home · contact · privacy
TCE: Add limit to drinking.
authorChristian Heller <c.heller@plomlompom.de>
Wed, 9 Mar 2016 22:21:51 +0000 (23:21 +0100)
committerChristian Heller <c.heller@plomlompom.de>
Wed, 9 Mar 2016 22:21:51 +0000 (23:21 +0100)
plugins/server/TheCrawlingEater.py

index 4e8a3f8ad0e0d36dce8a4c9189440d22beec366f..1fc7e0c5737cd0e7cb38b0827388812e9850ff07 100644 (file)
@@ -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