home · contact · privacy
TCE: Eat on every wall attack, not just on successful ones.
authorChristian Heller <c.heller@plomlompom.de>
Sat, 12 Mar 2016 00:35:22 +0000 (01:35 +0100)
committerChristian Heller <c.heller@plomlompom.de>
Sat, 12 Mar 2016 00:35:22 +0000 (01:35 +0100)
plugins/server/TheCrawlingEater.py

index 52807b83019ae76ccf136a09510418c9c2c2aa40..ab88cadd54766d0e994fcb7be0f4f79d324635e7 100644 (file)
@@ -126,14 +126,10 @@ def actor_eat(t):
         height = world_db["MAP"][pos] - ord("0")
         if t["T_STOMACH"] >= 32 or height == 5:
             return
-        eaten = False
-        if height == 3 and 0 == int(rand.next() % 2):
-            t["T_STOMACH"] += height
-            eaten = True
-        elif height == 4 and 0 == int(rand.next() % 5):
-            t["T_STOMACH"] += height
-            eaten = True
+        t["T_STOMACH"] += 1
         log("You EAT.")
+        eaten = (height == 3 and 0 == int(rand.next() % 2)) or \
+                (height == 4 and 0 == int(rand.next() % 5))
         if eaten:
             world_db["MAP"][pos] = ord("0")
             if t["T_STOMACH"] > 32: