YEP Damage Core - Conditional Damage Formula

Hi!

I've been trying to play around Yanfly's damage core plugin but I'm really having a hard time trying to figure this one out.

I need a damage formula for this condition (inside the <damage formula></damage formula> tags)

If the target is affected by state "Bleed", the damage formula will be

Spoiler
(b.mhp -  b.hp) - b.def * 2
If not,

(200 + a.atk * 4) - b.def * 2

What i did was:

Spoiler
<damage formula>if (b.state !== "Bleed") {

  value += (b.mhp -  b.hp) - b.def * 2;

}

else {

  value += (200 + a.atk * 4) - b.def * 2;

}

</damage formula>
I know that the condition itself is incorrect. I'll appreciate any help. Thanks in advance!
I haven't tested it, but try something like this inside the <damage formula> tag

if(b.isStateAffected(x)) {(b.mhp - b.hp) - b.def * 2;} else {(200 + a.atk * 4) - b.def * 2);}x is the id of your bleed state in your database.
I haven't tested it, but try something like this inside the <damage formula> tag

if(b.isStateAffected(x)) {(b.mhp - b.hp) - b.def * 2;} else {(200 + a.atk * 4) - b.def * 2);}x is the id of your bleed state in your database.
Hi kiriseo!

Thanks for the reply! The state condition is what I needed. I made it work this way:

if (b.isStateAffected(x)) {

value += ((b.mhp - b.hp) - b.def * 2);

}

else {

value += ((200 + a.atk * 4) - b.def * 2);

}

The condition shall be added to my reference. 😀 Thank you very much! Thread may now be closed.

Original thread: https://forums.rpgmakerweb.com/threads/yep-damage-core-conditional-damage-formula.51384/