Skip to content

Commit c0b5933

Browse files
committed
[Shaman] Remove old DRE random process, default to new "deck of cards"
1 parent 71de806 commit c0b5933

File tree

1 file changed

+23
-96
lines changed

1 file changed

+23
-96
lines changed

engine/class_modules/sc_shaman.cpp

Lines changed: 23 additions & 96 deletions
Original file line numberDiff line numberDiff line change
@@ -1346,8 +1346,6 @@ struct shaman_t : public parse_player_effects_t
13461346
struct options_t
13471347
{
13481348
rotation_type_e rotation = ROTATION_STANDARD;
1349-
double dre_flat_chance = -1.0;
1350-
unsigned dre_forced_failures = 2U;
13511349

13521350
// Tempest options
13531351
int init_tempest_counter = -1;
@@ -1377,9 +1375,6 @@ struct shaman_t : public parse_player_effects_t
13771375
double ice_strike_base_chance = 0.07;
13781376
double lively_totems_base_chance = 0.06;
13791377

1380-
double dre_enhancement_base_chance = 0.0024;
1381-
unsigned dre_enhancement_forced_failures = 0;
1382-
13831378
// Surging totem whiff
13841379
double surging_totem_miss_chance = 0.0;
13851380

@@ -1395,7 +1390,6 @@ struct shaman_t : public parse_player_effects_t
13951390
int tww3_stormbringer_set = 0;
13961391

13971392
// New deck dre implementation
1398-
bool use_new_dre = false; // Use, defaults to false for now
13991393
unsigned n_dre_draw_success = 2; // Number of successs in the deck
14001394
int n_dre_draws = -1; // Total cards in the deck
14011395
} options;
@@ -1832,7 +1826,6 @@ struct shaman_t : public parse_player_effects_t
18321826
shuffled_rng_t* flowing_spirits;
18331827

18341828
accumulated_rng_t* imbuement_mastery;
1835-
accumulated_rng_t* dre_enhancement;
18361829
accumulated_rng_t* ice_strike;
18371830
accumulated_rng_t* lively_totems_ptr;
18381831

@@ -11901,13 +11894,6 @@ std::unique_ptr<expr_t> shaman_t::create_expression( util::string_view name )
1190111894
} );
1190211895
}
1190311896

11904-
if ( util::str_compare_ci( name, "dre_chance_pct" ) )
11905-
{
11906-
return make_fn_expr( name, [ this ]() {
11907-
return 100.0 * std::max( 0.0, dre_attempts * 0.01 - 0.01 * options.dre_forced_failures );
11908-
} );
11909-
}
11910-
1191111897
if ( util::str_compare_ci( name, "total_awaken_count" ) )
1191211898
return make_fn_expr( name, [ this ]() { return as<double>( aws_counter ); } );
1191311899

@@ -12223,8 +12209,8 @@ void shaman_t::create_options()
1222312209
add_option( opt_int( "shaman.initial_tempest_counter", options.init_tempest_counter, -1, 299 ) );
1222412210

1222512211
add_option( opt_obsoleted( "shaman.chain_harvest_allies" ) );
12226-
add_option( opt_float( "shaman.dre_flat_chance", options.dre_flat_chance, -1.0, 1.0 ) );
12227-
add_option( opt_uint( "shaman.dre_forced_failures", options.dre_forced_failures, 0U, 10U ) );
12212+
add_option( opt_obsoleted( "shaman.dre_flat_chance" ) );
12213+
add_option( opt_obsoleted( "shaman.dre_forced_failures" ) );
1222812214

1222912215
add_option( opt_uint( "shaman.icefury_positive", options.icefury_positive, 0U, 100U ) );
1223012216
add_option( opt_uint( "shaman.icefury_total", options.icefury_total , 0U, 100U ) );
@@ -12244,8 +12230,8 @@ void shaman_t::create_options()
1224412230

1224512231
add_option( opt_float( "shaman.imbuement_mastery_base_chance", options.imbuement_mastery_base_chance, 0.0, 1.0 ) );
1224612232

12247-
add_option( opt_float( "shaman.dre_enhancement_base_chance", options.dre_enhancement_base_chance, 0.0, 1.0 ) );
12248-
add_option( opt_uint( "shaman.dre_enhancement_forced_failures", options.dre_enhancement_forced_failures, 0, 100 ) );
12233+
add_option( opt_obsoleted( "shaman.dre_enhancement_base_chance" ) );
12234+
add_option( opt_obsoleted( "shaman.dre_enhancement_forced_failures" ) );
1224912235

1225012236
add_option( opt_float( "shaman.lively_totems_base_chance", options.lively_totems_base_chance, 0.0, 1.0 ) );
1225112237

@@ -12286,7 +12272,6 @@ void shaman_t::create_options()
1228612272
add_option( opt_int( "shaman.tww3_stormbringer_set", options.tww3_stormbringer_set, 0, 4 ) );
1228712273

1228812274
// New DRE shuffled deck options
12289-
add_option( opt_bool( "shaman.use_new_dre", options.use_new_dre ) );
1229012275
add_option( opt_uint( "shaman.dre_deck_success", options.n_dre_draw_success, 0, 10000U ) );
1229112276
add_option( opt_int( "shaman.dre_deck_total", options.n_dre_draws, 1, 10000U ) );
1229212277
}
@@ -12320,8 +12305,6 @@ void shaman_t::copy_from( player_t* source )
1232012305

1232112306
options.init_tempest_counter = p->options.init_tempest_counter;
1232212307

12323-
options.dre_flat_chance = p->options.dre_flat_chance;
12324-
options.dre_forced_failures = p->options.dre_forced_failures;
1232512308
options.icefury_positive = p->options.icefury_positive;
1232612309
options.icefury_total = p->options.icefury_total;
1232712310
options.ancient_fellowship_positive = p->options.ancient_fellowship_positive;
@@ -12335,9 +12318,6 @@ void shaman_t::copy_from( player_t* source )
1233512318
options.lively_totems_base_chance = p->options.lively_totems_base_chance;
1233612319
options.flowing_spirits_chances = p->options.flowing_spirits_chances;
1233712320

12338-
options.dre_enhancement_base_chance = p->options.dre_enhancement_base_chance;
12339-
options.dre_enhancement_forced_failures = p->options.dre_enhancement_forced_failures;
12340-
1234112321
options.surging_totem_miss_chance = p->options.surging_totem_miss_chance;
1234212322

1234312323
options.flowing_spirits_procs = p->options.flowing_spirits_procs;
@@ -12346,7 +12326,6 @@ void shaman_t::copy_from( player_t* source )
1234612326

1234712327
options.chain_lightning_target_rng = p->options.chain_lightning_target_rng;
1234812328

12349-
options.use_new_dre = p->options.use_new_dre;
1235012329
options.n_dre_draws = p->options.n_dre_draws;
1235112330
options.n_dre_draw_success = p->options.n_dre_draw_success;
1235212331
}
@@ -13318,75 +13297,29 @@ void shaman_t::trigger_deeply_rooted_elements( const action_state_t* state )
1331813297
return;
1331913298
}
1332013299

13321-
if ( options.use_new_dre )
13322-
{
13323-
auto spell = debug_cast<shaman_spell_t*>( state->action );
13324-
unsigned draws = specialization() == SHAMAN_ENHANCEMENT
13325-
? spell->mw_consumed_stacks
13326-
: spell->last_resource_cost;
13300+
auto spell = debug_cast<shaman_spell_t*>( state->action );
13301+
unsigned draws = specialization() == SHAMAN_ENHANCEMENT
13302+
? spell->mw_consumed_stacks
13303+
: spell->last_resource_cost;
1332713304

13328-
bool success = false;
13329-
for ( auto draw = 0U; draw < draws; ++draw )
13330-
{
13331-
dre_attempts++;
13332-
if ( rng_obj.deeply_rooted_elements->trigger() )
13333-
{
13334-
assert( !success );
13335-
success = true;
13336-
}
13337-
}
13338-
13339-
if ( success )
13340-
{
13341-
dre_samples.add( as<double>( dre_attempts ) );
13342-
dre_attempts = 0U;
13343-
13344-
action.dre_ascendance->execute_on_target( state->target );
13345-
spell->proc_deeply_rooted_elements->occur();
13346-
}
13347-
}
13348-
else
13305+
bool success = false;
13306+
for ( auto draw = 0U; draw < draws; ++draw )
1334913307
{
13350-
double proc_chance = 0.0;
13351-
if ( options.dre_flat_chance == -1.0 )
13352-
{
13353-
auto spell = debug_cast<shaman_spell_t*>( state->action );
13354-
13355-
switch ( specialization() )
13356-
{
13357-
case SHAMAN_ELEMENTAL:
13358-
proc_chance = 0.01 * talent.deeply_rooted_elements->effectN( 2 ).base_value() * 0.01 *
13359-
spell->last_resource_cost;
13360-
break;
13361-
case SHAMAN_ENHANCEMENT:
13362-
proc_chance = 0.01 * talent.deeply_rooted_elements->effectN( 3 ).base_value() * 0.1 *
13363-
spell->mw_consumed_stacks;
13364-
break;
13365-
default:
13366-
break;
13367-
}
13368-
}
13369-
else
13370-
{
13371-
proc_chance = options.dre_flat_chance;
13372-
}
13373-
13374-
if ( proc_chance <= 0.0 )
13308+
dre_attempts++;
13309+
if ( rng_obj.deeply_rooted_elements->trigger() )
1337513310
{
13376-
return;
13311+
assert( !success );
13312+
success = true;
1337713313
}
13314+
}
1337813315

13379-
dre_attempts++;
13380-
13381-
if ( rng().roll( proc_chance ) )
13382-
{
13383-
dre_samples.add( as<double>( dre_attempts ) );
13384-
dre_attempts = 0U;
13316+
if ( success )
13317+
{
13318+
dre_samples.add( as<double>( dre_attempts ) );
13319+
dre_attempts = 0U;
1338513320

13386-
action.dre_ascendance->execute_on_target( state->target );
13387-
auto spell = debug_cast<shaman_spell_base_t<spell_t>*>( state->action );
13388-
spell->proc_deeply_rooted_elements->occur();
13389-
}
13321+
action.dre_ascendance->execute_on_target( state->target );
13322+
spell->proc_deeply_rooted_elements->occur();
1339013323
}
1339113324
}
1339213325

@@ -14867,12 +14800,6 @@ void shaman_t::init_rng()
1486714800

1486814801
rng_obj.imbuement_mastery = get_accumulated_rng( "imbuement_mastery",
1486914802
options.imbuement_mastery_base_chance );
14870-
rng_obj.dre_enhancement = get_accumulated_rng( "deeply_rooted_elements_enh",
14871-
options.dre_enhancement_base_chance, [ this ]( double base_chance, unsigned attempt, action_t* ) {
14872-
return attempt <= options.dre_enhancement_forced_failures
14873-
? 0.0
14874-
: ( attempt - options.dre_enhancement_forced_failures ) * base_chance;
14875-
} );
1487614803
rng_obj.ice_strike = get_accumulated_rng( "ice_strike",
1487714804
options.ice_strike_base_chance );
1487814805
rng_obj.lively_totems_ptr = get_accumulated_rng( "lively_totems_ptr",
@@ -14881,7 +14808,7 @@ void shaman_t::init_rng()
1488114808
rng_obj.flowing_spirits = get_shuffled_rng( "flowing_spirits",
1488214809
options.flowing_spirits_procs, options.flowing_spirits_total );
1488314810

14884-
if ( talent.deeply_rooted_elements.ok() && options.use_new_dre )
14811+
if ( talent.deeply_rooted_elements.ok() )
1488514812
{
1488614813
auto n_dre_draws = options.n_dre_draws != -1 ? as<unsigned>( options.n_dre_draws ) : 0U;
1488714814
auto max_dre_draw = 0;
@@ -16541,7 +16468,7 @@ class shaman_report_t : public player_report_extension_t
1654116468
highchart::histogram_chart_t chart( highchart::build_id( p, "dre" ), *p.sim );
1654216469

1654316470
chart.set( "plotOptions.column.color", color::RED.str() );
16544-
chart.set( "plotOptions.column.pointStart", p.options.dre_forced_failures + 1 );
16471+
chart.set( "plotOptions.column.pointStart", 1 );
1654516472
chart.set_title( fmt::format( "DRE Attempts (min={} median={} max={})", p.dre_samples.min(),
1654616473
p.dre_samples.percentile( 0.5 ), p.dre_samples.max() ) );
1654716474
chart.set( "yAxis.title.text", "# of Triggered Procs" );

0 commit comments

Comments
 (0)