Greetings everyone. I am trying to create basic "Life-Steal" skills with BuffsStatesCore and SkillCore
However, The notetag I gave my skill to do the actual lifesteal does not seem to play nice with the notetag of a damage reduction state.
State Notetag:
<Custom React Effect>
if (value > 0 && this.item().damage.elementId !== 14) {
value = Math.round(value * 0.5);
}
</Custom React Effect>
Skill Notetag:
<Post-Damage Eval>
user.gainHp(Math.round(Math.max(0, (value*0.5)*user.rec)));
</Post-Damage Eval>
Example:
The enemy has a skill that deals 20 damage flat and heals for 50% of damage dealt.
The target may have a state that reduces all damage by 50%.
The enemy hits for 20 damage and the target does not have the state:
Deals 20 damage and heals for 10 HP.
The enemy hits for 20 damage and the target does have the state:
Deals 10 damage and heals for 10 HP.
> The healing should be 5 HP.
Conclusion:
So it seems that the effect from the Skill-notetag is executed before the State-notetag.
Is there a easy solution for this? And if not, are there any other valid workarounds?
Note: I have a lot damage-modifying states, so I'd rather avoid "tagging" all life-steal skills with all states that have such a modifier, creating a thousand conditional branches in every skill.
However, The notetag I gave my skill to do the actual lifesteal does not seem to play nice with the notetag of a damage reduction state.
State Notetag:
<Custom React Effect>
if (value > 0 && this.item().damage.elementId !== 14) {
value = Math.round(value * 0.5);
}
</Custom React Effect>
Skill Notetag:
<Post-Damage Eval>
user.gainHp(Math.round(Math.max(0, (value*0.5)*user.rec)));
</Post-Damage Eval>
Example:
The enemy has a skill that deals 20 damage flat and heals for 50% of damage dealt.
The target may have a state that reduces all damage by 50%.
The enemy hits for 20 damage and the target does not have the state:
Deals 20 damage and heals for 10 HP.
The enemy hits for 20 damage and the target does have the state:
Deals 10 damage and heals for 10 HP.
> The healing should be 5 HP.
Conclusion:
So it seems that the effect from the Skill-notetag is executed before the State-notetag.
Is there a easy solution for this? And if not, are there any other valid workarounds?
Note: I have a lot damage-modifying states, so I'd rather avoid "tagging" all life-steal skills with all states that have such a modifier, creating a thousand conditional branches in every skill.