Skip to content

UnitType

UnitType

extends UnlockableContent

field type default notes
envRequired int 0 Environmental flags that are all required for this unit to function. 0 = any environment
envEnabled int 1 The environment flags that this unit can function in. If the env matches any of these, it will be enabled.
envDisabled int 16 The environment flags that this unit cannot function in. If the env matches any of these, it will explode or be disabled.
speed float 1.1 movement speed (world units/t)
boostMultiplier float 1.0 movement speed (world units/t)
rotateSpeed float 5.0 movement speed (world units/t)
baseRotateSpeed float 5.0 movement speed (world units/t)
drag float 0.3 movement speed (world units/t)
accel float 0.5 movement speed (world units/t)
hitSize float 6.0 movement speed (world units/t)
stepShake float -1.0 movement speed (world units/t)
rippleScale float 1.0 movement speed (world units/t)
riseSpeed float 0.08 movement speed (world units/t)
fallSpeed float 0.018 movement speed (world units/t)
missileAccelTime float 0.0 movement speed (world units/t)
health float 200.0 movement speed (world units/t)
armor float 0.0 movement speed (world units/t)
range float -1.0 movement speed (world units/t)
maxRange float -1.0 movement speed (world units/t)
mineRange float 70.0 movement speed (world units/t)
buildRange float 220.0 movement speed (world units/t)
crashDamageMultiplier float 1.0 movement speed (world units/t)
dpsEstimate float -1.0 movement speed (world units/t)
clipSize float -1.0 movement speed (world units/t)
drownTimeMultiplier float 1.0 movement speed (world units/t)
strafePenalty float 0.5 movement speed (world units/t)
researchCostMultiplier float 50.0 movement speed (world units/t)
groundLayer float 60.0 movement speed (world units/t)
payloadCapacity float 8.0 movement speed (world units/t)
buildSpeed float -1.0 movement speed (world units/t)
aimDst float -1.0 movement speed (world units/t)
buildBeamOffset float 3.8 movement speed (world units/t)
targetPriority float 0.0 movement speed (world units/t)
shadowElevation float -1.0 movement speed (world units/t)
shadowElevationScl float 1.0 movement speed (world units/t)
engineOffset float 5.0 movement speed (world units/t)
engineSize float 2.5 movement speed (world units/t)
engineLayer float -1.0 movement speed (world units/t)
itemOffsetY float 3.0 movement speed (world units/t)
lightRadius float -1.0 movement speed (world units/t)
lightOpacity float 0.6 movement speed (world units/t)
fogRadius float -1.0 movement speed (world units/t)
waveTrailX float 4.0 movement speed (world units/t)
waveTrailY float -3.0 movement speed (world units/t)
trailScl float 1.0 movement speed (world units/t)
isEnemy boolean true if true, this unit counts as an enemy in the wave counter (usually false for support-only units)
flying boolean false if true, this unit counts as an enemy in the wave counter (usually false for support-only units)
wobble boolean true if true, this unit counts as an enemy in the wave counter (usually false for support-only units)
targetAir boolean true if true, this unit counts as an enemy in the wave counter (usually false for support-only units)
targetGround boolean true if true, this unit counts as an enemy in the wave counter (usually false for support-only units)
faceTarget boolean true if true, this unit counts as an enemy in the wave counter (usually false for support-only units)
circleTarget boolean false if true, this unit counts as an enemy in the wave counter (usually false for support-only units)
canBoost boolean false if true, this unit counts as an enemy in the wave counter (usually false for support-only units)
logicControllable boolean true if true, this unit counts as an enemy in the wave counter (usually false for support-only units)
playerControllable boolean true if true, this unit counts as an enemy in the wave counter (usually false for support-only units)
allowedInPayloads boolean true if true, this unit counts as an enemy in the wave counter (usually false for support-only units)
hittable boolean true if true, this unit counts as an enemy in the wave counter (usually false for support-only units)
killable boolean true if true, this unit counts as an enemy in the wave counter (usually false for support-only units)
targetable boolean true if true, this unit counts as an enemy in the wave counter (usually false for support-only units)
vulnerableWithPayloads boolean false if true, this unit counts as an enemy in the wave counter (usually false for support-only units)
pickupUnits boolean true if true, this unit counts as an enemy in the wave counter (usually false for support-only units)
physics boolean true if true, this unit counts as an enemy in the wave counter (usually false for support-only units)
canDrown boolean true if true, this unit counts as an enemy in the wave counter (usually false for support-only units)
useUnitCap boolean true if true, this unit counts as an enemy in the wave counter (usually false for support-only units)
coreUnitDock boolean false if true, this unit counts as an enemy in the wave counter (usually false for support-only units)
createWreck boolean true if true, this unit counts as an enemy in the wave counter (usually false for support-only units)
createScorch boolean true if true, this unit counts as an enemy in the wave counter (usually false for support-only units)
lowAltitude boolean false if true, this unit counts as an enemy in the wave counter (usually false for support-only units)
rotateToBuilding boolean true if true, this unit counts as an enemy in the wave counter (usually false for support-only units)
allowLegStep boolean false if true, this unit counts as an enemy in the wave counter (usually false for support-only units)
legPhysicsLayer boolean true if true, this unit counts as an enemy in the wave counter (usually false for support-only units)
hovering boolean false if true, this unit counts as an enemy in the wave counter (usually false for support-only units)
omniMovement boolean true if true, this unit counts as an enemy in the wave counter (usually false for support-only units)
rotateMoveFirst boolean false if true, this unit counts as an enemy in the wave counter (usually false for support-only units)
healFlash boolean true if true, this unit counts as an enemy in the wave counter (usually false for support-only units)
canHeal boolean false if true, this unit counts as an enemy in the wave counter (usually false for support-only units)
singleTarget boolean false if true, this unit counts as an enemy in the wave counter (usually false for support-only units)
forceMultiTarget boolean false if true, this unit counts as an enemy in the wave counter (usually false for support-only units)
canAttack boolean true if true, this unit counts as an enemy in the wave counter (usually false for support-only units)
hidden boolean false if true, this unit counts as an enemy in the wave counter (usually false for support-only units)
internal boolean false if true, this unit counts as an enemy in the wave counter (usually false for support-only units)
bounded boolean true if true, this unit counts as an enemy in the wave counter (usually false for support-only units)
naval boolean false if true, this unit counts as an enemy in the wave counter (usually false for support-only units)
autoFindTarget boolean true if true, this unit counts as an enemy in the wave counter (usually false for support-only units)
targetUnderBlocks boolean true if true, this unit counts as an enemy in the wave counter (usually false for support-only units)
alwaysShootWhenMoving boolean false if true, this unit counts as an enemy in the wave counter (usually false for support-only units)
hoverable boolean true if true, this unit counts as an enemy in the wave counter (usually false for support-only units)
alwaysCreateOutline boolean false if true, this unit counts as an enemy in the wave counter (usually false for support-only units)
squareShape boolean false if true, this unit counts as an enemy in the wave counter (usually false for support-only units)
drawBuildBeam boolean true if true, this unit counts as an enemy in the wave counter (usually false for support-only units)
drawCell boolean true if true, this unit counts as an enemy in the wave counter (usually false for support-only units)
drawItems boolean true if true, this unit counts as an enemy in the wave counter (usually false for support-only units)
drawShields boolean true if true, this unit counts as an enemy in the wave counter (usually false for support-only units)
drawBody boolean true if true, this unit counts as an enemy in the wave counter (usually false for support-only units)
drawMinimap boolean true if true, this unit counts as an enemy in the wave counter (usually false for support-only units)
aiController Prov<? extends UnitController> {code} The default AI controller to assign on creation.
controller Func get() : new CommandAI() Function that chooses AI controller based on unit entity.
constructor Prov<? extends Unit> null Creates a new instance of this unit class.
abilities Seq new Seq<>() list of "abilities", which are various behaviors that update each frame
weapons Seq new Seq<>() All weapons that this unit will shoot with.
immunities ObjectSet new ObjectSet<>() None of the status effects in this set can be applied to this unit.
healColor Color 98ffa9ff color that this unit flashes when getting healed (if healFlash is true)
lightColor Color fbd367ff Color of light that this unit produces when lighting is enabled in the map.
shieldColor Color null override for unit shield colour.
deathSound Sound bang sound played when this unit explodes (not when it is shot down)
loopSound Sound none sound played on loop when this unit is around.
loopSoundVolume float 0.5 volume of loop sound
fallEffect Effect fallSmoke effect that this unit emits when falling
fallEngineEffect Effect fallSmoke effect created at engine when unit falls.
deathExplosionEffect Effect dynamicExplosion effect created when this unit dies
treadEffect Effect null optional effect created when this tank moves
parts Seq class) extra (usually animated) visual parts
engines Seq new Seq<>() list of engines, or "thrusters"
useEngineElevation boolean true if false, the thruster is always displayed at its normal size regardless of elevation
engineColor Color null override for all engine colors
engineColorInner Color ffffffff color for inner portions of engines
trailLength int 0 length of engine trail (if flying) or wave trail (if naval)
trailColor Color null override for engine trail color
pathCost PathCost null Function used for calculating cost of moving with ControlPathfinder. Does not affect "normal" flow field pathfinding.
pathCostId int 0 ID 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 Unit null A sample of the unit that this type creates. Do not modify!
targetFlags BlockFlag[] [null] Flags to target based on priority. Null indicates that the closest target should be found. The closest enemy core is used as a fallback.
commands UnitCommand[] [] Commands available to this unit through RTS controls. An empty array means commands will be assigned based on unit capabilities in init().
defaultCommand UnitCommand null Command to assign to this unit upon creation. Null indicates the first command in the array.
stances UnitStance[] [] Stances this unit can have. An empty array means stances will be assigned based on unit capabilities in init().
outlineColor Color 565666ff color for outline generated around sprites
outlineRadius int 3 thickness for sprite outline
outlines boolean true if false, no sprite outlines are generated
itemCapacity int -1 amount of items this unit can carry; <0 to determine based on hitSize.
ammoCapacity int -1 amount of ammo this unit can hold (if the rule is enabled); <0 to determine based on weapon fire rate.
ammoType AmmoType copper) ammo this unit uses, if that system is enabled.
mineTier int -1 max hardness of ore that this unit can mine (<0 to disable)
mineSpeed float 1.0 mining speed in weird arbitrary units
mineWalls boolean false whether this unit can mine ores from floors/walls, respectively
mineFloor boolean true whether this unit can mine ores from floors/walls, respectively
mineHardnessScaling boolean true if true, harder materials will take longer to mine
mineSound Sound minebeam continuous sound emitted when mining.
mineSoundVolume float 0.6 volume of mining sound.
mineItems Seq thorium) Target items to mine. Used in MinerAI
legCount int 4 number of legs this unit has (must have the correct type to function!)
legGroupSize int 2 size of groups in which legs move. for example, insects (6 legs) usually move legs in groups of 3.
legLength float 10.0 total length of a leg (both segments)
legSpeed float 0.1 total length of a leg (both segments)
legForwardScl float 1.0 total length of a leg (both segments)
legBaseOffset float 0.0 total length of a leg (both segments)
legMoveSpace float 1.0 total length of a leg (both segments)
legExtension float 0.0 total length of a leg (both segments)
legPairOffset float 0.0 total length of a leg (both segments)
legLengthScl float 1.0 total length of a leg (both segments)
legStraightLength float 1.0 total length of a leg (both segments)
legMaxLength float 1.75 total length of a leg (both segments)
legMinLength float 0.0 total length of a leg (both segments)
legSplashDamage float 0.0 total length of a leg (both segments)
legSplashRange float 5.0 total length of a leg (both segments)
baseLegStraightness float 0.0 total length of a leg (both segments)
legStraightness float 0.0 total length of a leg (both segments)
lockLegBase boolean false If true, legs are locked to the base of the unit instead of being on an implicit rotating "mount".
legContinuousMove boolean false If true, legs always try to move around even when the unit is not moving (leads to more natural behavior)
flipBackLegs boolean true TODO neither of these appear to do much
flipLegSide boolean false TODO neither of these appear to do much
mechLandShake float 0.0 screen shake amount for when this mech lands after boosting
mechSideSway float 0.54 parameters for mech swaying animation
mechFrontSway float 0.1 parameters for mech swaying animation
mechStride float -1.0 parameters for mech swaying animation
mechStepParticles boolean false whether particles are created when this mech takes a step
mechLegColor Color 6e7080ff color that legs change to when moving, to simulate depth
treadRects Rect[] [] list of treads as rectangles in IMAGE COORDINATES, relative to the center. these are mirrored.
treadFrames int 18 number of frames of movement in a tread
treadPullOffset int 0 how much of a top part of a tread sprite is "cut off" relative to the pattern; this is corrected for
segments int 0 number of independent segments
segmentMag float 2.0 magnitude of sine offset between segments
segmentScl float 4.0 magnitude of sine offset between segments
segmentPhase float 5.0 magnitude of sine offset between segments
segmentRotSpeed float 1.0 magnitude of sine offset between segments
segmentMaxRot float 30.0 magnitude of sine offset between segments
crawlSlowdown float 0.5 magnitude of sine offset between segments
crushDamage float 0.0 magnitude of sine offset between segments
crawlSlowdownFrac float 0.55 magnitude of sine offset between segments
lifetime float 300.0 lifetime of this missile.
homingDelay float 10.0 ticks that must pass before this missile starts homing.
baseRegion TextureRegion null
legRegion TextureRegion null
region TextureRegion null
previewRegion TextureRegion null
shadowRegion TextureRegion null
cellRegion TextureRegion null
itemCircleRegion TextureRegion null
softShadowRegion TextureRegion null
jointRegion TextureRegion null
footRegion TextureRegion null
legBaseRegion TextureRegion null
baseJointRegion TextureRegion null
outlineRegion TextureRegion null
treadRegion TextureRegion null
mineLaserRegion TextureRegion null
mineLaserEndRegion TextureRegion null
wreckRegions TextureRegion[] null
segmentRegions TextureRegion[] null
segmentOutlineRegions TextureRegion[] null
treadRegions TextureRegion[][] null