Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 17 additions & 5 deletions engine/class_modules/sc_mage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -370,6 +370,7 @@ struct mage_t final : public player_t
unsigned clearcasting_blp_threshold = 0;
unsigned sphere_blp_threshold = 11;
unsigned augury_blp_threshold = 21;
unsigned infused_blp_threshold = 10;
bool il_requires_freezing = false;
bool il_sort_by_freezing = true;
bool randomize_si_target = false;
Expand Down Expand Up @@ -414,6 +415,7 @@ struct mage_t final : public player_t
accumulated_rng_t* clearcasting;
accumulated_rng_t* spellfire_spheres;
accumulated_rng_t* augury_abounds;
accumulated_rng_t* infused_splinters;
} accumulated_rng;

// Sample data
Expand Down Expand Up @@ -917,7 +919,7 @@ struct mage_t final : public player_t
void trigger_freezing( player_t* target, int stacks, proc_t* source, double chance = 1.0 );
int trigger_shatter( player_t* target, action_t* action, int max_consumption, shatter_source_t* source, bool fof = false );
void trigger_icicle( int count = 1, bool grant_buff = true );
void trigger_arcane_salvo( proc_t* source, int stacks = 1, double chance = 1.0 );
void trigger_arcane_salvo( proc_t* source, int stacks = 1, double chance = 1.0, bool predictable = true );
};

namespace pets {
Expand Down Expand Up @@ -5274,7 +5276,6 @@ struct splinter_t final : public mage_spell_t
add_child( controlled_instincts );
}

freezing_chance = p->talents.infused_splinters->effectN( 2 ).percent();
freezing_stacks = as<int>( p->talents.infused_splinters->effectN( 4 ).base_value() );
}

Expand All @@ -5289,6 +5290,9 @@ struct splinter_t final : public mage_spell_t

void impact( action_state_t* s ) override
{
auto infused_outcome = p()->accumulated_rng.infused_splinters->trigger();
freezing_chance = infused_outcome;

mage_spell_t::impact( s );

if ( !result_is_hit( s->result ) )
Expand All @@ -5301,7 +5305,7 @@ struct splinter_t final : public mage_spell_t
}

p()->trigger_arcane_salvo( salvo_source, as<int>( p()->talents.infused_splinters->effectN( 3 ).base_value() ),
p()->talents.infused_splinters->effectN( 1 ).percent() );
infused_outcome, false );

auto cd = p()->specialization() == MAGE_FROST ? p()->cooldowns.frozen_orb : p()->cooldowns.arcane_orb;
// TODO: This is actually 300 ms (rather than 250), not sure how
Expand Down Expand Up @@ -5776,6 +5780,7 @@ void mage_t::create_options()
add_option( opt_uint( "mage.clearcasting_blp_threshold", options.clearcasting_blp_threshold ) );
add_option( opt_uint( "mage.sphere_blp_threshold", options.sphere_blp_threshold ) );
add_option( opt_uint( "mage.augury_blp_threshold", options.augury_blp_threshold ) );
add_option( opt_uint( "mage.infused_blp_threshold", options.infused_blp_threshold ) );
add_option( opt_bool( "mage.il_requires_freezing", options.il_requires_freezing ) );
add_option( opt_bool( "mage.il_sort_by_freezing", options.il_sort_by_freezing ) );
add_option( opt_bool( "mage.randomize_si_target", options.randomize_si_target ) );
Expand Down Expand Up @@ -6539,6 +6544,13 @@ void mage_t::init_rng()
accumulated_rng.augury_abounds = get_accumulated_rng(
"augury_abounds", prd::find_constant( augury_chance, options.augury_blp_threshold ),
options.augury_blp_threshold );

double infused_chance = talents.infused_splinters->effectN( specialization() == MAGE_ARCANE ? 1 : 2 ).percent();
// Thresholds may be uncapped (particularily Frost's).
// It's incredibly rare to reach 10/20: out of their (very) few instances, they've respectively shown a 100% success rate.
const unsigned infused_cap = specialization() == MAGE_ARCANE ? options.infused_blp_threshold : options.infused_blp_threshold * 2;
accumulated_rng.infused_splinters = get_accumulated_rng(
"infused_splinters", prd::find_constant( infused_chance, infused_cap ), infused_cap );
}

void mage_t::init_finished()
Expand Down Expand Up @@ -7113,7 +7125,7 @@ void mage_t::trigger_cinderstorm( player_t* target )
}
}

void mage_t::trigger_arcane_salvo( proc_t* source, int stacks, double chance )
void mage_t::trigger_arcane_salvo( proc_t* source, int stacks, double chance, bool predictable )
{
if ( !talents.arcane_salvo->ok() || stacks <= 0 )
return;
Expand All @@ -7125,7 +7137,7 @@ void mage_t::trigger_arcane_salvo( proc_t* source, int stacks, double chance )
buff->trigger( stacks );
int new_stacks = buff->check();

if ( chance >= 1.0 )
if ( chance >= 1.0 && predictable )
buff->predict();

if ( buff->at_max_stacks() && old_stacks < new_stacks )
Expand Down
2 changes: 1 addition & 1 deletion engine/sim/proc_rng.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,7 @@ constexpr double find_constant( double p, unsigned K = 0 )
// % success = proc_chance * trigger_count
//
// where trigger_count is the number of trigger attempts since the last success, including the current attempt.
// Thefirst trigger attempt after a successful proc will have a trigger count of 1.
// The first trigger attempt after a successful proc will have a trigger count of 1.
//
// cap is an optional parameter that sets the maximum number of attempts before the proc is guaranteed. If set
// to a nonzero value, it guarantees a proc when trigger_count == cap (even if proc_chance * trigger_count < 1).
Expand Down
Loading