Angband
|
character screens and dumps More...
#include "angband.h"
#include "buildid.h"
#include "game-world.h"
#include "init.h"
#include "obj-curse.h"
#include "obj-desc.h"
#include "obj-gear.h"
#include "obj-info.h"
#include "obj-knowledge.h"
#include "obj-util.h"
#include "player.h"
#include "player-calcs.h"
#include "player-timed.h"
#include "player-util.h"
#include "store.h"
#include "ui-display.h"
#include "ui-history.h"
#include "ui-input.h"
#include "ui-menu.h"
#include "ui-object.h"
#include "ui-output.h"
#include "ui-player.h"
Data Structures | |
struct | panel_line |
Panel utilitiesMore... | |
struct | panel |
Panel holder type. More... | |
struct | player_flag_record |
Macros | |
#define | RES_ROWS 9 |
List of resistances and abilities to display. More... | |
#define | BOUND(x, min, max) MIN(max, MAX(min, x)) |
#define | INFO_SCREENS 2 /* Number of screens in character info mode */ |
Functions | |
static struct panel * | panel_allocate (int n) |
Allocate some panel lines. More... | |
static void | panel_free (struct panel *p) |
Free up panel lines. More... | |
static void | panel_line (struct panel *p, byte attr, const char *label, const char *fmt,...) |
Add a new line to the panel. More... | |
static void | panel_space (struct panel *p) |
Add a spacer line in a panel. More... | |
static const char * | likert (int x, int y, byte *attr) |
Returns a "rating" of x depending on y, and sets "attr" to the corresponding "attribute". More... | |
static void | display_player_equippy (int y, int x) |
Equippy chars. More... | |
static void | display_resistance_panel (const struct player_flag_record *rec, size_t size, const region *bounds) |
static void | display_player_flag_info (void) |
void | display_player_stat_info (void) |
Special display, part 2b. More... | |
static void | display_player_sust_info (void) |
Special display, part 2c. More... | |
static void | display_panel (const struct panel *p, bool left_adj, const region *bounds) |
static const char * | show_title (void) |
static const char * | show_adv_exp (void) |
static const char * | show_depth (void) |
static const char * | show_speed (void) |
static byte | max_color (int val, int max) |
static struct panel * | get_panel_topleft (void) |
static struct panel * | get_panel_midleft (void) |
static struct panel * | get_panel_combat (void) |
static struct panel * | get_panel_skills (void) |
static struct panel * | get_panel_misc (void) |
void | display_player_xtra_info (void) |
void | display_player (int mode) |
Display the character on the screen (two different modes) More... | |
void | write_character_dump (ang_file *fff) |
Write a character dump. More... | |
bool | dump_save (const char *path) |
Save the lore to a file in the user directory. More... | |
void | do_cmd_change_name (void) |
Hack – change name. More... | |
Variables | |
static const struct player_flag_record | player_flag_table [RES_ROWS *4] |
static const byte | colour_table [] |
Colours for table items. More... | |
struct { | |
region bounds | |
bool align_left | |
struct panel *(* panel )(void) | |
} | panels [] |
Panels for main character screen. More... | |
character screens and dumps
Copyright (c) 1997 Ben Harrison, James E. Wilson, Robert A. Koeneke
This work is free software; you can redistribute it and/or modify it under the terms of either:
a) the GNU General Public License as published by the Free Software Foundation, version 2, or
b) the "Angband licence": This software may be copied and distributed for educational, research, and not for profit purposes provided that this copyright and statement are included in all such copies. Other copyrights may also apply.
Referenced by get_panel_skills().
#define INFO_SCREENS 2 /* Number of screens in character info mode */ |
Referenced by do_cmd_change_name().
#define RES_ROWS 9 |
List of resistances and abilities to display.
Referenced by display_player_flag_info().
References panel_line::attr, region::col, COLOUR_WHITE, i, panel_line::label, panel::len, panel::lines, pl, region_erase(), region::row, row, Term_putstr(), panel_line::value, w, and region::width.
Referenced by display_player(), and display_player_xtra_info().
Display the character on the screen (two different modes)
The top two lines, and the bottom line (or two) are left blank.
Mode 0 = standard display with skills/history Mode 1 = special display with equipment flags
References align_left, angband_term, bounds, clear_from(), display_panel(), display_player_flag_info(), display_player_stat_info(), display_player_sust_info(), display_player_xtra_info(), p, panel_free(), panels, player_upkeep::playing, Term, and player::upkeep.
Referenced by death_info(), do_cmd_change_name(), roller_command(), textui_do_birth(), update_player0_subwindow(), update_player1_subwindow(), and write_character_dump().
Equippy chars.
References player::body, player_body::count, i, object_attr(), object_char(), slot_object(), Term_putch(), tile_height, and tile_width.
Referenced by display_player_sust_info(), and display_resistance_panel().
References player::body, player_body::count, display_resistance_panel(), i, player_flag_table, and RES_ROWS.
Referenced by display_player().
Special display, part 2b.
References buf, player_class::c_adj, c_put_str(), player::class, cnv_stat(), COLOUR_L_BLUE, COLOUR_L_GREEN, COLOUR_WHITE, COLOUR_YELLOW, i, put_str(), player_race::r_adj, player::race, row, player_state::stat_add, player::stat_cur, STAT_MAX, player::stat_max, stat_names, stat_names_reduced, player_state::stat_top, player_state::stat_use, player::state, and strnfmt().
Referenced by display_player(), point_based_start(), and point_based_stats().
Special display, part 2c.
How to print out the modifications and sustains. Positive mods with no sustain will be light green. Positive mods with a sustain will be dark green. Sustains (with no modification) will be a dark green 's'. Negative mods (from a curse) will be red. Huge mods (>9), like from MICoMorgoth, will be a '*' No mod, no sustain, will be a slate '.'
References player::body, c_put_str(), COLOUR_GREEN, COLOUR_L_GREEN, COLOUR_RED, COLOUR_SLATE, COLOUR_WHITE, player_body::count, display_player_equippy(), i, I2D, object::modifiers, OBJ_MOD_MIN_STAT, object_flag_is_known(), object_flags_known(), of_has, OF_SIZE, player_flags(), row, slot_object(), STAT_MAX, sustain_flag(), and Term_putch().
Referenced by display_player().
References align_left, bounds, COLOUR_WHITE, display_panel(), player::history, i, N_ELEMENTS, p, panel_free(), panels, Term_gotoxy(), text_out_indent, text_out_to_screen(), and text_out_wrap.
Referenced by display_player(), point_based_misc(), and point_based_start().
|
static |
References panel_line::attr, player::body, region::col, COLOUR_GREEN, COLOUR_L_BLUE, COLOUR_L_GREEN, COLOUR_RED, COLOUR_SLATE, COLOUR_WHITE, player_body::count, curse_max, curses, object::curses, display_player_equippy(), player_race::el_info, object::el_info, player_flag_record::element, player_flag_record::flag, flag, object::flags, format(), i, index, player_race::infra, player_flag_record::mod, object::modifiers, NULL, curse::obj, player::obj_k, object_element_is_known(), object_flag_is_known(), object_flags_known(), of_has, OF_SIZE, of_wipe, player_flags(), curse_data::power, player_race::r_skills, player::race, element_info::res_level, region::row, row, SKILL_DIGGING, slot_object(), Term_addch(), Term_gotoxy(), Term_putstr(), player::timed, player_flag_record::tmd_flag, and true.
Referenced by display_player_flag_info().
Hack – change name.
References arg_force_name, ARROW_LEFT, ARROW_RIGHT, buf, mouseclick::button, keypress::code, COLOUR_WHITE, display_player(), dump_save(), ESCAPE, EVENT_MESSAGE_FLUSH, event_signal(), EVT_BUTTON, EVT_KBRD, EVT_MOUSE, player::full_name, get_character_name(), get_file, INFO_SCREENS, inkey_ex(), ui_event::key, ui_event::mouse, msg, my_strcat(), my_strcpy(), p, player_safe_name(), screen_load(), screen_save(), Term_putstr(), and ui_event::type.
Referenced by store_process_command_key().
bool dump_save | ( | const char * | path | ) |
Save the lore to a file in the user directory.
path | is the path to the filename |
References msg, text_lines_to_file(), and write_character_dump().
Referenced by death_file(), and do_cmd_change_name().
References player_state::ac, BTH_PLUS_ADJ, COLOUR_L_BLUE, object::dd, object::ds, equipped_item_by_slot_name(), object::known, player::known_state, player_state::num_blows, player_state::num_shots, p, panel_allocate(), panel_line(), panel_space(), SKILL_TO_HIT_BOW, SKILL_TO_HIT_MELEE, player_state::skills, player::state, player_state::to_a, player_state::to_d, object::to_d, player_state::to_h, and object::to_h.
References player::age, panel_line::attr, COLOUR_L_BLUE, player::ht, p, panel_allocate(), panel_line(), player::resting_turn, player::total_energy, turn, and player::wt.
References panel_line::attr, BOUND, cave, COLOUR_L_GREEN, COLOUR_L_UMBER, colour_table, chunk::depth, desc, likert(), p, panel_allocate(), panel_line(), player_state::see_infra, show_speed(), SKILL_DEVICE, SKILL_DISARM_MAGIC, SKILL_DISARM_PHYS, SKILL_SAVE, SKILL_SEARCH, SKILL_STEALTH, player_state::skills, player_state::speed, player::state, and player::timed.
Returns a "rating" of x depending on y, and sets "attr" to the corresponding "attribute".
References COLOUR_L_GREEN, COLOUR_RED, and COLOUR_YELLOW.
Referenced by get_panel_skills().
References COLOUR_L_GREEN, and COLOUR_YELLOW.
Referenced by get_panel_midleft().
Allocate some panel lines.
References panel::len, panel::lines, panel::max, mem_zalloc(), and p.
Referenced by get_panel_combat(), get_panel_midleft(), get_panel_misc(), get_panel_skills(), and get_panel_topleft().
Free up panel lines.
References panel::lines, and mem_free().
Referenced by display_player(), and display_player_xtra_info().
|
static |
Add a new line to the panel.
References panel_line::attr, panel_line::label, panel::len, panel::lines, panel::max, pl, panel_line::value, and vstrnfmt().
Referenced by get_panel_combat(), get_panel_midleft(), get_panel_misc(), get_panel_skills(), and get_panel_topleft().
Add a spacer line in a panel.
References panel::len, and panel::max.
Referenced by get_panel_combat(), and get_panel_midleft().
References buffer, player::expfact, player::lev, player_exp, PY_MAX_LEVEL, and strnfmt().
Referenced by get_panel_midleft().
References buffer, player::max_depth, and strnfmt().
Referenced by get_panel_midleft().
References buffer, player_state::speed, player::state, strnfmt(), and player::timed.
Referenced by get_panel_skills().
References player::class, player::lev, PY_MAX_LEVEL, player_class::title, player::total_winner, and player::wizard.
Referenced by get_panel_topleft().
Write a character dump.
References player::body, buf, buildid, player_body::count, player::died_from, display_player(), dump_history(), file_putf(), gear_to_label(), i, I2A, player_upkeep::inven, player::is_dead, mem_free(), mem_zalloc(), message_str(), messages_num(), object_desc(), object_info_chardump(), ODESC_FULL, ODESC_PREFIX, OP_BIRTH, OP_INTERFACE, OP_MAX, player_options::opt, option_desc(), option_name(), option_type(), player::opts, p, angband_constants::pack_size, player_upkeep::quiver, angband_constants::quiver_size, slot_object(), store::stock_num, STORE_HOME, angband_constants::store_inven_max, store_stock_list(), stores, Term_what(), player::upkeep, void(), and z_info.
Referenced by dump_save().
bool align_left |
Referenced by display_player(), and display_player_xtra_info().
region bounds |
Referenced by display_player(), and display_player_xtra_info().
Referenced by display_knowledge().
const { ... } panels[] |
Panels for main character screen.
Referenced by display_player(), and display_player_xtra_info().
|
static |
Referenced by display_player_flag_info().