Commit graph

16 commits

Author SHA1 Message Date
327cc90b2e Remove QuitAction and ActionWithActor!
Move quit event handling to the interface and flatten the Action class
hierarchy. There are no longer any actions that don't take an Actor. This has
the happy side effect of resolving some pylint errors too. :)
2023-03-11 01:11:09 -08:00
01b549bc6e Remove the RegenerateRoomsAction 2023-03-11 00:57:48 -08:00
003aedf30e Restructure event handling
Events start in the Interface. The interface gets first crack at any incoming
events. If the interface doesn't handle the event, it is given to the
engine. The engine has an EngineEventHandler that yields actions just
like the event handler prior to this change.

The interface's event handler passes events to each window in the
interface. Windows can choose to handle events however they like, and
they return a bool indicating whether the event was fully handled.
2023-03-07 21:29:28 -08:00
356e205f2c Implement viewport tracking for the MapWindow
As the player moves the hero, the MapWindow will try to keep the
hero in the middle of the view.
2023-02-12 19:47:27 -08:00
a709f3fba5 Detect when Shift is pressed and don't return a WaitAction when Shift+. is pressed 2023-02-12 14:29:45 -08:00
6c9d01771f Draw a path from the hero to the current mouse point
Add a highlight grid to Map, with locations set to True if that point should be
drawn with a "highlight" treatment.

Add the highlight graphic_dtype to all Tiles.
2023-02-10 22:37:21 -08:00
f05dfdef55 PEP8 formatter changes 2023-02-10 21:25:00 -08:00
ae1c7f5ce2 Refactor events into their own package
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.
2022-05-28 08:52:54 -07:00
d4e4684694 Show Entity under mouse cursor in a line above the hit points 2022-05-15 16:50:24 -07:00
4e585a2650 Implement passive healing 2022-05-15 16:19:03 -07:00
090272854d Add a turn count that increments after successfully handling actions for that turn 2022-05-15 13:13:12 -07:00
e5b3cbd2cd Prepare for a GameOver state
- 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
2022-05-14 23:43:04 -07:00
5b0b33782f Move handling hero actions and entity actions to the Engine 2022-05-14 23:41:43 -07:00
2b367c7bb6 Quit the game on Escape 2022-05-12 20:40:46 -07:00
ce63c825b0 Move all the logging to log.py and prefix all the log names with "erynrl" 2022-05-12 20:40:15 -07:00
f6fe9d0f09 Move the roguebasin package to erynrl 2022-05-12 09:05:27 -07:00
Renamed from roguebasin/events.py (Browse further)