Phoenix Down + Zombie State?

How would I be able to do this?

So far I have figured out how to handle recovery and regen inverts.
How would I have a Life/Phoenix Down inversion during Zombie State?
I found this thread that has some great info on damage formulas.
https://rpgmakermv.co/threads/damage-formulas-101-mv-edition.2172/

In particular, you would put this in the HP Recover part:

if(!b.isStateAffected(stateId) b.addState(1);

Make sure you replace stateId with you a state that you can add to any and all undead monsters. You may need a plugin to allow passive states.
Alternatively, you could also make a "Undead" element and do checks to see if the enemies Undead Element Rate is 0%
If it is, kill it. Then, set all Undead to have an Undead Element Rate of 0%.

b.elementRate(elementId) == 0 ? b.addState(1) : 0

elementId should be the id of your Undead element.
I found this thread that has some great info on damage formulas.
https://rpgmakermv.co/threads/damage-formulas-101-mv-edition.2172/

In particular, you would put this in the HP Recover part:

if(!b.isStateAffected(stateId) b.addState(1);

Make sure you replace stateId with you a state that you can add to any and all undead monsters. You may need a plugin to allow passive states.
Alternatively, you could also make a "Undead" element and do checks to see if the enemies Undead Element Rate is 0%
If it is, kill it. Then, set all Undead to have an Undead Element Rate of 0%.

b.elementRate(elementId) == 0 ? b.addState(1) : 0

elementId should be the id of your Undead element.

Hmmm setting Undead as an element rate sounds interesting...
Effectively... I would give "non-undead" units a 100% rating and undead a 0% rating (or an inverse of 0% and 100% undead)

and the eval would be

b.elementRate(elementId) == 100 ? b.addState(1) : 0

That's a pretty neat way of setting undead state.

And OMG... thank you for the link. I never knew the damage formula's could be so flexible...
Also is there a reason for making it !b? in the eval?

Thanks for the reply 🙂
Oh no that was just me copy-pasting it and overlooking the !

You would want to omit the ! in this case.

I definitely suggest not doing the 100% = undead and 0% = living because then anything without the trait Element Rate Undead = 0% would be considered undead. However I could see why you might want to, so it's up to you.

I think b.elementRate(elementId) == 100 might be correct. If it isn't try == 1, as it might be a percent based value.
!b means if b, the target, is not, so the check here:
!b.isStateAffected(stateId) means
b is not affected by state #stareId,
If you were doing a zombie state you could have your eval like this:
If(!b.isStateAffected(stateId)){b.revives(); b.mhp/2;} else{b.dies();} where stateId is the zombie state id. And where the target revives if not affected by the zombie state or dies if they are.

Original thread: https://forums.rpgmakerweb.com/threads/phoenix-down-zombie-state.91738/