As the title suggest, I'm tinkering around with making a battle system loosely inspired by 5e rule systems. Wondering if anyone can provide insights, or ideas on how to make my characters have Actions, and bonus actions?
For those unfamiliar, characters are able to do two things during their turns. And Action, and a bonus action. While actions cover most main things in a turn, such as attacking an enemy, or casting a spell. A bonus action are minor actions that can be done along side a main action, and might be most class specific. A rogue hiding as a bonus action, before attacking to line up a sneak attack, or fighter attacking, before raising their shield in defense. A cleric can use a weaker healing spell as a bonus action, while still being able to attack with their main action. etc etc.
What I've been considering is giving each characters two turns, and using two states, one called "Action used", and another called "Bonus action used". Each seal their respective ability types, and will last until the end of turn. What I'm having trouble with is actually giving the characters those states.
So I use the damage formula:
a.addState(32), a.atk - b.def
This does the trick, but with only one problem. It only works if the player lands the attack. If they miss, the state doesn't get added, because the damage formula doesn't go through. So how can I add a state to the character when they use an ability, regardless if that ability works or not?
For those unfamiliar, characters are able to do two things during their turns. And Action, and a bonus action. While actions cover most main things in a turn, such as attacking an enemy, or casting a spell. A bonus action are minor actions that can be done along side a main action, and might be most class specific. A rogue hiding as a bonus action, before attacking to line up a sneak attack, or fighter attacking, before raising their shield in defense. A cleric can use a weaker healing spell as a bonus action, while still being able to attack with their main action. etc etc.
What I've been considering is giving each characters two turns, and using two states, one called "Action used", and another called "Bonus action used". Each seal their respective ability types, and will last until the end of turn. What I'm having trouble with is actually giving the characters those states.
So I use the damage formula:
a.addState(32), a.atk - b.def
This does the trick, but with only one problem. It only works if the player lands the attack. If they miss, the state doesn't get added, because the damage formula doesn't go through. So how can I add a state to the character when they use an ability, regardless if that ability works or not?