Skip to content

Instantly share code, notes, and snippets.

@cgdangelo
Created November 9, 2017 19:56
Show Gist options
  • Save cgdangelo/b8641a1f458dcee2fb21688e4702dbc4 to your computer and use it in GitHub Desktop.
Save cgdangelo/b8641a1f458dcee2fb21688e4702dbc4 to your computer and use it in GitHub Desktop.
diff --git a/engine/class_modules/sc_mage.cpp b/engine/class_modules/sc_mage.cpp
index 70e0b53..b59a409 100755
--- a/engine/class_modules/sc_mage.cpp
+++ b/engine/class_modules/sc_mage.cpp
@@ -264,6 +264,12 @@ public:
int blessing_of_wisdom_count;
bool allow_shimmer_lance;
+ double low_burn_duration;
+ iteration_data_entry_t low_burn_iteration;
+
+ double high_burn_duration;
+ iteration_data_entry_t high_burn_iteration;
+
// Cached actions
struct actions_t
{
@@ -6111,7 +6117,17 @@ struct stop_burn_phase_t : public action_t
{
mage_t* p = debug_cast<mage_t*>( player );
- p -> sample_data.burn_duration_history -> add( p -> burn_phase.duration( sim -> current_time() ).total_seconds() );
+ double burn_duration = p -> burn_phase.duration( sim -> current_time() ).total_seconds();
+
+ if ( p -> low_burn_duration == 0 || burn_duration < p -> low_burn_duration) {
+ p -> low_burn_duration = burn_duration;
+ p -> low_burn_iteration = sim -> iteration_data[ sim -> current_iteration ];
+ } else if ( p -> high_burn_duration == 0 || burn_duration > p -> high_burn_duration ) {
+ p -> high_burn_duration = burn_duration;
+ p -> high_burn_iteration = sim -> iteration_data[ sim -> current_iteration ];
+ }
+
+ p -> sample_data.burn_duration_history -> add( burn_duration );
bool success = p -> burn_phase.disable( sim -> current_time() );
if ( !success )
@@ -6607,6 +6623,8 @@ mage_t::mage_t( sim_t* sim, const std::string& name, race_e r ) :
firestarter_time( timespan_t::zero() ),
blessing_of_wisdom_count( 0 ),
allow_shimmer_lance( false ),
+ low_burn_iteration( SCALE_METRIC_DPS, 0, 0, 0 ),
+ high_burn_iteration( SCALE_METRIC_DPS, 0, 0, 0 ),
action( actions_t() ),
benefits( benefits_t() ),
buffs( buffs_t() ),
@@ -6929,6 +6947,15 @@ void mage_t::merge( player_t& other )
case MAGE_ARCANE:
sample_data.burn_duration_history -> merge ( *mage.sample_data.burn_duration_history );
sample_data.burn_initial_mana -> merge( *mage.sample_data.burn_initial_mana );
+
+ if ( low_burn_duration > mage.low_burn_duration ) {
+ low_burn_duration = mage.low_burn_duration;
+ low_burn_iteration = mage.low_burn_iteration;
+ } else if ( high_burn_duration < mage.high_burn_duration ) {
+ high_burn_duration = mage.high_burn_duration;
+ high_burn_iteration = mage.high_burn_iteration;
+ }
+
break;
case MAGE_FIRE:
@@ -8860,6 +8887,8 @@ public:
os << "</tbody>\n"
<< "</table>\n";
+ os.format("<h4>Low burn</h4><pre>Length: %d, Iteration: %i, Seed: %i</pre>\n", p.low_burn_duration, p.low_burn_iteration.iteration, p.low_burn_iteration.seed);
+
os << "</div>\n"
<< "</div>\n";
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment