Main Page | Modules | Alphabetical List | Data Structures | File List | Data Fields | Globals | Related Pages

player Struct Reference

#include <player.h>


Detailed Description

Player position and status.

Definition at line 65 of file player.h.

Data Fields

sshort x
sshort y
sshort class
 Player class (fighter, wizard, etc).

sshort hps
 Current hit points. (If zero, die).

sshort hps_max
 Max. hit points.

sshort hps_max_mod
 How much max HPs have been modified by.

sshort pps
 Power points (spellcasting power).

sshort pps_max
 Max. power points (spellcasting power).

sshort pps_max_mod
 Modifier to max. power points.

ushort partialhps
 Fractional hit points.

ushort partialpps
 Fractional power points.

ushort level
 Player level.

schar facing_forced
schar facing
 Force-facing direction (zapping, shooting).

ushort velocity
 Last movement direction.

stat_timer stat_timers [NUM_STATMOD_TIMERS]
sshort intrinsic [NUM_STATS]
 Base stats.

sshort extrinsic [NUM_STATS]
 Stats after equipment modifiers.

sshort maximum [NUM_STATS]
 Highest value a stat's ever taken.

ushort skill [NUM_SKILLS+1]
 Weapon skills.

ushort skill_marks [NUM_SKILLS+1]
 Weapon skill marks.

ulong xp
slong satiation
 Number of turns until starvation.

ulong debt
 (Unused) money owed to a shopkeeper

item inventory [PLRINVSIZE]
 Carried items.

slong * spellknowledge
 Turns on which spells will be forgotten.

ulong score
 The score so far.


Field Documentation

sshort player::class
 

Player class (fighter, wizard, etc).

Definition at line 70 of file player.h.

Referenced by char_info(), deref_jump_table(), distribute_attributes(), init_player(), init_skills(), marks_to_advance(), study_book(), and study_spell().

ulong player::debt
 

(Unused) money owed to a shopkeeper

Definition at line 148 of file player.h.

Referenced by init_player().

sshort player::extrinsic[NUM_STATS]
 

Stats after equipment modifiers.

Calculated from update_player based on intrinsics and worn equipment. All of the player's stats are included; to access a stat, use the corresponding index into this array. For example, strength is w->plr.extrinsic[STAT_STRENGTH].

Definition at line 135 of file player.h.

Referenced by apply_stat_mod_desc(), award_mark(), calc_light_tile(), cast_spell(), char_info(), draw(), draw_tile(), init_player(), init_skills(), mod_from_attribute(), monst_attack_plr(), monst_attack_type(), monst_hit_plr(), monstname(), player_can_see(), plr_attack(), plr_move(), plr_run(), plr_takedamage(), plr_walk(), spell_confusion(), study_spell(), throw_item(), timepass(), update_player(), weapon_skill_attack(), weapon_skill_damage(), and webspinner_cower().

schar player::facing
 

Force-facing direction (zapping, shooting).

Definition at line 116 of file player.h.

Referenced by init_player(), player_facing(), plr_walk(), and prompt_dir().

schar player::facing_forced
 

Definition at line 115 of file player.h.

Referenced by init_player(), player_facing(), prompt_dir(), and timepass().

sshort player::hps
 

Current hit points. (If zero, die).

Definition at line 73 of file player.h.

Referenced by draw(), init_player(), plr_takedamage(), potion_numbness_expire(), spell_confusion(), and timepass().

sshort player::hps_max
 

Max. hit points.

Calculated from update_player. Do not modify directly for game effects; instead, change hps_max_mod.

Definition at line 79 of file player.h.

Referenced by draw(), init_player(), potion_numbness_expire(), timepass(), and update_player().

sshort player::hps_max_mod
 

How much max HPs have been modified by.

Normally, HPs can be calculated solely based on Wi and To. However, hit points may be drained (by vampires, for example) or boosted. This drain/boost is represented here.

Definition at line 86 of file player.h.

Referenced by init_player(), and update_player().

sshort player::intrinsic[NUM_STATS]
 

Base stats.

After modifying one of these, be sure to call update_player so the extrinsic (modified) stats will be changed as well. Do not read these values to determine effects; look at player::extrinsic instead.

Definition at line 128 of file player.h.

Referenced by char_info(), distribute_attributes(), init_player(), plr_mod_stat(), plr_restore_stat(), potion_numbness_expire(), and update_player().

struct item player::inventory[PLRINVSIZE]
 

Carried items.

Definition at line 150 of file player.h.

Referenced by init_inventory().

ushort player::level
 

Player level.

Definition at line 113 of file player.h.

Referenced by awardXP(), char_info(), deref_jump_table(), draw(), init_player(), plr_attack(), plr_attack_monster_roll(), study_spell(), throw_item(), timepass(), and update_player().

sshort player::maximum[NUM_STATS]
 

Highest value a stat's ever taken.

Definition at line 137 of file player.h.

Referenced by distribute_attributes(), plr_mod_stat(), and plr_restore_stat().

ushort player::partialhps
 

Fractional hit points.

Used to keep track of when the player will regenerate. See timepass.

Definition at line 105 of file player.h.

Referenced by init_player(), and timepass().

ushort player::partialpps
 

Fractional power points.

Used to keep track of when the player will regenerate. See timepass.

Definition at line 110 of file player.h.

Referenced by init_player(), and timepass().

sshort player::pps
 

Power points (spellcasting power).

Definition at line 89 of file player.h.

Referenced by cast_spell(), draw(), init_player(), and timepass().

sshort player::pps_max
 

Max. power points (spellcasting power).

Calculated from update_player. Do not modify directly for game effects; instead, change hps_max_mod.

Definition at line 95 of file player.h.

Referenced by draw(), init_player(), study_spell(), timepass(), and update_player().

sshort player::pps_max_mod
 

Modifier to max. power points.

Power points may be "lost" mainly by casting a summoning spell.

Definition at line 100 of file player.h.

Referenced by init_player(), and update_player().

slong player::satiation
 

Number of turns until starvation.

Definition at line 146 of file player.h.

Referenced by hunger_status(), init_player(), and timepass().

ulong player::score
 

The score so far.

Definition at line 154 of file player.h.

Referenced by award_item_points(), awardXP(), end_game(), gen_map(), and init_player().

ushort player::skill[NUM_SKILLS+1]
 

Weapon skills.

Definition at line 139 of file player.h.

Referenced by award_mark(), init_skills(), marks_to_advance(), print_skills(), weapon_skill_attack(), and weapon_skill_damage().

ushort player::skill_marks[NUM_SKILLS+1]
 

Weapon skill marks.

Definition at line 140 of file player.h.

Referenced by award_mark(), and init_skills().

slong* player::spellknowledge
 

Turns on which spells will be forgotten.

Definition at line 152 of file player.h.

Referenced by cast_spell(), cleanup(), init_spells(), learn_spell(), numSpellsKnown(), refresh_spell(), restore_game(), save_game(), spellByIndex(), spellString(), and study_spell().

struct stat_timer player::stat_timers[NUM_STATMOD_TIMERS]
 

Definition at line 120 of file player.h.

Referenced by add_timer(), apply_timers(), init_timers(), and remove_expired_timers().

ushort player::velocity
 

Last movement direction.

Time spent going in the same direction (used to check for stumbling)

Definition at line 117 of file player.h.

Referenced by init_player(), plr_walk(), and timepass().

sshort player::x
 

Definition at line 67 of file player.h.

Referenced by attack_tile(), calc_light(), calc_light_tile(), do_drop_item(), draw(), draw_tile(), enter_map(), facing_towards(), follow_connection(), force_follow_connection(), gather_wandering_monsters(), give_item_slip(), item_step(), manip_door(), monst_can_attack_player(), monst_chat(), monst_detect_player(), monst_is_aligned_with_plr(), monstcanmove(), monstmove(), monstmoveawayfromplayer(), monstmoverandomly(), monstmoveto(), monstmovetowardsplayer(), pet_move(), pickup(), place_player_on_map(), place_wandering_monsters(), player_facing(), plr_move(), plr_moveto(), plr_search(), plr_walk(), throw_item(), tool_holysymbol(), and webspinner_cower().

ulong player::xp
 

Number of XP points gained last level

See also:
awardXP

Definition at line 144 of file player.h.

Referenced by awardXP(), and init_player().

sshort player::y
 

Definition at line 68 of file player.h.

Referenced by attack_tile(), calc_light(), calc_light_tile(), do_drop_item(), draw(), draw_tile(), enter_map(), facing_towards(), follow_connection(), force_follow_connection(), gather_wandering_monsters(), give_item_slip(), item_step(), manip_door(), monst_can_attack_player(), monst_chat(), monst_detect_player(), monst_is_aligned_with_plr(), monstcanmove(), monstmove(), monstmoveawayfromplayer(), monstmoverandomly(), monstmoveto(), monstmovetowardsplayer(), pet_move(), pickup(), place_player_on_map(), place_wandering_monsters(), player_facing(), plr_move(), plr_moveto(), plr_search(), plr_walk(), throw_item(), tool_holysymbol(), and webspinner_cower().


The documentation for this struct was generated from the following file:
Generated on Thu May 20 13:12:14 2004 for CalcRogue by doxygen 1.3.6