fight.qsrc 33 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119
  1. # fight
  2. !2020/10/14/Gwen
  3. !{ To Use Fight:
  4. 1) Initialize fight to make sure previous fighter are cleared out.
  5. 2) Add Opponents and Allies
  6. 3) Set Fight Ending
  7. 4) Start Fight
  8. Example:
  9. Let''s make a fight where Tatiana helps us beat Kisame and a bandit
  10. gs 'fight','initFight'
  11. gs 'fight_npcdata', 'tatiana', 'pcs'
  12. gs 'fight_npcdata', 'kisame', 'opp'
  13. gs 'fight_npcdata', 'bandit', 'opp'
  14. fightEnding = 2
  15. gt 'fight', 'start'
  16. }
  17. !! Variables to be set for each participant before fight - in brackets so you can copy/paste
  18. !!{
  19. $opp_name[0] = <<name of opponent>>
  20. $opp_image[0] = opponent image ie. '<img <<$set_imgh>> src="images/characters/city/tobi/tobi.jpg">'
  21. opp_def[0] = opponent defence
  22. opp_run[0] = Opponent running skill used for player escape
  23. opp_wrstlng[0] = Wrestling skill
  24. opp_kick[0] = Kicking
  25. opp_punch[0] = Power punch
  26. opp_jab[0] = Light punch
  27. opp_stren[0] = Strengh
  28. opp_agil[0] = Agility
  29. opp_vital[0] = vitality
  30. opp_react[0] = Reactions
  31. opp_health[0] = Health
  32. opp_willpwr[0] = willpower
  33. opp_shoot[0] = opponent marksmanship (only required if they are armed)
  34. opp_magik[0] = only if they have magic
  35. opp_mana[0] = only if they have magic
  36. opp_fog[0] = (tuman): Obscures vision, makes hitting harder.
  37. opp_clone[0] = (klon): Copies of the char that absorb 1 hit and disappear. A char may have some number of them.
  38. opp_shield[0] = (defence): Shielding that absorbs damage before hitpoints.
  39. opp_dambonus[0] = (magweapbonus): damage added to melee attacks
  40. opp_init[0] = (initBonus): attack faster/first
  41. opp_stun[0] = (stunner): make target unable to act for some amount of time
  42. opp_spells[0] = comma delimited list of spell names
  43. }
  44. !! Use the above with [1] and [2] for extra opponents
  45. !! Use pcs_ prefix for Sveta and add [1] and [2] for allies. ie. $pcs_name[1] = 'Reinhold'
  46. if $ARGS[0] = 'initFight':
  47. !! Clear Opponents from previous battle
  48. killvar '$opp_name'
  49. killvar '$opp_image'
  50. killvar 'opp_def'
  51. killvar 'opp_run'
  52. killvar 'opp_wrstlng'
  53. killvar 'opp_kick'
  54. killvar 'opp_punch'
  55. killvar 'opp_jab'
  56. killvar 'opp_stren'
  57. killvar 'opp_agil'
  58. killvar 'opp_vital'
  59. killvar 'opp_react'
  60. killvar 'opp_health'
  61. killvar 'opp_willpwr'
  62. killvar 'opp_shoot'
  63. killvar 'opp_magik'
  64. killvar 'opp_mana'
  65. killvar 'opp_fog'
  66. killvar 'opp_clone'
  67. killvar 'opp_shield'
  68. killvar 'opp_dambonus'
  69. killvar 'opp_init'
  70. killvar 'opp_stun'
  71. killvar '$opp_spells'
  72. killvar 'opp_timer'
  73. !! Clear any allies from previous battle
  74. i = arrsize('pcs_health')
  75. :ClearAllyLoop
  76. if i > 1:
  77. gs 'fight', 'clearPCSArray', i-1
  78. i -= 1
  79. jump 'ClearAllyLoop'
  80. end
  81. killvar 'i'
  82. !! Initialize $pcs_name for Sveta
  83. $pcs_name[0] = 'You'
  84. if ARGS[1] = 1:
  85. $pcs_image[0] = 'images/system/1_openings/1_tf/mikhail_1.jpg'
  86. else
  87. $pcs_image[0] = FUNC('$face_image')
  88. end
  89. end
  90. if $ARGS[0] = 'clearPCSArray':
  91. !{ Delete an Ally from the pcs data arrays
  92. ARGS[1] = Which ally slot tot delete
  93. }
  94. i = ARGS[1]
  95. killvar '$pcs_name', i
  96. killvar '$pcs_image', i
  97. killvar 'pcs_def', i
  98. killvar 'pcs_run', i
  99. killvar 'pcs_wrstlng', i
  100. killvar 'pcs_kick', i
  101. killvar 'pcs_punch', i
  102. killvar 'pcs_jab', i
  103. killvar 'pcs_stren', i
  104. killvar 'pcs_agil', i
  105. killvar 'pcs_vital', i
  106. killvar 'pcs_react', i
  107. killvar 'pcs_health', i
  108. killvar 'pcs_willpwr', i
  109. killvar 'pcs_shoot', i
  110. killvar 'pcs_magik', i
  111. killvar 'pcs_mana', i
  112. killvar 'pcs_fog', i
  113. killvar 'pcs_clone', i
  114. killvar 'pcs_shield', i
  115. killvar 'pcs_dambonus', i
  116. killvar 'pcs_init', i
  117. killvar 'pcs_stun', i
  118. killvar 'pcs_spells', i
  119. killvar 'pcs_timer', i
  120. killvar 'i'
  121. end
  122. if $ARGS[0] = 'randomOpp':
  123. !{ Generate a random Opponent
  124. ARGS[1] = Optional, raise difficulty of the attacker, 0 - 50
  125. }
  126. OppDiffBonus = ARGS[1]
  127. i = arrsize('opp_health')
  128. $opp_name[i] = 'Opponent 1'
  129. $opp_image[i] = 'images/locations/shared/street/mugger.jpg'
  130. opp_def[i] = rand(1,50) + OppDiffBonus
  131. opp_run[i] = rand(1,50) + OppDiffBonus
  132. opp_wrstlng[i] = rand(1,50) + OppDiffBonus
  133. opp_kick[i] = rand(1,50) + OppDiffBonus
  134. opp_punch[i] = rand(1,50) + OppDiffBonus
  135. opp_jab[i] = rand(1,50) + OppDiffBonus
  136. opp_stren[i] = rand(1,50) + OppDiffBonus
  137. opp_agil[i] = rand(1,50) + OppDiffBonus
  138. opp_vital[i] = rand(1,50) + OppDiffBonus
  139. opp_health[i] = (opp_vital * 10 + opp_stren * 5)
  140. opp_react[i] = rand(1,50) + OppDiffBonus
  141. opp_willpwr[i] = rand(1,50) + OppDiffBonus
  142. opp_shoot[i] = rand(1,50) + OppDiffBonus
  143. killvar 'OppDiffBonus'
  144. killvar 'i'
  145. end
  146. if $ARGS[0] = 'applyDamage':
  147. !{ Apply Damage to a participant taking into account clones and shields
  148. $ARGS[1] = Target Type ('opp','pcs')
  149. ARGS[2] = Target number
  150. ARGS[3] = damage to be applied
  151. }
  152. $fightAppDam['TargetType'] = $ARGS[1]
  153. fightAppDam['TargetNumber'] = ARGS[2]
  154. fightAppDam['Damage'] = ARGS[3]
  155. $fightAppDam['TargetName'] = dyneval('$result=$<<$fightAppDam[''TargetType'']>>_name[<<fightAppDam[''TargetNumber'']>>]')
  156. fightAppDam['Shield'] = dyneval('result=<<$fightAppDam[''TargetType'']>>_shield[<<fightAppDam[''TargetNumber'']>>]')
  157. fightAppDam['OverShieldDamage'] = dyneval('result=<<fightAppDam[''Damage'']>> - <<$fightAppDam[''TargetType'']>>_shield[<<fightAppDam[''TargetNumber'']>>]')
  158. dynamic "
  159. !!If the target has clones, destroy one
  160. if <<$fightAppDam['TargetType']>>_clone[<<fightAppDam['TargetNumber']>>] > 0:
  161. <<$fightAppDam['TargetType']>>_clone[<<fightAppDam['TargetNumber']>>] -= 1
  162. if $fightAppDam['TargetName'] = 'you':
  163. ""<<$fightAppDam['TargetName']>> lose a clone.""
  164. else
  165. ""<<$fightAppDam['TargetName']>> loses a clone.""
  166. end
  167. !!if the target has enough shields to mitigate, remove some shields
  168. elseif <<$fightAppDam['TargetType']>>_shield[<<fightAppDam['TargetNumber']>>] >= <<fightAppDam['Damage']>>:
  169. <<$fightAppDam['TargetType']>>_shield[<<fightAppDam['TargetNumber']>>] -= <<fightAppDam['Damage']>>
  170. if $fightAppDam['TargetName'] = 'you':
  171. ""<<$fightAppDam['TargetName']>> lose <<fightAppDam['Damage']>> defense.""
  172. else
  173. ""<<$fightAppDam['TargetName']>> loses <<fightAppDam['Damage']>> defense.""
  174. end
  175. !!otherwise remove shields to 0 and the remainder comes from health
  176. else
  177. if <<$fightAppDam['TargetType']>>_shield[<<fightAppDam['TargetNumber']>>] > 0:
  178. <<$fightAppDam['TargetType']>>_shield[<<fightAppDam['TargetNumber']>>] = 0
  179. if $fightAppDam['TargetName'] = 'you':
  180. ""<<$fightAppDam['TargetName']>> lose <<fightAppDam['Shield']>> defense.""
  181. else
  182. ""<<$fightAppDam['TargetName']>> losses <<fightAppDam['Shield']>> defense.""
  183. end
  184. end
  185. if <<$fightAppDam['TargetType']>>_health[<<fightAppDam['TargetNumber']>>] > <<fightAppDam['OverShieldDamage']>>:
  186. <<$fightAppDam['TargetType']>>_health[<<fightAppDam['TargetNumber']>>] -= <<fightAppDam['OverShieldDamage']>>
  187. else
  188. <<$fightAppDam['TargetType']>>_health[<<fightAppDam['TargetNumber']>>] = 0
  189. end
  190. if $fightAppDam['TargetName'] = 'you':
  191. ""<<$fightAppDam['TargetName']>> lose <<fightAppDam['OverShieldDamage']>> health.""
  192. else
  193. ""<<$fightAppDam['TargetName']>> loses <<fightAppDam['OverShieldDamage']>> health.""
  194. end
  195. end
  196. "
  197. killvar '$fightAppDam'
  198. killvar 'fightAppDam'
  199. end
  200. if $ARGS[0] = 'start':
  201. menu_off = 1
  202. inFight = 1
  203. gs 'themes', 'indoors'
  204. cla
  205. if arrsize('pcs_health') > arrsize('opp_health'):
  206. tableSize = arrsize('pcs_health')
  207. else
  208. tableSize = arrsize('opp_health')
  209. end
  210. $HTMLText = '<table border=1>
  211. <tr>
  212. <th align="left"><b><font size=18>Allies</font></b></td>
  213. <th align="center" valign="center" rowspan=<<tableSize*2+1>> ><b><font size=18>vs.</font></b></center></td>
  214. <th align="right"><b><font size=18>Opponents</font></b></td>
  215. </tr>'
  216. i = 0
  217. :FightPoster
  218. if i < tableSize:
  219. $HTMLText += '
  220. <tr>
  221. <td align="left"><img HEIGHT=300 src="<<$pcs_image[i]>>"></left></td>
  222. <td align="right"><img HEIGHT=300 src="<<$opp_image[i]>>"></right></td>
  223. </tr>
  224. <tr>
  225. <td align="left"><b><font size=10><<$pcs_name[i]>></font></b></left></td>
  226. <td align="right"><b><font size=10><<$opp_name[i]>></font></b></right></td>
  227. </tr>'
  228. i += 1
  229. jump 'FightPoster'
  230. end
  231. $HTMLText += '</table>'
  232. *pl func('cleanHTML',$HTMLText)
  233. i=0
  234. :PCSTimerInit
  235. if i < arrsize('pcs_health'):
  236. pcs_timer[i] = 60 - (pcs_react[i]/2)
  237. i +=1
  238. jump 'PCSTimerInit'
  239. end
  240. i=0
  241. :OppTimerInit
  242. if i < arrsize('opp_health'):
  243. opp_timer[i] = 60 - (opp_react[i]/2)
  244. i +=1
  245. jump 'OppTimerInit'
  246. end
  247. act 'Fight!': gt 'fight', 'main'
  248. killvar '$HTMLText'
  249. killvar 'tableSize'
  250. killvar 'i'
  251. end
  252. if $ARGS[0] = 'findActiveTimer':
  253. !! Find the participant with the lowest Timer
  254. ! These values are passed back via two global variables.
  255. !
  256. ! $fightTimType = 'player' or 'opponent' depending on which group has the lowest member
  257. ! fightTimNum = the array number of the lowest participant
  258. $fightTimType = 'player'
  259. fightTimNum = 0
  260. !! set this to high so that everyone will be lower.
  261. fightTimLow = 99999
  262. !! Find lowest of pcs participants
  263. i = 0
  264. :LowTimerLoop1
  265. if i < arrsize('pcs_timer'):
  266. !Skip round if char is stunned
  267. if pcs_stun[i] > 0:
  268. pcs_stun[i] -= 1
  269. !Skip anyone with no Health
  270. elseif pcs_health[i] > 0:
  271. if pcs_timer[i] < fightTimLow:
  272. fightTimLow = pcs_timer[i]
  273. fightTimNum = i
  274. end
  275. end
  276. i += 1
  277. jump 'LowTimerLoop1'
  278. end
  279. !!Find if any Opponents have lower than best PCS
  280. i = 0
  281. :LowTimerLoop2
  282. if i < arrsize('opp_timer'):
  283. !Skip round if char is stunned
  284. if opp_stun[i] > 0:
  285. opp_stun[i] -= 1
  286. !Skip anyone with no Health
  287. elseif opp_health[i] > 0:
  288. if opp_timer[i] < fightTimLow:
  289. fightTimLow = opp_timer[i]
  290. fightTimNum = i
  291. $fightTimType = 'opponent'
  292. end
  293. end
  294. i += 1
  295. jump 'LowTimerLoop2'
  296. end
  297. killvar 'i'
  298. end
  299. if $ARGS[0] = 'main':
  300. gs 'fight', 'result_check'
  301. gs 'fight', 'findActiveTimer'
  302. gt 'fight', $fightTimType, fightTimNum
  303. end
  304. if $ARGS[0] = 'printStats':
  305. !{ Print the stats for a character
  306. $ARGS[1] = The Type of char ('opp','pcs')
  307. ARGS[2] = The member of the party
  308. }
  309. $fightPStats['CharType'] = $ARGS[1]
  310. i = ARGS[2]
  311. if $fightPStats['CharType'] = 'opp':
  312. $fightPStats['Name'] = $opp_name[i]
  313. fightPStats['Health'] = opp_health[i]
  314. fightPStats['Mana'] = opp_mana[i]
  315. fightPStats['Willpower'] = opp_willpwr[i]
  316. fightPStats['Shield'] = opp_shield[i]
  317. fightPStats['Fog'] = opp_fog[i]
  318. fightPStats['Clone'] = opp_clone[i]
  319. fightPStats['Stun'] = opp_stun[i]
  320. fightPStats['Timer'] = opp_timer[i]
  321. $fightPStats['Image'] = $opp_image[i]
  322. else
  323. $fightPStats['Name'] = $pcs_name[i]
  324. fightPStats['Health'] = pcs_health[i]
  325. fightPStats['Mana'] = pcs_mana[i]
  326. fightPStats['Willpower'] = pcs_willpwr[i]
  327. fightPStats['Shield'] = pcs_shield[i]
  328. fightPStats['Fog'] = pcs_fog[i]
  329. fightPStats['Clone'] = pcs_clone[i]
  330. fightPStats['Stun'] = pcs_stun[i]
  331. fightPStats['Timer'] = pcs_timer[i]
  332. $fightPStats['Image'] = $pcs_image[i]
  333. end
  334. $fightStatRowText = "
  335. <tr>
  336. <td rowspan=4 align=right valign=center>
  337. <img HEIGHT=70 src='<<$fightPStats['Image']>>'>
  338. <br> <b><<$fightPStats['Name']>></b>
  339. </td>
  340. <td align=right> Life </td>
  341. <td align=right> <b><font color = red><<fightPStats['Health']>></font></b> </td>
  342. <td rowspan=4 align=left valign=center>"
  343. if fightPStats['Shield'] > 0:$fightStatRowText += "<b><font color = purple>Protection <<fightPStats['Shield']>> units</font></b><br>"
  344. if fightPStats['Clone'] > 0:$fightStatRowText += "<b><font color = purple>Clones active <<fightPStats['Clone']>> </font></b><br>"
  345. if fightPStats['Fog'] > 0:$fightStatRowText += "<b><font color = purple>Obscuring Fog <<fightPStats['Fog']>> units</font></b><br>"
  346. if fightPStats['Stun'] > 0:$fightStatRowText += "<b><font color = purple>Stunned <<fightPStats['Stun']>> rounds</font></b>"
  347. $fightStatRowText += "
  348. </td>
  349. </tr>
  350. <tr>
  351. <td align=right> Mana </td>
  352. <td align=right> <b><font color = blue><<fightPStats['Mana']>></font></b> </td>
  353. </tr>
  354. <tr>
  355. <td align=right> Willpower </td>
  356. <td align=right> <b><font color = green><<fightPStats['Willpower']>></font></b> </td>
  357. </tr>
  358. <tr>
  359. <td align=right> Initiative </td>
  360. <td align=right> <b><font color = orange><<fightPStats['Timer']>></font></b> </td>
  361. </tr><tr><td colspan=4 bgcolor=grey></td></tr>"
  362. $result = $fightStatRowText
  363. killvar 'i'
  364. killvar 'fightPStats'
  365. killvar '$fightPStats'
  366. end
  367. if $ARGS[0] = 'statDisplay':
  368. $fightStatText = "
  369. <table border=1><th colspan=4><b><font size=12>Opponents</font></b></th>
  370. "
  371. j = 0
  372. :OppLoopRC1
  373. if j < arrsize('opp_health'):
  374. $fightStatText += func('fight', 'printStats', 'opp', j)
  375. j += 1
  376. jump 'OppLoopRC1'
  377. end
  378. $fightStatText += "</table>"
  379. *pl func('cleanHTML',$fightStatText)
  380. *nl
  381. $fightStatText = "
  382. <table border=1><th colspan=4><b><font size=12>Opponents</font></b></th>
  383. "
  384. j = 0
  385. :PCSLoopRC1
  386. if j < arrsize('pcs_health'):
  387. $fightStatText += func('fight', 'printStats', 'pcs', j)
  388. j += 1
  389. jump 'PCSLoopRC1'
  390. end
  391. $fightStatText += "</table>"
  392. *pl func('cleanHTML',$fightStatText)
  393. end
  394. if $ARGS[0] = 'result_check':
  395. !!cheat to auto-win fights check
  396. if cheatVars['win_fights'] = 1:
  397. xgt 'ender', 'win'
  398. gt $loc, $loc_arg
  399. exit
  400. end
  401. !!win/lose conditions
  402. if func('fight', 'AvailableTargets', 'pcs') = 0:
  403. '<b><font color = red> You lost!</font></b>'
  404. xgt'ender','loss'
  405. gt $loc, $loc_arg
  406. exit
  407. elseif func('fight', 'AvailableTargets', 'opp') = 0:
  408. '<b><font color = green> You won!</font></b>'
  409. xgt'ender','win'
  410. gt $loc, $loc_arg
  411. exit
  412. elseif pcs_willpwr <= 0:
  413. '<b><font color = red> You cannot summon the will to fight!</font></b>'
  414. xgt'ender','loss'
  415. gt $loc, $loc_arg
  416. exit
  417. end
  418. !gt 'fight', 'main'
  419. killvar 'i'
  420. end
  421. !! Kick
  422. $AttackType[0] = 'Kick'
  423. $AttackSkill[0] = 'kick'
  424. AttackMin[0] = 5
  425. AttackMax[0] = 8
  426. AttackTime[0] = 40
  427. !! Hard Punch
  428. $AttackType[1] = 'Hard Punch'
  429. $AttackSkill[1] = 'punch'
  430. AttackMin[1] = 4
  431. AttackMax[1] = 6
  432. AttackTime[1] = 30
  433. !! Jab
  434. $AttackType[2] = 'Jab'
  435. $AttackSkill[2] = 'jab'
  436. AttackMin[2] = 2
  437. AttackMax[2] = 3
  438. AttackTime[2] = 15
  439. !!{Attack a target
  440. $ARGS[1] = Attack Type (Kick, Hard Punch, Jab)
  441. ARGS[2] = Which target
  442. ARGS[3] = Which Attacker
  443. }
  444. if $ARGS[0] = 'Attack':
  445. $fightAtk_Type = $ARGS[1]
  446. fightAtk_Type = arrpos('$AttackType',$fightAtk_Type)
  447. $fightAtk_TargetType = $ARGS[2]
  448. fightAtk_TargetNumber = ARGS[3]
  449. fightAtk_AttackerNumber = ARGS[4]
  450. if $fightAtk_TargetType = 'opp' and fightAtk_AttackerNumber = 0:
  451. $fightAtk_AttackerType = 'pcs'
  452. $fightAtk['DefenderName'] = $opp_name[fightAtk_TargetNumber]
  453. $fightAtk['AttackerName'] = 'You'
  454. !!Add Skill Exp
  455. gs 'exp_gain', $AttackSkill[fightAtk_Type], rand(1,3)
  456. elseif $fightAtk_TargetType = 'opp':
  457. $fightAtk['AttackerName'] = $pcs_name[fightAtk_AttackerNumber]
  458. $fightAtk['DefenderName'] = $opp_name[fightAtk_TargetNumber]
  459. $fightAtk_AttackerType = 'pcs'
  460. else
  461. $fightAtk_AttackerType = 'opp'
  462. $fightAtk['AttackerName'] = $opp_name[fightAtk_AttackerNumber]
  463. $fightAtk['DefenderName'] = $pcs_name[fightAtk_TargetNumber]
  464. end
  465. fightAtk['AttackerSkillValue'] = dyneval('result = <<$fightAtk_AttackerType>>_<<$AttackSkill[fightAtk_Type]>>[<<fightAtk_AttackerNumber>>]')
  466. fightAtk['TargetReactValue'] = dyneval('result = iif(<<$fightAtk_TargetType>>_stun[<<fightAtk_TargetNumber>>]>0,0,<<$fightAtk_TargetType>>_react[<<fightAtk_TargetNumber>>])')
  467. fightAtk['TargetAgilValue'] = dyneval('result = iif(<<$fightAtk_TargetType>>_stun[<<fightAtk_TargetNumber>>]>0,0,<<$fightAtk_TargetType>>_agil[<<fightAtk_TargetNumber>>])')
  468. fightAtk['TargetHealthBefore'] = dyneval('result = <<$fightAtk_TargetType>>_health[<<fightAtk_TargetNumber>>]')
  469. fightAtk['MinDamage'] = AttackMin[fightAtk_Type]
  470. fightAtk['MaxDamage'] = AttackMax[fightAtk_Type]
  471. if $fightAtk_TargetType = 'opp' and fightAtk_AttackerNumber = 0:
  472. 'You attempt to <<$fightAtk_Type>> <<$fightAtk["DefenderName"]>>!'
  473. else
  474. '<<$fightAtk["AttackerName"]>> attempts to <<$fightAtk_Type>> <<$fightAtk["DefenderName"]>>!'
  475. end
  476. *nl
  477. if fightAtk['AttackerSkillValue'] + rand(0,40) > fightAtk['TargetReactValue'] / 4 + 3 * fightAtk['TargetAgilValue'] / 4:
  478. !!Calculate Damage
  479. dynamic "fightAtk['Damage'] = <<$fightAtk_AttackerType>>_stren[<<fightAtk_AttackerNumber>>] * rand(<<fightAtk['MinDamage']>>,<<fightAtk['MaxDamage']>>) / 3"
  480. !!Apply Damage
  481. gs 'fight', 'applyDamage', $fightAtk_TargetType, fightAtk_TargetNumber, fightAtk['Damage']
  482. elseif rand(0,3) ! 0:
  483. !!Always chance to hit if rand = 0
  484. if $fightAtk_TargetType = 'pcs' and fightAtk_AttackerNumber = 0:
  485. 'You avoid the blow.'
  486. else
  487. '<<$fightAtk["DefenderName"]>> avoids the blow.'
  488. end
  489. else
  490. !!Apply Damage
  491. gs 'fight', 'applyDamage', $fightAtk_TargetType, fightAtk_TargetNumber, fightAtk['Damage']
  492. end
  493. !! Flavor text for size of the hit.
  494. fightAtk['TargetHealthLoss'] = fightAtk['TargetHealthBefore'] - dyneval('result = <<$fightAtk_TargetType>>_health[<<fightAtk_TargetNumber>>]')
  495. !! If blow does over half health in damage, causes stun
  496. if fightAtk['TargetHealthLoss']*2 > fightAtk['TargetHealthBefore']:
  497. gs 'fight', 'devastating'
  498. !! Very hard hit
  499. elseif fightAtk['TargetHealthLoss'] > 50:
  500. gs 'fight', 'hard'
  501. !! Does physical damage, but not a lot
  502. elseif fightAtk['TargetHealthLoss'] > 0:
  503. gs 'fight', 'light'
  504. !! No physical damage was done.
  505. else
  506. if $fightAtk_TargetType = 'pcs' and fightAtk_TargetNumber = 0:
  507. 'You avoid their attack.'
  508. else
  509. 'They avoid your attack.'
  510. end
  511. end
  512. dynamic "<<$fightAtk_AttackerType>>_timer[<<fightAtk_AttackerNumber>>] += AttackTime[<<fightAtk_Type>>]"
  513. cla
  514. act 'Next': gt 'fight', 'main'
  515. !! clear attack values to prevent figures bleeding through
  516. killvar 'fightAtk'
  517. killvar '$fightAtk'
  518. killvar 'fightAtk_Type'
  519. killvar '$fightAtk_Type'
  520. killvar 'fightAtk_TargetType'
  521. killvar '$fightAtk_TargetType'
  522. killvar 'fightAtk_TargetNumber'
  523. killvar 'fightAtk_AttackerNumber'
  524. end
  525. if $ARGS[0] = 'devastating':
  526. if fightAtk_Type = 0:
  527. if rand(0,2) = 0:
  528. $bodypart = 'head'
  529. else
  530. $bodypart = 'stomach'
  531. end
  532. if $fightAtk_TargetType = 'pcs' and fightAtk_TargetNumber = 0:
  533. 'They land a devastating kick to your <<$bodypart>>. You are stunned.'
  534. if $bodypart = 'head':
  535. gs 'pain', 7, 'head', 'kick'
  536. else
  537. gs 'pain', 7, 'tummy', 'kick'
  538. end
  539. else
  540. 'You deliver a devastating kick to their <<$bodypart>>. <<$fightAtk["DefenderName"]>> is stunned.'
  541. end
  542. elseif fightAtk_Type = 1:
  543. if rand(0,3) = 0:
  544. $bodypart = 'head'
  545. elseif rand(0,2) = 0:
  546. $bodypart = 'chest'
  547. elseif rand(0,1) = 0:
  548. $bodypart = 'ribs'
  549. else
  550. $bodypart = 'stomach'
  551. end
  552. if $fightAtk_TargetType = 'pcs' and fightAtk_TargetNumber = 0:
  553. 'They land a devastating punch to your <<$bodypart>>. You are stunned.'
  554. if $bodypart = 'head':
  555. gs 'pain', 7, 'head', 'hit'
  556. elseif $bodypart = 'chest':
  557. gs 'pain', 5, 'chest', 'hit'
  558. gs 'pain', 5, 'breast', 'hit'
  559. elseif $bodypart = 'ribs':
  560. gs 'pain', 7, 'ribs', 'hit'
  561. else
  562. gs 'pain', 7, 'tummy', 'hit'
  563. end
  564. else
  565. 'You deliver a devastating punch to their <<$bodypart>>. <<$fightAtk["DefenderName"]>> is stunned.'
  566. end
  567. elseif fightAtk_Type = 2:
  568. if rand(0,3) = 0:
  569. $bodypart = 'head'
  570. elseif rand(0,2) = 0:
  571. $bodypart = 'chest'
  572. elseif rand(0,1) = 0:
  573. $bodypart = 'ribs'
  574. else
  575. $bodypart = 'stomach'
  576. end
  577. if $fightAtk_TargetType = 'pcs' and fightAtk_TargetNumber = 0:
  578. 'They land a devastating jab to your <<$bodypart>>. You are stunned.'
  579. if $bodypart = 'head':
  580. gs 'pain', 7, 'head', 'hit'
  581. elseif $bodypart = 'chest':
  582. gs 'pain', 5, 'chest', 'hit'
  583. gs 'pain', 5, 'breast', 'hit'
  584. elseif $bodypart = 'ribs':
  585. gs 'pain', 7, 'ribs', 'hit'
  586. else
  587. gs 'pain', 7, 'tummy', 'hit'
  588. end
  589. else
  590. 'You deliver a devastating jab to their <<$bodypart>>. <<$fightAtk["DefenderName"]>> is stunned.'
  591. end
  592. end
  593. dynamic '<<$fightAtk_TargetType>>_stun[<<fightAtk_TargetNumber>>] += 1'
  594. dynamic '<<$fightAtk_TargetType>>_timer[<<fightAtk_TargetNumber>>] += AttackTime[<<fightAtk_Type>>]'
  595. end
  596. if $ARGS[0] = 'hard':
  597. if fightAtk_Type = 0:
  598. if rand(0,2) = 0:
  599. $bodypart = 'head'
  600. else
  601. $bodypart = 'stomach'
  602. end
  603. if $fightAtk_TargetType = 'pcs' and fightAtk_TargetNumber = 0:
  604. 'They land a hard kick to your <<$bodypart>>. You are stunned.'
  605. if $bodypart = 'head':
  606. gs 'pain', 4, 'head', 'kick'
  607. else
  608. gs 'pain', 4, 'tummy', 'kick'
  609. end
  610. else
  611. 'You deliver a hard kick to their <<$bodypart>>. <<$fightAtk["DefenderName"]>> is stunned.'
  612. end
  613. elseif fightAtk_Type = 1:
  614. if rand(0,5) = 0:
  615. $bodypart = 'head'
  616. elseif rand(0,5) = 0:
  617. $bodypart = 'cheeks'
  618. elseif rand(0,5) = 0:
  619. $bodypart = 'nose'
  620. elseif rand(0,5) = 0:
  621. $bodypart = 'mouth'
  622. elseif rand(0,2) = 0:
  623. $bodypart = 'chest'
  624. elseif rand(0,1) = 0:
  625. $bodypart = 'ribs'
  626. else
  627. $bodypart = 'stomach'
  628. end
  629. if $fightAtk_TargetType = 'pcs' and fightAtk_TargetNumber = 0:
  630. 'They land a hard punch to your <<$bodypart>>. You are stunned.'
  631. if $bodypart = 'head':
  632. gs 'pain', 4, 'head', 'hit'
  633. elseif $bodypart = 'cheeks':
  634. gs 'pain', 4, 'cheeks', 'hit'
  635. elseif $bodypart = 'nose':
  636. gs 'pain', 4, 'nose', 'hit'
  637. elseif $bodypart = 'mouth':
  638. gs 'pain', 4, 'mouth', 'hit'
  639. elseif $bodypart = 'chest':
  640. gs 'pain', 3, 'chest', 'hit'
  641. gs 'pain', 3, 'breast', 'hit'
  642. elseif $bodypart = 'ribs':
  643. gs 'pain', 4, 'ribs', 'hit'
  644. else
  645. gs 'pain', 4, 'tummy', 'hit'
  646. end
  647. else
  648. 'You deliver a hard punch to their <<$bodypart>>. <<$fightAtk["DefenderName"]>> is stunned.'
  649. end
  650. elseif fightAtk_Type = 2:
  651. if rand(0,5) = 0:
  652. $bodypart = 'head'
  653. elseif rand(0,5) = 0:
  654. $bodypart = 'cheeks'
  655. elseif rand(0,5) = 0:
  656. $bodypart = 'nose'
  657. elseif rand(0,5) = 0:
  658. $bodypart = 'mouth'
  659. elseif rand(0,2) = 0:
  660. $bodypart = 'chest'
  661. elseif rand(0,1) = 0:
  662. $bodypart = 'ribs'
  663. else
  664. $bodypart = 'stomach'
  665. end
  666. if $fightAtk_TargetType = 'pcs' and fightAtk_TargetNumber = 0:
  667. 'They land a hard jab to your <<$bodypart>>.'
  668. if $bodypart = 'head':
  669. gs 'pain', 4, 'head', 'hit'
  670. elseif $bodypart = 'cheeks':
  671. gs 'pain', 4, 'cheeks', 'hit'
  672. elseif $bodypart = 'nose':
  673. gs 'pain', 4, 'nose', 'hit'
  674. elseif $bodypart = 'mouth':
  675. gs 'pain', 4, 'mouth', 'hit'
  676. elseif $bodypart = 'chest':
  677. gs 'pain', 3, 'chest', 'hit'
  678. gs 'pain', 3, 'breast', 'hit'
  679. elseif $bodypart = 'ribs':
  680. gs 'pain', 4, 'ribs', 'hit'
  681. else
  682. gs 'pain', 4, 'tummy', 'hit'
  683. end
  684. else
  685. 'You deliver a hard jab to their <<$bodypart>>.'
  686. end
  687. end
  688. end
  689. if $ARGS[0] = 'light':
  690. if fightAtk_Type = 0:
  691. if rand(0,2) = 0:
  692. $bodypart = 'leg'
  693. else
  694. $bodypart = 'arm'
  695. end
  696. if $fightAtk_TargetType = 'pcs' and fightAtk_TargetNumber = 0:
  697. 'They only manage a glancing kick to your <<$bodypart>>.'
  698. if $bodypart = 'leg':
  699. if rand(0,1) = 0:
  700. gs 'pain', 1, 'legL', 'kick'
  701. else
  702. gs 'pain', 1, 'legR', 'kick'
  703. end
  704. else
  705. if rand(0,1) = 0:
  706. gs 'pain', 1, 'armL', 'kick'
  707. else
  708. gs 'pain', 1, 'armR', 'kick'
  709. end
  710. end
  711. else
  712. 'Your kick just glances their <<$bodypart>>.'
  713. end
  714. elseif fightAtk_Type = 1:
  715. if rand(0,5) = 0:
  716. $bodypart = 'leg'
  717. elseif rand(0,5) = 0:
  718. $bodypart = 'arm'
  719. elseif rand(0,5) = 0:
  720. $bodypart = 'nose'
  721. elseif rand(0,5) = 0:
  722. $bodypart = 'mouth'
  723. elseif rand(0,2) = 0:
  724. $bodypart = 'chest'
  725. else
  726. $bodypart = 'stomach'
  727. end
  728. if $fightAtk_TargetType = 'pcs' and fightAtk_TargetNumber = 0:
  729. 'They punch you but it just glances your <<$bodypart>>.'
  730. if $bodypart = 'leg':
  731. if rand(0,1) = 0:
  732. gs 'pain', 1, 'legL', 'kick'
  733. else
  734. gs 'pain', 1, 'legR', 'kick'
  735. end
  736. elseif $bodypart = 'arm':
  737. if rand(0,1) = 0:
  738. gs 'pain', 1, 'armL', 'kick'
  739. else
  740. gs 'pain', 1, 'armR', 'kick'
  741. end
  742. elseif $bodypart = 'nose':
  743. gs 'pain', 1, 'nose', 'hit'
  744. elseif $bodypart = 'mouth':
  745. gs 'pain', 1, 'mouth', 'hit'
  746. elseif $bodypart = 'chest':
  747. gs 'pain', 1, 'chest', 'hit'
  748. gs 'pain', 1, 'breast', 'hit'
  749. else
  750. gs 'pain', 1, 'tummy', 'hit'
  751. end
  752. else
  753. 'You hard punch just glaces their <<$bodypart>>. <<$fightAtk["DefenderName"]>> is stunned.'
  754. end
  755. elseif fightAtk_Type = 2:
  756. if rand(0,5) = 0:
  757. $bodypart = 'head'
  758. elseif rand(0,5) = 0:
  759. $bodypart = 'cheeks'
  760. elseif rand(0,5) = 0:
  761. $bodypart = 'nose'
  762. elseif rand(0,5) = 0:
  763. $bodypart = 'mouth'
  764. elseif rand(0,2) = 0:
  765. $bodypart = 'chest'
  766. elseif rand(0,1) = 0:
  767. $bodypart = 'ribs'
  768. else
  769. $bodypart = 'stomach'
  770. end
  771. if $fightAtk_TargetType = 'pcs' and fightAtk_TargetNumber = 0:
  772. 'They jab you but it just glances your <<$bodypart>>.'
  773. if $bodypart = 'head':
  774. gs 'pain', 1, 'head', 'hit'
  775. elseif $bodypart = 'cheeks':
  776. gs 'pain', 1, 'cheeks', 'hit'
  777. elseif $bodypart = 'nose':
  778. gs 'pain', 1, 'nose', 'hit'
  779. elseif $bodypart = 'mouth':
  780. gs 'pain', 1, 'mouth', 'hit'
  781. elseif $bodypart = 'chest':
  782. gs 'pain', 1, 'chest', 'hit'
  783. gs 'pain', 1, 'breast', 'hit'
  784. elseif $bodypart = 'ribs':
  785. gs 'pain', 1, 'ribs', 'hit'
  786. else
  787. gs 'pain', 1, 'tummy', 'hit'
  788. end
  789. else
  790. 'Your jab just glaces their <<$bodypart>>.'
  791. end
  792. end
  793. end
  794. !! Make a list of targets that still have health
  795. ! $ARGS[1] = Target Type ('pcs','opp')
  796. if $ARGS[0] = 'AvailableTargets':
  797. killvar 'fightAvailTarg'
  798. i=0
  799. :AvailTargetLoop
  800. if i < arrsize($ARGS[1]+'_health'):
  801. if dyneval('result=<<$ARGS[1]>>_health[<<i>>]') > 0:
  802. fightAvailTarg[] = i
  803. end
  804. i +=1
  805. jump 'AvailTargetLoop'
  806. end
  807. result = arrsize('fightAvailTarg')
  808. killvar 'i'
  809. exit
  810. end
  811. !! Pick random target from list of targets. Returns the Target, or -1 if no target.
  812. ! $ARGS[1] = Target Type ('pcs','opp')
  813. if $ARGS[0] = 'RandomTarget':
  814. if func('fight', 'AvailableTargets', $ARGS[1]) > 0:
  815. result = fightAvailTarg[rand(0,arrsize('fightAvailTarg'))-1]
  816. else
  817. result = -1
  818. end
  819. exit
  820. end
  821. !! Find Action for an NPC fighter to take
  822. ! $ARGS[1] = Attacker Type ('opp','pcs')
  823. ! ARGS[2] = Attacker party member number
  824. if $ARGS[0] = 'fightAlgorithm':
  825. $AttackerType = $ARGS[1]
  826. AttackerNumber = ARGS[2]
  827. if $AttackerType = 'pcs':
  828. $TargetType = 'opp'
  829. else
  830. $TargetType = 'pcs'
  831. end
  832. TargetNumber = func('fight', 'RandomTarget', $TargetType)
  833. !! Some Target still has some hitpoints
  834. if TargetNumber>= 0:
  835. !!Fight Algorithm
  836. ActionMade = 0
  837. ! First try to cast spells
  838. if dyneval('result=<<$AttackerType>>_magik[<<AttackerNumber>>]') > 0:
  839. gs 'fight', 'buildCasterSpellList', $dyneval('$result=$<<$AttackerType>>_spells[<<AttackerNumber>>]')
  840. !Heal self if hurt badly
  841. if dyneval('result=<<$AttackerType>>_health[<<AttackerNumber>>]') < 50:
  842. ActionMade = func('fight','spellListCheck', '$comHealSpells',$AttackerType,AttackerNumber,$AttackerType,AttackerNumber)
  843. end
  844. !Clone if none left
  845. if dyneval('result=<<$AttackerType>>_clone[<<AttackerNumber>>]') = 0 and ActionMade = 0:
  846. ActionMade = func('fight','spellCheck', 'multiclone',$AttackerType,AttackerNumber,$AttackerType,AttackerNumber)
  847. if ActionMade = 0:
  848. ActionMade = func('fight','spellCheck', 'clone',$AttackerType,AttackerNumber,$AttackerType,AttackerNumber)
  849. end
  850. end
  851. !Shield if low shield
  852. if dyneval('result=<<$AttackerType>>_shield[<<AttackerNumber>>]') = 0 and ActionMade = 0:
  853. ActionMade = func('fight','spellListCheck', '$comShldSpells',$AttackerType,AttackerNumber,$AttackerType,AttackerNumber)
  854. end
  855. !Fog if no Fog , Any fog on the field makes casting fog impossible
  856. !if opp_fog[ARGS[2]] = 0 and ActionMade = 0:
  857. ! ActionMade = func('fight','spellCheck', 'fog','opp',ARGS[2],'opp',ARGS[2])
  858. !end
  859. !Buff if needed
  860. ! ToDo - How to determine if buff has already been applied
  861. !Attack Spell if Possible
  862. if ActionMade = 0:
  863. ActionMade = func('fight','spellListCheck', '$comAtkSpells',$TargetType,TargetNumber,$AttackerType,AttackerNumber)
  864. end
  865. !make sure we can continue the fight.
  866. !if ActionMode = 1:
  867. act 'Next': gt 'fight', 'main'
  868. !end
  869. end
  870. !Physical attack if nothing else can be done.
  871. if ActionMade = 0:
  872. if rand(0,dyneval('result=<<$AttackerType>>_kick[<<AttackerNumber>>]')) > 40:
  873. gs 'fight', 'Attack', 'Kick', $TargetType, TargetNumber, AttackerNumber
  874. elseif rand(0,dyneval('result=<<$AttackerType>>_punch[<<AttackerNumber>>]')) > 40:
  875. gs 'fight', 'Attack', 'Hard Punch', $TargetType, TargetNumber, AttackerNumber
  876. else
  877. gs 'fight', 'Attack', 'Jab', $TargetType, TargetNumber, AttackerNumber
  878. end
  879. !Spell was cast, so move timer.
  880. else
  881. dynamic "<<$AttackerType>>_timer[<<AttackerNumber>>] += 50"
  882. end
  883. !!This should never happen
  884. else
  885. gt 'fight', 'main'
  886. end
  887. killvar 'ActionMade'
  888. killvar 'TargetNumber'
  889. killvar '$TargetType'
  890. killvar '$AttackerType'
  891. killvar 'AttackerNumber'
  892. end
  893. if $ARGS[0] = 'opponent':
  894. gs 'fight', 'statDisplay'
  895. gs 'fight','fightAlgorithm','opp',ARGS[1]
  896. end
  897. if $ARGS[0] = 'player':
  898. gs 'fight', 'statDisplay'
  899. !! If this is the Player character
  900. if ARGS[2] = 0:
  901. if $start_type[1] ! 'nomagic':
  902. act 'Cast a Spell': gs 'fight', 'spellcast'
  903. end
  904. if func('fight', 'AvailableTargets', 'opp') > 0:
  905. i=0
  906. :loop000000
  907. if i < arrsize('fightAvailTarg'):
  908. $op_name_000000 = $opp_name[fightAvailTarg[i]]
  909. dynamic "
  910. act 'Kick <<$op_name_000000>>':
  911. gs 'fight', 'Attack', 'Kick', 'opp', <<fightAvailTarg[i]>>, 0
  912. end
  913. act 'Punch <<$op_name_000000>> hard':
  914. gs 'fight', 'Attack', 'Hard Punch', 'opp', <<fightAvailTarg[i]>>, 0
  915. end
  916. act 'Jab <<$op_name_000000>>':
  917. gs 'fight', 'Attack', 'Jab', 'opp', <<fightAvailTarg[i]>>, 0
  918. end
  919. "
  920. killvar '$op_name_000000'
  921. i +=1
  922. jump 'loop000000'
  923. end
  924. end
  925. act 'Surrender': gt 'ender', 'surrender'
  926. !! If this is a team member of the player
  927. else
  928. gs 'fight','fightAlgorithm','pcs',ARGS[2]
  929. end
  930. end
  931. !! Builds an array spell list from a comma delimited spell name list
  932. ! $ARGS[1] = comma delimited list of spell names
  933. if $ARGS[0] = 'buildCasterSpellList':
  934. killvar '$casterSpellList'
  935. $tmpStr = $trim($ARGS[1])
  936. :loop000001
  937. i=INSTR($tmpStr,',')
  938. if i > 0:
  939. $casterSpellList[] = $trim($mid($tmpStr,1,i-1))
  940. $tmpStr = $trim($mid($tmpStr,i+1))
  941. jump 'loop000001'
  942. else
  943. $casterSpellList[] = $trim($tmpStr)
  944. end
  945. killvar 'i'
  946. killvar '$tmpStr'
  947. exit
  948. end
  949. !! Check if spell will be cast
  950. ! $ARGS[1] = spell name
  951. ! $ARGS[2] = Target Type ('opp','pcs')
  952. ! ARGS[3] = Target party member number
  953. ! $ARGS[4] = Caster Type ('opp','pcs')
  954. ! ARGS[5] = Caster party member number
  955. if $ARGS[0] = 'spellCheck':
  956. $spellCheckVar['SpellName'] = $ARGS[1]
  957. $spellCheckVar['TargetType'] = $ARGS[2]
  958. spellCheckVar['TargetNumber'] = ARGS[3]
  959. $spellCheckVar['CasterType'] = $ARGS[4]
  960. spellCheckVar['CasterNumber'] = ARGS[5]
  961. spellCheckVar['CasterMana'] = dyneval("result = <<$spellCheckVar['CasterType']>>_mana[<<spellCheckVar['CasterNumber']>>]")
  962. if ARRPOS('$casterSpellList',$spellCheckVar['SpellName'])>=0 and spellCheckVar['CasterMana'] >= spellMana[$spellCheckVar['SpellName']]:
  963. if $spellTarget[$spellCheckVar['SpellName']] = 'self':
  964. gs 'castSpellNPC', $spellCheckVar['SpellName'], $spellCheckVar['CasterType'], spellCheckVar['CasterNumber'],$spellCheckVar['CasterType'], spellCheckVar['CasterNumber']
  965. else
  966. gs 'castSpellNPC', $spellCheckVar['SpellName'], $spellCheckVar['TargetType'], spellCheckVar['TargetNumber'],$spellCheckVar['CasterType'], spellCheckVar['CasterNumber']
  967. end
  968. result = 1
  969. else
  970. result = 0
  971. end
  972. killvar 'spellCheckVar'
  973. killvar '$spellCheckVar'
  974. exit
  975. end
  976. !! Check list of spells if they will be cast
  977. ! $ARGS[1] = spell List array name
  978. ! $ARGS[2] = Target Type ('opp','pcs')
  979. ! ARGS[3] = Target party member number
  980. ! $ARGS[4] = Caster Type ('opp','pcs')
  981. ! ARGS[5] = Caster party member number
  982. if $ARGS[0] = 'spellListCheck':
  983. i=0
  984. ActionMade1 = 0
  985. :loop000002
  986. if i < arrsize($ARGS[1]) and ActionMade1=0:
  987. ActionMade1 = func('fight','spellCheck','<<$ARGS[1]>>[<<i>>]',$ARGS[2],ARGS[3],$ARGS[4],ARGS[5])
  988. i+=1
  989. jump 'loop000002'
  990. end
  991. result = ActionMade1
  992. killvar 'ActionMade1'
  993. exit
  994. end
  995. if $ARGS[0] = 'spellcast':
  996. *clr
  997. cla
  998. act 'Next': gt 'fight', 'main'
  999. func('spellBook', 'targetable', '$combatSpells', 'gt ''fight'', ''main''', 'pcs_timer[0] += 50')
  1000. end
  1001. !!--------------------------------------------------old shit--------------------------------------------------
  1002. if $ARGS[0] = 'sta':
  1003. menu_off = 1
  1004. cla
  1005. damTip = 0
  1006. damTipM = 0
  1007. damTipV = 0
  1008. damTipMV = 0
  1009. magweapbonus = 0
  1010. magweapbonusV = 0
  1011. bonusSh = 0
  1012. bonusShV = 0
  1013. eleSh = 0
  1014. eleShV = 0
  1015. poisonAV = 0
  1016. hidanAtk = 0
  1017. '<b>= = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =</b>'
  1018. '<b><<$boydesc>></b> life <b><font color = red><<healthV>></font></b>, mana <b><font color = blue><<manaV>></font></b>, willpower <b><font color = green><<willpowerV>></font></b>'
  1019. if defenceV > 0:'<b><font color = red>Protection <<defenceV>> units</font></b>'
  1020. if defenceMV > 0:'<b><font color = red>Mana protection <<defenceMV>> units</font></b>'
  1021. if defenceWV > 0:'<b><font color = red>Will protection <<defenceWV>> units</font></b>'
  1022. 'Your life <b><font color = red><<pcs_health>></font></b>, mana <b><font color = blue><<pcs_mana>></font></b>, willpower <b><font color = green><<pcs_willpwr>></font></b>'
  1023. if defence > 0:'<b><font color = green>Protection <<defence>> units</font></b>'
  1024. if defenceM > 0:'<b><font color = green>Mana impact protection <<defenceM>> units</font></b>'
  1025. if defenceW > 0:'<b><font color = green>Will impact protection <<defenceW>> units</font></b>'
  1026. if defenceAct > 0:'<b><font color = green><<defenceAct>> Regeneration</font></b>'
  1027. if defenceActM > 0:'<b><font color = green><<defenceActM>> Mana recovery protection</font></b>'
  1028. '<b>= = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =</b>'
  1029. if cheatVars['auto_combat'] = 0: act 'Continue': gt'fight', 'start'
  1030. if cheatVars['auto_combat'] = 1: gt 'fight', 'start'
  1031. end
  1032. --- fight ---------------------------------