Hello,
I am trying to find a way for a character to take less damage when substituting for another character. If there is a non-Plugin method I apologize for posting here. Otherwise, I am using Yanfly's States Core plugin.
Basically, I have an ability that adds StateID 10 to all allies and StateID 9 to the User. StateID 9 adds the Substitute flag while StateID 10 is where I place my code snippets. I want the engine to double the defense of the actor with StateID 9 ONLY when that actor is not the original target, i.e. the actor is substituting. My code is below and is setup to assume only actor 1 can apply state 9 for testing purposes.
Is this doable? Is my code anywhere close if it is?
<Custom Initiate Effect>
var defend1 = $gameActors.actor(1).param[3];
var defend2 = $gameActors.actor(1).param[3];
var defend3 = defend2 * 2;
</Custom Initiate Effect>
<Custom Select Effect>
if (target.isStateAfftected(9)){
}
else {
$gameActors.actor(1).addParam(3, defend3);
}
<Custom Select Effect>
<Custom Establish Effect>
$gameActors.actor(1).addParam(3, defend1);
</Custom Establish Effect>
I am trying to find a way for a character to take less damage when substituting for another character. If there is a non-Plugin method I apologize for posting here. Otherwise, I am using Yanfly's States Core plugin.
Basically, I have an ability that adds StateID 10 to all allies and StateID 9 to the User. StateID 9 adds the Substitute flag while StateID 10 is where I place my code snippets. I want the engine to double the defense of the actor with StateID 9 ONLY when that actor is not the original target, i.e. the actor is substituting. My code is below and is setup to assume only actor 1 can apply state 9 for testing purposes.
Is this doable? Is my code anywhere close if it is?
<Custom Initiate Effect>
var defend1 = $gameActors.actor(1).param[3];
var defend2 = $gameActors.actor(1).param[3];
var defend3 = defend2 * 2;
</Custom Initiate Effect>
<Custom Select Effect>
if (target.isStateAfftected(9)){
}
else {
$gameActors.actor(1).addParam(3, defend3);
}
<Custom Select Effect>
<Custom Establish Effect>
$gameActors.actor(1).addParam(3, defend1);
</Custom Establish Effect>