home *** CD-ROM | disk | FTP | other *** search
/ 300 Favorite Games / 300GAMES.iso / 316 / hotsnipr.atr < prev    next >
Text File  |  1992-12-17  |  3KB  |  139 lines

  1. ; HOT Sniper                    Ed T. Toton III 
  2.  
  3. ; define vars
  4. #def speed
  5. #def shoot
  6. #def move
  7. #def armor
  8. #def hitcheck
  9. #def hit
  10. #def accuracy
  11. #def turn
  12.  
  13. ; set some label-remembering variables.
  14. set     shoot   1000
  15. set     move    2000
  16. set     hitcheck  50
  17.  
  18. ;First order of business... Get the robot moving..
  19. gsb     move
  20.  
  21.  
  22.  
  23. ;MAIN (settings)
  24. :1
  25. ; set speed=0, arc-wdth=8, turn-speed=+10
  26. opo     11      0
  27. opo     18      8
  28. set     turn    10
  29.  
  30. ; Get random number... 50% chance of setting turn-speed to -10.
  31. ipo     10      az
  32. cmp     az      5000
  33. jls     2
  34. set     turn    -10
  35.  
  36. ; MAIN loop..
  37. :2
  38.        ;turn
  39.         opo     14      turn
  40.  
  41.        ;scan & shoot
  42.         ipo     7       az
  43.         cmp     az      5000
  44.         jls     shoot   1
  45.  
  46.        ;check to see if damaged since last check.
  47.         set     hit     0
  48.         gsb     hitcheck
  49.         cmp     hit     0
  50.  
  51.        ;if damaged then MOVE.
  52.         jne     move    1
  53.  
  54. jmp 2
  55. ; if a "JMP 10" is called, the settings can be repeated.
  56. :10
  57. jmp 1
  58.  
  59.  
  60. ;Hitcheck
  61. :50
  62.        ;read and compare armor
  63.         ipo     6       az
  64.         cmp     az      armor
  65.  
  66.        ;if no damage then simply exit.
  67.         ret
  68.  
  69.        ;if hit, then say so!
  70.         set     armor   az
  71.         set     hit     1
  72. :51
  73. ret
  74.  
  75.  
  76. ;Shoot
  77. :1000
  78.        ;Turn on Overburn
  79.         opo     _Set_Overburn   1
  80.  
  81.        ;Stop turning.
  82.         ipo     _compass        ax
  83.         int     8
  84.        
  85. :1001
  86.  
  87.        ;fire using accuracy
  88.         opo     15      10003
  89.  
  90.        ;turn using accuracy (to try to continue to face target)
  91.         opo     14      10003
  92.  
  93.        ;scan again. If there then repeat, else exit.
  94.         ipo     7       az
  95.         cmp     az      1000
  96.         jgr     1010
  97.  
  98.        ;Check heat. If not frying, then toast the enemy again.
  99.         ipo     _heat_sense     az
  100.         cmp     az      300
  101.         jls     1001
  102.  
  103. :1010
  104.        ;Turn off Overburn
  105.         opo     _Set_Overburn   0
  106. ret
  107.  
  108.  
  109. ;Move
  110. :2000
  111.        ;read a random number, make it so it's 
  112.        ;in range of 0-360, then turn that way.
  113.         set     az      10030
  114.         mod     az      az      360
  115.         opo     14      az
  116.  
  117.        ;Set speed to 100, then delay
  118.         opo     11      100
  119.  
  120.        ;Removed...
  121. ;       ipo     1       az
  122. ;       cmp     az      0
  123. ;       jeq     2000
  124.  
  125.        ;keep going until speed reaches zero.
  126.        :2001
  127.         ipo     1       az
  128.         cmp     az      0
  129.         jne     2001
  130.  
  131.        ;set armor so that the HITCHECK doesn't think 
  132.        ;we've been shot. (we take damage when we hit walls).
  133.         ipo     6       az
  134.         set     armor   az
  135.  
  136.        ;Set speed to 0.
  137.         opo     11      0
  138. ret
  139.