Eval Collection: Endless Return

Whenever a hero takes damage while his HP are below a certain threshold, he has a chance to recover a lot of HP.

Requirements:

♦ YEP_BuffsStatesCore.js

endlessreturn.png

In the picture above, Jeff was hit while his HP were below 30% of his health. He was lucky and triggered the effect of Endless Return, restoring 35% of his HP to him.

Use this notetag in your state’s notebox:


<Custom Deselect Effect>
if (target.hpRate() < 0.3) {
if (Math.random() < 0.5) {
target.gainHp(~~(target.mhp * 0.35));
target.startAnimation(41);
target.startDamagePopup();
target.clearResult();
}
}
</Custom Deselect Effect>

Line 2 needs adjusting! The endless return effect may only trigger if the target’s HP rate is below this threshold. In my case, it’s 30%. (Thus 0.3)

Line 3 needs adjusting! This is the probability with which the effect will trigger. In my case, it’s 50%. (Thus 0.5)

Line 4 needs adjusting! This is the amount of HP the target will restore. You can either use a flat number (ex. 2000) or a formula like me. In my case, it restores 35% of the target’s maximum HP.

Line 5 needs adjusting! This the animation that will be played when the effect triggers. You can either change it or simply remove the whole line if you don’t want an animation to be played.

Advertisements

2 thoughts on “Eval Collection: Endless Return

Write a comment

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s