So, I want to do a Genshin Impact-like thing. Like, if an enemy has an "electro" status ailment, and you hit them with a "fire" skill, it deals extra damage and then removes the "electro" status. Or something like "if an enemy is frozen, deal critical damage, then remove frozen." Anyone know how to do something like this?
How do I make it so that if enemy has status effect when hit with another skill, deal more damage?
RPG Maker MZ SupportThe dealing extra damage is simple, just give the state a Trait that modifies their element rate for that element.
As for removing the state, the simple in-engine way is you make your fire attacks:
Add a State - this state has State Resist: Electro
Remove State - same state
There are other ways you can do this with plugins that execute code from inside states, but you really don't need any of that for what you described.
As for removing the state, the simple in-engine way is you make your fire attacks:
Add a State - this state has State Resist: Electro
Remove State - same state
There are other ways you can do this with plugins that execute code from inside states, but you really don't need any of that for what you described.
if (b.isStateAffected(elctro id)){b.removeState(electro id); extra damage formula} else {(normal damage formula)}
This should work for the first one as damage formula. Not sure how to do critical hits with formula though.
This should work for the first one as damage formula. Not sure how to do critical hits with formula though.
@miragewolf It's generally bad practice to put script calls like removeState() into the damage formula.
If the skill can possibly be used by enemies or by actors with the Auto Battle trait on, then when the game tests their skills to see which one is the best to use each turn, that code will execute.
So you'll see states disappearing off of opponents even when the skill isn't used or they're not attacked.
If the skill can possibly be used by enemies or by actors with the Auto Battle trait on, then when the game tests their skills to see which one is the best to use each turn, that code will execute.
So you'll see states disappearing off of opponents even when the skill isn't used or they're not attacked.
Original thread: https://forums.rpgmakerweb.com/threads/how-do-i-make-it-so-that-if-enemy-has-status-effect-when-hit-with-another-skill-deal-more-damage.171248/