[RPVX ACE] HELP WITH THE BATTLE FORMULA.

Posts

Pages: 1
Ok so in my game, the PC's stats increase as they land attacks/are hit by attacks.

To make it so it only happens on a successful hit I am using the damage formula to apply these bonuses. Increasing Attack and Magic is easy. It's literally just adding an "a.add_param(3, 1)" before the damage formula, followed by a ; then the damage formula itself. With raising defence and hp, it's a bit more tricky. I want it to be so when the player guards and is hit, the resistance increases. So magic attacks increase magic defence, and physical attacks increase defence. This is easy, a simple "b.add_param(4, 1)" does the trick. Where I start to falter is here, I want it so that if the character is not guarding, their HP increases instead.

My current formula is this:
a.add_param(3, 1); b.isGuard() ? b.add_param(0, 1) : b.add_param(4, 1); a.atk - b.def

the problem is this does not work. I can make it so it increases one, or both, but not so it properly increases on based on the target's state.

Any tips? Am I doing the if statement wrong? I honestly can't figure this out.
This system makes sense for ATK/DEF/MAT/MDF, but for HP it sounds strange.
Getting hit increases HP? or Max HP?

HP -> Getting hit causes a slight heal? How's that different from being hit with a weaker attack?

Max HP -> Let yourself get hit by beginner enemies till your Max HP increases to a ludicrous amount. (

Wait, probably these bonuses disappear when battle ends or something. Never mind.
Max HP, and no the bonuses are permanent, but many late game enemies are ridiculously strong. I have a script that raises stat caps to 999,999 and monsters reach it late game. Also without defense even early to mid game monsters will deal high damage.
cool, cant wait for some 'Let yourself get hit by beginner enemies till your Max HP increases to a ludicrous amount' gameplay
Eh, weaker enemies increase your hp by one. Later enemies by slightly more. Rarer attacks even more so. Itd be very counter intuitive and poorly planned out to do that. :b
The check for if a battler is guarding is guard? so try:

a.add_param(3, 1); b.guard? ? b.add_param(4, 1) : b.add_param(0, 1); a.atk - b.def

I also swapped the param of HP and DEF since a trinary operator is

condition ? if true : if false
and guard? returns true if the battler is guarding which should be a DEF increase.

I haven't tested it myself, if you still have issues I'll look more into it tomorrow night.
I jist realised i never said thanks. While there was some conflict with a script this did work. Thanks ^-^ <3
Pages: 1