home *** CD-ROM | disk | FTP | other *** search
/ Loadstar 25 / 025.d81 / battle-64 (.txt) < prev    next >
Commodore BASIC  |  2022-08-26  |  7KB  |  183 lines

  1. 100 goto855
  2. 105 poke53281,0:poke53280,0:gosub665:goto430
  3. 110 la%=la%-1:cl=tl+g1:ex%=peek(cl):ifla%<1thenla%=0:return
  4. 115 ifex%=31thenls%=ls%+25:gosub210:gosub210:return
  5. 120 ifcl=trthenifrl%>0thenrl%=rl%-1:ls%=ls%+200:gosub210:return
  6. 125 ifex%=60thenifcl=1422thenls%=ls%+500:gosub210:gosub210:gosub210:return
  7. 130 ifex%=61thenifcl=1302thenls%=ls%-500:gosub210:gosub210:return
  8. 135 goto210
  9. 140 ra%=ra%-1:cl=tr-g2:ex%=peek(cl):ifra%<1thenra%=0:return
  10. 145 ifex%=31thenrs%=rs%+25:gosub210:gosub210:return
  11. 150 ifcl=tlthenifll%>0thenll%=ll%-1:rs%=rs%+200:gosub210:return
  12. 155 ifex%=60thenifcl=1505thenrs%=rs%+500:gosub210:gosub210:gosub210:return
  13. 160 ifex%=63thenifcl=1625thenrs%=rs%-500:gosub210:gosub210:return
  14. 165 goto210
  15. 170 pokesw,0:pokesv,15:pokesh,s1:pokesl,s2:pokesa,s3:pokess,s4:pokesw,s5
  16. 175 rp=int(rnd(0)*30)+1
  17. 180 ifrp<6thenpoke1505,60:poke1505+ac,6
  18. 185 ifrp>25thenpoke1422,60:poke1422+ac,2
  19. 190 ifrp=22thenpoke1625,63:poke1625+ac,6
  20. 195 ifrp=20thenpoke1302,61:poke1302+ac,2
  21. 200 iffg=1thenreturn
  22. 205 ford=54272to54296:poked,0:next:return
  23. 210 pokecl,27:pokecl+ac,7:ifll%>0thenpoketl,ls:poketl+ac,6
  24. 215 ifrl%>1thenpoketr,rs:poketr+ac,2
  25. 220 pokecl,28:pokecl+ac,8
  26. 225 s1=2:s2=120:s3=8:s4=0:s5=129:gosub170:gosub170:pokecl,32:pokecl+ac,0
  27. 230 return
  28. 235 ifpeek(cr)=31thenpoketr,32:tr=cr:rl%=rl%-1:poketr,rs:poketr+ac,2
  29. 240 ifpeek(cr)=rsthencl=cr:gosub210:goto355
  30. 245 ifpeek(cr)=60thenrf%=300:ra%=30:goto350
  31. 250 ifcr=1625thenifll%<2thengosub350:goto555
  32. 255 ifpeek(cr)=215thenrl%=2:rf%=rf%/2:rs%=rs%+100:goto350
  33. 260 return
  34. 265 ifpeek(cr)=31thenpoketl,32:tl=cr:ll%=ll%-1:poketl,ls:poketl+ac,6
  35. 270 ifpeek(cr)=lsthencl=cr:gosub210:goto380
  36. 275 ifpeek(cr)=60thenlf%=300:la%=30:goto375
  37. 280 ifcr=1302thenifrl%<2thengosub375:goto555
  38. 285 ifpeek(cr)=209thenll%=2:lf%=lf%/2:ls%=ls%+100:goto375
  39. 290 return
  40. 295 printm1$g1tab(30)m2$g2
  41. 300 forx=0to16:print:next
  42. 305 ifll%<1thenll%=0:la%=0:lf%=0
  43. 310 ifrl%<1thenrl%=0:ra%=0:rf%=0
  44. 315 lf%=lf%-1:rf%=rf%-1:iflf%<1thenlf%=0
  45. 320 ifrf%<1thenrf%=0
  46. 325 printm3$"   "tab(23)m4$"   "
  47. 330 printm5$la%tab(23)m4$ra%
  48. 335 printm6$"       "tab(23)m7$"      ":printm8$lf%tab(23)m7$rf%
  49. 340 printn1$"     "tab(23)n2$"      ":printn3$ll%tab(23)n2$rl%
  50. 345 printn4$"       "tab(23)n5$"       ":printn6$ls%tab(23)n5$rs%:return
  51. 350 poketr,32:tr=tr+e%
  52. 355 ifj2<3thenrv=rv+ad
  53. 360 ifj2>3thenrh=rh+ad
  54. 365 ad=0:iff2=0thenifra%>0thengosub140
  55. 370 return
  56. 375 poketl,32:tl=tl+e%
  57. 380 ifj1<3thenlv=lv+ad
  58. 385 ifj1>3thenlh=lh+ad
  59. 390 ad=0:iff1=0thenifla%>0thengosub110
  60. 395 return
  61. 400 ifrf%<1thenreturn
  62. 405 ifpeek(tr+e%)=32then350
  63. 410 cr=tr+e%:goto235
  64. 415 iflf%<1thenreturn
  65. 420 ifpeek(tl+e%)=32then375
  66. 425 cr=tl+e%:goto265
  67. 430 gosub295:j1=peek(p1):j2=peek(p2):f1=j1and16:f2=j2and16
  68. 435 j1=15-(j1and15):j2=15-(j2and15)
  69. 440 pokesv,6:pokesh,0:pokesl,240:iff2=0thenifj2=1theng2=g2+1:ifg2>9theng2=9
  70. 445 pokesa,128:pokess,128:pokesw,33:iff1=0andj1=1theng1=g1+1:ifg1>9theng1=9
  71. 450 iff2=0thenifj2=1theng2=g2+1:ifg2>9theng2=9
  72. 455 iff1=0thenifj1=2theng1=g1-1:ifg1<1theng1=1
  73. 460 iff2=0thenifj2=2theng2=g2-1:ifg2<1theng2=1
  74. 465 iff1=0thenifla%>0thenifj1=0thengosub110
  75. 470 iff2=0thenifra%>0thenifj2=0thengosub140
  76. 475 iflf%=0thenifrf%=0then555
  77. 480 iff1<>0thenifj1=1theniflv>1thenad=-1:e%=-40:ls=36:gosub415
  78. 485 iff2<>0thenifj2=1thenifrv>1thenad=-1:e%=-40:rs=38:gosub400
  79. 490 iff1<>0thenifj1=2theniflv<15thenad=1:e%=40:ls=36:gosub415
  80. 495 iff2<>0thenifj2=2thenifrv<15thenad=1:e%=40:rs=38:gosub400
  81. 500 ifj1=8theniflh<38thenad=1:e%=1:gosub415:ls=37
  82. 505 ifj2=8thenifrh<38thenad=1:e%=1:gosub400:rs=39
  83. 510 ifj1=4theniflh>0thenad=-1:e%=-1:gosub415:ls=37
  84. 515 ifj2=4thenifrh>0thenad=-1:e%=-1:gosub400:rs=39
  85. 520 ifll%>0thenpoketl,ls:poketl+ac,6
  86. 525 ifrl%>0thenpoketr,rs:poketr+ac,2
  87. 530 ifrl%<2thenpoke1364,215:poke1364+ac,2
  88. 535 ifll%<2thenpoke1523,209:poke1523+ac,6
  89. 540 getq$:ifq$="[209]"thencr=0:goto555
  90. 545 ifq$="[208]"thengosub650
  91. 550 goto430
  92. 555 fg=1:ifcr=1302thenls%=ls%+1000
  93. 560 ifcr=1625thenrs%=rs%+1000
  94. 565 gosub295:print"";:forx=0to39:printchr$(32);:next
  95. 570 ifcr=1302thenprint"     *    victory by blue army    *"
  96. 575 ifcr=1302thenpokecr,36:pokecr+ac,6:goto605
  97. 580 ifcr=1625thenprint"     *    victory by red army     *"
  98. 585 ifcr=1625thenpokecr,38:pokecr+ac,2:goto605
  99. 590 printchr$(19)tab(11)" * *    tie    * * "
  100. 595 ifrs%>ls%thenprint" red army victory "
  101. 600 ifls%>rs%thenprint" blue army victory "
  102. 605 du=102:s3=0:s4=240:s5=33
  103. 610 printtab(11)"     f1   [146] to quit"
  104. 615 printtab(11)"  any key [146] to play"
  105. 617 getq$:ifq$=""then617
  106. 618 ifq$="[133]"then1000
  107. 620 restore:poke198,0:forx=0to108:reada:nextx
  108. 630 reada,b:s1=a:s2=b:ifa=-1then620
  109. 635 gosub170:forx=0todu:next:ifq$=""then625
  110. 640 gosub205:fg=0:ifq$=chr$(133)then1000
  111. 645 run2
  112. 650 print"":fordu=0to18:print:nextdu:print" /pause/ ":poke198,0
  113. 655 getq$:ifq$=""then655
  114. 660 return
  115. 665 ls=37:rs=39:lh=0:lv=5:rh=38:rv=12:p2=56320:p1=56321
  116. 670 sv=54296:sh=54273:sl=54272:sa=54277:ss=54278:sw=54276
  117. 675 tl=1304:tr=1623:ac=54272:la%=30:ra%=30:g1=5:g2=5
  118. 680 lf%=400:rf%=400:ll%=9:rl%=9
  119. 685 m1$="elev":m2$="elev"
  120. 690 m3$="ammo   :":m4$="ammo   :":m5$="[145]ammo   :"
  121. 695 m6$="fuel   :":m7$="fuel   :":m8$="[145]fuel   :"
  122. 700 n1$="lives  :":n2$="lives  :":n3$="[145]lives  :"
  123. 705 n4$="score  :":n5$="score  :":n6$="[145]score  :"
  124. 710 print"[147]"tab(15)"b[149]at[153]t[153]l[129]e[149]f[150]iel[153]d"
  125. 715 print:forx=0to39:print"[149]+";:next:forx=0to14:print:next
  126. 720 forx=0to39:print"+";:next:x=int(rnd(0)*30)+10:c=5
  127. 725 forxx=0tox:t=int(rnd(0)*500):poket+1144,43:poket+55416,c:ifc=5thenc=6
  128. 730 c=c+1:ifc>9thenc=5
  129. 735 next
  130. 740 x=int(rnd(0)*10)+4
  131. 745 forxx=0tox:t=int(rnd(0)*500):poket+1144,31:poket+55416,11:next
  132. 750 x=int(rnd(0)*6)+4
  133. 755 forxx=0tox:t=int(rnd(0)*500):poket+1144,31:poket+55416,0:next:xx=0
  134. 760 forx=0to14:poke1162+xx,31:poke1163+xx,31:poke1164+xx,31:poke1165+xx,31
  135. 765 poke1162+ac+xx,11:poke1163+ac+xx,11
  136. 770 poke1164+ac+xx,11:poke1165+ac+xx,11:xx=xx+40:next
  137. 775 d1=1505:d2=1422:poked1,60:poked2,60:poke55777,6:poke55694,2
  138. 780 h1=1625:h2=1302:pokeh1,63:pokeh2,61:poke55897,6:poke55574,2
  139. 785 pokeh1+1,31:pokeh2-1,31:pokeh1+1+ac,11:pokeh2-1+ac,11
  140. 790 pokeh1-40,31:pokeh2-40,31:pokeh1-40+ac,11:pokeh2-40+ac,11
  141. 795 pokeh1+40,31:pokeh2+40,31:pokeh1+40+ac,11:pokeh2+40+ac,11
  142. 800 poketl,ls:poketl+ac,6:poketr,rs:poketr+ac,2:return
  143. 805 data 63,0,255,219,219,195,219,219,255,61,0,255,219,219,195,219,219,255
  144. 810 data 60,255,142,180,180,142,255,192,192,43,36,94,187,127,234,119,92,16
  145. 815 data 36,0,238,254,232,199,232,254,238,37,254,254,104,71,104,254,254,0
  146. 820 data 38,0,119,127,23,227,23,127,119,39,127,127,22,226,22,127,127,0
  147. 825 data 31,0,204,0,51,0,204,0,51,27,16,147,199,235,203,203,8,8
  148. 830 data 28,22,52,8,3,216,4,62,38,29,66,0,194,11,68,34,65,152,-1
  149. 835 data23,181,29,223,29,223,29,223,23,181,29,223,29,223,29,223,23
  150. 840 data181,29,223,29,223,29,223,23,181,17,195,17,195,17,195,17,195
  151. 845 data 29,223,29,223,23,181,17,195,23,181,29,223,29,223,29,223,23
  152. 850 data 181,29,223,29,223,29,223,23,181,-1,-1
  153. 855 poke53281,0:poke53280,0
  154. 860 printchr$(147)chr$(142):forx=0to24:print:nextx
  155. 865 print"     [223][146]  [169] [223][146]  [169]     [223][146]  [169]     [223][146]   [146]  [169]   [223]"
  156. 870 print" [146]     [146]   [146]  [146]      [146]         [146]      [146]   [146]"
  157. 875 print" [146]     [146]   [146]  [146]      [146]         [146]      [146]   [146]"
  158. 880 print" [162][162][162][162] [146]   [162] [146]      [146]         [146]      [146]   [162][162][162]"
  159. 885 print" [146]     [146]   [146]  [146]      [146]         [146]      [146]   [146]"
  160. 890 print" [146]     [146]   [146]  [146]      [146]         [146]      [146]   [146]"
  161. 895 print"     [146][169]   [146]  [146]      [146]         [146]      [146]  [223]    [146][169]"
  162. 900 print:printtab(13)"g.fields/pf/tpc"
  163. 905 print:print"                  1985                  "
  164. 910 forxx=0to6:forx=0to300:nextx:print:nextxx
  165. 915 print"             wait 35 seconds            ";
  166. 920 print"      while the troops get dressed      "
  167. 925 print"":forx=0to11:print:next
  168. 930 print"                                        ";
  169. 935 print" blue army: port 1   red army: port 2   ";
  170. 940 print"