How would I do Rock Paper Scissors in battle?

I don't mean literally but I'd like to have something like this:

You can choose a strong attack. a quick attack. a parry, a spell or a guard. The enemy also chooses from one of those. Then the game compares and does something like:

Strong attack beats quick attack
quick attack beats parry
parry beats strong attack
Guard lowers damage as usual
Spells work as normal.

If you both either a strong or a quick attack they cancel each other out.

So, I figure the easiest way to do this would be something like having the attack command call a common event. I'm using Yanfly's battle engine core so I think that'll help with this.

From there I think it'd be simple to set up a choice menu. But this is as far as I've gotten.

1) How do I have the enemy's choice reflected in the common event? I figure the enemy has to choose their attack then it'd be some conditionals that check that against the player's attack. I could do a random number then set the enemies attack based on that but I don't want their attacks to be totally random. I want to have priorities so, for example, maybe a bandit uses Quick Attack more than other stuff so the player has a chance to use strategy against the enemy. So how do I check what action the enemy has chosen and use it in a conditional? I figure there must be a script for it but I don't know what it is.

2) How do I "set" the player's attack based on the conditional choice? If they choose "strong attack" how do I translate that into "the player is using the strong attack skill." There is the force action skill so I'm thinking maybe I use that and set it to last target?

This is my first game so I apologize if I'm missing something simple.
I'm making two assumptions here, since you didn't spell out your desired mechanics in detail:
  • There is only one character and one enemy fighting at a time - no "party" of battlers working together.
  • You don't simply want two attack moves (from strong attack, quick attack, and parry) that both work to be "better" against one another; you want one attack move to work and the other to be stuffed if the opponent picks a counter.
The way I'd do it is to have each skill target "The User" and simply apply a State to them that does nothing - for example, a "Chose Quick Attack" state. You can easily influence enemy behavior this way, by giving different priorities or multiple copies of the same skill in their Moveset. Then, in a Common Event that runs at the end of every single turn (have a Troop Event which calls it run on Turn 1 + 1X with Condition At End of Turn), compare the actor's state and the enemy's state.
  • For example, if the actor and enemy both have the Chose Strong Attack state, have them both use a Strong Attack on each other (Force Action).
  • If the actor chose Strong Attack and the enemy chose Quick Attack, simply have the actor use Strong Attack on the enemy (and maybe give them a 1-turn ATK buff right beforehand that wears off at the end of the turn, so it does more damage).
  • If the actor chose Strong Attack and the enemy chose Parry, simply have the enemy use a Parry Attack (perhaps dealing damage and draining HP).
  • If both chose Parry, do nothing.
  • Etc. Figure out a good result for each combination of Attack Choices.
  • For Guard, just apply the Guard state to the user before any of the other attacks are processed. Allow Quick Attack and Strong attack to still launch their attacks after their opponent Guards.
  • For Spells, you probably want to have a different state to the user for each spell, and you'll have to look through for each Spell Chosen state on both battlers, and use the Force Action in the right place if they used a spell. Again, allow Quick/Strong to still launch.
At the end of the turn (and the end of battle), be sure to clear all "Attack Chosen", "Guard Chosen", and "Spell Chosen" states from both battlers.
I should have specified. I plan to only have one character for the user. Not a party. I do plan to have more than one opponent sometimes depending on the fight. Still, your idea about states might be just what I was looking for. Would I need to do something like set enemy agility super high so they always choose their attack before things happen?

Original thread: https://forums.rpgmakerweb.com/threads/how-would-i-do-rock-paper-scissors-in-battle.112669/