home *** CD-ROM | disk | FTP | other *** search
/ ftp.team17.com 2014 / 2014.05.ftp.team17.com.tar / ftp.team17.com / pub / t17 / demos / pc / PhoenixDemo_De.exe / Tactics / Dogfight / 2on1FighterFormation.tac < prev    next >
Text File  |  1999-10-21  |  22KB  |  806 lines

  1. A: FIGHTER
  2. A: SHIELDKILL
  3.  
  4. B: FIGHTER
  5. B: HULLKILL
  6.  
  7. C: FIGHTER;FIGHTER2;EMPLACEMENT
  8.  
  9. Targets(C)
  10.  
  11. // BOX 1 **************************
  12.  
  13. Start(A)
  14.  
  15. Set Priority(A,10)
  16.  
  17. // If B is attacking me, go to "dogfight" code.
  18. If(HeIs[C,"AWARE",A]): Goto(1_DOGFIGHT)
  19. // I am attacking someone who is not awa1re of me
  20. // at the moment.
  21. Goto(28_CHASE_AND_ATTACK)
  22.  
  23. // Code for dogfighting with an enemy.
  24. Label(1_DOGFIGHT)
  25.  
  26. Do(SayIm[A,"STOP",A])
  27. StayHere(A)
  28. Label(DOGFIGHT_LOOP)
  29. If(ShotByOther[A,F]): Gosub(SHOT_BY_OTHER)
  30. // If we are far apart, decide what to do about it.
  31. If(CloseTogether[A,C,60000]): Goto(24_IN_RANGE)
  32. // We are fairly distant from one another.
  33. // Do I have the energy to launch an assault?
  34. If(HasEnergy[A,600]): Goto(2_DISTANT_I_HAVE_ENERGY)
  35. // Stay here and recharge.
  36. If(HeIs[C,"ATTACK",A]): Goto(20_DISTANT_I_AM_LOW)
  37. Goto(DOGFIGHT_LOOP)
  38.  
  39. // BOX 2 **************************
  40.  
  41. Label(2_DISTANT_I_HAVE_ENERGY)
  42. Do(SayIm[A,"CHARGE ATTACK AWARE",C])
  43. Lock(C)
  44.  
  45. Label(PICK_CHARGE)
  46. Do(Random[A,6])
  47. If(RandomIs[A,0]): ChargeTowards(AC)
  48. If(RandomIs[A,1]): ChargeTowardsRollLeft(AC)
  49. If(RandomIs[A,2]): ChargeTowardsRollRight(AC)
  50. If(RandomIs[A,3]): ChargeTowardsTurbo(AC)
  51. If(RandomIs[A,4]): ChargeTowardsRollLeftTurbo(AC)
  52. If(RandomIs[A,5]): ChargeTowardsRollRightTurbo(AC)
  53.  
  54. Do(Random[A,4])
  55. If(RandomIs[A,0]): Timer(A,1000)
  56. If(RandomIs[A,1]): Timer(A,2000)
  57. If(RandomIs[A,2]): Timer(A,3000)
  58. If(RandomIs[A,3]): Timer(A,4000)
  59.  
  60. Label(DISTANT_I_HAVE_ENERGY_LOOP)
  61. If(ShotByOther[A,F]): Gosub(SHOT_BY_OTHER)
  62. // What is C doing?
  63. If(HeIs[C,"DODGE",A]): Goto(32_ENEMY_DODGING_CHARGE)
  64. If(HeIs[C,"CHARGE",A]): Goto(3_DISTANT_HEAD_TO_HEAD)
  65. // C is not charging back at me.
  66. If(HeIs[C,"STOP",-1]): Goto(14_DISTANT_I_CHARGE_HE_STOP)
  67. // C is not stopping either.
  68. If(LowEnergy[A,400]): Goto(20_DISTANT_I_AM_LOW)
  69. // I still have enough energy to continue.
  70. If(CloseTogether[A,C,60000]): Goto(24_IN_RANGE)
  71.  
  72. If(HitBig[A]): Goto(DODGEBIG_2)
  73.  
  74. If(Timer[a]): Goto(DISTANT_I_HAVE_ENERGY_LOOP)
  75. Goto(PICK_CHARGE)
  76.  
  77. Label(DODGEBIG_2)
  78. Timer(A,3000)
  79. FlyDownwards(A)
  80. Label(GODOWN_2)
  81. If(ShotByOther[A,F]): Gosub(SHOT_BY_OTHER)
  82. If(Timer[A]): Goto(GODOWN_2)
  83. Goto(PICK_CHARGE)
  84.  
  85. // BOX 3 ****************************
  86.  
  87. Label(3_DISTANT_HEAD_TO_HEAD)
  88.  
  89. Lock(C)
  90. Do(SayIm[A,"CHARGE ATTACK AWARE",C])
  91. ChargeTowards(AC)
  92. Label(RANDOM_CHOICE)
  93. Do(Random[A,2])
  94. Timer(A,2000)
  95. If(RandomIs[A,0]): Goto(19_STOP_WAIT_FOR_HIM)
  96.  
  97. Label(PICK_CHARGE_3)
  98. Do(Random[A,6])
  99. If(RandomIs[A,0]): ChargeTowards(AC)
  100. If(RandomIs[A,1]): ChargeTowardsRollLeft(AC)
  101. If(RandomIs[A,2]): ChargeTowardsRollRight(AC)
  102. If(RandomIs[A,3]): ChargeTowardsTurbo(AC)
  103. If(RandomIs[A,4]): ChargeTowardsRollLeftTurbo(AC)
  104. If(RandomIs[A,5]): ChargeTowardsRollRightTurbo(AC)
  105.  
  106. Do(Random[A,4])
  107. If(RandomIs[A,0]): Timer(A,1000)
  108. If(RandomIs[A,1]): Timer(A,2000)
  109. If(RandomIs[A,2]): Timer(A,3000)
  110. If(RandomIs[A,3]): Timer(A,4000)
  111.  
  112. Label(DISTANT_HTH_LOOP)
  113. If(ShotByOther[A,F]): Gosub(SHOT_BY_OTHER)
  114. // Is C still charging at me?
  115. If(HeIs[C,"CHARGE",A]): Goto(4_ENEMY_BREAKS_OFF_HTH)
  116. // Do I still have energy?
  117. If(LowEnergy[A,400]): Goto(20_DISTANT_I_AM_LOW)
  118. // Am I in range yet?
  119. If(CloseTogether[A,C,60000]): Goto(24_IN_RANGE)
  120. // TODO: Random chance of changing my mind.
  121. If(HitBig[A]): Goto(DODGEBIG_3)
  122. If(Timer[A]): Goto(DISTANT_HTH_LOOP)
  123. Goto(RANDOM_CHOICE)
  124.  
  125.  
  126. Label(DODGEBIG_3)
  127. Timer(A,3000)
  128. FlyDownwards(A)
  129. Label(GODOWN_3)
  130. If(ShotByOther[A,F]): Gosub(SHOT_BY_OTHER)
  131. If(Timer[A]): Goto(GODOWN_3)
  132. Goto(PICK_CHARGE_3)
  133.  
  134. // BOX 4 ***************************
  135.  
  136. Label(4_ENEMY_BREAKS_OFF_HTH)
  137.  
  138. Do(SayIm[A,"CHARGE ATTACK AWARE",C])
  139. Lock(C)
  140. ChargeTowards(AC)
  141. // Is C low on energy?
  142. If(HasEnergy[C,400]): Goto(6_ENEMY_HIGH_BREAKS_OFF_HTH)
  143. Goto(5_ENEMY_LOW_BREAKS_OFF_HTH)
  144.  
  145. // BOX 5 ***************************
  146.  
  147. Label(5_ENEMY_LOW_BREAKS_OFF_HTH)
  148.  
  149. // Charging a weakened enemy with low energy, who
  150. // has stopped charging.
  151. // Is he running?
  152. If(HeIs[C,"RUN",-1]): Goto(10_ENEMY_LOW_RUNNING)
  153. // He's doing something else; either stopping or dodging.
  154. Goto(28_CHASE_AND_ATTACK)
  155.  
  156. // BOX 6 ***************************
  157.  
  158. Label(6_ENEMY_HIGH_BREAKS_OFF_HTH)
  159.  
  160. // TODO Implement "clever" and "stupid" criteria
  161. // for pilots.
  162. Goto(7_ENEMY_HIGH_CLEVER_WHAT_DOING)
  163. Goto(13_ENEMY_HIGH_STUPID_WHAT_DOING)
  164.  
  165. // BOX 7 ****************************
  166.  
  167. Label(7_ENEMY_HIGH_CLEVER_WHAT_DOING)
  168.  
  169. Do(SayIm[A,"CHARGE ATTACK AWARE",C])
  170. Lock(C)
  171.  
  172. Label(PICK_CHARGE_7)
  173. Do(Random[A,6])
  174. If(RandomIs[A,0]): ChargeTowards(AC)
  175. If(RandomIs[A,1]): ChargeTowardsRollLeft(AC)
  176. If(RandomIs[A,2]): ChargeTowardsRollRight(AC)
  177. If(RandomIs[A,3]): ChargeTowardsTurbo(AC)
  178. If(RandomIs[A,4]): ChargeTowardsRollLeftTurbo(AC)
  179. If(RandomIs[A,5]): ChargeTowardsRollRightTurbo(AC)
  180.  
  181. Do(Random[A,4])
  182. If(RandomIs[A,0]): Timer(A,1000)
  183. If(RandomIs[A,1]): Timer(A,2000)
  184. If(RandomIs[A,2]): Timer(A,3000)
  185. If(RandomIs[A,3]): Timer(A,4000)
  186.  
  187. Label(ENEMY_HIGH_WHAT_DOING_LOOP)
  188. If(ShotByOther[A,F]): Gosub(SHOT_BY_OTHER)
  189. // Is he stopping?
  190. If(HeIs[C,"STOP",-1]): Goto(18_DODGE_AND_ATTACK)
  191. // Is he dodging?
  192. If(HeIs[C,"DODGE",-1]): Goto(8_DODGE_AND_ATTACK_TIMED)
  193. // Is he running?
  194. If(HitBig[A]): Goto(DODGEBIG_7)
  195.  
  196. If(HeIs[C,"RUN",-1]): Goto(9_FOLLOW_HANG_BACK)
  197. Goto(ENEMY_HIGH_WHAT_DOING_LOOP)
  198.  
  199. Label(DODGEBIG_7)
  200. Timer(A,3000)
  201. FlyDownwards(A)
  202. Label(GODOWN_7)
  203. If(ShotByOther[A,F]): Gosub(SHOT_BY_OTHER)
  204. If(Timer[A]): Goto(GODOWN_7)
  205. Goto(PICK_CHARGE_7)
  206.  
  207. // BOX 8 ******************************
  208.  
  209. Label(8_DODGE_AND_ATTACK_TIMED)
  210.  
  211. Do(SayIm[A,"DODGE ATTACK AWARE",C])
  212. Lock(C)
  213. Label(PICK_NEW_DODGE_TIMED)
  214. Do(Random[A,5])
  215. If(RandomIs[A,0]): DodgeToLeftAttack(AC)
  216. If(RandomIs[A,1]): DodgeToRightAttack(AC)
  217. If(RandomIs[A,2]): DodgeToAboveAttack(AC)
  218. If(RandomIs[A,3]): DodgeToBelowAttack(AC)
  219. If(RandomIs[A,4]): Goto(17_PRETEND_TO_RUN)
  220. Do(Random[A,4])
  221. If(RandomIs[A,0]): Timer(A,1000)
  222. If(RandomIs[A,1]): Timer(A,2000)
  223. If(RandomIs[A,2]): Timer(A,3000)
  224. If(RandomIs[A,3]): Timer(A,4000)
  225. Label(DODGE_AND_ATTACK_TIMED_LOOP)
  226. If(ShotByOther[A,F]): Gosub(SHOT_BY_OTHER)
  227. // Has the time limit expired yet?
  228. If(Timer[A]): Goto(DODGE_AND_ATTACK_TIMED_LOOP)
  229. // Am I low on energy?
  230. If(LowEnergy[A,400]): Goto(20_DISTANT_I_AM_LOW)
  231. // Is HE low on energy?
  232. If(LowEnergy[C,400]): Goto(28_CHASE_AND_ATTACK)
  233. Goto(PICK_NEW_DODGE_TIMED)
  234.  
  235. // BOX 9 ******************************
  236.  
  237. Label(9_FOLLOW_HANG_BACK)
  238.  
  239. Do(SayIm[A,"FOLLOW AWARE",C])
  240. FollowHangBack(AC)
  241. Timer(A,5000)
  242. Label(FOLLOW_HANG_BACK_LOOP)
  243. If(ShotByOther[A,F]): Gosub(SHOT_BY_OTHER)
  244.  
  245. // Has he rumbled that I'm not falling for it?
  246. If(HeIs[C,"RUN",-1]): If(Timer[A]): Goto(FOLLOW_HANG_BACK_LOOP)
  247. Goto(16_IMPASSE)
  248.  
  249. // BOX 10 ******************************
  250.  
  251. Label(10_ENEMY_LOW_RUNNING)
  252.  
  253. // Is he getting help?
  254. If(HeIs[C,"GETHELP",-1]): Goto(11_ENEMY_LOW_RUN_GET_HELP)
  255. // Just chase him
  256. Goto(28_CHASE_AND_ATTACK)
  257.  
  258. // BOX 11 ******************************
  259.  
  260. Label(11_ENEMY_LOW_RUN_GET_HELP)
  261.  
  262. // are his friends close enough to help?
  263. // TODO: Implement check for "cleverness" of pilot.
  264. If(GetFriendTargettingMyEnemy[B,D,A]): If(Closer[D,B,A]): Goto(12_ENEMY_LOW_RUN_FRIENDS_MAY_HELP)
  265. Goto(28_CHASE_AND_ATTACK)
  266.  
  267. // BOX 12 ******************************
  268.  
  269. Label(12_ENEMY_LOW_RUN_FRIENDS_MAY_HELP)
  270.  
  271.  
  272. //If(CanHelp[D]): Goto(ABORT)
  273. Goto(28_CHASE_AND_ATTACK)
  274.  
  275. // BOX 13 ******************************
  276.  
  277. Label(13_ENEMY_HIGH_STUPID_WHAT_DOING)
  278.  
  279. If(HeIs[C,"RUN",-1]): Goto(28_CHASE_AND_ATTACK)
  280. Goto(29_STOP_AND_FIRE)
  281.  
  282. // BOX 14 ******************************
  283.  
  284. Label(14_DISTANT_I_CHARGE_HE_STOP)
  285.  
  286. // TODO: Implement "clever" "stupid" and "aggressive"
  287. // characteristics for pilots.
  288. Goto(15_CHECK_ENEMY_ENERGY)
  289. Goto(2_DISTANT_I_HAVE_ENERGY)
  290.  
  291. // BOX 15 ******************************
  292.  
  293. Label(15_CHECK_ENEMY_ENERGY)
  294.  
  295. // Has C got energy?
  296. If(LowEnergy[C,400]): Goto(2_DISTANT_I_HAVE_ENERGY)
  297. Goto(16_IMPASSE)
  298.  
  299. // BOX 16 ******************************
  300.  
  301. Label(16_IMPASSE)
  302. // TODO: Implement "random" code
  303.  
  304. Do(Random[A,3])
  305. If(RandomIs[A,0]): Goto(2_DISTANT_I_HAVE_ENERGY)
  306. If(RandomIs[A,1]): Goto(17_PRETEND_TO_RUN)
  307. Goto(18_DODGE_AND_ATTACK)
  308.  
  309. // BOX 17 ******************************
  310.  
  311. Label(17_PRETEND_TO_RUN)
  312.  
  313. If(CloseTogether[A,C,60000]): Goto(39_PRETEND_TO_RUN_IN_RANGE)
  314. Goto(40_PRETEND_TO_RUN_OUT_RANGE)
  315.  
  316. // BOX 18 ******************************
  317.  
  318. Label(18_DODGE_AND_ATTACK)
  319.  
  320. Do(SayIm[A,"DODGE ATTACK AWARE",C])
  321. Lock(C)
  322. // Every few seconds, randomly change the side
  323. // I'm dodging round to.
  324. Label(PICK_NEW_DODGE)
  325. Do(Random[A,5])
  326. If(RandomIs[A,0]): DodgeToLeftAttack(AC)
  327. If(RandomIs[A,1]): DodgeToRightAttack(AC)
  328. If(RandomIs[A,2]): DodgeToAboveAttack(AC)
  329. If(RandomIs[A,3]): DodgeToBelowAttack(AC)
  330. If(RandomIs[A,4]): Goto(23_NOT_WORKING)
  331. Do(Random[A,4])
  332. If(RandomIs[A,0]): Timer(A,1000)
  333. If(RandomIs[A,1]): Timer(A,2000)
  334. If(RandomIs[A,2]): Timer(A,3000)
  335. If(RandomIs[A,3]): Timer(A,4000)
  336. Label(DODGE_AND_ATTACK_LOOP)
  337. If(ShotByOther[A,F]): Gosub(SHOT_BY_OTHER)
  338. If(Timer[A]): Goto(DODGE_AND_ATTACK_LOOP)
  339. //Is he running away yet?
  340. If(HeIs[C,"RUN",-1]): Goto(28_CHASE_AND_ATTACK)
  341. //Am I low on energy?
  342. If(LowEnergy[A,400]): Goto(20_DISTANT_I_AM_LOW)
  343. Goto(PICK_NEW_DODGE)
  344.  
  345. // BOX 19 ******************************
  346.  
  347. Label(19_STOP_WAIT_FOR_HIM)
  348.  
  349. Do(SayIm[A,"STOP AWARE",C])
  350. StayHere(A)
  351. Do(Random[A,4])
  352. If(RandomIs[A,0]): Timer(A,2000)
  353. If(RandomIs[A,1]): Timer(A,3000)
  354. If(RandomIs[A,2]): Timer(A,4000)
  355. If(RandomIs[A,3]): Timer(A,5000)
  356. Label(STOP_WAIT_FOR_HIM_LOOP)
  357. If(ShotByOther[A,F]): Gosub(SHOT_BY_OTHER)
  358. // Do I still have energy?
  359. If(LowEnergy[A,400]): Goto(20_DISTANT_I_AM_LOW)
  360. // Are we in range yet?
  361. If(CloseTogether[A,C,60000]): Goto(24_IN_RANGE)
  362. // Is he still approaching me?
  363. If(HeIs[C,"CHARGE",A]): If(Timer[A]): Goto(STOP_WAIT_FOR_HIM_LOOP)
  364. Goto(16_IMPASSE)
  365.  
  366. // BOX 20 ******************************
  367.  
  368. Label(20_DISTANT_I_AM_LOW)
  369.  
  370. If(GetFriendTargettingMyEnemy[A,D,C]): Goto(25_RUN_TO_FRIENDS)
  371. Goto(26_DODGE_AROUND)
  372.  
  373. // BOX 21 ******************************
  374.  
  375. Label(21_IN_RANGE_BOTH_ENERGY)
  376.  
  377. Do(Random[A,3])
  378. If(RandomIs[A,0]): Goto(17_PRETEND_TO_RUN)
  379. If(RandomIs[A,1]): Goto(28_CHASE_AND_ATTACK)
  380. If(RandomIs[A,2]): Goto(29_STOP_AND_FIRE)
  381.  
  382. // BOX 22 ******************************
  383.  
  384. Label(22_ENEMY_BEHIND_LOW)
  385.  
  386. Goto(24_IN_RANGE)
  387.  
  388. // BOX 23 ******************************
  389.  
  390. Label(23_NOT_WORKING)
  391.  
  392. Do(Random[A,2])
  393. If(RandomIs[A,0]): Goto(17_PRETEND_TO_RUN)
  394. If(RandomIs[A,1]): Goto(28_CHASE_AND_ATTACK)
  395.  
  396. // BOX 24 ******************************
  397.  
  398. Label(24_IN_RANGE)
  399.  
  400. If(HasEnergy[C,400]): Goto(21_IN_RANGE_BOTH_ENERGY)
  401. Goto(27_IN_RANGE_ENERGY_ADVANTAGE)
  402.  
  403. // BOX 25 ******************************
  404.  
  405. Label(25_RUN_TO_FRIENDS)
  406.  
  407. // TODO: Implement "clever" and "stupid" criteria.
  408. Goto(30_RUN_TO_FRIENDS_STUPID)
  409. Goto(31_RUN_TO_FRIENDS_CLEVER)
  410.  
  411. // BOX 26 ******************************
  412.  
  413. Label(26_DODGE_AROUND)
  414.  
  415. Do(SayIm[A,"DODGE AWARE",C])
  416. //Unlock
  417. // Every few seconds, randomly change the side
  418. // I'm dodging round to.
  419. Label(PICK_NEW)
  420. If(CloseTogether[A,B,60000]): Goto(PICK_NEW_CLOSE)
  421. Do(Random[A,6])
  422. If(RandomIs[A,0]): DodgeToLeftDistant(AB)
  423. If(RandomIs[A,1]): DodgeToRightDistant(AB)
  424. If(RandomIs[A,2]): DodgeToAboveDistant(AB)
  425. If(RandomIs[A,3]): DodgeToBelowDistant(AB)
  426. If(RandomIs[A,4]): DodgeToFrontDistant(AB)
  427. If(RandomIs[A,5]): DodgeToBackDistant(AB)
  428. Goto(PICKED_NEW)
  429. Label(PICK_NEW_CLOSE)
  430. If(Behind[A,B]): Goto(PICKDODGEBEHIND)
  431. Do(Random[A,12])
  432. If(RandomIs[A,0]): DodgeToLeft(AB)
  433. If(RandomIs[A,1]): DodgeToRight(AB)
  434. If(RandomIs[A,2]): DodgeToAbove(AB)
  435. If(RandomIs[A,3]): DodgeToBelow(AB)
  436. If(RandomIs[A,4]): DodgeToLeftRollLeft(AB)
  437. If(RandomIs[A,5]): DodgeToRightRollLeft(AB)
  438. If(RandomIs[A,6]): DodgeToAboveRollLeft(AB)
  439. If(RandomIs[A,7]): DodgeToBelowRollLeft(AB)
  440. If(RandomIs[A,8]): DodgeToLeftRollRight(AB)
  441. If(RandomIs[A,9]): DodgeToRightRollRight(AB)
  442. If(RandomIs[A,10]): DodgeToAboveRollRight(AB)
  443. If(RandomIs[A,11]): DodgeToBelowRollRight(AB)
  444. Goto(PICKED_NEW)
  445. Label(PICKDODGEBEHIND)
  446. Do(Random[A,12])
  447. If(RandomIs[A,0]): DodgeToLeftBack(AB)
  448. If(RandomIs[A,1]): DodgeToRightBack(AB)
  449. If(RandomIs[A,2]): DodgeToAboveBack(AB)
  450. If(RandomIs[A,3]): DodgeToBelowBack(AB)
  451. If(RandomIs[A,4]): DodgeToLeftBackRollLeft(AB)
  452. If(RandomIs[A,5]): DodgeToRightBackRollLeft(AB)
  453. If(RandomIs[A,6]): DodgeToAboveBackRollLeft(AB)
  454. If(RandomIs[A,7]): DodgeToBelowBackRollLeft(AB)
  455. If(RandomIs[A,8]): DodgeToLeftBackRollRight(AB)
  456. If(RandomIs[A,9]): DodgeToRightBackRollRight(AB)
  457. If(RandomIs[A,10]): DodgeToAboveBackRollRight(AB)
  458. If(RandomIs[A,11]): DodgeToBelowBackRollRight(AB)
  459. Label(PICKED_NEW)
  460. Do(Random[A,4])
  461. If(RandomIs[A,0]): Timer(A,2000)
  462. If(RandomIs[A,1]): Timer(A,2500)
  463. If(RandomIs[A,2]): Timer(A,3000)
  464. If(RandomIs[A,3]): Timer(A,3500)
  465. Label(DODGE_LOOP)
  466. If(ShotByOther[A,F]): Gosub(SHOT_BY_OTHER)
  467. //Do I have energy yet?
  468. If(HasEnergy[A,600]): Goto(24_IN_RANGE)
  469. If(Timer[A]): Goto(DODGE_LOOP)
  470. //Is he still attacking?
  471. If(HeIs[C,"ATTACK",A]): Goto(STILL_ATTACKING)
  472. Goto(1_DOGFIGHT)
  473. Label(STILL_ATTACKING)
  474. Goto(PICK_NEW)
  475.  
  476. // BOX 27 ******************************
  477.  
  478. Label(27_IN_RANGE_ENERGY_ADVANTAGE)
  479.  
  480. If(HeIs[C,"CHARGE",A]): Goto(18_DODGE_AND_ATTACK)
  481. Goto(29_STOP_AND_FIRE)
  482.  
  483. // BOX 28 ******************************
  484.  
  485. Label(28_CHASE_AND_ATTACK)
  486.  
  487. Do(SayIm[A,"CHARGE ATTACK AWARE",C])
  488. Lock(C)
  489.  
  490. Label(PICK_CHASE)
  491.  
  492. Do(Random[A,3])
  493. If(RandomIs[A,0]): ChaseTail(AB)
  494. If(RandomIs[A,1]): ChaseTailRollLeft(AB)
  495. If(RandomIs[A,2]): ChaseTailRollRight(AB)
  496.  
  497. Do(Random[A,4])
  498. If(RandomIs[A,0]): Timer(A,2000)
  499. If(RandomIs[A,1]): Timer(A,3000)
  500. If(RandomIs[A,2]): Timer(A,4000)
  501. If(RandomIs[A,3]): Timer(A,5000)
  502. Label(CHASE_AND_ATTACK_LOOP)
  503. If(ShotByOther[A,F]): Gosub(SHOT_BY_OTHER)
  504. //Am I low on energy?
  505. If(LowEnergy[A,400]): Goto(20_DISTANT_I_AM_LOW)
  506. If(HitBig[A]): Goto(DODGEBIG_28)
  507. If(Timer[A]): Goto(CHASE_AND_ATTACK_LOOP)
  508. Goto(PICK_CHASE)
  509.  
  510. Label(DODGEBIG_28)
  511. Timer(A,3000)
  512. FlyDownwards(A)
  513. Label(GODOWN_28)
  514. If(ShotByOther[A,F]): Gosub(SHOT_BY_OTHER)
  515. If(Timer[A]): Goto(GODOWN_28)
  516. Goto(PICK_CHASE)
  517.  
  518. // BOX 29 ******************************
  519.  
  520. Label(29_STOP_AND_FIRE)
  521.  
  522. Do(SayIm[A,"STOP ATTACK AWARE",C])
  523. Lock(C)
  524. StopAndFire(AC)
  525. Do(Random[A,4])
  526. If(RandomIs[A,0]): Timer(A,1000)
  527. If(RandomIs[A,1]): Timer(A,2000)
  528. If(RandomIs[A,2]): Timer(A,3000)
  529. If(RandomIs[A,3]): Timer(A,4000)
  530. Label(STOP_AND_FIRE_LOOP)
  531. If(ShotByOther[A,F]): Gosub(SHOT_BY_OTHER)
  532. //Am I low on energy?
  533. If(LowEnergy[A,400]): Goto(20_DISTANT_I_AM_LOW)
  534. //Is he charging me?
  535. If(HeIs[C,"CHARGE",A]): Goto(18_DODGE_AND_ATTACK)
  536. If(CloseTogether[A,C,60000]): If(Timer[A]): Goto(CHASE_AND_ATTACK_LOOP)
  537. Goto(23_NOT_WORKING)
  538.  
  539. // BOX 30 ******************************
  540.  
  541. Label(30_RUN_TO_FRIENDS_STUPID)
  542.  
  543. Do(SayIm[A,"RUN AWARE GETHELP",C])
  544. //Unlock
  545. Label(RUN_TO_FRIENDS_STUPID_LOOP)
  546. If(ShotByOther[A,F]): Gosub(SHOT_BY_OTHER)
  547. StayHere(A)
  548. // Has my energy recharged?
  549. If(HasEnergy[A,600]): Goto(24_IN_RANGE)
  550. // Any friends to run to?
  551. If(GetFriendTargettingMyEnemy[A,D,C]): Goto(STILL_FRIENDS)
  552. Goto(26_DODGE_AROUND)
  553.  
  554. Label(STILL_FRIENDS)
  555. ChargeTowardsTurbo(AD)
  556. If(HitBig[A]): Goto(DODGEBIG_30)
  557. If(CloseTogether[A,D,30000]): Goto(33_REACHED_FRIEND)
  558. Goto(RUN_TO_FRIENDS_STUPID_LOOP)
  559.  
  560. Label(DODGEBIG_30)
  561. Timer(A,3000)
  562. FlyDownwards(A)
  563. Label(GODOWN_30)
  564. If(ShotByOther[A,F]): Gosub(SHOT_BY_OTHER)
  565. If(Timer[A]): Goto(GODOWN_30)
  566. Goto(RUN_TO_FRIENDS_STUPID_LOOP)
  567.  
  568. // BOX 31 ******************************
  569.  
  570. Label(31_RUN_TO_FRIENDS_CLEVER)
  571.  
  572. Do(SayIm[A,"RUN AWARE GETHELP",C])
  573. //Unlock
  574. Label(RUN_TO_FRIENDS_CLEVER_LOOP)
  575. If(ShotByOther[A,F]): Gosub(SHOT_BY_OTHER)
  576. StayHere(A)
  577. // Has my energy recharged?
  578. If(HasEnergy[A,600]): Goto(34_GOT_ENERGY_ENEMY_BEHIND)
  579. // Any friends to run to?
  580. If(GetFriendTargettingMyEnemy[A,D,C]): Goto(STILL_FRIENDS_CLEVER)
  581. Goto(26_DODGE_AROUND)
  582.  
  583. Label(STILL_FRIENDS_CLEVER)
  584. If(ShotByOther[A,F]): Gosub(SHOT_BY_OTHER)
  585. ChargeTowardsTurbo(AD)
  586. If(HitBig[A]): Goto(DODGEBIG_31)
  587. If(CloseTogether[A,D,30000]): Goto(33_REACHED_FRIEND)
  588. Goto(RUN_TO_FRIENDS_CLEVER_LOOP)
  589.  
  590. Label(DODGEBIG_31)
  591. Timer(A,3000)
  592. FlyDownwards(A)
  593. Label(GODOWN_31)
  594. If(ShotByOther[A,F]): Gosub(SHOT_BY_OTHER)
  595. If(Timer[A]): Goto(GODOWN_31)
  596. Goto(RUN_TO_FRIENDS_CLEVER_LOOP)
  597.  
  598. // BOX 32 ******************************
  599.  
  600. Label(32_ENEMY_DODGING_CHARGE)
  601.  
  602. //TODO: Implement Clever and Stupid code.
  603. If(LowEnergy[C,400]): Goto(36_CARRY_ON_CHARGING)
  604. Goto(37_HANG_BACK)
  605.  
  606. // BOX 33 ******************************
  607.  
  608. Label(33_REACHED_FRIEND)
  609.  
  610. // Todo: replace this abort with a "split" command to force this other guy to help.
  611. //If(GetFriend[A,D]): If(CanHelp[D]): Goto(ABORT)
  612. //Goto(ABORT)
  613. Goto(26_DODGE_AROUND)
  614.  
  615. // BOX 34 ******************************
  616.  
  617. Label(34_GOT_ENERGY_ENEMY_BEHIND)
  618.  
  619. If(LowEnergy[C,400]): Goto(24_IN_RANGE)
  620. Goto(35_DODGE_AROUND_WASTE)
  621.  
  622. // BOX 35 ******************************
  623.  
  624. Label(35_DODGE_AROUND_WASTE)
  625.  
  626. Do(SayIm[A,"DODGE AWARE",C])
  627. //Unlock
  628. // Every few seconds, randomly change the side
  629. // I'm dodging round to.
  630. Label(PICK_NEW_WASTE)
  631. Do(Random[A,5])
  632. If(RandomIs[A,0]): DodgeToLeft(AC)
  633. If(RandomIs[A,1]): DodgeToRight(AC)
  634. If(RandomIs[A,2]): DodgeToAbove(AC)
  635. If(RandomIs[A,3]): DodgeToBelow(AC)
  636. If(RandomIs[A,4]): Goto(23_NOT_WORKING)
  637. Do(Random[A,2])
  638. If(RandomIs[A,0]): Timer(A,1000)
  639. If(RandomIs[A,1]): Timer(A,2000)
  640. Label(DODGE_WASTE_LOOP)
  641. If(ShotByOther[A,F]): Gosub(SHOT_BY_OTHER)
  642. //Has he lost energy yet?
  643. If(LowEnergy[C,400]): Goto(24_IN_RANGE)
  644. // Have I lost energy?
  645. If(LowEnergy[A,400]): Goto(20_DISTANT_I_AM_LOW)
  646. //Is he still attacking?
  647. If(HeIs[C,"ATTACK",A]): Goto(STILL_ATTACKING_WASTE)
  648. Goto(ABORT)
  649.  
  650. Label(STILL_ATTACKING_WASTE)
  651. If(Timer[A]): Goto(DODGE_WASTE_LOOP)
  652. Goto(PICK_NEW_WASTE)
  653.  
  654. // BOX 36 ******************************
  655.  
  656. Label(36_CARRY_ON_CHARGING)
  657.  
  658. Do(SayIm[A,"CHARGE ATTACK AWARE",C])
  659. ChaseTail(AC)
  660. Lock(C)
  661. Do(Random[A,4])
  662. If(RandomIs[A,0]): Timer(A,2000)
  663. If(RandomIs[A,1]): Timer(A,3000)
  664. If(RandomIs[A,2]): Timer(A,4000)
  665. If(RandomIs[A,3]): Timer(A,5000)
  666. Label(CARRY_ON_LOOP)
  667. If(ShotByOther[A,F]): Gosub(SHOT_BY_OTHER)
  668. If(LowEnergy[A,400]): Goto(20_DISTANT_I_AM_LOW)
  669. If(HitBig[A]): Goto(DODGEBIG_36)
  670. If(HeIs[C,"RUN",-1]): Goto(10_ENEMY_LOW_RUNNING)
  671. If(Timer[A]): Goto(CARRY_ON_LOOP)
  672. Goto(23_NOT_WORKING)
  673.  
  674. Label(DODGEBIG_36)
  675. Timer(A,3000)
  676. FlyDownwards(A)
  677. Label(GODOWN_36)
  678. If(ShotByOther[A,F]): Gosub(SHOT_BY_OTHER)
  679. If(Timer[A]): Goto(GODOWN_36)
  680. Goto(36_CARRY_ON_CHARGING)
  681.  
  682. // BOX 37 ******************************
  683.  
  684. Label(37_HANG_BACK)
  685.  
  686. Do(SayIm[A,"FOLLOW AWARE",C])
  687. FollowHangBack(AC)
  688. Do(Random[A,4])
  689. If(RandomIs[A,0]): Timer(A,2000)
  690. If(RandomIs[A,1]): Timer(A,3000)
  691. If(RandomIs[A,2]): Timer(A,4000)
  692. If(RandomIs[A,3]): Timer(A,5000)
  693. Label(HANG_BACK_LOOP)
  694. If(ShotByOther[A,F]): Gosub(SHOT_BY_OTHER)
  695. If(LowEnergy[A,400]): Goto(20_DISTANT_I_AM_LOW)
  696. If(HeIs[C,"RUN",-1]): Goto(28_CHASE_AND_ATTACK)
  697. If(HeIs[C,"CHARGE",A]): Goto(38_TOY_WITH_HIM)
  698. If(HeIs[C,"STOP",-1]): Goto(16_IMPASSE)
  699. If(Timer[A]): Goto(HANG_BACK_LOOP)
  700. Goto(16_IMPASSE)
  701.  
  702. // BOX 38 ******************************
  703.  
  704. Label(38_TOY_WITH_HIM)
  705.  
  706. Do(Random[A,3])
  707. If(RandomIs[A,0]): Goto(18_DODGE_AND_ATTACK)
  708. If(RandomIs[A,1]): Goto(28_CHASE_AND_ATTACK)
  709. Goto(17_PRETEND_TO_RUN)
  710.  
  711. // BOX 39 ******************************
  712.  
  713. Label(39_PRETEND_TO_RUN_IN_RANGE)
  714. Do(SayIm[A,"RUN AWARE",C])
  715. RunBackwards(AC)
  716. Do(Random[A,4])
  717. If(RandomIs[A,0]): Timer(A,1000)
  718. If(RandomIs[A,1]): Timer(A,2000)
  719. If(RandomIs[A,2]): Timer(A,3000)
  720. If(RandomIs[A,3]): Timer(A,4000)
  721. Label(PRETEND_TO_RUN_LOOP)
  722. If(ShotByOther[A,F]): Gosub(SHOT_BY_OTHER)
  723. // Am I low on energy?
  724. If(LowEnergy[A,400]): Goto(20_DISTANT_I_AM_LOW)
  725. // Is HE low on energy?
  726. If(LowEnergy[C,400]): Goto(22_ENEMY_BEHIND_LOW)
  727. // Am I wasting my time?
  728.  
  729. //If(CloseTogether[A,C,20000]): Goto(STILL_CLOSE_PRETEND)
  730. //Goto(16_IMPASSE)
  731.  
  732. Label(STILL_CLOSE_PRETEND)
  733. If(Timer[A]): Goto(PRETEND_TO_RUN_LOOP)
  734. Goto(8_DODGE_AND_ATTACK_TIMED)
  735.  
  736. // BOX 40 ******************************
  737.  
  738. Label(40_PRETEND_TO_RUN_OUT_RANGE)
  739. Do(SayIm[A,"RUN AWARE",C])
  740. RunSlowly(AC)
  741. Do(Random[A,4])
  742. If(RandomIs[A,0]): Timer(A,1000)
  743. If(RandomIs[A,1]): Timer(A,2000)
  744. If(RandomIs[A,2]): Timer(A,3000)
  745. If(RandomIs[A,3]): Timer(A,4000)
  746. Label(PRETEND_TO_RUN_LOOP2)
  747. If(ShotByOther[A,F]): Gosub(SHOT_BY_OTHER)
  748. // Am I low on energy?
  749. If(LowEnergy[A,400]): Goto(20_DISTANT_I_AM_LOW)
  750. // Are we within range?
  751. If(CloseTogether[A,C,60000]): Goto(24_IN_RANGE)
  752. // Is HE low on energy?
  753. If(LowEnergy[C,400]): Goto(22_ENEMY_BEHIND_LOW)
  754. // Am I wasting my time?
  755. If(Timer[A]): Goto(PRETEND_TO_RUN_LOOP2)
  756. Goto(19_STOP_WAIT_FOR_HIM)
  757.  
  758. //***************************************
  759.  
  760. Label(ABORT)
  761. Abort
  762.  
  763. Label(SHOT_BY_OTHER)
  764. If(CloseTogether[A,C,60000]): GotoQuick(SHOT_BY_OTHER_STILL_IN_RANGE)
  765. Split(ABF,2on1Fighter)
  766. Goto(DONE)
  767.  
  768. Label(SHOT_BY_OTHER_STILL_IN_RANGE)
  769. If(LowEnergy[C,600]): GotoQuick(SHOT_BY_OTHER_THIS_ONE_LOW)
  770. //If(Closer[F,A,B]): GotoQuick(TAKE_NEW_ONE)
  771. Split(ABF,2on1Fighter)
  772. Goto(DONE)
  773.  
  774. Label(TAKE_NEW_ONE)
  775. Split(ABF,2on1Fighter)
  776. Goto(DONE)
  777.  
  778. Label(SHOT_BY_OTHER_THIS_ONE_LOW)
  779. Split(ABF,2on1Fighter)
  780. Goto(DONE)
  781.  
  782. Label(DONE)
  783. Goto(DONE)
  784.  
  785.  
  786. Start(B)
  787. FlyFormation2(BA)
  788. Lock(C)
  789. Label(Bdone)
  790. If(LowEnergy[B,300]): Goto(BABORT)
  791. If(LowEnergy[B,500]): Goto(BSTOPFIRE)
  792. Goto(Bdone)
  793.  
  794. Label(BSTOPFIRE)
  795. //Unlock
  796. Label(BCHARGEUP)
  797. If(LowEnergy[B,300]): Goto(BABORT)
  798. If(LowEnergy[B,700]): Goto(BCHARGEUP)
  799. Goto(Bdone)
  800.  
  801. Label(BABORT)
  802. //Tactic Message({B}:{}MY SHIELDS ARE DOWN,{A};{}BREAKING OFF.)
  803. Split(AC,1on1Fighter)
  804. Split(BC,1on1Fighter)
  805. Goto(BABORT)
  806.