X-Git-Url: https://plomlompom.com/repos/foo.html?a=blobdiff_plain;f=plugins%2Fserver%2FPleaseTheIslandGod.py;h=7e45e15370e18051fc3bf51ad47bd9c69f85dbc0;hb=4a99efd6b0320ad9bc718b43a52b7d9981f75a17;hp=d3a5239ccac262e1bcc3719d3a93905cef6a2353;hpb=5b2e37b6247c2853a7cedaa70e0de37815365d18;p=plomrogue diff --git a/plugins/server/PleaseTheIslandGod.py b/plugins/server/PleaseTheIslandGod.py index d3a5239..7e45e15 100644 --- a/plugins/server/PleaseTheIslandGod.py +++ b/plugins/server/PleaseTheIslandGod.py @@ -85,10 +85,10 @@ def actor_pickup(t): log("CAN'T pick up object: No storage room to carry more.") def actor_pickup_test_hook(t, tid): - from server.ai import eat_vs_hunger_threshold tt = world_db["ThingTypes"][tid] return not (t != world_db["Things"][0] and (tt["TT_TOOL"] != "food" or - (tt["TT_TOOLPOWER"] <= eat_vs_hunger_threshold(t["T_TYPE"])))) + (tt["TT_TOOLPOWER"] <= + world_db["ThingTypes"][t["T_TYPE"]]["eat_vs_hunger_threshold"]))) def actor_drop(t): from server.actions import actor_drop @@ -211,7 +211,7 @@ def actor_move(t): altar_msg_wait(100) elif world_db["FAVOR_STAGE"] == 1 and world_db["GOD_FAVOR"] >= 100: world_db["FAVOR_STAGE"] = 2 - log(altar_msg_2) + log(altar_msg_1) id = id_setter(-1, "Things") world_db["Things"][id] = new_Thing(world_db["PLANT_1"], world_db["altar"]) @@ -378,10 +378,12 @@ def play_use_attempt_hook(t, tt): log("You CAN'T use a " + world_db["ThingTypes"][type]["TT_NAME"] + " without some wood in your inventory.") return False - elif (tt["TT_TOOL"] == "fertilizer" - and not world_db["MAP"][pos] == ord(".")): - log("Can only make soil out of NON-SOIL earth.") - return False + return True + elif tt["TT_TOOL"] == "fertilizer": + if not world_db["MAP"][pos] == ord("."): + log("Can only make soil out of NON-SOIL earth.") + return False + return True elif tt["TT_TOOL"] == "wood": log("To use wood, you NEED a carpentry tool.") return False @@ -540,4 +542,4 @@ server.config.make_world_helpers.world_makable = world_makable server.config.make_world_helpers.make_map = make_map import server.config.ai -server.config.ai.ai_hook_pickup = ai_hook_pickup_test +server.config.ai.ai_hook_pickup_test = ai_hook_pickup_test