Skip to content

Instantly share code, notes, and snippets.

@cgdangelo
Created February 12, 2018 21:07
Show Gist options
  • Save cgdangelo/41ad58c9d3b4f1badd25fd85831993be to your computer and use it in GitHub Desktop.
Save cgdangelo/41ad58c9d3b4f1badd25fd85831993be 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 22bef767b..b66f2fd0a 100755
--- a/engine/class_modules/sc_mage.cpp
+++ b/engine/class_modules/sc_mage.cpp
@@ -332,6 +332,8 @@ struct proc_source_t : private noncopyable
struct mage_t : public player_t
{
public:
+ event_t* temporal_flux_evocation_event;
+
// Icicles
std::vector<icicle_tuple_t> icicles;
action_t* icicle;
@@ -433,6 +435,7 @@ public:
buff_t* incanters_flow;
buff_t* ray_of_frost;
buff_t* rune_of_power;
+ buff_t* temporal_flux_evocation;
// Legendary
buff_t* cord_of_infinity;
@@ -471,6 +474,7 @@ public:
gain_t* greater_blessing_of_wisdom;
gain_t* evocation;
gain_t* mystic_kilt_of_the_rune_master;
+ gain_t* temporal_flux_evocation;
} gains;
// Pets
@@ -3360,6 +3364,30 @@ struct dragons_breath_t : public fire_mage_spell_t
// Evocation Spell ==========================================================
+namespace events {
+struct temporal_flux_evocation_event_t : public event_t
+{
+ mage_t* mage;
+
+ temporal_flux_evocation_event_t( mage_t* p )
+ : event_t( *p, timespan_t::from_seconds( 5.0 ) ),
+ mage( p )
+ { }
+
+ virtual const char* name() const override
+ {
+ return "temporal_flux_evocation";
+ }
+
+ virtual void execute() override
+ {
+ mage -> temporal_flux_evocation_event = nullptr;
+ mage -> buffs.temporal_flux_evocation -> trigger();
+ }
+};
+}
+
+
struct evocation_t : public arcane_mage_spell_t
{
evocation_t( mage_t* p, const std::string& options_str ) :
@@ -3395,6 +3423,16 @@ struct evocation_t : public arcane_mage_spell_t
return arcane_mage_spell_t::usable_moving();
}
+
+ void last_tick( dot_t *d ) override
+ {
+ arcane_mage_spell_t::last_tick( d );
+
+ if ( p() -> talents.temporal_flux -> ok() )
+ {
+ p() -> temporal_flux_evocation_event = make_event<events::temporal_flux_evocation_event_t>( *sim, p() );
+ }
+ }
};
// Fireball Spell ===========================================================
@@ -5958,6 +5996,7 @@ mage_td_t::mage_td_t( player_t* target, mage_t* mage ) :
mage_t::mage_t( sim_t* sim, const std::string& name, race_e r ) :
player_t( sim, MAGE, name, r ),
+ temporal_flux_evocation_event( nullptr ),
icicle( nullptr ),
icicle_event( nullptr ),
ignite( nullptr ),
@@ -6403,7 +6442,7 @@ void mage_t::init_spells()
talents.arctic_gale = find_talent_spell( "Arctic Gale" );
// Tier 100
talents.overpowered = find_talent_spell( "Overpowered" );
- talents.temporal_flux = find_talent_spell( "Temporal Flux" );
+ talents.temporal_flux = find_talent_spell( "Temporal Flux [NYI]" );
talents.arcane_orb = find_talent_spell( "Arcane Orb" );
talents.kindling = find_talent_spell( "Kindling" );
talents.cinderstorm = find_talent_spell( "Cinderstorm" );
@@ -6580,6 +6619,15 @@ void mage_t::create_buffs()
buffs.rune_of_power = buff_creator_t( this, "rune_of_power", find_spell( 116014 ) )
.duration( find_spell( 116011 ) -> duration() )
.default_value( find_spell( 116014 ) -> effectN( 1 ).percent() );
+ buffs.temporal_flux_evocation = buff_creator_t( this, "temporal_flux_evocation", find_specialization_spell( "Evocation", MAGE_ARCANE ) )
+ .period( timespan_t::from_seconds( 2.0 ) )
+ .tick_zero( true )
+ .tick_callback([this]( buff_t*, int, const timespan_t& ) {
+ double mana_gain = resources.max[ RESOURCE_MANA ] * find_specialization_spell( "Evocation", MAGE_ARCANE ) -> effectN( 1 ).percent();
+
+ resource_gain( RESOURCE_MANA, mana_gain, gains.temporal_flux_evocation);
+ })
+ .tick_behavior( BUFF_TICK_CLIP );
// Legendary
buffs.lady_vashjs_grasp = new buffs::lady_vashjs_grasp_t( this );
@@ -6608,6 +6656,7 @@ void mage_t::init_gains()
gains.evocation = get_gain( "Evocation" );
gains.mystic_kilt_of_the_rune_master = get_gain( "Mystic Kilt of the Rune Master" );
gains.greater_blessing_of_wisdom = get_gain( "Greater Blessing of Wisdom" );
+ gains.temporal_flux_evocation = get_gain( "Temporal Flux Evocation" );
}
// mage_t::init_procs =======================================================
@@ -7429,6 +7478,7 @@ void mage_t::reset()
icicles.clear();
event_t::cancel( icicle_event );
event_t::cancel( ignite_spread_event );
+ event_t::cancel( temporal_flux_evocation_event );
if ( spec.savant -> ok() )
{
@@ -7764,6 +7814,20 @@ expr_t* mage_t::create_expression( action_t* a, const std::string& name_str )
}
}
+ if ( util::str_compare_ci( name_str, "temporal_flux_evocation_scheduled" ) )
+ {
+ struct temporal_flux_evocation_scheduled_expr_t: public mage_expr_t
+ {
+ temporal_flux_evocation_scheduled_expr_t( mage_t& m ) : mage_expr_t( "temporal_flux_evocation_scheduled", m )
+ { }
+
+ virtual double evaluate() override
+ { return mage.temporal_flux_evocation_event != nullptr; }
+ };
+
+ return new temporal_flux_evocation_scheduled_expr_t( *this );
+ }
+
return player_t::create_expression( a, name_str );
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment