Hi everyone,
I'm having an issue with a custom notetag in the YEP Buffs and States Core Plugin for RPG Maker MV. My goal is to have a state that damages the target only when he selects a skill, but I don't know how to do it, because when I select a command like guard, for example, the target still gets hit by the damage. Here is my code:
the guard command uses a state called "guard" (ID2) that triggers a skill named "rest" (Skill ID2), so damage should occur only when a skill is used (what I believe to be the standard for RPG maker when you start a new project).
I'm having an issue with a custom notetag in the YEP Buffs and States Core Plugin for RPG Maker MV. My goal is to have a state that damages the target only when he selects a skill, but I don't know how to do it, because when I select a command like guard, for example, the target still gets hit by the damage. Here is my code:
JavaScript:
<State: 16>
<Custom Action End Effect>
if (target.isActor() || target.isEnemy()) {
var dmg = Math.floor(target.mhp * 0.1);
target.gainHp(-dmg);
target.startDamagePopup();
target.clearResult();
// Play animation
target.startAnimation(53);
// Add battle log message
BattleManager.addText(target.name() + " suffers from its wounds.");
if (target.hp <= 0) {
target.performCollapse();
}
}
</Custom Action End Effect>
the guard command uses a state called "guard" (ID2) that triggers a skill named "rest" (Skill ID2), so damage should occur only when a skill is used (what I believe to be the standard for RPG maker when you start a new project).