Looking at the options here, I think an old idea I gave up on, is actually possible here... maybe.
DAMAGE MP
I had originally looked up pluggins for this, but none of them were designed "correctly".
The idea:
Put up a buff. While this buff is active, damage you take, has to go through your MP before it goes through your HP.
This does NOT mean your HP is immune to damage intake if you have MP.
This does NOT mean a percentage of the damage goes to MP and HP every time.
example:
You have 9,999hp and 999mp.
The enemy does 5,000 dmg.
you take 999mp dmg, and the remaining 4,001 dmg goes to HP, leaving you with 5,998hp.
Looking at the damage formula, would it be possible to do all of this:
(1) First check to see if the buff is up or not. (
Damage MP state)
(2) If so, calculates the dmg it would do based on stats, stores the number. (
a.att - b.def is stored)
(3) Checks to see how much MP you currently have, stores the number. (
b.mp is stored)
(4) uses mpGain "negatively" so you lose MP, rather than gain it, based on that mp stored number. (
mpGain - stored dmg number)
(5) reduces the damage dealt to HP based on the stored MP number. (
stored number - the stored mp number (not current number, as MP was reduced))
I dont know if its possible to store all these numbers, and recall them with all these conditional branches, nor how i would even start to attempt such a thing. (Maybe deal HP dmg 1st, before i deal dmg to mp, in the equation?)
EDIT:
here's what i tried c=b.mp; d=a.atk-b.def-c; if (b.isStateAffected(21)) b.gainMp(-d); d; else a.atk - b.def
currently doing 0 dmg, and not lowering targets mp either.
if i remove the b.gainMp part out, it will damage Hp correctly. but once i try to damage the mp, it stops working.
when i do
b.gainMp(-(a.atk+b.def)); a.atk-b.def
no "if" statement, just this, it does dmg to hp and mp.
so my currently issue is having an if statement do 2 things, before going to an else formula.
edit: just tried
c=b.mp; d=a.atk-b.def-c; if (b.isStateAffected(21)) { if (b.isStateAffected(21)){b.gainMp(-d)} else{d} }else{a.atk - b.def}
figured the result would be to damage mp but not HP (which is what happened), but figured id try.
still cant get all 3 to work. i can get any combination of 2 of 3 to work.
(1) check if,
(2) dmg mp,
(3) dmg HP. (yes, even damage both hp and mp work, just not after an if statement)
Bonus question: how would you allow it to work with yanflys temp HP shields? (takes from MP before it takes from temp HP, and temp HP before normal HP. Unless yanflys by default treats temp hp as just a "current hp" number higher than max hp)
FINAL EDIT: I figured it out. When doing if statements, you can NOT do 2 things. example, you cant apply a buff, a debuff, and do dmg. you can do only ONE thing after an if statement. (idk why) but in the else part, you can do as many multiple things as you want.
so i changed the formula to simply have
if(!b.isStateAffected where the "normal" formula happens after the if(! but the actual 2 things i want to happen, due to the buff, happen in the "else"
So it currently looks like
c=b.mp; d=a.atk-b.def-c; if (!b.isStateAffected(21)) a.atk - b.def; else b.gainMp(-a.atk-b.def); d
(I think theres a small error, but this mostly works now, ill fine tune details later)
Thanks for the answer, but is it possible to get the exact value the user got from specific equipment?
My ideal is to create a class that focus on Kick, so damage formula is based on Shoes defense, and a class with close combat that has damage formula based on both Gloves + Shoes defense.
Its not quite the answer you're looking for, but one work around I can come up with, is to have each battle start with an event that checks the party members currently equipped gear.
So it looks to see if anyone has the class/ability you mentioned.
then it checks their boots and gloves, and assigns a variable based on which boots they have, and another based on the gloves.
(This is a LOT of conditional branching, as u have to check for every single piece of gear that can be equipped in that slot)
then in the damage formula, have it add the 2 variables together for the damage.
if you use pluggins that allow you to put states on gear, then you can just check for the states, and make variables that way.
and if you use a pluggin that allows you to make "useless" stats on gear, u can check for those instead.
(some pluggins allow u to add stats to gear which boost certain attacks as well)