9 #include "dbc/data_definitions.hh" 10 #include "player/target_specific.hpp" 11 #include "sc_enums.hpp" 12 #include "util/timespan.hpp" 13 #include "util/generic.hpp" 14 #include "util/string_view.hpp" 15 #include "util/format.hpp" 55 std::string name_str_reporting;
192 bool may_hit, may_miss, may_dodge, may_parry, may_glance, may_block, may_crit, tick_may_crit;
284 } attack_power_mod, spell_power_mod;
308 std::array< double, RESOURCE_MAX >
base_costs, secondary_costs;
333 double crit_multiplier;
334 double crit_bonus_multiplier;
336 double base_dd_adder;
337 double base_ta_adder;
359 double dynamic_recharge_rate_multiplier;
374 double energize_amount;
389 std::vector< action_t* > child_action;
404 action_energize energize_type;
407 resource_e energize_resource;
460 int max_cycle_targets;
478 bool interrupt_immediate;
480 std::string if_expr_str;
481 std::string target_if_str;
482 std::string interrupt_if_expr_str;
483 std::string early_chain_if_expr_str;
484 std::string cancel_if_expr_str;
485 std::string sync_str;
486 std::string target_str;
490 bool interrupt_global;
492 std::unique_ptr<expr_t> if_expr;
494 enum target_if_mode_e
502 std::unique_ptr<expr_t> target_if_expr;
503 std::unique_ptr<expr_t> interrupt_if_expr;
504 std::unique_ptr<expr_t> early_chain_if_expr;
505 std::unique_ptr<expr_t> cancel_if_expr;
507 std::string signature_str;
521 proc_t* queue_failed_proc;
522 uint_least64_t total_executions;
541 unsigned snapshot_flags;
543 unsigned update_flags;
554 std::vector< player_t* > list;
557 }
mutable target_cache;
560 std::vector<std::unique_ptr<option_t>> options;
562 std::vector<travel_event_t*> travel_events;
571 void add_option( std::unique_ptr<option_t> new_option );
573 void check_spec( specialization_e );
588 {
return ( *s_data ); }
597 const int num_targets = n_targets();
598 return num_targets == -1 || num_targets > 0;
601 const char* name()
const 602 {
return name_str.c_str(); }
604 const char* name_reporting()
const;
606 size_t num_travel_events()
const 607 {
return travel_events.size(); }
609 bool has_travel_events()
const 610 {
return ! travel_events.empty(); }
614 bool has_travel_events_for(
const player_t* target )
const;
619 return attack_power_mod.direct > 0 || attack_power_mod.tick > 0
620 || spell_power_mod.direct > 0 || spell_power_mod.tick > 0
621 || (weapon && weapon_multiplier > 0);
626 void parse_effect_direct_mods(
const spelleffect_data_t& spelleffect_data,
bool item_scaling );
627 void parse_effect_periodic_mods(
const spelleffect_data_t& spelleffect_data,
bool item_scaling );
632 void parse_target_str();
636 void reschedule_queue_event();
642 player_t* select_target_if_target();
646 void apply_affecting_conduit(
const conduit_data_t& conduit,
int effect_num = 1 );
647 void apply_affecting_conduit_effect(
const conduit_data_t& conduit,
size_t effect_num );
651 void execute_on_target(
player_t*,
double = -1.0 );
663 virtual bool verify_actor_level()
const;
665 virtual bool verify_actor_spec()
const;
667 virtual bool verify_actor_weapon()
const;
669 virtual double cost()
const;
671 virtual double base_cost()
const;
673 virtual double cost_per_tick( resource_e )
const;
679 virtual double false_positive_pct()
const;
681 virtual double false_negative_pct()
const;
684 {
return base_execute_time; }
695 return RESULT_UNKNOWN;
698 virtual block_result_e calculate_block_result(
action_state_t* s )
const;
700 virtual double calculate_direct_amount(
action_state_t* state )
const;
702 virtual double calculate_tick_amount(
action_state_t* state,
double multiplier )
const;
704 virtual double calculate_weapon_damage(
double attack_power )
const;
706 virtual double calculate_crit_damage_bonus(
action_state_t* s )
const;
708 virtual double recharge_multiplier(
const cooldown_t& )
const 709 {
return base_recharge_multiplier * dynamic_recharge_multiplier; }
711 virtual double recharge_rate_multiplier(
const cooldown_t& )
const 712 {
return base_recharge_rate_multiplier * dynamic_recharge_rate_multiplier; }
717 virtual resource_e current_resource()
const 718 {
return resource_current; }
720 virtual int n_targets()
const 725 virtual result_amount_type amount_type(
const action_state_t* ,
bool =
false )
const 726 {
return result_amount_type::NONE; }
728 virtual result_amount_type report_amount_type(
const action_state_t* state )
const;
734 virtual double miss_chance(
double ,
player_t* )
const 737 virtual double dodge_chance(
double ,
player_t* )
const 740 virtual double parry_chance(
double ,
player_t* )
const 743 virtual double glance_chance(
int )
const 754 virtual int num_targets()
const;
756 virtual size_t available_targets( std::vector< player_t* >& )
const;
758 virtual std::vector< player_t* >& target_list()
const;
760 virtual player_t* find_target_by_number(
int number )
const;
762 virtual bool execute_targeting(
action_t* action )
const;
764 virtual std::vector<player_t*>& targets_in_range_list( std::vector< player_t* >& tl )
const;
766 virtual std::vector<player_t*>& check_distance_targeting( std::vector< player_t* >& tl )
const;
768 virtual double ppm_proc_chance(
double PPM )
const;
770 virtual bool usable_moving()
const;
774 virtual double attack_direct_power_coefficient(
const action_state_t* )
const 775 {
return attack_power_mod.direct; }
777 virtual double amount_delta_modifier(
const action_state_t* )
const 778 {
return amount_delta; }
780 virtual double attack_tick_power_coefficient(
const action_state_t* )
const 781 {
return attack_power_mod.tick; }
783 virtual double spell_direct_power_coefficient(
const action_state_t* )
const 784 {
return spell_power_mod.direct; }
786 virtual double spell_tick_power_coefficient(
const action_state_t* )
const 787 {
return spell_power_mod.tick; }
790 {
return base_dd_min; }
793 {
return base_dd_max; }
799 {
return base_dd_adder; }
802 {
return base_ta_adder; }
804 virtual double range_()
const 807 virtual double radius_()
const 810 virtual double action_multiplier()
const 811 {
return base_multiplier; }
813 virtual double action_da_multiplier()
const 814 {
return base_dd_multiplier; }
816 virtual double action_ta_multiplier()
const 817 {
return base_td_multiplier; }
819 virtual double composite_hit()
const 822 virtual double composite_crit_chance()
const 823 {
return base_crit; }
825 virtual double composite_crit_chance_multiplier()
const 828 virtual double composite_crit_damage_bonus_multiplier()
const 829 {
return crit_bonus_multiplier; }
831 virtual double composite_haste()
const 834 virtual attack_power_type get_attack_power_type()
const 837 virtual double composite_attack_power()
const;
839 virtual double composite_spell_power()
const;
841 virtual double composite_target_armor(
player_t* t )
const;
843 virtual double composite_target_crit_chance(
player_t* target )
const;
845 virtual double composite_target_crit_damage_bonus_multiplier(
player_t* )
const 848 virtual double composite_target_multiplier(
player_t* target )
const;
850 virtual double composite_target_damage_vulnerability(
player_t* target )
const;
852 virtual double composite_versatility(
const action_state_t* )
const 857 virtual double composite_run_speed()
const;
859 virtual double composite_avoidance()
const;
861 virtual double composite_corruption()
const;
863 virtual double composite_corruption_resistance()
const;
865 virtual double composite_total_corruption()
const;
869 {
return composite_target_multiplier( target ); }
873 {
return composite_target_multiplier( target ); }
875 virtual double composite_da_multiplier(
const action_state_t* )
const;
878 virtual double composite_ta_multiplier(
const action_state_t* )
const;
881 virtual double composite_persistent_multiplier(
const action_state_t*)
const;
892 virtual double composite_target_mitigation(
player_t* t, school_e s)
const;
894 virtual double composite_player_critical_multiplier(
const action_state_t* s)
const;
898 {
return PROC1_INVALID; }
900 virtual bool has_movement_directionality()
const;
902 virtual double composite_teleport_distance(
const action_state_t* )
const 903 {
return base_teleport_distance; }
908 virtual bool dot_refreshable(
const dot_t* dot,
timespan_t triggered_duration )
const;
910 virtual double composite_energize_amount(
const action_state_t* )
const 911 {
return energize_amount; }
913 virtual resource_e energize_resource_()
const 914 {
return energize_resource; }
916 virtual action_energize energize_type_()
const 917 {
return energize_type; }
926 virtual void parse_options( util::string_view options_str );
928 virtual void consume_resource();
930 virtual void execute();
932 virtual void tick(
dot_t* d);
934 virtual void last_tick(
dot_t* d);
936 virtual void assess_damage( result_amount_type,
action_state_t* state );
942 virtual void queue_execute( execute_type type );
944 virtual void reschedule_execute(
timespan_t time);
946 virtual void start_gcd();
948 virtual void update_ready(
timespan_t cd_duration = timespan_t::min());
951 virtual bool ready();
954 virtual bool action_ready();
956 virtual bool select_target();
958 virtual bool target_ready(
player_t* target );
961 virtual bool usable_during_current_cast()
const;
963 virtual bool usable_during_current_gcd()
const;
967 virtual void init_finished();
969 virtual void reset();
971 virtual void cancel();
973 virtual void interrupt_action();
977 virtual void activate();
979 virtual std::unique_ptr<expr_t> create_expression(util::string_view name);
991 virtual void snapshot_internal(
action_state_t*,
unsigned flags, result_amount_type );
993 virtual void snapshot_state(
action_state_t* s,
unsigned flags, result_amount_type rt )
994 { snapshot_internal( s, flags, rt ); }
996 virtual void snapshot_state(
action_state_t* s, result_amount_type rt )
997 { snapshot_state( s, snapshot_flags, rt ); }
999 virtual void update_state(
action_state_t* s,
unsigned flags, result_amount_type rt )
1000 { snapshot_internal( s, flags, rt ); }
1002 virtual void update_state(
action_state_t* s, result_amount_type rt )
1003 { update_state( s, update_flags, rt ); }
1007 virtual bool consume_cost_per_tick(
const dot_t& dot );
1015 virtual void set_target(
player_t* target );
1017 virtual void gain_energize_resource( resource_e resource_type,
double amount,
gain_t* gain );
1023 static bool result_is_hit( result_e r )
1025 return( r == RESULT_HIT ||
1027 r == RESULT_GLANCE ||
1031 static bool result_is_miss( result_e r )
1033 return( r == RESULT_MISS ||
1034 r == RESULT_DODGE ||
1035 r == RESULT_PARRY );
1038 static bool result_is_block( block_result_e r )
1040 return( r == BLOCK_RESULT_BLOCKED || r == BLOCK_RESULT_CRIT_BLOCKED );
1043 friend void sc_format_to(
const action_t&, fmt::format_context::iterator );
1051 void execute()
override 1060 util::string_view name =
"swap_action_list" );
1062 void execute()
override;
1063 bool ready()
override;
1070 void execute()
override;
bool interrupt
Interrupt option.
Definition: action.hpp:465
Definition: action.hpp:1046
attack_power_type ap_type
Type of attack power used by the ability.
Definition: action.hpp:247
double base_dd_multiplier
base direct damage multiplier
Definition: action.hpp:323
Definition: action.hpp:1066
Definition: option.hpp:38
bool interrupt_auto_attack
False if channeled action does not reschedule autoattacks, used on abilities such as bladestorm...
Definition: action.hpp:149
double base_recharge_rate_multiplier
A second static action cooldown duration multiplier that also reduces the effectiveness of flat coold...
Definition: action.hpp:355
double min_travel_time
Minimum travel time in seconds.
Definition: action.hpp:371
bool ground_aoe
This ability leaves a ticking dot on the ground, and doesn't move when the target moves...
Definition: action.hpp:229
virtual school_e get_school() const
Use when damage schools change during runtime.
Definition: action.hpp:731
bool interrupt_immediate_occurred
Did a channel action have an interrupt_immediate used to cancel it on it.
Definition: action.hpp:239
Definition: action_state.hpp:132
bool is_precombat
Whether the action is used from the precombat action list. Will be set up automatically by action_t::...
Definition: action.hpp:186
double last_resource_cost
Last available, effectively used resource cost.
Definition: action.hpp:435
action_state_t * execute_state
State of the last execute()
Definition: action.hpp:536
event_t * execute_event
Execute event (e.g., "casting" of the action)
Definition: action.hpp:423
timespan_t trigger_gcd
Length of unhasted gcd triggered when used.
Definition: action.hpp:266
double amount_delta
full damage variation in %
Definition: action.hpp:293
Definition: action_priority_list.hpp:20
bool chain
Chain can be used to re-cast a channeled spell at the beginning of its last tick. ...
Definition: action.hpp:472
timespan_t dot_duration
Default full duration of dot.
Definition: action.hpp:302
dot_t * parent_dot
This is used to cache/track spells that have a parent driver, such as most channeled/ground aoe abili...
Definition: action.hpp:387
Definition: cooldown.hpp:26
double base_dd_min
Minimum base direct damage.
Definition: action.hpp:314
std::array< double, RESOURCE_MAX > base_costs_per_tick
Cost of using ability per periodic effect tick.
Definition: action.hpp:311
double chain_multiplier
Damage modifier for chained/AoE, exponentially increased by number of target hit. ...
Definition: action.hpp:343
bool direct_tick
Used with DoT Drivers, tells simc that the direct hit is actually a tick.
Definition: action.hpp:161
bool reset_auto_attack
True if channeled action fully resets the autoattack timer rather than simply delaying it...
Definition: action.hpp:152
virtual bool has_amount_result() const
Determine if the action can have a resulting damage/heal amount > 0.
Definition: action.hpp:617
const spell_data_t & data() const
Spell Data associated with the action.
Definition: action.hpp:587
bool tick_on_application
Whether or not the ability/dot ticks when it is first applied, but not on refresh applications...
Definition: action.hpp:198
dot_behavior_e dot_behavior
Behavior of dot.
Definition: action.hpp:254
school_e school
What type of damage this spell does.
Definition: action.hpp:74
action_t * tick_action
This action will execute every tick.
Definition: action.hpp:392
Definition: spell_data.hpp:398
gcd_haste_type gcd_type
Hasted GCD stat type. One of HASTE_NONE, HASTE_ATTACK, HASTE_SPELL, SPEED_ATTACK, SPEED_SPELL...
Definition: action.hpp:263
Target Cache System.
Definition: action.hpp:553
double weapon_power_mod
Weapon AP multiplier.
Definition: action.hpp:279
action_state_t * pre_execute_state
Optional - if defined before execute(), will be copied into execute_state.
Definition: action.hpp:539
virtual double composite_target_ta_multiplier(player_t *target) const
Tick amount multiplier due to debuffs on the target.
Definition: action.hpp:872
int internal_id
player & action-name unique id.
Definition: action.hpp:87
timespan_t ground_aoe_duration
Duration of the ground area trigger.
Definition: action.hpp:244
bool ignores_armor
Used with psudo-DoT effects, tells us to ignore armor even if the physical damage is direct...
Definition: action.hpp:164
cooldown_t * cooldown
Used to manipulate cooldown duration and charges.
Definition: action.hpp:417
timespan_t time_to_travel
Last available, effectively used travel time.
Definition: action.hpp:432
virtual double composite_aoe_multiplier(const action_state_t *) const
Generic aoe multiplier for the action.
Definition: action.hpp:889
bool usable_while_casting
True if ability is usable while casting another spell.
Definition: action.hpp:146
Definition: action.hpp:47
std::array< double, RESOURCE_MAX > base_costs
Cost of using the ability.
Definition: action.hpp:308
action_t * execute_action
This action will execute every execute.
Definition: action.hpp:395
Definition: action.hpp:447
stats_t * stats
action statistics, merged by action-name
Definition: action.hpp:420
timespan_t min_gcd
The minimum gcd triggered no matter the haste.
Definition: action.hpp:260
double reduced_aoe_targets
Reduce damage to targets when total targets is greater than value Formula used is <damage per="" targ...
Definition: action.hpp:216
Definition: action_state.hpp:20
bool ignore_false_positive
Used for actions that will do awful things to the sim when a "false positive" skill roll happens...
Definition: action.hpp:155
double base_multiplier
base damage multiplier (direct and tick damage)
Definition: action.hpp:329
timespan_t base_tick_time
Amount of time the ability uses between ticks.
Definition: action.hpp:299
bool tick_zero
Whether or not the ability/dot ticks immediately on usage.
Definition: action.hpp:195
double radius
AoE ability area of influence.
Definition: action.hpp:276
double travel_speed
Missile travel speed in yards / second.
Definition: action.hpp:365
movement_direction_type movement_directionality
Movement Direction.
Definition: action.hpp:384
double base_td
Base tick damage.
Definition: action.hpp:320
bool harmful
Simplified: Will the ability pull the boss if used.
Definition: action.hpp:173
bool is_interrupt
Whether or not the action is an interrupt (specifically triggers PF2_CAST_INTERRUPT callbacks) ...
Definition: action.hpp:183
bool special
Whether or not the spell uses the yellow attack hit table.
Definition: action.hpp:108
bool background
Enables/Disables direct execution of the ability in an action list.
Definition: action.hpp:131
timespan_t ability_lag
Ability specific extra player ready delay.
Definition: action.hpp:257
weapon_t * weapon
Weapon used for this ability. If set extra weapon damage is calculated.
Definition: action.hpp:63
bool not_a_proc
Specifies that a spell is not a proc and can be considered for triggering only proc from class abilit...
Definition: action.hpp:105
proc_t * starved_proc
Resource starvation tracking.
Definition: action.hpp:517
double weapon_multiplier
Weapon damage for the ability.
Definition: action.hpp:340
bool initialized
Is the action initialized? (action_t::init ran successfully)
Definition: action.hpp:189
bool dynamic_tick_action
Used with tick_action, tells tick_action to update state on every tick.
Definition: action.hpp:235
double action_skill
Skill is now done per ability, with the default being set to the player option.
Definition: action.hpp:158
bool use_off_gcd
Check if action is executable between GCD's.
Definition: action.hpp:140
bool may_hit
Self explanatory.
Definition: action.hpp:192
double range
This is how far away the target can be from the player, and still be hit or targeted.
Definition: action.hpp:269
virtual double composite_target_da_multiplier(player_t *target) const
Direct amount multiplier due to debuffs on the target.
Definition: action.hpp:868
Class for representing InGame time.
Definition: timespan.hpp:37
int aoe
The amount of targets that an ability impacts on. -1 will hit all targets.
Definition: action.hpp:93
Definition: player.hpp:109
bool quiet
Disables/enables reporting of this action.
Definition: action.hpp:121
timespan_t time_to_execute
Last available, effectively used execute time.
Definition: action.hpp:429
double base_teleport_distance
Maximum distance that the ability can travel. Used on abilities that instantly move you...
Definition: action.hpp:362
timespan_t base_execute_time
Amount of time the ability uses to execute before modifiers.
Definition: action.hpp:296
bool use_while_casting
True if ability should be used while casting another spell.
Definition: action.hpp:143
Action expression.
Definition: expressions.hpp:79
double dynamic_recharge_multiplier
Dynamically adjustable action cooldown duration multipliers. These are reset to 1.0 in action_t::reset.
Definition: action.hpp:358
const item_t * item
Item back-pointer for trinket-sourced actions so we can show proper tooltips in reports.
Definition: action.hpp:60
Definition: covenant.hpp:34
Definition: spell_data.hpp:145
resource_e resource_current
What resource does this ability use.
Definition: action.hpp:90
bool consume_per_tick_
Need to consume per tick?
Definition: action.hpp:209
double base_td_multiplier
base tick damage multiplier
Definition: action.hpp:326
std::vector< school_e > base_schools
What base school components this spell has.
Definition: action.hpp:77
Definition: action_priority_list.hpp:35
bool sequence
mark this as a sequence_t action
Definition: action.hpp:114
unsigned id
Spell id if available, 0 otherwise.
Definition: action.hpp:80
Random number generation.
Definition: action.hpp:37
double base_dd_max
Maximum base direct damage.
Definition: action.hpp:317
virtual proc_types proc_type() const
Action proc type, needed for dynamic aoe stuff and such.
Definition: action.hpp:897
double chain_bonus_damage
Damage modifier for chained/AoE, linearly increasing with each target hit.
Definition: action.hpp:346
Definition: weapon.hpp:12
bool split_aoe_damage
Split damage evenly between targets.
Definition: action.hpp:212
double base_aoe_multiplier
Static reduction of damage for AoE.
Definition: action.hpp:349
Simulation engine.
Definition: sim.hpp:61
bool allow_class_ability_procs
Allows triggering of procs marked to only proc from class abilities.
Definition: action.hpp:102
helper class to make a class non-copyable
Definition: generic.hpp:81
Definition: action.hpp:1055
bool normalize_weapon_speed
Normalize weapon speed for weapon damage calculations.
Definition: action.hpp:226
bool hasted_ticks
Whether or not ticks scale with haste.
Definition: action.hpp:206
bool round_base_dmg
Round spell base damage to integer before using.
Definition: action.hpp:232
bool channeled
Tells the sim to not perform any other actions, as the ability is channeled.
Definition: action.hpp:111
double travel_delay
Missile travel delay in seconds.
Definition: action.hpp:368
bool callbacks
enables/disables proc callback system on the action, like trinkets, enchants, rppm.
Definition: action.hpp:99
player_t * default_target
Default target is needed, otherwise there's a chance that cycle_targets option will MAJORLY mess up t...
Definition: action.hpp:71
std::unique_ptr< cooldown_t > line_cooldown
Cooldown for specific APL line.
Definition: action.hpp:531
int moving
moving (default: -1), when different from -1, will flag the action as usable only when the players ar...
Definition: action.hpp:456
action_t * impact_action
This action will execute every impact - Useful for AoE debuffs.
Definition: action.hpp:398
char marker
Marker for sample action priority list reporting.
Definition: action.hpp:441
bool dual
If set to true, this action will not be counted toward total amount of executes in reporting...
Definition: action.hpp:96
bool repeating
Used for abilities that repeat themselves without user interaction, only used on autoattacks.
Definition: action.hpp:167
double base_recharge_multiplier
Static action cooldown duration multiplier.
Definition: action.hpp:352
int full_amount_targets
If reduced_aoe_targets > 0, the number of target(s) that will take full unreduced amount...
Definition: action.hpp:219
bool proc
Whether or not this ability is a proc.
Definition: action.hpp:180
int num_targets_hit
Last available number of targets effectively hit.
Definition: action.hpp:438
event_t * queue_event
Queue delay event (for queueing cooldowned actions shortly before they execute.
Definition: action.hpp:426