star.wb 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501
  1. cls:print"Loading STAR WITCH..."
  2. locate 10,10:print "○○○○";
  3. 100 cls:gosub 17000 'オープニング
  4. 1000 cls
  5. 1010 print "┏━━━━━━━━━┳━━━━━━━┳━━━━━━━━┓";
  6. 1020 print "┃ 12345678┃       ┃        ┃";
  7. 1030 print "┃1        ┃ENERGY ┃   ジャンプ ┃";
  8. 1040 print "┃2        ┃       ┃        ┃";
  9. 1050 print "┃3        ┃MISSILE┃   バーニア ┃";
  10. 1060 print "┃4        ┃       ┃        ┃";
  11. 1070 print "┃5        ┃LEFT   ┃   ウェーブ ┃";
  12. 1080 print "┃6        ┃       ┃        ┃";
  13. 1090 print "┃7        ┃DAY    ┃   ミサイル ┃";
  14. 1100 print "┃8        ┃       ┃        ┃";
  15. 1110 print "┣━━━━━━━━━┻━━━━━━━┻━━━━━━━━┫";
  16. 1120 print "┃                          ┃";
  17. 1130 print "┃                          ┃";
  18. 1140 print "┃                          ┃";
  19. 1150 print "┃                          ┃";
  20. 1160 print "┃                          ┃";
  21. 1170 print "┗━━━━━━━━━━━━━━━━━━━━━━━━━━┛";
  22. 1175 print "   STAR WITCH ~ゴブリン帝国の野望~";
  23. 1180 rem 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7
  24. 1190 rem
  25. 2000 rem 初期化
  26. 2005 randomize tick
  27. 2010 E=4000 'EはWITCH号のエネルギー
  28. 2020 M=10 'MはWITCH号の所持ミサイル
  29. 2030 L=10 'Lはクリアすべきエリアの残り数
  30. 2040 D=1 'Dは現在の日数 (1アクション1日)
  31. 2042 S=0 'WITCH号のX位置
  32. 2044 T=0 'WITCH号のY位置
  33. 2050 A=0 '@(A)~@A(A+8*8-1)までが現在エリアの内容
  34. 2060 '0:なし -1:小惑星 -2:輸送船
  35. 2061 '正数はゴブリン戦艦でエネルギー量
  36. 2065 W=A+8*8 'ワークエリアに使って良い配列の先頭位置
  37. 2070 B=0 'エリア作成時の輸送船の数
  38. 2080 G=0 'エリア作成時のゴブリン戦艦の数
  39. 2090 S=1+rnd(4) 'エリア作成時の小惑星の数
  40. 2095 H=0 '通算の撃破ゴブリン戦艦数
  41. 2100 P=11 'メッセージエリアのY位置 (良く参照されるので変数に置く)
  42. 2200 rem エリア進入
  43. 2210 gosub 10000
  44. 3000 rem ターン開始
  45. 3010 gosub 25000 'ステータス更新
  46. 3020 gosub 12000 '補給チェックと実行
  47. 3030 gosub 11000 '敵の攻撃
  48. 3100 rem コマンド選択
  49. 3105 gosub 20000:locate 2,P+2:print "艦長、ご指示を";
  50. 3110 c=0
  51. 3120 locate 20, 2+(c*2):print "→";
  52. 3200 s=wait
  53. 3205 locate 20, 2+(c*2):print " ";
  54. 3210 if s and scan_a then goto 4000+(c*1000)
  55. 3220 if s and scan_x1 then c=c-1:if c<0 then c=3
  56. 3230 if s and scan_x3 then c=c+1:if c>3 then c=0
  57. 3290 goto 3120
  58. 4000 '*******ジャンプ*******
  59. 4010 f=0
  60. 4020 for y=0 to 7:for x=0 to 7
  61. 4030 if @(A+x+y*8) > 0 then f=f+1
  62. 4040 next:next
  63. 4050 if f=0 then goto 4200
  64. 4060 gosub 20000
  65. 4070 locate 2,P+1:print "艦長!";
  66. 4080 locate 2,P+3:print "ゴブリン戦艦がまだ";f;"隻もいます!"
  67. 4090 d=wait
  68. 4100 gosub 20000
  69. 4110 goto 3100
  70. 4200 ' 行き先候補
  71. 4210 gosub 20000
  72. 4215 locate 2,P:print "目的地を指示してください"
  73. 4220 for i=0 to 2
  74. 4230 @(W+i*3)=1+rnd(5) 'ゴブリン戦艦1~5隻
  75. 4240 @(W+i*3+1)=0:if rnd(3)=0 then @(W+i*3+1)=1 '輸送船は1/3の確率
  76. 4250 @(W+i*3+2)=1+rnd(4) '小惑星1~5個
  77. 4260 locate 4,P+1+i
  78. 4270 print "ゴブリン";@(W+i*3);
  79. 4280 print " 輸送船";@(W+i*3+1);
  80. 4290 print " 小惑星"@(W+i*3+2);
  81. 4300 next
  82. 4400 rem 候補を選ぶ
  83. 4410 c=0
  84. 4420 locate 2, P+1+c:print "→";
  85. 4500 s=wait
  86. 4505 locate 2, P+1+c:print " ";
  87. 4510 if s and scan_a then goto 4600
  88. 4520 if s and scan_x1 then c=c-1:if c<0 then c=2
  89. 4530 if s and scan_x3 then c=c+1:if c>2 then c=0
  90. 4590 goto 4420
  91. 4600 ' 次のエリアに行く
  92. 4610 B=@(W+c*3+1)
  93. 4620 G=@(W+c*3)
  94. 4630 S=@(W+c*3+2)
  95. 4700 gosub 20000
  96. 4710 locate 2,P+1:print "ハイパースペース・ドライブ";
  97. 4720 locate 2,P+3:print "  スタンバイOK!"
  98. 4730 d=wait
  99. 4740 gosub 20000
  100. 4750 locate 2,P+2:print "次のエリアにジャンプします";
  101. 4760 d=wait
  102. 4780 gosub 20000
  103. 4785 for y=0 to 7:for x=0 to 7:locate 2+x,2+y:print "※";:next:next
  104. 4790 waitvb 75
  105. 4795 if E>10 then E=E-10:goto 4800
  106. 4796 locate 2,P+1:print "艦長! エネルギーが足りません!";
  107. 4797 locate 4,P+3:print "通常空間に復帰できません!!";
  108. 4798 d=wait:goto 19000
  109. 4800 locate 2,P+2:print "ジャンプ成功! レーダー動作します";
  110. 4810 d=wait
  111. 4820 gosub 20000
  112. 4890 D=D+1:L=L-1:goto 2200
  113. locate 10,10:print "●○○○";
  114. 5000 '******バーニア*******
  115. 5010 gosub 20000
  116. 5020 locate 2,P+1:print "エリア内移動・スタンバイ";
  117. 5030 locate 2,P+3:print "コースは? (0-360)";
  118. 5040 X=21:Y=P:gosub 21000
  119. 5050 if Z<0 then goto 3100 'キャンセルされた
  120. 5060 if Z<=360 then s=Z:goto 5100
  121. 5070 gosub 20000
  122. 5080 locate 2,P+1:print "艦長!";
  123. 5090 locate 2,P+3:print "コースは0から360までです!";
  124. 5095 d=wait:goto 5010
  125. 5100 gosub 20000
  126. 5110 locate 2,P+1:print "エリア内移動・スタンバイ";
  127. 5120 locate 2,P+3:print "距離は? (1-12)";
  128. 5130 X=21:Y=P:gosub 21000
  129. 5140 if Z<0 then goto 5010 'キャンセルされた
  130. 5145 if Z>E+1 then goto 5190
  131. 5150 if Z>=1 and Z<=12 then l=Z:E=E-l:goto 5200
  132. 5155 gosub 20000
  133. 5160 locate 2,P+1:print "艦長!";
  134. 5170 locate 2,P+3:print "距離は1から12までです!";
  135. 5180 d=wait:goto 5100
  136. 5190 gosub 20000
  137. 5192 locate 2,P+1:print "艦長!";
  138. 5194 locate 2,P+3:print "エネルギーが足りません!";
  139. 5198 d=wait:goto 5100
  140. 5200 '移動アニメーション
  141. 5210 gosub 20000
  142. 5215 'locate 2+S,2+T:print " ";
  143. 5220 X=s:gosub 23000:a=Y
  144. 5230 X=s:gosub 22000:b=-Y '反時計回りにしたいのでマイナス
  145. 5235 c=S:d=T '最後に有効であった座標を持つ
  146. 5240 i=1:j=0 'iは本当の移動距離。jは見かけ上の移動距離
  147. 5250 x=S+a*i/100
  148. 5260 y=T+b*i/100
  149. 5261 'debug S,T,x,y,a,b,i,s
  150. 5262 if x<0 or x>7 or y<0 or y>7 then goto 5400
  151. 5264 if @(A+x+y*8)=0 then goto 5270
  152. 5266 gosub 20000:locate 2,P+2:print "衝突回避! 緊急停止!";d=wait
  153. 5268 goto 5400 'ループを強制終了させる
  154. 5270 if c=x and d=y then goto 5300 '見かけ上の移動が起きていない
  155. 5272 j=j+1
  156. 5275 locate 2+x,2+y:print "W";
  157. 5280 locate 2+c,2+d:print " ";:c=x:d=y
  158. 6285 D=D+1:gosub 25000
  159. 5290 waitvb 75
  160. 5300 i=i+1:if j<l then goto 5250
  161. 5400 S=c:T=d
  162. 5410 locate 2+S,2+T:print "W";
  163. 5500 goto 3000
  164. 6000 '*****ウェーブ*****
  165. 6010 gosub 20000
  166. 6020 locate 2,P+1:print "ウェーブキヤノン・スタンバイ";
  167. 6030 locate 2,P+3:print " エネルギー量は? (1-";E-1;")";
  168. 6040 X=21:Y=P:gosub 21000
  169. 6050 if Z<0 then goto 3100 'キャンセルされた
  170. 6060 if Z>=1 and Z<=E-1 then s=Z:goto 6100
  171. 6070 gosub 20000
  172. 6080 locate 2,P+1:print "艦長!";
  173. 6090 locate 2,P+3:print " エネルギー量は1から";E-1;"までです!";
  174. 6095 d=wait:goto 6010
  175. 6100 gosub 20000
  176. 6110 ' 存在するオブジェクト数を数える
  177. 6120 f=0
  178. 6130 for y=0 to 7:for x=0 to 7
  179. 6140 if @(A+x+y*8) <> 0 then f=f+1
  180. 6150 next:next
  181. 6160 e=s/f:if e<1 then e=1 'eは1標的あたりの攻撃量
  182. 6170 gosub 20000
  183. 6180 locate 2,P+2:print "ウェーブキヤノン・発射!";
  184. 6190 d=wait
  185. 6200 for y=0 to 7:for x=0 to 7
  186. 6210 if @(A+x+y*8) <= 0 then goto 6400
  187. 6220 gosub 20000
  188. 6230 locate 2,P+1:print "(";x+1;",";y+1;")のゴブリン戦艦にダメージ";e;
  189. 6240 @(A+x+y*8)=@(A+x+y*8)-e:if @(A+x+y*8)<=0 then @(A+x+y*8)=0:goto 6300
  190. 6245 locate 4,P+3:print "(残りエネルギー";@(A+x+y*8);")";
  191. 6250 d=wait
  192. 6290 goto 6400
  193. 6300 locate 4,P+3:print "ゴブリン戦艦、撃沈!";:H=H+1
  194. 6350 X=x:Y=y:gosub 24000 '爆発
  195. 6400 next:next
  196. 6900 E=E-s:
  197. 6910 if L=0 then gosub 26000:if Y=0 then goto 18000
  198. 6920 D=D+1:goto 3000
  199. locate 10,10:print "●●○○";
  200. 7000 '******ミサイル******
  201. 7010 if M>0 then goto 7100
  202. 7020 gosub 20000
  203. 7030 locate 2,P+1:print "艦長!";
  204. 7040 locate 2,P+3:print "ミサイルの残弾はゼロです!";
  205. 7050 d=wait
  206. 7090 goto 3100
  207. 7100 gosub 20000
  208. 7110 locate 2,P+1:print "ミサイル・スタンバイ";
  209. 7120 locate 2,P+3:print "コースは? (0-360)";
  210. 7130 X=21:Y=P:gosub 21000
  211. 7140 if Z<0 then goto 3100 'キャンセルされた
  212. 7150 if Z<=360 then s=Z:goto 7200
  213. 7160 gosub 20000
  214. 7170 locate 2,P+1:print "艦長!";
  215. 7180 locate 2,P+3:print "コースは0から360までです!";
  216. 7190 d=wait:goto 7100
  217. 7200 '移動アニメーション
  218. 7205 M=M-1:gosub 25000
  219. 7210 gosub 20000
  220. 7220 X=s:gosub 23000:a=Y
  221. 7230 X=s:gosub 22000:b=-Y '反時計回りにしたいのでマイナス
  222. 7235 i=1
  223. 7240 c=S:d=T '最後に有効であった座標を持つ
  224. 7250 x=S+a*i/100
  225. 7260 y=T+b*i/100
  226. 7270 'debug S,T,x,y,a,b,i,s
  227. 7280 if x<0 or x>7 or y<0 or y>7 then goto 7500
  228. 7290 if @(A+x+y*8)<>0 then goto 7600
  229. 7320 if c=x and d=y then goto 7370 '見かけ上の移動が起きていない
  230. 7340 locate 2+x,2+y:print "M";
  231. 7350 waitvb 75
  232. 7360 locate 2+x,2+y:print " ";:c=x:d=y
  233. 7370 i=i+1:goto 7250
  234. 7400 goto 3000
  235. 7500 'はずれ!
  236. 7510 gosub 20000
  237. 7515 locate 2,P+1:print "艦長!";
  238. 7520 locate 4,P+3:print "攻撃は失敗です!";
  239. 7530 d=wait
  240. 7590 D=D+1:goto 3000
  241. 7600 'あたり!
  242. 7610 gosub 20000
  243. 7620 locate 2,P+1:print "艦長!";
  244. 7630 locate 4,P+3
  245. 7640 if @(A+x+y*8)=-1 then print "小惑星に命中しました!";
  246. 7650 if @(A+x+y*8)=-2 then print "輸送船に命中しました!";
  247. 7660 if @(A+x+y*8)>0 then print "ゴブリン戦艦に命中しました!";
  248. 7670 X=x:Y=y:gosub 24000 '爆発
  249. 7680 'd=wait
  250. 7690 gosub 20000
  251. 7700 locate 4,P+2
  252. 7710 if @(A+x+y*8)=-1 then print "小惑星の消滅を確認!";
  253. 7720 if @(A+x+y*8)=-2 then print "輸送船乗組員の救助のため10日必要です";:D=D+1
  254. 7730 if @(A+x+y*8)>0 then print "ゴブリン戦艦を撃沈!";:H=H+1
  255. 7740 @(A+x+y*8)=0 'そこにはもう何もない
  256. 7750 d=wait
  257. 7760 if L=0 then gosub 26000:if Y=0 then goto 18000
  258. 7790 D=D+1:goto 3000
  259. 10000 rem エリア作成
  260. 10005 for y=0 to 7:for x=0 to 7:@(A+x+y*8)=0:next:next
  261. 10010 if B=0 then goto 10100
  262. 10020 for i=0 to B-1
  263. 10030 x=rnd(8):y=rnd(8)
  264. 10040 if @(A+x+y*8) <> 0 then goto 10030
  265. 10050 @(A+x+y*8)=-2
  266. 10060 next
  267. 10100 if G=0 then goto 10200
  268. 10105 for i=0 to G-1
  269. 10110 x=rnd(8):y=rnd(8)
  270. 10120 if @(A+x+y*8) <> 0 then goto 10110
  271. 10130 @(A+x+y*8)=400+rnd(200) 'ゴブリン戦艦のエネルギー初期値
  272. 10140 next
  273. 10200 for i=0 to S-1
  274. 10210 x=rnd(8):y=rnd(8)
  275. 10220 if @(A+x+y*8) <> 0 then goto 10210
  276. 10230 @(A+x+y*8)=-1
  277. 10240 next
  278. 10250 'WITCH号の位置を確定
  279. 10260 S=rnd(7):T=rnd(7)
  280. 10270 if @(A+S+T*8) <> 0 then goto 10260
  281. 10300 gosub 10500
  282. 10400 return
  283. 10500 'レーダー作動
  284. 10510 for y=0 to 7:for x=0 to 7
  285. 10520 locate x+2,y+2
  286. 10530 t=@(A+x+y*8)
  287. 10540 if t=0 then print " ";
  288. 10550 if t=-1 then print "*";
  289. 10560 if t=-2 then print "T";
  290. 10570 if t>0 then print "G";
  291. 10580 next:next
  292. 10590 locate S+2,T+2:print "W";
  293. 10600 return
  294. 11000 '*****敵の攻撃*****
  295. 11010 for y=0 to 7:for x=0 to 7
  296. 11020 if @(A+x+y*8) <= 2 then goto 11900
  297. 11025 n=@(A+x+y*8)/4+rnd(@(A+x+y*8)/2):if n<1 then 11900
  298. 11030 gosub 20000
  299. 11040 locate 2,P+1:print "(";x+1;",";y+1;")のゴブリン戦艦よりの攻撃!";
  300. 11050 d=wait
  301. 11070 locate 4,P+3:print "WITCH号に";n;"のダメージ!";
  302. 11075 @(A+x+y*8)=@(A+x+y*8)-n
  303. 11080 E=E-n:if E<0 then E=0
  304. 11090 gosub 25000
  305. 11100 d=wait
  306. 11110 if E>0 then goto 11900
  307. 11120 gosub 20000
  308. 11130 locate 2,P+1:print "艦長!";
  309. 11130 locate 4,P+3:print "エネルギーがもうありません!";
  310. 11140 gosub 20000
  311. 11150 locate 2,P+1:print "防御バリア機能停止";
  312. 11160 locate 4,P+3:print "WITCH号の船体が砕けます!";
  313. 11170 X=S:Y=T:gosub 24000 '爆発
  314. 11180 gosub 20000
  315. 11190 goto 19000 'BAD ENDING
  316. 11900 next:next
  317. 11910 return
  318. locate 10,10:print "●●●○";
  319. 12000 '補給チェックと実行
  320. 12020 f=0
  321. 12030 if S>0 then if @(A+(S-1)+T*8)=-2 then f=1
  322. 12040 if S<7 then if @(A+(S+1)+T*8)=-2 then f=1
  323. 12050 if T>0 then if @(A+S+(T-1)*8)=-2 then f=1
  324. 12060 if T<7 then if @(A+S+(T+1)*8)=-2 then f=1
  325. 12070 if f=0 then return
  326. 12080 gosub 20000
  327. 12090 locate 2,P+1:print "艦長!";
  328. 12100 locate 4,P+3:print "輸送船から補給を受けます。";
  329. 12110 d=wait
  330. 12120 E=4000:M=10
  331. 12130 gosub 25000 'ステータス更新
  332. 12190 return
  333. 17000 'OPENING
  334. 17010 cls
  335. 17020 for i=0 to 1
  336. 17030 locate 2,2:print "緊急指令!"
  337. 17040 waitvb 30
  338. 17050 locate 2,2:print "     "
  339. 17060 waitvb 30
  340. 17070 next
  341. 17100 locate 2,2:print "緊急指令!"
  342. 17110 cls:print
  343. 17120 waitvb 30:print " かねてより":print
  344. 17130 waitvb 30:print " 我が地球連邦政府に敵対していた":print
  345. 17140 waitvb 30:print " 凶悪なゴブリン帝国が":print
  346. 17150 waitvb 30:print " 多数の宇宙戦艦で侵攻してきた":print
  347. 17155 print
  348. 17160 waitvb 30:print " 連邦艦隊ナンバーワン艦長の君に命じる":print
  349. 17170 waitvb 30:print " 最新鋭戦艦WITCH号を指揮し":print
  350. 17180 waitvb 30:print " 侵入したゴブリン戦艦を撃破せよ"
  351. 17190 d=wait
  352. 17200 cls
  353. 17210 for i=0 to 4
  354. 17220 if i=4 then locate 2, 2:print"  ■■■ ■■■■■  ■    ■■■■"
  355. 17230 if i=3 then locate 2, 3:print" ■      ■   ■ ■   ■   ■"
  356. 17240 if i=2 then locate 2, 4:print"  ■■■   ■   ■■■   ■■■■"
  357. 17250 if i=1 then locate 2, 5:print"     ■  ■  ■   ■  ■  ■"
  358. 17260 if i=0 then locate 2, 6:print"  ■■■   ■ ■     ■ ■   ■"
  359. 17270 if i=0 then locate 2, 9:print"■  ■  ■ ■ ■■■  ■■■   ■  ■"
  360. 17280 if i=1 then locate 2,10:print"■ ■ ■ ■ ■  ■  ■   ■  ■  ■"
  361. 17290 if i=2 then locate 2,11:print"■ ■ ■ ■ ■  ■  ■      ■■■■"
  362. 17300 if i=3 then locate 2,12:print"■ ■ ■ ■ ■  ■  ■   ■  ■  ■"
  363. 17310 if i=4 then locate 2,13:print" ■   ■  ■  ■   ■■■   ■  ■"
  364. 17320 waitvb 30:next
  365. 17330 locate 9,15:print "~ゴブリン帝国の野望~";
  366. 17340 d=wait
  367. 17400 cls
  368. 17410 print " ***WITCH号の最新装備を紹介する***":print
  369. 17420 waitvb 30:print " 量子レーダー:"
  370. 17430 print "  W←WITCH号 *←小惑星"
  371. 17440 print "  G←ゴブリン戦艦 T←輸送船":print
  372. 17450 waitvb 30:print " 超空間ジャンプドライブ:"
  373. 17460 print "  エリア内の敵を全滅させたら次のエリアに進める。":print
  374. 17470 waitvb 30:print " バーニア:"
  375. 17480 print "  エリア内を移動できる。":print
  376. 17490 waitvb 30:print " ウェーブキヤノン:"
  377. 17500 print "  エリア内のすべての敵を同時攻撃":print
  378. 17510 waitvb 30:print " 反応弾頭ミサイル:"
  379. 17520 print "  敵艦も小惑星も一撃で粉砕する"
  380. 17590 d=wait
  381. 17600 cls
  382. 17610 locate 8,8:print "それでは健闘を祈る!"
  383. 17690 d=wait
  384. 17700 cls
  385. 17710 locate 5,8:print "艦長! WITCH号、出港します!"
  386. 17790 d=wait
  387. 17900 return
  388. 18000 'GOOD ENDING
  389. 18010 cls:print
  390. 18020 waitvb 75:print " 作戦開始後";D;"日":print
  391. 18030 waitvb 75:print " ";H;"隻の戦艦を失った":print
  392. 18032 waitvb 75:print " ゴブリン帝国は、全面降伏した":print
  393. 18035 waitvb 75:print " 宇宙の平和は守られたのだ":print
  394. 18040 waitvb 75:print " WITCH号ならびに艦長の活躍をたたえ":print
  395. 18050 waitvb 75:print " 全人類から感謝の言葉をおくる":print
  396. 18060 waitvb 75:locate 10,14:print "ありがとう!"
  397. 18070 waitvb 75:locate 10,16:print "CONGRATURATIONS!";
  398. 18080 d=wait
  399. 18090 end
  400. locate 10,10:print "●●●●";
  401. 19000 'BAD ENDING
  402. 19010 cls:print
  403. 19020 waitvb 75:print " 作戦開始後";D;"日":print
  404. 19030 waitvb 75:print " WITCH号、宇宙の藻屑と消える":print
  405. 19040 waitvb 75:print " この日、地球連邦政府は、ゴブリン帝国に降伏":print
  406. 19050 waitvb 75:print " 地球人はゴブリン帝国の奴隷となった":print
  407. 19060 waitvb 75:locate 17,16:print "GAME OVER!";
  408. 19080 d=wait
  409. 19090 end
  410. 20000 ' clear message
  411. 20010 for i=11 to 15:locate 1,i
  412. 20020 print "                          ";
  413. 20030 next
  414. 20040 return
  415. 21000 ' 数値入力
  416. 21010 locate X,Y+0:print "┏━━━━┓";
  417. 21020 locate X,Y+1:print "┃    ┃";
  418. 21030 locate X,Y+2:print "┃0000┃";
  419. 21040 locate X,Y+3:print "┃    ┃";
  420. 21050 locate X,Y+4:print "┗━━━━┛";
  421. 21100 for i=0 to 3:@(W+i)=0:next
  422. 21110 v=3 '桁位置
  423. 21200 locate X+v+1,Y+1:print "↑";
  424. 21210 locate X+v+1,Y+3:print "↓";
  425. 21220 for i=0 to 3:locate X+i+1,Y+2:print @(W+i);:next
  426. 21300 s=wait
  427. 21310 locate X+v+1,Y+1:print " ";
  428. 21320 locate X+v+1,Y+3:print " ";
  429. 21330 if s and scan_x3 then @(W+v)=@(W+v)-1:if @(W+v)<0 then @(W+v)=9
  430. 21340 if s and scan_x1 then @(W+v)=@(W+v)+1:if @(W+v)>9 then @(W+v)=0
  431. 21350 if s and scan_x2 then v=v+1:if v>3 then v=0
  432. 21360 if s and scan_x4 then v=v-1:if v<0 then v=3
  433. 21365 if s and scan_a then goto 21400
  434. 21370 if s and scan_b then Z=-1:return
  435. 21380 goto 21200
  436. 21400 Z=@(W+0)*1000+@(W+1)*100+@(W+2)*10+@(W+3)
  437. 21410 return
  438. 22000 ' 疑似三角関数(Y=sin(X)) Y=-100...100 X=0-360
  439. 22010 X=X/5
  440. 22020 if X<=18 then gosub 22100:return
  441. 22030 if X<=36 then X=36-X:gosub 22100:return
  442. 22040 if X<=54 then X=X-36:gosub 22100:Y=-Y:return
  443. 22050 if X<=72 then X=72-X:gosub 22100:Y=-Y:return
  444. 22060 X=X-72:goto 22020
  445. 22100 if X=0 then Y=0
  446. 22110 if X=1 then Y=8
  447. 22120 if X=2 then Y=17
  448. 22130 if X=3 then Y=25
  449. 22140 if X=4 then Y=34
  450. 22150 if X=5 then Y=42
  451. 22160 if X=6 then Y=49
  452. 22170 if X=7 then Y=57
  453. 22180 if X=8 then Y=64
  454. 22190 if X=9 then Y=70
  455. 22200 if X=10 then Y=76
  456. 22210 if X=11 then Y=81
  457. 22220 if X=12 then Y=86
  458. 22230 if X=13 then Y=90
  459. 22240 if X=14 then Y=93
  460. 22250 if X=15 then Y=96
  461. 22260 if X=16 then Y=98
  462. 22270 if X=17 then Y=99
  463. 22280 if X=18 then Y=99
  464. 22290 return
  465. 23000 ' 疑似三角関数(cos)
  466. 23010 X=X+90:gosub 22000:return
  467. 24000 ' 爆発アニメーション
  468. 24005 locate 2+X,2+Y:print "・";:waitvb 30
  469. 24010 locate 2+X,2+Y:print "●";:waitvb 30
  470. 24020 locate 2+X,2+Y:print "※";:waitvb 30
  471. 24030 locate 2+X,2+Y:print " ";
  472. 24040 d=wait
  473. 24090 return
  474. 25000 '******ステータス表示更新*****
  475. 25010 locate 11,3:print "       ";
  476. 25020 locate 14,3:print E;
  477. 25030 locate 11,5:print "       ";
  478. 25040 locate 14,5:print M;
  479. 25050 locate 11,7:print "       ";
  480. 25060 locate 14,7:print L;
  481. 25070 locate 11,9:print "       ";
  482. 25080 locate 14,9:print D;
  483. 25090 return
  484. 26000 ' エリア内残り敵戦艦を数えてYに返す
  485. 26010 Y=0
  486. 26020 for y=0 to 7:for x=0 to 7
  487. 26030 if @(A+x+y*8)>0 then Y=Y+1
  488. 26040 next:next
  489. 26090 return
  490. cls:print"Loading Completed"