3 * Summary: Player related functions.
4 * Written by: Linley Henzell
14 #include "itemprop-enum.h"
16 #include "place-info.h"
17 #include "religion-enum.h"
28 int check_stealth(void);
30 typedef FixedVector
<int, NUM_DURATIONS
> durations_t
;
31 class player
: public actor
35 std::string your_name
;
38 std::string class_name
;
40 // This field is here even in non-WIZARD compiles, since the
41 // player might have been playing previously under wiz mode.
42 bool wizard
; // true if player has entered wiz mode.
43 time_t birth_time
; // start time of game
47 int elapsed_time
; // total amount of elapsed time in the game
51 int base_hp
; // temporary max HP loss (rotting)
52 int base_hp2
; // base HPs from levels (and permanent loss)
56 int base_magic_points
; // temporary max MP loss? (currently unused)
57 int base_magic_points2
; // base MPs from levels and potions of magic
59 FixedVector
<int8_t, NUM_STATS
> stat_loss
;
60 FixedVector
<int8_t, NUM_STATS
> base_stats
;
61 FixedVector
<int, NUM_STATS
> stat_zero
;
62 FixedVector
<std::string
, NUM_STATS
> stat_zero_cause
;
63 stat_type last_chosen
;
69 uint8_t hit_points_regeneration
;
70 uint8_t magic_points_regeneration
;
71 unsigned int experience
;
75 FixedVector
<int8_t, NUM_EQUIP
> equip
;
76 FixedVector
<bool, NUM_EQUIP
> melded
;
77 unsigned short unrand_reacts
;
79 // PC's symbol (usually @) and colour.
81 transformation_type form
;
83 FixedVector
< item_def
, ENDOFPACK
> inv
;
86 burden_state_type burden_state
;
87 FixedVector
<spell_type
, MAX_KNOWN_SPELLS
> spells
;
89 game_direction_type char_direction
;
91 bool royal_jelly_dead
;
92 bool transform_uncancellable
;
93 bool fishtail
; // Merfolk fishtail transformation
95 unsigned short pet_target
;
97 int absdepth0
; // offset by one (-1 == 0, 0 == 1, etc.) for display
101 int berserk_penalty
; // penalty for moving while berserk
103 FixedVector
<int, NUM_ATTRIBUTES
> attribute
;
104 FixedVector
<uint8_t, NUM_AMMO
> quiver
; // default items for quiver
105 FixedVector
<int, NUM_OBJECT_CLASSES
> sacrifice_value
;
107 undead_state_type is_undead
;
109 int friendly_pickup
; // pickup setting for allies
110 bool dead
; // ... but pending revival
114 FixedVector
<uint8_t, NUM_SKILLS
> skills
;
115 FixedVector
<bool, NUM_SKILLS
> practise_skill
;
116 FixedVector
<unsigned int, NUM_SKILLS
> skill_points
;
117 FixedVector
<unsigned int, NUM_SKILLS
> ct_skill_points
;
118 FixedVector
<uint8_t, NUM_SKILLS
> skill_order
;
120 //Ashenzari transfer knowledge
121 skill_type transfer_from_skill
;
122 skill_type transfer_to_skill
;
123 unsigned int transfer_skill_points
;
124 unsigned int transfer_total_skill_points
;
126 skill_type sage_bonus_skill
; // If Sage is in effect, which skill it affects.
127 int sage_bonus_degree
; // How much bonus XP to give in that skill.
129 int skill_cost_level
;
130 int total_skill_points
;
133 FixedArray
<uint8_t, 6, 50> item_description
;
134 FixedVector
<unique_item_status_type
, MAX_UNRANDARTS
> unique_items
;
135 FixedVector
<bool, NUM_MONSTERS
> unique_creatures
;
137 // NOTE: The kills member is a pointer to a KillMaster object,
138 // rather than the object itself, so that we can get away with
139 // just a forward declare of the KillMaster class, rather than
140 // having to #include kills.h and thus make every single .cc file
141 // dependant on kills.h. Having a pointer means that we have
142 // to do our own implementations of copying the player object,
143 // since the default implementations will lead to the kills member
144 // pointing to freed memory, or worse yet lead to the same piece of
145 // memory being freed twice.
148 level_area_type level_type
;
150 // Human-readable name for portal vault. Will be set to level_type_tag
151 // if not explicitly set by the entry portal.
152 std::string level_type_name
;
154 // Three-letter extension for portal vault bones files. Will be set
155 // to first three letters of level_type_tag if not explicitly set by
157 std::string level_type_ext
;
159 // Abbreviation of portal vault name, for use in notes. If not
160 // explicitly set by the portal vault, will be set from level_type_name
161 // or level_type_tag if either is short enough, or the shorter of the
162 // two will be truncated if neither is short enough.
163 std::string level_type_name_abbrev
;
165 // Item origin string for items from portal vaults, so that dumps
166 // can have origins like "You found it in on level 2 of a ziggurat".
167 // Will be set relative to level_type_name if not explicitly set.
168 std::string level_type_origin
;
170 // .des file tag for portal vault
171 std::string level_type_tag
;
173 branch_type where_are_you
;
175 FixedVector
<uint8_t, 30> branch_stairs
;
178 std::string jiyva_second_name
; // Random second name of Jiyva
180 uint8_t piety_hysteresis
; // amount of stored-up docking
181 uint8_t gift_timeout
;
182 FixedVector
<uint8_t, MAX_NUM_GODS
> penance
;
183 FixedVector
<uint8_t, MAX_NUM_GODS
> worshipped
;
184 FixedVector
<short, MAX_NUM_GODS
> num_current_gifts
;
185 FixedVector
<short, MAX_NUM_GODS
> num_total_gifts
;
187 // Nemelex sacrifice toggles
188 FixedVector
<bool, NUM_NEMELEX_GIFT_TYPES
> nemelex_sacrificing
;
190 FixedVector
<uint8_t, NUM_MUTATIONS
> mutation
;
191 FixedVector
<uint8_t, NUM_MUTATIONS
> innate_mutations
;
196 mutation_type mutation
;
199 std::vector
<demon_trait
> demonic_traits
;
201 int earth_attunement
; // nomes only
202 int magic_contamination
;
204 FixedVector
<bool, NUM_FIXED_BOOKS
> had_book
;
205 FixedVector
<bool, NUM_SPELLS
> seen_spell
;
206 FixedVector
<uint32_t, NUM_WEAPONS
> seen_weapon
;
207 FixedVector
<uint32_t, NUM_ARMOURS
> seen_armour
;
209 uint8_t normal_vision
; // how far the species gets to see
210 uint8_t current_vision
; // current sight radius (cells)
212 branch_type hell_branch
; // which branch the player goes to on hell exit
213 uint8_t hell_exit
; // which level player goes to on hell exit
215 int real_time
; // real time played (in seconds)
216 int num_turns
; // number of turns taken
217 int exploration
; // levels explored (16.16 bit real number)
219 int last_view_update
; // what turn was the view last updated?
221 // Warning: these two are quite different.
223 // The spell table is an index to a specific spell slot (you.spells).
224 // The ability table lists the ability (ABIL_*) which prefers that letter.
226 // In other words, the spell table contains hard links and the ability
227 // table contains soft links.
228 FixedVector
<int, 52> spell_letter_table
; // ref to spell by slot
229 FixedVector
<ability_type
, 52> ability_letter_table
; // ref to abil by enum
231 std::set
<std::string
> uniq_map_tags
;
232 std::set
<std::string
> uniq_map_names
;
234 PlaceInfo global_info
;
235 player_quiver
* m_quiver
;
237 CrawlHashTable props
;
239 // monsters mesmerising player; should be protected, but needs to be saved
241 std::vector
<int> beholders
;
243 // monsters causing fear to the player; see above
244 std::vector
<int> fearmongers
;
246 // Delayed level actions. This array is never trimmed, as usually D:1 won't
247 // be loaded again until the very end.
248 std::vector
<daction_type
> dactions
;
250 #if TAG_MAJOR_VERSION == 32
251 int montiers
[5]; // four monster tiers, plus corpse count
255 // Non-saved UI state:
256 unsigned short prev_targ
;
257 coord_def prev_grd_targ
;
260 // Coordinates of last travel target; note that this is never used by
261 // travel itself, only by the level-map to remember the last travel target.
262 short travel_x
, travel_y
;
265 runrest running
; // Nonzero if running/traveling.
266 bool received_weapon_warning
;
268 delay_queue_type delay_queue
; // pending actions
270 time_t last_keypress_time
;
271 #if defined(WIZARD) || defined(DEBUG)
272 // If set to true, then any call to ouch() which would cuase the player
273 // to die automatically returns without ending the game.
277 int bondage_level
; // how much an Ash worshipper is into bondage
280 // Volatile (same-turn) state:
281 bool turn_is_over
; // flag signaling that player has performed a timed action
283 // If true, player is headed to the Abyss.
285 std::string banished_by
;
287 bool wield_change
; // redraw weapon
288 bool redraw_quiver
; // redraw quiver
289 uint64_t redraw_status_flags
;
291 bool redraw_hit_points
;
292 bool redraw_magic_points
;
293 FixedVector
<bool, NUM_STATS
> redraw_stats
;
294 bool redraw_experience
;
295 bool redraw_armour_class
;
298 uint8_t flash_colour
;
302 int shield_blocks
; // number of shield blocks since last action
304 entry_cause_type entry_cause
;
305 god_type entry_cause_god
;
307 int old_hunger
; // used for hunger delta-meter (see output.cc)
309 // Set when the character is going to a new level, to guard against levgen
311 dungeon_feature_type transit_stair
;
314 int escaped_death_cause
;
315 std::string escaped_death_aux
;
317 int turn_damage
; // cumulative damage per turn
318 int damage_source
; // death source of last damage done to player
319 int source_damage
; // cumulative damage for you.damage_source
321 // When other levels are loaded (e.g. viewing), is the player on this level?
322 bool on_current_level
;
324 // Did you spent this turn walking (/flying)?
325 // 0 = no, 1 = cardinal move, 2 = diagonal move
328 // View code clears and needs new data in places where we can't announce the
329 // portal right away; delay the announcements then.
332 // Number of viewport refreshes.
333 unsigned int frame_no
;
335 // The save file itself.
338 // The type of a zotdef wave, if any.
339 std::string zotdef_wave_name
;
340 // The biggest assigned monster id so far.
343 // The last spell cast by the player.
344 spell_type last_cast_spell
;
347 FixedVector
<PlaceInfo
, NUM_BRANCHES
> branch_info
;
348 FixedVector
<PlaceInfo
, NUM_LEVEL_AREA_TYPES
- 1> non_branch_info
;
352 player(const player
&other
);
355 void copy_from(const player
&other
);
359 // Set player position without updating view geometry.
360 void set_position(const coord_def
&c
);
361 // Low-level move the player. Use this instead of changing pos directly.
362 void moveto(const coord_def
&c
);
363 bool move_to_pos(const coord_def
&c
);
364 // Move the player during an abyss shift.
365 void shiftto(const coord_def
&c
);
366 bool blink_to(const coord_def
& c
, bool quiet
= false);
368 void reset_prev_move();
370 int8_t stat(stat_type stat
, bool nonneg
=true) const;
371 int8_t strength() const;
372 int8_t intel() const;
374 int8_t max_stat(stat_type stat
) const;
375 int8_t max_strength() const;
376 int8_t max_intel() const;
377 int8_t max_dex() const;
379 bool in_water() const;
380 bool can_swim(bool permanently
= false) const;
381 int visible_igrd(const coord_def
&) const;
382 bool is_levitating() const;
383 bool can_cling_to_walls() const;
384 void clear_clinging();
385 bool cannot_speak() const;
386 bool invisible() const;
388 bool can_see_invisible() const;
389 bool can_see_invisible(bool unid
, bool transient
= true) const;
390 bool visible_to(const actor
*looker
) const;
391 bool can_see(const actor
* a
) const;
393 bool see_cell(const coord_def
& p
) const;
394 const los_base
* get_los();
396 // Is c in view but behind a transparent wall?
397 bool trans_wall_blocking(const coord_def
&c
) const;
400 bool is_fiery() const;
401 bool is_skeletal() const;
403 bool light_flight() const;
404 bool travelling_light() const;
406 // Dealing with beholders. Implemented in behold.cc.
407 void add_beholder(const monster
* mon
);
409 bool beheld_by(const monster
* mon
) const;
410 monster
* get_beholder(const coord_def
&pos
) const;
411 monster
* get_any_beholder() const;
412 void remove_beholder(const monster
* mon
);
413 void clear_beholders();
414 void beholders_check_noise(int loudness
);
415 void update_beholders();
416 void update_beholder(const monster
* mon
);
418 // Dealing with fearmongers. Implemented in fearmonger.cc.
419 bool add_fearmonger(const monster
* mon
);
421 bool afraid_of(const monster
* mon
) const;
422 monster
* get_fearmonger(const coord_def
&pos
) const;
423 monster
* get_any_fearmonger() const;
424 void remove_fearmonger(const monster
* mon
);
425 void clear_fearmongers();
426 void fearmongers_check_noise(int loudness
);
427 void update_fearmongers();
428 void update_fearmonger(const monster
* mon
);
430 kill_category
kill_alignment() const;
432 bool has_spell(spell_type spell
) const;
434 size_type
transform_size(int psize
= PSIZE_TORSO
) const;
435 std::string
shout_verb() const;
437 item_def
*slot_item(equipment_type eq
,
438 bool include_melded
=false);
439 const item_def
*slot_item(equipment_type eq
,
440 bool include_melded
=false) const;
444 int get_experience_level() const;
445 actor_type
atype() const { return ACT_PLAYER
; }
446 monster
* as_monster() { return NULL
; }
447 player
* as_player() { return this; }
448 const monster
* as_monster() const { return NULL
; }
449 const player
* as_player() const { return this; }
451 god_type
deity() const;
453 bool is_summoned(int* duration
= NULL
, int* summon_type
= NULL
) const;
455 bool swimming() const;
456 bool submerged() const;
457 bool floundering() const;
458 bool extra_balanced() const;
459 bool can_pass_through_feat(dungeon_feature_type grid
) const;
460 bool is_habitable_feat(dungeon_feature_type actual_grid
) const;
461 size_type
body_size(size_part_type psize
= PSIZE_TORSO
, bool base
= false) const;
462 int body_weight(bool base
= false) const;
463 int total_weight() const;
464 int damage_brand(int which_attack
= -1);
465 int damage_type(int which_attack
= -1);
467 int has_claws(bool allow_tran
= true) const;
468 bool has_usable_claws(bool allow_tran
= true) const;
469 int has_talons(bool allow_tran
= true) const;
470 bool has_usable_talons(bool allow_tran
= true) const;
471 int has_fangs(bool allow_tran
= true) const;
472 int has_usable_fangs(bool allow_tran
= true) const;
473 int has_tail(bool allow_tran
= true) const;
474 int has_usable_tail(bool allow_tran
= true) const;
475 bool has_usable_offhand() const;
476 int has_pseudopods(bool allow_tran
= true) const;
477 int has_usable_pseudopods(bool allow_tran
= true) const;
479 item_def
*weapon(int which_attack
= -1);
482 bool can_wield(const item_def
&item
,
483 bool ignore_curse
= false,
484 bool ignore_brand
= false,
485 bool ignore_shield
= false,
486 bool ignore_transform
= false) const;
487 bool could_wield(const item_def
&item
,
488 bool ignore_brand
= false,
489 bool ignore_transform
= false) const;
491 std::string
name(description_level_type type
,
492 bool force_visible
= false) const;
493 std::string
pronoun(pronoun_type pro
, bool force_visible
= false) const;
494 std::string
conj_verb(const std::string
&verb
) const;
495 std::string
hand_name(bool plural
, bool *can_plural
= NULL
) const;
496 std::string
foot_name(bool plural
, bool *can_plural
= NULL
) const;
497 std::string
arm_name(bool plural
, bool *can_plural
= NULL
) const;
499 bool fumbles_attack(bool verbose
= true);
500 bool cannot_fight() const;
502 void attacking(actor
*other
);
503 bool can_go_berserk() const;
504 bool can_go_berserk(bool intentional
, bool potion
= false) const;
505 void go_berserk(bool intentional
, bool potion
= false);
506 bool berserk() const;
507 bool has_lifeforce() const;
508 bool can_mutate() const;
509 bool can_safely_mutate() const;
510 bool can_bleed() const;
513 void banish(const std::string
&who
= "");
514 void blink(bool allow_partial_control
= true);
515 void teleport(bool right_now
= false,
516 bool abyss_shift
= false,
517 bool wizard_tele
= false);
518 void drain_stat(stat_type stat
, int amount
, actor
* attacker
);
520 void expose_to_element(beam_type element
, int strength
= 0);
521 void god_conduct(conduct_type thing_done
, int level
);
523 int hunger_level() const { return hunger_state
; }
524 void make_hungry(int nutrition
, bool silent
= true);
525 void poison(actor
*agent
, int amount
= 1, bool force
= false);
526 bool sicken(int amount
);
527 void paralyse(actor
*, int str
);
528 void petrify(actor
*, int str
);
529 void slow_down(actor
*, int str
);
530 void confuse(actor
*, int strength
);
531 bool heal(int amount
, bool max_too
= false);
532 bool drain_exp(actor
*, bool quiet
= false, int pow
= 3);
533 bool rot(actor
*, int amount
, int immediate
= 0, bool quiet
= false);
534 int hurt(const actor
*attacker
, int amount
,
535 beam_type flavour
= BEAM_MISSILE
,
536 bool cleanup_dead
= true);
540 int mons_species() const;
542 mon_holy_type
holiness() const;
543 bool undead_or_demonic() const;
544 bool is_holy() const;
545 bool is_unholy() const;
546 bool is_evil() const;
547 bool is_chaotic() const;
548 bool is_artificial() const;
549 bool is_unbreathing() const;
550 bool is_insubstantial() const;
551 bool is_cloud_immune(cloud_type
) const;
552 int res_acid() const;
553 int res_fire() const;
554 int res_steam() const;
555 int res_cold() const;
556 int res_elec() const;
557 int res_poison(bool temp
= true) const;
558 int res_rotting(bool temp
= true) const;
559 int res_asphyx() const;
560 int res_water_drowning() const;
561 int res_sticky_flame() const;
562 int res_holy_energy(const actor
*) const;
563 int res_negative_energy() const;
564 int res_torment() const;
565 int res_wind() const;
566 int res_magic() const;
567 bool confusable() const;
568 bool slowable() const;
570 flight_type
flight_mode() const;
571 bool permanent_levitation() const;
572 bool permanent_flight() const;
574 bool paralysed() const;
575 bool cannot_move() const;
576 bool cannot_act() const;
577 bool confused() const;
579 bool backlit(bool check_haloed
= true, bool self_halo
= true) const;
580 int halo_radius2() const;
581 int silence_radius2() const;
582 int liquefying_radius2 () const;
583 bool glows_naturally() const;
584 bool petrified() const;
585 bool incapacitated() const
587 return actor::incapacitated() || stat_zero
[STAT_DEX
];
591 void hibernate(int power
= 0);
592 void put_to_sleep(actor
*, int power
= 0);
594 void check_awaken(int disturbance
);
595 int beam_resists(bolt
&beam
, int hurted
, bool doEffects
,
598 bool can_throw_large_rocks() const;
599 bool can_smell() const;
601 int armour_class() const;
602 int gdr_perc() const;
603 int melee_evasion(const actor
*attacker
,
604 ev_ignore_type evit
= EV_IGNORE_NONE
) const;
606 int stat_hp() const { return hp
; }
607 int stat_maxhp() const { return hp_max
; }
608 int stealth() const { return check_stealth(); }
610 int shield_bonus() const;
611 int shield_block_penalty() const;
612 int shield_bypass_ability(int tohit
) const;
614 void shield_block_succeeded(actor
*foe
);
616 bool wearing_light_armour(bool with_skill
= false) const;
617 int skill(skill_type skill
) const;
618 int traps_skill() const;
622 void apply_location_effects(const coord_def
&oldpos
,
623 killer_type killer
= KILL_NONE
,
626 ////////////////////////////////////////////////////////////////
628 PlaceInfo
& get_place_info() const ; // Current place info
629 PlaceInfo
& get_place_info(branch_type branch
,
630 level_area_type level_type2
) const;
631 PlaceInfo
& get_place_info(branch_type branch
) const;
632 PlaceInfo
& get_place_info(level_area_type level_type2
) const;
633 void clear_place_info();
635 void goto_place(const level_id
&level
);
637 void set_place_info(PlaceInfo info
);
638 // Returns copies of the PlaceInfo; modifying the vector won't
639 // modify the player object.
640 std::vector
<PlaceInfo
> get_all_place_info(bool visited_only
= false,
641 bool dungeon_only
= false) const;
643 bool did_escape_death() const;
644 void reset_escaped_death();
646 void add_gold(int delta
);
647 void del_gold(int delta
);
648 void set_gold(int amount
);
650 void increase_duration(duration_type dur
, int turns
, int cap
= 0,
651 const char* msg
= NULL
);
652 void set_duration(duration_type dur
, int turns
, int cap
= 0,
653 const char *msg
= NULL
);
658 void _removed_beholder();
659 bool _possible_beholder(const monster
* mon
) const;
661 void _removed_fearmonger();
662 bool _possible_fearmonger(const monster
* mon
) const;
666 #define you (*real_you)
670 struct player_save_info
673 unsigned int experience
;
674 int experience_level
;
676 species_type species
;
677 std::string class_name
;
679 std::string jiyva_second_name
;
680 game_type saved_game_type
;
687 player_save_info
operator=(const player
& rhs
);
688 bool operator<(const player_save_info
& rhs
) const;
689 std::string
short_desc() const;
695 // Helper. Use move_player_to_grid or player::apply_location_effects instead.
696 void moveto_location_effects(dungeon_feature_type old_feat
,
697 bool stepped
=false, bool allow_shift
=true,
698 const coord_def
& old_pos
=coord_def());
700 bool check_moveto(const coord_def
& p
, const std::string
&move_verb
= "step");
701 void move_player_to_grid(const coord_def
& p
, bool stepped
, bool allow_shift
);
703 bool player_in_mappable_area(void);
704 bool player_in_branch(int branch
);
705 bool player_in_level_area(level_area_type area
);
706 bool player_in_hell(void);
708 bool berserk_check_wielded_weapon(void);
709 int player_equip(equipment_type slot
, int sub_type
, bool calc_unid
= true);
710 int player_equip_ego_type(int slot
, int sub_type
, bool calc_unid
= true);
711 bool player_equip_unrand(int unrand_index
);
712 bool player_can_hit_monster(const monster
* mon
);
714 bool player_is_shapechanged(void);
716 bool is_effectively_light_armour(const item_def
*item
);
717 bool player_effectively_in_light_armour();
719 bool player_under_penance(void);
721 bool extrinsic_amulet_effect(jewellery_type amulet
);
722 bool wearing_amulet(jewellery_type which_am
, bool calc_unid
= true,
723 bool ignore_extrinsic
= false);
725 int burden_change(void);
727 int carrying_capacity(burden_state_type bs
= BS_OVERLOADED
);
729 int player_energy(void);
731 int player_adjusted_shield_evasion_penalty(int scale
);
732 int player_adjusted_body_armour_evasion_penalty(int scale
);
733 int player_armour_shield_spell_penalty();
734 int player_evasion(ev_ignore_type evit
= EV_IGNORE_NONE
);
736 int player_movement_speed(bool ignore_burden
= false);
738 int player_hunger_rate(void);
740 int calc_hunger(int food_cost
);
742 int player_icemail_armour_class();
744 int player_mag_abil(bool is_weighted
);
745 int player_magical_power(void);
747 int player_prot_life(bool calc_unid
= true, bool temp
= true,
750 int player_regen(void);
752 int player_res_cold(bool calc_unid
= true, bool temp
= true,
754 int player_res_acid(bool calc_unid
= true, bool items
= true);
755 int player_res_corr(bool calc_unid
= true, bool items
= true);
756 int player_acid_resist_factor();
758 int player_res_torment(bool calc_unid
= true, bool temp
= true);
760 bool player_item_conserve(bool calc_unid
= true);
761 int player_mental_clarity(bool calc_unid
= true, bool items
= true);
762 int player_spirit_shield(bool calc_unid
= true);
764 bool player_likes_chunks(bool permanently
= false);
765 bool player_likes_water(bool permanently
= false);
767 int player_mutation_level(mutation_type mut
);
769 int player_res_electricity(bool calc_unid
= true, bool temp
= true,
772 int player_res_fire(bool calc_unid
= true, bool temp
= true,
774 int player_res_sticky_flame(bool calc_unid
= true, bool temp
= true,
776 int player_res_steam(bool calc_unid
= true, bool temp
= true,
779 int player_res_poison(bool calc_unid
= true, bool temp
= true,
781 int player_res_magic(bool calc_unid
= true, bool temp
= true);
783 bool player_control_teleport(bool calc_unid
= true, bool temp
= true,
786 int player_shield_class(void);
789 int player_spec_air(void);
790 int player_spec_cold(void);
791 int player_spec_conj(void);
792 int player_spec_death(void);
793 int player_spec_earth(void);
794 int player_spec_ench(void);
795 int player_spec_fire(void);
796 int player_spec_holy(void);
797 int player_spec_poison(void);
798 int player_spec_summ(void);
800 int player_speed(void);
801 int player_ponderousness();
802 int player_evokable_levitation();
803 int player_evokable_invis();
805 int player_spell_levels(void);
807 int player_sust_abil(bool calc_unid
= true);
809 int player_teleport(bool calc_unid
= true);
811 bool items_give_ability(const int slot
, artefact_prop_type abil
);
812 int scan_artefacts(artefact_prop_type which_property
, bool calc_unid
= true);
814 int slaying_bonus(weapon_property_type which_affected
, bool ranged
= false);
816 unsigned int exp_needed(int lev
);
818 int get_expiration_threshold(duration_type dur
);
819 bool dur_expiring(duration_type dur
);
820 void display_char_status(void);
822 void forget_map(int chance_forgotten
= 100, bool force
= false);
824 void gain_exp(unsigned int exp_gained
, unsigned int* actual_gain
= NULL
,
825 unsigned int* actual_avail_gain
= NULL
);
827 bool player_in_bat_form();
828 bool player_can_open_doors();
830 inline bool player_can_handle_equipment()
832 return player_can_open_doors();
835 void level_change(bool skip_attribute_increase
= false);
837 bool player_genus(genus_type which_genus
,
838 species_type species
= SP_UNKNOWN
);
839 bool is_player_same_species(const int mon
, bool = false);
840 monster_type
player_mons(bool transform
= true);
841 void update_player_symbol();
842 void update_vision_range();
844 bool you_can_wear(int eq
, bool special_armour
= false);
845 bool player_has_feet(void);
846 bool player_wearing_slot(int eq
);
847 bool you_tran_can_wear(const item_def
&item
);
848 bool you_tran_can_wear(int eq
, bool check_mutation
= false);
850 bool enough_hp(int minimum
, bool suppress_msg
);
851 bool enough_mp(int minimum
, bool suppress_msg
, bool include_items
= true);
852 bool enough_xp(int minimum
, bool suppress_msg
);
854 void dec_hp(int hp_loss
, bool fatal
, const char *aux
= NULL
);
855 void dec_mp(int mp_loss
);
857 void inc_mp(int mp_gain
, bool max_too
);
858 void inc_hp(int hp_gain
, bool max_too
);
860 void rot_hp(int hp_loss
);
861 void unrot_hp(int hp_recovered
);
863 void rot_mp(int mp_loss
);
865 void inc_max_hp(int hp_gain
);
866 void dec_max_hp(int hp_loss
);
868 void inc_max_mp(int mp_gain
);
869 void dec_max_mp(int mp_loss
);
871 void deflate_hp(int new_level
, bool floor
);
872 void set_hp(int new_amount
, bool max_too
);
874 int get_real_hp(bool trans
, bool rotted
= false);
875 int get_real_mp(bool include_items
);
877 int get_contamination_level();
878 std::string
describe_contamination(int level
);
880 void set_mp(int new_amount
, bool max_too
);
882 void contaminate_player(int change
, bool controlled
= false,
885 bool confuse_player(int amount
, bool resistable
= true);
887 bool curare_hits_player(int death_source
, int amount
, const bolt
&beam
);
888 bool poison_player(int amount
, std::string source
,
889 std::string source_aux
= "", bool force
= false);
890 void dec_poison_player();
891 void reduce_poison_player(int amount
);
892 bool miasma_player(std::string source
, std::string source_aux
= "");
894 bool napalm_player(int amount
);
895 void dec_napalm_player(int delay
);
897 bool slow_player(int turns
);
898 void dec_slow_player(int delay
);
899 void dec_exhaust_player(int delay
);
901 bool haste_player(int turns
, bool rageext
= false);
902 void dec_haste_player(int delay
);
903 void levitate_player(int pow
);
904 void float_player(bool fly
);
907 void dec_disease_player(int delay
);
909 void dec_color_smoke_trail();
911 bool player_weapon_wielded();
913 // Determines if the given grid is dangerous for the player to enter.
914 bool is_feat_dangerous(dungeon_feature_type feat
, bool permanently
= false);
916 void run_macro(const char *macroname
= NULL
);
918 int count_worn_ego(int which_ego
);