Eval Collection: Share the Pain!


♦ 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.




  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.


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 };
if (enemy._hp <= 0) {
</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).


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