Eval Collection: Share the Pain!

Requirements:

♦ YEP_SkillCore.js

There are two ways I use this snippet.

  1. I have a skill called “Share the Pain!”. You can only target allies with it. The targeted ally will take 15% of their max. HP as damage but all enemies will simultaneously receive the same amount of damage as well.

stp1stp2

 

 

  1. “Freezing Touch” will deal damage to one enemy first, then go on and deal a portion of the damage (30% in my case) to all enemies.

stp3stp4

This is the code snippet:


<Post-Damage Eval>
for (var i = 0; i < $gameTroop._enemies.length; i++) {
var enemy = $gameTroop._enemies[i];
if (enemy._hp <= 0) { continue };
if (enemy === target) { continue };
enemy.gainHp(Math.floor(-value));
enemy.startDamagePopup();
if (enemy._hp <= 0) {
enemy.performCollapse();
}
}
</Post-Damage Eval>

Line 5 is optional. If you decide to keep it, the target will not be damaged twice (First by the skill, second by this code snippet). If you delete it, the target will be hit twice.

Line 6 needs adjusting!  The default is “value” which returns the same damage as in the damage box. If you want something else there, just exchange value for an actual number or make modifications like “value * 0.5” (= 50% of value).

Advertisements

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