Package mindustry.type
Class UnitType
java.lang.Object
mindustry.ctype.Content
mindustry.ctype.MappableContent
mindustry.ctype.UnlockableContent
mindustry.type.UnitType
- All Implemented Interfaces:
Comparable<Content>,Senseable
- Direct Known Subclasses:
ErekirUnitType,MissileUnitType,NeoplasmUnitType
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from class mindustry.ctype.Content
Content.ModContentInfo -
Field Summary
FieldsModifier and TypeFieldDescriptionarc.struct.Seq<Ability>list of "abilities", which are various behaviors that update each framefloatmovement speed (world units/t)arc.func.Prov<? extends UnitController>The default AI controller to assign on creation.floatmovement speed (world units/t)booleanA value of false is used to hide command changing UI in unit factories.booleanif true, this unit counts as an enemy in the wave counter (usually false for support-only units)booleanif true, this unit counts as an enemy in the wave counter (usually false for support-only units)booleanif true, this unit counts as an enemy in the wave counter (usually false for support-only units)booleanif true, this unit counts as an enemy in the wave counter (usually false for support-only units)intamount of ammo this unit can hold (if the rule is enabled); <0 to determine based on weapon fire rate.ammo this unit uses, if that system is enabled.floatmovement speed (world units/t)booleanif true, this unit counts as an enemy in the wave counter (usually false for support-only units)booleanif true, this unit counts as an enemy in the wave counter (usually false for support-only units)arc.graphics.g2d.TextureRegionfloattotal length of a leg (both segments)arc.graphics.g2d.TextureRegionfloatmovement speed (world units/t)floatmovement speed (world units/t)booleanif true, this unit counts as an enemy in the wave counter (usually false for support-only units)booleanif true, this unit counts as an enemy in the wave counter (usually false for support-only units)booleanif true, this unit counts as an enemy in the wave counter (usually false for support-only units)floatmovement speed (world units/t)floatmovement speed (world units/t)floatmovement speed (world units/t)protected floatprotected ItemStack[]booleanif true, this unit counts as an enemy in the wave counter (usually false for support-only units)booleanif true, this unit counts as an enemy in the wave counter (usually false for support-only units)booleanif true, this unit counts as an enemy in the wave counter (usually false for support-only units)booleanif true, this unit counts as an enemy in the wave counter (usually false for support-only units)arc.graphics.g2d.TextureRegionbooleanif true, this unit counts as an enemy in the wave counter (usually false for support-only units)floatmovement speed (world units/t)arc.struct.Seq<UnitCommand>Commands available to this unit through RTS controls.arc.func.Prov<? extends mindustry.gen.Unit>Creates a new instance of this unit class.arc.func.Func<mindustry.gen.Unit,? extends UnitController> Function that chooses AI controller based on unit entity.booleanif true, this unit counts as an enemy in the wave counter (usually false for support-only units)booleanif true, this unit counts as an enemy in the wave counter (usually false for support-only units)floatmovement speed (world units/t)floatmagnitude of sine offset between segmentsfloatmagnitude of sine offset between segmentsbooleanif true, this unit counts as an enemy in the wave counter (usually false for support-only units)booleanif true, this unit counts as an enemy in the wave counter (usually false for support-only units)floatmagnitude of sine offset between segmentseffect created when this unit diesfloatmovement speed (world units/t)arc.audio.Soundsound played when this unit explodes (*not* when it is shot down)Command to assign to this unit upon creation.floatmovement speed (world units/t)floatmovement speed (world units/t)booleanif true, this unit counts as an enemy in the wave counter (usually false for support-only units)booleanif true, this unit counts as an enemy in the wave counter (usually false for support-only units)booleanif true, this unit counts as an enemy in the wave counter (usually false for support-only units)booleanif true, this unit counts as an enemy in the wave counter (usually false for support-only units)booleanif true, this unit counts as an enemy in the wave counter (usually false for support-only units)booleanif true, this unit counts as an enemy in the wave counter (usually false for support-only units)booleanif true, this unit counts as an enemy in the wave counter (usually false for support-only units)booleanif true, this unit counts as an enemy in the wave counter (usually false for support-only units)floatmovement speed (world units/t)booleanWhether to emit a splashing effect in water (fasle implies emitWalkSound false).booleanWhether to emit a splashing noise in water.arc.graphics.Coloroverride for all engine colorsarc.graphics.Colorcolor for inner portions of enginesfloatmovement speed (world units/t)floatmovement speed (world units/t)arc.struct.Seq<UnitType.UnitEngine>list of engines, or "thrusters"floatmovement speed (world units/t)intThe environment flags that this unit *cannot* function in.intThe environment flags that this unit can function in.intEnvironmental flags that are *all* required for this unit to function.booleanif true, this unit counts as an enemy in the wave counter (usually false for support-only units)effect that this unit emits when fallingeffect created at engine when unit falls.floatmovement speed (world units/t)protected ItemStack[]booleanTODO neither of these appear to do muchbooleanTODO neither of these appear to do muchfloathow affected this unit is by terrainintCost type ID for flow field/enemy AI pathfinding.booleanif true, this unit counts as an enemy in the wave counter (usually false for support-only units)floatmovement speed (world units/t)floatmovement speed (world units/t)arc.graphics.g2d.TextureRegionbooleanif true, this unit counts as an enemy in the wave counter (usually false for support-only units)booleanif true, this unit counts as an enemy in the wave counter (usually false for support-only units)floatmovement speed (world units/t)arc.graphics.Colorcolor that this unit flashes when getting healed (if healFlash is true)booleanif true, this unit counts as an enemy in the wave counter (usually false for support-only units)floatmovement speed (world units/t)booleanif true, this unit counts as an enemy in the wave counter (usually false for support-only units)floatmovement speed (world units/t)booleanif true, this unit counts as an enemy in the wave counter (usually false for support-only units)floatticks that must pass before this missile starts homing.booleanif true, this unit counts as an enemy in the wave counter (usually false for support-only units)booleanif true, this unit counts as an enemy in the wave counter (usually false for support-only units)arc.struct.ObjectSet<StatusEffect>None of the status effects in this set can be applied to this unit.booleanif true, this unit counts as an enemy in the wave counter (usually false for support-only units)booleanif true, this unit counts as an enemy in the wave counter (usually false for support-only units)booleanif true, this unit counts as an enemy in the wave counter (usually false for support-only units)intamount of items this unit can carry; <0 to determine based on hitSize.arc.graphics.g2d.TextureRegionfloatmovement speed (world units/t)arc.graphics.g2d.TextureRegionbooleanif true, this unit counts as an enemy in the wave counter (usually false for support-only units)floattotal length of a leg (both segments)arc.graphics.g2d.TextureRegionbooleanIf true, the base (further away) leg region is drawn under instead of over.booleanIf true, legs always try to move around even when the unit is not moving (leads to more natural behavior)intnumber of legs this unit has (must have the correct type to function!)floattotal length of a leg (both segments)floattotal length of a leg (both segments)intsize of groups in which legs move.floattotal length of a leg (both segments)floattotal length of a leg (both segments)floattotal length of a leg (both segments)floattotal length of a leg (both segments)floattotal length of a leg (both segments)floattotal length of a leg (both segments)booleanif true, this unit counts as an enemy in the wave counter (usually false for support-only units)arc.graphics.g2d.TextureRegionfloattotal length of a leg (both segments)floattotal length of a leg (both segments)floattotal length of a leg (both segments)floattotal length of a leg (both segments)floattotal length of a leg (both segments)floatlifetime of this missile.arc.graphics.ColorColor of light that this unit produces when lighting is enabled in the map.floatmovement speed (world units/t)floatmovement speed (world units/t)booleanIf true, legs are locked to the base of the unit instead of being on an implicit rotating "mount".booleanif true, this unit counts as an enemy in the wave counter (usually false for support-only units)arc.audio.Soundsound played on loop when this unit is around.floatvolume of loop soundbooleanif true, this unit counts as an enemy in the wave counter (usually false for support-only units)floatmovement speed (world units/t)floatparameters for mech swaying animationfloatscreen shake amount for when this mech lands after boostingarc.graphics.Colorcolor that legs change to when moving, to simulate depthfloatparameters for mech swaying animationbooleanwhether particles are created when this mech takes a stepfloatparameters for mech swaying animationfloatmovement speed (world units/t)booleanwhether this unit can mine ores from floors/walls, respectivelybooleanif true, harder materials will take longer to minearc.struct.Seq<Item>Target items to mine.arc.graphics.g2d.TextureRegionarc.graphics.g2d.TextureRegionfloatmovement speed (world units/t)arc.audio.Soundcontinuous sound emitted when mining.floatvolume of mining sound.floatmining speed in weird arbitrary unitsintmax hardness of ore that this unit can mine (<0 to disable)booleanwhether this unit can mine ores from floors/walls, respectivelyfloatmovement speed (world units/t)booleanif true, this unit counts as an enemy in the wave counter (usually false for support-only units)booleanif true, this unit counts as an enemy in the wave counter (usually false for support-only units)arc.graphics.Colorcolor for outline generated around spritesintthickness for sprite outlinearc.graphics.g2d.TextureRegionbooleanif false, no sprite outlines are generatedarc.struct.Seq<DrawPart>extra (usually animated) visual partsFunction used for calculating cost of moving with ControlPathfinder.intID for path cost, to be used in the control path finder.floatmovement speed (world units/t)booleanif true, this unit counts as an enemy in the wave counter (usually false for support-only units)booleanif true, this unit counts as an enemy in the wave counter (usually false for support-only units)booleanif true, this unit counts as an enemy in the wave counter (usually false for support-only units)arc.graphics.g2d.TextureRegionfloatmovement speed (world units/t)arc.graphics.g2d.TextureRegionfloatmovement speed (world units/t)floatmovement speed (world units/t)floatmovement speed (world units/t)booleanif true, this unit counts as an enemy in the wave counter (usually false for support-only units)floatmovement speed (world units/t)booleanif true, this unit counts as an enemy in the wave counter (usually false for support-only units)mindustry.gen.UnitA sample of the unit that this type creates.arc.graphics.g2d.TextureRegion[]unit spawned at the end; if null, the segment unit is usedbooleantrue - parent segments are on higher layers; false - parent segments are on lower layers than headfloatmagnitude of sine offset between segmentsfloatmagnitude of sine offset between segmentsarc.graphics.g2d.TextureRegion[]floatmagnitude of sine offset between segmentsarc.graphics.g2d.TextureRegion[]floatmagnitude of sine offset between segmentsfloatmagnitude of sine offset between segmentsintnumber of independent segmentsfloatmagnitude of sine offset between segmentsfloatmagnitude of sine offset between segmentsunit spawned in segments; if null, the same unit is usedintTODO wave support - for multi-unit segmented units, this is the number of independent units that are spawnedfloatmovement speed (world units/t)floatmovement speed (world units/t)arc.graphics.g2d.TextureRegionstatic final floatstatic final floatarc.graphics.Coloroverride for unit shield colour.booleanif true, this unit counts as an enemy in the wave counter (usually false for support-only units)arc.graphics.g2d.TextureRegionfloatmovement speed (world units/t)floatmovement speed (world units/t)booleanif true, this unit counts as an enemy in the wave counter (usually false for support-only units)arc.struct.Seq<UnitStance>Stances this unit can have.floatmovement speed (world units/t)floatmovement speed (world units/t)booleanif true, this unit counts as an enemy in the wave counter (usually false for support-only units)booleanif true, this unit counts as an enemy in the wave counter (usually false for support-only units)booleanif true, this unit counts as an enemy in the wave counter (usually false for support-only units)Flags to target based on priority.booleanif true, this unit counts as an enemy in the wave counter (usually false for support-only units)floatmovement speed (world units/t)booleanif true, this unit counts as an enemy in the wave counter (usually false for support-only units)protected ItemStack[]arc.graphics.Coloroverride for engine trail colorintlength of engine trail (if flying) or wave trail (if naval)floatmovement speed (world units/t)optional effect created when this tank movesintnumber of frames of movement in a treadinthow much of a top part of a tread sprite is "cut off" relative to the pattern; this is corrected forarc.math.geom.Rect[]list of treads as rectangles in IMAGE COORDINATES, relative to the center.arc.graphics.g2d.TextureRegionarc.graphics.g2d.TextureRegion[][]booleanif false, the thruster is always displayed at its normal size regardless of elevationbooleanif true, this unit counts as an enemy in the wave counter (usually false for support-only units)booleanif true, this unit counts as an enemy in the wave counter (usually false for support-only units)floatmovement speed (world units/t)floatmovement speed (world units/t)arc.struct.Seq<Weapon>All weapons that this unit will shoot with.booleanif true, this unit counts as an enemy in the wave counter (usually false for support-only units)floatmovement speed (world units/t)arc.graphics.g2d.TextureRegion[]Fields inherited from class mindustry.ctype.UnlockableContent
allDatabaseTabs, alwaysUnlocked, databaseTabs, description, details, fullIcon, fullOverride, generateIcons, hideDatabase, hideDetails, inlineDescription, localizedName, selectionSize, shownPlanets, stats, techNode, techNodes, uiIcon, unlockedFields inherited from class mindustry.ctype.MappableContent
name -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanallowCommand(mindustry.gen.Unit unit, UnitCommand command) booleanallowStance(mindustry.gen.Unit unit, UnitStance stance) voidapplyColor(mindustry.gen.Unit unit) voidapplyOutlineColor(mindustry.gen.Unit unit) arc.graphics.ColorcellColor(mindustry.gen.Unit unit) protected voidcheckEntityMapping(mindustry.gen.Unit example) mindustry.gen.UnitcreateController(mindustry.gen.Unit unit) voidcreateIcons(MultiPacker packer) Generate any special icons for this content.voiddisplay(mindustry.gen.Unit unit, arc.scene.ui.layout.Table table) voiddraw(mindustry.gen.Unit unit) voiddrawBody(mindustry.gen.Unit unit) voiddrawCell(mindustry.gen.Unit unit) voiddrawCrawl(mindustry.gen.Crawlc crawl) voiddrawEngines(mindustry.gen.Unit unit) voiddrawItems(mindustry.gen.Unit unit) <T extends mindustry.gen.Unit & mindustry.gen.Legsc>
voiddrawLegs(T unit) voiddrawLight(mindustry.gen.Unit unit) voiddrawMech(mindustry.gen.Mechc mech) voiddrawMining(mindustry.gen.Unit unit) voiddrawMiningBeam(mindustry.gen.Unit unit, float px, float py) voiddrawOutline(mindustry.gen.Unit unit) <T extends mindustry.gen.Unit & mindustry.gen.Payloadc>
voiddrawPayload(T unit) voiddrawShadow(mindustry.gen.Unit unit) voiddrawShield(mindustry.gen.Unit unit) voiddrawSoftShadow(float x, float y, float rotation, float alpha) voiddrawSoftShadow(mindustry.gen.Unit unit) voiddrawSoftShadow(mindustry.gen.Unit unit, float alpha) <T extends mindustry.gen.Unit & mindustry.gen.Tankc>
voiddrawTank(T unit) voiddrawTrail(mindustry.gen.Unit unit) voiddrawWeaponOutlines(mindustry.gen.Unit unit) voiddrawWeapons(mindustry.gen.Unit unit) floatfloatReturns the type name of this piece of content.voidgetDependencies(arc.func.Cons<UnlockableContent> cons) Iterates through any implicit dependencies of this content.voidgetRegionsToOutline(arc.struct.Seq<arc.graphics.g2d.TextureRegion> out) getRequirements(UnitType[] prevReturn, float[] timeReturn) voidgetUnitStances(mindustry.gen.Unit unit, arc.struct.Seq<UnitStance> out) Adds all available unit stances based on the unit's current state.booleanbooleanhittable(mindustry.gen.Unit unit) voidinit()Called after all content and modules are created.booleanisBanned()booleanisHidden()Whether this content is always hidden in the content database dialog.booleankillable(mindustry.gen.Unit unit) voidkilled(mindustry.gen.Unit unit) voidlanded(mindustry.gen.Unit unit) voidload()Called after all content is created, only on non-headless versions.booleandoublesenseObject(LAccess sensor) voidsetEnginesMirror(UnitType.UnitEngine... array) Sets up engines, mirroring the contents of the specified array.voidsetStats()Initializes stats on demand.arc.graphics.ColorshieldColor(mindustry.gen.Unit unit) mindustry.gen.Unitspawn(float x, float y) mindustry.gen.Unitspawn(arc.math.geom.Position pos) mindustry.gen.Unitmindustry.gen.Unitmindustry.gen.Unitmindustry.gen.Unitmindustry.gen.UnitbooleansupportsEnv(int env) booleantargetable(mindustry.gen.Unit unit, Team targeter) voidupdate(mindustry.gen.Unit unit) voidupdatePayload(mindustry.gen.Unit unit, mindustry.gen.Unit unitHolder, mindustry.gen.Building buildingHolder) Methods inherited from class mindustry.ctype.UnlockableContent
checkStats, clearUnlock, displayDescription, displayExtra, emoji, emojiChar, getLogicId, hasEmoji, isOnPlanet, loadIcon, locked, logicVisible, makeOutline, makeOutline, makeOutline, onUnlock, postInit, quietUnlock, showUnlock, unlock, unlocked, unlockedHost, unlockedNow, unlockedNowHostMethods inherited from class mindustry.ctype.MappableContent
toStringMethods inherited from class mindustry.ctype.Content
compareTo, hasErrored, isModded, isVanilla
-
Field Details
-
shadowTX
public static final float shadowTX- See Also:
-
shadowTY
public static final float shadowTY- See Also:
-
envRequired
public int envRequiredEnvironmental flags that are *all* required for this unit to function. 0 = any environment -
envEnabled
public int envEnabledThe environment flags that this unit can function in. If the env matches any of these, it will be enabled. -
envDisabled
public int envDisabledThe environment flags that this unit *cannot* function in. If the env matches any of these, it will explode or be disabled. -
speed
public float speedmovement speed (world units/t) -
boostMultiplier
public float boostMultipliermovement speed (world units/t) -
rotateSpeed
public float rotateSpeedmovement speed (world units/t) -
baseRotateSpeed
public float baseRotateSpeedmovement speed (world units/t) -
drag
public float dragmovement speed (world units/t) -
accel
public float accelmovement speed (world units/t) -
hitSize
public float hitSizemovement speed (world units/t) -
deathShake
public float deathShakemovement speed (world units/t) -
stepShake
public float stepShakemovement speed (world units/t) -
rippleScale
public float rippleScalemovement speed (world units/t) -
riseSpeed
public float riseSpeedmovement speed (world units/t) -
fallSpeed
public float fallSpeedmovement speed (world units/t) -
missileAccelTime
public float missileAccelTimemovement speed (world units/t) -
health
public float healthmovement speed (world units/t) -
armor
public float armormovement speed (world units/t) -
range
public float rangemovement speed (world units/t) -
maxRange
public float maxRangemovement speed (world units/t) -
mineRange
public float mineRangemovement speed (world units/t) -
buildRange
public float buildRangemovement speed (world units/t) -
crashDamageMultiplier
public float crashDamageMultipliermovement speed (world units/t) -
wreckHealthMultiplier
public float wreckHealthMultipliermovement speed (world units/t) -
dpsEstimate
public float dpsEstimatemovement speed (world units/t) -
clipSize
public float clipSizemovement speed (world units/t) -
drownTimeMultiplier
public float drownTimeMultipliermovement speed (world units/t) -
strafePenalty
public float strafePenaltymovement speed (world units/t) -
researchCostMultiplier
public float researchCostMultipliermovement speed (world units/t) -
groundLayer
public float groundLayermovement speed (world units/t) -
flyingLayer
public float flyingLayermovement speed (world units/t) -
payloadCapacity
public float payloadCapacitymovement speed (world units/t) -
buildSpeed
public float buildSpeedmovement speed (world units/t) -
aimDst
public float aimDstmovement speed (world units/t) -
buildBeamOffset
public float buildBeamOffsetmovement speed (world units/t) -
mineBeamOffset
public float mineBeamOffsetmovement speed (world units/t) -
targetPriority
public float targetPrioritymovement speed (world units/t) -
shadowElevation
public float shadowElevationmovement speed (world units/t) -
shadowElevationScl
public float shadowElevationSclmovement speed (world units/t) -
engineOffset
public float engineOffsetmovement speed (world units/t) -
engineSize
public float engineSizemovement speed (world units/t) -
engineLayer
public float engineLayermovement speed (world units/t) -
itemOffsetY
public float itemOffsetYmovement speed (world units/t) -
lightRadius
public float lightRadiusmovement speed (world units/t) -
lightOpacity
public float lightOpacitymovement speed (world units/t) -
softShadowScl
public float softShadowSclmovement speed (world units/t) -
fogRadius
public float fogRadiusmovement speed (world units/t) -
waveTrailX
public float waveTrailXmovement speed (world units/t) -
waveTrailY
public float waveTrailYmovement speed (world units/t) -
trailScl
public float trailSclmovement speed (world units/t) -
isEnemy
public boolean isEnemyif true, this unit counts as an enemy in the wave counter (usually false for support-only units) -
flying
public boolean flyingif true, this unit counts as an enemy in the wave counter (usually false for support-only units) -
wobble
public boolean wobbleif true, this unit counts as an enemy in the wave counter (usually false for support-only units) -
targetAir
public boolean targetAirif true, this unit counts as an enemy in the wave counter (usually false for support-only units) -
targetGround
public boolean targetGroundif true, this unit counts as an enemy in the wave counter (usually false for support-only units) -
faceTarget
public boolean faceTargetif true, this unit counts as an enemy in the wave counter (usually false for support-only units) -
circleTarget
public boolean circleTargetif true, this unit counts as an enemy in the wave counter (usually false for support-only units) -
autoDropBombs
public boolean autoDropBombsif true, this unit counts as an enemy in the wave counter (usually false for support-only units) -
targetBuildingsMobile
public boolean targetBuildingsMobileif true, this unit counts as an enemy in the wave counter (usually false for support-only units) -
canBoost
public boolean canBoostif true, this unit counts as an enemy in the wave counter (usually false for support-only units) -
boostWhenBuilding
public boolean boostWhenBuildingif true, this unit counts as an enemy in the wave counter (usually false for support-only units) -
boostWhenMining
public boolean boostWhenMiningif true, this unit counts as an enemy in the wave counter (usually false for support-only units) -
logicControllable
public boolean logicControllableif true, this unit counts as an enemy in the wave counter (usually false for support-only units) -
playerControllable
public boolean playerControllableif true, this unit counts as an enemy in the wave counter (usually false for support-only units) -
controlSelectGlobal
public boolean controlSelectGlobalif true, this unit counts as an enemy in the wave counter (usually false for support-only units) -
allowedInPayloads
public boolean allowedInPayloadsif true, this unit counts as an enemy in the wave counter (usually false for support-only units) -
hittable
public boolean hittableif true, this unit counts as an enemy in the wave counter (usually false for support-only units) -
killable
public boolean killableif true, this unit counts as an enemy in the wave counter (usually false for support-only units) -
targetable
public boolean targetableif true, this unit counts as an enemy in the wave counter (usually false for support-only units) -
vulnerableWithPayloads
public boolean vulnerableWithPayloadsif true, this unit counts as an enemy in the wave counter (usually false for support-only units) -
pickupUnits
public boolean pickupUnitsif true, this unit counts as an enemy in the wave counter (usually false for support-only units) -
physics
public boolean physicsif true, this unit counts as an enemy in the wave counter (usually false for support-only units) -
canDrown
public boolean canDrownif true, this unit counts as an enemy in the wave counter (usually false for support-only units) -
useUnitCap
public boolean useUnitCapif true, this unit counts as an enemy in the wave counter (usually false for support-only units) -
coreUnitDock
public boolean coreUnitDockif true, this unit counts as an enemy in the wave counter (usually false for support-only units) -
createWreck
public boolean createWreckif true, this unit counts as an enemy in the wave counter (usually false for support-only units) -
createScorch
public boolean createScorchif true, this unit counts as an enemy in the wave counter (usually false for support-only units) -
lowAltitude
public boolean lowAltitudeif true, this unit counts as an enemy in the wave counter (usually false for support-only units) -
rotateToBuilding
public boolean rotateToBuildingif true, this unit counts as an enemy in the wave counter (usually false for support-only units) -
allowLegStep
public boolean allowLegStepif true, this unit counts as an enemy in the wave counter (usually false for support-only units) -
legPhysicsLayer
public boolean legPhysicsLayerif true, this unit counts as an enemy in the wave counter (usually false for support-only units) -
hovering
public boolean hoveringif true, this unit counts as an enemy in the wave counter (usually false for support-only units) -
omniMovement
public boolean omniMovementif true, this unit counts as an enemy in the wave counter (usually false for support-only units) -
rotateMoveFirst
public boolean rotateMoveFirstif true, this unit counts as an enemy in the wave counter (usually false for support-only units) -
healFlash
public boolean healFlashif true, this unit counts as an enemy in the wave counter (usually false for support-only units) -
canHeal
public boolean canHealif true, this unit counts as an enemy in the wave counter (usually false for support-only units) -
singleTarget
public boolean singleTargetif true, this unit counts as an enemy in the wave counter (usually false for support-only units) -
forceMultiTarget
public boolean forceMultiTargetif true, this unit counts as an enemy in the wave counter (usually false for support-only units) -
canAttack
public boolean canAttackif true, this unit counts as an enemy in the wave counter (usually false for support-only units) -
internal
public boolean internalif true, this unit counts as an enemy in the wave counter (usually false for support-only units) -
internalGenerateSprites
public boolean internalGenerateSpritesif true, this unit counts as an enemy in the wave counter (usually false for support-only units) -
bounded
public boolean boundedif true, this unit counts as an enemy in the wave counter (usually false for support-only units) -
autoFindTarget
public boolean autoFindTargetif true, this unit counts as an enemy in the wave counter (usually false for support-only units) -
targetUnderBlocks
public boolean targetUnderBlocksif true, this unit counts as an enemy in the wave counter (usually false for support-only units) -
alwaysShootWhenMoving
public boolean alwaysShootWhenMovingif true, this unit counts as an enemy in the wave counter (usually false for support-only units) -
hoverable
public boolean hoverableif true, this unit counts as an enemy in the wave counter (usually false for support-only units) -
alwaysCreateOutline
public boolean alwaysCreateOutlineif true, this unit counts as an enemy in the wave counter (usually false for support-only units) -
generateFullIcon
public boolean generateFullIconif true, this unit counts as an enemy in the wave counter (usually false for support-only units) -
squareShape
public boolean squareShapeif true, this unit counts as an enemy in the wave counter (usually false for support-only units) -
drawBuildBeam
public boolean drawBuildBeamif true, this unit counts as an enemy in the wave counter (usually false for support-only units) -
drawMineBeam
public boolean drawMineBeamif true, this unit counts as an enemy in the wave counter (usually false for support-only units) -
drawCell
public boolean drawCellif true, this unit counts as an enemy in the wave counter (usually false for support-only units) -
drawItems
public boolean drawItemsif true, this unit counts as an enemy in the wave counter (usually false for support-only units) -
drawShields
public boolean drawShieldsif true, this unit counts as an enemy in the wave counter (usually false for support-only units) -
drawBody
public boolean drawBodyif true, this unit counts as an enemy in the wave counter (usually false for support-only units) -
drawSoftShadow
public boolean drawSoftShadowif true, this unit counts as an enemy in the wave counter (usually false for support-only units) -
drawMinimap
public boolean drawMinimapif true, this unit counts as an enemy in the wave counter (usually false for support-only units) -
aiController
The default AI controller to assign on creation. -
controller
Function that chooses AI controller based on unit entity. -
constructor
public arc.func.Prov<? extends mindustry.gen.Unit> constructorCreates a new instance of this unit class. -
abilities
list of "abilities", which are various behaviors that update each frame -
weapons
All weapons that this unit will shoot with. -
immunities
None of the status effects in this set can be applied to this unit. -
healColor
public arc.graphics.Color healColorcolor that this unit flashes when getting healed (if healFlash is true) -
lightColor
public arc.graphics.Color lightColorColor of light that this unit produces when lighting is enabled in the map. -
shieldColor
@Nullable public arc.graphics.Color shieldColoroverride for unit shield colour. -
deathSound
public arc.audio.Sound deathSoundsound played when this unit explodes (*not* when it is shot down) -
loopSound
public arc.audio.Sound loopSoundsound played on loop when this unit is around. -
loopSoundVolume
public float loopSoundVolumevolume of loop sound -
fallEffect
effect that this unit emits when falling -
fallEngineEffect
effect created at engine when unit falls. -
deathExplosionEffect
effect created when this unit dies -
treadEffect
optional effect created when this tank moves -
parts
extra (usually animated) visual parts -
engines
list of engines, or "thrusters" -
useEngineElevation
public boolean useEngineElevationif false, the thruster is always displayed at its normal size regardless of elevation -
engineColor
@Nullable public arc.graphics.Color engineColoroverride for all engine colors -
engineColorInner
public arc.graphics.Color engineColorInnercolor for inner portions of engines -
trailLength
public int trailLengthlength of engine trail (if flying) or wave trail (if naval) -
trailColor
@Nullable public arc.graphics.Color trailColoroverride for engine trail color -
flowfieldPathType
public int flowfieldPathTypeCost type ID for flow field/enemy AI pathfinding. -
pathCost
Function used for calculating cost of moving with ControlPathfinder. Does not affect "normal" flow field pathfinding. -
pathCostId
public int pathCostIdID for path cost, to be used in the control path finder. This is the value that actually matters; do not assign manually. Set in init(). -
sample
@Nullable public mindustry.gen.Unit sampleA sample of the unit that this type creates. Do not modify! -
targetFlags
Flags to target based on priority. Null indicates that the closest target should be found. The closest enemy core is used as a fallback. -
allowChangeCommands
public boolean allowChangeCommandsA value of false is used to hide command changing UI in unit factories. -
commands
Commands available to this unit through RTS controls. An empty array means commands will be assigned based on unit capabilities in init(). -
defaultCommand
Command to assign to this unit upon creation. Null indicates the first command in the array. -
stances
Stances this unit can have. An empty array means stances will be assigned based on unit capabilities in init(). -
outlineColor
public arc.graphics.Color outlineColorcolor for outline generated around sprites -
outlineRadius
public int outlineRadiusthickness for sprite outline -
outlines
public boolean outlinesif false, no sprite outlines are generated -
itemCapacity
public int itemCapacityamount of items this unit can carry; <0 to determine based on hitSize. -
ammoCapacity
public int ammoCapacityamount of ammo this unit can hold (if the rule is enabled); <0 to determine based on weapon fire rate. -
ammoType
ammo this unit uses, if that system is enabled. -
mineTier
public int mineTiermax hardness of ore that this unit can mine (<0 to disable) -
mineSpeed
public float mineSpeedmining speed in weird arbitrary units -
mineWalls
public boolean mineWallswhether this unit can mine ores from floors/walls, respectively -
mineFloor
public boolean mineFloorwhether this unit can mine ores from floors/walls, respectively -
mineHardnessScaling
public boolean mineHardnessScalingif true, harder materials will take longer to mine -
mineSound
public arc.audio.Sound mineSoundcontinuous sound emitted when mining. -
mineSoundVolume
public float mineSoundVolumevolume of mining sound. -
mineItems
Target items to mine. Used in MinerAI -
legCount
public int legCountnumber of legs this unit has (must have the correct type to function!) -
legGroupSize
public int legGroupSizesize of groups in which legs move. for example, insects (6 legs) usually move legs in groups of 3. -
legLength
public float legLengthtotal length of a leg (both segments) -
legSpeed
public float legSpeedtotal length of a leg (both segments) -
legForwardScl
public float legForwardScltotal length of a leg (both segments) -
legBaseOffset
public float legBaseOffsettotal length of a leg (both segments) -
legMoveSpace
public float legMoveSpacetotal length of a leg (both segments) -
legExtension
public float legExtensiontotal length of a leg (both segments) -
legPairOffset
public float legPairOffsettotal length of a leg (both segments) -
legLengthScl
public float legLengthScltotal length of a leg (both segments) -
legStraightLength
public float legStraightLengthtotal length of a leg (both segments) -
legMaxLength
public float legMaxLengthtotal length of a leg (both segments) -
legMinLength
public float legMinLengthtotal length of a leg (both segments) -
legSplashDamage
public float legSplashDamagetotal length of a leg (both segments) -
legSplashRange
public float legSplashRangetotal length of a leg (both segments) -
baseLegStraightness
public float baseLegStraightnesstotal length of a leg (both segments) -
legStraightness
public float legStraightnesstotal length of a leg (both segments) -
legBaseUnder
public boolean legBaseUnderIf true, the base (further away) leg region is drawn under instead of over. -
lockLegBase
public boolean lockLegBaseIf true, legs are locked to the base of the unit instead of being on an implicit rotating "mount". -
legContinuousMove
public boolean legContinuousMoveIf true, legs always try to move around even when the unit is not moving (leads to more natural behavior) -
flipBackLegs
public boolean flipBackLegsTODO neither of these appear to do much -
flipLegSide
public boolean flipLegSideTODO neither of these appear to do much -
emitWalkSound
public boolean emitWalkSoundWhether to emit a splashing noise in water. -
emitWalkEffect
public boolean emitWalkEffectWhether to emit a splashing effect in water (fasle implies emitWalkSound false). -
mechLandShake
public float mechLandShakescreen shake amount for when this mech lands after boosting -
mechSideSway
public float mechSideSwayparameters for mech swaying animation -
mechFrontSway
public float mechFrontSwayparameters for mech swaying animation -
mechStride
public float mechStrideparameters for mech swaying animation -
mechStepParticles
public boolean mechStepParticleswhether particles are created when this mech takes a step -
mechLegColor
public arc.graphics.Color mechLegColorcolor that legs change to when moving, to simulate depth -
treadRects
public arc.math.geom.Rect[] treadRectslist of treads as rectangles in IMAGE COORDINATES, relative to the center. these are mirrored. -
treadFrames
public int treadFramesnumber of frames of movement in a tread -
treadPullOffset
public int treadPullOffsethow much of a top part of a tread sprite is "cut off" relative to the pattern; this is corrected for -
floorMultiplier
public float floorMultiplierhow affected this unit is by terrain -
segments
public int segmentsnumber of independent segments -
segmentUnits
public int segmentUnitsTODO wave support - for multi-unit segmented units, this is the number of independent units that are spawned -
segmentUnit
unit spawned in segments; if null, the same unit is used -
segmentEndUnit
unit spawned at the end; if null, the segment unit is used -
segmentLayerOrder
public boolean segmentLayerOrdertrue - parent segments are on higher layers; false - parent segments are on lower layers than head -
segmentMag
public float segmentMagmagnitude of sine offset between segments -
segmentScl
public float segmentSclmagnitude of sine offset between segments -
segmentPhase
public float segmentPhasemagnitude of sine offset between segments -
segmentRotSpeed
public float segmentRotSpeedmagnitude of sine offset between segments -
segmentMaxRot
public float segmentMaxRotmagnitude of sine offset between segments -
segmentSpacing
public float segmentSpacingmagnitude of sine offset between segments -
segmentRotationRange
public float segmentRotationRangemagnitude of sine offset between segments -
crawlSlowdown
public float crawlSlowdownmagnitude of sine offset between segments -
crushDamage
public float crushDamagemagnitude of sine offset between segments -
crawlSlowdownFrac
public float crawlSlowdownFracmagnitude of sine offset between segments -
lifetime
public float lifetimelifetime of this missile. -
homingDelay
public float homingDelayticks that must pass before this missile starts homing. -
baseRegion
public arc.graphics.g2d.TextureRegion baseRegion -
legRegion
public arc.graphics.g2d.TextureRegion legRegion -
region
public arc.graphics.g2d.TextureRegion region -
previewRegion
public arc.graphics.g2d.TextureRegion previewRegion -
shadowRegion
public arc.graphics.g2d.TextureRegion shadowRegion -
cellRegion
public arc.graphics.g2d.TextureRegion cellRegion -
itemCircleRegion
public arc.graphics.g2d.TextureRegion itemCircleRegion -
softShadowRegion
public arc.graphics.g2d.TextureRegion softShadowRegion -
jointRegion
public arc.graphics.g2d.TextureRegion jointRegion -
footRegion
public arc.graphics.g2d.TextureRegion footRegion -
legBaseRegion
public arc.graphics.g2d.TextureRegion legBaseRegion -
baseJointRegion
public arc.graphics.g2d.TextureRegion baseJointRegion -
outlineRegion
public arc.graphics.g2d.TextureRegion outlineRegion -
treadRegion
public arc.graphics.g2d.TextureRegion treadRegion -
mineLaserRegion
public arc.graphics.g2d.TextureRegion mineLaserRegion -
mineLaserEndRegion
public arc.graphics.g2d.TextureRegion mineLaserEndRegion -
wreckRegions
public arc.graphics.g2d.TextureRegion[] wreckRegions -
segmentRegions
public arc.graphics.g2d.TextureRegion[] segmentRegions -
segmentCellRegions
public arc.graphics.g2d.TextureRegion[] segmentCellRegions -
segmentOutlineRegions
public arc.graphics.g2d.TextureRegion[] segmentOutlineRegions -
treadRegions
public arc.graphics.g2d.TextureRegion[][] treadRegions -
buildTime
protected float buildTime -
totalRequirements
-
cachedRequirements
-
firstRequirements
-
-
Constructor Details
-
UnitType
-
-
Method Details
-
createController
-
create
-
spawn
public mindustry.gen.Unit spawn(Team team, float x, float y, float rotation, @Nullable arc.func.Cons<mindustry.gen.Unit> cons) - Parameters:
cons- Callback that gets called with every unit that is spawned. This is used for multi-unit segmented units.
-
spawn
-
spawn
-
spawn
public mindustry.gen.Unit spawn(float x, float y) -
spawn
-
spawn
public mindustry.gen.Unit spawn(arc.math.geom.Position pos) -
spawn
-
hasWeapons
public boolean hasWeapons() -
targetable
-
killable
public boolean killable(mindustry.gen.Unit unit) -
hittable
public boolean hittable(mindustry.gen.Unit unit) -
getUnitStances
Adds all available unit stances based on the unit's current state. This can change based on the command of the unit. -
allowStance
-
allowCommand
-
update
public void update(mindustry.gen.Unit unit) -
updatePayload
public void updatePayload(mindustry.gen.Unit unit, @Nullable mindustry.gen.Unit unitHolder, @Nullable mindustry.gen.Building buildingHolder) -
killed
public void killed(mindustry.gen.Unit unit) -
landed
public void landed(mindustry.gen.Unit unit) -
display
public void display(mindustry.gen.Unit unit, arc.scene.ui.layout.Table table) -
supportsEnv
public boolean supportsEnv(int env) - Returns:
- whether this block supports a specific environment.
-
isBanned
public boolean isBanned()- Overrides:
isBannedin classUnlockableContent
-
getDependencies
Description copied from class:UnlockableContentIterates through any implicit dependencies of this content. For blocks, this would be the items required to build it.- Overrides:
getDependenciesin classUnlockableContent
-
isHidden
public boolean isHidden()Description copied from class:UnlockableContentWhether this content is always hidden in the content database dialog.- Overrides:
isHiddenin classUnlockableContent
-
setStats
public void setStats()Description copied from class:UnlockableContentInitializes stats on demand. Should only be called once. Only called before something is displayed.- Overrides:
setStatsin classUnlockableContent
-
checkEntityMapping
protected void checkEntityMapping(mindustry.gen.Unit example) -
init
public void init()Description copied from class:ContentCalled after all content and modules are created. Do not use to load regions or texture data! -
estimateDps
public float estimateDps() -
load
public void load()Description copied from class:ContentCalled after all content is created, only on non-headless versions. Use for loading regions or other image data. -
getRegionsToOutline
public void getRegionsToOutline(arc.struct.Seq<arc.graphics.g2d.TextureRegion> out) -
needsBodyOutline
public boolean needsBodyOutline() -
createIcons
Description copied from class:UnlockableContentGenerate any special icons for this content. Called synchronously. No regions are loaded at this point; grab pixmaps from the packer.- Overrides:
createIconsin classUnlockableContent
-
getBuildTime
public float getBuildTime()- Returns:
- the time required to build this unit, as a value that takes into account reconstructors
-
getTotalRequirements
- Returns:
- all items needed to build this unit, including reconstructor steps.
-
getRequirements
@Nullable public ItemStack[] getRequirements(@Nullable UnitType[] prevReturn, @Nullable float[] timeReturn) - Returns:
- item requirements based on reconstructors or factories found; returns previous unit in array if provided
-
getFirstRequirements
-
researchRequirements
- Overrides:
researchRequirementsin classUnlockableContent- Returns:
- items needed to research this content
-
sense
-
senseObject
- Specified by:
senseObjectin interfaceSenseable
-
getContentType
Description copied from class:ContentReturns the type name of this piece of content. This should return the same value for all instances of this content type.- Specified by:
getContentTypein classContent
-
setEnginesMirror
Sets up engines, mirroring the contents of the specified array. -
draw
public void draw(mindustry.gen.Unit unit) -
shieldColor
public arc.graphics.Color shieldColor(mindustry.gen.Unit unit) -
drawMining
public void drawMining(mindustry.gen.Unit unit) -
drawMiningBeam
public void drawMiningBeam(mindustry.gen.Unit unit, float px, float py) -
drawPayload
public <T extends mindustry.gen.Unit & mindustry.gen.Payloadc> void drawPayload(T unit) -
drawShield
public void drawShield(mindustry.gen.Unit unit) -
drawShadow
public void drawShadow(mindustry.gen.Unit unit) -
drawSoftShadow
public void drawSoftShadow(mindustry.gen.Unit unit) -
drawSoftShadow
public void drawSoftShadow(mindustry.gen.Unit unit, float alpha) -
drawSoftShadow
public void drawSoftShadow(float x, float y, float rotation, float alpha) -
drawItems
public void drawItems(mindustry.gen.Unit unit) -
drawTrail
public void drawTrail(mindustry.gen.Unit unit) -
drawEngines
public void drawEngines(mindustry.gen.Unit unit) -
drawWeapons
public void drawWeapons(mindustry.gen.Unit unit) -
drawWeaponOutlines
public void drawWeaponOutlines(mindustry.gen.Unit unit) -
drawOutline
public void drawOutline(mindustry.gen.Unit unit) -
drawBody
public void drawBody(mindustry.gen.Unit unit) -
drawCell
public void drawCell(mindustry.gen.Unit unit) -
cellColor
public arc.graphics.Color cellColor(mindustry.gen.Unit unit) -
drawLight
public void drawLight(mindustry.gen.Unit unit) -
drawTank
public <T extends mindustry.gen.Unit & mindustry.gen.Tankc> void drawTank(T unit) -
drawLegs
public <T extends mindustry.gen.Unit & mindustry.gen.Legsc> void drawLegs(T unit) -
drawCrawl
public void drawCrawl(mindustry.gen.Crawlc crawl) -
drawMech
public void drawMech(mindustry.gen.Mechc mech) -
applyOutlineColor
public void applyOutlineColor(mindustry.gen.Unit unit) -
applyColor
public void applyColor(mindustry.gen.Unit unit)
-