get inflicted damage of attack before strike in WML
Moderator: Forum Moderators
Forum rules
- Please use [code] BBCode tags in your posts for embedding WML snippets.
- To keep your code readable so that others can easily help you, make sure to indent it following our conventions.
get inflicted damage of attack before strike in WML
is there any way to get (for example store in variable) amount of damage that will be actually inflicted when/if next strike connects?
apart from calculating it by starting with weapon's base damage and "manually" applying modificators from resistance, weapon specials and other sources one by one
same value as in damage_inflicted variable automatically set for attacker_hits and defender_hits events but before this damage is actually inflicted, for example in attack event.
apart from calculating it by starting with weapon's base damage and "manually" applying modificators from resistance, weapon specials and other sources one by one
same value as in damage_inflicted variable automatically set for attacker_hits and defender_hits events but before this damage is actually inflicted, for example in attack event.
author of: Altered Era/Ruleset (AKA "Altera"), latest version is on add-ons servers for BfW 1.16 and 1.14, latest version also still supports BfW 1.12 and 1.10, 1.10 server is stuck with older buggy version)
Re: get inflicted damage of attack before strike in WML
No, doesn't seem possible.
Re: get inflicted damage of attack before strike in WML
There is [harm_unit], which would allow you to factor in the unit type damage resistances and time-of-day alignment bonus. But that's not going to cover every possibility.lea wrote:is there any way to get (for example store in variable) amount of damage that will be actually inflicted when/if next strike connects?
http://www.wesnoth.org/wiki/User:Sapient... "Looks like your skills saved us again. Uh, well at least, they saved Soarin's apple pie."
Re: get inflicted damage of attack before strike in WML
that's how I tried to do it but it is impractical when there are too many possibilities to cover.Sapient wrote:There is [harm_unit], which would allow you to factor in the unit type damage resistances and time-of-day alignment bonus. But that's not going to cover every possibility.
my goal is/was to make a "nonlethal" attack special (attack that cannot kill, somewhat like poison but with instant one-time effect). I tried to reset unit's HP to 1 whenever it fell below 1 but it prevents remaining strikes of current combat encounter from happening.
my current solution is to add a big number (much bigger than damage from single combat encounter can ever be, like 1000) to current hitpoints in attack event and subtract same number in attack end event (or set HP to 1 if remaining hitpoints are less than the number I used). I should "automatically" account for every possibility except effects that vary depending on HP.
author of: Altered Era/Ruleset (AKA "Altera"), latest version is on add-ons servers for BfW 1.16 and 1.14, latest version also still supports BfW 1.12 and 1.10, 1.10 server is stuck with older buggy version)