Package mindustry.entities.units
Class AIController
java.lang.Object
mindustry.entities.units.AIController
- All Implemented Interfaces:
UnitController
- Direct Known Subclasses:
AssemblerAI
,BoostAI
,BuilderAI
,CargoAI
,CommandAI
,DefenderAI
,DroneCenter.EffectDroneAI
,FlyingAI
,GroundAI
,HugAI
,LogicAI
,MinerAI
,MissileAI
,RepairAI
-
Field Summary
Modifier and TypeFieldDescriptionprotected AIController
protected float
protected static final float
protected mindustry.gen.Teamc
main target that is being facedprotected Interval
protected static final int
protected static final int
protected static final int
protected static final int
protected mindustry.gen.Unit
protected static final Vec2
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
checkTarget
(mindustry.gen.Teamc target, float x, float y, float range) void
void
void
circleAttack
(float circleLength) void
commandPosition
(Vec2 pos) void
commandTarget
(mindustry.gen.Teamc moveTo) void
void
For ground units: Looks at the target, or the movement position.fallback()
mindustry.gen.Teamc
findMainTarget
(float x, float y, float range, boolean air, boolean ground) mindustry.gen.Teamc
findTarget
(float x, float y, float range, boolean air, boolean ground) void
init()
Called after this controller is assigned a unit.boolean
invalid
(mindustry.gen.Teamc target) boolean
boolean
void
void
void
void
moveTo
(Position target, float circleLength, float smooth, boolean keepDistance, Vec2 offset, boolean arrive) void
pathfind
(int pathTarget) boolean
retarget()
boolean
void
mindustry.gen.Teamc
target
(float x, float y, float range, boolean air, boolean ground) mindustry.gen.Teamc
targetFlag
(float x, float y, BlockFlag flag, boolean enemy) mindustry.gen.Unit
unit()
void
unit
(mindustry.gen.Unit unit) void
void
void
void
void
void
boolean
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface mindustry.entities.units.UnitController
hit, isBeingControlled, isValidController, removed
-
Field Details
-
vec
-
rotateBackTimer
protected static final float rotateBackTimer- See Also:
-
timerTarget
protected static final int timerTarget- See Also:
-
timerTarget2
protected static final int timerTarget2- See Also:
-
timerTarget3
protected static final int timerTarget3- See Also:
-
timerTarget4
protected static final int timerTarget4- See Also:
-
unit
protected mindustry.gen.Unit unit -
timer
-
fallback
-
noTargetTime
protected float noTargetTime -
target
protected mindustry.gen.Teamc targetmain target that is being faced
-
-
Constructor Details
-
AIController
public AIController()
-
-
Method Details
-
updateUnit
public void updateUnit()- Specified by:
updateUnit
in interfaceUnitController
-
keepState
public boolean keepState()- Returns:
- whether controller state should not be reset after reading. Do not override unless you know exactly what you are doing.
-
isLogicControllable
public boolean isLogicControllable()- Specified by:
isLogicControllable
in interfaceUnitController
- Returns:
- whether logic AI can take over
-
stopShooting
public void stopShooting() -
fallback
-
useFallback
public boolean useFallback() -
updateVisuals
public void updateVisuals() -
updateMovement
public void updateMovement() -
updateTargeting
public void updateTargeting() -
faceTarget
public void faceTarget()For ground units: Looks at the target, or the movement position. Does not apply to non-omni units. -
faceMovement
public void faceMovement() -
invalid
public boolean invalid(mindustry.gen.Teamc target) -
pathfind
public void pathfind(int pathTarget) -
updateWeapons
public void updateWeapons() -
checkTarget
public boolean checkTarget(mindustry.gen.Teamc target, float x, float y, float range) -
shouldShoot
public boolean shouldShoot() -
targetFlag
-
target
public mindustry.gen.Teamc target(float x, float y, float range, boolean air, boolean ground) -
retarget
public boolean retarget() -
findMainTarget
public mindustry.gen.Teamc findMainTarget(float x, float y, float range, boolean air, boolean ground) -
findTarget
public mindustry.gen.Teamc findTarget(float x, float y, float range, boolean air, boolean ground) -
commandTarget
public void commandTarget(mindustry.gen.Teamc moveTo) -
commandPosition
-
init
public void init()Called after this controller is assigned a unit. -
getClosestSpawner
-
unloadPayloads
public void unloadPayloads() -
circleAttack
public void circleAttack(float circleLength) -
circle
-
circle
-
moveTo
-
moveTo
-
moveTo
-
moveTo
-
unit
public void unit(mindustry.gen.Unit unit) - Specified by:
unit
in interfaceUnitController
-
unit
public mindustry.gen.Unit unit()- Specified by:
unit
in interfaceUnitController
-