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