mrhoontar

Battle Sim

Oct 30th, 2016
59
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. Lbl ZZ
  2. AxesOff
  3. ClrDraw
  4. DelVar {Y1}
  5.  
  6. ClrHome
  7. DelVar [C]
  8. DelVar [D]
  9. {2,6}->dim([C]
  10. Fill(0,[C]
  11. {8,4}->dim([D]
  12. Fill(0,[D]
  13.  
  14. 0->X
  15. Lbl X1
  16. X+1->X
  17. If X=9
  18. Goto X2
  19. randInt(20,130)->[D](X,1
  20. Goto X1
  21.  
  22. Lbl X2
  23. 0->K
  24. Lbl 5A
  25. K+1->K
  26. If K=9
  27. Goto 5B
  28. randInt(1,2)->[D](K,2
  29. Goto 5A
  30.  
  31. Lbl 5B
  32. 1->N
  33. Text(0,21,"Welcome to my
  34. Text(6,18,"Battle Simulator
  35. Text(13,2,"First we will
  36. Text(13,45,"make a random
  37. Text(19,20,"enemy Pokemon.
  38. Text(30,19,"ENTER to advance
  39. Pause
  40. ClrDraw
  41. Text(1,1,"Before we begin, when you
  42. Text(7,1,"select a move to use, it will
  43. Text(13,1,"be shown in this format
  44. Text(20,10,"Base Power, Type
  45. Text(27,1,"As an example:
  46. Text(34,32,"77, Phys.
  47. Text(40,1,"77 Base Power, Physical Atk
  48. Text(47,19,"ENTER to advance
  49. Pause
  50.  
  51. ClrHome
  52. Disp "What should the","enemys level be?","
  53. Input "",X
  54.  
  55. {0,1->L1
  56. {0,[D](1,1)->L2
  57. LinReg(ax+b) {Y1}
  58. Equ>String({Y1},Str1
  59. sub(Str1,1,length(Str1)-3->Str1
  60.  
  61. {0,1->L1
  62. {0,[D](2,1)->L2
  63. LinReg(ax+b) {Y1}
  64. Equ>String({Y1},Str2
  65. sub(Str2,1,length(Str2)-3->Str2
  66.  
  67. {0,1->L1
  68. {0,[D](3,1)->L2
  69. LinReg(ax+b) {Y1}
  70. Equ>String({Y1},Str3
  71. sub(Str3,1,length(Str3)-3->Str3
  72.  
  73. {0,1->L1
  74. {0,[D](4,1)->L2
  75. LinReg(ax+b) {Y1}
  76. Equ>String({Y1},Str4
  77. sub(Str4,1,length(Str4)-3->Str4
  78.  
  79. If [D](1,2)=1
  80. Str1+", Phys."->Str1
  81. If [D](2,2)=1
  82. Str2+", Phys."->Str2
  83. If [D](3,2)=1
  84. Str3+", Phys."->Str3
  85. If [D](4,2)=1
  86. Str4+", Phys."->Str4
  87. If [D](1,2)=2
  88. Str1+", Spec."->Str1
  89. If [D](2,2)=2
  90. Str2+", Spec."->Str2
  91. If [D](3,2)=2
  92. Str3+", Spec."->Str3
  93. If [D](4,2)=2
  94. Str4+", Spec."->Str4
  95.  
  96. DelVar {Y1}
  97.  
  98. X->L
  99.  
  100. randInt(0,31->I
  101. randInt(0,255->E
  102. randInt(1,255->B
  103. iPart((((2B+I+(E/4))*L)/(100))+L+10)->[C](2,1
  104.  
  105. 1->A
  106.  
  107. Lbl Q3
  108. A+1->A
  109. If A=7
  110. Goto Q4
  111. randInt(0,31)->I
  112. randInt(0,255)->E
  113. randInt(6,130)->X
  114. randInt(5,X)->B
  115. iPart((((((2B+I+(E/4))*L)/(100))+5)*N))->[C](2,A
  116. Goto Q3
  117.  
  118. Lbl Q4
  119. ClrHome
  120. Text(1,38,"Stats
  121. Text(57,19,"ENTER to advance
  122. Text(3,4,"Enemy's
  123. Text(9,36,"Health
  124. Text(16,36,"Attack
  125. Text(23,30,"Sp. Attack
  126. Text(30,35,"Defense
  127. Text(37,29,"Sp. Defense
  128. Text(44,37,"Speed
  129.  
  130. Pause
  131. Text(9,12,[C](2,1
  132. Pause
  133. Text(16,12,[C](2,2
  134. Pause
  135. Text(23,12,[C](2,3
  136. Pause
  137. Text(30,12,[C](2,4
  138. Pause
  139. Text(37,12,[C](2,5
  140. Pause
  141. Text(44,12,[C](2,6
  142. Pause
  143.  
  144. ClrHome
  145. Disp "Now we make","your Pokemon!
  146. Pause "ENTER to advance
  147.  
  148. ClrHome
  149. Disp "What should","your level be?",""
  150. Input "",X
  151.  
  152. "Health"
  153. X->L
  154.  
  155. randInt(0,31)->I
  156. randInt(0,255)->E
  157. randInt(1,255)->B
  158. iPart((((2B+I+(E/4))*L)/(100))+L+10)->[C](1,1
  159.  
  160. 1->A
  161.  
  162. Lbl Q1
  163. A+1->A
  164. If A=7
  165. Goto Q2
  166. randInt(0,31)->I
  167. randInt(0,255)->E
  168. randInt(6,130)->X
  169. randInt(5,X)->B
  170. iPart((((((2B+I+(E/4))*L)/(100))+5)*N))->[C](1,A
  171. Goto Q1
  172.  
  173. Lbl Q2
  174. ClrHome
  175.  
  176. Text(3,70,"Yours
  177. Pause
  178. Text(9,78,[C](1,1
  179. Pause
  180. Text(16,78,[C](1,2
  181. Pause
  182. Text(23,78,[C](1,3
  183. Pause
  184. Text(30,78,[C](1,4
  185. Pause
  186. Text(37,78,[C](1,5
  187. Pause
  188. Text(44,78,[C](1,6
  189. Pause
  190.  
  191. 0->Y
  192. Lbl G1
  193. Y+1->Y
  194. If Y=9
  195. Goto G2
  196. If [D](Y,1)>=5 and [D](Y,1)<80
  197. Then
  198.     100->[D](Y,3
  199.     5->[D](Y,4
  200. End
  201. If [D](Y,1)>80 and [D](Y,1)<100
  202. Then
  203.     95->[D](Y,3
  204.     4->[D](Y,4
  205. End
  206. If [D](Y,1)>=100 and [D](Y,1)<110
  207. Then
  208.     90->[D](Y,3
  209.     3->[D](Y,4
  210. End
  211. If [D](Y,1)>=110 and [D](Y,1)<120
  212. Then
  213.     85->[D](Y,3
  214.     2->[D](Y,4
  215. End
  216. If [D](Y,1)>=120 and [D](Y,1)<=130
  217. Then
  218.     80->[D](Y,3
  219.     1->[D](Y,4
  220. End
  221.  
  222. Goto G1
  223.  
  224. Lbl G2
  225. If [C](1,6)>[C](2,6
  226. Goto A
  227. If [C](1,6)<[C](2,6
  228. Goto B
  229. If [C](1,6)=[C](2,6
  230. randInt(1,2)->X
  231. If X=1
  232. Goto A
  233. If X=2
  234. Goto B
  235.  
  236. Lbl A
  237. If [C](1,1)<=0
  238. Then
  239.     ClrHome
  240.     Disp "You lost!
  241.     Pause "ENTER to advance
  242.     Menu("Battle again?","Yes",ZZ,"No",Z1
  243.     Else
  244.     ClrHome
  245.     Disp "Your turn","to attack!
  246.     Pause "ENTER to advance
  247.     ClrHome
  248.     Lbl A8
  249.     ClrHome
  250.     If [D](1,4)=0 and [D](2,4)=0 and [D](3,4)=0 and [D](4,4)=0
  251.     Then
  252.         Disp "Youre out of PP!
  253.         Disp "You struggled!
  254.         [C](1,2)->A
  255.         [C](2,4)->D
  256.         50->B
  257.         iPart(([C](1,1)*.25))->J
  258.         iPart([C](1,1)-[C](1,1)*.25)->[C](1,1
  259.         Goto F1
  260.     End
  261.     Menu("What move?",Str1,A1,Str2,A2,Str3,A3,Str4,A4,"View Stats",A7
  262.     Lbl A1
  263.     If [D](1,4)=0
  264.     Goto FF
  265.     [D](1,4)-1->[D](1,4
  266.     1->X
  267.     If [D](1,2)=1
  268.     Goto A5
  269.     If [D](1,2)=2
  270.     Goto A6
  271.     Lbl A2
  272.     If [D](2,4)=0
  273.     Goto FF
  274.     [D](2,4)-1->[D](2,4
  275.     2->X
  276.     If [D](2,2)=1
  277.     Goto A5
  278.     If [D](2,2)=2
  279.     Goto A6
  280.     Lbl A3
  281.     If [D](3,4)=0
  282.     Goto FF
  283.     [D](3,4)-1->[D](3,4
  284.     3->X
  285.     If [D](3,2)=1
  286.     Goto A5
  287.     If [D](3,2)=2
  288.     Goto A6
  289.     Lbl A4
  290.     If [D](4,4)=0
  291.     Goto FF
  292.     [D](4,4)-1->[D](4,4
  293.     4->X
  294.     If [D](4,2)=1
  295.     Goto A5
  296.     If [D](4,2)=2
  297.     Goto A6
  298.  
  299.     Lbl A7
  300.     Pxl-On(4,4
  301.     Pause
  302.     Goto A8
  303.    
  304.     Lbl A5
  305.     [C](1,2)->A
  306.     [C](2,4)->D
  307.     Goto B1
  308.     Lbl A6
  309.     [C](1,3)->A
  310.     [C](2,5)->D
  311.     Goto B1
  312. End
  313.  
  314. Lbl B1
  315. [D](X,1)->B
  316. randInt(1,100)->S
  317. If S>75
  318. Then
  319.     1.5->S
  320.     Else
  321.     1->S
  322. End
  323. Goto ST
  324.  
  325. Lbl FF
  326. ClrHome
  327. Disp "Your move is
  328. Disp "out of PP!
  329. Disp "
  330. Disp "Choose a
  331. Disp "different move!
  332. Pause "Enter to advance
  333. Goto A8
  334.    
  335. Lbl ST
  336. X->Y
  337. If [D](Y,3)<=randInt(0,100)
  338. Then
  339.     ClrHome
  340.     Disp "You missed
  341.     Disp "the Pokemon!
  342.     Pause "ENTER to advance
  343.     Goto B
  344.     Else
  345.     randInt(1,100)->C
  346.     If C>94
  347.     Then
  348.         2->C
  349.         Else
  350.         1->C
  351.     End
  352. End
  353.  
  354. randInt(85,100)/100->R
  355. Goto GI
  356. Lbl F1
  357. Pause
  358. ClrHome
  359. Disp "You took
  360. Disp J
  361. Disp "recoil damage!
  362. Lbl GI
  363. SCR->M
  364. iPart(((((2L+10)/(250))*((A)/(D))*B+2)*M))->Q
  365.  
  366. [C](2,1)-Q->[C](2,1)
  367. If C=2
  368. Disp "Critical hit!
  369. Disp "You dealt",Q,"Damage!
  370. Pause "
  371. ClrHome
  372. Disp "Your enemy has
  373. If [C](2,1)<=0
  374. 0->[C](2,1)
  375. Disp [C](2,1),"Health left.
  376. Pause "ENTER to advance
  377. Goto B
  378.  
  379. Lbl B
  380. If [C](2,1)<=0
  381. Then
  382.     ClrHome
  383.     Disp "You won!
  384.     Pause "ENTER to advance
  385.     Menu("Battle again?","Yes",ZZ,"No",Z1
  386.     Else
  387.     ClrHome
  388.     Disp "Enemy's turn","to attack!
  389.     Pause "ENTER to advance
  390.     randInt(5,8)->X
  391.     If X=[D](X,2)=1
  392.     [C](2,2)->A
  393.     [C](1,4)->D
  394.     Goto D1
  395.     If X=[D](X,2)=2
  396.     [C](2,3)->A
  397.     [C](1,5)->D
  398.     Goto D1
  399. End
  400. Lbl D1
  401. [D](X,1)->B
  402. randInt(1,100)->S
  403. If S>75
  404. Then
  405.     1.5->S
  406.     Else
  407.     1->S
  408. End
  409.  
  410. X->Y
  411. If [D](Y,3)<=randInt(0,100)
  412. Then
  413.     ClrHome
  414.     Disp "The enemy
  415.     Disp "missed!
  416.     Pause "ENTER to advance
  417.     Goto A
  418.     Else
  419.     randInt(1,100)->C
  420.     If C>94
  421.     Then
  422.         2->C
  423.         Else
  424.         1->C
  425.     End
  426. End
  427.  
  428.  
  429.  
  430. randInt(85,100)/100->R
  431.  
  432. SCR->M
  433. iPart(((((2L+10)/(250))*((A)/(D))*B+2)*M))->Q
  434. [C](1,1)-Q->[C](1,1)
  435. ClrHome
  436. If C=2
  437. Disp "Critical hit!
  438. Disp "You were dealt",Q,"Damage!
  439. Pause ""
  440. ClrHome
  441. Disp "You have
  442. If [C](1,1)<=0
  443. 0->[C](1,1)
  444. Disp [C](1,1)
  445. Disp "Health left.
  446. Pause "ENTER to advance
  447. Goto A
  448.  
  449. Lbl Z1
  450. Stop
Add Comment
Please, Sign In to add comment