Commit graph

166 commits

Author SHA1 Message Date
843aa2823f Some messing around with fonts and BDF files from long ago 2023-02-08 08:36:44 -08:00
1df7cea2ad Move map modules to their own directory 2023-02-08 08:36:00 -08:00
a4f4584ffd Enable pep8 formatting on save 2023-02-08 08:35:06 -08:00
1b37807710 Add a pep8 code style configuration file 2023-02-08 08:34:46 -08:00
90994cafd7 Import Action and ActionResult from actions submodules 2022-05-29 21:24:31 -07:00
05eb5c4ade Add some docstrings to ai.py 2022-05-28 09:02:52 -07: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
46af8863b1 Use a try/catch to check for the presence of actor/target.fighter in MeleeAction 2022-05-16 20:51:53 -07:00
99838cbd00 Convert the passive healing clock to a more granular tick mechanism
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.
2022-05-16 20:50:23 -07:00
31bec25dcf Add a docstring to engine.Configuration 2022-05-16 20:49:42 -07:00
4124d1ae4e Clean up some pylint warnings in interface/color.py 2022-05-16 20:49:28 -07:00
d5f6cbe73a Clean up some pylint warnings in messages.py
Add a module doc string
Remove an extraneous else:
2022-05-16 20:49:01 -07:00
e5485300ef Rename interface.bar.Bar -> interface.percentage_bar.PercentageBar 2022-05-16 16:47:21 -07:00
6e0112fd59 Add some documentation to the things in object.py 2022-05-16 16:40:45 -07:00
18a068cff6 Add some more basic colors and some semantic colors for the Health Bar 2022-05-16 16:40:29 -07:00
11aee12320 Add colors attribute to Bar class
This list lets you specify a set of colors that the bar should be painted with
depending on the percentage the bar is filled
2022-05-16 16:40:04 -07:00
6073454ed3 Add line 1 comment to interface/__init__.py 2022-05-16 16:39:19 -07:00
85569595a9 FIX THE COLLISION DETECTION BUG 2022-05-15 19:58:39 -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
ccd2e04d0e Doc strings in Messages module 2022-05-15 16:18:42 -07:00
8239b22157 Allow fg and bg as variable names 2022-05-15 16:03:47 -07:00
9f27899572 Print some messages when damage and death happen! 2022-05-15 13:58:37 -07:00
72cbd15fb0 Render the MessageLog and clean up the interface (lots of math errors here) 2022-05-15 13:58:26 -07:00
08ef1af4e4 Add a MessageLog that keeps a record of in-game events 2022-05-15 13:58:06 -07:00
ff6763d354 Add a unique identifier to all entities (a monotonically increasing integer) 2022-05-15 13:57:32 -07:00
8fed219af0 Add erynrl log config 2022-05-15 13:13:22 -07:00
090272854d Add a turn count that increments after successfully handling actions for that turn 2022-05-15 13:13:12 -07:00
5a9df0a322 Add my first interface element: a Bar!
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.
2022-05-15 00:12:05 -07:00
388754e5dd When the Hero dies, swap MainGameEventHandler for GameOverEventHandler 2022-05-14 23:43:38 -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
c44c4e7bc6 Move the event loop to Engine.run_event_loop() 2022-05-14 23:39:03 -07:00
bd5e1bc3c1 Rename the VS Code Workspace (again) 2022-05-13 08:18:46 -07:00
2b367c7bb6 Quit the game on Escape 2022-05-12 20:40:46 -07:00
ee915bd7c1 Add a doc string and a terminal newline 2022-05-12 20:40:40 -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
5d4e0cff3d Rename the launch config 2022-05-12 20:29:44 -07:00
f6fe9d0f09 Move the roguebasin package to erynrl 2022-05-12 09:05:27 -07:00
cc6c701c59 Move first steps scripts to their own directory 2022-05-12 09:02:53 -07:00
1244c97493 Move the VS Code workspace to LYARLFGG 2022-05-12 09:02:15 -07:00
0e917ac111 Move the ai log config to ERROR level 2022-05-12 08:59:36 -07:00
7a5f131973 Log AI for entities that are visible to the hero to the ai logger 2022-05-12 08:59:24 -07:00
95cc3034b8 Clean up unused imports in ai.py 2022-05-12 08:58:51 -07:00
da3d30872b Add logging action handling in a tree-like fashion
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
```
2022-05-12 08:56:15 -07:00
d236b827cd Move most of the basic actions logs to debug (probably just for now) 2022-05-12 08:55:22 -07:00
4084d98efd Clean up Action processing a little bit
- 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
2022-05-12 08:53:26 -07:00
70c17b6235 Condense the declaration of engine.hero; add a FIXME 2022-05-12 08:49:46 -07:00
e4f8aa5e80 Clean up the __str__ for a few Action subclasses 2022-05-12 08:48:28 -07:00
6f1d68db20 Update the logging config 2022-05-12 08:46:59 -07:00