fight.tw 39 KB

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