Finite, Sleepy State Machines

I was asked to create a state machine for an assessment that has a few simple rules, basically creating a self-determined “creature” that had a few basic abilities. Building on the initial ruleset, I decided to develop it into an automata simulation.
The creatures have four attributes: thirst, hunger, fatigue, and boredom. They are capable of idling, walking, running, eating, drinking, sleeping, and with user interaction they can play. Clicking with the mouse will cause nearby creatures to react.
Each state has a transition pre-state that occurs before it. The color of the character will blend from a color representing his previous state to the color representing his new state.
- Initial values of the four attributes are generated randomly when the SWF is loaded.
- If no state is queued, it will idle. Idling causes its thirst, hunger, fatigue, and boredom to increase.
- If it gets too bored, it will either run or walk (50% chance).
- Walking increases all attributes except boredom, which decreases slightly. If it gets too thirsty, hungry, or tired it will switch to that action.
- Running increases all attributes except boredom, which decreases. If it drops below 50% boredom or above 100% fatigue, it will eat or sleep (50% chance).
- Playing causes all attributes to increase except boredom, which decreases significantly. It will not stop playing until the user releases the mouse button.
- Eating causes all attributes to decrease except thirst, which increases significantly. It will drink after eating.
- Drinking causes all attributes to decrease. It will idle after drinking.
- Sleeping causes fatigue and boredom to decrease, thirst and hunger increase. It will idle after sleeping.
I had to disable the real-time stats for the web version, otherwise it gets too choppy. But in a standalone player is runs nice and smooth. If you want the source code just shoot me an email.