RPG Maker Forums

Here is my code for reference:
<Custom Apply Effect>

if (target._stateTurns[36] >= 50) {

target._stateTurns[36] = 50;

}

</Custom Apply Effect>

// The above snippet is used to control the maximum duration of the state (in this case, state 36 has a cap of 50 turns)

<Custom Regenerate Effect>

// The formula for the regeneration effect. In this case, it uses the user's max HP, divides by 100 (to make it 1%),
// checks against the elementRate of element 12, rounds everything down, then increases the total by 1.

var regen = Math.floor(origin.mhp / 100 * target.elementRate(12)+1);

// Make the user gain HP.

user.gainHp(regen);

// Show the HP healed.

user.startDamagePopup();

// Clear the user's results.

user.clearResult();

</Custom Regenerate Effect>

What I have here is just a basic healing effect that heals over time. if I were to add a "-" to (regen), it would instead deal damage (and would be displayed as (-regen) instead). What I want to be able to do is make an effect that can change it's damage or healing based on actions received.
For example, the above example heals for 1% of the user's max HP per turn, but maybe if you receive physical damage (element 1), the amount of healing it does should be increased to 2% instead.
Alternatively, supposed you were to take Shadow damage (let's say element 9), and that effect weakens healing taken, so it should instead reduce the amount of healing to 0.5% of the user's max HP per turn. Of course, this can be done already by modifying the user's element rate, since the above formula already performs a check against the elementrate, but what if I want to be able to do it without having to do that?
I don't know exactly how it would have to be written, but I'm inclined to believe it should be possible to do using if statements.
If this can be done, I would like to try to take it one step further and make it so when a modifier is run to increase or decrease the effect, it also increases a number (either a number unique to this formula, or a variable, it doesn't matter), and the point of this number would be to limit the number of times the effect can be increased or decreased.

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,049
Messages
1,018,546
Members
137,835
Latest member
yetisteven
Top