home · contact · privacy
TCE: Only give GRACE capabilities to player.
[plomrogue] / plugins / server / TheCrawlingEater.py
index c9854b52c507bbc077f0ec905321067eb09de92b..9ac6c073bb6aa54de85561bf858f21c52345997d 100644 (file)
@@ -226,11 +226,12 @@ def actor_move(t):
 
 
 def test_hole(t):
-    if world_db["GRACE"] >= 32 and world_db["MAP"][t["pos"]] == ord("&"):
-        world_db["die"](t, "YOU WIN, CONGRATULATIONS.")
-        return False
-    if world_db["GRACE"] >= 24:
-        return True
+    if t == world_db["Things"][0]:
+        if world_db["GRACE"] >= 32 and world_db["MAP"][t["pos"]] == ord("&"):
+            world_db["die"](t, "YOU WIN, CONGRATULATIONS.")
+            return False
+        if world_db["GRACE"] >= 24:
+            return True
     if chr(world_db["MAP"][t["pos"]]) in "*&":
         world_db["die"](t, "You FALL in a hole, and die.")
         return False
@@ -310,8 +311,9 @@ def calc_effort(ta, t):
                                          t["T_POSY"], t["T_POSX"])
         if 1 == move_result[0]:
             pos = (move_result[1] * world_db["MAP_LENGTH"]) + move_result[2]
-            narrowness = world_db["MAP"][pos] - ord("0")
-            return 2 ** narrowness
+            if chr(world_db["MAP"][pos]) in "012":
+                narrowness = world_db["MAP"][pos] - ord("0")
+                return 2 ** narrowness
     return 1
 world_db["calc_effort"] = calc_effort