Skip to content

Commit 62fb49d

Browse files
authored
[Action] use explicit state flags instead of composite STATE_MUL_DA/TA (#11727)
As various state flags exhibit different behavior, especially wrt to various SX_IGNORE spell attributes, they should be individually handled instead of using composite flags.
1 parent f3400f7 commit 62fb49d

11 files changed

Lines changed: 27 additions & 23 deletions

File tree

engine/action/action.cpp

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2730,20 +2730,23 @@ void action_t::init()
27302730

27312731
if ( does_periodic_damage() )
27322732
{
2733-
snapshot_flags |= STATE_MUL_TA | STATE_MUL_VERSUS | STATE_TGT_MUL_TA | STATE_TGT_MITG_TA | STATE_MUL_PERSISTENT | STATE_VERSATILITY;
2733+
snapshot_flags |= STATE_MUL_SPELL_TA | STATE_MUL_PLAYER_DAM | STATE_MUL_VERSUS | STATE_TGT_MUL_TA |
2734+
STATE_TGT_MITG_TA | STATE_MUL_PERSISTENT | STATE_VERSATILITY;
27342735
}
27352736

27362737
if ( does_direct_damage() )
27372738
{
2738-
snapshot_flags |= STATE_MUL_DA | STATE_MUL_VERSUS | STATE_TGT_MUL_DA | STATE_TGT_MITG_DA | STATE_MUL_PERSISTENT | STATE_VERSATILITY;
2739+
snapshot_flags |= STATE_MUL_SPELL_DA | STATE_MUL_PLAYER_DAM | STATE_MUL_VERSUS | STATE_TGT_MUL_DA |
2740+
STATE_TGT_MITG_DA | STATE_MUL_PERSISTENT | STATE_VERSATILITY;
27392741

27402742
// Because schools can change during runtime, armor is flagged and not snapshot if determined to be non-physical
27412743
if ( !ignores_armor )
27422744
snapshot_flags |= STATE_TGT_ARMOR;
27432745
}
27442746

2745-
if ( player->is_pet() && ( snapshot_flags & ( STATE_MUL_DA | STATE_MUL_TA | STATE_MUL_VERSUS | STATE_TGT_MUL_DA | STATE_TGT_MUL_TA |
2746-
STATE_MUL_PERSISTENT | STATE_VERSATILITY ) ) )
2747+
if ( player->is_pet() &&
2748+
( snapshot_flags & ( STATE_MUL_SPELL_DA | STATE_MUL_SPELL_TA | STATE_MUL_PLAYER_DAM | STATE_MUL_VERSUS |
2749+
STATE_TGT_MUL_DA | STATE_TGT_MUL_TA | STATE_MUL_PERSISTENT | STATE_VERSATILITY ) ) )
27472750
{
27482751
snapshot_flags |= STATE_MUL_PET | STATE_TGT_MUL_PET;
27492752
}
@@ -2802,7 +2805,8 @@ void action_t::init()
28022805
{
28032806
if ( is_periodic_damage_effect( eff ) && eff.flags( spelleffect_attribute::EX_COMPUTE_ON_CAST ) )
28042807
{
2805-
update_flags &= ~( STATE_AP | STATE_SP | STATE_MUL_TA | STATE_MUL_VERSUS | STATE_VERSATILITY );
2808+
update_flags &=
2809+
~( STATE_AP | STATE_SP | STATE_MUL_SPELL_TA | STATE_MUL_PLAYER_DAM | STATE_MUL_VERSUS | STATE_VERSATILITY );
28062810
break;
28072811
}
28082812
}

engine/action/residual_action.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ struct residual_periodic_action_t : public Base
6161
// ab::hasted_ticks = false;
6262
// ab::rolling_periodic = false;
6363
// ab::dot_behavior = dot_behavior_e::DOT_REFRESH_DURATION;
64-
// ab::snapshot_flags |= STATE_MUL_TA | STATE_TGT_MUL_TA | STATE_MUL_PERSISTENT | STATE_VERSATILITY;
64+
// ab::snapshot_flags |= STATE_MUL_SPELL_TA | STATE_MUL_PLAYER_DAM | STATE_TGT_MUL_TA | STATE_MUL_PERSISTENT | STATE_VERSATILITY;
6565
}
6666

6767
action_state_t* new_state() override

engine/class_modules/monk/sc_monk.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4090,7 +4090,7 @@ struct celestial_fortune_t : public monk_heal_t
40904090
// disable the snapshot_flags for all multipliers, but specifically allow
40914091
// action_multiplier() to be called so we can override.
40924092
snapshot_flags &= STATE_NO_MULTIPLIER;
4093-
snapshot_flags |= STATE_MUL_DA;
4093+
snapshot_flags |= STATE_MUL_SPELL_DA | STATE_MUL_PLAYER_DAM;
40944094
}
40954095
};
40964096

engine/class_modules/paladin/sc_paladin_retribution.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -206,9 +206,9 @@ struct execution_sentence_t : public paladin_melee_attack_t
206206
void init() override
207207
{
208208
paladin_melee_attack_t::init();
209-
snapshot_flags |= STATE_TARGET_NO_PET | STATE_MUL_TA | STATE_MUL_DA;
209+
snapshot_flags |= STATE_TARGET_NO_PET | STATE_MUL_SPELL_DA | STATE_MUL_SPELL_TA | STATE_MUL_PLAYER_DAM;
210210
update_flags &= ~STATE_TARGET;
211-
update_flags |= STATE_MUL_TA | STATE_MUL_DA;
211+
update_flags |= STATE_MUL_SPELL_DA | STATE_MUL_SPELL_TA | STATE_MUL_PLAYER_DAM;
212212
}
213213
};
214214

engine/class_modules/priest/sc_priest.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1127,7 +1127,7 @@ struct shadow_word_death_self_damage_t final : public priest_spell_t
11271127
// We don't want this counted towards our dps
11281128
stats->type = stats_e::STATS_NEUTRAL;
11291129

1130-
snapshot_flags |= STATE_MUL_DA;
1130+
snapshot_flags |= STATE_MUL_SPELL_DA | STATE_MUL_PLAYER_DAM;
11311131
}
11321132

11331133
proc_types proc_type() const override
@@ -2218,7 +2218,7 @@ struct atonement_t final : public priest_heal_t
22182218
void init() override
22192219
{
22202220
priest_heal_t::init();
2221-
snapshot_flags |= STATE_TGT_MUL_DA | STATE_MUL_DA;
2221+
snapshot_flags |= STATE_TGT_MUL_DA | STATE_MUL_SPELL_DA | STATE_MUL_PLAYER_DAM;
22222222
snapshot_flags &= ~( STATE_CRIT | STATE_VERSATILITY );
22232223
}
22242224

engine/class_modules/sc_death_knight.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9994,7 +9994,7 @@ struct death_strike_heal_t final : public death_knight_heal_t
99949994
{
99959995
death_knight_heal_t::init();
99969996

9997-
snapshot_flags |= STATE_MUL_DA;
9997+
snapshot_flags |= STATE_MUL_SPELL_DA | STATE_MUL_PLAYER_DAM;
99989998
}
99999999

1000010000
double base_da_min( const action_state_t* ) const override

engine/class_modules/sc_shaman.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4461,7 +4461,7 @@ struct stormblast_t : public shaman_attack_t
44614461
{
44624462
shaman_attack_t::init();
44634463

4464-
snapshot_flags = update_flags = ~STATE_MUL_PLAYER_DAM & ( STATE_MUL_DA | STATE_TGT_MUL_DA );
4464+
snapshot_flags = update_flags = STATE_MUL_SPELL_DA | STATE_TGT_MUL_DA;
44654465

44664466
may_proc_hot_hand = false;
44674467
may_proc_ability_procs = false;

engine/player/player.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -470,7 +470,8 @@ struct leech_t : public heal_t
470470
{
471471
heal_t::init();
472472

473-
snapshot_flags = update_flags = STATE_MUL_DA | STATE_TGT_MUL_DA | STATE_VERSATILITY | STATE_MUL_PERSISTENT;
473+
snapshot_flags = update_flags =
474+
STATE_MUL_SPELL_DA | STATE_MUL_PLAYER_DAM | STATE_TGT_MUL_DA | STATE_VERSATILITY | STATE_MUL_PERSISTENT;
474475

475476
player->register_combat_begin( []( player_t* p ) {
476477
make_repeating_event( *p->sim,

engine/player/unique_gear.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2554,7 +2554,7 @@ struct soul_capacitor_explosion_t : public spell_t
25542554
{
25552555
spell_t::init();
25562556

2557-
snapshot_flags = STATE_MUL_DA;
2557+
snapshot_flags = STATE_MUL_SPELL_DA | STATE_MUL_PLAYER_DAM;
25582558
update_flags = 0;
25592559
}
25602560

engine/player/unique_gear_legion.cpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3946,7 +3946,7 @@ void item::figurehead_of_the_naglfar( special_effect_t& effect )
39463946
proc_spell_t::init();
39473947

39483948
// Allow DA multipliers so base_multiplier may take effect.
3949-
snapshot_flags = STATE_MUL_DA;
3949+
snapshot_flags = STATE_MUL_SPELL_DA | STATE_MUL_PLAYER_DAM;
39503950
update_flags = 0;
39513951
}
39523952

@@ -4197,7 +4197,7 @@ struct aw_nuts_t : public proc_spell_t
41974197
proc_spell_t::init();
41984198

41994199
// Don't benefit from player multipliers because, in game, the squirrel is dealing the damage, not you.
4200-
snapshot_flags &= ~( STATE_MUL_DA | STATE_MUL_PERSISTENT | STATE_TGT_MUL_DA );
4200+
snapshot_flags &= ~( STATE_MUL_SPELL_DA | STATE_MUL_PLAYER_DAM | STATE_MUL_PERSISTENT | STATE_TGT_MUL_DA );
42014201
}
42024202
};
42034203

@@ -4711,7 +4711,8 @@ void item::wriggling_sinew( special_effect_t& effect )
47114711
effect.trigger_spell_id = 222050;
47124712
auto damage = effect.initialize_offensive_spell_action();
47134713
damage->base_dd_min = damage->base_dd_max = effect.driver()->effectN( 1 ).average( effect.item );
4714-
damage->snapshot_flags |= STATE_MUL_DA | STATE_VERSATILITY | STATE_MUL_PERSISTENT | STATE_TGT_MUL_DA;
4714+
damage->snapshot_flags |=
4715+
STATE_MUL_SPELL_DA | STATE_MUL_PLAYER_DAM | STATE_VERSATILITY | STATE_MUL_PERSISTENT | STATE_TGT_MUL_DA;
47154716
// Reset triggered spell; we don't want to trigger a spell on use.
47164717
effect.trigger_spell_id = 0;
47174718

0 commit comments

Comments
 (0)