If X Mouse<242 Then Add BIG(XOFF,YOFF,SIDE,1),-1,B To B+7 : Dec AP
If X Mouse>355 and X Mouse<400 Then Add BIG(XOFF,YOFF,SIDE,1),1,B To B+7 : Dec AP
If(Y Mouse>64 and Y Mouse<176 and X Mouse>241 and X Mouse<356)
Proc QUESTION["END THIS UNIT'S MOVE?"]
If PRORET=1
BIG(XOFF,YOFF,SIDE,2)=1
Pop Proc
End If
End If
If AP<1
BIG(XOFF,YOFF,SIDE,2)=1
Pop Proc
End If
If X Screen(X Mouse)>279 and X Screen(X Mouse)<301 and Y Screen(Y Mouse)>49 and Y Screen(Y Mouse)<71 and AP>9 and BIG(XOFF,YOFF,SIDE,0)=4 and SIDE=0 and BIG(XOFF,YOFF,1,1)=0
Bell 20 : SIDE=1 : AP=AP-10 : Swap BIG(XOFF,YOFF,1,1),BIG(XOFF,YOFF,0,1)
End If
If X Screen(X Mouse)>279 and X Screen(X Mouse)<301 and Y Screen(Y Mouse)>99 and Y Screen(Y Mouse)<121 and AP>9 and BIG(XOFF,YOFF,SIDE,0)=4 and SIDE=1 and BIG(XOFF,YOFF,0,1)=0
Bell 20 : SIDE=0 : AP=AP-10 : Swap BIG(XOFF,YOFF,1,1),BIG(XOFF,YOFF,0,1)
End If
Proc DSCREEN["move unit",AP]
SKIP3:
Loop
End Proc
Procedure QUESTION[Q$]
Cls 0
Pen 1
Locate 0,10
Centre Q$
Locate 0,2
Centre "YES"
Ink 1
Draw 0,100 To 320,100
Locate 0,18
Centre "NO"
Screen Swap
Clear Key
Wait 20
Do
I$=Inkey$
If Lower$(I$)="y" or(Mouse Key<>0 and Y Mouse<140)
PRORET=1 : Pop Proc
End If
If Lower$(I$)="n" or(Mouse Key<>0 and Y Mouse>139)
PRORET=0 : Pop Proc
End If
Loop
End Proc
Procedure H2H[XM,YM]
Shoot
I=BIG(XOFF,YOFF,SIDE,1)
AC=0
Proc PDATA[I]
WS=PRORET1 : WD=PRORET2 : AC=PRORET6 : If AC=2 Then ACC=1 Else ACC=0
I=BIG(XOFF+XM,YOFF+YM,SIDE,1)
Proc PDATA[I]
WS2=PRORET1 : AR=PRORET5 : If PRORET6>0 Then AC=PRORET6
S=BIG(XOFF+XM,YOFF+YM,SIDE,0)
If S=12
BIG(XOFF+XM,YOFF+YM,SIDE,0)=11
Pop Proc
End If
If S=13
BIG(XOFF+XM,YOFF+YM,SIDE,0)=10
Pop Proc
End If
If WS+Rnd(5)>WS2+Rnd(5) and Rnd(5)+1+WD>AR
BIG(XOFF+XM,YOFF+YM,SIDE,1)=999
Boom
If AC=1
BIG(XOFF+XM,YOFF+YM,SIDE,0)=16
End If
If ACC=1 and(BIG(XOFF+XM,YOFF+YM,SIDE,1)<49 or BIG(XOFF+XM,YOFF+YM,SIDE,1)>50)
BIG(XOFF+XM,YOFF+YM,SIDE,1)=33
BIG(XOFF+XM,YOFF+YM,SIDE,2)=1
End If
Proc DSCREEN["GOT THE GIT !!!",0]
If PLYER=1
Inc VIC1
End If
If PLYER=2
Inc VIC2
End If
Wait 10
End If
End Proc
Procedure ZAP
BIG(XOFF,YOFF,SIDE,2)=1
XF=XOFF : YF=YOFF
I=BIG(XOFF,YOFF,SIDE,1)
Proc PDATA[I]
AN=PRORET4 : WD=PRORET3 : B=PRORET7 : AP=PRORET
FC=I+1-B
For T=1 To AN
Do
Proc SELECT["choose a target"]
XT=XOFF : YT=YOFF
Proc LOSTRACE[XF,YF,XT,YT,FC]
If PRORET=1
Exit
End If
Proc QUESTION["no line of sight to target:abort fire?"]
If PRORET=1
Pop Proc
End If
Loop
I=BIG(XT,YT,SIDE,1)
Proc PDATA[I]
AR=PRORET5 : AC=PRORET6
If WD=0
Bell
End If
If WD=1 or WD=2
Shoot
End If
If WD=3
Boom
End If
RG=Sqr((Abs(XT-XF)^2)+(Abs(YT-YF)^2))/4
If Rnd(10)-RG>0
Proc DSCREEN["a hit !",0]
D=BIG(XT,YT,SIDE,0)
If(D=8 or D=9 or D=12 or D=13 or D=18 or D=17) and WD>1
If Abs(XM#)=>Abs(YM#) Then Gosub XDRAW Else Gosub YDRAW
Goto NDDRAW
XDRAW:
If XM#<0 Then STP=-1
If XM#>0 Then STP=1
If XM=0 Then Goto NDDRAW
YINC#=YM#/Abs(XM#)
Y#=Y1
For X=X1 To X2 Step STP
YR=Y#
A=BIG(X,YR,SIDE,0)
B=BIG(X,YR,SIDE,1)
If(X<>X1 or YR<>Y1) and(X<>X2 or YR<>Y2)
If B>0 or A=1 or A=2 or A=8 or A=9 or A=12 or A=13
PRORET=0 : Pop Proc
End If
End If
Y#=Y#+YINC#
Next X
Return
YDRAW:
If YM#<0 Then STP=-1
If YM#>0 Then STP=1
If YM=0 Then Goto NDDRAW
YINC#=XM#/Abs(YM#)
Y#=X1
For X=Y1 To Y2 Step STP
YR=Y#
A=BIG(YR,X,SIDE,0)
B=BIG(YR,X,SIDE,1)
If(YR<>X1 or X<>Y1) and(YR<>X2 or X<>Y2)
If B>0 or A=1 or A=2 or A=8 or A=9 or A=12 or A=13
PRORET=0 : Pop Proc
End If
End If
Y#=Y#+YINC#
Next X
Return
NDDRAW:
End Proc
Procedure GAMEOVER
Autoback 1
Pen 8
Locate 0,0
Centre "Game Over!"
Locate 0,2
If PRORET1=0 and PRORET2=1 Then Print "All good guys dead!" : Print "total alien victory!"
If PRORET1=1 and PRORET2=0 Then Print "Al1 aliens terminated" : Print "total goodguy victory!"
Print
Print "marines score:";VIC1
Print "aliens score:";VIC2
While(Mouse Click=0) and(Inkey$="") : Bell Rnd(50)+10 : Wend
End Proc
Procedure ALIENMOVE
XST=XOFF : YST=YOFF
Cls 0
Locate 0,0
Pen 5
Centre "ALIENS TURN"
Locate 0,2 : Centre "please wait"
Screen Swap
For X=0 To 31
For Y=0 To 31
For Z=0 To 1
A=BIG(X,Y,Z,0)
I=BIG(X,Y,Z,1)
If BIG(X,Y,Z,2)=0 and((I>24 and I<49) or(I>50 and I<59) or(I>0 and I<9) or(I>127 and I<144))
AP=30
Proc PDATA[I]
B=PRORET7 : AP=PRORET
XT=X : YT=Y
Do
For O=XT To 31 Step 1
N=BIG(O,YT,Z,0) : M=BIG(O,YT,Z,1)
If N=1 or N=2 or N=8 or N=9 or N=12 or N=13
Exit 1
End If
If(M>8 and M<25) or(M>71 and M<128)
BIG(XT,YT,Z,1)=B+2
AP=AP-Abs(I-B+2)
If(BIG(XT,YT,Z,1)>0 and BIG(XT,YT,Z,1)<9) or(BIG(XT,YT,Z,1)>24 and BIG(XT,YT,Z,1)<33) or(BIG(XT,YT,Z,1)>40 and BIG(XT,YT,Z,1)<49) or(BIG(XT,YT,Z,1)>127 and BIG(XT,YT,Z,1)<144)
If AP>0
Proc HELLFIRE[XT,YT,O,YT,Z]
AP=0
End If
End If
Exit
Else
If M>0 and O<>XT
Exit
End If
End If
Next O
For O=XT To 0 Step -1
N=BIG(O,YT,Z,0) : M=BIG(O,YT,Z,1)
If N=1 or N=2 or N=8 or N=9 or N=12 or N=13
Exit 1
End If
If(M>8 and M<25) or(M>71 and M<128)
BIG(XT,YT,Z,1)=B+6
AP=AP-Abs(I-B+6)
If(BIG(XT,YT,Z,1)>0 and BIG(XT,YT,Z,1)<9) or(BIG(XT,YT,Z,1)>24 and BIG(XT,YT,Z,1)<33) or(BIG(XT,YT,Z,1)>40 and BIG(XT,YT,Z,1)<49) or(BIG(XT,YT,Z,1)>127 and BIG(XT,YT,Z,1)<144)
If AP>0
Proc HELLFIRE[XT,YT,O,YT,Z]
AP=0
End If
End If
Exit
Else
If M>0 and O<>XT
Exit
End If
End If
Next O
For O=YT To 31 Step 1
N=BIG(XT,O,Z,0) : M=BIG(XT,O,Z,1)
If N=1 or N=2 or N=8 or N=9 or N=12 or N=13
Exit 1
End If
If(M>8 and M<25) or(M>71 and M<128)
BIG(XT,YT,Z,1)=B+4
AP=AP-Abs(I-B+4)
If(BIG(XT,YT,Z,1)>0 and BIG(XT,YT,Z,1)<9) or(BIG(XT,YT,Z,1)>24 and BIG(XT,YT,Z,1)<33) or(BIG(XT,YT,Z,1)>40 and BIG(XT,YT,Z,1)<49) or(BIG(XT,YT,Z,1)>127 and BIG(XT,YT,Z,1)<144)
If AP>0
Proc HELLFIRE[XT,YT,XT,O,Z]
AP=0
End If
End If
Exit
Else
If M>0 and O<>YT
Exit
End If
End If
Next O
For O=YT To 0 Step -1
N=BIG(XT,O,Z,0) : M=BIG(XT,O,Z,1)
If N=1 or N=2 or N=8 or N=9 or N=12 or N=13
Exit 1
End If
If(M>8 and M<25) or(M>71 and M<128)
BIG(XT,YT,Z,1)=B
AP=AP-Abs(I-B)
If(BIG(XT,YT,Z,1)>0 and BIG(XT,YT,Z,1)<9) or(BIG(XT,YT,Z,1)>24 and BIG(XT,YT,Z,1)<33) or(BIG(XT,YT,Z,1)>40 and BIG(XT,YT,Z,1)<49) or(BIG(XT,YT,Z,1)>127 and BIG(XT,YT,Z,1)<144)
If AP>0
Proc HELLFIRE[XT,YT,XT,O,Z]
AP=0
End If
End If
Exit
Else
If M>0 and O<>YT
Exit
End If
End If
Next O
I=BIG(XT,YT,Z,1)
F=I+1-B
If F=1 or F=8 or F=2
YM=-1
End If
If F=3 or F=7
YM=0
End If
If F=4 or F=5 or F=6
YM=1
End If
If F=6 or F=7 or F=8
XM=-1
End If
If F=1 or F=5
XM=0
End If
If F=2 or F=3 or F=4
XM=1
End If
If XT+XM>31 or XT+XM<0 or YT+YM>31 or YT+YM<0
Dec AP
N6=BIG(XT,YT,Z,1)
Add N6,1,B To B+7
BIG(XT,YT,Z,1)=N6
Goto SKIPIT
End If
N=BIG(XT+XM,YT+YM,Z,0)
M=BIG(XT+XM,YT+YM,Z,1)
If N<3 or(N>7 and N<10) or((N>11 and N<14) and AP<10) or(M>0 and M<9) or(M>24 and M<72 or(M>127 and M<144))
Dec AP
N6=BIG(XT,YT,Z,1)
Add N6,1,B To B+7
BIG(XT,YT,Z,1)=N6
Goto SKIPIT
End If
If N=13
AP=AP-10
BIG(XT+XM,YT+YM,Z,0)=10
Shoot
End If
If N=12
AP=AP-10
BIG(XT+XM,YT+YM,Z,0)=11
Shoot
End If
If(M>8 and M<25) or(M>71 and M<128)
XOFF=XT : YOFF=YT
Proc DSCREEN["under attack",0]
SIDE=Z
Proc H2H[XM,YM]
AP=AP-10
Else
Swap BIG(XT,YT,Z,1),BIG(XT+XM,YT+YM,Z,1)
XT=XT+XM : YT=YT+YM
APC=4
N2=BIG(XT,YT,Z,0)
If N2=3 or N2=5
APC=6
End If
AP=AP-APC
End If
If BIG(XT,YT,Z,0)=14
Bell
BIG(XT,YT,Z,0)=7
Inc VIC2
End If
SKIPIT: Rem line
If Rnd(1)=0 and AP>9 and BIG(XT,YT,Z,0)=4 and Z=0 and BIG(XT,YT,1,1)=0
Bell 20 : AP=AP-10 : Swap BIG(XT,YT,1,1),BIG(XT,YT,0,1)
End If
If Rnd(1)=0 and AP>9 and BIG(XT,YT,Z,0)=4 and Z=1 and BIG(XT,YT,0,1)=0
Bell 20 : AP=AP-10 : Swap BIG(XT,YT,1,1),BIG(XT,YT,0,1)
End If
If AP<1
BIG(XT,YT,Z,2)=1
Exit 1
End If
Loop
End If
If((I>0 and I<9) or(I>24 and I<33) or(I>40 and I<49))
End If
Next Z
Next Y
Next X
XOFF=XST : YOFF=YST
End Proc
Procedure HELLFIRE[X1,Y1,X2,Y2,Z]
I=BIG(X1,Y1,Z,1)
Proc PDATA[I]
WD=PRORET3 : AN=PRORET4
If AN=0 and WD=0 Then Pop Proc
I=BIG(X2,Y2,Z,1)
Proc PDATA[I]
AR=PRORET5
If AN=0 Then Pop Proc
XMR=XOFF : YMR=YOFF
XOFF=X2 : YOFF=Y2
Shoot
If WD>2
Boom
End If
Proc DSCREEN["under fire !",0]
RG=Sqr((Abs(X1-X2)^2)+(Abs(Y1-Y2)^2))/4
For T=1 To AN
If Rnd(10)-RG>0
Proc DSCREEN["a hit !",0]
D=BIG(X2,Y2,Z,0)
If(D=8 or D=9 or D=12 or D=13) and WD>1
BIG(X2,Y2,Z,0)=5
End If
If BIG(X2,Y2,Z,1)>0
If(Rnd(5)+1+WD)>AR
Boom
BIG(X2,Y2,Z,1)=999
Proc DSCREEN["a kill !!",0]
Inc VIC2
Else
Proc DSCREEN["deflected !!",0] : Wait 10
End If
End If
End If
Next T
XOFF=XMR : YOFF=YMR
End Proc
Procedure PDATA[I]
If I>0 and I<9 Then WS=0 : WD=0 : AP=50 : RWD=0 : AN=1 : AR=2 : B=1
If I>8 and I<17 Then WS=2 : WD=1 : AP=30 : RWD=1 : AN=1 : AR=3 : B=9
If I>16 and I<25 Then WS=3 : WD=3 : AP=30 : RWD=1 : AN=2 : AR=5 : B=17
If I>24 and I<33 Then WS=0 : WD=0 : AP=20 : RWD=3 : AN=1 : AR=5 : B=25
If I>32 and I<41 Then WS=3 : WD=2 : AP=40 : AR=3 : AC=1 : B=33
If I>40 and I<49 Then WS=2 : WD=1 : AP=30 : RWD=1 : AN=1 : AR=1 : AC=1 : B=41
If I>50 and I<59 Then WS=0 : WD=0 : AP=50 : AC=2 : B=51
If I>71 and I<80 Then WS=2 : WD=1 : AP=20 : RWD=4 : AN=1 : AR=3 : B=72
If I>79 and I<88 Then WS=3 : WD=3 : AP=30 : RWD=2 : AN=3 : AR=5 : B=80
If I>87 and I<96 Then WS=2 : WD=1 : AP=40 : RWD=1 : AN=2 : AR=2 : B=88
If I>95 and I<104 Then WS=4 : WD=2 : AP=50 : RWD=1 : AN=1 : AR=3 : B=96
If I>103 and I<112 Then WS=2 : WD=0 : AP=25 : RWD=0 : AN=1 : AR=1 : B=104
If I>111 and I<120 Then WS=2 : WD=0 : AP=25 : RWD=2 : AN=2 : AR=1 : B=112
If I>119 and I<128 Then WS=3 : WD=2 : AP=25 : RWD=1 : AN=1 : AR=5 : B=120
If I>127 and I<136 Then WS=1 : WD=1 : AP=30 : RWD=1 : AN=1 : AR=1 : B=128
If I>135 and I<144 Then WS=1 : WD=0 : AP=20 : RWD=3 : AN=3 : AR=1 : B=136