X-Git-Url: https://plomlompom.com/repos/%7B%7B%20web_path%20%7D%7D/decks/%7B%7Bdeck_id%7D%7D/cards/%7B%7Bcard_id%7D%7D/form?a=blobdiff_plain;f=roguelike-server;h=41506c0800e22f2e115d4a86c3d5936188ddba3c;hb=fd9a37455ebccd94d981be866223b2a203a817df;hp=311a62b994857374134684a413f6fc2947e30850;hpb=a31f16b08b3d4b17f558388dc22f6bd39c975cfb;p=plomrogue diff --git a/roguelike-server b/roguelike-server index 311a62b..41506c0 100755 --- a/roguelike-server +++ b/roguelike-server @@ -1092,13 +1092,17 @@ def hunger(t): """Decrement t's satiation,dependent on it trigger lifepoint dec chance.""" if t["T_SATIATION"] > -32768: t["T_SATIATION"] -= 1 - testbase = t["T_SATIATION"] if t["T_SATIATION"] >= 0 else -t["T_SATIATION"] if not world_db["ThingTypes"][t["T_TYPE"]]["TT_LIFEPOINTS"]: raise RuntimeError("A thing that should not hunger is hungering.") stomach = int(32767 / world_db["ThingTypes"][t["T_TYPE"]]["TT_LIFEPOINTS"]) - if int(int(testbase / stomach) / ((rand.next() % stomach) + 1)): + if int(int(abs(t["T_SATIATION"]) / stomach) + / ((rand.next() % stomach) + 1)): if t == world_db["Things"][0]: - strong_write(io_db["file_out"], "LOG You suffer from hunger.\n") + if t["T_SATIATION"] < 0: + strong_write(io_db["file_out"], "LOG You suffer from hunger.\n") + else: + strong_write(io_db["file_out"], + "LOG You suffer from over-eating.\n") decrement_lifepoints(t)