+def command_plant0(str_int):
+ val = integer_test(str_int, 0)
+ if None != val:
+ world_db["PLANT_0"] = val
+ if world_db["WORLD_ACTIVE"] and \
+ world_db["PLANT_0"] not in world_db["ThingTypes"]:
+ world_db["WORLD_ACTIVE"] = 0
+ print("PLANT_0 matches no known ThingTypes, deactivating world.")
+
+def play_use(str_arg):
+ """Try "use" as player's T_COMMAND, int(str_arg) as T_ARGUMENT / slot."""
+ if action_exists("use"):
+ t = world_db["Things"][0]
+ if 0 == len(t["T_CARRIES"]):
+ log("You have NOTHING to use in your inventory.")
+ else:
+ val = integer_test(str_arg, 0, 255)
+ if None != val and val < len(t["T_CARRIES"]):
+ id = t["T_CARRIES"][val]
+ type = world_db["Things"][id]["T_TYPE"]
+ if type != world_db["SLIPPERS"] and not \
+ world_db["ThingTypes"][type]["TT_TOOL"] == "food":
+ log("You CAN'T consume this thing.")
+ return
+ world_db["Things"][0]["T_ARGUMENT"] = val
+ set_command("use")
+ else:
+ print("Illegal inventory index.")
+