home · contact · privacy
7DRL: New tool: fertilizer.
authorChristian Heller <c.heller@plomlompom.de>
Sun, 15 Mar 2015 18:51:54 +0000 (19:51 +0100)
committerChristian Heller <c.heller@plomlompom.de>
Sun, 15 Mar 2015 18:51:54 +0000 (19:51 +0100)
confserver/world
roguelike-server
src/client/draw_wins.c
test_server.sh

index bab3d5a78b61fb3f8362e85abfd69f83ad86ea82..898ccc6de89211263ebd1e22c475be581e8715b0 100644 (file)
@@ -48,7 +48,7 @@ TT_STORAGE 1
 TT_PROLIFERATE 512
 
 TT_ID 3
-TT_START_NUMBER 2
+TT_START_NUMBER 3
 TT_LIFEPOINTS 54
 TT_SYMBOL B
 TT_NAME BEAR
@@ -78,13 +78,20 @@ TT_TOOLPOWER 5000
 TT_START_NUMBER 0
 
 TT_ID 7
+TT_TOOL fertilizer
+TT_SYMBOL [
+TT_NAME 'FERTILIZER'
+TT_START_NUMBER 0
+TT_TOOLPOWER 5000
+
+TT_ID 8
 TT_TOOL wood
 TT_START_NUMBER 0
 TT_SYMBOL =
 TT_NAME WOOD
 
-TT_ID 8
-TT_START_NUMBER 2
+TT_ID 9
+TT_START_NUMBER 0
 TT_LIFEPOINTS 0
 TT_SYMBOL $
 TT_NAME 'BEAR CORPSE'
@@ -92,7 +99,7 @@ TT_TOOLPOWER 4000
 TT_PROLIFERATE 4096
 TT_TOOL food
 
-TT_ID 9
+TT_ID 10
 TT_START_NUMBER 0
 TT_LIFEPOINTS 0
 TT_SYMBOL %
@@ -100,7 +107,7 @@ TT_NAME 'HUMAN CORPSE'
 TT_TOOLPOWER 2500
 TT_TOOL food
 
-TT_ID 10
+TT_ID 11
 TT_START_NUMBER 0
 TT_LIFEPOINTS 0
 TT_SYMBOL &
@@ -108,7 +115,7 @@ TT_NAME 'DOG CORPSE'
 TT_TOOLPOWER 1500
 TT_TOOL food
 
-TT_ID 11
+TT_ID 12
 TT_START_NUMBER 0
 TT_LIFEPOINTS 0
 TT_SYMBOL (
@@ -117,7 +124,7 @@ TT_TOOLPOWER 512
 TT_PROLIFERATE 192
 TT_TOOL food
 
-TT_ID 12
+TT_ID 13
 TT_START_NUMBER 0
 TT_LIFEPOINTS 0
 TT_SYMBOL ;
@@ -125,7 +132,7 @@ TT_NAME 'BUG CORPSE'
 TT_TOOLPOWER 512
 TT_TOOL food
 
-TT_ID 13
+TT_ID 14
 TT_START_NUMBER 64
 TT_LIFEPOINTS 0
 TT_SYMBOL '#'
@@ -134,7 +141,7 @@ TT_TOOLPOWER 128
 TT_PROLIFERATE 32
 TT_TOOL food
 
-TT_ID 14
+TT_ID 15
 TT_START_NUMBER 3
 TT_LIFEPOINTS 0
 TT_SYMBOL *
@@ -153,7 +160,8 @@ TT_CORPSE_ID 8
 
 FAVOR_STAGE 0
 SLIPPERS 4
-PLANT_0 14
-PLANT_1 11
-LUMBER 7
+PLANT_0 15
+PLANT_1 12
+LUMBER 8
 TOOL_0 6
+TOOL_1 7
index 8cd7bb1bf97cf0a1ca638669c2bbca22421e5ca4..a88cfc066f5649c0ded02fe9a91a798e43c0392d 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]
@@ -2060,6 +2066,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 +2122,7 @@ world_db = {
     "PLANT_1": 0,  # #
     "LUMBER": 0,  # #
     "TOOL_0": 0,  # #
+    "TOOL_1": 0,  # #
     "EMPATHY": 1,  # #
     "ThingActions": {},
     "ThingTypes": {},
@@ -2123,7 +2131,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",
index 6555193a7c0de35b323093a3b33574bf7cf6f27a..d40574dcd9a2ff936646128ced36abd61dbc602c 100644 (file)
@@ -481,7 +481,7 @@ extern void draw_win_map(struct Win * win)
                 { //
                     a = col_corpse; //
                 } //
-                else if ('/' == c || ']' == c) //
+                else if ('/' == c || ']' == c || '[' == c) //
                 { //
                     a = col_tool; //
                 } //
index 94b360dc4edda86e91b53252940f0d9c3e759b61..389e39ec6dbd9f51cad37e7c1e48e93cf054c9e4 100755 (executable)
@@ -27,5 +27,6 @@ echo "Server has quit. Here's the diff of final '_test' to reference save file"
 echo "./testing/ref_end (TEST WENT WELL IF NO LINES FOLLOW):"
 mv _test testing/last_end
 diff testing/last_end testing/ref_end
+#echo 'NODIFF'
 
 rm record__test