How to: Stat Dependent Buffs?

Nate_Tillern

Villager
Member
Joined
Apr 14, 2019
Messages
8
Reaction score
0
First Language
English
Primarily Uses
RMMV
Hello All!

I have been googling a bit around this, but so far have not seen someone explaining how to handle what I would like to have happen in the software, or a plugin addressing it. (So I may be missing something super obvious).

Anyway, so I have a class who is all about just buffing allies, changing their attack element, other support stuff. The thing is, I can't figure out how to make the impact of their skills dependent on their intelligence (magic attack stat).

I haven't developed the exact math yet, but essentially I would like to do something along the lines of the following as an example:

Sample berserk spell that buffs ally's attack:
b.atk = b.atk + b.atk * ( Math.pow( a.mat / 999 , 0.5 ) * ( ( Math.random() * a.luk ) / 100 ) )

Again the exact formula isn't set in stone, but something where the stat increase is positively dependent on the casters magic attack. I thought I'd be able to be able to set this up in the state section (since the built in buff/debuff stuff is super simple), but haven't had any luck. Any help is greatly appreciated.
 

Nate_Tillern

Villager
Member
Joined
Apr 14, 2019
Messages
8
Reaction score
0
First Language
English
Primarily Uses
RMMV
Would I have to do something with the skill calling a common event that saves the character's stats as variables, doing the math manipulation within the variables themselves and then replacing the characters stat with the outcome variable?
 

Wavelength

Edge of Eternity
Global Mod
Joined
Jul 22, 2014
Messages
5,404
Reaction score
4,801
First Language
English
Primarily Uses
RMVXA
@Nate_Tillern Please avoid double-posting (posting directly after yourself, unless no one has responded for 3 days). If you need to add something to your last post, just use the Edit function.

Additionally, please be careful where you're posting, as somehow your thread ended up in "MV Software Updates" rather than RPG Maker MV (Support). I'm going to go ahead and move it to JS Plugin Requests, though, since this will probably require Plugins.

To the topic of your buff, you definitely don't want to set an actor's ATK stat like that - it's not only complex in the implementation it would require, it's also way too risky - for instance if a state which notes their ATK should be set back is removed by a Recover All or by Death. While you could create several different ATK Buff states of varying levels of power and assign the target one of these states based on how high the caster's MAT stat is, the better way to do handle it would be to find a plugin that can safely change someone's stat using a formula.

I thought that one of Hime's or Yanfly's plugins would allow you to do this, but upon searching them I can't find any where I can definitively say they do, so hopefully someone can find the one that does or give you a completely different plugin that will help you pull this off.
 

HumanNinjaToo

The Cheerful Pessimist
Veteran
Joined
Apr 18, 2013
Messages
1,113
Reaction score
517
First Language
English
Primarily Uses
RMMV
You could try using Yanfly Buff and States Core. I pasted the code from the Heighten Magic tips and tricks and just changed the part of the value to include the origin's (meaning the actor that puts the state onto the target) MAT.

This is very basic, probably not exactly the formula you are looking for; however, I think it demonstrates that what you want to do can be achieved if you were willing to use this particular plugin. Basically it is saying that if the actor with this state is using a Magical skill then the damage value will be increased by the origin's MAT * 2.

<Custom Confirm Effect>
if (this.isMagical() && value !== 0) {
value = Math.ceil(value + origin.mat * 2);
}
</Custom Confirm Effect>

as far as the 'value =' portion, you can have anything you want there that would work in a damage formula box on a skill. You can also use lunatic code to maybe get some info that would be a little more difficult to get using the damage formula box, i.e. the state origin's MAT.
 

Frostorm

[]D[][]V[][]D aka "Staf00"
Veteran
Joined
Feb 22, 2016
Messages
1,116
Reaction score
808
First Language
English
Primarily Uses
RMMV
Try this? It uses the "origin" as @HumanNinjaToo mentioned.
b.atk += b.atk * ( Math.pow( origin.mat / 999 , 0.5 ) * ( ( Math.random() * origin.luk ) / 100 ) )
 

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Posts

Latest Profile Posts

ESAMarathon on Twitch, now streaming "Eat Girl". Yep, that's the title of a game... Apparently it's a Pacman knockoff.... Which is of course the only logical conclusion one would get from a name like "Eat Girl". :kaopride: I can't believe anybody would think anything else! :kaoback:
Super stoked i just finished my first town in my project, by finished i mean i can always add more decorative aesthetics and the NPCs don't talk yet but the mapping is complete and all the important chess pieces are present!
My brain: Hey, I have an idea how to make the transition to the main story quest in The Wastes more natural!
Me: Good!
My brain: You need to remake the hotel you start out in, it's not realistic enough.
Me: Ok... This was unexpected, but I can do it.
My brain: Now make each hotel floor 5 times as large to match the main part. Oh, you also need to make a bunch of new npcs to fill in the space on these maps.
Me: Crap.
Should be able to release Haxe MV/MZ next weekend.
It look that somehow MZ tracks are messed up (for example battle4 is obviously a theme, castle2 is a ship, ship1 is a scene and so on..). Maybe they just named them after with some ambiguity.

Forum statistics

Threads
100,618
Messages
977,837
Members
132,228
Latest member
zhengdddddd
Top