Attack Calculation beyond max HP

The place to post your WML questions and answers.

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.
Post Reply
Mabuse
Posts: 2480
Joined: November 6th, 2007, 1:38 pm

Attack Calculation beyond max HP

Post by Mabuse »

hello,

it seems weird that, for some reason, the pre-attack calculation does not simply use the actual HP for the calculation (well it does) but seems to cap it off at max HP, if for some reason if the HP is higher than that.

so all calculations with HP higher than max HP are wrong and there is basically no reason for that. at least none i can think of.
EDIT:
(after all, max HP can be of importance to keep track of upper limit for DRAIN or similar specials, so i can see why it was incorporated into the calculation - but maybe the calculation can be expanded to factor in HP higher than MAX.)


what would be the best workaround for that, so that people can use pre-game calculation in these cases? do we have an event that triggers if calculator is opened so we can manipulate HP just in right moment?
The best bet is your own, good Taste.
User avatar
Ravana
Forum Moderator
Posts: 3484
Joined: January 29th, 2012, 12:49 am
Location: Estonia
Contact:

Re: Attack Calculation beyond max HP

Post by Ravana »

To be fair, the fact hp over max works as well as it currently does is accident and might disappear at any time. If that is important feature for your addon I would create wml test for it, like I did for https://github.com/wesnoth/wesnoth/blob ... grades.cfg
Mabuse
Posts: 2480
Joined: November 6th, 2007, 1:38 pm

Re: Attack Calculation beyond max HP

Post by Mabuse »

Ravana wrote: July 8th, 2026, 3:09 pm If that is important feature for your addon
well yes, i can say that the damage calculation shows correct information is an important feature for my addon.



---->

Another Attack/combat related Issue.

- i have a 1 time use unit
- which should attack 1 time (100% CTH)
- then gets KILLED (animate=yes) on "attacker hit"-event
- Damage is applied properly
- but status effects like poison + slow, wont apply

??


setting the event to attack ends, applies the status effects,
is not a real option since then the defender would be able to strike back at that 1x time use unit, which isnt wanted (as it would make no sense)


why is damage applied at attacker hit event but status effect from weapon special is not?



but yeah, i guess i have to apply all status effects manually then ......
The best bet is your own, good Taste.
User avatar
Ravana
Forum Moderator
Posts: 3484
Joined: January 29th, 2012, 12:49 am
Location: Estonia
Contact:

Re: Attack Calculation beyond max HP

Post by Ravana »

I mean the feature that unit is not capped to max hp regularly.
Post Reply