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; 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; }