Open conde2 opened 8 years ago
@WibbenZ @Mkalo Could you guys check this issue please ?
Shouldn't it be manaLoss?
No. manaLoss
is the absolute value (on the else branch, manaChange
is non-positive so manaLoss
is non-negative). The value sent to onManaChange
can be positive or negative, from the code you shown.
I do have this: https://gist.github.com/Mkalo/2b1c4bcd772e161a1200cfeb820d3aba
But I never created a PR cause I didn't have time before, I could do it if this is okay.
@ranisalt
Imo this issue is kinda related to #1211, seeing as the functions need an overhaul.
I don't know if onManaChange should be executed for spell casting anyway, (It doesnt use any combat function just Creature::changeMana).
We could change that and make it fire a combat (Game::combatChangeMana) and use ORIGIN_SPELL.
As mark wrote this function should be used as much as we can. Look at #1226
How do I know if the player is gaining mana or losing mana ?
Because manaChange is always positive.