X-Git-Url: https://plomlompom.com/repos/foo.html?a=blobdiff_plain;f=plugins%2Fserver%2FTheCrawlingEater.py;h=658d57db264707c5b114d116b52354e43a1f7786;hb=d2ddcd0d031caddee2b8bf4dabcff03059f12327;hp=b1dc407898d86bb25092012585a9a023b156b6fe;hpb=8ee1a43e70d13ca23e7dd6af808d32596171d480;p=plomrogue diff --git a/plugins/server/TheCrawlingEater.py b/plugins/server/TheCrawlingEater.py index b1dc407..658d57d 100644 --- a/plugins/server/TheCrawlingEater.py +++ b/plugins/server/TheCrawlingEater.py @@ -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: @@ -281,14 +277,15 @@ def turn_over(): if t["T_BLADDER"] > 16: if 0 == (rand.next() % (33 - t["T_BLADDER"])): action_db["actor_pee"](t) - t["T_STOMACH"] -= 1 - t["T_BOWEL"] += 1 - t["T_KIDNEY"] -= 1 - t["T_BLADDER"] += 1 - if t["T_STOMACH"] == 0: - world_db["die"](t, "You DIE of hunger.") - elif t["T_KIDNEY"] == 0: - world_db["die"](t, "You DIE of dehydration.") + if 0 == world_db["TURN"] % 5: + t["T_STOMACH"] -= 1 + t["T_BOWEL"] += 1 + t["T_KIDNEY"] -= 1 + t["T_BLADDER"] += 1 + if t["T_STOMACH"] == 0: + world_db["die"](t, "You DIE of hunger.") + elif t["T_KIDNEY"] == 0: + world_db["die"](t, "You DIE of dehydration.") water = 0 positions_to_wet = [] for pos in range(world_db["MAP_LENGTH"] ** 2): @@ -418,8 +415,8 @@ commands_db["drink"] = (0, False, play_drink) commands_db["pee"] = (0, False, play_pee) commands_db["use"] = (1, False, lambda x: None) commands_db["pickup"] = (0, False, lambda: None) -commands_db["T_STOMACH"] = (1, False, setter("Thing", "T_BOWEL", 0, 255)) -commands_db["T_KIDNEY"] = (1, False, setter("Thing", "T_BLADDER", 0, 255)) +commands_db["T_STOMACH"] = (1, False, setter("Thing", "T_STOMACH", 0, 255)) +commands_db["T_KIDNEY"] = (1, False, setter("Thing", "T_KIDNEY", 0, 255)) commands_db["T_BOWEL"] = (1, False, setter("Thing", "T_BOWEL", 0, 255)) commands_db["T_BLADDER"] = (1, False, setter("Thing", "T_BLADDER", 0, 255)) commands_db["WETMAP"] = (2, False, wetmapset)