X-Git-Url: https://plomlompom.com/repos/?a=blobdiff_plain;f=roguelike-server;h=b72b9f530b950dd8200a5f870c4c0c2f2a901cb9;hb=fc7f9132eeb72243ecea80f6eb98bdbd86562f4c;hp=21aef5a52983f3dc10e6b89270cbe8161fa2d908;hpb=af068305ede8fd8ea75a6eb42ea66c8a02bcfc49;p=plomrogue diff --git a/roguelike-server b/roguelike-server index 21aef5a..b72b9f5 100755 --- a/roguelike-server +++ b/roguelike-server @@ -1069,23 +1069,20 @@ def thingproliferation(t, prol_map): def try_healing(t): - """Grow t's HP to a 1/32 chance if < HP max, satiation > 0, and waiting. - - On success, decrease satiation score by 32. - """ + """If t's HP < max, increment them if well-nourished, maybe waiting.""" # 7DRL: Successful heals increment God's mood. - if t["T_SATIATION"] > 0 \ - and t["T_LIFEPOINTS"] < \ - world_db["ThingTypes"][t["T_TYPE"]]["TT_LIFEPOINTS"] \ - and 0 == (rand.next() % 31) \ - and t["T_COMMAND"] == [id for id in world_db["ThingActions"] - if world_db["ThingActions"][id]["TA_NAME"] == - "wait"][0]: - t["T_LIFEPOINTS"] += 1 - world_db["GOD_MOOD"] += 1 # # - t["T_SATIATION"] -= 32 - if t == world_db["Things"][0]: - strong_write(io_db["file_out"], "LOG You heal.\n") + if t["T_LIFEPOINTS"] < \ + world_db["ThingTypes"][t["T_TYPE"]]["TT_LIFEPOINTS"]: + wait_id = [id for id in world_db["ThingActions"] + if world_db["ThingActions"][id]["TA_NAME"] == "wait"][0] + wait_divider = 8 if t["T_COMMAND"] == wait_id else 1 + testval = int(abs(t["T_SATIATION"]) / wait_divider) + if (testval <= 1 or 1 == (rand.next() % testval)): + t["T_LIFEPOINTS"] += 1 + if t != world_db["Things"][0]: # # + world_db["GOD_MOOD"] += 1 # # + if t == world_db["Things"][0]: + strong_write(io_db["file_out"], "LOG You heal.\n") def hunger(t):