Difference between revisions of "HardMissileAI"

From Elite Wiki
 
m
Line 37: Line 37:
   
 
'''[[AI|BACK]]'''
 
'''[[AI|BACK]]'''
  +
  +
  +
[[Category:Oolite]]

Revision as of 12:01, 12 July 2006

Comparable to the missileAI script, with ommision of the EMC=explode bit.

Defined states:

  • GLOBAL: ->ATTACK_SHIP
  • ATTACK_SHIP: ->DETONATE, ->EXPLODE
  • DETONATE: deals damage
  • EXPLODE: just pretty fireworks

This is a standalone AI, it is terminated when missile-entity becomes an explosion.

{
   "ATTACK_SHIP" = {
       "DESIRED_RANGE_ACHIEVED" = ("setStateTo: DETONATE"); 
       ENTER = ("setDesiredRangeTo: 25.0", performIntercept); 
       EXIT = (); 
       "TARGET_DESTROYED" = ("setStateTo: EXPLODE"); 
       "TARGET_LOST" = ("setStateTo: EXPLODE"); 
       "GONE_BEYOND_RANGE" = ("setStateTo: EXPLODE"); 
       UPDATE = ("setDesiredRangeTo: 30000.0", checkDistanceTravelled, "setDesiredRangeTo: 25.0", "pauseAI: 5.0");     }; 
   DETONATE = {
       ENTER = ("setDesiredRangeTo: 250.0", dealEnergyDamageWithinDesiredRange, becomeExplosion); 
       EXIT = (); 
       UPDATE = ();     }; 
   EXPLODE = {
       ENTER = (becomeExplosion); 
       EXIT = (); 
       UPDATE = ();     }; 
   GLOBAL = {
       ENTER = ("setSpeedFactorTo: 1.0", "setStateTo: ATTACK_SHIP"); 
       EXIT = (); 
       UPDATE = (); 
   }; 
}

BACK