RMMV Yanfly Buffs & States Core - Help With A Simple State Effect

Ravenith

Veteran
Veteran
Joined
Mar 27, 2012
Messages
265
Reaction score
16
First Language
Greek
Primarily Uses
Hello there.

So, short story short, I would like to create a state that stacks with itself, and provides a flat +1 bonus to MaxMP for each stack.

Any help would be appreciated :>
 

MiddleMang

Villager
Member
Joined
Jan 24, 2019
Messages
15
Reaction score
2
First Language
English
Primarily Uses
RMMV
Hello there.

So, short story short, I would like to create a state that stacks with itself, and provides a flat +1 bonus to MaxMP for each stack.

Any help would be appreciated :>
How would you like this to stack? Over time? When applied via skill? On a hit? Any stack limit? Does it fill the mp it gains as well? Or when it gains, is it just max?


This is a Passive Version that resets every battle, every turn you gain 1max mp along with a stack that's visually indicated by a counter. (It may not be the most clean code but this works for me). We can change it if you'd like.
JavaScript:
<Category: buff>
<Custom Regenerate Effect>
//add your state + how many visual stacks you want per turn
user.addStateCounter(yourstate, 1);
//specify stack value gained per turn
this._RegenCounter = 1;
var n = this._RegenCounter;
// * 1 can be changed to whatever value for MP per stack (n).
var value = Math.floor(n * 1);
//gain the max mp
user.addMaxMp(value);
this._RegenCounter += 1;
</Custom Regenerate Effect>

  <Custom Victory Effect>
user.removeStateCounter(yourstate);
a.clearParamPlus()
  </Custom Victory Effect>

<Custom Escape Effect>
user.removeStateCounter(yourstate);
a.clearParamPlus()
  </Custom Escape Effect>

<Custom Defeat Effect>
user.removeStateCounter(yourstate);
a.clearParamPlus()
  </Custom Defeat Effect>

<Custom Remove Effect>
user.removeStateCounter(yourstate);
a.clearParamPlus()
</Custom Remove Effect>
 
Last edited:

Ravenith

Veteran
Veteran
Joined
Mar 27, 2012
Messages
265
Reaction score
16
First Language
Greek
Primarily Uses
This is a Passive Version that resets every battle, every turn you gain 1max mp along with a stack that's visually indicated by a counter. (It may not be the most clean code but this works for me). We can change it if you'd like.
JavaScript:
<Category: buff>
<Custom Regenerate Effect>
//add your state + how many visual stacks you want per turn
user.addStateCounter(yourstate, 1);
//specify stack value gained per turn
this._RegenCounter = 1;
var n = this._RegenCounter;
// * 1 can be changed to whatever value for MP per stack (n).
var value = Math.floor(n * 1);
//gain the max mp
user.addMaxMp(value);
this._RegenCounter += 1;
</Custom Regenerate Effect>

  <Custom Victory Effect>
user.removeStateCounter(yourstate);
a.clearParamPlus()
  </Custom Victory Effect>

<Custom Escape Effect>
user.removeStateCounter(yourstate);
a.clearParamPlus()
  </Custom Escape Effect>

<Custom Defeat Effect>
user.removeStateCounter(yourstate);
a.clearParamPlus()
  </Custom Defeat Effect>

<Custom Remove Effect>
user.removeStateCounter(yourstate);
a.clearParamPlus()
</Custom Remove Effect>

This is exactly what I wanted, but I must be doing something wrong. Do I have to replace something in the code?

EDIT: Never mind, my bad, it works great! Thanks a bunch!
 

MiddleMang

Villager
Member
Joined
Jan 24, 2019
Messages
15
Reaction score
2
First Language
English
Primarily Uses
RMMV
This is exactly what I wanted, but I must be doing something wrong. Do I have to replace something in the code?

EDIT: Never mind, my bad, it works great! Thanks a bunch!
Sorry, maybe my little comments weren't very clear, I'm not really used to sharing my bruteforced success stories haha! Glad it worked out!
 

Latest Threads

Latest Posts

Latest Profile Posts

I've been working on some ABS team A.I. for 'A New Suburbia', and thought I'd share.

I'm generally quite please although the AI is a little grenade heavy right now :rolleyes: - Sneaking and stalking next! Please excuse the terrible map... it was just for ease of viewing!
Voting for the second round of the Map Madness Tournament is now live! Vote for your favorite in each matchup! https://forums.rpgmakerweb.com/index.php?forums/map-madness-2021-polls.187/
Just bought the Visustella All Waves bundle... Time to go IN!!
Oh, I was just confirmed I'll be doing small online classes during june - july, on one side I'm nervous and looking forward it, on the other one: I've became the very thing I swore to destroy. :kaodes:
Work starts today at 2pm. I hate jeans, but the dress code says I have to wear them... That's how I discovered I was a plus size. Shopping for my first pair of jeans.
Anyhow, I'll post a new video on TheDazzlingsAreBack as soon as I'm able to.

Forum statistics

Threads
110,576
Messages
1,054,331
Members
143,690
Latest member
dlsgp0712
Top