MV Yanfly Action Sequences Pack - Mutiple hits with different damage values?

i got a skill that involves multiple small slashes before a finishing blow, i know you can achieve multiple hits by repeating "action effect: target" but is there a way to change the damage formula or add a different one mid sequence so the last hit deals signifficantly more damage?

the sequence itself goes something akin to this, although i removed some elements like fading backgrounds to make it more simple:

Code:
<whole action>
immortal: targets, true
se: Skill3, 65, 90, 0
animation 23: target
wait: 8
shake screen: 6, 24, 64
action effect: target
wait: 8
action effect: target
wait: 8
action effect: target
wait: 8
action effect: target
wait: 8
action effect: target
wait: 8
action effect: target
wait: 8
action effect: target
wait: 8
action effect: target
wait: 32
(here is where the big hit would land)
zoom: 120%, 5
shake screen: 24, 24, 32
wait for animation
immortal: targets, false
reset camera: 5
reset zoom: 5
end
</whole action>
If I'm not having a brainfart right now, you should be able to use
Code:
eval: target.gainHp(-(user.atk * 4 - target.def * 2));
and just put whatever formula you want. This is outside of the action effect tho, so keep that in mind when it's a skill that also has other effects like applying a state. (In which case you could use add state x: target)

You may also want to use:
Code:
eval: target.startDamagePopup();
Right after, because dealing damage with an eval like that will not automatically produce a popup.
i use variables for that personally. I set a variable to whatever multiplier i need it to before the action effect and then use the variable in the formula.
If I'm not having a brainfart right now, you should be able to use
Code:
eval: target.gainHp(-(user.atk * 4 - target.def * 2));
and just put whatever formula you want. This is outside of the action effect tho, so keep that in mind when it's a skill that also has other effects like applying a state. (In which case you could use add state x: target)

You may also want to use:
Code:
eval: target.startDamagePopup();
Right after, because dealing damage with an eval like that will not automatically produce a popup.
that worked thanks!, though now i have a different problem, i use AS in conjunction with the animated SV battlers, the eval seems to skip the hurt animation, is there another eval to trigger it?
that worked thanks!, though now i have a different problem, i use AS in conjunction with the animated SV battlers, the eval seems to skip the hurt animation, is there another eval to trigger it?
You just use the regular action sequence command.
motion damage: target

Robro's approach works just as well tho and would avoid all the extra shenanigans my approach needs. (Tho I have no idea how you'd set that dmg formula up.)
You just use the regular action sequence command.
motion damage: target

Robro's approach works just as well tho and would avoid all the extra shenanigans my approach needs. (Tho I have no idea how you'd set that dmg formula up.)
noted, will try the variable method in other skills as well, thanks for all the help!
(Tho I have no idea how you'd set that dmg formula up.)
pretty much as i said
Code:
(formula) * $gameVariables.value(x)
yes, you can also use v[x]...

So for one of my multihit skills where the hits use different multipliers, the formula is
Code:
this.PDmg(a, b, a.atk, b.def) * $gameVariables.value(212)
where i multiply the formula by the variable, and then the damage section of the AS uses

Code:
<target action>
eval: $gameVariables.setValue(212, .2)
action animation
action effect
wait: 8
action animation
action effect
wait: 20
eval: $gameVariables.setValue(212, 1.1)
action animation
action effect
</target action>

so that the first 2 hits use a 20% mult and the last uses a 110%.
I altered $gameVariable.setValue to allow for decimals in my project, but all it does is save having to multiply the variable's value by some power of 10 when setting it and dividing it by the same in the formula when using it


Then, if you wanted an entirely different formula between hits and not just a multiplier change, storing the formula as a string in a variable and eval()'ing the variable works. I havent used a similar setup like it ever since initial testing, but having the formula just be like
Code:
eval($gameVariables.value(212))
and the AS be
Code:
<target>
eval: $gameVariables.setValue(212, "a.atk-b.def")
action animation
action effect
wait for animation
eval: $gameVariables.setValue(212, "a.mat*3-b.agi")
action animation
action effect
</target>
does let you actively change what the effective formula is
pretty much as i said
Code:
(formula) * $gameVariables.value(x)
yes, you can also use v[x]...

So for one of my multihit skills where the hits use different multipliers, the formula is
Code:
this.PDmg(a, b, a.atk, b.def) * $gameVariables.value(212)
where i multiply the formula by the variable, and then the damage section of the AS uses

Code:
<target action>
eval: $gameVariables.setValue(212, .2)
action animation
action effect
wait: 8
action animation
action effect
wait: 20
eval: $gameVariables.setValue(212, 1.1)
action animation
action effect
</target action>

so that the first 2 hits use a 20% mult and the last uses a 110%.
I altered $gameVariable.setValue to allow for decimals in my project, but all it does is save having to multiply the variable's value by some power of 10 when setting it and dividing it by the same in the formula when using it


Then, if you wanted an entirely different formula between hits and not just a multiplier change, storing the formula as a string in a variable and eval()'ing the variable works. I havent used a similar setup like it ever since initial testing, but having the formula just be
Code:
eval($gameVariables.value(212))
and the AS be
Code:
<target>
eval: $gameVariables.setValue(212, "a.atk-b.def")
action animation
action effect
wait for animation
eval: $gameVariables.setValue(212, "a.mat*3-b.agi")
action animation
action effect
</target>
does let you actively change what the effective formula is
Oh I see, you have the variable in there by default... So you'd set it to 0 if you don't actually want a multiplier. Yeah that works too.

Original thread: https://forums.rpgmakerweb.com/threads/yanfly-action-sequences-pack-mutiple-hits-with-different-damage-values.183972/