Basically I have a state machine that controls a game character's attacks, with timings based on the animation length.
So for example:
I start at the default state, and if the player hits an attack button it starts an attack, switching the state and setting a timer based on the attacks length. The state machine gets more complex however when I consider charge attacks that can be cancelled, attacks that can move to different states depending on what they hit, and also every state has unique ways of dealing with the character being attacked. At the moment I have large switch statements. I thought about polymorphism but that would require a new class for every state for which there are a lot (starting attack, attacking and finishing attack all require separate states for example).
The switch statement works, but its quite large and also isn't as easily modified as an inheritance based system.
Any suggestions on good looking implementations?
EDIT: This is using java.