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 / 1on1FighterKami.tac < prev    next >
Text File  |  1999-10-21  |  21KB  |  780 lines

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