RPG Maker Forums

So I'm trying to create a custom damage over time effect where the damage and turns it takes is based on the users MP at the time the skill is used (the MP shouldn't be a cost, but it clears once the effect hits the enemy. It's 5 as that's the characters max MP at all times).


I am using YanFly's Buffs and States core for this. The adding turns is working fine, however the variables in the custom apply effect need to go through to the custom regenerate effect (if I set the variable there it will just update to the current MP of the character which is not what I want.)


Here is the code:

<Custom Apply Effect>
var RuptureMult = origin.mp;
user.setStateTurns(137, RuptureMult + 1);
origin.gainMp(-5);
</Custom Apply Effect>


<Custom Regenerate Effect>
var elementId = 13;
var damage = Math.round(Math.ceil(origin.level *0.05) * ((origin.atk * 4) * 0.6) * (RuptureMult * RuptureMult));
damage *= user.elementRate(elementId);
damage = Math.floor(damage);
user.gainHp(-damage);
user.startDamagePopup();
user.clearResult();
</Custom Regenerate Effect>


Any help would be appreciated.

Latest Threads

Latest Profile Posts

Don't forget, aspiring writers: Personality isn't what your characters do, it is WHY they do it.
Hello! I would like to know if there are any pluggings or any way to customize how battles look?
I was thinking that when you start the battle for it to appear the eyes of your characters and opponents sorta like Ace Attorney.
Sadly I don't know how that would be possible so I would be needing help! If you can help me in any way I would really apreciate it!
The biggest debate we need to complete on which is better, Waffles or Pancakes?
rux
How is it going? :D
Day 9 of giveaways! 8 prizes today :D

Forum statistics

Threads
106,050
Messages
1,018,548
Members
137,835
Latest member
yetisteven
Top