home *** CD-ROM | disk | FTP | other *** search
/ AMOS PD CD / amospdcd.iso / 476-500 / apd494 / alliance.amos / alliance.amosSourceCode next >
AMOS Source Code  |  1989-04-03  |  18KB  |  899 lines

  1. Set Buffer 100
  2. Dim BIG(31,31,1,2)
  3. Global BIG(),SIDE,PRORET,PRORET1,PRORET2,PRORET3,PRORET4,PRORET5,PRORET6,PRORET7,PLRS,XOFF,YOFF,PLYER,VIC1,VIC2
  4. Proc SETUP
  5. Procedure SETUP
  6. Reserve As Work 5,17000
  7. Flash Off 
  8. Curs Off 
  9. Cls 0
  10. Hide On 
  11. Sprite 8,X Mouse,Y Mouse,1
  12. Channel 0 To Sprite 8
  13. Amal 0,"L:LX=XM;LY=YM;JL"
  14. Amal On 0
  15. Get Sprite Palette 
  16. For T=0 To 15
  17. N=Colour(T)
  18. Colour T+16,N
  19. Next T
  20. Get Icon Palette %1111111111111111
  21. Double Buffer 
  22. End Proc
  23. GENESIS: Autoback 1
  24. Randomize Timer
  25. Cls 0
  26. SIDE=0
  27. Proc TITLE
  28. Proc GAME
  29. Proc GAMEOVER
  30. Goto GENESIS
  31. Procedure TITLE
  32. Locate 0,0
  33. Pen 1
  34. Paper 0
  35. Centre "ALLIANCE by mark potter"
  36. A=14 : B=22 : C=30 : D=38 : E=46 : F=54 : G=64
  37. Autoback 0
  38. Ink 0
  39. While Mouse Click=0
  40. Bar 0,50 To 15,65 : Paste Icon 0,50,A : Add A,1,14 To 21
  41. Bar 40,50 To 55,65 : Paste Icon 40,50,B : Add B,1,22 To 29
  42. Bar 80,50 To 95,65 : Paste Icon 80,50,C : Add C,1,30 To 37
  43. Bar 120,50 To 135,65 : Paste Icon 120,50,D : Add D,1,38 To 45
  44. Bar 160,50 To 175,65 : Paste Icon 160,50,E : Add E,1,46 To 53
  45. Bar 200,50 To 215,65 : Paste Icon 200,50,F : Add F,1,54 To 61
  46. Bar 240,50 To 255,65 : Paste Icon 240,50,G : Add G,1,64 To 71
  47. H=Rnd(320) : I=Rnd(100) : J=Rnd(73)
  48. Paste Icon H,I+100,J+1
  49. Screen Swap : Wait Vbl 
  50. Paste Icon H,I+100,J+1
  51. Wend 
  52. Autoback 1
  53. Cls 0
  54. Boom 
  55. Locate 0,0
  56. Pen 3
  57. Print "Options:"
  58. Print "1:load level"
  59. Print "2:start a 1 player game"
  60. Print "3:start a 2 player game"
  61. Print "5:quit program"
  62. Do 
  63. I$=Inkey$
  64. If I$="5"
  65. Print "are you sure(Y/N)?"
  66. Input J$
  67. If Left$(Upper$(J$),1)="Y"
  68. Edit 
  69. End If 
  70. End If 
  71. If I$="1"
  72. Show On 
  73. F$=Fsel$("","","load a level file","")
  74. Hide On 
  75. If F$<>""
  76. Load F$,5
  77. N=Start(5)
  78. For X=0 To 31
  79. For Y=0 To 31
  80. For S=0 To 1
  81. For M=0 To 1
  82. BIG(X,Y,S,M)=Leek(N) : N=N+4
  83. Next M
  84. Next S
  85. Next Y
  86. Next X
  87. Print "O.K"
  88. End If 
  89. End If 
  90. If I$="2" Then PLRS=1 : Exit 
  91. If I$="3" Then PLRS=2 : Exit 
  92. Loop 
  93. Curs Off 
  94. End Proc
  95. Procedure SELECT[T$]
  96. Cls 0
  97. Proc DSCREEN[T$,0]
  98. Autoback 0
  99. Do 
  100. I$=Inkey$
  101. If I$="l" Then Proc LGAME
  102. If I$="s" Then Proc SGAME
  103. XSC=0 : YSC=0
  104. If Mouse Key=0 Then Goto SKIP2
  105. If Y Mouse<65 and YOFF>0 Then Dec YOFF
  106. If Y Mouse>175 and YOFF<31 Then Inc YOFF
  107. If X Mouse<242 and XOFF>0 Then Dec XOFF
  108. If X Mouse>355 and XOFF<31 Then Inc XOFF
  109. If Y Mouse>64 and Y Mouse<176 and X Mouse>241 and X Mouse<356
  110. Bell 10
  111. XS=((X Mouse-242)/16)-3
  112. YS=((Y Mouse-65)/16)-3
  113. If XOFF+XS>-1 and XOFF+XS<32 and YOFF+YS>-1 and YOFF+YS<32
  114. XOFF=XOFF+XS : YOFF=YOFF+YS
  115. Pop Proc
  116. End If 
  117. End If 
  118. If X Screen(X Mouse)>279 and X Screen(X Mouse)<301 and Y Screen(Y Mouse)>49 and Y Screen(Y Mouse)<71 Then Bell : SIDE=1
  119. If X Screen(X Mouse)>279 and X Screen(X Mouse)<301 and Y Screen(Y Mouse)>99 and Y Screen(Y Mouse)<121 Then Bell : SIDE=0
  120. Proc DSCREEN[T$,0]
  121. SKIP2:
  122. Loop 
  123. End Proc
  124. Procedure DSCREEN[T$,AP]
  125. Cls 0
  126. Ink 3 : Bar 280,50 To 300,70 : Ink 5 : Bar 280,100 To 300,120
  127. Locate 0,0 : Pen 3 : Paper 0 : Centre T$
  128. Locate 0,10 : Print "X:";XOFF;",Y:";YOFF
  129. If AP>0
  130. Locate 0,12 : Print "AP:";AP
  131. End If 
  132. For X=1 To 7
  133. For Y=1 To 7
  134. If XOFF+X-4>31 or XOFF+X-4<0 or YOFF+Y-4>31 or YOFF+Y-4<0 Then N=1 : N2=0 : Goto SKIP
  135. N=BIG(XOFF+X-4,YOFF+Y-4,SIDE,0)
  136. N2=BIG(XOFF+X-4,YOFF+Y-4,SIDE,1)
  137. SKIP:
  138. I=0
  139. If N<14 and N>0 Then I=N
  140. If N=16 Then I=74
  141. If N=14 Then I=72
  142. If N=18 Then I=148
  143. If N=17 Then I=147
  144. If N2>0 and N2<72 Then I=N2+13
  145. If N2>71 Then I=N2+3
  146. If N2=999 Then I=73 : BIG(XOFF+X-4,YOFF+Y-4,SIDE,1)=0
  147. If I>0 Then Paste Icon(X*16)+100,(Y*16),I Else Ink 0 : Bar(X*16)+100,(Y*16) To(X*16)+116,(Y*16)+16
  148. Next Y
  149. Next X
  150. Screen Swap 
  151. Wait Vbl 
  152. End Proc
  153. Procedure GAME
  154. Do 
  155. Cls 0
  156. Pen 3 : Paper 0
  157. Locate 0,5
  158. Centre "GOOD GUYS TURN"
  159. PLYER=1
  160. Locate 0,7
  161. Print "points:";VIC1
  162. Sprite 8,,,1
  163. Screen Swap 
  164. Wait 10
  165. While Mouse Key=0 : Wend 
  166. Cls 0
  167. Pen 3 : Paper 0
  168. Locate 0,5
  169. Centre "MOVEMENT PHASE"
  170. Screen Swap 
  171. While Mouse Key=0 : Wend 
  172. Wait 10
  173. Do 
  174. Proc SELECT["PICK A PLAYER TO MOVE"]
  175. N=BIG(XOFF,YOFF,SIDE,1)
  176. If BIG(XOFF,YOFF,SIDE,2)=0 and((N>8 and N<25) or(N>71 and N<128))
  177. Bell 
  178. Proc MOVEMAN
  179. Else 
  180. Proc QUESTION["end movement phase?"]
  181. If PRORET=1
  182. Exit 
  183. End If 
  184. End If 
  185. Loop 
  186. Cls 0
  187. Pen 3 : Paper 0
  188. Locate 0,5
  189. Centre "FIRING PHASE"
  190. Sprite 8,,,2
  191. Screen Swap 
  192. For X=0 To 31
  193. For Y=0 To 31
  194. For Z=0 To 1
  195. BIG(X,Y,Z,2)=0
  196. Next Z
  197. Next Y
  198. Next X
  199. While Mouse Key=0 : Wend 
  200. Wait 10
  201. Do 
  202. Proc SELECT["SELECT UNIT TO FIRE"]
  203. N=BIG(XOFF,YOFF,SIDE,1)
  204. If BIG(XOFF,YOFF,SIDE,2)=0 and((N>8 and N<25) or(N>71 and N<128))
  205. Bell 
  206. Proc ZAP
  207. Else 
  208. Proc QUESTION["end firing phase?"]
  209. If PRORET=1
  210. Exit 
  211. End If 
  212. End If 
  213. Loop 
  214. If PLRS=2
  215. Cls 0
  216. Pen 5 : Paper 0
  217. Locate 0,5
  218. Centre "ALIENS TURN"
  219. PLYER=2
  220. Locate 0,7
  221. Print "points:";VIC2
  222. Sprite 8,,,3
  223. Screen Swap 
  224. Wait 10
  225. While Mouse Key=0 : Wend 
  226. Do 
  227. Proc SELECT["PICK A PLAYER TO MOVE"]
  228. N=BIG(XOFF,YOFF,SIDE,1)
  229. If BIG(XOFF,YOFF,SIDE,2)=0 and((N>0 and N<9) or(N>24 and N<62) or(N>63 and N<72) or(N>24 and N<62) or(N>127 and N<144))
  230. Bell 
  231. Proc MOVEMAN
  232. Else 
  233. Proc QUESTION["End move phase?"]
  234. If PRORET=1
  235. Exit 
  236. End If 
  237. End If 
  238. Loop 
  239. Cls 0
  240. Pen 5 : Paper 0
  241. Locate 0,5
  242. Centre "FIRING PHASE"
  243. Sprite 8,,,2
  244. Screen Swap 
  245. For X=0 To 31
  246. For Y=0 To 31
  247. For Z=0 To 1
  248. BIG(X,Y,Z,2)=0
  249. Next Z
  250. Next Y
  251. Next X
  252. While Mouse Key=0 : Wend 
  253. Wait 10
  254. Do 
  255. Proc SELECT["SELECT UNIT TO FIRE"]
  256. N=BIG(XOFF,YOFF,SIDE,1)
  257. If BIG(XOFF,YOFF,SIDE,2)=0 and((N>40 and N<49) or(N>24 and N<33) or(N>0 and N<9) or(N>24 and N<62) or(N>127 and N<144))
  258. Bell 
  259. Proc ZAP
  260. Else 
  261. Proc QUESTION["end firing phase?"]
  262. If PRORET=1
  263. Exit 
  264. End If 
  265. End If 
  266. Loop 
  267. Else 
  268. Proc ALIENMOVE
  269. End If 
  270. Cls 0
  271. Pen 1
  272. Locate 0,0
  273. Centre "END PHASE"
  274. Screen Swap 
  275. Wait 10
  276. VIK1=0
  277. VIK2=0
  278. For X=0 To 31
  279. For Y=0 To 31
  280. For Z=0 To 1
  281. N=BIG(X,Y,Z,1)
  282. If((N>8 and N<25) or(N>71 and N<128)) Then VIK1=1
  283. If((N>0 and N<9) or(N>24 and N<72) or(N>127 and N<144)) Then VIK2=1
  284. BIG(X,Y,Z,2)=0
  285. If BIG(X,Y,Z,0)=16 and Rnd(5)=0 Then BIG(X,Y,Z,0)=6
  286. If BIG(X,Y,Z,1)=50 Then BIG(X,Y,Z,1)=51
  287. If BIG(X,Y,Z,1)=49 and Rnd(10)=0 Then BIG(X,Y,Z,1)=50
  288. Next Z
  289. Next Y
  290. Next X
  291. If VIK1=0 or VIK2=0 Then PRORET1=VIK1 : PRORET2=VIK2 : Pop Proc
  292. Loop 
  293. End Proc
  294. Procedure MOVEMAN
  295. I=BIG(XOFF,YOFF,SIDE,1)
  296. Proc PDATA[I]
  297. B=PRORET7 : AP=PRORET
  298. Proc DSCREEN["move unit",AP]
  299. Cls 0
  300. Autoback 0
  301. Do 
  302. I=BIG(XOFF,YOFF,SIDE,1)
  303. F=I+1-B
  304. If F=1 or F=8 or F=2 Then YM=-1
  305. If F=3 or F=7 Then YM=0
  306. If F=4 or F=5 or F=6 Then YM=1
  307. If F=6 or F=7 or F=8 Then XM=-1
  308. If F=1 or F=5 Then XM=0
  309. If F=2 or F=3 or F=4 Then XM=1
  310. XSC=0 : YSC=0
  311. If Mouse Key=0 Then Goto SKIP3
  312. If Y Mouse>175 and XOFF+XM>-1 and XOFF+XM<32 and YOFF+YM>-1 and YOFF+YM<32
  313. TRAP=4
  314. If XM<>0 and YM<>0
  315. TRAP=6
  316. End If 
  317. T=BIG(XOFF+XM,YOFF+YM,SIDE,0)
  318. If T=14
  319. Bell 
  320. BIG(XOFF+XM,YOFF+YM,SIDE,0)=7
  321. If PLYER=1
  322. Inc VIC1
  323. End If 
  324. If PLYER=2
  325. Inc VIC2
  326. End If 
  327. End If 
  328. If T=17 and AP>10
  329. Proc QUESTION["computer functions:close all doors?"]
  330. If PRORET=1
  331. For XDR=0 To 31
  332. For YDR=0 To 31
  333. For ZDR=0 To 1
  334. If BIG(XDR,YDR,ZDR,0)=10
  335. BIG(XDR,YDR,ZDR,0)=13
  336. End If 
  337. If BIG(XDR,YDR,ZDR,0)=11
  338. BIG(XDR,YDR,ZDR,0)=12
  339. End If 
  340. Next ZDR
  341. Next YDR
  342. Next XDR
  343. End If 
  344. Proc QUESTION["computer functions:open all doors?"]
  345. If PRORET=1
  346. For XDR=0 To 31
  347. For YDR=0 To 31
  348. For ZDR=0 To 1
  349. If BIG(XDR,YDR,ZDR,0)=13
  350. BIG(XDR,YDR,ZDR,0)=10
  351. End If 
  352. If BIG(XDR,YDR,ZDR,0)=12
  353. BIG(XDR,YDR,ZDR,0)=11
  354. End If 
  355. Next ZDR
  356. Next YDR
  357. Next XDR
  358. End If 
  359. End If 
  360. If T=12 or T=13
  361. If AP>9
  362. Proc H2H[XM,YM]
  363. AP=AP-10
  364. End If 
  365. End If 
  366. If(T>2 and T<8) or T=10 or T=11 or T=18
  367. If T=5 or T=3
  368. TRAP=TRAP+4
  369. End If 
  370. If AP=>TRAP
  371. If BIG(XOFF+XM,YOFF+YM,SIDE,1)=0
  372. Swap BIG(XOFF,YOFF,SIDE,1),BIG(XOFF+XM,YOFF+YM,SIDE,1) : AP=AP-TRAP
  373. Bell 5
  374. XOFF=XOFF+XM : YOFF=YOFF+YM
  375. Else 
  376. If AP>9
  377. Proc H2H[XM,YM]
  378. AP=AP-10
  379. End If 
  380. End If 
  381. End If 
  382. End If 
  383. End If 
  384. If X Mouse<242 Then Add BIG(XOFF,YOFF,SIDE,1),-1,B To B+7 : Dec AP
  385. If X Mouse>355 and X Mouse<400 Then Add BIG(XOFF,YOFF,SIDE,1),1,B To B+7 : Dec AP
  386. If(Y Mouse>64 and Y Mouse<176 and X Mouse>241 and X Mouse<356)
  387. Proc QUESTION["END THIS UNIT'S MOVE?"]
  388. If PRORET=1
  389. BIG(XOFF,YOFF,SIDE,2)=1
  390. Pop Proc
  391. End If 
  392. End If 
  393. If AP<1
  394. BIG(XOFF,YOFF,SIDE,2)=1
  395. Pop Proc
  396. End If 
  397. 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
  398. Bell 20 : SIDE=1 : AP=AP-10 : Swap BIG(XOFF,YOFF,1,1),BIG(XOFF,YOFF,0,1)
  399. End If 
  400. 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
  401. Bell 20 : SIDE=0 : AP=AP-10 : Swap BIG(XOFF,YOFF,1,1),BIG(XOFF,YOFF,0,1)
  402. End If 
  403. Proc DSCREEN["move unit",AP]
  404. SKIP3:
  405. Loop 
  406. End Proc
  407. Procedure QUESTION[Q$]
  408. Cls 0
  409. Pen 1
  410. Locate 0,10
  411. Centre Q$
  412. Locate 0,2
  413. Centre "YES"
  414. Ink 1
  415. Draw 0,100 To 320,100
  416. Locate 0,18
  417. Centre "NO"
  418. Screen Swap 
  419. Clear Key 
  420. Wait 20
  421. Do 
  422. I$=Inkey$
  423. If Lower$(I$)="y" or(Mouse Key<>0 and Y Mouse<140)
  424. PRORET=1 : Pop Proc
  425. End If 
  426. If Lower$(I$)="n" or(Mouse Key<>0 and Y Mouse>139)
  427. PRORET=0 : Pop Proc
  428. End If 
  429. Loop 
  430. End Proc
  431. Procedure H2H[XM,YM]
  432. Shoot 
  433. I=BIG(XOFF,YOFF,SIDE,1)
  434. AC=0
  435. Proc PDATA[I]
  436. WS=PRORET1 : WD=PRORET2 : AC=PRORET6 : If AC=2 Then ACC=1 Else ACC=0
  437. I=BIG(XOFF+XM,YOFF+YM,SIDE,1)
  438. Proc PDATA[I]
  439. WS2=PRORET1 : AR=PRORET5 : If PRORET6>0 Then AC=PRORET6
  440. S=BIG(XOFF+XM,YOFF+YM,SIDE,0)
  441. If S=12
  442. BIG(XOFF+XM,YOFF+YM,SIDE,0)=11
  443. Pop Proc
  444. End If 
  445. If S=13
  446. BIG(XOFF+XM,YOFF+YM,SIDE,0)=10
  447. Pop Proc
  448. End If 
  449. If WS+Rnd(5)>WS2+Rnd(5) and Rnd(5)+1+WD>AR
  450. BIG(XOFF+XM,YOFF+YM,SIDE,1)=999
  451. Boom 
  452. If AC=1
  453. BIG(XOFF+XM,YOFF+YM,SIDE,0)=16
  454. End If 
  455. If ACC=1 and(BIG(XOFF+XM,YOFF+YM,SIDE,1)<49 or BIG(XOFF+XM,YOFF+YM,SIDE,1)>50)
  456. BIG(XOFF+XM,YOFF+YM,SIDE,1)=33
  457. BIG(XOFF+XM,YOFF+YM,SIDE,2)=1
  458. End If 
  459. Proc DSCREEN["GOT THE GIT !!!",0]
  460. If PLYER=1
  461. Inc VIC1
  462. End If 
  463. If PLYER=2
  464. Inc VIC2
  465. End If 
  466. Wait 10
  467. End If 
  468. End Proc
  469. Procedure ZAP
  470. BIG(XOFF,YOFF,SIDE,2)=1
  471. XF=XOFF : YF=YOFF
  472. I=BIG(XOFF,YOFF,SIDE,1)
  473. Proc PDATA[I]
  474. AN=PRORET4 : WD=PRORET3 : B=PRORET7 : AP=PRORET
  475. FC=I+1-B
  476. For T=1 To AN
  477. Do 
  478. Proc SELECT["choose a target"]
  479. XT=XOFF : YT=YOFF
  480. Proc LOSTRACE[XF,YF,XT,YT,FC]
  481. If PRORET=1
  482. Exit 
  483. End If 
  484. Proc QUESTION["no line of sight to target:abort fire?"]
  485. If PRORET=1
  486. Pop Proc
  487. End If 
  488. Loop 
  489. I=BIG(XT,YT,SIDE,1)
  490. Proc PDATA[I]
  491. AR=PRORET5 : AC=PRORET6
  492. If WD=0
  493. Bell 
  494. End If 
  495. If WD=1 or WD=2
  496. Shoot 
  497. End If 
  498. If WD=3
  499. Boom 
  500. End If 
  501. RG=Sqr((Abs(XT-XF)^2)+(Abs(YT-YF)^2))/4
  502. If Rnd(10)-RG>0
  503. Proc DSCREEN["a hit !",0]
  504. D=BIG(XT,YT,SIDE,0)
  505. If(D=8 or D=9 or D=12 or D=13 or D=18 or D=17) and WD>1
  506. BIG(XT,YT,SIDE,0)=5
  507. If D=9
  508. For XX=-1 To 1
  509. For YY=-1 To 1
  510. If XX+XT>0 and XX+XT<32 and YY+YT>0 and YY+YT<32
  511. BIG(XX+XT,YY+YT,SIDE,0)=5 : BIG(XX+XT,YY+YT,SIDE,1)=999
  512. End If 
  513. Next YY
  514. Next XX
  515. End If 
  516. End If 
  517. If BIG(XT,YT,SIDE,1)>0
  518. If Rnd(5)+1+WD>AR
  519. Boom 
  520. BIG(XT,YT,SIDE,1)=999
  521. Proc DSCREEN["a kill !!",0]
  522. If PLYER=1
  523. Inc VIC1
  524. End If 
  525. If PLYER=2
  526. Inc VIC2
  527. End If 
  528. If AC=1
  529. BIG(XOFF+XM,YOFF+YM,SIDE,0)=16
  530. End If 
  531. Else 
  532. Proc DSCREEN["deflected !!",0]
  533. End If 
  534. End If 
  535. End If 
  536. Next T
  537. End Proc
  538. Procedure LOSTRACE[X1,Y1,X2,Y2,FC]
  539. PRORET=0
  540. If X1=X2 and Y1=Y2
  541. PRORET=0
  542. Pop Proc
  543. End If 
  544. XM#=X2-X1
  545. YM#=Y2-Y1
  546. XM=XM# : YM=YM#
  547. If FC=1 and YM<=Abs(XM)*-1 Then PRORET=1
  548. If FC=3 and XM=>Abs(YM) Then PRORET=1
  549. If FC=5 and YM=>Abs(XM) Then PRORET=1
  550. If FC=7 and XM<=Abs(YM)*-1 Then PRORET=1
  551. If FC=2 and XM>=0 and YM<=0 Then PRORET=1
  552. If FC=4 and XM>=0 and YM>=0 Then PRORET=1
  553. If FC=6 and XM<=0 and YM>=0 Then PRORET=1
  554. If FC=8 and XM<=0 and YM<=0 Then PRORET=1
  555. If Abs(XM#)=>Abs(YM#) Then Gosub XDRAW Else Gosub YDRAW
  556. Goto NDDRAW
  557. XDRAW:
  558. If XM#<0 Then STP=-1
  559. If XM#>0 Then STP=1
  560. If XM=0 Then Goto NDDRAW
  561. YINC#=YM#/Abs(XM#)
  562. Y#=Y1
  563. For X=X1 To X2 Step STP
  564. YR=Y#
  565. A=BIG(X,YR,SIDE,0)
  566. B=BIG(X,YR,SIDE,1)
  567. If(X<>X1 or YR<>Y1) and(X<>X2 or YR<>Y2)
  568. If B>0 or A=1 or A=2 or A=8 or A=9 or A=12 or A=13
  569. PRORET=0 : Pop Proc
  570. End If 
  571. End If 
  572. Y#=Y#+YINC#
  573. Next X
  574. Return 
  575. YDRAW:
  576. If YM#<0 Then STP=-1
  577. If YM#>0 Then STP=1
  578. If YM=0 Then Goto NDDRAW
  579. YINC#=XM#/Abs(YM#)
  580. Y#=X1
  581. For X=Y1 To Y2 Step STP
  582. YR=Y#
  583. A=BIG(YR,X,SIDE,0)
  584. B=BIG(YR,X,SIDE,1)
  585. If(YR<>X1 or X<>Y1) and(YR<>X2 or X<>Y2)
  586. If B>0 or A=1 or A=2 or A=8 or A=9 or A=12 or A=13
  587. PRORET=0 : Pop Proc
  588. End If 
  589. End If 
  590. Y#=Y#+YINC#
  591. Next X
  592. Return 
  593. NDDRAW:
  594. End Proc
  595. Procedure GAMEOVER
  596. Autoback 1
  597. Pen 8
  598. Locate 0,0
  599. Centre "Game Over!"
  600. Locate 0,2
  601. If PRORET1=0 and PRORET2=1 Then Print "All good guys dead!" : Print "total alien victory!"
  602. If PRORET1=1 and PRORET2=0 Then Print "Al1 aliens terminated" : Print "total goodguy victory!"
  603. Print 
  604. Print "marines score:";VIC1
  605. Print "aliens score:";VIC2
  606. While(Mouse Click=0) and(Inkey$="") : Bell Rnd(50)+10 : Wend 
  607. End Proc
  608. Procedure ALIENMOVE
  609. XST=XOFF : YST=YOFF
  610. Cls 0
  611. Locate 0,0
  612. Pen 5
  613. Centre "ALIENS TURN"
  614. Locate 0,2 : Centre "please wait"
  615. Screen Swap 
  616. For X=0 To 31
  617. For Y=0 To 31
  618. For Z=0 To 1
  619. A=BIG(X,Y,Z,0)
  620. I=BIG(X,Y,Z,1)
  621. 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))
  622. AP=30
  623. Proc PDATA[I]
  624. B=PRORET7 : AP=PRORET
  625. XT=X : YT=Y
  626. Do 
  627. For O=XT To 31 Step 1
  628. N=BIG(O,YT,Z,0) : M=BIG(O,YT,Z,1)
  629. If N=1 or N=2 or N=8 or N=9 or N=12 or N=13
  630. Exit 1
  631. End If 
  632. If(M>8 and M<25) or(M>71 and M<128)
  633. BIG(XT,YT,Z,1)=B+2
  634. AP=AP-Abs(I-B+2)
  635. 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)
  636. If AP>0
  637. Proc HELLFIRE[XT,YT,O,YT,Z]
  638. AP=0
  639. End If 
  640. End If 
  641. Exit 
  642. Else 
  643. If M>0 and O<>XT
  644. Exit 
  645. End If 
  646. End If 
  647. Next O
  648. For O=XT To 0 Step -1
  649. N=BIG(O,YT,Z,0) : M=BIG(O,YT,Z,1)
  650. If N=1 or N=2 or N=8 or N=9 or N=12 or N=13
  651. Exit 1
  652. End If 
  653. If(M>8 and M<25) or(M>71 and M<128)
  654. BIG(XT,YT,Z,1)=B+6
  655. AP=AP-Abs(I-B+6)
  656. 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)
  657. If AP>0
  658. Proc HELLFIRE[XT,YT,O,YT,Z]
  659. AP=0
  660. End If 
  661. End If 
  662. Exit 
  663. Else 
  664. If M>0 and O<>XT
  665. Exit 
  666. End If 
  667. End If 
  668. Next O
  669. For O=YT To 31 Step 1
  670. N=BIG(XT,O,Z,0) : M=BIG(XT,O,Z,1)
  671. If N=1 or N=2 or N=8 or N=9 or N=12 or N=13
  672. Exit 1
  673. End If 
  674. If(M>8 and M<25) or(M>71 and M<128)
  675. BIG(XT,YT,Z,1)=B+4
  676. AP=AP-Abs(I-B+4)
  677. 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)
  678. If AP>0
  679. Proc HELLFIRE[XT,YT,XT,O,Z]
  680. AP=0
  681. End If 
  682. End If 
  683. Exit 
  684. Else 
  685. If M>0 and O<>YT
  686. Exit 
  687. End If 
  688. End If 
  689. Next O
  690. For O=YT To 0 Step -1
  691. N=BIG(XT,O,Z,0) : M=BIG(XT,O,Z,1)
  692. If N=1 or N=2 or N=8 or N=9 or N=12 or N=13
  693. Exit 1
  694. End If 
  695. If(M>8 and M<25) or(M>71 and M<128)
  696. BIG(XT,YT,Z,1)=B
  697. AP=AP-Abs(I-B)
  698. 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)
  699. If AP>0
  700. Proc HELLFIRE[XT,YT,XT,O,Z]
  701. AP=0
  702. End If 
  703. End If 
  704. Exit 
  705. Else 
  706. If M>0 and O<>YT
  707. Exit 
  708. End If 
  709. End If 
  710. Next O
  711. I=BIG(XT,YT,Z,1)
  712. F=I+1-B
  713. If F=1 or F=8 or F=2
  714. YM=-1
  715. End If 
  716. If F=3 or F=7
  717. YM=0
  718. End If 
  719. If F=4 or F=5 or F=6
  720. YM=1
  721. End If 
  722. If F=6 or F=7 or F=8
  723. XM=-1
  724. End If 
  725. If F=1 or F=5
  726. XM=0
  727. End If 
  728. If F=2 or F=3 or F=4
  729. XM=1
  730. End If 
  731. If XT+XM>31 or XT+XM<0 or YT+YM>31 or YT+YM<0
  732. Dec AP
  733. N6=BIG(XT,YT,Z,1)
  734. Add N6,1,B To B+7
  735. BIG(XT,YT,Z,1)=N6
  736. Goto SKIPIT
  737. End If 
  738. N=BIG(XT+XM,YT+YM,Z,0)
  739. M=BIG(XT+XM,YT+YM,Z,1)
  740. 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))
  741. Dec AP
  742. N6=BIG(XT,YT,Z,1)
  743. Add N6,1,B To B+7
  744. BIG(XT,YT,Z,1)=N6
  745. Goto SKIPIT
  746. End If 
  747. If N=13
  748. AP=AP-10
  749. BIG(XT+XM,YT+YM,Z,0)=10
  750. Shoot 
  751. End If 
  752. If N=12
  753. AP=AP-10
  754. BIG(XT+XM,YT+YM,Z,0)=11
  755. Shoot 
  756. End If 
  757. If(M>8 and M<25) or(M>71 and M<128)
  758. XOFF=XT : YOFF=YT
  759. Proc DSCREEN["under attack",0]
  760. SIDE=Z
  761. Proc H2H[XM,YM]
  762. AP=AP-10
  763. Else 
  764. Swap BIG(XT,YT,Z,1),BIG(XT+XM,YT+YM,Z,1)
  765. XT=XT+XM : YT=YT+YM
  766. APC=4
  767. N2=BIG(XT,YT,Z,0)
  768. If N2=3 or N2=5
  769. APC=6
  770. End If 
  771. AP=AP-APC
  772. End If 
  773. If BIG(XT,YT,Z,0)=14
  774. Bell 
  775. BIG(XT,YT,Z,0)=7
  776. Inc VIC2
  777. End If 
  778. SKIPIT: Rem line 
  779. If Rnd(1)=0 and AP>9 and BIG(XT,YT,Z,0)=4 and Z=0 and BIG(XT,YT,1,1)=0
  780. Bell 20 : AP=AP-10 : Swap BIG(XT,YT,1,1),BIG(XT,YT,0,1)
  781. End If 
  782. If Rnd(1)=0 and AP>9 and BIG(XT,YT,Z,0)=4 and Z=1 and BIG(XT,YT,0,1)=0
  783. Bell 20 : AP=AP-10 : Swap BIG(XT,YT,1,1),BIG(XT,YT,0,1)
  784. End If 
  785. If AP<1
  786. BIG(XT,YT,Z,2)=1
  787. Exit 1
  788. End If 
  789. Loop 
  790. End If 
  791. If((I>0 and I<9) or(I>24 and I<33) or(I>40 and I<49))
  792. End If 
  793. Next Z
  794. Next Y
  795. Next X
  796. XOFF=XST : YOFF=YST
  797. End Proc
  798. Procedure HELLFIRE[X1,Y1,X2,Y2,Z]
  799. I=BIG(X1,Y1,Z,1)
  800. Proc PDATA[I]
  801. WD=PRORET3 : AN=PRORET4
  802. If AN=0 and WD=0 Then Pop Proc
  803. I=BIG(X2,Y2,Z,1)
  804. Proc PDATA[I]
  805. AR=PRORET5
  806. If AN=0 Then Pop Proc
  807. XMR=XOFF : YMR=YOFF
  808. XOFF=X2 : YOFF=Y2
  809. Shoot 
  810. If WD>2
  811. Boom 
  812. End If 
  813. Proc DSCREEN["under fire !",0]
  814. RG=Sqr((Abs(X1-X2)^2)+(Abs(Y1-Y2)^2))/4
  815. For T=1 To AN
  816. If Rnd(10)-RG>0
  817. Proc DSCREEN["a hit !",0]
  818. D=BIG(X2,Y2,Z,0)
  819. If(D=8 or D=9 or D=12 or D=13) and WD>1
  820. BIG(X2,Y2,Z,0)=5
  821. End If 
  822. If BIG(X2,Y2,Z,1)>0
  823. If(Rnd(5)+1+WD)>AR
  824. Boom 
  825. BIG(X2,Y2,Z,1)=999
  826. Proc DSCREEN["a kill !!",0]
  827. Inc VIC2
  828. Else 
  829. Proc DSCREEN["deflected !!",0] : Wait 10
  830. End If 
  831. End If 
  832. End If 
  833. Next T
  834. XOFF=XMR : YOFF=YMR
  835. End Proc
  836. Procedure PDATA[I]
  837. If I>0 and I<9 Then WS=0 : WD=0 : AP=50 : RWD=0 : AN=1 : AR=2 : B=1
  838. If I>8 and I<17 Then WS=2 : WD=1 : AP=30 : RWD=1 : AN=1 : AR=3 : B=9
  839. If I>16 and I<25 Then WS=3 : WD=3 : AP=30 : RWD=1 : AN=2 : AR=5 : B=17
  840. If I>24 and I<33 Then WS=0 : WD=0 : AP=20 : RWD=3 : AN=1 : AR=5 : B=25
  841. If I>32 and I<41 Then WS=3 : WD=2 : AP=40 : AR=3 : AC=1 : B=33
  842. If I>40 and I<49 Then WS=2 : WD=1 : AP=30 : RWD=1 : AN=1 : AR=1 : AC=1 : B=41
  843. If I>50 and I<59 Then WS=0 : WD=0 : AP=50 : AC=2 : B=51
  844. If I>71 and I<80 Then WS=2 : WD=1 : AP=20 : RWD=4 : AN=1 : AR=3 : B=72
  845. If I>79 and I<88 Then WS=3 : WD=3 : AP=30 : RWD=2 : AN=3 : AR=5 : B=80
  846. If I>87 and I<96 Then WS=2 : WD=1 : AP=40 : RWD=1 : AN=2 : AR=2 : B=88
  847. If I>95 and I<104 Then WS=4 : WD=2 : AP=50 : RWD=1 : AN=1 : AR=3 : B=96
  848. If I>103 and I<112 Then WS=2 : WD=0 : AP=25 : RWD=0 : AN=1 : AR=1 : B=104
  849. If I>111 and I<120 Then WS=2 : WD=0 : AP=25 : RWD=2 : AN=2 : AR=1 : B=112
  850. If I>119 and I<128 Then WS=3 : WD=2 : AP=25 : RWD=1 : AN=1 : AR=5 : B=120
  851. If I>127 and I<136 Then WS=1 : WD=1 : AP=30 : RWD=1 : AN=1 : AR=1 : B=128
  852. If I>135 and I<144 Then WS=1 : WD=0 : AP=20 : RWD=3 : AN=3 : AR=1 : B=136
  853. PRORET=AP
  854. PRORET1=WS
  855. PRORET2=WD
  856. PRORET3=RWD
  857. PRORET4=AN
  858. PRORET5=AR
  859. PRORET6=AC
  860. PRORET7=B
  861. End Proc
  862. Procedure SGAME
  863. Show On 
  864. F$=Fsel$("","","save game")
  865. If F$<>""
  866. N=Start(5)
  867. For X=0 To 31
  868. For Y=0 To 31
  869. For Z=0 To 1
  870. For M=0 To 1
  871. Loke N,BIG(X,Y,Z,M)
  872. N=N+4
  873. Next M
  874. Next Z
  875. Next Y
  876. Next X
  877. Save F$,5
  878. End If 
  879. Hide On 
  880. End Proc
  881. Procedure LGAME
  882. Show On 
  883. F$=Fsel$("","","load game")
  884. If F$<>""
  885. Load F$,5
  886. N=Start(5)
  887. For X=0 To 31
  888. For Y=0 To 31
  889. For Z=0 To 1
  890. For M=0 To 1
  891. BIG(X,Y,Z,M)=Leek(N)
  892. N=N+4
  893. Next M
  894. Next Z
  895. Next Y
  896. Next X
  897. End If 
  898. Hide On 
  899. End Proc