Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ele] adding some bugs #9759

Draft
wants to merge 11 commits into
base: thewarwithin
Choose a base branch
from
98 changes: 81 additions & 17 deletions engine/class_modules/sc_shaman.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -487,6 +487,8 @@ struct shaman_t : public player_t
action_t* flame_shock_lmt;
action_t* flame_shock;
action_t* elemental_blast;
action_t* lava_burst;
action_t* lava_burst_ol;

action_t* lightning_rod;
action_t* tempest_strikes;
Expand Down Expand Up @@ -2344,29 +2346,39 @@ struct shaman_action_t : public Base
{
p()->buff.flurry->trigger( p()->buff.flurry->max_stack() );
}

if ( ( affected_by_ns_cast_time || affected_by_ns_cost ) && !(affected_by_stormkeeper_cast_time && p()->buff.stormkeeper->up()) && !ab::background)
if (!p()->buff.stormkeeper->up() || !affected_by_stormkeeper_cast_time)
{
p()->buff.natures_swiftness->decrement();
}
if ( ( affected_by_ns_cast_time || affected_by_ns_cost ) && !ab::background )
{
p()->buff.natures_swiftness->decrement();
}

if ( ( affected_by_ans_cast_time || affected_by_ans_cost ) && !(affected_by_stormkeeper_cast_time && p()->buff.stormkeeper->up()) && !ab::background)
{
p()->buff.ancestral_swiftness->decrement();
if ( ( affected_by_ans_cast_time || affected_by_ans_cost ) &&
!( affected_by_stormkeeper_cast_time && p()->buff.stormkeeper->up() ) && !ab::background )
{
p()->buff.ancestral_swiftness->decrement();
}

if ( affected_by_arc_discharge && p()->buff.arc_discharge->up() && !ab::background && p()->specialization() == SHAMAN_ELEMENTAL)
{
p()->buff.arc_discharge->decrement();
}
}

if ( affected_by_storm_frenzy && !this->background && exec_type == spell_variant::NORMAL &&
!( affected_by_stormkeeper_cast_time && p()->buff.stormkeeper->up() ) && !ab::background )
{
this->p()->buff.storm_frenzy->decrement();
}

}

void impact( action_state_t* state ) override
{
ab::impact( state );

p()->trigger_stormbringer( state );

if ( affected_by_storm_frenzy && exec_type == spell_variant::NORMAL &&
!p()->buff.stormkeeper->up()&& !ab::background )
{
p()->buff.storm_frenzy->decrement();
}
}

void schedule_execute( action_state_t* execute_state = nullptr ) override
Expand Down Expand Up @@ -2721,7 +2733,7 @@ struct shaman_spell_base_t : public shaman_action_t<Base>

this->p()->consume_maelstrom_weapon( this->execute_state, mw_consumed_stacks );

if ( this->exec_type == spell_variant::NORMAL && !this->background )
if ( this->exec_type == spell_variant::NORMAL && (!this->background || this->execute_state->action->id == 188389))
{
this->p()->trigger_ancestor( ancestor_trigger, this->execute_state );
}
Expand Down Expand Up @@ -7050,7 +7062,13 @@ struct lightning_bolt_t : public shaman_spell_t

if ( !p()->sk_during_cast )
{
p()->buff.stormkeeper->decrement();
auto rem = p()->buff.stormkeeper->remains();
auto dur = p()->buff.stormkeeper->buff_duration();
if ( p()->buff.stormkeeper->stack() != 3 ||
rem < dur * 0.97)
{
p()->buff.stormkeeper->decrement();
}
}
p()->sk_during_cast = false;

Expand Down Expand Up @@ -8704,10 +8722,13 @@ struct ascendance_t : public shaman_spell_t
{
ascendance_damage_t* ascendance_damage;
lava_burst_t* lvb;
lava_burst_overload_t* lvb_ol;

ascendance_t( shaman_t* player, util::string_view name_str, util::string_view options_str = {} ) :
shaman_spell_t( name_str, player, player->spell.ascendance ),
ascendance_damage( nullptr ), lvb( nullptr )
ascendance_damage( nullptr ),
lvb( nullptr ),
lvb_ol( nullptr )
{
parse_options( options_str );
harmful = false;
Expand All @@ -8727,7 +8748,6 @@ struct ascendance_t : public shaman_spell_t
void init() override
{
shaman_spell_t::init();

if ( p()->specialization() == SHAMAN_ELEMENTAL )
{
if ( auto trigger_spell = p()->find_action( "lava_burst_ascendance" ) )
Expand Down Expand Up @@ -8850,6 +8870,8 @@ struct ascendance_dre_t : public ascendance_t
lvb = new lava_burst_t( p(), spell_variant::DEEPLY_ROOTED_ELEMENTS );
add_child( lvb );
}

lvb_ol = debug_cast<lava_burst_overload_t*>(p()->find_action("lava_burst_overload"));
}

if ( p()->specialization() == SHAMAN_ENHANCEMENT )
Expand All @@ -8865,6 +8887,44 @@ struct ascendance_dre_t : public ascendance_t
}
}
}

void execute() override
{
if ( p()->specialization() == SHAMAN_ENHANCEMENT || !p()->bugs )
{
ascendance_t::execute();
return;
}

if (!p()->buff.ascendance->up())
{
ascendance_t::execute();
return;
}

//for Elemental, the damage portion of Asc is not executed. this is intented to model a bug
auto tl = target_list();
auto fs_cap = p()->action.ascendance->data().effectN( 7 ).base_value();
for ( size_t i = 0; i < fs_cap; i++ )
{

int index = rng().range( tl.size() );
p()->trigger_secondary_flame_shock( tl[ index ], spell_variant::ASCENDANCE );


p()->trigger_maelstrom_gain( lvb->maelstrom_gain );
p()->trigger_maelstrom_gain( lvb_ol->maelstrom_gain );

double ol_chance = overload_chance( execute_state );

if ( !rng().roll( ol_chance ) )
{
p()->trigger_maelstrom_gain( lvb_ol->maelstrom_gain );
}

}

}
};

// Stormkeeper Spell ========================================================
Expand Down Expand Up @@ -12929,7 +12989,11 @@ void shaman_t::trigger_arc_discharge( const action_state_t* state )
} );

}
buff.arc_discharge->decrement();

if ( specialization() == SHAMAN_ENHANCEMENT )
{
buff.arc_discharge->decrement();
}
}

//Flowing Spirits logic is real round-about all around the module, when Windfury procs it, it reports
Expand Down