So there was an effect I made in MV. When the DoT damage goes off, the caster is healed for the same amount of damage, like a drain effect. This was using Yanfly's plugins, and I'm using VisuStella's now.
This is how the code looks in MV. Though there's a few problems in MZ I'm not sure how to get around.
For starters, the DoT formula now has to go in HP Slip Damage. So most of my DoT formulas look like this:
The issue is that if I try to put the healing here, the code always breaks. Calling the Pre-Regenerate phase only seems to affect the target, so I can't use that either, and the Life Steal notetags are all for skills or items.
In short, I'm stuck. Is there anything I can do?
Code:
<Reapply Reset Turns>
<Custom Apply Effect>
// Make sure the stack count exists.
target._vampireDrain = target._vampireDrain || 0;
// Increase the stack count.
target._vampireDrain += 1;
</Custom Apply Effect>
<Custom Remove Effect>
// Reset the stack count.
target._vampireDrain = 0;
</Custom Remove Effect>
<Custom Regenerate Effect>
// Check if the original caster isn't the target and that the original target is alive.
if (origin !== target && origin.isAlive()) {
// Determine the damage dealt.
var damage = origin.mat;
// Round up the damage.
damage = Math.ceil(damage);
// Original caster gains HP.
origin.gainHp(damage);
// Show the HP gained.
origin.startDamagePopup();
// Clears the original caster's HP popup.
origin.clearResult();
// Damage the target's HP.
target.gainHp(-damage);
// Check if the target is dead.
if (target.isDead()) {
// If the target is dead, make it collapse.
target.performCollapse();
}
}
</Custom Regenerate Effect>
This is how the code looks in MV. Though there's a few problems in MZ I'm not sure how to get around.
For starters, the DoT formula now has to go in HP Slip Damage. So most of my DoT formulas look like this:
Code:
<JS HP Slip Damage>
damage = user.mat * ((100 - (target.mdf/2))/100) * ((1 + user.getDealtElementPlus(6)) * user.getDealtElementRate(6) + user.getDealtElementFlat(6)) * target.elementRate(6)
</JS HP Slip Damage>
The issue is that if I try to put the healing here, the code always breaks. Calling the Pre-Regenerate phase only seems to affect the target, so I can't use that either, and the Life Steal notetags are all for skills or items.
In short, I'm stuck. Is there anything I can do?