Eval Collection: Heal all members

This code snippet will heal all party members for a certain amount of the damage dealt to an enemy by the skill.

Requirements:

♦ YEP_SkillCore.js

 

snippet1.png

In the picture above, “Will of the Gods” restores 20% of Damage as HP to all allies.

If you want to achieve this effect, use the following notetag:


<Post-Damage Eval>
for (var i = 0; i < $gameParty.battleMembers().length; i++) {
var actor = $gameParty.battleMembers()[i];
if (actor.id === 0) { continue };
if (actor.hp <= 0) { continue };
actor.gainHp(Math.floor(value * 0.2));
if (actor !== user) {
actor.startDamagePopup();
}
}
</Post-Damage Eval>

 

Line 5 is optional. If you decide to keep it, the skill will NOT revive dead members. If you leave it out, the skill will revive fallen heroes.

Line 6 needs adjusting! Of course you can keep the value as it is but maybe you’d like your skill to heal more or less than 20%. In that case, change the value 0.2 to something else. 2 = 200%, 1 = 100%, 0.5 = 50%, 0.25 = 25%, ………….

Advertisements

4 thoughts on “Eval Collection: Heal all members

  1. Hello, I tried to use somes skills with this effect but when it ran, I get a error message :
    typeerror cannot read property ‘length’ of undefined

    Any ideas how to fix that please ?

    Like

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