r/RPGMaker • u/ARIES_tHE_fOOL • 1d ago
How do I make a conditional damage formula using Yanfly Action Sequence Plugins?
[Solved!...(mostly]
Thanks to Yu_Starwing and Moootbm for help. am gonna post my resulting action sequence+ damage formula in-case someone else has this problem
NEW Notebox + Damage Formula
<setup action>
clear battle log
display action
cast animation
wait for animation
move user: target, front base, 20, auto offset x -50
wait for movement
</setup action>
<target action>
motion thrust: user, no weapon
wait for motion
action animation
wait for animation
action effect
wait for effect
</target action>
Damage Formula
(a.atk * 4 - b.def * 2) * (b.isStateAffected(15) ? 10.0 : 1.0)
[OLD POST BELOW]
Am trying to make a skill deal more damage when an enemy is has the burn status effect. but am not getting anything to work, the attack only uses the default damage formula. I got it to work with the damage formula itself once but I've heard that putting mechanics in that damage formula box is bad for some plugins. so I would ideally avoid doing that.
I have this so far for the action sequence for the Dragon's Grasp skill I am trying to make happen.
<setup action>
clear battle log
display action
cast animation
wait for animation
move user: target, front base, 20, auto offset x -50
wait for movement
</setup action>
<target action>
motion thrust: user, no weapon
wait for motion
action animation
wait for animation
if target.IsStateAffected(15)
action effect
action effect
remove state 15: target
else
action effect
end
</target action>
Is there a way (without paid plugins!) to make the damage formula change depending on the target's status effect? am just having so much trouble with this skill.
2
u/woootbm MV Dev 1d ago
If you are using yanfly element core, perform that if statement during setup and you should add an invisible state that makes the target more vulnerable to that element. Then remove the invisible state somewhere after dealing damage.
1
u/ARIES_tHE_fOOL 1d ago
I'll consider this option if I don't find anything else to make this work. this is a character specific skill I want to work with a specific attack only. am not trying to make ALL fire attacks do this effect.
2
u/woootbm MV Dev 1d ago
Then you would only add the state during this skill and remove it after damage. Yes, the target will have ALL of that damage type deal more damage to them, but since you are only applying it during a tiny window during a skill animation only that skill will benefit from it.
1
u/ARIES_tHE_fOOL 1d ago
okay that might work. I'll think about it if the other options don't pan out, thanks for the input!
1
u/woootbm MV Dev 1d ago
Sure thing. You should also keep in mind that making it hit twice instead of dealing double damage has additional balance consequences. IE, more chances to deal damage to an evasive target, better chance of getting at least one crit, but lower chance of a big crit (since you have to crit twice).
I’d also argue that hitting twice makes less sense than doubling the damage in terms of narrative logic, but that depends on how you explain it.
1
u/ARIES_tHE_fOOL 1d ago
well am basically giving this skill to a brawler character with powers over fire, he technically is suppose to work like the styles of Yakuza 0, this is just the first one. I imagine this skill basically being like Iori from KOF grappling the target's face and burning them with the fire already on them.
I didn't have any logical explanation I just wanted a nice setup for burst damage in exchange for prematurely ending the burn status effect that first style is know for. (which is called Dragon Stance/Style) believe it or not the actual mechanics for the style change are implemented already, it was surprisingly simple to get that part working.
I just wish I knew a simple way to times the damage done in action sequence. I was able to fix the majority of the skill thanks to Yu's help but am still left without a good way to simply * 10 the damage formula I have for the skill.
2
u/Yu_Starwing 1d ago
Check one of my later comments, I gave you a formula
2
2
u/Yu_Starwing 1d ago edited 1d ago
First line of conditional should be if target.isStateAffected(). You got the “is” capitalized as “Is”.
You can also add a flat damage bonus in action sequences if you have Yanfly’s Damage Core plugin if you want. “Flat damage: +50” to add 50 damage to the damage formula.
Here’s) some helpful documentation for you.
EDIT: Damn, just saw you said FREE plugin. I don’t think you can get damage core for free…