00001
00002
00003
00004
00005
00006
00007
00008 #ifndef PLAYER_H
00009 #define PLAYER_H
00010
00011 #include "actor.h"
00012 #include "beam.h"
00013 #include "quiver.h"
00014 #include "itemprop-enum.h"
00015 #include "package.h"
00016 #include "place-info.h"
00017 #include "religion-enum.h"
00018
00019 #include "species.h"
00020
00021 #include <vector>
00022 #include <stdint.h>
00023
00024 #ifdef USE_TILE
00025 #include "tiledoll.h"
00026 #endif
00027
00028 typedef FixedVector<int, NUM_DURATIONS> durations_t;
00029 class player : public actor
00030 {
00031 public:
00032
00033 std::string your_name;
00034 species_type species;
00035 job_type char_class;
00036 std::string class_name;
00037
00038
00039
00040 bool wizard;
00041 time_t birth_time;
00042
00043
00044
00045 int elapsed_time;
00046
00047 int hp;
00048 int hp_max;
00049 int base_hp;
00050 int base_hp2;
00051
00052 int magic_points;
00053 int max_magic_points;
00054 int base_magic_points;
00055 int base_magic_points2;
00056
00057 FixedVector<int8_t, NUM_STATS> stat_loss;
00058 FixedVector<int8_t, NUM_STATS> base_stats;
00059 FixedVector<int, NUM_STATS> stat_zero;
00060 FixedVector<std::string, NUM_STATS> stat_zero_cause;
00061 stat_type last_chosen;
00062
00063 int hunger;
00064 int disease;
00065 uint8_t hunger_state;
00066 uint8_t max_level;
00067 uint8_t hit_points_regeneration;
00068 uint8_t magic_points_regeneration;
00069 unsigned int experience;
00070 int experience_level;
00071 int gold;
00072
00073 FixedVector<int8_t, NUM_EQUIP> equip;
00074 FixedVector<bool, NUM_EQUIP> melded;
00075 unsigned short unrand_reacts;
00076
00077
00078 monster_type symbol;
00079 transformation_type form;
00080
00081 FixedVector< item_def, ENDOFPACK > inv;
00082
00083 int burden;
00084 burden_state_type burden_state;
00085 FixedVector<spell_type, MAX_KNOWN_SPELLS> spells;
00086 uint8_t spell_no;
00087 game_direction_type char_direction;
00088 bool opened_zot;
00089 bool royal_jelly_dead;
00090 bool transform_uncancellable;
00091 bool fishtail;
00092
00093 unsigned short pet_target;
00094
00095 int absdepth0;
00096
00097 durations_t duration;
00098 int rotting;
00099 int berserk_penalty;
00100
00101 FixedVector<int, NUM_ATTRIBUTES> attribute;
00102 FixedVector<uint8_t, NUM_AMMO> quiver;
00103 FixedVector<int, NUM_OBJECT_CLASSES> sacrifice_value;
00104
00105 undead_state_type is_undead;
00106
00107 int friendly_pickup;
00108 bool dead;
00109 int lives;
00110 int deaths;
00111
00112 FixedVector<uint8_t, NUM_SKILLS> skills;
00113 FixedVector<bool, NUM_SKILLS> practise_skill;
00114 FixedVector<unsigned int, NUM_SKILLS> skill_points;
00115 FixedVector<unsigned int, NUM_SKILLS> ct_skill_points;
00116 FixedVector<uint8_t, NUM_SKILLS> skill_order;
00117
00118
00119 skill_type transfer_from_skill;
00120 skill_type transfer_to_skill;
00121 unsigned int transfer_skill_points;
00122 unsigned int transfer_total_skill_points;
00123
00124 skill_type sage_bonus_skill;
00125 int sage_bonus_degree;
00126
00127 int skill_cost_level;
00128 int total_skill_points;
00129 int exp_available;
00130
00131 FixedArray<uint8_t, 6, 50> item_description;
00132 FixedVector<unique_item_status_type, MAX_UNRANDARTS> unique_items;
00133 FixedVector<bool, NUM_MONSTERS> unique_creatures;
00134
00135
00136
00137
00138
00139
00140
00141
00142
00143
00144 KillMaster* kills;
00145
00146 level_area_type level_type;
00147
00148
00149
00150 std::string level_type_name;
00151
00152
00153
00154
00155 std::string level_type_ext;
00156
00157
00158
00159
00160
00161 std::string level_type_name_abbrev;
00162
00163
00164
00165
00166 std::string level_type_origin;
00167
00168
00169 std::string level_type_tag;
00170
00171 branch_type where_are_you;
00172
00173 FixedVector<uint8_t, 30> branch_stairs;
00174
00175 god_type religion;
00176 std::string jiyva_second_name;
00177 uint8_t piety;
00178 uint8_t piety_hysteresis;
00179 uint8_t gift_timeout;
00180 FixedVector<uint8_t, MAX_NUM_GODS> penance;
00181 FixedVector<uint8_t, MAX_NUM_GODS> worshipped;
00182 FixedVector<short, MAX_NUM_GODS> num_current_gifts;
00183 FixedVector<short, MAX_NUM_GODS> num_total_gifts;
00184
00185
00186 FixedVector<bool, NUM_NEMELEX_GIFT_TYPES> nemelex_sacrificing;
00187
00188 FixedVector<uint8_t, NUM_MUTATIONS> mutation;
00189 FixedVector<uint8_t, NUM_MUTATIONS> innate_mutations;
00190
00191 struct demon_trait
00192 {
00193 int level_gained;
00194 mutation_type mutation;
00195 };
00196
00197 std::vector<demon_trait> demonic_traits;
00198
00199 int earth_attunement;
00200 int magic_contamination;
00201
00202 FixedVector<bool, NUM_FIXED_BOOKS> had_book;
00203 FixedVector<bool, NUM_SPELLS> seen_spell;
00204 FixedVector<uint32_t, NUM_WEAPONS> seen_weapon;
00205 FixedVector<uint32_t, NUM_ARMOURS> seen_armour;
00206
00207 uint8_t normal_vision;
00208 uint8_t current_vision;
00209
00210 branch_type hell_branch;
00211 uint8_t hell_exit;
00212
00213 int real_time;
00214 int num_turns;
00215 int exploration;
00216
00217 int last_view_update;
00218
00219
00220
00221
00222
00223
00224
00225
00226 FixedVector<int, 52> spell_letter_table;
00227 FixedVector<ability_type, 52> ability_letter_table;
00228
00229 std::set<std::string> uniq_map_tags;
00230 std::set<std::string> uniq_map_names;
00231
00232 PlaceInfo global_info;
00233 player_quiver* m_quiver;
00234
00235 CrawlHashTable props;
00236
00237
00238
00239 std::vector<int> beholders;
00240
00241
00242 std::vector<int> fearmongers;
00243
00244
00245
00246 std::vector<daction_type> dactions;
00247
00248
00249
00250 unsigned short prev_targ;
00251 coord_def prev_grd_targ;
00252 coord_def prev_move;
00253
00254
00255
00256 short travel_x, travel_y;
00257 level_id travel_z;
00258
00259 runrest running;
00260 bool received_weapon_warning;
00261
00262 delay_queue_type delay_queue;
00263
00264 time_t start_time;
00265 #if defined(WIZARD) || defined(DEBUG)
00266
00267
00268 bool never_die;
00269 #endif
00270 bool xray_vision;
00271 int bondage_level;
00272
00273
00274
00275 bool turn_is_over;
00276
00277
00278 bool banished;
00279 std::string banished_by;
00280
00281 bool wield_change;
00282 bool redraw_quiver;
00283 uint64_t redraw_status_flags;
00284
00285 bool redraw_hit_points;
00286 bool redraw_magic_points;
00287 FixedVector<bool, NUM_STATS> redraw_stats;
00288 bool redraw_experience;
00289 bool redraw_armour_class;
00290 bool redraw_evasion;
00291
00292 uint8_t flash_colour;
00293
00294 int time_taken;
00295
00296 int shield_blocks;
00297
00298 entry_cause_type entry_cause;
00299 god_type entry_cause_god;
00300
00301 int old_hunger;
00302
00303
00304
00305 dungeon_feature_type transit_stair;
00306 bool entering_level;
00307
00308 int escaped_death_cause;
00309 std::string escaped_death_aux;
00310
00311 int turn_damage;
00312 int damage_source;
00313 int source_damage;
00314
00315
00316 bool on_current_level;
00317
00318
00319
00320 int walking;
00321
00322
00323
00324 int seen_portals;
00325
00326
00327 unsigned int frame_no;
00328
00329
00330 package *save;
00331
00332
00333 bool clinging;
00334
00335 std::vector<coord_def> cling_to;
00336
00337 std::string zotdef_wave_name;
00338
00339 mid_t last_mid;
00340 protected:
00341 FixedVector<PlaceInfo, NUM_BRANCHES> branch_info;
00342 FixedVector<PlaceInfo, NUM_LEVEL_AREA_TYPES - 1> non_branch_info;
00343
00344 public:
00345 player();
00346 player(const player &other);
00347 ~player();
00348
00349 void copy_from(const player &other);
00350
00351 void init();
00352
00353
00354 void set_position(const coord_def &c);
00355
00356 void moveto(const coord_def &c);
00357 bool move_to_pos(const coord_def &c);
00358
00359 void shiftto(const coord_def &c);
00360 bool blink_to(const coord_def& c, bool quiet = false);
00361
00362 void reset_prev_move();
00363
00364 int8_t stat(stat_type stat, bool nonneg=true) const;
00365 int8_t strength() const;
00366 int8_t intel() const;
00367 int8_t dex() const;
00368 int8_t max_stat(stat_type stat) const;
00369 int8_t max_strength() const;
00370 int8_t max_intel() const;
00371 int8_t max_dex() const;
00372
00373 bool in_water() const;
00374 bool can_swim(bool permanently = false) const;
00375 int visible_igrd(const coord_def&) const;
00376 bool is_levitating() const;
00377 bool is_wall_clinging() const;
00378 bool can_cling_to(const coord_def& p) const;
00379 void check_clinging();
00380 bool cannot_speak() const;
00381 bool invisible() const;
00382 bool misled() const;
00383 bool can_see_invisible() const;
00384 bool can_see_invisible(bool unid, bool transient = true) const;
00385 bool are_charming() const;
00386 bool visible_to(const actor *looker) const;
00387 bool can_see(const actor* a) const;
00388
00389 bool see_cell(const coord_def& p) const;
00390 const los_base* get_los();
00391
00392
00393 bool trans_wall_blocking(const coord_def &c) const;
00394
00395 bool is_icy() const;
00396 bool is_fiery() const;
00397 bool is_skeletal() const;
00398
00399 bool light_flight() const;
00400 bool travelling_light() const;
00401
00402
00403 void add_beholder(const monster* mon);
00404 bool beheld() const;
00405 bool beheld_by(const monster* mon) const;
00406 monster* get_beholder(const coord_def &pos) const;
00407 monster* get_any_beholder() const;
00408 void remove_beholder(const monster* mon);
00409 void clear_beholders();
00410 void beholders_check_noise(int loudness);
00411 void update_beholders();
00412 void update_beholder(const monster* mon);
00413
00414
00415 bool add_fearmonger(const monster* mon);
00416 bool afraid() const;
00417 bool afraid_of(const monster* mon) const;
00418 monster* get_fearmonger(const coord_def &pos) const;
00419 monster* get_any_fearmonger() const;
00420 void remove_fearmonger(const monster* mon);
00421 void clear_fearmongers();
00422 void fearmongers_check_noise(int loudness);
00423 void update_fearmongers();
00424 void update_fearmonger(const monster* mon);
00425
00426 kill_category kill_alignment() const;
00427
00428 bool has_spell(spell_type spell) const;
00429
00430 size_type transform_size(int psize = PSIZE_TORSO) const;
00431 std::string shout_verb() const;
00432
00433 item_def *slot_item(equipment_type eq,
00434 bool include_melded=false);
00435 const item_def *slot_item(equipment_type eq,
00436 bool include_melded=false) const;
00437
00438
00439 int mindex() const;
00440 int get_experience_level() const;
00441 actor_type atype() const { return ACT_PLAYER; }
00442 monster* as_monster() { return NULL; }
00443 player* as_player() { return this; }
00444 const monster* as_monster() const { return NULL; }
00445 const player* as_player() const { return this; }
00446
00447 god_type deity() const;
00448 bool alive() const;
00449 bool is_summoned(int* duration = NULL, int* summon_type = NULL) const;
00450
00451 bool swimming() const;
00452 bool submerged() const;
00453 bool floundering() const;
00454 bool extra_balanced() const;
00455 bool can_pass_through_feat(dungeon_feature_type grid) const;
00456 bool is_habitable_feat(dungeon_feature_type actual_grid) const;
00457 size_type body_size(size_part_type psize = PSIZE_TORSO, bool base = false) const;
00458 int body_weight(bool base = false) const;
00459 int total_weight() const;
00460 int damage_brand(int which_attack = -1);
00461 int damage_type(int which_attack = -1);
00462
00463 int has_claws(bool allow_tran = true) const;
00464 bool has_usable_claws(bool allow_tran = true) const;
00465 int has_talons(bool allow_tran = true) const;
00466 bool has_usable_talons(bool allow_tran = true) const;
00467 int has_fangs(bool allow_tran = true) const;
00468 int has_usable_fangs(bool allow_tran = true) const;
00469 int has_tail(bool allow_tran = true) const;
00470 int has_usable_tail(bool allow_tran = true) const;
00471 bool has_usable_offhand() const;
00472 int has_pseudopods(bool allow_tran = true) const;
00473 int has_usable_pseudopods(bool allow_tran = true) const;
00474
00475 item_def *weapon(int which_attack = -1);
00476 item_def *shield();
00477
00478 bool can_wield(const item_def &item,
00479 bool ignore_curse = false,
00480 bool ignore_brand = false,
00481 bool ignore_shield = false,
00482 bool ignore_transform = false) const;
00483 bool could_wield(const item_def &item,
00484 bool ignore_brand = false,
00485 bool ignore_transform = false) const;
00486
00487 std::string name(description_level_type type,
00488 bool force_visible = false) const;
00489 std::string pronoun(pronoun_type pro, bool force_visible = false) const;
00490 std::string conj_verb(const std::string &verb) const;
00491 std::string hand_name(bool plural, bool *can_plural = NULL) const;
00492 std::string foot_name(bool plural, bool *can_plural = NULL) const;
00493 std::string arm_name(bool plural, bool *can_plural = NULL) const;
00494
00495 bool fumbles_attack(bool verbose = true);
00496 bool cannot_fight() const;
00497
00498 void attacking(actor *other);
00499 bool can_go_berserk() const;
00500 bool can_go_berserk(bool intentional, bool potion = false) const;
00501 void go_berserk(bool intentional, bool potion = false);
00502 bool berserk() const;
00503 bool has_lifeforce() const;
00504 bool can_mutate() const;
00505 bool can_safely_mutate() const;
00506 bool can_bleed() const;
00507 bool mutate();
00508 void backlight();
00509 void banish(const std::string &who = "");
00510 void blink(bool allow_partial_control = true);
00511 void teleport(bool right_now = false,
00512 bool abyss_shift = false,
00513 bool wizard_tele = false);
00514 void drain_stat(stat_type stat, int amount, actor* attacker);
00515
00516 void expose_to_element(beam_type element, int strength = 0);
00517 void god_conduct(conduct_type thing_done, int level);
00518
00519 int hunger_level() const { return hunger_state; }
00520 void make_hungry(int nutrition, bool silent = true);
00521 void poison(actor *agent, int amount = 1, bool force = false);
00522 bool sicken(int amount);
00523 void paralyse(actor *, int str);
00524 void petrify(actor *, int str);
00525 void slow_down(actor *, int str);
00526 void confuse(actor *, int strength);
00527 bool heal(int amount, bool max_too = false);
00528 bool drain_exp(actor *, bool quiet = false, int pow = 3);
00529 bool rot(actor *, int amount, int immediate = 0, bool quiet = false);
00530 int hurt(const actor *attacker, int amount,
00531 beam_type flavour = BEAM_MISSILE,
00532 bool cleanup_dead = true);
00533
00534 int warding() const;
00535
00536 int mons_species() const;
00537
00538 mon_holy_type holiness() const;
00539 bool undead_or_demonic() const;
00540 bool is_holy() const;
00541 bool is_unholy() const;
00542 bool is_evil() const;
00543 bool is_chaotic() const;
00544 bool is_artificial() const;
00545 bool is_unbreathing() const;
00546 bool is_insubstantial() const;
00547 bool is_cloud_immune(cloud_type) const;
00548 int res_acid() const;
00549 int res_fire() const;
00550 int res_steam() const;
00551 int res_cold() const;
00552 int res_elec() const;
00553 int res_poison(bool temp = true) const;
00554 int res_rotting(bool temp = true) const;
00555 int res_asphyx() const;
00556 int res_water_drowning() const;
00557 int res_sticky_flame() const;
00558 int res_holy_energy(const actor *) const;
00559 int res_negative_energy() const;
00560 int res_torment() const;
00561 int res_wind() const;
00562 int res_magic() const;
00563 bool confusable() const;
00564 bool slowable() const;
00565
00566 flight_type flight_mode() const;
00567 bool permanent_levitation() const;
00568 bool permanent_flight() const;
00569
00570 bool paralysed() const;
00571 bool cannot_move() const;
00572 bool cannot_act() const;
00573 bool confused() const;
00574 bool caught() const;
00575 bool backlit(bool check_haloed = true, bool self_halo = true) const;
00576 int halo_radius2() const;
00577 int silence_radius2() const;
00578 int liquefying_radius2 () const;
00579 bool glows_naturally() const;
00580 bool petrified() const;
00581 bool incapacitated() const
00582 {
00583 return actor::incapacitated() || stat_zero[STAT_DEX];
00584 }
00585
00586 bool asleep() const;
00587 void hibernate(int power = 0);
00588 void put_to_sleep(actor *, int power = 0);
00589 void awake();
00590 void check_awaken(int disturbance);
00591 int beam_resists(bolt &beam, int hurted, bool doEffects,
00592 std::string source);
00593
00594 bool can_throw_large_rocks() const;
00595 bool can_smell() const;
00596
00597 int armour_class() const;
00598 int gdr_perc() const;
00599 int melee_evasion(const actor *attacker,
00600 ev_ignore_type evit = EV_IGNORE_NONE) const;
00601
00602 int stat_hp() const { return hp; }
00603 int stat_maxhp() const { return hp_max; }
00604
00605 int shield_bonus() const;
00606 int shield_block_penalty() const;
00607 int shield_bypass_ability(int tohit) const;
00608
00609 void shield_block_succeeded(actor *foe);
00610
00611 bool wearing_light_armour(bool with_skill = false) const;
00612 int skill(skill_type skill, bool skill_bump = false) const;
00613 int traps_skill() const;
00614
00615 bool do_shaft();
00616
00617 void apply_location_effects(const coord_def &oldpos,
00618 killer_type killer = KILL_NONE,
00619 int killernum = -1);
00620
00622
00623 PlaceInfo& get_place_info() const ;
00624 PlaceInfo& get_place_info(branch_type branch,
00625 level_area_type level_type2) const;
00626 PlaceInfo& get_place_info(branch_type branch) const;
00627 PlaceInfo& get_place_info(level_area_type level_type2) const;
00628 void clear_place_info();
00629
00630 void goto_place(const level_id &level);
00631
00632 void set_place_info(PlaceInfo info);
00633
00634
00635 std::vector<PlaceInfo> get_all_place_info(bool visited_only = false,
00636 bool dungeon_only = false) const;
00637
00638 bool did_escape_death() const;
00639 void reset_escaped_death();
00640
00641 void add_gold(int delta);
00642 void del_gold(int delta);
00643 void set_gold(int amount);
00644
00645 void increase_duration(duration_type dur, int turns, int cap = 0,
00646 const char* msg = NULL);
00647 void set_duration(duration_type dur, int turns, int cap = 0,
00648 const char *msg = NULL);
00649
00650
00651
00652 protected:
00653 void _removed_beholder();
00654 bool _possible_beholder(const monster* mon) const;
00655
00656 void _removed_fearmonger();
00657 bool _possible_fearmonger(const monster* mon) const;
00658 };
00659
00660 #ifdef DEBUG_GLOBALS
00661 #define you (*real_you)
00662 #endif
00663 extern player you;
00664
00665 struct player_save_info
00666 {
00667 std::string name;
00668 unsigned int experience;
00669 int experience_level;
00670 bool wizard;
00671 species_type species;
00672 std::string class_name;
00673 god_type religion;
00674 std::string jiyva_second_name;
00675 game_type saved_game_type;
00676
00677 #ifdef USE_TILE
00678 dolls_data doll;
00679 bool held_in_net;
00680 #endif
00681
00682 player_save_info operator=(const player& rhs);
00683 bool operator<(const player_save_info& rhs) const;
00684 std::string short_desc() const;
00685 };
00686
00687 class monster;
00688 struct item_def;
00689
00690
00691 void moveto_location_effects(dungeon_feature_type old_feat,
00692 bool stepped=false, bool allow_shift=true,
00693 const coord_def& old_pos=coord_def());
00694
00695 bool check_moveto(const coord_def& p, const std::string &move_verb = "step");
00696 void move_player_to_grid(const coord_def& p, bool stepped, bool allow_shift);
00697
00698 bool player_in_mappable_area(void);
00699 bool player_in_branch(int branch);
00700 bool player_in_level_area(level_area_type area);
00701 bool player_in_hell(void);
00702
00703 bool berserk_check_wielded_weapon(void);
00704 int player_equip(equipment_type slot, int sub_type, bool calc_unid = true);
00705 int player_equip_ego_type(int slot, int sub_type, bool calc_unid = true);
00706 bool player_equip_unrand(int unrand_index);
00707 bool player_can_hit_monster(const monster* mon);
00708
00709 bool player_is_shapechanged(void);
00710
00711 bool is_effectively_light_armour(const item_def *item);
00712 bool player_effectively_in_light_armour();
00713
00714 bool player_under_penance(void);
00715
00716 bool extrinsic_amulet_effect(jewellery_type amulet);
00717 bool wearing_amulet(jewellery_type which_am, bool calc_unid = true,
00718 bool ignore_extrinsic = false);
00719
00720 int burden_change(void);
00721
00722 int carrying_capacity(burden_state_type bs = BS_OVERLOADED);
00723
00724 int check_stealth(void);
00725
00726 int player_energy(void);
00727
00728 int player_adjusted_shield_evasion_penalty(int scale);
00729 int player_adjusted_body_armour_evasion_penalty(int scale);
00730 int player_armour_shield_spell_penalty();
00731 int player_evasion(ev_ignore_type evit = EV_IGNORE_NONE);
00732
00733 int player_movement_speed(bool ignore_burden = false);
00734
00735 int player_hunger_rate(void);
00736
00737 int calc_hunger(int food_cost);
00738
00739 int player_icemail_armour_class();
00740
00741 int player_mag_abil(bool is_weighted);
00742 int player_magical_power(void);
00743
00744 int player_prot_life(bool calc_unid = true, bool temp = true,
00745 bool items = true);
00746
00747 int player_regen(void);
00748
00749 int player_res_cold(bool calc_unid = true, bool temp = true,
00750 bool items = true);
00751 int player_res_acid(bool calc_unid = true, bool items = true);
00752 int player_res_corr(bool calc_unid = true, bool items = true);
00753 int player_acid_resist_factor();
00754
00755 int player_res_torment(bool calc_unid = true, bool temp = true);
00756
00757 bool player_item_conserve(bool calc_unid = true);
00758 int player_mental_clarity(bool calc_unid = true, bool items = true);
00759 int player_spirit_shield(bool calc_unid = true);
00760
00761 bool player_likes_chunks(bool permanently = false);
00762 bool species_likes_water();
00763 bool player_likes_water(bool permanently = false);
00764
00765 int player_mutation_level(mutation_type mut);
00766
00767 int player_res_electricity(bool calc_unid = true, bool temp = true,
00768 bool items = true);
00769
00770 int player_res_fire(bool calc_unid = true, bool temp = true,
00771 bool items = true);
00772 int player_res_sticky_flame(bool calc_unid = true, bool temp = true,
00773 bool items = true);
00774 int player_res_steam(bool calc_unid = true, bool temp = true,
00775 bool items = true);
00776
00777 int player_res_poison(bool calc_unid = true, bool temp = true,
00778 bool items = true);
00779 int player_res_magic(bool calc_unid = true, bool temp = true);
00780
00781 bool player_control_teleport(bool calc_unid = true, bool temp = true,
00782 bool items = true);
00783
00784 int player_shield_class(void);
00785
00786
00787 int player_spec_air(void);
00788 int player_spec_cold(void);
00789 int player_spec_conj(void);
00790 int player_spec_death(void);
00791 int player_spec_earth(void);
00792 int player_spec_ench(void);
00793 int player_spec_fire(void);
00794 int player_spec_holy(void);
00795 int player_spec_poison(void);
00796 int player_spec_summ(void);
00797
00798 int player_speed(void);
00799 int player_ponderousness();
00800 int player_evokable_levitation();
00801 int player_evokable_invis();
00802
00803 int player_spell_levels(void);
00804
00805 int player_sust_abil(bool calc_unid = true);
00806
00807 int player_teleport(bool calc_unid = true);
00808
00809 bool items_give_ability(const int slot, artefact_prop_type abil);
00810 int scan_artefacts(artefact_prop_type which_property, bool calc_unid = true);
00811
00812 int slaying_bonus(weapon_property_type which_affected, bool ranged = false);
00813
00814 unsigned int exp_needed(int lev);
00815
00816 int get_expiration_threshold(duration_type dur);
00817 bool dur_expiring(duration_type dur);
00818 void display_char_status(void);
00819
00820 void forget_map(int chance_forgotten = 100, bool force = false);
00821
00822 void gain_exp(unsigned int exp_gained, unsigned int* actual_gain = NULL,
00823 unsigned int* actual_avail_gain = NULL);
00824
00825 bool player_in_bat_form();
00826 bool player_can_open_doors();
00827
00828 inline bool player_can_handle_equipment()
00829 {
00830 return player_can_open_doors();
00831 }
00832
00833 void level_change(bool skip_attribute_increase = false);
00834
00835 bool player_genus(genus_type which_genus,
00836 species_type species = SP_UNKNOWN);
00837 bool is_player_same_species(const int mon, bool = false);
00838 monster_type player_mons(bool transform = true);
00839 void update_player_symbol();
00840 void update_vision_range();
00841
00842 bool you_can_wear(int eq, bool special_armour = false);
00843 bool player_has_feet(void);
00844 bool player_wearing_slot(int eq);
00845 bool you_tran_can_wear(const item_def &item);
00846 bool you_tran_can_wear(int eq, bool check_mutation = false);
00847
00848 bool enough_hp(int minimum, bool suppress_msg);
00849 bool enough_mp(int minimum, bool suppress_msg, bool include_items = true);
00850 bool enough_xp(int minimum, bool suppress_msg);
00851
00852 void dec_hp(int hp_loss, bool fatal, const char *aux = NULL);
00853 void dec_mp(int mp_loss);
00854
00855 void inc_mp(int mp_gain, bool max_too);
00856 void inc_hp(int hp_gain, bool max_too);
00857
00858 void rot_hp(int hp_loss);
00859 void unrot_hp(int hp_recovered);
00860 int player_rotted();
00861 void rot_mp(int mp_loss);
00862
00863 void inc_max_hp(int hp_gain);
00864 void dec_max_hp(int hp_loss);
00865
00866 void inc_max_mp(int mp_gain);
00867 void dec_max_mp(int mp_loss);
00868
00869 void deflate_hp(int new_level, bool floor);
00870 void set_hp(int new_amount, bool max_too);
00871
00872 int get_real_hp(bool trans, bool rotted = false);
00873 int get_real_mp(bool include_items);
00874
00875 int get_contamination_level();
00876 std::string describe_contamination(int level);
00877
00878 void set_mp(int new_amount, bool max_too);
00879
00880 void contaminate_player(int change, bool controlled = false,
00881 bool msg = true);
00882
00883 bool confuse_player(int amount, bool resistable = true);
00884
00885 bool curare_hits_player(int death_source, int amount, const bolt &beam);
00886 bool poison_player(int amount, std::string source,
00887 std::string source_aux = "", bool force = false);
00888 void dec_poison_player();
00889 void reduce_poison_player(int amount);
00890 bool miasma_player(std::string source, std::string source_aux = "");
00891
00892 bool napalm_player(int amount);
00893 void dec_napalm_player(int delay);
00894
00895 bool slow_player(int turns);
00896 void dec_slow_player(int delay);
00897 void dec_exhaust_player(int delay);
00898
00899 bool haste_player(int turns, bool rageext = false);
00900 void dec_haste_player(int delay);
00901 void levitate_player(int pow);
00902 void float_player(bool fly);
00903 bool land_player();
00904
00905 void dec_disease_player(int delay);
00906
00907 void dec_color_smoke_trail();
00908
00909 bool player_weapon_wielded();
00910
00911
00912 bool is_feat_dangerous(dungeon_feature_type feat, bool permanently = false);
00913
00914 void run_macro(const char *macroname = NULL);
00915
00916 int count_worn_ego(int which_ego);
00917 #endif