Minor death fix-up.
authorNeil Moore <neil@s-z.org>
Thu, 29 May 2008 05:32:04 +0000 (01:32 -0400)
committerNeil Moore <neil@s-z.org>
Thu, 29 May 2008 05:32:04 +0000 (01:32 -0400)
Switch avatars only if the current one died (not if any died).

Arrange Creature.can_breathe to make room for future checks.

creature.py
roguelike.py

index 79c9f9f..7f6bce6 100644 (file)
@@ -67,7 +67,11 @@ class Creature(thing.Thing):
         return True
 
     def can_breathe(self):
-        return not isinstance(self.location, loc.Water)
+        if isinstance(self.location, loc.Water):
+            # Check for water breathing
+            return False
+        else:
+            return True
 
     def breathe(self):
         if self.can_breathe():
index 39adb8d..5097b13 100755 (executable)
@@ -352,7 +352,7 @@ class AppUI:
                 self.message("You have lost")
                 self.more()
                 return
-            elif len(dead) > 0:
+            elif self.player in dead:
                 self.switch()