- 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")