SonoKiabutsu

Villager
Member
Joined
Jul 4, 2015
Messages
8
Reaction score
1
First Language
Enland
Primarily Uses
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.
 

lolshtar

Master of Magic thatknow nospell
Veteran
Joined
Apr 13, 2013
Messages
701
Reaction score
103
First Language
French
Primarily Uses
RMMV
l don't understand what you need exactly inside the custom regenerate effect.
 

Latest Threads

Latest Posts

Latest Profile Posts

Hot chocolate and music make studying and note-taking much easier :kaoluv:
Until my hand cramps up from writing too much!
Doing RPG Maker News for 21st September 2021


Malak is still waiting for Dark Deception Chapter 4... This was him yesterday after another sugar crash.
Again, he's fine. He's just bored at this point, considering he's exhausted his entire vacation bucket list.
Am I the only one who files custom resources under specific folders to remember who to credit? :kaoswt2:
1632263519730.png
I always smile to myself when I see someone do the "immediate halt and spin around" from forgetting something. I find it sort of endearing how we all do it without ever being taught to.

Forum statistics

Threads
115,263
Messages
1,088,450
Members
149,868
Latest member
MOAII
Top