home · contact · privacy
7DRL: Add GOD_MOOD, GOD_FAVOR properties with no use so far.
authorChristian Heller <c.heller@plomlompom.de>
Tue, 10 Mar 2015 03:18:50 +0000 (04:18 +0100)
committerChristian Heller <c.heller@plomlompom.de>
Tue, 10 Mar 2015 03:18:50 +0000 (04:18 +0100)
confclient/interface_conf
roguelike-server
src/client/draw_wins.c
src/client/io.c
src/client/world.h

index 00551412cf900f5993ce227f7c2de72ad09ece23..d18336559b8ccf9a8a6089e146836fbba5e8c0bc 100644 (file)
@@ -83,7 +83,7 @@ WINDOW i
 NAME 'Info'
 BREAK 2
 WIDTH -38
-HEIGHT 1
+HEIGHT 2
 
 WINDOW l
 NAME 'Log'
@@ -95,7 +95,7 @@ WINDOW m
 NAME 'Map'
 BREAK 0
 WIDTH -38
-HEIGHT -2
+HEIGHT -3
 KEY 97 ai
 KEY 112 pick
 KEY 58 wait
index 8cd8162bd63e28954354e1d13f0d01fc5a4b09ce..ea5b40a2a29b5e96f46fe769e3de7a4cae5023ef 100755 (executable)
@@ -324,7 +324,10 @@ def try_worldstate_update():
                 type_id = world_db["Things"][id]["T_TYPE"]
                 name = world_db["ThingTypes"][type_id]["TT_NAME"]
                 inventory = inventory + name + "\n"
-        string = str(world_db["TURN"]) + "\n" + \
+        ## 7DRL additions:  GOD_MOOD, GOD_FAVOR
+        string = str(world_db["GOD_MOOD"]) + "\n" + \
+                 str(world_db["GOD_FAVOR"]) + "\n" + \
+                 str(world_db["TURN"]) + "\n" + \
                  str(world_db["Things"][0]["T_LIFEPOINTS"]) + "\n" + \
                  str(world_db["Things"][0]["T_SATIATION"]) + "\n" + \
                  inventory + "%\n" + \
@@ -926,6 +929,9 @@ def get_dir_to_target(t, filter):
             dir_to_target = 0
         return dir_to_target
 
+    def FOO():
+        libpr.dijkstra_map()
+
     dir_to_target = False
     mem_depth_c = b' '
     run_i = 9 + 1 if "s" == filter else 1
@@ -934,7 +940,7 @@ def get_dir_to_target(t, filter):
         init_score_map()
         mem_depth_c = b'9' if b' ' == mem_depth_c \
                            else bytes([mem_depth_c[0] - 1])
-        if libpr.dijkstra_map():
+        if FOO(): # libpr.dijkstra_map():
             raise RuntimeError("No score map allocated for dijkstra_map().")
         dir_to_target = get_dir_from_neighbors()
         libpr.free_score_map()
@@ -1536,6 +1542,8 @@ commands_db = {
     "SEED_MAP": (1, False, command_seedmap),
     "SEED_RANDOMNESS": (1, False, command_seedrandomness),
     "TURN": (1, False, setter(None, "TURN", 0, 65535)),
+    "GOD_MOOD": (1, False, setter(None, "GOD_MOOD", -32768, 32767)), ##
+    "GOD_FAVOR": (1, False, setter(None, "GOD_FAVOR", -32768, 32767)), ##
     "PLAYER_TYPE": (1, False, setter(None, "PLAYER_TYPE", 0)),
     "MAP_LENGTH": (1, False, command_maplength),
     "WORLD_ACTIVE": (1, False, command_worldactive),
@@ -1582,6 +1590,8 @@ world_db = {
     "SEED_MAP": 0,
     "PLAYER_TYPE": 0,
     "WORLD_ACTIVE": 0,
+    "GOD_MOOD": 0, ##
+    "GOD_FAVOR": 0, ##
     "ThingActions": {},
     "ThingTypes": {},
     "Things": {}
index 9857af522565dee13086b9deeaa3250c7065a826..ad4cc382ca6842757e095f25b6151b2d6a06ecbc 100644 (file)
@@ -427,12 +427,16 @@ extern void draw_win_info(struct Win * win)
     char * dsc_turn      = "Turn: ";
     char * dsc_hitpoints = "\nHitpoints: ";
     char * dsc_satiation = "\nSatiation: ";
-    uint16_t maxl =   strlen(dsc_turn) + 5 + strlen(dsc_hitpoints)
-                    + strlen(dsc_satiation) + 6 + 3;
+    char * dsc_godsmood  = "\nGod's mood: "; // 7DRL
+    char * dsc_godsfavor = "\nGod's favor: "; // 7DRL
+    uint16_t maxl =   strlen(dsc_turn) + 5 + strlen(dsc_hitpoints) + 3 //
+                    + strlen(dsc_satiation) + 6 + strlen(dsc_godsmood) + 6 //
+                    + strlen(dsc_godsfavor) + 6; //
     char * text = try_malloc(maxl + 1, __func__);
-    int test = sprintf(text, "%s%d%s%d%s%d", dsc_turn, world.turn, dsc_hitpoints,
-                       world.player_lifepoints, dsc_satiation,
-                       world.player_satiation);
+    int test = sprintf(text, "%s%d%s%d%s%d%s%d%s%d", dsc_turn, world.turn,
+                       dsc_hitpoints, world.player_lifepoints, dsc_satiation,
+                       world.player_satiation, dsc_godsmood, world.godsmood, //
+                       dsc_godsfavor, world.godsfavor); //
     exit_trouble(test < 0, __func__, "sprintf");
     add_text_with_linebreaks(win, text);
     free(text);
index 54b65c2b438ce73e97da7f0819678f75bd60523e..247a681c9f3a683178ef39693562b4b644824aa4 100644 (file)
@@ -184,6 +184,8 @@ static uint8_t read_worldstate()
     }
     uint32_t linemax = textfile_width(file);
     char * read_buf = try_malloc(linemax + 1, __func__);
+    world.godsmood = (int16_t) read_value_from_line(read_buf, linemax, file); //
+    world.godsfavor = (int16_t) read_value_from_line(read_buf, linemax, file); //
     world.turn = (uint16_t) read_value_from_line(read_buf, linemax, file);
     world.player_lifepoints = (uint16_t) read_value_from_line(read_buf, linemax,
                                                               file);
index 5681210ed04ec58f1c41cd851f9e48dc25f6dc5c..99ad75a1794a795fe787f72ee5c8296a186eb0a4 100644 (file)
@@ -43,6 +43,8 @@ struct World
     struct yx_uint8 look_pos; /* coordinates of look cursor */
     uint16_t turn; /* world/game turn */
     int16_t player_satiation; /* player's belly fullness */
+    int16_t godsmood; /* island god's mood */ // 7DRL
+    int16_t godsfavor; /* island god's favor to player */ // 7DRL
     uint8_t player_inventory_select; /* index of selected item in inventory */
     uint8_t player_lifepoints; /* how alive the player is */
     uint8_t winch; /* if set, SIGWINCH was registered; trigger reset_windows()*/