home *** CD-ROM | disk | FTP | other *** search
/ Maximum CD 2002 January / maximum-cd-2002-01.iso / Files / Mechwarrior 4 Mapping / MW4Editor.exe / content / ABLScripts / Bots / RookieDodgeBot.abl < prev    next >
Encoding:
Text File  |  2001-07-16  |  2.7 KB  |  106 lines

  1.  
  2. fsm RookieDodgeBot : integer;
  3.  
  4.  
  5. //------------------------------------------------------------------
  6.  
  7. // RookieDodgeBot:
  8. //   A rookie version of the DodgeBot.
  9.  
  10. //------------------------------------------------------------------
  11.  
  12.  
  13. //------------------------------------------------------------------
  14. //     Constants
  15. //------------------------------------------------------------------
  16.  
  17.     const
  18.         #include_ <content\ABLScripts\mwconst.abi>
  19.  
  20. //------------------------------------------------------------------
  21. //     Types
  22. //------------------------------------------------------------------
  23.  
  24.     type
  25.         #include_ <content\ABLScripts\mwtype.abi>
  26.     
  27.  
  28. //------------------------------------------------------------------
  29. //     Variables
  30. //------------------------------------------------------------------
  31.  
  32.     var
  33.         static integer            attackRange;        // At what range do I start shooting?
  34.         static integer            withdrawRange;        // At what range do I withdraw?
  35.  
  36. //------------------------------------------------------------------
  37. //     Init: my initialization function
  38. //------------------------------------------------------------------
  39.  
  40. function Init;
  41.     code
  42.         // script-specific variables
  43.         attackRange        = 9999;
  44.         withdrawRange    = 9999;
  45.  
  46.         // driver settings
  47.         SetFiringDelay            (ME,2.0,6.0);
  48.         SetIgnoreFriendlyFire    (ME,true);
  49.         SetIsShotRadius            (ME,160);
  50.         SetEntropyMood            (ME,NEUTRAL_START);
  51.         SetCurMood                (ME,NEUTRAL_START);
  52.         SetSkillLevel            (ME,80,10,30);
  53.         SetAttackThrottle        (ME,90);
  54.             
  55. endfunction;
  56.  
  57. //------------------------------------------------------------------
  58. //    StartState: my initial state
  59. //------------------------------------------------------------------
  60.  
  61. state StartState;
  62.     code
  63.         trans WaitToAmbushState;
  64.  
  65. endstate;
  66.  
  67. //------------------------------------------------------------------
  68. //    WaitInAmbushState: wait for someone to come close enough to attack
  69. //------------------------------------------------------------------
  70.  
  71. state WaitToAmbushState;
  72.     code
  73.         if (Bot_FindEnemy(attackrange)) then
  74.             trans AttackState;
  75.         endif;
  76.  
  77.         OrderMoveLookOut;
  78. endstate;
  79.  
  80. //------------------------------------------------------------------
  81. //    AttackState: the ambush is over -- let's kick some ass!
  82. //------------------------------------------------------------------
  83.  
  84. state AttackState;
  85.     code
  86.         if (LeaveAttackState(withdrawRange)) then
  87.             trans WaitToAmbushState;
  88.         endif;
  89.  
  90.         OrderAttackTactic(TACTIC_CIRCLE,TRUE);
  91. endstate;
  92.  
  93. //------------------------------------------------------------------
  94. //    DeadState: OK, I kicked the bucket.
  95. //------------------------------------------------------------------
  96.  
  97. state DeadState;
  98.     code
  99.         orderDie;
  100.  
  101. endstate;
  102.  
  103.  
  104. endfsm.
  105.  
  106.