I am looking to make a skill that drains the hp of all enemies and then adds two status effects to all party members with a common event. How would the script call look to tell who already has the status so that way the status doesn't stack or reset?
Status in Battle
RPG Maker MV Supportwhy does it have to use a common event? i know you use yanfly's skill core, and that can easily be done through that as well as action sequences
Ok, but what would the code be that I would put in the notetag for the skill part for it to apply the two status effects if the spell hits?
your requirements changed. before, it was "a skill that drains the hp of all enemies and then adds two status effects to all party members". now it hitting (presumably any target) is required.
Pre-Damage Eval tags are only ran if the skill connects. If you do something like
Code:
<post-damage Eval>
user.friendsUnit().aliveMembers().forEach(member => {
if (!member.isStateAffected(x)) member.addState(x);
if (!member.isStateAffected(y)) member.addState(y);
})
</post-Damage Eval>
alternatively, if you didnt want reapplications to to not reset a state's turns, theres a state tag and a parameter specifically to do (or not do) that in the buffs and states plugin that you already use as well.
Ok. So I got that, but how do I make one of the stats only last for say 2 turns in the eval?
is your state set up to last 2 turns in the database?
The specific one that I want to last two turns for this skill is not, no. It has no time limit on it in the database.
I suggest then either making that one last a duration, or making a duplicate one with a duration and using that new one instead. You can manipulate a state's remaining turns through the notetags with battler._stateTurns[x], but it needs an autoremoval timing to have any effect
looks fine. did it not work?
It worked! Thanks for the help!
Original thread: https://forums.rpgmakerweb.com/threads/status-in-battle.166622/