Skip to content

Commit

Permalink
[7.x Gear] Implement the detonator for Forgefiends Fabricator
Browse files Browse the repository at this point in the history
  • Loading branch information
Xanzara committed Nov 7, 2017
1 parent 1b201fc commit 9c527f2
Show file tree
Hide file tree
Showing 5 changed files with 47 additions and 0 deletions.
8 changes: 8 additions & 0 deletions engine/action/sc_action.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3411,6 +3411,14 @@ void action_t::remove_travel_event( travel_event_t* e )
erase_unordered( travel_events, pos );
}

void action_t::execute_all_travel_events()
{
for ( const auto& TravelEvent : travel_events)
{
TravelEvent->execute();
}
}

void action_t::do_teleport( action_state_t* state )
{
player -> teleport( composite_teleport_distance( state ) );
Expand Down
2 changes: 2 additions & 0 deletions engine/action/sc_action_state.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -244,6 +244,8 @@ travel_event_t::travel_event_t( action_t* a, action_state_t* state,

void travel_event_t::execute()
{
if ( !state ) return;

if ( !state->target->is_sleeping() )
{
action->impact( state );
Expand Down
1 change: 1 addition & 0 deletions engine/player/sc_player.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -757,6 +757,7 @@ player_t::player_t( sim_t* s,
item_cooldown( cooldown_t( "item_cd", *this ) ),
legendary_tank_cloak_cd( nullptr ),
warlords_unseeing_eye( 0.0 ),
forgefiends_fabricator_fire_mine(nullptr),
auto_attack_multiplier( 1.0 ),
scaling( ( ! is_pet() || sim -> report_pets_separately ) ? new player_scaling_t() : nullptr ),
// Movement & Position
Expand Down
31 changes: 31 additions & 0 deletions engine/player/sc_unique_gear_x7.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,7 @@ namespace item
void seeping_scourgewing( special_effect_t& );
void gorshalach_legacy( special_effect_t& );
void forgefiends_fabricator( special_effect_t& );
void forgefiends_fabricator_detonate(special_effect_t&);

// 7.2.0 Dungeon
void dreadstone_of_endless_shadows( special_effect_t& );
Expand Down Expand Up @@ -2331,6 +2332,7 @@ struct fire_mines_driver_t : public proc_spell_t
fire_mines( new fire_mines_t( effect ) )
{
background = true;
effect.player->forgefiends_fabricator_fire_mine = fire_mines;
}

void execute() override
Expand All @@ -2349,6 +2351,34 @@ void item::forgefiends_fabricator( special_effect_t& effect )
new dbc_proc_callback_t( effect.player, effect );
}

struct fire_mines_detonator_driver_t : public proc_spell_t
{
fire_mines_detonator_driver_t( const special_effect_t& effect ) :
proc_spell_t( "fire_mines_detonator", effect.player, effect.player -> find_spell(253322), effect.item)
{ }

bool ready() override
{
if ( !player -> forgefiends_fabricator_fire_mine -> has_travel_events() )
return false;

return proc_spell_t::ready();
}

void execute() override
{
proc_spell_t::execute();

player->forgefiends_fabricator_fire_mine->execute_all_travel_events();
}
};

void item::forgefiends_fabricator_detonate(special_effect_t& effect)
{
effect.execute_action = new fire_mines_detonator_driver_t(effect);
}


// Toe Knee's Promise ======================================================

struct flame_gale_pulse_t : proc_spell_t
Expand Down Expand Up @@ -6490,6 +6520,7 @@ void unique_gear::register_special_effects_x7()
register_special_effect( 253323, item::seeping_scourgewing );
register_special_effect( 253326, item::gorshalach_legacy );
register_special_effect( 253310, item::forgefiends_fabricator );
register_special_effect( 253322, item::forgefiends_fabricator_detonate );

/* Legion 7.2.0 Dungeon */
register_special_effect( 238498, item::dreadstone_of_endless_shadows );
Expand Down
5 changes: 5 additions & 0 deletions engine/simulationcraft.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -4094,6 +4094,9 @@ struct player_t : public actor_t
double warlords_unseeing_eye;
stats_t* warlords_unseeing_eye_stats;

// Forgefiend's Fabricator (7.3.2 Antorus Trinket)
action_t* forgefiends_fabricator_fire_mine;

// Misc Multipliers
// auto attack multiplier (for Jeweled Signet of Melandrus and similar effects)
double auto_attack_multiplier;
Expand Down Expand Up @@ -5852,6 +5855,8 @@ struct action_t : private noncopyable

void remove_travel_event( travel_event_t* e );

void execute_all_travel_events();

void reschedule_queue_event();

rng::rng_t& rng()
Expand Down

0 comments on commit 9c527f2

Please sign in to comment.