kickboxing_funcs.qsrc 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339
  1. # kickboxing_funcs
  2. if $ARGS[0] = 'init_fight_vars':
  3. temp_kickboxVars['pcs_points'] = 0
  4. temp_kickboxVars['npc_points'] = 0
  5. temp_kickboxVars['round'] = 1
  6. temp_kickboxVars['time'] = 0
  7. temp_kickboxVars['max_rounds'] = 3
  8. end
  9. if $ARGS[0] = 'generate_opponent':
  10. if $ARGS[1] = 'spar':
  11. gs 'npcgeneratec', 1, 'sparring partner', rand(19, 45)
  12. gs 'boyStat', $npclastgenerated
  13. temp_kickboxVars['npc_stren'] = rand(10, 20)
  14. temp_kickboxVars['npc_speed'] = rand(10, 20)
  15. temp_kickboxVars['npc_agil'] = rand(10, 20)
  16. temp_kickboxVars['npc_react'] = rand(10, 20)
  17. temp_kickboxVars['npc_vital'] = rand(10, 20)
  18. temp_kickboxVars['npc_intel'] = 10
  19. temp_kickboxVars['npc_will'] = 10
  20. !!skills
  21. temp_kickboxVars['npc_jab'] = rand(5, 20)
  22. temp_kickboxVars['npc_punch'] = rand(5, 20)
  23. temp_kickboxVars['npc_kick'] = rand(5, 20)
  24. temp_kickboxVars['npc_def'] = rand(5, 20)
  25. !!parameters
  26. elseif $ARGS[1] = 'amateur_fight':
  27. if ARGS[2] <= 0:
  28. gs 'npcgeneratec', 1, 'Useless rival', rand(19,45)
  29. gs 'boyStat', $npclastgenerated
  30. temp_kickboxVars['npc_stren'] = rand(10, 20)
  31. temp_kickboxVars['npc_speed'] = rand(10, 20)
  32. temp_kickboxVars['npc_agil'] = rand(10, 20)
  33. temp_kickboxVars['npc_react'] = rand(10, 20)
  34. temp_kickboxVars['npc_vital'] = rand(10, 20)
  35. temp_kickboxVars['npc_intel'] = 10
  36. temp_kickboxVars['npc_will'] = 10
  37. !!skills
  38. temp_kickboxVars['npc_jab'] = rand(10, 30)
  39. temp_kickboxVars['npc_punch'] = rand(10, 30)
  40. temp_kickboxVars['npc_kick'] = rand(10, 30)
  41. temp_kickboxVars['npc_def'] = rand(10, 30)
  42. elseif ARGS[2] = 1:
  43. gs 'npcgeneratec', 1, '3rd class rival', rand(19,45)
  44. gs 'boyStat', $npclastgenerated
  45. temp_kickboxVars['npc_stren'] = rand(15, 25)
  46. temp_kickboxVars['npc_speed'] = rand(15, 25)
  47. temp_kickboxVars['npc_agil'] = rand(15, 25)
  48. temp_kickboxVars['npc_react'] = rand(15, 25)
  49. temp_kickboxVars['npc_vital'] = rand(15, 25)
  50. temp_kickboxVars['npc_intel'] = 10
  51. temp_kickboxVars['npc_will'] = 10
  52. !!skills
  53. temp_kickboxVars['npc_jab'] = rand(15, 35)
  54. temp_kickboxVars['npc_punch'] = rand(15, 35)
  55. temp_kickboxVars['npc_kick'] = rand(15, 35)
  56. temp_kickboxVars['npc_def'] = rand(15, 35)
  57. elseif ARGS[2] = 2:
  58. gs 'npcgeneratec', 1, '2rd class rival', rand(19,45)
  59. gs 'boyStat', $npclastgenerated
  60. temp_kickboxVars['npc_stren'] = rand(20, 30)
  61. temp_kickboxVars['npc_speed'] = rand(20, 30)
  62. temp_kickboxVars['npc_agil'] = rand(20, 30)
  63. temp_kickboxVars['npc_react'] = rand(20, 30)
  64. temp_kickboxVars['npc_vital'] = rand(20, 30)
  65. temp_kickboxVars['npc_intel'] = 10
  66. temp_kickboxVars['npc_will'] = 10
  67. !!skills
  68. temp_kickboxVars['npc_jab'] = rand(30, 50)
  69. temp_kickboxVars['npc_punch'] = rand(30, 50)
  70. temp_kickboxVars['npc_kick'] = rand(30, 50)
  71. temp_kickboxVars['npc_def'] = rand(30, 50)
  72. elseif ARGS[2] = 3:
  73. gs 'npcgeneratec', 1, '1st class rival', rand(19,45)
  74. gs 'boyStat', $npclastgenerated
  75. temp_kickboxVars['npc_stren'] = rand(30, 40)
  76. temp_kickboxVars['npc_speed'] = rand(30, 40)
  77. temp_kickboxVars['npc_agil'] = rand(30, 40)
  78. temp_kickboxVars['npc_react'] = rand(30, 40)
  79. temp_kickboxVars['npc_vital'] = rand(30, 40)
  80. temp_kickboxVars['npc_intel'] = 10
  81. temp_kickboxVars['npc_will'] = 10
  82. !!skills
  83. temp_kickboxVars['npc_jab'] = rand(40, 60)
  84. temp_kickboxVars['npc_punch'] = rand(40, 60)
  85. temp_kickboxVars['npc_kick'] = rand(40, 60)
  86. temp_kickboxVars['npc_def'] = rand(40, 60)
  87. elseif ARGS[2] = 4:
  88. gs 'npcgeneratec', 1, 'Excellent rival', rand(19,45)
  89. gs 'boyStat', $npclastgenerated
  90. temp_kickboxVars['npc_stren'] = rand(40, 60)
  91. temp_kickboxVars['npc_speed'] = rand(40, 60)
  92. temp_kickboxVars['npc_agil'] = rand(40, 60)
  93. temp_kickboxVars['npc_react'] = rand(40, 60)
  94. temp_kickboxVars['npc_vital'] = rand(40, 60)
  95. temp_kickboxVars['npc_intel'] = 10
  96. temp_kickboxVars['npc_will'] = 10
  97. !!skills
  98. temp_kickboxVars['npc_jab'] = rand(60, 80)
  99. temp_kickboxVars['npc_punch'] = rand(60, 80)
  100. temp_kickboxVars['npc_kick'] = rand(60, 80)
  101. temp_kickboxVars['npc_def'] = rand(60, 80)
  102. else
  103. gs 'npcgeneratec', 1, 'Best rival in the gym', rand(19,45)
  104. gs 'boyStat', $npclastgenerated
  105. temp_kickboxVars['npc_stren'] = rand(60, 100)
  106. temp_kickboxVars['npc_speed'] = rand(60, 100)
  107. temp_kickboxVars['npc_agil'] = rand(60, 100)
  108. temp_kickboxVars['npc_react'] = rand(60, 100)
  109. temp_kickboxVars['npc_vital'] = rand(60, 100)
  110. temp_kickboxVars['npc_intel'] = 10
  111. temp_kickboxVars['npc_will'] = 10
  112. !!skills
  113. temp_kickboxVars['npc_jab'] = rand(80, 110)
  114. temp_kickboxVars['npc_punch'] = rand(80, 110)
  115. temp_kickboxVars['npc_kick'] = rand(80, 110)
  116. temp_kickboxVars['npc_def'] = rand(80, 110)
  117. end
  118. end
  119. temp_kickboxVars['npc_max_health'] = temp_kickboxVars['npc_vital'] * 10 + temp_kickboxVars['npc_stren'] * 5
  120. temp_kickboxVars['npc_health'] = temp_kickboxVars['npc_max_health']
  121. temp_kickboxVars['npc_stam'] = (30 * (2 * temp_kickboxVars['npc_vital'] + temp_kickboxVars['npc_agil'] + temp_kickboxVars['npc_stren']) + 1000) / 13
  122. end
  123. if $ARGS[0] = 'set_initiative':
  124. temp_kickboxVars['pcs_init'] = pcs_agil + pcs_react
  125. temp_kickboxVars['npc_init'] = temp_kickboxVars['npc_speed'] + temp_kickboxVars['npc_react']
  126. temp_kickboxVars['pcs_init_true'] = rand(temp_kickboxVars['pcs_init'] - temp_kickboxVars['pcs_init'] / 5, temp_kickboxVars['pcs_init'] + temp_kickboxVars['pcs_init'] / 5)
  127. temp_kickboxVars['npc_init_true'] = rand(temp_kickboxVars['npc_init'] - temp_kickboxVars['npc_init'] / 5, temp_kickboxVars['npc_init'] + temp_kickboxVars['npc_init'] / 5)
  128. if temp_kickboxVars['set_init'] = 0:
  129. temp_kickboxVars['set_init'] = 1
  130. if temp_kickboxVars['pcs_init_true'] > temp_kickboxVars['npc_init_true'] and temp_kickboxVars['pcs_inittime'] < 3 or temp_kickboxVars['npc_inittime'] >= 3:
  131. temp_kickboxVars['active_init'] = 0
  132. temp_kickboxVars['pcs_inittime'] += 1
  133. temp_kickboxVars['npc_inittime'] = 0
  134. '<font color="green">You take the initiative.</font>'
  135. elseif temp_kickboxVars['pcs_init_true'] < temp_kickboxVars['npc_init_true'] and temp_kickboxVars['npc_inittime'] < 3 or temp_kickboxVars['pcs_inittime'] >= 3:
  136. temp_kickboxVars['active_init'] = 1
  137. temp_kickboxVars['pcs_inittime'] = 0
  138. temp_kickboxVars['npc_inittime'] += 1
  139. '<font color="red"><<$boydesc>> took the initiative.</font>'
  140. else
  141. if rand(0, 1) = 0:
  142. temp_kickboxVars['active_init'] = 0
  143. temp_kickboxVars['pcs_inittime'] += 1
  144. temp_kickboxVars['npc_inittime'] = 0
  145. '<font color="green">You take the initiative.</font>'
  146. else
  147. temp_kickboxVars['active_init'] = 1
  148. temp_kickboxVars['pcs_inittime'] = 0
  149. temp_kickboxVars['npc_inittime'] += 1
  150. '<font color="red"><<$boydesc>> took the initiative.</font>'
  151. end
  152. end
  153. end
  154. end
  155. if $ARGS[0] = 'attack':
  156. if $ARGS[1] = 'player':
  157. if $ARGS[2] = 'jab':
  158. temp_kickboxVars['damage'] = rand(pcs_stren / 12, pcs_stren / 8)
  159. temp_kickboxVars['hit_mod'] = (pcs_agil + pcs_react + pcs_jab) * 2
  160. elseif $ARGS[2] = 'punch':
  161. temp_kickboxVars['damage'] = pcs_stren + rand(-pcs_stren / 5, pcs_stren / 5)
  162. temp_kickboxVars['hit_mod'] = (pcs_agil + pcs_react + pcs_punch)
  163. elseif $ARGS[2] = 'kick':
  164. temp_kickboxVars['damage'] = 3 * pcs_stren + rand(-3 * (pcs_stren / 5), 3 * (pcs_stren / 5))
  165. temp_kickboxVars['hit_mod'] = (pcs_agil + pcs_react + pcs_kick) / 2
  166. end
  167. temp_kickboxVars['hit_chance'] = temp_kickboxVars['hit_mod'] + rand(-temp_kickboxVars['hit_mod'] / 5, temp_kickboxVars['hit_mod'] / 5)
  168. if temp_kickboxVars['damage'] <= 0: temp_kickboxVars['damage'] = 1
  169. temp_kickboxVars['base_def'] = temp_kickboxVars['npc_agil'] + temp_kickboxVars['npc_react'] + temp_kickboxVars['npc_def']
  170. temp_kickboxVars['defence'] = temp_kickboxVars['base_def'] + rand(-temp_kickboxVars['base_def'] / 5, temp_kickboxVars['base_def'] / 5)
  171. if temp_kickboxVars['hit_chance'] < temp_kickboxVars['defence']:
  172. '<font color="red">You''ve missed.</font>'
  173. else
  174. if temp_kickboxVars['hit_chance'] < temp_kickboxVars['defence'] * 2:
  175. '<font color="green">Contact</font>'
  176. else
  177. '<b><font color="green">HIT</font></b>'
  178. temp_kickboxVars['damage'] += temp_kickboxVars['damage'] / 5
  179. end
  180. temp_kickboxVars['npc_health'] -= temp_kickboxVars['damage']
  181. temp_kickboxVars['pcs_points'] += 1
  182. '<font color="green">You have dealt <<temp_kickboxVars[''damage'']>> points of damage.</font>'
  183. if temp_kickboxVars['damage'] >= temp_kickboxVars['npc_health'] / 5:
  184. temp_kickboxVars['pcs_points'] += 1
  185. '<font color="green"><<$boydesc>> falls to the ground.</font>'
  186. if temp_kickboxVars['npc_health'] < temp_kickboxVars['npc_max_health'] / 4:
  187. '<font color="green"><<$boydesc>> is knocked out. You''ve won!</font>'
  188. temp_kickboxVars['KO'] = 1
  189. end
  190. end
  191. end
  192. end
  193. if $ARGS[1] = 'enemy':
  194. if $ARGS[2] = 'jab':
  195. temp_kickboxVars['damage'] = rand(temp_kickboxVars['npc_stren'] / 12, temp_kickboxVars['npc_stren'] / 8)
  196. temp_kickboxVars['hit_mod'] = (temp_kickboxVars['npc_speed'] + temp_kickboxVars['npc_react'] + temp_kickboxVars['npc_jab']) * 2
  197. elseif $ARGS[2] = 'punch':
  198. temp_kickboxVars['damage'] = temp_kickboxVars['npc_stren'] + rand(-temp_kickboxVars['npc_stren'] / 5, temp_kickboxVars['npc_stren'] / 5)
  199. temp_kickboxVars['hit_mod'] = (temp_kickboxVars['npc_speed'] + temp_kickboxVars['npc_react'] + temp_kickboxVars['npc_punch'])
  200. elseif $ARGS[2] = 'kick':
  201. temp_kickboxVars['damage'] = 3 * temp_kickboxVars['npc_stren'] + rand(-3 * (temp_kickboxVars['npc_stren'] / 5), 3 * (temp_kickboxVars['npc_stren'] / 5))
  202. temp_kickboxVars['hit_mod'] = (temp_kickboxVars['npc_speed'] + temp_kickboxVars['npc_react'] + temp_kickboxVars['npc_kick']) / 2
  203. end
  204. temp_kickboxVars['hit_chance'] = temp_kickboxVars['hit_mod'] + rand(-temp_kickboxVars['hit_mod'] / 5, temp_kickboxVars['hit_mod'] / 5)
  205. if temp_kickboxVars['damage'] <= 0: temp_kickboxVars['damage'] = 1
  206. temp_kickboxVars['base_def'] = pcs_agil + pcs_react + pcs_def
  207. temp_kickboxVars['defence'] = temp_kickboxVars['base_def'] + rand(-temp_kickboxVars['base_def'] / 5, temp_kickboxVars['base_def'] / 5)
  208. if temp_kickboxVars['hit_chance'] < temp_kickboxVars['defence']:
  209. '<font color="green">Missed</font>'
  210. else
  211. if temp_kickboxVars['hit_chance'] < temp_kickboxVars['defence'] * 2:
  212. '<font color="red">You''ve gotten hit.</font>'
  213. else
  214. '<b><font color="red">You''ve gotten hit.</font></b>'
  215. temp_kickboxVars['damage'] += temp_kickboxVars['damage'] / 5
  216. end
  217. pcs_health -= temp_kickboxVars['damage']
  218. temp_kickboxVars['npc_points'] += 1
  219. '<font color="red">You have received <<temp_kickboxVars[''damage'']>> points of damage.</font>'
  220. if temp_kickboxVars['damage'] >= pcs_health / 5:
  221. temp_kickboxVars['npc_points'] += 1
  222. '<font color="red">You have fallen to the ground.</font>'
  223. if pcs_health < healthmax / 4:
  224. '<font color="red">You are knocked out. You''ve lost!</font>'
  225. temp_kickboxVars['KO'] = 1
  226. end
  227. end
  228. end
  229. end
  230. end
  231. if $ARGS[0] = 'sash_advancement':
  232. if kickbox['sash'] = 0:
  233. if kickbox['advancement'] >= 5:
  234. kickbox['sash'] = 1
  235. kickbox['advancement'] = 0
  236. kickbox['money'] = 200
  237. 'Having covered red, yellow and orange in your basic training, you have now been awarded green sash(rank 4).'
  238. end
  239. elseif kickbox['sash'] = 1:
  240. if kickbox['advancement'] >= 10:
  241. kickbox['sash'] = 2
  242. kickbox['advancement'] = 0
  243. kickbox['money'] = 500
  244. 'You have been awarded purple sash(rank 5).'
  245. end
  246. elseif kickbox['sash'] = 2:
  247. if kickbox['advancement'] >= 15:
  248. kickbox['sash'] = 3
  249. kickbox['advancement'] = 0
  250. kickbox['money'] = 1500
  251. 'You have been awarded blue sash(rank 6).'
  252. end
  253. elseif kickbox['sash'] = 3:
  254. if kickbox['advancement'] >= 20:
  255. kickbox['sash'] = 4
  256. kickbox['advancement'] = 0
  257. kickbox['money'] = 3500
  258. 'You have been awarded brown sash(rank 7).'
  259. end
  260. elseif kickbox['sash'] = 4:
  261. if kickbox['advancement'] >= 25:
  262. kickbox['sash'] = 5
  263. kickbox['advancement'] = 0
  264. kickbox['money'] = 7500
  265. 'You have been awarded black sash, 1st dan.'
  266. end
  267. end
  268. end
  269. if $ARGS[0] = 'display_header':
  270. '<b>= = = = = = = = = = = = = (ROUND <<temp_kickboxVars[''round'']>>) = = = = = = = = = = = = =</b>'
  271. if temp_kickboxVars['time'] = 0:
  272. '<b>Start of the round</b>'
  273. elseif temp_kickboxVars['time'] = 1:
  274. '<b>Time in round 0:30</b>'
  275. elseif temp_kickboxVars['time'] = 2:
  276. '<b>Time in round 1:00</b>'
  277. elseif temp_kickboxVars['time'] = 3:
  278. '<b>Time in round 1:30</b>'
  279. elseif temp_kickboxVars['time'] = 4:
  280. '<b>Time in round 2:00</b>'
  281. elseif temp_kickboxVars['time'] = 5:
  282. '<b>Time in round 2:30</b>'
  283. else
  284. '<b>Time in round 3:00</b>'
  285. end
  286. '<b><<$boydesc>></b> health <b><font color="red"><<temp_kickboxVars[''npc_health'']>></font></b>, Stamina <b><font color="green"><<temp_kickboxVars[''npc_stam'']>></font></b>'
  287. 'Your health <b><font color="red"><<pcs_health>></font></b>, stamina <b><font color="green"><<pcs_stam>></font></b>'
  288. '<b>= = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =</b>'
  289. 'Your points: <<temp_kickboxVars[''pcs_points'']>> Opponent''s points: <<temp_kickboxVars[''npc_points'']>>'
  290. '<b>= = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =</b>'
  291. end
  292. if $ARGS[0] = 'display_header2':
  293. end
  294. --- kickboxing_funcs ---------------------------------