- Joined
- Jul 18, 2014
- Messages
- 222
- Reaction score
- 13
- First Language
- English
- Primarily Uses
- RMMV
Link to Yanfly's Plugin: http://yanfly.moe/2015/12/25/yep-50-buffs-states-core/
I'm trying to create a state that confuses the victim and has a chance of randomly targeting an ally or foe.
So, for example:
Roy uses a Fire Spell and selects Enemy A.
There is a 50% chance of avoiding the confusion effect.
Roy is unlucky and becomes confused.
He randomly casts the Fire Spell at Enemy A, Enemy B, Enemy C, himself, Ally B or Ally C.
Is this possible?
I know it would need to run at the action's start hence <Custom Action Start Effect>
And well, I know this piece of code which causes the user to consume the skill's resources (This can be utilized for Paralysis-based Status Ailments):
Is there something like user.currentAction(). "determine target here" ?
What I am currently thinking of trying is using:
The confusion state would obtain the current skill's ID and execute a Forced Action using that skill ID. It would randomly choose between targeting the party and or enemy troop. Then it would target a random (applicable) index.
I'm not sure if that would be efficient though.
I'd also have to include conditions for when skills with User or All scopes are used.
I'm trying to create a state that confuses the victim and has a chance of randomly targeting an ally or foe.
So, for example:
Roy uses a Fire Spell and selects Enemy A.
There is a 50% chance of avoiding the confusion effect.
Roy is unlucky and becomes confused.
He randomly casts the Fire Spell at Enemy A, Enemy B, Enemy C, himself, Ally B or Ally C.
Is this possible?
I know it would need to run at the action's start hence <Custom Action Start Effect>
Code:
<Custom Action Start Effect>
var confuseRate = 0.50;
if (Math.random() < confuseRate) {
// Insert code
}
</Custom Action Start Effect>
And well, I know this piece of code which causes the user to consume the skill's resources (This can be utilized for Paralysis-based Status Ailments):
Code:
user.useItem(user.currentAction().item());
Is there something like user.currentAction(). "determine target here" ?
What I am currently thinking of trying is using:
Code:
subject.forceAction(skillId, $gameParty.battleMembers().indexOf(X));
subject.forceAction(skillId, $gameTroop.members().indexOf(X));
The confusion state would obtain the current skill's ID and execute a Forced Action using that skill ID. It would randomly choose between targeting the party and or enemy troop. Then it would target a random (applicable) index.
I'm not sure if that would be efficient though.
I'd also have to include conditions for when skills with User or All scopes are used.