<p></p>
<p>I think when costs are deducted is wrong in some ways and problematic in others.</p>
<p>I think it's intuitive that costs be deducted at the start of the attack, maybe even at the start of the attack delay -- an attack bit to deduct costs before instead of after the delay seems reasonable. Note we have a "Recheck costs after delay" attack bit; that one would be shadowed by a new bit.</p>
<p>If an attack hits multiple targets, or a target multiple times, then costs are deducted after the first attack, which is surely a bug because HP and MP might be used as base ATK stat by the attack.</p>
<p>Also, <code>battle_attack_do_inflict</code> does<br>
<code>IF liveherocount(bslot()) = 0 THEN bat.atk.id = -1</code><br>
at the end (I don't know whether there's a dead attacker check elsewhere), so it looks like if an HP cost kills an attacking hero then the attack gets cancelled after hitting the first target, but not so for enemies. The attack should instead stop after all attacks happen.</p>
<p>So it looks like HP costs should happen after an attack, but that could be made a special case, or if they happen before, the attacker death-check should happen after.</p>
<p>Attack tags are evaluated again for each target, which is correct, but it happens before costs on the first target, and then after costs are subtracted for all remaining targets, which is inconsistent. Again, it would be better if costs happen either before all attacks or after all attacks.</p>
<p>It would be a backcompat break to deduct costs before instead of after, but we were going to add a backcompat bit to enable the uncountable other attack cost bugfixes for <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="581265997" data-permission-text="Title is private" data-url="https://github.com/ohrrpgce/ohrrpgce/issues/1098" data-hovercard-type="issue" data-hovercard-url="/ohrrpgce/ohrrpgce/issues/1098/hovercard" href="https://github.com/ohrrpgce/ohrrpgce/issues/1098">#1098</a>, so we can reuse that bit. Or maybe make it preference bit instead.</p>

<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">—<br />You are receiving this because you are subscribed to this thread.<br />Reply to this email directly, <a href="https://github.com/ohrrpgce/ohrrpgce/issues/1122">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/AMWGWZUR65J3JQUOPVIV2HTROOGFFANCNFSM4MRACXZQ">unsubscribe</a>.<img src="https://github.com/notifications/beacon/AMWGWZTDUDQRE5FSP3IAT6DROOGFFA5CNFSM4MRACXZ2YY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4JBMPAOQ.gif" height="1" width="1" alt="" /></p>
<script type="application/ld+json">[
{
"@context": "http://schema.org",
"@type": "EmailMessage",
"potentialAction": {
"@type": "ViewAction",
"target": "https://github.com/ohrrpgce/ohrrpgce/issues/1122",
"url": "https://github.com/ohrrpgce/ohrrpgce/issues/1122",
"name": "View Issue"
},
"description": "View this Issue on GitHub",
"publisher": {
"@type": "Organization",
"name": "GitHub",
"url": "https://github.com"
}
}
]</script>