Closed Jazzepi closed 6 years ago
Buffer applies in onLoseHP
, which is unfortunately way too late. I could make BandageBot explicitly check for the buffer power.
How would you check for buffer? If the buffer is used up before coming to the call how would you know they had one?
BufferPower.onLoseHp always happens after BandageBotPower.onAttacked. So there I can check if the player has BufferPower, and in that case don't trigger.
Dumb question, how do you know the ordering?
From looking at AbstractPlayer.damage. There p.onAttacked is called before p.onLoseHp.
Oh sorry I got confused. Somehow I thought you were referencing the same callback method (onLoseHp) for both.
If you have buffer up, and get hit, buffer reduces the damage to 0, but onAttacked still triggers and the damage must be > 0 at that point. Maybe the buffer trigger is lower in the call order.
There is a "atDamageFinalRecieve" which contains both damage, and damage type. Perhaps the buffer will have applied by then?