Skip to content

Commit

Permalink
[Action] use standard parsing of spell attributes for rolling periodics
Browse files Browse the repository at this point in the history
* snapshot/update state flags will be handled within action_t::init() like other actions
* rolling_periodic is sufficient to add standard dot flags even with 0 tick damage values
* further processing will remove state flags based on spell attributes as per normal
* tick_may_crit and hasted_ticks will be set via attributes as per normal
  • Loading branch information
gastank committed May 16, 2024
1 parent f6a5511 commit adaf4af
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 11 deletions.
4 changes: 2 additions & 2 deletions engine/action/action.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2570,10 +2570,10 @@ void action_t::init()
if ( may_crit || tick_may_crit )
snapshot_flags |= STATE_CRIT | STATE_TGT_CRIT;

if ( ( base_td > 0 || spell_power_mod.tick > 0 || attack_power_mod.tick > 0 ) && dot_duration > 0_ms )
if ( ( base_td > 0 || spell_power_mod.tick > 0 || attack_power_mod.tick > 0 || rolling_periodic ) && dot_duration > 0_ms )
snapshot_flags |= STATE_MUL_TA | STATE_TGT_MUL_TA | STATE_MUL_PERSISTENT | STATE_VERSATILITY;

if ( base_dd_min > 0 || ( spell_power_mod.direct > 0 || attack_power_mod.direct > 0 ) || weapon_multiplier > 0 )
if ( base_dd_min > 0 || spell_power_mod.direct > 0 || attack_power_mod.direct > 0 || weapon_multiplier > 0 )
snapshot_flags |= STATE_MUL_DA | STATE_TGT_MUL_DA | STATE_MUL_PERSISTENT | STATE_VERSATILITY;

if ( player->is_pet() && ( snapshot_flags & ( STATE_MUL_DA | STATE_MUL_TA | STATE_TGT_MUL_DA | STATE_TGT_MUL_TA |
Expand Down
14 changes: 5 additions & 9 deletions engine/action/residual_action.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -57,21 +57,17 @@ struct residual_periodic_action_t : public Base
void initialize_()
{
ab::background = true;

ab::tick_may_crit = false;
ab::hasted_ticks = false;
ab::may_crit = false;

ab::attack_power_mod.tick = 0;
ab::spell_power_mod.tick = 0;
// Current assumption is that residual based rolling periodics behave the same way as coeff based rolling periodics.
// If this is disproven in the future, rolling_periodic & dot_behavior overrides below may need to be reactivated,
// If this is disproven in the future, the overrides below may need to be reactivated.
// ab::tick_may_crit = false;
// ab::hasted_ticks = false;
// ab::rolling_periodic = false;
// ab::dot_behavior = dot_behavior_e::DOT_REFRESH_DURATION;

// As residual actions have no base damage in the spell data, they do not get caster damage multiplier state flags
// properly set. By default rolling periodics scale with multipliers unless they also have the Ignore X multiplier
// flags, which is handled by action_t::init()
ab::snapshot_flags |= STATE_MUL_TA | STATE_MUL_DA | STATE_VERSATILITY;
// ab::snapshot_flags |= STATE_MUL_TA | STATE_TGT_MUL_TA | STATE_MUL_PERSISTENT | STATE_VERSATILITY;
}

action_state_t* new_state() override
Expand Down

0 comments on commit adaf4af

Please sign in to comment.