Angband
|
Player implementation. More...
#include "guid.h"
#include "obj-properties.h"
#include "object.h"
#include "option.h"
#include "list-stats.h"
#include "list-player-flags.h"
Go to the source code of this file.
Data Structures | |
struct | quest |
Structure for the "quests". More... | |
struct | equip_slot |
A single equipment slot. More... | |
struct | player_body |
A player 'body'. More... | |
struct | player_race |
Player race info. More... | |
struct | player_blow |
Blow names for shapechanged players. More... | |
struct | player_shape |
Player shapechange shape info. More... | |
struct | start_item |
Items the player starts with. More... | |
struct | magic_realm |
Structure for magic realms. More... | |
struct | class_spell |
A structure to hold class-dependent information on spells. More... | |
struct | class_book |
A structure to hold class-dependent information on spell books. More... | |
struct | class_magic |
Information about class magic knowledge. More... | |
struct | player_class |
Player class info. More... | |
struct | history_entry |
Histories are a graph of charts; each chart contains a set of individual entries for that chart, and each entry contains a text description and a successor chart to move history generation to. More... | |
struct | history_chart |
struct | player_history |
Player history information. More... | |
struct | player_state |
All the variable state that changes when you put on/take off equipment. More... | |
struct | player_upkeep |
Temporary, derived, player-related variables used during play but not saved. More... | |
struct | player |
Most of the "player" information goes here. More... | |
Macros | |
#define | STAT(a) STAT_##a, |
#define | PF(a, b, c) PF_##a, |
#define | PF_SIZE FLAG_SIZE(PF_MAX) |
#define | pf_has(f, flag) flag_has_dbg(f, PF_SIZE, flag, #f, #flag) |
#define | pf_next(f, flag) flag_next(f, PF_SIZE, flag) |
#define | pf_is_empty(f) flag_is_empty(f, PF_SIZE) |
#define | pf_is_full(f) flag_is_full(f, PF_SIZE) |
#define | pf_is_inter(f1, f2) flag_is_inter(f1, f2, PF_SIZE) |
#define | pf_is_subset(f1, f2) flag_is_subset(f1, f2, PF_SIZE) |
#define | pf_is_equal(f1, f2) flag_is_equal(f1, f2, PF_SIZE) |
#define | pf_on(f, flag) flag_on_dbg(f, PF_SIZE, flag, #f, #flag) |
#define | pf_off(f, flag) flag_off(f, PF_SIZE, flag) |
#define | pf_wipe(f) flag_wipe(f, PF_SIZE) |
#define | pf_setall(f) flag_setall(f, PF_SIZE) |
#define | pf_negate(f) flag_negate(f, PF_SIZE) |
#define | pf_copy(f1, f2) flag_copy(f1, f2, PF_SIZE) |
#define | pf_union(f1, f2) flag_union(f1, f2, PF_SIZE) |
#define | pf_inter(f1, f2) flag_inter(f1, f2, PF_SIZE) |
#define | pf_diff(f1, f2) flag_diff(f1, f2, PF_SIZE) |
#define | STAT_RANGE 38 |
The range of possible indexes into tables based upon stats. More... | |
#define | PY_MAX_EXP 99999999L /* Maximum exp */ |
Player constants. More... | |
#define | PY_KNOW_LEVEL 30 /* Level to know all runes */ |
#define | PY_MAX_LEVEL 50 /* Maximum level */ |
#define | PY_SPELL_LEARNED 0x01 /* Spell has been learned */ |
Flags for player.spell_flags[]. More... | |
#define | PY_SPELL_WORKED 0x02 /* Spell has been successfully tried */ |
#define | PY_SPELL_FORGOTTEN 0x04 /* Spell has been forgotten */ |
#define | BTH_PLUS_ADJ 3 /* Adjust BTH per plus-to-hit */ |
#define | NOSCORE_WIZARD 0x0002 |
Ways in which players can be marked as cheaters. More... | |
#define | NOSCORE_DEBUG 0x0008 |
#define | NOSCORE_JUMPING 0x0010 |
#define | player_has(p, flag) (pf_has(p->state.pflags, (flag))) |
Enumerations | |
enum | { STAT_MAX } |
Indexes of the player stats (hard-coded by savefiles). More... | |
enum | { PF_MAX } |
Player race and class flags. More... | |
enum | { DIGGING_RUBBLE = 0, DIGGING_MAGMA, DIGGING_QUARTZ, DIGGING_GRANITE, DIGGING_DOORS, DIGGING_MAX } |
Terrain that the player has a chance of digging through. More... | |
enum | { SKILL_DISARM_PHYS, SKILL_DISARM_MAGIC, SKILL_DEVICE, SKILL_SAVE, SKILL_SEARCH, SKILL_STEALTH, SKILL_TO_HIT_MELEE, SKILL_TO_HIT_BOW, SKILL_TO_HIT_THROW, SKILL_DIGGING, SKILL_MAX } |
Skill indexes. More... | |
Functions | |
struct player_class * | player_id2class (guid id) |
int | stat_name_to_idx (const char *name) |
const char * | stat_idx_to_name (int type) |
const struct magic_realm * | lookup_realm (const char *code) |
bool | player_stat_inc (struct player *p, int stat) |
bool | player_stat_dec (struct player *p, int stat, bool permanent) |
void | player_exp_gain (struct player *p, s32b amount) |
void | player_exp_lose (struct player *p, s32b amount, bool permanent) |
void | player_flags (struct player *p, bitflag f[OF_SIZE]) |
Obtain object flags for the player. More... | |
byte | player_hp_attr (struct player *p) |
byte | player_sp_attr (struct player *p) |
bool | player_restore_mana (struct player *p, int amt) |
void | player_safe_name (char *safe, size_t safelen, const char *name, bool strip_suffix) |
Return a version of the player's name safe for use in filesystems. More... | |
struct player_race * | player_id2race (guid id) |
Variables | |
struct player_body * | bodies |
ExternsMore... | |
struct player_race * | races |
struct player_shape * | shapes |
struct player_class * | classes |
struct magic_realm * | realms |
const s32b | player_exp [PY_MAX_LEVEL] |
Base experience levels, may be adjusted up for race and/or class. More... | |
struct player * | player |
Pointer to the player struct. More... | |
Player implementation.
Copyright (c) 1997 Ben Harrison, James E. Wilson, Robert A. Koeneke Copyright (c) 2011 elly+. See COPYING. Copyright (c) 2015 Nick McConnell angb and@l epto quark .net
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.
#define BTH_PLUS_ADJ 3 /* Adjust BTH per plus-to-hit */ |
#define NOSCORE_DEBUG 0x0008 |
Referenced by enter_score(), and textui_cmd_debug().
#define NOSCORE_JUMPING 0x0010 |
Referenced by choose_profile(), and do_cmd_wiz_jump().
#define NOSCORE_WIZARD 0x0002 |
Ways in which players can be marked as cheaters.
Referenced by do_cmd_wizard(), enter_score(), savefile_load(), and wiz_cheat_death().
#define PF | ( | a, | |
b, | |||
c | |||
) | PF_##a, |
Referenced by calc_bonuses(), and remove_bad_spells().
#define pf_has | ( | f, | |
flag | |||
) | flag_has_dbg(f, PF_SIZE, flag, #f, #flag) |
Referenced by class_help(), race_help(), unset_spells(), and update_smart_learn().
#define pf_is_empty | ( | f | ) | flag_is_empty(f, PF_SIZE) |
Referenced by remove_bad_spells().
#define pf_is_full | ( | f | ) | flag_is_full(f, PF_SIZE) |
#define pf_negate | ( | f | ) | flag_negate(f, PF_SIZE) |
#define pf_on | ( | f, | |
flag | |||
) | flag_on_dbg(f, PF_SIZE, flag, #f, #flag) |
Referenced by calc_bonuses().
#define pf_setall | ( | f | ) | flag_setall(f, PF_SIZE) |
Referenced by parse_class_play_flags(), parse_p_race_play_flags(), parse_shape_play_flags(), and remove_bad_spells().
Referenced by calc_bonuses(), and calc_shapechange().
Referenced by calc_bonuses(), and remove_bad_spells().
Referenced by beam_chance(), calc_bonuses(), calc_light(), cave_unlight(), context_menu_cave(), decrease_timeouts(), do_cmd_steal_aux(), do_cmd_study(), inven_carry(), map_info(), player_flags(), player_inc_check(), process_player(), process_world(), project_m(), project_player_handler_DARK_WEAK(), prt_sp(), py_attack(), spell_chance(), update_view(), and update_view_one().
#define PY_KNOW_LEVEL 30 /* Level to know all runes */ |
#define PY_MAX_EXP 99999999L /* Maximum exp */ |
Player constants.
Referenced by adjust_level(), do_cmd_wiz_advance(), and effect_handler_GAIN_EXP().
#define PY_MAX_LEVEL 50 /* Maximum level */ |
Referenced by adjust_level(), cleanup_class(), do_cmd_rerate(), parse_class_title(), prt_title(), rd_player(), rd_player_hp(), roll_hp(), show_adv_exp(), show_title(), teardown_tests(), and wr_player_hp().
#define PY_SPELL_FORGOTTEN 0x04 /* Spell has been forgotten */ |
Referenced by calc_spells(), and spell_menu_display().
#define PY_SPELL_LEARNED 0x01 /* Spell has been learned */ |
Flags for player.spell_flags[].
Referenced by calc_spells(), spell_learn(), spell_menu_display(), spell_okay_to_cast(), and spell_okay_to_study().
#define PY_SPELL_WORKED 0x02 /* Spell has been successfully tried */ |
Referenced by spell_cast(), and spell_menu_display().
#define STAT | ( | a | ) | STAT_##a, |
#define STAT_RANGE 38 |
The range of possible indexes into tables based upon stats.
Currently things range from 3 to 18/220 = 40.
Referenced by calc_bonuses(), and obj_known_blows().
anonymous enum |
anonymous enum |
const struct magic_realm* lookup_realm | ( | const char * | code | ) |
References my_stricmp(), magic_realm::name, magic_realm::next, quit_fmt(), and realms.
Referenced by parse_class_book().
References adjust_level(), player::exp, and player::max_exp.
Referenced by do_cmd_disarm_aux(), do_cmd_disarm_chest(), do_cmd_open_chest(), do_cmd_wiz_advance(), do_cmd_wiz_change_aux(), effect_handler_GAIN_EXP(), effect_handler_RESTORE_EXP(), get_debug_command(), object_learn_on_use(), player_kill_monster(), and spell_cast().
References adjust_level(), player::exp, and player::max_exp.
Referenced by do_cmd_wiz_change_aux(), effect_handler_BIZARRE(), effect_handler_LOSE_EXP(), melee_effect_experience(), process_world(), project_player_handler_CHAOS(), project_player_handler_COLD(), project_player_handler_DARK(), project_player_handler_NETHER(), and project_player_handler_TIME().
Obtain object flags for the player.
References player::class, player_race::flags, player_class::flags, player::lev, of_on, of_union, player_has, and player::race.
Referenced by calc_bonuses(), display_player_sust_info(), and display_resistance_panel().
References player::chp, COLOUR_L_GREEN, COLOUR_RED, COLOUR_YELLOW, player_options::hitpoint_warn, player::mhp, and player::opts.
Referenced by prt_hp().
struct player_class* player_id2class | ( | guid | id | ) |
References player_class::cidx, classes, guid_eq(), and player_class::next.
Referenced by class_help(), display_scores_aux(), do_cmd_birth_init(), and do_cmd_choose_class().
struct player_race* player_id2race | ( | guid | id | ) |
References guid_eq(), player_race::next, races, and player_race::ridx.
Referenced by display_scores_aux(), do_cmd_birth_init(), do_cmd_choose_race(), and race_help().
References player::csp, msg, player::msp, PR_MANA, player_upkeep::redraw, and player::upkeep.
Return a version of the player's name safe for use in filesystems.
XXX This does not belong here.
References find_roman_suffix_start(), i, MIN, my_strcpy(), and suffix().
Referenced by death_file(), do_cmd_change_name(), do_cmd_pref_file_hack(), get_pref_path(), process_character_pref_files(), and savefile_set_name().
References COLOUR_L_GREEN, COLOUR_RED, COLOUR_YELLOW, player::csp, player_options::hitpoint_warn, player::msp, and player::opts.
Referenced by prt_sp().
References PR_STATS, PU_BONUS, player_upkeep::redraw, magic_realm::stat, player::stat_cur, player::stat_max, player_upkeep::update, and player::upkeep.
Referenced by effect_handler_BIZARRE(), effect_handler_DRAIN_STAT(), effect_handler_LOSE_RANDOM_STAT(), player_over_exert(), process_world(), project_player_drain_stats(), project_player_handler_TIME(), and test_stat_dec().
References PU_BONUS, randint1, magic_realm::stat, player::stat_cur, player::stat_max, player_upkeep::update, and player::upkeep.
Referenced by effect_handler_GAIN_STAT(), and test_stat_inc().
References STAT_MAX, stat_name_list, and type.
References i, my_stricmp(), and stat_name_list.
Referenced by effect_subtype(), and parse_realm_stat().
struct player_body* bodies |
struct player_class* classes |
Referenced by cleanup_class(), finish_parse_class(), object_kind_to_book(), player_id2class(), player_init(), rd_player(), and setup_menus().
const s32b player_exp[PY_MAX_LEVEL] |
Base experience levels, may be adjusted up for race and/or class.
Referenced by adjust_level(), prt_exp(), and show_adv_exp().
struct player_race* races |
Referenced by cleanup_p_race(), finish_parse_p_race(), player_id2race(), player_init(), rd_player(), and setup_menus().
struct magic_realm* realms |
Referenced by cleanup_realm(), finish_parse_realm(), and lookup_realm().
struct player_shape* shapes |
Referenced by cleanup_shape(), finish_parse_shape(), lookup_player_shape(), player_shape_by_idx(), and rd_player().