From: Christian Heller <c.heller@plomlompom.de>
Date: Wed, 9 Mar 2016 22:21:51 +0000 (+0100)
Subject: TCE: Add limit to drinking.
X-Git-Tag: tce~56
X-Git-Url: https://plomlompom.com/repos/%7B%7Bdb.prefix%7D%7D/%7B%7B%20web_path%20%7D%7D/static/reset_cookie?a=commitdiff_plain;h=d9b6e12b2f12f22e723fddcafc77126e17c08801;p=plomrogue

TCE: Add limit to drinking.
---

diff --git a/plugins/server/TheCrawlingEater.py b/plugins/server/TheCrawlingEater.py
index 4e8a3f8..1fc7e0c 100644
--- a/plugins/server/TheCrawlingEater.py
+++ b/plugins/server/TheCrawlingEater.py
@@ -11,11 +11,15 @@ def play_drink():
         if ord("~") != world_db["MAP"][world_db["Things"][0]["pos"]]:
             log("NOTHING to drink here.")
             return
+        elif world_db["Things"][0]["T_BLADDER"] >= 32:
+            log("You're too FULL to drink more.")
+            return
         world_db["set_command"]("drink")
 
 
 def actor_drink(t):
-    if ord("~") == world_db["MAP"][world_db["Things"][0]["pos"]]:
+    if ord("~") == world_db["MAP"][world_db["Things"][0]["pos"]] and \
+            t["T_BLADDER"] < 32:
         log("You DRINK.")
         t["T_BLADDER"] += 1