InterceptAI
From Elite Wiki
A three-state machine, designed for interception and combat, will exit afterwards. Used mainly by policevipers (hence the reference to lights), but also by other attacking AI-scripts, such as the escortAI.
Used states:
- ATTACK_SHIP: ->FLEE
- FLEE: ->ATTACK_SHIP
- GLOBAL: ->ATTACK_SHIP
No references to other AI's, will exit after completion.
{ "ATTACK_SHIP" = { "ENERGY_LOW" = ("setStateTo: FLEE"); ENTER = (performAttack); EXIT = (); "INCOMING_MISSILE" = (fightOrFleeMissile, "setStateTo: FLEE"); "TARGET_DESTROYED" = (switchLightsOff, exitAI); "TARGET_LOST" = (switchLightsOff, exitAI); UPDATE = (); };
FLEE = { "ENERGY_FULL" = ("setStateTo: ATTACK_SHIP"); "TARGET_LOST" = (switchLightsOff, exitAI); "TARGET_DESTROYED" = (switchLightsOff, exitAI); ENTER = ("setDesiredRangeTo: 25600", performFlee); EXIT = (); "INCOMING_MISSILE" = (fightOrFleeMissile, "setStateTo: FLEE"); UPDATE = (); };
GLOBAL = { ENTER = (switchLightsOn, "setStateTo: ATTACK_SHIP"); EXIT = (); UPDATE = (); }; }