Not Another Yanfly Plugin Thread

Sorry to do this, but I've got a few questions that don't merit clogging up more of Yanflys plugin page, and they aren't really requests either. I am trying to make a skill that removes a certain STATE category (using yanfly's STATE category plugin) here is how far I got:


The skill is supposed to check if the target is using a MODE and if it is deal increased damage and then remove the MODE. If not, the skill does normal damage and goes on cooldown.


<damage formula>
value = a.atk * 2;
if (battler.isStateCategoryAffected(‘Mode’)){
value *= 5.0;
battler.removeStateCategoryAll(‘Mode’);
} else {
value *= 1;
}
</damage formula>


What happens in game is... skill is used, deals 0 damage, MODE remains.


The other question is what tags would be best to use on states to display an animation for a state when its added and when a state is leaving?


<Custom Apply Effect>
target.startAnimation(15);
</Custom Apply Effect>

<Custom Turn End Effect>
target.startAnimation(15);
</Custom Turn End Effect>


Would this work? I only want it to show when its added or removed!
<damage formula>
value = a.atk * 2;
if (target.isStateCategoryAffected(‘Mode’)){
value *= 5.0;
target.removeStateCategoryAll(‘Mode’);
// You can try adding animation here
// target.startAnimation(15);
} 
</damage formula>


Did you try exchange battler to target?


For state animation try this

Code:
<Custom Apply Effect>
target.startAnimation(15);
</Custom Apply Effect>

<Custom Remove Effect>
user.startAnimation(15);
</Custom Remove Effect>
<damage formula>
value = a.atk * 2;
if (target.isStateCategoryAffected(‘Mode’)){
value *= 5.0;
target.removeStateCategoryAll(‘Mode’);
// You can try adding animation here
// target.startAnimation(15);
} 
</damage formula>


Did you try exchange battler to target?


For state animation try this



<Custom Apply Effect>
target.startAnimation(15);
</Custom Apply Effect>

<Custom Remove Effect>
user.startAnimation(15);
</Custom Remove Effect>

Hmm, I tried this. Now it does damage when they don't have a MODE, but 0 when they do have a MODE (and it isn't removed either).
Then try exchane target with user or owner or a or b......


Other ways to do this.


Using Yanfly Skill Core not tested:


<Pre-Damage Eval>


var value = user.atk *2;


if (user.isStateCategoryAffected(‘Mode’)) {


value *= 5;


user.removeStateCategoryAll('Mode');


}


// only for test if formula is executed


target.gainHp(-value);


</Pre-Damage Eval>


It also could be done with States and Buffs by adding below code to your mode states notetag


<Custom Confirm Effect>


// If you want this make working only with x id skill


// probably must modify below line because don't know how to check skil id


// if (this.isSkill().id === 34) {


value = user.atk *2;


if (user.isStateCategoryAffected(‘Mode’)) {


value *= 5;


user.removeStateCategoryAll('Mode');


}


// }


</Custom Confirm Effect>


Those ways checking if attacker has mode state then increase power, if you want checking for blocker change user to target.

Original thread: https://forums.rpgmakerweb.com/threads/not-another-yanfly-plugin-thread.64672/