static void skill_help(s16b skills[], int mhp, int exp, int infra) { text_out_e("Hit/Shoot/Throw: %+d/%+d/%+d\n", skills[SKILL_TO_HIT_MELEE], skills[SKILL_TO_HIT_BOW], skills[SKILL_TO_HIT_THROW]); text_out_e("Hit die: %2d XP mod: %d%%\n", mhp, exp); text_out_e("Disarm: %+3d Devices: %+3d\n", skills[SKILL_DISARM], skills[SKILL_DEVICE]); text_out_e("Save: %+3d Stealth: %+3d\n", skills[SKILL_SAVE], skills[SKILL_STEALTH]); if (infra >= 0) text_out_e("Infravision: %d ft\n", infra * 10); text_out_e("Digging: %+d\n", skills[SKILL_DIGGING]); text_out_e("Search: %+d/%d", skills[SKILL_SEARCH], skills[SKILL_SEARCH_FREQUENCY]); if (infra < 0) text_out_e("\n"); }
static void class_help(int i, void *db, const region *l) { int j; size_t k; struct player_class *c = player_id2class(i); int len = (A_MAX + 1) / 2; int n_flags = 0; int flag_space = 5; if (!c) return; /* Output to the screen */ text_out_hook = text_out_to_screen; /* Indent output */ text_out_indent = CLASS_AUX_COL; Term_gotoxy(CLASS_AUX_COL, TABLE_ROW); for (j = 0; j < len; j++) { const char *name1 = stat_names_reduced[j]; const char *name2 = stat_names_reduced[j + len]; int adj1 = c->c_adj[j]; int adj2 = c->c_adj[j + len]; text_out_e("%s%+3d %s%+3d\n", name1, adj1, name2, adj2); } text_out_e("\n"); skill_help(c->c_skills, c->c_mhp, c->c_exp, -1); if (c->spell_book == TV_MAGIC_BOOK) { text_out_e("\nLearns arcane magic"); } else if (c->spell_book == TV_PRAYER_BOOK) { text_out_e("\nLearns divine magic"); } for (k = 0; k < PF_MAX; k++) { const char *s; if (n_flags >= flag_space) break; if (!pf_has(c->pflags, k)) continue; s = get_pflag_desc(k); if (!s) continue; text_out_e("\n%s", s); n_flags++; } while(n_flags < flag_space) { text_out_e("\n"); n_flags++; } /* Reset text_out() indentation */ text_out_indent = 0; }
static void race_help(int i, void *db, const region *l) { int j; size_t k; struct player_race *r = player_id2race(i); int len = (A_MAX + 1) / 2; int n_flags = 0; int flag_space = 3; if (!r) return; /* Output to the screen */ text_out_hook = text_out_to_screen; /* Indent output */ text_out_indent = RACE_AUX_COL; Term_gotoxy(RACE_AUX_COL, TABLE_ROW); for (j = 0; j < len; j++) { const char *name1 = stat_names_reduced[j]; const char *name2 = stat_names_reduced[j + len]; int adj1 = r->r_adj[j]; int adj2 = r->r_adj[j + len]; text_out_e("%s%+3d %s%+3d\n", name1, adj1, name2, adj2); } text_out_e("\n"); skill_help(r->r_skills, r->r_mhp, r->r_exp, r->infra); text_out_e("\n"); for (k = 0; k < OF_MAX; k++) { if (n_flags >= flag_space) break; if (!of_has(r->flags, k)) continue; text_out_e("\n%s", get_flag_desc(k)); n_flags++; } for (k = 0; k < PF_MAX; k++) { if (n_flags >= flag_space) break; if (!pf_has(r->pflags, k)) continue; text_out_e("\n%s", get_pflag_desc(k)); n_flags++; } while(n_flags < flag_space) { text_out_e("\n"); n_flags++; } /* Reset text_out() indentation */ text_out_indent = 0; }
static void class_help(int i, void *db, const region *l) { int j; /* Output to the screen */ text_out_hook = text_out_to_screen; /* Indent output */ text_out_indent = CLASS_AUX_COL; Term_gotoxy(CLASS_AUX_COL, TABLE_ROW); for (j = 0; j < A_MAX; j++) { text_out_e("%s%+d%+8d%+8d\n", stat_names_reduced[j], p_info[p_ptr->prace].r_adj[j], c_info[i].c_adj[j], (p_info[p_ptr->prace].r_adj[j] + c_info[i].c_adj[j])); } text_out_e("Hit die: %6d%8d\n", c_info[i].c_mhp, p_info[p_ptr->prace].r_mhp + c_info[i].c_mhp); text_out_e("Experience: %3d%%%7d%%", c_info[i].c_exp, + (p_info[p_ptr->prace].r_exp + c_info[i].c_exp)); /* Reset text_out() indentation */ text_out_indent = 0; }
static void race_help(int i, void *db, const region *l) { int j; /* Output to the screen */ text_out_hook = text_out_to_screen; /* Indent output */ text_out_indent = RACE_AUX_COL; Term_gotoxy(RACE_AUX_COL, TABLE_ROW); for (j = 0; j < A_MAX; j++) { text_out_e("%s%+d\n", stat_names_reduced[j], p_info[i].r_adj[j]); } text_out_e("Hit die: %d\n", p_info[i].r_mhp); text_out_e("Experience: %d%%\n", p_info[i].r_exp); text_out_e("Infravision: %d ft", p_info[i].infra * 10); /* Reset text_out() indentation */ text_out_indent = 0; }
/* Show the birth instructions on an otherwise blank screen */ static void print_menu_instructions(void) { /* Clear screen */ Term_clear(); /* Output to the screen */ text_out_hook = text_out_to_screen; /* Indent output */ text_out_indent = QUESTION_COL; Term_gotoxy(QUESTION_COL, HEADER_ROW); /* Display some helpful information */ text_out_e(BIRTH_MENU_HELPTEXT); /* Reset text_out() indentation */ text_out_indent = 0; }
static void skill_help(const int r_skills[], const int c_skills[], int mhp, int exp, int infra) { s16b skills[SKILL_MAX]; unsigned i; for (i = 0; i < SKILL_MAX ; ++i) skills[i] = (r_skills ? r_skills[i] : 0 ) + (c_skills ? c_skills[i] : 0); text_out_e("Hit/Shoot/Throw: %+d/%+d/%+d\n", skills[SKILL_TO_HIT_MELEE], skills[SKILL_TO_HIT_BOW], skills[SKILL_TO_HIT_THROW]); text_out_e("Hit die: %2d XP mod: %d%%\n", mhp, exp); text_out_e("Disarm: %+3d Devices: %+3d\n", skills[SKILL_DISARM], skills[SKILL_DEVICE]); text_out_e("Save: %+3d Stealth: %+3d\n", skills[SKILL_SAVE], skills[SKILL_STEALTH]); if (infra >= 0) text_out_e("Infravision: %d ft\n", infra * 10); text_out_e("Digging: %+d\n", skills[SKILL_DIGGING]); text_out_e("Search: %+d/%d", skills[SKILL_SEARCH], skills[SKILL_SEARCH_FREQUENCY]); if (infra < 0) text_out_e("\n"); }
/** * Display list of ego items to be ignored. */ static void ego_menu(const char *unused, int also_unused) { int max_num = 0; struct ego_item *ego; struct ego_desc *choice; struct menu menu; menu_iter menu_f = { 0, 0, ego_display, ego_action, 0 }; region area = { 1, 5, -1, -1 }; int cursor = 0; int i; /* Create the array */ choice = mem_zalloc(z_info->e_max * ITYPE_MAX * sizeof(struct ego_desc)); /* Get the valid ego-items */ for (i = 0; i < z_info->e_max; i++) { int itype; ego = &e_info[i]; /* Only valid known ego-items allowed */ if (!ego->name || !ego->everseen) continue; /* Find appropriate ignore types */ for (itype = ITYPE_NONE + 1; itype < ITYPE_MAX; itype++) if (ego_has_ignore_type(ego, itype)) { /* Fill in the details */ choice[max_num].e_idx = i; choice[max_num].itype = itype; choice[max_num].short_name = strip_ego_name(ego->name); ++max_num; } } /* Quickly sort the array by ego-item name */ qsort(choice, max_num, sizeof(choice[0]), ego_comp_func); /* Return here if there are no objects */ if (!max_num) { mem_free(choice); return; } /* Save the screen and clear it */ screen_save(); clear_from(0); /* Help text */ prt("Ego item ignore menu", 0, 0); /* Output to the screen */ text_out_hook = text_out_to_screen; /* Indent output */ text_out_indent = 1; text_out_wrap = 79; Term_gotoxy(1, 1); /* Display some helpful information */ text_out_e(EGO_MENU_HELPTEXT); text_out_indent = 0; /* Set up the menu */ memset(&menu, 0, sizeof(menu)); menu_init(&menu, MN_SKIN_SCROLL, &menu_f); menu_setpriv(&menu, max_num, choice); menu_layout(&menu, &area); /* Select an entry */ (void) menu_select(&menu, cursor, false); /* Free memory */ mem_free(choice); /* Load screen */ screen_load(); return; }
/** * Display list of ego items to be ignored. */ static void ego_menu(const char *unused, int also_unused) { int max_num = 0; ego_item_type *ego; ego_desc *choice; struct ego_poss_item *poss; struct menu menu; menu_iter menu_f = { 0, 0, ego_display, ego_action, 0 }; region area = { 1, 5, -1, -1 }; int cursor = 0; int i; /* Create the array */ choice = mem_zalloc(z_info->e_max * sizeof(ego_desc)); /* Get the valid ego-items */ for (i = 0; i < z_info->e_max; i++) { int itype, tval; int tval_table[TV_MAX] = { 0 }; ego = &e_info[i]; /* Only valid known ego-items allowed */ if (!ego->name || !ego->everseen) continue; /* Note the tvals which are possible for this ego */ for (poss = ego->poss_items; poss; poss = poss->next) { object_kind *kind = &k_info[poss->kidx]; tval_table[kind->tval]++; } /* Find appropriate ignore types */ for (itype = ITYPE_NONE; itype < ITYPE_MAX; itype++) for (tval = 1; tval < TV_MAX; tval++) { /* Skip invalid types */ if (!tval_table[tval]) continue; if (tval_has_ignore_type(tval, itype)) { /* Fill in the details */ choice[max_num].e_idx = i; choice[max_num].itype = itype; choice[max_num].short_name = strip_ego_name(ego->name); ++max_num; /* Done with this tval */ break; } } } /* Quickly sort the array by ego-item name */ qsort(choice, max_num, sizeof(choice[0]), ego_comp_func); /* Return here if there are no objects */ if (!max_num) { mem_free(choice); return; } /* Save the screen and clear it */ screen_save(); clear_from(0); /* Help text */ prt("Ego item ignore menu", 0, 0); /* Output to the screen */ text_out_hook = text_out_to_screen; /* Indent output */ text_out_indent = 1; text_out_wrap = 79; Term_gotoxy(1, 1); /* Display some helpful information */ text_out_e(EGO_MENU_HELPTEXT); text_out_indent = 0; /* Set up the menu */ memset(&menu, 0, sizeof(menu)); menu_init(&menu, MN_SKIN_SCROLL, &menu_f); menu_setpriv(&menu, max_num, choice); menu_layout(&menu, &area); /* Select an entry */ (void) menu_select(&menu, cursor, FALSE); /* Free memory */ mem_free(choice); /* Load screen */ screen_load(); return; }
static void class_help(int i, void *db, const region *l) { int j; size_t k; struct player_class *c = player_id2class(i); const struct player_race *r = player->race; int len = (STAT_MAX + 1) / 2; int n_flags = 0; int flag_space = 5; if (!c) return; /* Output to the screen */ text_out_hook = text_out_to_screen; /* Indent output */ text_out_indent = CLASS_AUX_COL; Term_gotoxy(CLASS_AUX_COL, TABLE_ROW); for (j = 0; j < len; j++) { const char *name = stat_names_reduced[j]; int adj = c->c_adj[j] + r->r_adj[j]; text_out_e("%s%+3d", name, adj); if (j*2 + 1 < STAT_MAX) { name = stat_names_reduced[j + len]; adj = c->c_adj[j + len] + r->r_adj[j + len]; text_out_e(" %s%+3d", name, adj); } text_out("\n"); } text_out_e("\n"); skill_help(r->r_skills, c->c_skills, r->r_mhp + c->c_mhp, r->r_exp + c->c_exp, -1); if (c->magic.spell_realm->index != REALM_NONE) text_out_e("\nLearns %s magic", c->magic.spell_realm->adjective); for (k = 0; k < PF_MAX; k++) { const char *s; if (n_flags >= flag_space) break; if (!pf_has(c->pflags, k)) continue; s = get_pflag_desc(k); if (!s) continue; text_out_e("\n%s", s); n_flags++; } while(n_flags < flag_space) { text_out_e("\n"); n_flags++; } /* Reset text_out() indentation */ text_out_indent = 0; }