SimulationCraft
SimulationCraft is a tool to explore combat mechanics in the popular MMO RPG World of Warcraft (tm).
player_t Struct Reference
Inheritance diagram for player_t:
actor_t noncopyable monk::monk_t paladin::paladin_t pet_t priestspace::priest_t warlock::warlock_t azerite::azerite_essences::guardian_of_azeroth_t::guardian_of_azeroth_pet_t monk::pets::monk_pet_t warlock::warlock_pet_t monk::pets::call_to_arms_niuzao_pet_t monk::pets::call_to_arms_xuen_pet_t monk::pets::chiji_pet_t monk::pets::crane_adept_pet_t monk::pets::niuzao_pet_t monk::pets::ox_adept_pet_t monk::pets::sinister_teaching_crane_adept_pet_t monk::pets::sinister_teaching_ox_adept_pet_t monk::pets::sinister_teaching_tiger_adept_pet_t monk::pets::storm_earth_and_fire_pet_t monk::pets::tiger_adept_pet_t monk::pets::xuen_pet_t monk::pets::yulon_pet_t warlock::pets::affliction::darkglare_t warlock::pets::base::felhunter_pet_t warlock::pets::base::imp_pet_t warlock::pets::base::sayaad_pet_t warlock::pets::base::voidwalker_pet_t warlock::pets::demonology::demonic_tyrant_t warlock::pets::demonology::dreadstalker_t warlock::pets::demonology::felguard_pet_t warlock::pets::demonology::grimoire_felguard_pet_t warlock::pets::demonology::malicious_imp_pet_t warlock::pets::demonology::wild_imp_pet_t warlock::pets::destruction::infernal_t warlock::pets::warlock_simple_pet_t

Classes

struct  antumbra_t
 
struct  base_initial_current_t
 
struct  buffs_t
 
struct  consumables_t
 
struct  debuffs_t
 
struct  diminishing_returns_constants_t
 
struct  external_buffs_t
 
struct  gains_t
 
struct  incoming_damage_entry_t
 
struct  passives_t
 
struct  procs_t
 
struct  racials_t
 
struct  shadowlands_opt_t
 
struct  spells_t
 
struct  uptimes_t
 

Public Types

enum  timeofday_e { NIGHT_TIME, DAY_TIME }
 
enum  zandalari_loa_e {
  AKUNDA, BWONSAMDI, GONK, KIMBUL,
  KRAGWA, PAKU
}
 
enum  vulpera_tricks_e {
  CORROSIVE, FLAMES, SHADOWS, HEALING,
  HOLY
}
 
using resource_callback_function_t = std::function< void()>
 
using combat_begin_fn_t = std::function< void(player_t *)>
 Start-of-combat effects.
 

Public Member Functions

void sequence_add (const action_t *a, const player_t *target, timespan_t ts)
 
void sequence_add_wait (timespan_t amount, timespan_t ts)
 
 player_t (sim_t *sim, player_e type, util::string_view name, race_e race_e)
 
const char * name () const override
 
void init_character_properties ()
 Initialize race, specialization, talents, professions.
 
double get_stat_value (stat_e)
 
void stat_gain (stat_e stat, double amount, gain_t *g=nullptr, action_t *a=nullptr, bool temporary=false)
 
void stat_loss (stat_e stat, double amount, gain_t *g=nullptr, action_t *a=nullptr, bool temporary=false)
 
void create_talents_numbers ()
 
void create_talents_armory ()
 
void create_talents_wowhead ()
 
void clear_action_priority_lists () const
 
void copy_action_priority_list (util::string_view old_list, util::string_view new_list)
 Replaces "old_list" action_priority_list data with "new_list" action_priority_list data.
 
void change_position (position_e)
 Change the player position ( fron/back, etc. More...
 
void register_resource_callback (resource_e resource, double value, resource_callback_function_t callback, bool use_pct, bool fire_once=true)
 Add a new resource callback, firing when a specified threshold for a resource is crossed. More...
 
bool add_action (util::string_view action, util::string_view options={}, util::string_view alist="default")
 Add action to action list. More...
 
bool add_action (const spell_data_t *s, util::string_view options={}, util::string_view alist="default")
 Add action to action list. More...
 
void add_option (std::unique_ptr< option_t > o)
 
void parse_talents_numbers (util::string_view talent_string)
 
bool parse_talents_armory (util::string_view talent_string)
 Old-style armory format for xx.battle.net / xx.battlenet.com.
 
bool parse_talents_armory2 (util::string_view talent_url)
 New armory format used in worldofwarcraft.com / www.wowchina.com.
 
void parse_temporary_enchants ()
 
bool is_moving () const
 
double composite_block_dr (double extra_block) const
 Helper function to calculate block value after diminishing returns.
 
bool is_pet () const
 
bool is_enemy () const
 
bool is_boss () const
 
bool is_add () const
 
bool is_sleeping () const
 
bool is_my_pet (const player_t *t) const
 
bool is_active () const
 Is the actor active currently.
 
bool in_gcd () const
 
bool recent_cast () const
 
bool dual_wield () const
 
bool has_shield_equipped () const
 
specialization_e specialization () const
 
const char * primary_tree_name () const
 
timespan_t total_reaction_time ()
 
double avg_item_level () const
 Get average item level the player is wearing.
 
double get_attribute (attribute_e a) const
 
double strength () const
 
double agility () const
 
double stamina () const
 
double intellect () const
 
double spirit () const
 
double mastery_coefficient () const
 
double get_player_distance (const player_t &) const
 
double get_ground_aoe_distance (const action_state_t &) const
 
double get_position_distance (double m=0, double v=0) const
 
double compute_incoming_damage (timespan_t interval) const
 
double compute_incoming_magic_damage (timespan_t interval) const
 
double calculate_time_to_bloodlust () const
 
slot_e parent_item_slot (const item_t &item) const
 
slot_e child_item_slot (const item_t &item) const
 
timespan_t cooldown_tolerance () const
 Actor-specific cooldown tolerance for queueable actions.
 
position_e position () const
 
pet_tcast_pet ()
 
const pet_tcast_pet () const
 
azerite_power_t find_azerite_spell (util::string_view name, bool tokenized=false) const
 
azerite_power_t find_azerite_spell (unsigned power_id) const
 
azerite_essence_t find_azerite_essence (util::string_view name, bool tokenized=false) const
 
azerite_essence_t find_azerite_essence (unsigned power_id) const
 
item_runeforge_t find_runeforge_legendary (util::string_view name, bool tokenized=false) const
 
conduit_data_t find_conduit_spell (util::string_view name) const
 
const spell_data_tfind_soulbind_spell (util::string_view name) const
 
const spell_data_tfind_covenant_spell (util::string_view name) const
 
const spell_data_tfind_racial_spell (util::string_view name, race_e r=RACE_NONE) const
 
const spell_data_tfind_class_spell (util::string_view name, specialization_e s=SPEC_NONE) const
 
const spell_data_tfind_rank_spell (util::string_view name, util::string_view rank, specialization_e s=SPEC_NONE) const
 
const spell_data_tfind_pet_spell (util::string_view name) const
 
const spell_data_tfind_talent_spell (util::string_view name, specialization_e s=SPEC_NONE, bool name_tokenized=false, bool check_validity=true) const
 Retrieves the Spell Data Associated with a given talent. More...
 
const spell_data_tfind_specialization_spell (util::string_view name, specialization_e s=SPEC_NONE) const
 
const spell_data_tfind_specialization_spell (util::string_view name, util::string_view desc, specialization_e s=SPEC_NONE) const
 
const spell_data_tfind_specialization_spell (unsigned spell_id, specialization_e s=SPEC_NONE) const
 
const spell_data_tfind_mastery_spell (specialization_e s) const
 
const spell_data_tfind_spell (util::string_view name, specialization_e s=SPEC_NONE) const
 Tries to find spell data by name. More...
 
const spell_data_tfind_spell (unsigned int id, specialization_e s) const
 
const spell_data_tfind_spell (unsigned int id) const
 
pet_tfind_pet (util::string_view name) const
 
item_tfind_item_by_name (util::string_view name)
 
item_tfind_item_by_id (unsigned id)
 
item_tfind_item_by_use_effect_name (util::string_view name)
 
action_tfind_action (util::string_view) const
 
cooldown_tfind_cooldown (util::string_view name) const
 
target_specific_cooldown_tfind_target_specific_cooldown (util::string_view name) const
 
dot_tfind_dot (util::string_view name, player_t *source) const
 
stats_tfind_stats (util::string_view name) const
 
gain_tfind_gain (util::string_view name) const
 
proc_tfind_proc (util::string_view name) const
 
benefit_tfind_benefit (util::string_view name) const
 
uptime_tfind_uptime (util::string_view name) const
 
sample_data_helper_tfind_sample_data (util::string_view name) const
 
action_priority_list_tfind_action_priority_list (util::string_view name) const
 
int find_action_id (util::string_view name) const
 
cooldown_tget_cooldown (util::string_view name, action_t *action=nullptr)
 
target_specific_cooldown_tget_target_specific_cooldown (util::string_view name, timespan_t duration=timespan_t::zero())
 
target_specific_cooldown_tget_target_specific_cooldown (cooldown_t &base_cooldown)
 
real_ppm_tget_rppm (util::string_view)
 
real_ppm_tget_rppm (util::string_view, const spell_data_t *data, const item_t *item=nullptr)
 
real_ppm_tget_rppm (util::string_view, double freq, double mod=1.0, unsigned s=RPPM_NONE)
 
shuffled_rng_tget_shuffled_rng (util::string_view name, int success_entries=0, int total_entries=0)
 
dot_tget_dot (util::string_view name, player_t *source)
 
gain_tget_gain (util::string_view name)
 
proc_tget_proc (util::string_view name)
 
stats_tget_stats (util::string_view name, action_t *action=nullptr)
 
benefit_tget_benefit (util::string_view name)
 
uptime_tget_uptime (util::string_view name)
 
sample_data_helper_tget_sample_data (util::string_view name)
 
action_priority_list_tget_action_priority_list (util::string_view name, util::string_view comment={})
 
int get_action_id (util::string_view name)
 
cooldown_waste_data_tget_cooldown_waste_data (const cooldown_t *cd)
 
virtual void invalidate_cache (cache_e c)
 
virtual void init ()
 
virtual void override_talent (util::string_view override_str)
 
virtual void init_meta_gem ()
 
virtual void init_resources (bool force=false)
 
virtual std::vector< std::string > get_item_actions ()
 
virtual std::vector< std::string > get_profession_actions ()
 
virtual std::vector< std::string > get_racial_actions ()
 
virtual void init_target ()
 
virtual void init_race ()
 
virtual void init_talents ()
 
virtual void replace_spells ()
 
virtual void init_position ()
 
virtual void init_professions ()
 
virtual void init_spells ()
 
virtual void init_items ()
 
virtual void init_azerite ()
 Initializes the Azerite-related support structures for an actor if there are any. More...
 
virtual void init_weapon (weapon_t &)
 Initialize azerite-related support structures for the actor.
 
virtual void init_base_stats ()
 Initialize base variables from database or other sources. More...
 
virtual void init_initial_stats ()
 Initialize initial stats from base + gear. More...
 
virtual void init_defense ()
 Initialize defensive properties (role, position, data collection, etc.)
 
virtual void create_buffs ()
 Create player buffs. More...
 
virtual void create_special_effects ()
 
virtual void init_special_effects ()
 
virtual void init_special_effect (special_effect_t &effect)
 Modify generic special effect initialization. More...
 
virtual void init_scaling ()
 
virtual void init_action_list ()
 
virtual void init_gains ()
 
virtual void init_procs ()
 
virtual void init_uptimes ()
 
virtual void init_benefits ()
 
virtual void init_rng ()
 
virtual void init_stats ()
 
virtual void init_distance_targeting ()
 
virtual void init_absorb_priority ()
 Define absorb priority. More...
 
virtual void init_assessors ()
 
virtual void init_background_actions ()
 
virtual void create_actions ()
 
virtual void init_actions ()
 
virtual void init_finished ()
 
virtual void add_precombat_buff_state (buff_t *buff, int stacks, double value, timespan_t duration)
 
virtual void add_precombat_cooldown_state (cooldown_t *cd, timespan_t duration)
 
virtual void apply_affecting_auras (action_t &)
 Called in every action constructor for all actions constructred for a player.
 
virtual void action_init_finished (action_t &)
 
virtual bool verify_use_items () const
 Verify that the user input (APL) contains an use-item line for all on-use items.
 
virtual void reset ()
 Reset player. More...
 
virtual void combat_begin ()
 
virtual void combat_end ()
 
virtual void merge (player_t &other)
 Merge player data with player from other thread. More...
 
virtual void datacollection_begin ()
 Begin data collection for statistics.
 
virtual void datacollection_end ()
 End data collection for statistics.
 
virtual void actor_changed ()
 Single actor batch mode calls this every time the active (player) actor changes for all targets.
 
virtual void activate ()
 A method to "activate" an actor in the simulator. More...
 
virtual void deactivate ()
 
virtual int level () const
 Scaled player level. More...
 
virtual double resource_regen_per_second (resource_e) const
 
double apply_combat_rating_dr (rating_e rating, double value) const
 
virtual double composite_melee_haste () const
 
virtual double composite_melee_speed () const
 
virtual double composite_melee_attack_power () const
 
virtual double composite_melee_attack_power_by_type (attack_power_type type) const
 
virtual double composite_melee_hit () const
 
virtual double composite_melee_crit_chance () const
 
virtual double composite_melee_crit_chance_multiplier () const
 
virtual double composite_melee_expertise (const weapon_t *w=nullptr) const
 
virtual double composite_spell_haste () const
 This is the subset of the old_spell_haste that applies to RPPM.
 
virtual double composite_spell_speed () const
 This is the old spell_haste and incorporates everything that buffs cast speed.
 
virtual double composite_spell_power (school_e school) const
 
virtual double composite_spell_crit_chance () const
 
virtual double composite_spell_crit_chance_multiplier () const
 
virtual double composite_spell_hit () const
 
virtual double composite_mastery () const
 
virtual double composite_mastery_value () const
 
virtual double composite_damage_versatility () const
 
virtual double composite_heal_versatility () const
 
virtual double composite_mitigation_versatility () const
 
virtual double composite_leech () const
 
virtual double composite_run_speed () const
 
virtual double composite_avoidance () const
 
virtual double composite_corruption () const
 
virtual double composite_corruption_resistance () const
 
virtual double composite_total_corruption () const
 
virtual double composite_armor () const
 
virtual double composite_bonus_armor () const
 
virtual double composite_base_armor_multiplier () const
 
virtual double composite_armor_multiplier () const
 
virtual double composite_miss () const
 
virtual double composite_dodge () const
 
virtual double composite_parry () const
 
virtual double composite_block () const
 Composite block chance. More...
 
virtual double composite_block_reduction (action_state_t *s) const
 
virtual double composite_crit_block () const
 
virtual double composite_crit_avoidance () const
 
virtual double composite_attack_power_multiplier () const
 
virtual double composite_spell_power_multiplier () const
 
virtual double matching_gear_multiplier (attribute_e) const
 
virtual double composite_player_multiplier (school_e) const
 
virtual double composite_player_dd_multiplier (school_e, const action_t *=nullptr) const
 
virtual double composite_player_td_multiplier (school_e, const action_t *a=nullptr) const
 
virtual double composite_persistent_multiplier (school_e) const
 Persistent multipliers that are snapshot at the beginning of the spell application/execution.
 
virtual double composite_player_target_multiplier (player_t *target, school_e school) const
 
virtual double composite_player_heal_multiplier (const action_state_t *s) const
 
virtual double composite_player_dh_multiplier (school_e) const
 
virtual double composite_player_th_multiplier (school_e) const
 
virtual double composite_player_absorb_multiplier (const action_state_t *s) const
 
virtual double composite_player_pet_damage_multiplier (const action_state_t *, bool guardian) const
 
virtual double composite_player_target_pet_damage_multiplier (player_t *target, bool guardian) const
 
virtual double composite_player_target_crit_chance (player_t *target) const
 
virtual double composite_player_critical_damage_multiplier (const action_state_t *s) const
 
virtual double composite_player_critical_healing_multiplier () const
 
virtual double composite_player_target_armor (player_t *target) const
 
virtual double composite_mitigation_multiplier (school_e) const
 
virtual double temporary_movement_modifier () const
 Return the highest-only temporary movement modifier. More...
 
virtual double passive_movement_modifier () const
 Return the sum of all passive movement modifier. More...
 
virtual double composite_movement_speed () const
 Return the combined (passive+temporary) movement speed. More...
 
virtual double composite_attribute (attribute_e attr) const
 
virtual double composite_attribute_multiplier (attribute_e attr) const
 
virtual double composite_rating_multiplier (rating_e) const
 
virtual double composite_rating (rating_e rating) const
 
virtual double composite_spell_hit_rating () const
 
virtual double composite_spell_crit_rating () const
 
virtual double composite_spell_haste_rating () const
 
virtual double composite_melee_hit_rating () const
 
virtual double composite_melee_crit_rating () const
 
virtual double composite_melee_haste_rating () const
 
virtual double composite_ranged_hit_rating () const
 
virtual double composite_ranged_crit_rating () const
 
virtual double composite_ranged_haste_rating () const
 
virtual double composite_mastery_rating () const
 
virtual double composite_expertise_rating () const
 
virtual double composite_dodge_rating () const
 
virtual double composite_parry_rating () const
 
virtual double composite_block_rating () const
 
virtual double composite_damage_versatility_rating () const
 
virtual double composite_heal_versatility_rating () const
 
virtual double composite_mitigation_versatility_rating () const
 
virtual double composite_leech_rating () const
 
virtual double composite_speed_rating () const
 
virtual double composite_avoidance_rating () const
 
virtual double composite_corruption_rating () const
 
virtual double composite_corruption_resistance_rating () const
 
virtual timespan_t composite_active_time () const
 Total activity time for this actor during the iteration.
 
virtual void interrupt ()
 Player is being interrupted.
 
virtual void halt ()
 
virtual void moving ()
 
virtual void finish_moving ()
 
virtual void stun ()
 
virtual void clear_debuffs ()
 
virtual void trigger_ready ()
 
virtual void schedule_ready (timespan_t delta_time=timespan_t::zero(), bool waiting=false)
 Player is ready to perform another action.
 
virtual void schedule_off_gcd_ready (timespan_t delta_time=timespan_t::min())
 
virtual void schedule_cwc_ready (timespan_t delta_time=timespan_t::min())
 
virtual void arise ()
 Player arises from the dead.
 
virtual void demise ()
 Player dies.
 
virtual timespan_t available () const
 
virtual action_tselect_action (const action_priority_list_t &, execute_type type=execute_type::FOREGROUND, const action_t *context=nullptr)
 
virtual action_texecute_action ()
 
virtual void regen (timespan_t periodicity=timespan_t::from_seconds(0.25))
 
virtual double resource_gain (resource_e resource_type, double amount, gain_t *source=nullptr, action_t *action=nullptr)
 
virtual double resource_loss (resource_e resource_type, double amount, gain_t *source=nullptr, action_t *action=nullptr)
 
virtual void recalculate_resource_max (resource_e resource_type, gain_t *source=nullptr)
 
virtual bool resource_available (resource_e resource_type, double cost) const
 
virtual bool record_healing () const
 Figure out if healing should be recorded.
 
virtual resource_e primary_resource () const
 
virtual role_e primary_role () const
 
virtual stat_e convert_hybrid_stat (stat_e s) const
 
virtual stat_e normalize_by () const
 Scale factor normalization stat. More...
 
virtual double health_percentage () const
 
virtual double max_health () const
 
virtual double current_health () const
 
virtual timespan_t time_to_percent (double percent) const
 
virtual void cost_reduction_gain (school_e school, double amount, gain_t *g=nullptr, action_t *a=nullptr)
 
virtual void cost_reduction_loss (school_e school, double amount, action_t *a=nullptr)
 
virtual void collect_resource_timeline_information ()
 
virtual void assess_damage (school_e, result_amount_type, action_state_t *)
 
virtual void target_mitigation (school_e, result_amount_type, action_state_t *)
 
virtual void assess_damage_imminent_pre_absorb (school_e, result_amount_type, action_state_t *)
 
virtual void assess_damage_imminent (school_e, result_amount_type, action_state_t *)
 
virtual void do_damage (action_state_t *)
 
virtual void assess_heal (school_e, result_amount_type, action_state_t *)
 
virtual bool taunt (player_t *)
 
virtual void summon_pet (util::string_view name, timespan_t duration=timespan_t::zero())
 
virtual void dismiss_pet (util::string_view name)
 
virtual std::unique_ptr< expr_tcreate_expression (util::string_view expression_str)
 
virtual std::unique_ptr< expr_tcreate_action_expression (action_t &, util::string_view expression_str)
 Player specific action expressions. More...
 
virtual std::unique_ptr< expr_tcreate_resource_expression (util::string_view expression_str)
 
virtual void create_options ()
 
void recreate_talent_str (talent_format format=talent_format::NUMBERS)
 
virtual std::string create_profile (save_e=SAVE_ALL)
 
virtual void copy_from (player_t *source)
 
virtual action_tcreate_action (util::string_view name, util::string_view options)
 
virtual void create_pets ()
 
virtual pet_tcreate_pet (util::string_view name, util::string_view type={})
 
virtual void armory_extensions (const std::string &, const std::string &, const std::string &, cache::behavior_e=cache::players())
 
virtual void do_dynamic_regen (bool forced=false)
 Perform dynamic resource regeneration. More...
 
virtual const player_tget_owner_or_self () const
 Returns owner if available, otherwise the player itself.
 
player_tget_owner_or_self ()
 
virtual bool has_t18_class_trinket () const
 
virtual const actor_target_data_tfind_target_data (const player_t *) const
 
virtual actor_target_data_tget_target_data (player_t *) const
 
virtual void pre_analyze_hook ()
 
virtual double composite_player_vulnerability (school_e) const
 
virtual void activate_action_list (action_priority_list_t *a, execute_type type=execute_type::FOREGROUND)
 Adds all on use item actions for all items with their on use effect not excluded in the exclude_effects string.
 
virtual void analyze (sim_t &)
 Analyze statistical data of a player.
 
scaling_metric_data_t scaling_for_metric (enum scale_metric_e metric) const
 Return the scaling metric over which this player gets scaled. More...
 
virtual action_tcreate_proc_action (util::string_view, const special_effect_t &)
 
virtual bool requires_data_collection () const
 
rng::rng_trng ()
 
rng::rng_trng () const
 
virtual timespan_t time_to_move () const
 
virtual void trigger_movement (double distance, movement_direction_type)
 
virtual void update_movement (timespan_t duration)
 
virtual void teleport (double yards, timespan_t duration=timespan_t::zero())
 Instant teleport. More...
 
virtual movement_direction_type movement_direction () const
 
virtual void cancel_auto_attacks ()
 Cancel the main hand (and off hand, if applicable) swing timer.
 
virtual void reset_auto_attacks (timespan_t delay=timespan_t::zero(), proc_t *proc=nullptr)
 Reset the main hand (and off hand, if applicable) swing timer Optionally delay by a set amount.
 
virtual void delay_auto_attacks (timespan_t delay, proc_t *proc=nullptr)
 Delay the main hand (and off hand, if applicable) swing timer.
 
virtual void acquire_target (retarget_source, player_t *=nullptr)
 Poor man's targeting support. More...
 
virtual std::string default_potion () const
 
virtual std::string default_flask () const
 
virtual std::string default_food () const
 
virtual std::string default_rune () const
 
virtual std::string default_temporary_enchant () const
 
virtual attack_power_type default_ap_type () const
 Default attack power type to use for value computation. More...
 
virtual void output_json_report (js::JsonOutput &) const
 
void add_active_dot (unsigned action_id)
 
void remove_active_dot (unsigned action_id)
 
unsigned get_active_dots (unsigned action_id) const
 
virtual void adjust_dynamic_cooldowns ()
 
virtual void adjust_global_cooldown (gcd_haste_type type)
 
virtual void adjust_auto_attack (gcd_haste_type type)
 
virtual void vision_of_perfection_proc ()
 8.2 Vision of Perfection proc handler More...
 
virtual player_tactor_by_name_str (util::string_view) const
 
void min_threshold_trigger ()
 Add a wake-up call at the next resource threshold level, compared to the current resource status of the actor.
 
void register_combat_begin (buff_t *b)
 Register a buff that triggers at the beginning of combat.
 
void register_precombat_begin (buff_t *b)
 Register a buff that triggers at the beginning of precombat.
 
void register_combat_begin (action_t *a)
 Register an action that triggers at the beginning of combat.
 
void register_combat_begin (const combat_begin_fn_t &fn)
 Register a custom function that triggers at the beginning of combat.
 
void register_precombat_begin (const combat_begin_fn_t &fn)
 Register a custom function that triggers at the beginning of precombat.
 
void register_combat_begin (double amount, resource_e resource, gain_t *g=nullptr)
 Register a resource gain that triggers at the beginning of combat.
 
void register_on_demise_callback (player_t *source, std::function< void(player_t *)> fn)
 
void register_on_arise_callback (player_t *source, std::function< void(void)> fn)
 
void register_on_kill_callback (std::function< void(player_t *)> fn)
 
void update_off_gcd_ready ()
 
void update_cast_while_casting_ready ()
 
spawner::base_actor_spawner_tfind_spawner (util::string_view id) const
 
int nth_iteration () const
 
bool is_ptr () const
 
- Public Member Functions inherited from actor_t
 actor_t (sim_t *s, util::string_view name)
 

Static Public Member Functions

static player_tcreate (sim_t *sim, const player_description_t &)
 
static bool _is_enemy (player_e t)
 
static bool _is_sleeping (const player_t *t)
 

Public Attributes

player_e type
 
player_tparent
 
int index
 
int creation_iteration
 
size_t actor_index
 
int actor_spawn_index
 
race_e race
 
role_e role
 
int true_level
 
int party
 
int ready_type
 
specialization_e _spec
 
bool bugs
 
int disable_hotfixes
 
bool scale_player
 
double death_pct
 
double height
 
double combat_reach
 
profile_source profile_source_
 
player_tdefault_target
 
player_ttarget
 
bool initialized
 
bool potion_used
 
std::string talents_str
 
std::string id_str
 
std::string target_str
 
std::string region_str
 
std::string server_str
 
std::string origin_str
 
std::string race_str
 
std::string professions_str
 
std::string position_str
 
enum player_t::timeofday_e timeofday
 
enum player_t::zandalari_loa_e zandalari_loa
 
enum player_t::vulpera_tricks_e vulpera_tricks
 
timespan_t gcd_ready
 
timespan_t base_gcd
 
timespan_t min_gcd
 
gcd_haste_type gcd_type
 
double gcd_current_haste_value
 
timespan_t started_waiting
 
std::vector< pet_t * > pet_list
 
std::vector< pet_t * > active_pets
 
std::vector< absorb_buff_t * > absorb_buff_list
 
std::map< unsigned, instant_absorb_tinstant_absorb_list
 
int invert_scaling
 
timespan_t reaction_offset
 
timespan_t reaction_max
 
timespan_t reaction_mean
 
timespan_t reaction_stddev
 
timespan_t reaction_nu
 
timespan_t world_lag
 
timespan_t world_lag_stddev
 
timespan_t brain_lag
 
timespan_t brain_lag_stddev
 
bool world_lag_override
 
bool world_lag_stddev_override
 
timespan_t cooldown_tolerance_
 
std::unique_ptr< dbc_tdbc
 
const dbc_override_tdbc_override
 
std::vector< std::unique_ptr< option_t > > options
 
std::vector< stat_e > stat_timelines
 
std::unique_ptr< player_talent_points_ttalent_points
 
std::string talent_overrides_str
 
std::array< int, PROFESSION_MAX > profession
 
std::unique_ptr< azerite::azerite_state_tazerite
 Azerite state object.
 
std::unique_ptr< azerite::azerite_essence_state_tazerite_essence
 Azerite essence state object.
 
std::unique_ptr< covenant::covenant_state_tcovenant
 Covenant state object.
 
struct player_t::base_initial_current_t base
 
struct player_t::base_initial_current_t initial
 
struct player_t::base_initial_current_t current
 
rating_t passive_rating_multiplier
 Passive combat rating multipliers.
 
gear_stats_t passive
 
timespan_t last_cast
 
struct player_t::diminishing_returns_constants_t def_dr
 
weapon_t main_hand_weapon
 
weapon_t off_hand_weapon
 
attack_tmain_hand_attack
 
attack_toff_hand_attack
 
double current_attack_speed
 
player_resources_t resources
 
action_texecuting
 
action_tqueueing
 
action_tchanneling
 
action_tstrict_sequence
 
event_treadying
 
event_toff_gcd
 
event_tcast_while_casting_poll_event
 
std::vector< const cooldown_t * > off_gcd_cd
 
std::vector< const cooldown_t * > off_gcd_icd
 
std::vector< const cooldown_t * > cast_while_casting_cd
 
std::vector< const cooldown_t * > cast_while_casting_icd
 
timespan_t off_gcd_ready
 
timespan_t cast_while_casting_ready
 
bool in_combat
 
bool action_queued
 
bool first_cast
 
action_tlast_foreground_action
 
std::vector< action_t * > prev_gcd_actions
 
std::vector< action_t * > off_gcdactions
 
timespan_t cast_delay_reaction
 
timespan_t cast_delay_occurred
 
effect_callbacks_t callbacks
 
auto_dispose< std::vector< special_effect_t * > > special_effects
 
std::vector< std::pair< player_t *, std::function< void(player_t *)> > > callbacks_on_demise
 
std::vector< std::pair< player_t *, std::function< void(void)> > > callbacks_on_arise
 
std::vector< std::function< void(player_t *)> > callbacks_on_kill
 
auto_dispose< std::vector< action_t * > > action_list
 
std::set< action_t * > dynamic_target_action_list
 Actions that have an action-specific dynamic targeting.
 
std::string action_list_str
 
std::string choose_action_list
 
std::string action_list_skip
 
std::string modify_action
 
std::string use_apl
 
bool use_default_action_list
 
auto_dispose< std::vector< dot_t * > > dot_list
 
auto_dispose< std::vector< action_priority_list_t * > > action_priority_list
 
std::vector< action_t * > precombat_action_list
 
action_priority_list_tactive_action_list
 
action_priority_list_tdefault_action_list
 
action_priority_list_tactive_off_gcd_list
 
action_priority_list_tactive_cast_while_casting_list
 
action_priority_list_trestore_action_list
 
std::unordered_map< std::string, std::string > alist_map
 
std::string action_list_information
 
bool no_action_list_provided
 
std::unordered_map< std::string, std::string > apl_variable_map
 
std::unordered_map< std::string, std::string > precombat_state_map
 
bool quiet
 
std::unique_ptr< player_report_extension_treport_extension
 
timespan_t arise_time
 
timespan_t iteration_fight_length
 
timespan_t iteration_waiting_time
 
timespan_t iteration_pooling_time
 
int iteration_executed_foreground_actions
 
std::array< double, RESOURCE_MAX > iteration_resource_lost
 
std::array< double, RESOURCE_MAX > iteration_resource_gained
 
std::array< double, RESOURCE_MAX > iteration_resource_overflowed
 
double rps_gain
 
double rps_loss
 
std::string tmi_debug_file_str
 
double tmi_window
 
auto_dispose< std::vector< buff_t * > > buff_list
 
auto_dispose< std::vector< proc_t * > > proc_list
 
auto_dispose< std::vector< gain_t * > > gain_list
 
auto_dispose< std::vector< stats_t * > > stats_list
 
auto_dispose< std::vector< benefit_t * > > benefit_list
 
auto_dispose< std::vector< uptime_t * > > uptime_list
 
auto_dispose< std::vector< cooldown_t * > > cooldown_list
 
auto_dispose< std::vector< target_specific_cooldown_t * > > target_specific_cooldown_list
 
auto_dispose< std::vector< real_ppm_t * > > rppm_list
 
auto_dispose< std::vector< shuffled_rng_t * > > shuffled_rng_list
 
std::vector< cooldown_t * > dynamic_cooldown_list
 
std::array< std::vector< plot_data_t >, STAT_MAX > dps_plot_data
 
std::vector< std::vector< plot_data_t > > reforge_plot_data
 
auto_dispose< std::vector< sample_data_helper_t * > > sample_data_list
 
std::vector< std::unique_ptr< cooldown_waste_data_t > > cooldown_waste_data_list
 
player_collected_data_t collected_data
 
double iteration_dmg
 
double priority_iteration_dmg
 
double iteration_dmg_taken
 
double dpr
 
std::vector< incoming_damage_entry_tincoming_damage
 
double iteration_heal
 
double iteration_heal_taken
 
double iteration_absorb
 
double iteration_absorb_taken
 
double hpr
 
std::vector< unsigned > absorb_priority
 
player_processed_report_information_t report_information
 
std::string items_str
 
std::string meta_gem_str
 
std::string potion_str
 
std::string flask_str
 
std::string food_str
 
std::string rune_str
 
std::string temporary_enchant_str
 
std::vector< item_titems
 
gear_stats_t gear
 
gear_stats_t enchant
 
gear_stats_t total_gear
 
std::unique_ptr< set_bonus_tsets
 
meta_gem_e meta_gem
 
bool matching_gear
 
bool karazhan_trinkets_paired
 
std::unique_ptr< cooldown_titem_cooldown
 
timespan_t default_item_group_cooldown
 
cooldown_tlegendary_tank_cloak_cd
 
double warlords_unseeing_eye
 
stats_twarlords_unseeing_eye_stats
 
double auto_attack_modifier
 
double auto_attack_multiplier
 
std::unique_ptr< player_scaling_tscaling
 
double base_movement_speed
 
double passive_modifier
 
double x_position
 
double y_position
 
double default_x_position
 
double default_y_position
 
struct player_t::consumables_t consumables
 
struct player_t::buffs_t buffs
 
struct player_t::debuffs_t debuffs
 
struct player_t::external_buffs_t external_buffs
 
struct player_t::gains_t gains
 
struct player_t::spells_t spells
 
struct player_t::procs_t procs
 
struct player_t::uptimes_t uptimes
 
struct player_t::racials_t racials
 
struct player_t::antumbra_t antumbra
 
struct player_t::passives_t passive_values
 
bool active_during_iteration
 
const spelleffect_data_t_mastery
 
player_stat_cache_t cache
 
auto_dispose< std::vector< action_variable_t * > > variables
 
std::vector< std::string > action_map
 
regen_type resource_regeneration
 
timespan_t last_regen
 Last iteration time regeneration occurred. Set at player_t::arise()
 
std::vector< bool > regen_caches
 A list of CACHE_x enumerations (stats) that affect the resource regeneration of the actor.
 
bool dynamic_regen_pets
 Flag to indicate if any pets require dynamic regneration. Initialized in player_t::init().
 
uint64_t visited_apls_
 Visited action lists, needed for call_action_list support. Reset by player_t::execute_action().
 
unsigned action_list_id_
 Internal counter for action priority lists, used to set action_priority_list_t::internal_id for lists.
 
execute_type current_execute_type
 Current execution type.
 
struct player_t::shadowlands_opt_t shadowlands_opts
 
event_tresource_threshold_trigger
 
std::vector< double > resource_thresholds
 
assessor::state_assessor_pipeline_t assessor_out_damage
 
std::vector< combat_begin_fn_tcombat_begin_functions
 
std::vector< combat_begin_fn_tprecombat_begin_functions
 
std::vector< spawner::base_actor_spawner_t * > spawners
 
- Public Attributes inherited from actor_t
sim_tsim
 
spawner::base_actor_spawner_tspawner
 
std::string name_str
 
int event_counter
 

Static Public Attributes

static const int default_level = 60
 

Friends

void sc_format_to (const player_t &, fmt::format_context::iterator)
 

Member Function Documentation

◆ acquire_target()

void player_t::acquire_target ( retarget_source  event,
player_t context = nullptr 
)
virtual

Poor man's targeting support.

Acquire_target is triggered by various events (see retarget_event_e) in the core. Context contains the triggering entity (if relevant). Figures out a target out of all non-sleeping targets. Skip "invulnerable" ones for now, anything else is fair game.

Reimplemented in pet_t.

◆ activate()

void player_t::activate ( )
virtual

A method to "activate" an actor in the simulator.

Single actor batch mode activates one primary actor at a time, while normal simulation mode activates all actors at the beginning of the sim.

NOTE: Currently, the only thing that occurs during activation of an actor is the registering of various state change callbacks (via the action_t::activate method) to the global actor lists. Actor pets are also activated by default.

Reimplemented in monk::monk_t.

◆ add_action() [1/2]

bool player_t::add_action ( util::string_view  action,
util::string_view  options = {},
util::string_view  alist = "default" 
)

Add action to action list.

Helper function to add actions with spell data of the same name to the action list, and check if that spell data is ok() returns true if spell data is ok(), false otherwise

◆ add_action() [2/2]

bool player_t::add_action ( const spell_data_t s,
util::string_view  options = {},
util::string_view  alist = "default" 
)

Add action to action list.

Helper function to add actions to the action list if given spell data is ok() returns true if spell data is ok(), false otherwise

◆ change_position()

void player_t::change_position ( position_e  new_pos)

Change the player position ( fron/back, etc.

) and update attack hit table

◆ composite_block()

double player_t::composite_block ( ) const
virtual

Composite block chance.

Use composite_block_dr function to apply diminishing returns on the part of your block which is affected by it. See paladin_t::composite_block() to see how this works.

Reimplemented in paladin::paladin_t.

◆ composite_movement_speed()

double player_t::composite_movement_speed ( ) const
virtual

Return the combined (passive+temporary) movement speed.

Multiplicative movement modifiers like snares can be applied here. They work similar to temporary speed boosts in that only the highest one counts.

Reimplemented in pet_t.

◆ create_action_expression()

std::unique_ptr< expr_t > player_t::create_action_expression ( action_t ,
util::string_view  expression_str 
)
virtual

Player specific action expressions.

Use this function for expressions which are bound to some action property (eg. target, cast_time, etc.) and not just to the player itself.

◆ create_buffs()

◆ default_ap_type()

virtual attack_power_type player_t::default_ap_type ( ) const
inlinevirtual

Default attack power type to use for value computation.

Defaults to BfA "new style" base_power + mh_weapon_dps * coefficient, can be overridden in class modules. Used by actions as a "last resort" to determine what attack power type drives the value calculation of the ability.

◆ do_dynamic_regen()

void player_t::do_dynamic_regen ( bool  forced = false)
virtual

Perform dynamic resource regeneration.

The forced parameter indicates whether the resource regen would also occur in game at the same time.

Reimplemented in priestspace::priest_t.

◆ find_spell()

const spell_data_t * player_t::find_spell ( util::string_view  name,
specialization_e  s = SPEC_NONE 
) const

Tries to find spell data by name.

It does this by going through various spell lists in following order: class spell, specialization spell, mastery spell, talent spell, racial spell, pet_spell

◆ find_talent_spell()

const spell_data_t * player_t::find_talent_spell ( util::string_view  n,
specialization_e  s = SPEC_NONE,
bool  name_tokenized = false,
bool  check_validity = true 
) const

Retrieves the Spell Data Associated with a given talent.

If the player does not have have the talent activated, or the talent is not found, spell_data_t::not_found() is returned. The talent search by name is case sensitive, including all special characters!

◆ init_absorb_priority()

void player_t::init_absorb_priority ( )
virtual

Define absorb priority.

Absorbs with the high priority flag will follow the order in absorb_priority vector when resolving. This method should be overwritten in class modules to declare the order of spec-specific high priority absorbs.

◆ init_azerite()

void player_t::init_azerite ( )
virtual

Initializes the Azerite-related support structures for an actor if there are any.

Since multiple instances of the same azerite power can be worn by an actor, we need to ensure that only one instance of the azerite power gets initialized. Ensure this by building a simple map that keeps initialization status for all azerite powers defined for the actor from different sources (currently only items). Initialization status changes automatically when an azerite_power_t object is created for the actor.

Note, guards against invocation from non-player actors (enemies, adds, pets ...)

◆ init_base_stats()

◆ init_initial_stats()

void player_t::init_initial_stats ( )
virtual

Initialize initial stats from base + gear.

After player_t::init_initial is executed, you can modify the initial member until combat starts

◆ init_special_effect()

void player_t::init_special_effect ( special_effect_t effect)
virtual

Modify generic special effect initialization.

Intended to allow modifications to some aspects of the special effect (or buffs, actions or callbacks it instantiates), including outright replacement.

This method is called after generic special effect initialization occurs, but before any proc objects (e.g., dbc_proc_callback_t-derived objects) are initialized.

Reimplemented in monk::monk_t.

◆ level()

int player_t::level ( ) const
virtual

Scaled player level.

Options such as timewalking will affect the players true_level.

◆ merge()

void player_t::merge ( player_t other)
virtual

Merge player data with player from other thread.

After simulating the same setup in multiple sim/threads, this function will merge the same player (and its collected data) from two simulations together, aggregating the collected data.

Reimplemented in monk::monk_t.

◆ normalize_by()

stat_e player_t::normalize_by ( ) const
virtual

Scale factor normalization stat.

Determine the stat by which scale factors are normalized, so that this stat will get a value of 1.0.

◆ passive_movement_modifier()

double player_t::passive_movement_modifier ( ) const
virtual

Return the sum of all passive movement modifier.

There are 2 categories of movement speed buffs: Passive and Temporary, both which stack additively. Passive buffs include movement speed enchant, unholy presence, cat form and generally anything that has the ability to be kept active all fight. These permanent buffs do stack with each other. Temporary includes all other speed bonuses, however, only the highest temporary bonus will be added on top.

◆ register_resource_callback()

void player_t::register_resource_callback ( resource_e  resource,
double  value,
resource_callback_function_t  callback,
bool  use_pct,
bool  fire_once = true 
)

Add a new resource callback, firing when a specified threshold for a resource is crossed.

Can either be a absolute value, or if use_pct is set, a percent-point value.

Warning: Does not work for main enemy target on sim->iterations==0 or sim->fixed_time==1

◆ reset()

void player_t::reset ( )
virtual

Reset player.

Called after each iteration to reset the player to its initial state.

Reimplemented in monk::monk_t, warlock::warlock_t, priestspace::priest_t, paladin::paladin_t, and pet_t.

◆ scaling_for_metric()

scaling_metric_data_t player_t::scaling_for_metric ( enum scale_metric_e  metric) const

Return the scaling metric over which this player gets scaled.

This is used for scale factors, reforge plots, etc. as the default metric to display/calculate. By default this will be personal dps or hps, but can also be dtps, tmi, etc.

◆ teleport()

void player_t::teleport ( double  yards,
timespan_t  duration = timespan_t::zero() 
)
virtual

Instant teleport.

No overshooting support for now.

◆ temporary_movement_modifier()

double player_t::temporary_movement_modifier ( ) const
virtual

Return the highest-only temporary movement modifier.

There are 2 categories of movement speed buffs: Passive and Temporary, both which stack additively. Passive buffs include movement speed enchant, unholy presence, cat form and generally anything that has the ability to be kept active all fight. These permanent buffs do stack with each other. Temporary includes all other speed bonuses, however, only the highest temporary bonus will be added on top.

Reimplemented in monk::monk_t, and paladin::paladin_t.

◆ vision_of_perfection_proc()

void player_t::vision_of_perfection_proc ( )
virtual

8.2 Vision of Perfection proc handler

Carries out class & spec-specific code when Vision of Perfection Procs. Overridden in class modules.

Reimplemented in paladin::paladin_t.