16 stats_result_t result = STATS_WINDOW;
20 const char* menu_options[4];
22 menu_options[0] = stats_mode_strings[STRENGTH_STR];
23 menu_options[1] = stats_mode_strings[INTELLIGENCE_STR];
24 menu_options[2] = stats_mode_strings[DEXTERITY_STR];
25 menu_options[3] = stats_mode_strings[CONSTITUTION_STR];
28 stats_mode_strings[STATS_MENU_TITLE],
36 switch (input_event.type) {
38 selected_index = (selected_index > 0) ? selected_index - 1 : MAX_STATS - 1;
41 selected_index = (selected_index + 1) % MAX_STATS;
44 if (player->skill_points > 0) {
45 switch (selected_index) {
47 raise_skill(&player->base_stats, STRENGTH, player->skill_points);
50 raise_skill(&player->base_stats, INTELLIGENCE, player->skill_points);
53 raise_skill(&player->base_stats, DEXTERITY, player->skill_points);
56 raise_skill(&player->base_stats, CONSTITUTION, player->skill_points);
60 player->skill_points--;
63 char word[MAX_STRING_LENGTH - 4];
64 snprintf(word, MAX_STRING_LENGTH - 4,
"%s: 0", stats_mode_strings[AVAILABLE_SKILL_POINTS_STR]);
void update_character_resources(resources_t *current_resources, resources_t *max_resources, stats_t *base_stats)
Updates the character's resources based on their stats.
void raise_skill(stats_t *stats, stat_type_t stat, int skillpoint)
Raises a specified skill by one point.
void draw_stats_menu(const char *title, const char **options, int option_count, int selected_index, const char *footer)
Draw the stats menu.