|
@@ -53,18 +53,19 @@ if $ARGS[0] = 'initFight':
|
|
|
killvar 'opp_init'
|
|
|
killvar 'opp_stun'
|
|
|
|
|
|
- !! Clear any allies from previous battle{
|
|
|
- i = arrsize('pcs_def')
|
|
|
+ !! Clear any allies from previous battle
|
|
|
+ i = arrsize('pcs_health')
|
|
|
:ClearAllyLoop
|
|
|
- if i > 0:
|
|
|
+ if i > 1:
|
|
|
gs 'fight', 'clearPCSArray', i-1
|
|
|
i -= 1
|
|
|
jump 'ClearAllyLoop'
|
|
|
end
|
|
|
- killvar 'i'}
|
|
|
+ killvar 'i'
|
|
|
|
|
|
!! Initialize $pcs_name for Sveta
|
|
|
$pcs_name[0] = 'You'
|
|
|
+ $pcs_image[0] = FUNC('$face_image')
|
|
|
end
|
|
|
|
|
|
if $ARGS[0] = 'clearPCSArray':
|
|
@@ -105,7 +106,7 @@ if $ARGS[0] = 'randomOpp':
|
|
|
ARGS[1] = Optional, raise difficulty of the attacker, 0 - 50
|
|
|
}
|
|
|
OppDiffBonus = ARGS[1]
|
|
|
- i = arrsize('opp_def')
|
|
|
+ i = arrsize('opp_health')
|
|
|
$opp_name[i] = 'Opponent 1'
|
|
|
$opp_image[i] = 'images/locations/shared/street/mugger.jpg'
|
|
|
opp_def[i] = rand(1,50) + OppDiffBonus
|
|
@@ -125,6 +126,31 @@ if $ARGS[0] = 'randomOpp':
|
|
|
killvar 'i'
|
|
|
end
|
|
|
|
|
|
+if $ARGS[0] = 'applyDamage':
|
|
|
+!{ Apply Damage to a participant taking into account clones and shields
|
|
|
+ $ARGS[1] = Target Type ('opp','pcs')
|
|
|
+ ARGS[2] = Target number
|
|
|
+ ARGS[3] = damage to be applied
|
|
|
+}
|
|
|
+ $fightAppDam['TargetType'] = $ARGS[1]
|
|
|
+ fightAppDam['TargetNumber'] = ARGS[2]
|
|
|
+ fightAppDam['Damage'] = ARGS[3]
|
|
|
+ dynamic "
|
|
|
+ !!If the target has clones, destroy one
|
|
|
+ if <<$fightAppDam['TargetType']>>_clone[<<fightAppDam['TargetNumber']>>] > 0:
|
|
|
+ <<$fightAppDam['TargetType']>>_clone[<<fightAppDam['TargetNumber']>>] -= 1
|
|
|
+ 'Clone Destroyed!'
|
|
|
+ !!if the target has enough shields to mitigate, remove some shields
|
|
|
+ elseif <<$fightAppDam['TargetType']>>_shield[<<fightAppDam['TargetNumber']>>] >= fightAppDam['Damage']:
|
|
|
+ <<$fightAppDam['TargetType']>>_shield[<<fightAppDam['TargetNumber']>>] -= fightAppDam['Damage']
|
|
|
+ !!otherwise remove shields to 0 and the remainder comes from health
|
|
|
+ else
|
|
|
+ <<$fightAppDam['TargetType']>>_health -= (fightAppDam['Damage'] - <<$fightAppDam['TargetType']>>_shield[<<fightAppDam['TargetNumber']>>])
|
|
|
+ <<$fightAppDam['TargetType']>>_shield[<<fightAppDam['TargetNumber']>>] = 0
|
|
|
+ end"
|
|
|
+ killvar '$fightAppDam'
|
|
|
+ killvar 'fightAppDam'
|
|
|
+end
|
|
|
|
|
|
if $ARGS[0] = 'start':
|
|
|
menu_off = 1
|
|
@@ -132,16 +158,47 @@ if $ARGS[0] = 'start':
|
|
|
gs 'themes', 'indoors'
|
|
|
cla
|
|
|
|
|
|
- '<center><b><font color="maroon">Fight!</font></b></center>'
|
|
|
- *nl
|
|
|
- '<left><img <<$set_imgh>> src="<<FUNC(''$face_image'')>>"></left><right><img <<$set_imgh>> src="<<$opp_image[0]>>"></right>'
|
|
|
- *nl
|
|
|
- '<left><<$pcs_firstname>></left><center>vs.</center><right><<$opp_name[0]>></right>'
|
|
|
+ if arrsize('pcs_health') > arrsize('opp_health'):
|
|
|
+ tableSize = arrsize('pcs_health')
|
|
|
+ else
|
|
|
+ tableSize = arrsize('opp_health')
|
|
|
+ end
|
|
|
+
|
|
|
+ $HTMLText = '<table>
|
|
|
+ <tr>
|
|
|
+ <th align="right">Allies</td>
|
|
|
+ <th align="center" valign="center" rowspan=<<tableSize*2+1>> >vs.</td>
|
|
|
+ <th align="left">Opponents</td>
|
|
|
+ </tr>'
|
|
|
+ i = 0
|
|
|
+ :FightPoster
|
|
|
+ if i < tableSize:
|
|
|
+ $HTMLText += '
|
|
|
+ <tr>
|
|
|
+ <td align="right"><img HEIGHT=400 src="<<$pcs_image[i]>>"></td>
|
|
|
+
|
|
|
+ <td align="left"><img HEIGHT=400 src="<<$opp_image[i]>>"></td>
|
|
|
+ </tr>
|
|
|
+ <tr>
|
|
|
+ <td align="right"><<$pcs_name[i]>></td>
|
|
|
+
|
|
|
+ <td align="left"><<$opp_name[i]>></td>
|
|
|
+ </tr>'
|
|
|
+ i += 1
|
|
|
+ jump 'FightPoster'
|
|
|
+ end
|
|
|
+ $HTMLText += '</table>'
|
|
|
+
|
|
|
+ *pl func('cleanHTML',$HTMLText)
|
|
|
|
|
|
pcs_timer = 100 - pcs_react
|
|
|
opp_timer = 100 - opp_react[0]
|
|
|
|
|
|
act 'Engage': gt 'fight', 'main'
|
|
|
+
|
|
|
+ killvar '$HTMLText'
|
|
|
+ killvar 'tableSize'
|
|
|
+ killvar 'i'
|
|
|
end
|
|
|
|
|
|
if $ARGS[0] = 'main':
|
|
@@ -217,7 +274,8 @@ end
|
|
|
if $ARGS[0] = 'result_check':
|
|
|
!!cheat to auto-win fights check
|
|
|
if fight_cheat = 1:
|
|
|
- xgt 'ender', 'win'
|
|
|
+ !xgt 'ender', 'win'
|
|
|
+ gt $loc, $metka
|
|
|
exit
|
|
|
end
|
|
|
|
|
@@ -226,17 +284,20 @@ if $ARGS[0] = 'result_check':
|
|
|
if pcs_health <= 0:
|
|
|
'<b><font color = red> You lost!</font></b>'
|
|
|
|
|
|
- xgt'ender','loss'
|
|
|
+ !xgt'ender','loss'
|
|
|
+ gt $loc, $metka
|
|
|
exit
|
|
|
elseif opp_health[0] <= 0:
|
|
|
'<b><font color = green><<$boydesc>> You won!</font></b>'
|
|
|
|
|
|
- xgt'ender','win'
|
|
|
+ !xgt'ender','win'
|
|
|
+ gt $loc, $metka
|
|
|
exit
|
|
|
elseif pcs_willpwr <= 0:
|
|
|
'<b><font color = red> You cannot summon the will to fight!</font></b>'
|
|
|
|
|
|
- xgt'ender','loss'
|
|
|
+ !xgt'ender','loss'
|
|
|
+ gt $loc, $metka
|
|
|
exit
|
|
|
end
|
|
|
!gt 'fight', 'main'
|
|
@@ -297,7 +358,7 @@ $fight['Attack'] = {
|
|
|
!!Calculate Damage
|
|
|
dynamic "fightAtk['Damage'] = <<$fightAtk['AttackerType']>>_stren[<<fightAtk['AttackerNumber']>>] * rand(<<fightAtk['MinDamage']>>,<<fightAtk['MaxDamage']>>) / 15"
|
|
|
!!Apply Damage
|
|
|
- dynamic "<<$fightAtk['TargetType']>>_health[<<fightAtk['TargetNumber']>>] -= fightAtk['Damage']"
|
|
|
+ gs 'fight', 'applyDamage', $fightAtk['TargetType'], fightAtk['TargetNumber'], fightAtk['Damage']
|
|
|
if fightAtk['Damage'] > 10:
|
|
|
'The hit is hard and <<$fightAtk["TargetPronoun"]>> reel in pain.'
|
|
|
else
|