06-15-2017, 10:47 AM
I'm assuming this is following the traditional RPG battle system in which case this is how I'd do it.
Enemy actions are decided semi-randomly each turn, different enemies have different weights for each action (e.g. some may only attack, some may increase defense very often, etc). Weights may change dynamically for some enemies as a form of AI, making some actions more or less likely depending on certain conditions (e.g. if the player is at low health, an enemy may be more likely to attack).
For attack order, you'd just have a list of all characters in the battle every round, and order them by speed stat. Once you've gone through the list a new round starts and the list might change order, since speed can change during battle.
Enemy actions are decided semi-randomly each turn, different enemies have different weights for each action (e.g. some may only attack, some may increase defense very often, etc). Weights may change dynamically for some enemies as a form of AI, making some actions more or less likely depending on certain conditions (e.g. if the player is at low health, an enemy may be more likely to attack).
For attack order, you'd just have a list of all characters in the battle every round, and order them by speed stat. Once you've gone through the list a new round starts and the list might change order, since speed can change during battle.