home · contact · privacy
Remove AI debugging logs.
[plomrogue] / roguelike-server
index 8cd7bb1bf97cf0a1ca638669c2bbca22421e5ca4..9ecfc92b81347175682716f3f111e6fe41e68d0c 100755 (executable)
@@ -1022,6 +1022,12 @@ def actor_use(t):
                 log("You can't use a "  # #
                     + world_db["ThingTypes"][type_tool]["TT_NAME"]  # #
                     + " without some wood in your inventory.")  # #
+        elif world_db["ThingTypes"][type]["TT_TOOL"] == "fertilizer":  # #
+            pos = t["T_POSY"] * world_db["MAP_LENGTH"] + t["T_POSX"]
+            if world_db["MAP"][pos] == ord("."):
+                world_db["MAP"][pos] = ord(":")
+            else:
+                log("Can only fertilize on unfertilized earth.")
         elif world_db["ThingTypes"][type]["TT_TOOL"] == "food":
             t["T_CARRIES"].remove(id)
             del world_db["Things"][id]
@@ -1368,42 +1374,34 @@ def ai(t):
     """Determine next command/argment for actor t via AI algorithms."""
     # 7DRL add: Don't pick up or search things when inventory is full.
     if t == world_db["Things"][0]:
-        log("%AI------")
     t["T_COMMAND"] = [id for id in world_db["ThingActions"]
                       if world_db["ThingActions"][id]["TA_NAME"] == "wait"][0]
     if get_dir_to_target(t, "f"):
         if t == world_db["Things"][0]:
-            log("%FLEE")
         return
     sel = get_inventory_slot_to_consume(t)
     if -1 != sel:
         if t == world_db["Things"][0]:
-            log("%EAT")
         t["T_COMMAND"] = [id for id in world_db["ThingActions"]
                           if world_db["ThingActions"][id]["TA_NAME"]
                              == "use"][0]
         t["T_ARGUMENT"] = sel
     elif standing_on_food(t):
         if t == world_db["Things"][0]:
-            log("%STANDINGON")
         if  (len(t["T_CARRIES"]) <  # #
              world_db["ThingTypes"][t["T_TYPE"]]["TT_STORAGE"]):  # #
             if t == world_db["Things"][0]:
-                log("%(pickingup)")
             t["T_COMMAND"] = [id for id in world_db["ThingActions"]
                                  if world_db["ThingActions"][id]["TA_NAME"]
                                  == "pick_up"][0]
     else:
         if t == world_db["Things"][0]:
-            log("%AIMING_FOR_FOOD")
         going_to_known_food_spot = get_dir_to_target(t, "c")
         if not going_to_known_food_spot:
             if t == world_db["Things"][0]:
-                log("%AIMING_FOR_WALKING_FOOD")
             aiming_for_walking_food = get_dir_to_target(t, "a")
             if not aiming_for_walking_food:
                 if t == world_db["Things"][0]:
-                    log("%SEARCHING")
                 get_dir_to_target(t, "s")
 
 
@@ -2060,6 +2058,7 @@ commands_db = {
     "PLANT_1": (1, False, specialtypesetter("PLANT_1")),  # #
     "LUMBER": (1, False, specialtypesetter("LUMBER")),  # #
     "TOOL_0": (1, False, specialtypesetter("TOOL_0")),  # #
+    "TOOL_1": (1, False, specialtypesetter("TOOL_1")),  # #
     "EMPATHY": (1, False, setter(None, "EMPATHY", 0, 1)),  # #
     "TA_ID": (1, False, command_taid),
     "TA_EFFORT": (1, False, setter("ThingAction", "TA_EFFORT", 0, 255)),
@@ -2115,6 +2114,7 @@ world_db = {
     "PLANT_1": 0,  # #
     "LUMBER": 0,  # #
     "TOOL_0": 0,  # #
+    "TOOL_1": 0,  # #
     "EMPATHY": 1,  # #
     "ThingActions": {},
     "ThingTypes": {},
@@ -2123,7 +2123,7 @@ world_db = {
 
 # 7DRL-specific!
 """Special type settings."""
-specials = ["SLIPPERS", "PLANT_0", "PLANT_1", "LUMBER", "TOOL_0"]  # #
+specials = ["SLIPPERS", "PLANT_0", "PLANT_1", "LUMBER", "TOOL_0", "TOOL_1"]  # #
 
 """Mapping of direction names to internal direction chars."""
 directions_db = {"east": "d", "south-east": "c", "south-west": "x",