Add a turn count that increments after successfully handling actions for that turn

This commit is contained in:
Eryn Wells 2022-05-15 13:13:12 -07:00
parent 5a9df0a322
commit 090272854d
2 changed files with 50 additions and 13 deletions

View file

@ -42,14 +42,7 @@ class EventHandler(tcod.event.EventDispatch[Action]):
log.EVENTS.debug('Unhandled event: %s', event)
return
result = self.engine.process_hero_action(action)
# Player's action failed, don't proceed with turn.
if not result.success and result.done:
return
self.engine.process_entity_actions()
self.engine.update_field_of_view()
self.engine.process_input_action(action)
def ev_quit(self, event: tcod.event.Quit) -> Optional[Action]:
return ExitAction(self.engine.hero)