Skip to content

Commit 630cae2

Browse files
committed
[Mage] Track Freezing sources
1 parent 9bc540c commit 630cae2

File tree

1 file changed

+44
-13
lines changed

1 file changed

+44
-13
lines changed

engine/class_modules/sc_mage.cpp

Lines changed: 44 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -809,7 +809,7 @@ struct mage_t final : public player_t
809809
void trigger_spellfire_spheres();
810810
void consume_burden_of_power();
811811
void trigger_splinter( player_t* target, int count = -1 );
812-
void trigger_freezing( player_t* target, int stacks, double chance = 1.0 );
812+
void trigger_freezing( player_t* target, int stacks, proc_t* source, double chance = 1.0 );
813813
int trigger_shatter( player_t* target, action_t* action, int max_consumption, bool fof = false );
814814
void trigger_icicle( int count = 1 );
815815
};
@@ -1461,6 +1461,7 @@ struct mage_spell_t : public spell_t
14611461
double freezing_chance = 1.0;
14621462
int freezing_stacks = 0;
14631463
int freezing_targets = -1;
1464+
proc_t* freezing_source = nullptr;
14641465

14651466
public:
14661467
mage_spell_t( std::string_view n, mage_t* p, const spell_data_t* s = spell_data_t::nil() ) :
@@ -1534,6 +1535,14 @@ struct mage_spell_t : public spell_t
15341535
target = player;
15351536
}
15361537

1538+
void init_finished() override
1539+
{
1540+
spell_t::init_finished();
1541+
1542+
if ( p()->spec.shatter->ok() )
1543+
freezing_source = p()->get_proc( fmt::format( "Freezing applied ({})", data().name_cstr() ) );
1544+
}
1545+
15371546
double action_multiplier() const override
15381547
{
15391548
double m = spell_t::action_multiplier();
@@ -1754,7 +1763,7 @@ struct mage_spell_t : public spell_t
17541763
return;
17551764

17561765
if ( freezing_targets == -1 || s->chain_target < freezing_targets )
1757-
p()->trigger_freezing( s->target, freezing_stacks, freezing_chance );
1766+
p()->trigger_freezing( s->target, freezing_stacks, freezing_source, freezing_chance );
17581767

17591768
if ( triggers.ignite )
17601769
trigger_ignite( s );
@@ -3661,7 +3670,7 @@ struct frostbolt_t final : public frost_mage_spell_t
36613670
frost_mage_spell_t::impact( s );
36623671

36633672
if ( s->result == RESULT_CRIT && p()->talents.frostbite.ok() )
3664-
p()->trigger_freezing( s->target, as<int>( p()->talents.frostbite->effectN( 1 ).base_value() ) );
3673+
p()->trigger_freezing( s->target, as<int>( p()->talents.frostbite->effectN( 1 ).base_value() ), freezing_source );
36653674

36663675
if ( result_is_hit( s->result ) && frostfire && p()->state.trigger_ff_empowerment )
36673676
{
@@ -3852,7 +3861,7 @@ struct glacial_spike_t final : public frost_mage_spell_t
38523861
frost_mage_spell_t::impact( s );
38533862

38543863
if ( s->result == RESULT_CRIT && p()->talents.frostbite.ok() )
3855-
p()->trigger_freezing( s->target, as<int>( p()->talents.frostbite->effectN( 1 ).base_value() ) );
3864+
p()->trigger_freezing( s->target, as<int>( p()->talents.frostbite->effectN( 1 ).base_value() ), freezing_source );
38563865

38573866
if ( result_is_hit( s->result ) && p()->action.flash_freezeburn )
38583867
p()->action.flash_freezeburn->execute_on_target( s->target, p()->talents.flash_freezeburn->effectN( 2 ).percent() * s->result_total );
@@ -3901,6 +3910,7 @@ struct ice_lance_t final : public frost_mage_spell_t
39013910
struct ice_lance_impact_t final : public frost_mage_spell_t
39023911
{
39033912
int freezing_consume;
3913+
proc_t* polished_focus = nullptr;
39043914

39053915
ice_lance_impact_t( std::string_view n, mage_t* p ) :
39063916
frost_mage_spell_t( n, p, p->find_spell( 228598 ) ),
@@ -3918,6 +3928,14 @@ struct ice_lance_t final : public frost_mage_spell_t
39183928
aoe = 1 + as<int>( p->talents.fractured_frost->effectN( 1 ).base_value() );
39193929
}
39203930

3931+
void init_finished() override
3932+
{
3933+
frost_mage_spell_t::init_finished();
3934+
3935+
if ( p()->talents.polished_focus.ok() )
3936+
polished_focus = p()->get_proc( "Freezing applied (Polished Focus)" );
3937+
}
3938+
39213939
void impact( action_state_t* s ) override
39223940
{
39233941
frost_mage_spell_t::impact( s );
@@ -3928,7 +3946,7 @@ struct ice_lance_t final : public frost_mage_spell_t
39283946
if ( s->chain_target == 0 && p()->talents.force_of_will.ok() )
39293947
p()->trigger_splinter( s->target, stacks / as<int>( p()->talents.force_of_will->effectN( 3 ).base_value() ) );
39303948
if ( stacks == freezing_consume )
3931-
p()->trigger_freezing( s->target, as<int>( p()->talents.polished_focus->effectN( 3 ).base_value() ) );
3949+
p()->trigger_freezing( s->target, as<int>( p()->talents.polished_focus->effectN( 3 ).base_value() ), polished_focus );
39323950
}
39333951
}
39343952

@@ -4421,8 +4439,11 @@ struct pyroblast_t final : public hot_streak_spell_t
44214439

44224440
struct splintering_ray_t final : public spell_t
44234441
{
4442+
proc_t* freezing_source;
4443+
44244444
splintering_ray_t( std::string_view n, mage_t* p ) :
4425-
spell_t( n, p, p->find_spell( 418735 ) )
4445+
spell_t( n, p, p->find_spell( 418735 ) ),
4446+
freezing_source( p->get_proc( "Freezing applied (Splintering Ray)" ) )
44264447
{
44274448
background = proc = true;
44284449
base_dd_min = base_dd_max = 1.0;
@@ -4458,7 +4479,7 @@ struct splintering_ray_t final : public spell_t
44584479
spell_t::impact( s );
44594480

44604481
if ( result_is_hit( s->result ) )
4461-
debug_cast<mage_t*>( player )->trigger_freezing( s->target, 1 );
4482+
debug_cast<mage_t*>( player )->trigger_freezing( s->target, 1, freezing_source );
44624483
}
44634484
};
44644485

@@ -4489,7 +4510,7 @@ struct ray_of_frost_t final : public frost_mage_spell_t
44894510
{
44904511
frost_mage_spell_t::tick( d );
44914512

4492-
p()->trigger_freezing( d->target, 1 ); // Not in spell data
4513+
p()->trigger_freezing( d->target, 1, freezing_source ); // Not in spell data
44934514
p()->trigger_splinter( d->target, as<int>( p()->talents.augury_abounds->effectN( 3 ).base_value() ) );
44944515

44954516
// TODO: FoF is granted through spell 269748. Unfortunately, Blizzard forgot to change its
@@ -4707,8 +4728,11 @@ struct arcane_echo_t final : public arcane_mage_spell_t
47074728

47084729
struct frostfire_empowerment_t final : public spell_t
47094730
{
4731+
proc_t* freezing_source;
4732+
47104733
frostfire_empowerment_t( std::string_view n, mage_t* p ) :
4711-
spell_t( n, p, p->find_spell( 431186 ) )
4734+
spell_t( n, p, p->find_spell( 431186 ) ),
4735+
freezing_source( p->get_proc( "Freezing applied (Frostfire Empowerment)" ) )
47124736
{
47134737
background = proc = true;
47144738
aoe = -1;
@@ -4732,14 +4756,17 @@ struct frostfire_empowerment_t final : public spell_t
47324756

47334757
mage_t* p = debug_cast<mage_t*>( player );
47344758
if ( result_is_hit( s->result ) )
4735-
p->trigger_freezing( s->target, as<int>( p->talents.frostfire_empowerment->effectN( 4 ).base_value() ) );
4759+
p->trigger_freezing( s->target, as<int>( p->talents.frostfire_empowerment->effectN( 4 ).base_value() ), freezing_source );
47364760
}
47374761
};
47384762

47394763
struct flash_freezeburn_t final : public spell_t
47404764
{
4765+
proc_t* freezing_source;
4766+
47414767
flash_freezeburn_t( std::string_view n, mage_t* p ) :
4742-
spell_t( n, p, p->find_spell( 1278079 ) )
4768+
spell_t( n, p, p->find_spell( 1278079 ) ),
4769+
freezing_source( p->get_proc( "Freezing applied (Flash Freezeburn)" ) )
47434770
{
47444771
background = proc = true;
47454772
base_dd_min = base_dd_max = 1.0;
@@ -4763,7 +4790,7 @@ struct flash_freezeburn_t final : public spell_t
47634790
spell_t::impact( s );
47644791

47654792
if ( result_is_hit( s->result ) )
4766-
debug_cast<mage_t*>( player )->trigger_freezing( s->target, 1 );
4793+
debug_cast<mage_t*>( player )->trigger_freezing( s->target, 1, freezing_source );
47674794
}
47684795
};
47694796

@@ -6591,7 +6618,7 @@ bool mage_t::trigger_crowd_control( const action_state_t* s, spell_mechanic type
65916618
return false;
65926619
}
65936620

6594-
void mage_t::trigger_freezing( player_t* target, int stacks, double chance )
6621+
void mage_t::trigger_freezing( player_t* target, int stacks, proc_t* source, double chance )
65956622
{
65966623
if ( !spec.shatter->ok() || stacks <= 0 )
65976624
return;
@@ -6603,8 +6630,12 @@ void mage_t::trigger_freezing( player_t* target, int stacks, double chance )
66036630
debuff->trigger( stacks );
66046631
int new_stacks = debuff->check();
66056632

6633+
assert( source );
66066634
for ( int i = 0; i < stacks; i++ )
6635+
{
6636+
source->occur();
66076637
procs.freezing_applied->occur();
6638+
}
66086639
int overflow = stacks - ( new_stacks - old_stacks );
66096640
for ( int i = 0; i < overflow; i++ )
66106641
procs.freezing_overflow->occur();

0 commit comments

Comments
 (0)