Most of the existing actions are game actions (they control the player character)
so they live in actions.game. Eventually, there will be modules for different
kinds of actions that only apply to, e.g. modal UI.
Instead of counting turns, count clock ticks. A WaitAction adds 10 ticks to the
passive healing clock and a WalkAction adds 5. So, you will heal while walking
but at a slower rate.
It renders a bar of a certain width and a percentage full. Use it to render HP.
Add a new Python package called interface. The Bar class lives there. Also add a
bunch of color defintions to a module called interface.color.
- Factor a bunch of event handling into a base EventHandler class
- Rename the previous event handler MainGameEventHandler
- Add a GameOverEventHandler that only responds to Exit actions
These logs are available in the actions.tree logger. They'll print a helpful
list of actions and their results in a tree-like way.
For example:
```
2022-05-12 08:57:57 actions.tree: Processing Hero Actions
2022-05-12 08:57:57 actions.tree: |-> @[(x:4, y:6)][30/30]
2022-05-12 08:57:57 actions.tree: | |-> BumpAction toward (δx:-1, δy:1) by @[(x:4, y:6)][30/30] => success=False done=False alternate=WalkAction[@]
2022-05-12 08:57:57 actions.tree: | `-> WalkAction toward (δx:-1, δy:1) by @[(x:3, y:7)][30/30] => success=True done=True alternate=None
2022-05-12 08:57:57 actions.tree: Processing Entity Actions
2022-05-12 08:57:57 actions.tree: |-> Orc with 10/10 hp at (x:4, y:5)
2022-05-12 08:57:57 actions.tree: | |-> BumpAction toward (δx:-1, δy:1) by Orc with 10/10 hp at (x:4, y:5) => success=False done=False alternate=WalkAction[o]
2022-05-12 08:57:57 actions.tree: | `-> WalkAction toward (δx:-1, δy:1) by Orc with 10/10 hp at (x:3, y:6) => success=True done=True alternate=None
2022-05-12 08:57:57 actions.tree: |-> Orc with 10/10 hp at (x:5, y:5)
2022-05-12 08:57:57 actions.tree: | |-> BumpAction toward (δx:-1, δy:1) by Orc with 10/10 hp at (x:5, y:5) => success=False done=False alternate=WalkAction[o]
2022-05-12 08:57:57 actions.tree: | `-> WalkAction toward (δx:-1, δy:1) by Orc with 10/10 hp at (x:4, y:6) => success=True done=True alternate=None
```
- Sort entities by their Euclidean distance to the hero so actions from entities
near the hero are processed first
- Fewer local variables for cleaner reading
- Pass hero into the RegerateRoomsAction, which was causing a pylint error