Advertisement
Guest User

Clash Of Clan - TI Basic z80 - By Wistaro

a guest
Oct 17th, 2014
1,453
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.50 KB | None | 0 0
  1. Lbl 1:ClrDraw:ClrHome:AxesOff:Full
  2. Output(2,1,"*-Clash of TI!-*
  3. Output(3,1,"*v0.1 - Wistaro*
  4. For(A,1,16
  5. Output(4,A,"*
  6. Output(1,A,"*
  7. End
  8. Repeat K=92 or K=105
  9. getKey->K
  10. If K=23:Goto R
  11. If K=45:Goto Q
  12. If K=93:Goto W
  13. Output(6,5,"Play: 1
  14. Output(8,5,"About: 2
  15. End
  16. Lbl J:ClrDraw
  17. UnArchive |LC
  18. ClrHome
  19. Disp "Updating...
  20. If 0>|LC(4:0->|LC(4
  21. If 0>|LC(5:0->|LC(5
  22. If 0>|LC(2:0->|LC(2
  23. DelVar ADelVar D
  24. |LC(18->A:|LC(18->B
  25. A+10|LC(19->A
  26. B+20|LC(19->B
  27. A+80|LC(22->A
  28. B+100|LC(23->B
  29. A->|LC(20:B->|LC(21
  30. startTmr-|LC(1->T
  31. If int(T/3600:Then
  32. int(T/3600->Q
  33. |LC(4->R:|LC(5->W
  34. |LC(4)+|LC(6)*Q->|LC(4
  35. |LC(4)+|LC(7)*Q->|LC(4
  36. |LC(5)+|LC(8)*Q->|LC(5
  37. |LC(5)+|LC(9)*Q->|LC(5
  38. Text(10,15,"Updated ",Q,"h ago!
  39. Text(30,0,"Gold: +",|LC(4)-R
  40. Text(40,0,"Elixir: +",|LC(5)-W
  41. |LC(2->R
  42. |LC(2)+100*Q->|LC(2
  43. Text(50,0,"XP: +",|LC(2)-R
  44. Pause
  45. startTmr->|LC(1
  46. End
  47. |LC(3)^4+|LC(3->P
  48. While |LC(2)>=P
  49. |LC(3)+1->|LC(3
  50. |LC(2)-P->|LC(2
  51. |LC(3)^4+|LC(3->P
  52. End
  53. Menu(" Clash Of TI!","Show map",C,"General Shop",B,"My stats",I,"Fight",A,"Exit",Q
  54. Lbl W:ClrDraw
  55. Text(5,12,"Thanks for playing!
  56. Text(20,0,"Author: Wistaro
  57. Text(30,0,"Version: release 0.1
  58. Text(40,0,"Last update: 15/10/14
  59. Text(50,0,"Total size: 5837 octets
  60. Pause :Goto 1
  61. Lbl A
  62. Menu("COC - Fight","Computer",AO,"Player",AJ,"<--",J
  63. Lbl AJ:ClrHome
  64. Disp "Soon!
  65. Pause :Goto J
  66. Lbl AO:ClrDraw
  67. randInt(|LC(3)+10,|LC(3)*500->A
  68. ~randInt(0,|LC(18)->S
  69. S+|LC(18->|LC(18
  70. If |LC(20)<A:Then
  71. Text(0,20,"You loose...
  72. A-|LC(21)->D
  73. ~10randInt(1,D->O
  74. ~10randInt(1,D->E
  75. ~randInt(D,|LC(3)^4->X
  76. Else
  77. Text(0,15,"Yous **WIN**!
  78. |LC(21)-A->D
  79. 10randInt(1,D->O
  80. 10randInt(1,D->E
  81. randInt(D,|LC(3)^4->X
  82. End
  83. Text(15,0,"Gold: ",O
  84. Text(25,0,"Elixir: ",E
  85. Text(35,0,"XP: ",X
  86. Text(45,0,"Soldiers: ",S
  87. O+|LC(4->|LC(4
  88. E+|LC(5->|LC(5
  89. |LC(2)+X->|LC(2
  90. Pause :Goto J
  91. Lbl C:ClrDraw
  92. UnArchive [I]
  93. 8->V:5->W
  94. DelVar L1DelVar L2seq(A,A,1,94,6)->L1
  95. seq(B,B,1,58,7->L2
  96. "o|E8}H->Str1
  97. For(A,1,9
  98. For(B,1,16
  99. If [I](A,B:Text(L2(A),L1(B),sub(Str1,[I](A,B),1
  100. End:End
  101. DelVar SDelVar T
  102. Repeat K=45 and not(S
  103. getKey->K
  104. If K=23 and not(S:Goto C
  105. Pxl-Change(L2(W),L1(V)
  106. not(Z->Z
  107. If Zmax(K={24,25,26,34}
  108. DelVar ZPxl-Change(L2(W),L1(V)
  109. V+(K=26 and V<16)-(K=24 and V>1->V
  110. W+(K=34 and W<9)-(K=25 and W>1->W
  111. If K=105 and not(S) and [I](W,V:Then
  112. Text(L2(W),L1(V)," "
  113. 1->S
  114. [I](W,V->T
  115. Text(L2(1),L1(15),"[",sub(Str1,T,1),"]
  116. 0->[I](W,V
  117. DelVar K
  118. End
  119. If K=105 and S and not([I](W,V:Then
  120. Text(L2(W),L1(V),sub(Str1,T,1
  121. DelVar S
  122. T->[I](W,V
  123. Text(L2(1),L1(15),"[
  124. End:End
  125. Goto J
  126. Lbl I
  127. Text(0,40,"Global
  128. Text(9,0,"LvL: ",|LC(3
  129. |LC(3)^4+|LC(3->P
  130. round((100*|LC(2)/P),1->P
  131. Text(18,0,"XP: ",|LC(2)," (",P," ^^o/plotsquare)
  132. Text(27,0,"Or: ",|LC(4
  133. Text(36,0,"Elixir: ",|LC(5
  134. Text(45,0,"Attaque: ",|LC(20
  135. Text(54,0,"Defense: ",|LC(21
  136. Pause :ClrDraw
  137. Text(0,40,"Mines
  138. Text(7,0,"Mine or 1:
  139. Text(14,10,"LvL: ",|LC(10)," Prod: ",|LC(6
  140. Text(21,0,"Mine or 2:
  141. Text(28,10,"LvL: ",|LC(11)," Prod: ",|LC(7
  142. Text(35,0,"Mine elixir 1:
  143. Text(42,10,"LvL: ",|LC(12)," Prod: ",|LC(8
  144. Text(49,0,"Mine elixir 2:
  145. Text(56,10,"LvL: ",|LC(13)," Prod: ",|LC(9
  146. Pause :ClrDraw
  147. Text(0,40,"Unitees
  148. Text(7,0,"Soldats: ",|LC(18
  149. Text(14,0,"Geants: ",|LC(19
  150. Text(21,0,"Canons: ",|LC(22
  151. Text(28,0,"Remparts: ",|LC(23
  152. Pause :Goto J
  153. Lbl B:ClrHome
  154. DelVar QDelVar R
  155. Menu("COT - Shop","Army",BA,"Defenses",BD,"Mine",BM,"<--",J
  156. Lbl BM
  157. {6,7,8,9->L3
  158. {11,12,13,14->L4
  159. Goto BV
  160. Lbl BD
  161. Menu("Defense","Canon",DC,"Rempart",DR,"<--",B
  162. Lbl DC
  163. 500->P:22->L:Goto BW
  164. Lbl DR
  165. 200->P:23->L:Goto BW
  166. Lbl BA
  167. Menu("Army","Soldiers",AS,"Giants",AG,"<--",B
  168. Lbl AS
  169. 10->P:18->L:Goto BW
  170. Lbl AG
  171. 100->P:19->L:Goto BW
  172. Lbl BV
  173. DelVar RDelVar Q
  174. Menu("Mine","Or",MO,"Elixir",MX,"<--",B
  175. Lbl MO
  176. Menu("Mine Or","Acheter",M1,"Ameliorer",M2,"<--",BV
  177. Lbl MX
  178. Menu("Mine elixir","Buy",M3,"Upgrade",M4,"<--",BV
  179. Lbl M2
  180. 14->C:10->L:6->P:10->M:Goto MM
  181. Lbl M4
  182. 16->C:12->L:8->P:12->M:Goto MM
  183. Lbl MM
  184. ClrHome
  185. Output(3,1,"Next Lvl:
  186. Output(3,10,|LC(L)+1
  187. Output(4,1,"Nxt Prod:
  188. Output(4,10,|LC(P)|LC(M)+10|LC(3)
  189. Output(5,1,"Price:
  190. Output(5,7,10|LC(P)
  191. Output(6,1,"Exl bank:
  192. Output(6,11,|LC(5
  193. Input "Ok? (1/0): ",A
  194. If A and |LC(L) and |LC(5)>=10|LC(P)
  195. Then
  196. startTmr->|LC(C
  197. |LC(5)-10|LC(P)->|LC(5
  198. |LC(L)+1->|LC(L
  199. int(2|LC(P)|LC(M)(|LC(3)+1)/3->|LC(P
  200. Else
  201. Output(8,1,"Failure!
  202. End
  203. ClrHome:Goto BM
  204. Lbl M1
  205. If not(|LC(10:Then
  206. 14->C:100->P:10->L:6->R
  207. Else
  208. 15->C:1000->P:11->L:7->R
  209. End:Goto BW
  210. Lbl M3
  211. If not(|LC(12:Then
  212. 16->C:200->P:12->L:8->Q
  213. Else
  214. 17->C:2000->P:13->L:9->Q
  215. End
  216. Lbl BW
  217. DelVar ARepeat PA<=|LC(4
  218. Output(3,1,"Price: "
  219. Output(3,8,P
  220. Output(6,1,"Gold: "
  221. Output(6,7,|LC(4
  222. Output(4,1,"Alrd:"
  223. Output(4,6,|LC(L
  224. If PA>|LC(4:Output(7,1,"Not enought money!
  225. If not(Q+R:Then
  226. Input "Qt? ",A
  227. Else
  228. Input "Ok? (1/0): ",A
  229. End
  230. int(abs(A->A
  231. ClrHome
  232. End
  233. If not(Q+R:Then
  234. If max(L={22,23:Then
  235. Disp "Building...
  236. Output(3,5,"/100
  237. For(T,1,A
  238. 1->Q
  239. Output(3,1,int((T*100)/A
  240. max((L={22,23})({4,3->Z
  241. For(M,1,9
  242. For(N,1,16
  243. If Q and not([I](M,N:DelVar QZ->[I](M,N
  244. End:End
  245. If not(Q:Then
  246. 1+|LC(L->|LC(L
  247. |LC(4)-P->|LC(4
  248. Else
  249. A->T
  250. Pause "Plus de place
  251. End:End
  252. Else
  253. A+|LC(L->|LC(L
  254. |LC(4)-PA->|LC(4
  255. End
  256.  
  257. Else
  258. If A:Then
  259. Pause "?2
  260. If R:Then
  261. 10->|LC(R
  262. 1->|LC(L
  263. End
  264. If Q:Then
  265. 20->|LC(Q
  266. 1->|LC(L
  267. End
  268. |LC(4)-P->|LC(4
  269. startTmr->|LC(C
  270. End
  271. End
  272. Goto B
  273. Lbl R
  274. Pause "ENTER to reset!
  275. {startTmr,0,1,100,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0->|LC
  276. DelVar [I]{9,16->dim([I]
  277. 5->[I](4,8
  278. 1->[I](8,12
  279. 1->[I](3,3
  280. 2->[I](5,7
  281. 2->[I](7,15
  282. Pause "Account cleared!
  283. Goto 1
  284. Lbl Q:ClrHome
  285. Disp "Saving Game..
  286. Disp "Please Wait...
  287. Archive |LC:Archive [I]
  288. ClrDraw:ClrHome
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement