From c5497ff2914508baa991445a42a7077e8944d389 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Czeka=C5=84ski?= Date: Mon, 15 Jun 2020 14:52:55 +0200 Subject: [PATCH] Add proper death message when food recognition failed --- src/game/Game.py | 3 +++ src/ui/Ui.py | 2 ++ 2 files changed, 5 insertions(+) diff --git a/src/game/Game.py b/src/game/Game.py index 8e6f46e..66f9d20 100644 --- a/src/game/Game.py +++ b/src/game/Game.py @@ -192,6 +192,7 @@ class Game: self.spritesList.draw(self.screen.pygameScreen) pygame.display.flip() self.running = False + continue # Choose target for player using decision tree if self.player.movementTarget is None: @@ -205,6 +206,7 @@ class Game: else: self.screen.ui.console.printToConsole("I was wrong") self.player.alive = False + self.player.deathReason = "Wrong food recognition" continue self.player.gotoToTarget(survivalDecisionTree.pickEntity(self.player, self.map), self.map) @@ -433,6 +435,7 @@ class Game: self.spritesList.draw(self.screen.pygameScreen) pygame.display.flip() self.running = False + continue # Choose target for player using decision tree if self.player.movementTarget is None: diff --git a/src/ui/Ui.py b/src/ui/Ui.py index 1a4a584..d5f9807 100644 --- a/src/ui/Ui.py +++ b/src/ui/Ui.py @@ -187,6 +187,8 @@ class Ui: deathReasonString = "Exhaustion" elif deathReason is StatisticNames.THIRST: deathReasonString = "Dehydration" + else: + deathReasonString = "Wrong food recognition" consoleLines.append("Death reason: " + deathReasonString)