From: Christian Heller Date: Fri, 11 Mar 2016 21:12:07 +0000 (+0100) Subject: TCE: Refactor eating. X-Git-Tag: tce~47 X-Git-Url: https://plomlompom.com/repos/%7B%7Bprefix%7D%7D/static/%7B%7Bdb.prefix%7D%7D/task?a=commitdiff_plain;h=d747fe02a4c5f8b31a08078ff78da22c0b2274b2;p=plomrogue TCE: Refactor eating. --- diff --git a/plugins/server/TheCrawlingEater.py b/plugins/server/TheCrawlingEater.py index d9b827b..cf6f204 100644 --- a/plugins/server/TheCrawlingEater.py +++ b/plugins/server/TheCrawlingEater.py @@ -129,14 +129,15 @@ def actor_move(t): t["pos"] = move_result[1] * world_db["MAP_LENGTH"] + move_result[2] build_fov_map(t) else: - if t["T_BOWEL"] >= 32 or chr(world_db["MAP"][pos]) == "5": + height = world_db["MAP"][pos] - ord("0") + if t["T_BOWEL"] >= 32 or height == 5: return eaten = False - if chr(world_db["MAP"][pos]) == "3" and 0 == int(rand.next() % 2): - t["T_BOWEL"] += 3 + if height == 3 and 0 == int(rand.next() % 2): + t["T_BOWEL"] += height eaten = True - elif chr(world_db["MAP"][pos]) == "4" and 0 == int(rand.next() % 5): - t["T_BOWEL"] += 4 + elif height == 4 and 0 == int(rand.next() % 5): + t["T_BOWEL"] += height eaten = True log("You EAT.") if eaten: