Last active
October 26, 2017 14:18
-
-
Save cgdangelo/578d90570745dbb1566afbc39ab9867f to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/engine/class_modules/sc_mage.cpp b/engine/class_modules/sc_mage.cpp | |
index 4c2f247..51f6f8d 100755 | |
--- a/engine/class_modules/sc_mage.cpp | |
+++ b/engine/class_modules/sc_mage.cpp | |
@@ -224,6 +224,8 @@ public: | |
int blessing_of_wisdom_count; | |
bool allow_shimmer_lance; | |
+ extended_sample_data_t* burn_duration_history; | |
+ | |
// Cached actions | |
struct actions_t | |
{ | |
@@ -618,6 +620,8 @@ public: | |
virtual void combat_end() override; | |
virtual std::string create_profile( save_e ) override; | |
virtual void copy_from( player_t* ) override; | |
+ virtual void merge( player_t& ) override; | |
+ virtual void analyze( sim_t& ) override; | |
target_specific_t<mage_td_t> target_data; | |
@@ -6075,6 +6079,8 @@ struct stop_burn_phase_t : public action_t | |
{ | |
mage_t* p = debug_cast<mage_t*>( player ); | |
+ p -> burn_duration_history -> add( p -> burn_phase.duration( sim -> current_time() ).total_seconds() ); | |
+ | |
bool success = p -> burn_phase.disable( sim -> current_time() ); | |
if ( !success ) | |
{ | |
@@ -6576,6 +6582,7 @@ mage_t::mage_t( sim_t* sim, const std::string& name, race_e r ) : | |
firestarter_time( timespan_t::zero() ), | |
allow_shimmer_lance( false ), | |
blessing_of_wisdom_count( 0 ), | |
+ burn_duration_history( nullptr ), | |
action( actions_t() ), | |
benefits( benefits_t() ), | |
buffs( buffs_t() ), | |
@@ -6637,6 +6644,7 @@ mage_t::~mage_t() | |
delete benefits.arcane_missiles; | |
delete benefits.fingers_of_frost; | |
delete benefits.ray_of_frost; | |
+ delete burn_duration_history; | |
} | |
/// Touch of the Magi explosion trigger | |
@@ -6882,6 +6890,22 @@ void mage_t::copy_from( player_t* source ) | |
allow_shimmer_lance = p -> allow_shimmer_lance; | |
} | |
+void mage_t::merge( player_t& other ) | |
+{ | |
+ player_t::merge( other ); | |
+ | |
+ mage_t& mage = dynamic_cast< mage_t& >( other ); | |
+ | |
+ burn_duration_history -> merge ( *mage.burn_duration_history ); | |
+} | |
+ | |
+void mage_t::analyze( sim_t& s ) | |
+{ | |
+ player_t::analyze( s ); | |
+ | |
+ burn_duration_history -> analyze(); | |
+} | |
+ | |
// mage_t::create_pets ======================================================== | |
void mage_t::create_pets() | |
@@ -7367,6 +7391,8 @@ void mage_t::init_uptimes() | |
{ | |
uptimes.burn_phase = get_uptime( "Burn Phase" ); | |
uptimes.conserve_phase = get_uptime( "Conserve Phase" ); | |
+ | |
+ burn_duration_history = new extended_sample_data_t( name_str + "_Burn_Duration_History", false ); | |
} | |
} | |
@@ -8303,7 +8329,7 @@ void mage_t::combat_end() | |
if ( specialization() == MAGE_ARCANE ) | |
{ | |
- uptimes.burn_phase -> update( false, sim -> current_time() ); | |
+// uptimes.burn_phase -> update( false, sim -> current_time() ); | |
uptimes.conserve_phase -> update( false, sim -> current_time() ); | |
} | |
} | |
@@ -8664,17 +8690,26 @@ public: | |
} | |
- virtual void html_customsection( report::sc_html_stream& /* os*/ ) override | |
+ virtual void html_customsection( report::sc_html_stream& os ) override | |
{ | |
- (void) p; | |
- /*// Custom Class Section | |
- os << "\t\t\t\t<div class=\"player-section custom_section\">\n" | |
- << "\t\t\t\t\t<h3 class=\"toggle open\">Custom Section</h3>\n" | |
- << "\t\t\t\t\t<div class=\"toggle-content\">\n"; | |
+ os << "<div class=\"player-section custom_section\">" | |
+ << "<h3 class=\"toggle open\">Burn Phases</h3>\n" | |
+ << "<div class=\"toggle-content\">\n" | |
+ << "<table class=\"sc\">\n" | |
+ << "<thead>\n" | |
+ << "<tr>\n" | |
+ << "<th>Burn Phase Duration</th>\n" | |
+ << "</tr>\n" | |
+ << "<tbody>\n"; | |
- os << p.name(); | |
+ os.format("<tr>\n<td class=\"left\">Minimum</td><td>%.3f</td>\n</tr>\b", p.burn_duration_history -> min() ); | |
+ os.format("<tr>\n<td class=\"left\">Mean</td><td>%.3f</td>\n</tr>\n", p.burn_duration_history -> mean() ); | |
+ os.format("<tr>\n<td class=\"left\">Max</td><td>%.3f</td>\n</tr>\n", p.burn_duration_history -> max() ); | |
- os << "\t\t\t\t\t\t</div>\n" << "\t\t\t\t\t</div>\n";*/ | |
+ os << "</tbody>\n" | |
+ << "</table>\n" | |
+ << "</div>\n" | |
+ << "</div>\n"; | |
} | |
private: | |
mage_t& p; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment