Hello. This is my first post. I created a class called Diva, her job is to buff the party. Is there a way to make it so the buffs could scale off of her MAT stat?
Stat based buffs
RPG Maker MZ SupportIn the damage formula for the buff.
a.mat * 4 - b.def * 2 would multiply the buff by 4x the Diva's MAT and subtract that from 2x the targets def. You can change the def to whatever stat you want, but that should do it.
So if Diva's MAT is 4 and target's DEF is 2, it would be 16 (mat x4) - 4 (def x2) for a total buff of 12 to whatever stat you're buffing. I think. I suck at math and I suck at formulas but that should be about right. If you wanted it to be based strictly on the MAT with no additions/multiplications, just remove the *4 from the formula. Same for the target stat (def in this example), just remove the *2 and it would be a straight subtraction of one from the other.
a.mat * 4 - b.def * 2 would multiply the buff by 4x the Diva's MAT and subtract that from 2x the targets def. You can change the def to whatever stat you want, but that should do it.
So if Diva's MAT is 4 and target's DEF is 2, it would be 16 (mat x4) - 4 (def x2) for a total buff of 12 to whatever stat you're buffing. I think. I suck at math and I suck at formulas but that should be about right. If you wanted it to be based strictly on the MAT with no additions/multiplications, just remove the *4 from the formula. Same for the target stat (def in this example), just remove the *2 and it would be a straight subtraction of one from the other.
Wait, I thought the stat buffs were hard-coded?
Like, what you said will work for HEALS, sure, but what about increasing the Attack stat or the M-Defense stat? Because in the pulldown menu, you an only have damage, heal, or drain HP or MP, and you HAVE to select a pulldown to use the damage formula box. Which means you'll either be healing or hurting their HP or MP, with no effect on the stat the "Diva" is trying to buff.
Like, what you said will work for HEALS, sure, but what about increasing the Attack stat or the M-Defense stat? Because in the pulldown menu, you an only have damage, heal, or drain HP or MP, and you HAVE to select a pulldown to use the damage formula box. Which means you'll either be healing or hurting their HP or MP, with no effect on the stat the "Diva" is trying to buff.
Hmm...check this thread for a better idea than what I threw out:
forums.rpgmakerweb.com
How to apply buffs through damage formulas?
How do I apply buffs to the user through the damage formula on a skill while the skill targets someone else? I know that states are applied with (a.addState(x)) added on to the end of a formula, but what is the code for adding a buff or debuff instead? Thanks.
forums.rpgmakerweb.com
I'm not entirely sure what you're seeking. Are you trying to buff a stat of a party member after using an offensive skill on an enemy? Do you just need to know how to make a skill specifically for buffing characters? Either of those things are simple to achieve, but your opening post made it seem like you want to tie the potency of a buff to one of the caster's stats, which I'm not entirely certain is possible with ease, or even at all.
I believe OP wants states that scale with the caster's parameters versus a static value as offered in the editor. For example, a Strength increase equal to a.mat * 2, instead of something like 10%.
I don't think there's a way around this without a plugin. rmmz_objects.js has an existing stateTurns object that snapshots a state's duration on application, so it wouldn't be particularly difficult to evaluate a formula or snapshot a parameter buff value at that point as well. But I believe that warrants a more fleshed out plugin request.
That being said, I'd be surprised if there isn't a Yanfly/VisuStella plugin that doesn't already have some kind of note tag framework for this. Maybe someone with knowledge of that plugin library can chime in.
I don't think there's a way around this without a plugin. rmmz_objects.js has an existing stateTurns object that snapshots a state's duration on application, so it wouldn't be particularly difficult to evaluate a formula or snapshot a parameter buff value at that point as well. But I believe that warrants a more fleshed out plugin request.
That being said, I'd be surprised if there isn't a Yanfly/VisuStella plugin that doesn't already have some kind of note tag framework for this. Maybe someone with knowledge of that plugin library can chime in.
For example, if Diva's MAT is 20 and you buff your ally's DEF, optimally I'd want 20 to be added to their DEF. Something like that.
Original thread: https://forums.rpgmakerweb.com/threads/stat-based-buffs.155030/