First pass on the logs

The newly-added logs manage a list of messages. Entities do register a
message to it when hitting each other. Display is created, but not yet
added to the layout actually displayed.
This commit is contained in:
Nicolas Margulies
2020-11-19 12:03:05 +01:00
parent 9b00863891
commit 6e71146aa2
6 changed files with 54 additions and 7 deletions

View File

@ -70,7 +70,7 @@ class Player(FightingEntity):
for entity in self.map.entities:
if entity.y == y and entity.x == x:
if entity.is_fighting_entity():
self.hit(entity)
self.map.logs.add_message(self.hit(entity))
if entity.dead:
self.add_xp(randint(3, 7))
return True