%
i
Info
-3
+2
33
%
k
%
l
Log
--10
+-9
33
%
m
{
char * dsc_turn = "Turn: ";
char * dsc_hitpoints = "\nHitpoints: ";
- char * dsc_score = "\nScore: ";
- uint16_t maxl = strlen(dsc_turn) + strlen(dsc_hitpoints) + strlen(dsc_score)
- + 5 + 3 + 5; /* Max strlens of strings of numbers to use. */
+ uint16_t maxl = strlen(dsc_turn) + 5 + strlen(dsc_hitpoints) + 3;
char text[maxl + 1];
- sprintf(text, "%s%d%s%d%s%d",
- dsc_turn, world.turn,
- dsc_hitpoints, world.player_lifepoints,
- dsc_score, world.player_score);
+ sprintf(text, "%s%d%s%d",
+ dsc_turn, world.turn, dsc_hitpoints, world.player_lifepoints);
add_text_with_linebreaks(win, text);
}
uint32_t linemax = textfile_width(file);
char * read_buf = try_malloc(linemax + 1, f_name);
world.turn = read_value_from_line(read_buf, linemax, file);
- world.player_score = read_value_from_line(read_buf, linemax, file);
world.player_lifepoints = read_value_from_line(read_buf, linemax, file);
read_inventory(read_buf, linemax, file);
world.player_pos.y = read_value_from_line(read_buf, linemax, file);
char * delim; /* delimiter for multi-line blocks in config files */
struct yx_uint8 player_pos; /* coordinates of player on map */
uint16_t turn; /* world/game turn */
- uint16_t player_score; /* player's score*/
uint8_t halfdelay; /* how long to wait for getch() input in io_loop() */
uint8_t player_inventory_select; /* index of selected item in inventory */
uint8_t player_lifepoints; /* how alive the player is */
world.log = NULL; /* map_object_action.c's update_log() checks for this. */
world.seed = seed;
world.map_obj_count = 0;
- world.score = 0;
free(world.map.cells);
free_map_objects(world.map_objs);
world.last_update_turn = 0;
FILE * file = try_fopen(path_tmp, "w", f_name);
struct MapObj * player = get_player();
write_value_as_line(world.turn, file);
- write_value_as_line(world.score, file);
write_value_as_line(player->lifepoints, file);
write_inventory(player, file);
write_value_as_line(player->pos.y, file);
return;
}
update_log(" It dies.");
- if (player == hitter)
- {
- world.score = world.score + mod_hitted->lifepoints;
- }
}
}
uint16_t replay; /* Turn up to which to replay game. No replay if zero. */
uint16_t turn; /* Current game turn. */
uint16_t last_update_turn; /* Last turn the .path_out file was updated. */
- uint16_t score; /* Player's score. */
uint8_t is_verbose; /* Should server send debugging info to stdout? */
uint8_t map_obj_count; /* Counts map objects generated so far. */
};