Skip to content

Commit

Permalink
Merge branch 'thewarwithin' of github.com:simulationcraft/simc into t…
Browse files Browse the repository at this point in the history
…hewarwithin
  • Loading branch information
HawkCorrigan committed Jan 9, 2025
2 parents 5a142f7 + 02d1db8 commit 62f92a3
Show file tree
Hide file tree
Showing 15 changed files with 179 additions and 133 deletions.
42 changes: 42 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -516,6 +516,48 @@ jobs:
with:
name: apl-${{ github.sha }}-*

update-generated-apl-modules:
name: Action Priority List Dump / Regenerate Profiles
runs-on: ${{ matrix.os }}
needs: [ spec-test, spelldata-dump ]
if: github.event_name == 'push' && ( success() || failure() ) && github.repository == 'simulationcraft/simc'

strategy:
fail-fast: false
matrix:
cppVersion: [17]
compiler: [clang++-15]
include:
- compiler: clang++-15
os: ubuntu-22.04

steps:
- uses: actions/cache@v4
with:
path: |
${{ runner.workspace }}/b/ninja/simc
key: ubuntu-${{ matrix.compiler }}-for_run-${{ github.sha }}-cpp-${{ matrix.cppVersion }}

- uses: actions/checkout@v4

- name: Setup
run: echo "SHORT_SHA=$(git rev-parse --short ${{ github.sha }})" >> $GITHUB_ENV

- name: Run
env:
UBSAN_OPTIONS: print_stacktrace=1
SIMC_CLI_PATH: ${{ runner.workspace }}/b/ninja/simc
run: ${{ github.workspace }}/generate_apl_modules_ci.sh

- name: Commit code-generated APLs
continue-on-error: true
uses: EndBug/add-and-commit@v9
with:
message: 'Update generated APL modules ${{ env.SHORT_SHA }}'
default_author: github_actions
fetch: --no-tags --force --prune --no-recurse-submodules --depth=1 origin ${{ github.ref_name }}
add: 'engine/class_modules/apl'

ubuntu-run:
name: ubuntu-${{ matrix.compiler }}-cpp-${{ matrix.cppVersion }}-${{ matrix.type }}
runs-on: ${{ matrix.os }}
Expand Down
2 changes: 1 addition & 1 deletion ActionPriorityLists/deathknight_unholy.simc
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ actions+=/call_action_list,name=cleave,if=active_enemies=2
actions+=/call_action_list,name=aoe_setup,if=active_enemies>=3&!death_and_decay.ticking&cooldown.death_and_decay.remains<10
actions+=/call_action_list,name=aoe_burst,if=active_enemies>=3&(death_and_decay.ticking|buff.death_and_decay.up&death_knight.fwounded_targets>=(active_enemies*0.5))
actions+=/call_action_list,name=aoe,if=active_enemies>=3&!death_and_decay.ticking
actions+=/run_action_list,name=san_fishing,if=active_enemies=1&talent.gift_of_the_sanlayn&!cooldown.dark_transformation.ready&!buff.gift_of_the_sanlayn.up&buff.essence_of_the_blood_queen.remains<cooldown.dark_transformation.remains+2
actions+=/run_action_list,name=san_fishing,if=active_enemies=1&talent.gift_of_the_sanlayn&!cooldown.dark_transformation.ready&!buff.gift_of_the_sanlayn.up&buff.essence_of_the_blood_queen.remains<cooldown.dark_transformation.remains+3
actions+=/call_action_list,name=san_st,if=active_enemies=1&talent.vampiric_strike
actions+=/call_action_list,name=st,if=active_enemies=1&!talent.vampiric_strike

Expand Down
7 changes: 7 additions & 0 deletions engine/buff/buff.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -449,6 +449,13 @@ std::unique_ptr<expr_t> create_buff_expression( util::string_view buff_name, uti
return buff->max_stack();
} );
}
else if ( type == "at_max_stacks" )
{
return make_buff_expr( "buff_at_max_stacks",
[]( buff_t* buff ) {
return buff->at_max_stacks();
} );
}
else if ( type == "value" )
{
return make_buff_expr( "buff_value",
Expand Down
12 changes: 9 additions & 3 deletions engine/class_modules/apl/apl_death_knight.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -418,7 +418,7 @@ void unholy( player_t* p )
default_->add_action( "call_action_list,name=aoe_setup,if=active_enemies>=3&!death_and_decay.ticking&cooldown.death_and_decay.remains<10" );
default_->add_action( "call_action_list,name=aoe_burst,if=active_enemies>=3&(death_and_decay.ticking|buff.death_and_decay.up&death_knight.fwounded_targets>=(active_enemies*0.5))" );
default_->add_action( "call_action_list,name=aoe,if=active_enemies>=3&!death_and_decay.ticking" );
default_->add_action( "run_action_list,name=san_fishing,if=active_enemies=1&talent.gift_of_the_sanlayn&!cooldown.dark_transformation.ready&!buff.gift_of_the_sanlayn.up&buff.essence_of_the_blood_queen.remains<cooldown.dark_transformation.remains+2" );
default_->add_action( "run_action_list,name=san_fishing,if=active_enemies=1&talent.gift_of_the_sanlayn&!cooldown.dark_transformation.ready&!buff.gift_of_the_sanlayn.up&buff.essence_of_the_blood_queen.remains<cooldown.dark_transformation.remains+3" );
default_->add_action( "call_action_list,name=san_st,if=active_enemies=1&talent.vampiric_strike" );
default_->add_action( "call_action_list,name=st,if=active_enemies=1&!talent.vampiric_strike" );

Expand Down Expand Up @@ -502,14 +502,20 @@ void unholy( player_t* p )

san_fishing->add_action( "antimagic_shell,if=death_knight.ams_absorb_percent>0&runic_power<40", "San'layn Fishing" );
san_fishing->add_action( "any_dnd,if=!buff.death_and_decay.up&!buff.vampiric_strike.react" );
san_fishing->add_action( "death_coil,if=buff.sudden_doom.react&talent.doomed_bidding" );
if ( p->is_ptr() )
san_fishing->add_action( "death_coil,if=buff.sudden_doom.react&talent.doomed_bidding|set_bonus.tww2_4pc&buff.essence_of_the_blood_queen.at_max_stacks&talent.frenzied_bloodthirst&!buff.vampiric_strike.react" );
else
san_fishing->add_action( "death_coil,if=buff.sudden_doom.react&talent.doomed_bidding" );
san_fishing->add_action( "soul_reaper,if=target.health.pct<=35&fight_remains>5" );
san_fishing->add_action( "death_coil,if=!buff.vampiric_strike.react" );
san_fishing->add_action( "wound_spender,if=(debuff.festering_wound.stack>=3-pet.abomination.active&cooldown.apocalypse.remains>variable.apoc_timing)|buff.vampiric_strike.react" );
san_fishing->add_action( "festering_strike,if=debuff.festering_wound.stack<3-pet.abomination.active" );

san_st->add_action( "any_dnd,if=!death_and_decay.ticking&talent.unholy_ground&cooldown.dark_transformation.remains<5", "Single Target San'layn" );
san_st->add_action( "death_coil,if=buff.sudden_doom.react&buff.gift_of_the_sanlayn.remains&(talent.doomed_bidding|talent.rotten_touch)|rune<3&!buff.runic_corruption.up" );
if ( p->is_ptr() )
san_st->add_action( "death_coil,if=buff.sudden_doom.react&buff.gift_of_the_sanlayn.remains&(talent.doomed_bidding|talent.rotten_touch)|rune<3&!buff.runic_corruption.up|set_bonus.tww2_4pc&runic_power>80|buff.gift_of_the_sanlayn.up&buff.essence_of_the_blood_queen.at_max_stacks&talent.frenzied_bloodthirst&set_bonus.tww2_4pc&buff.winning_streak.at_max_stacks&rune<=3&buff.essence_of_the_blood_queen.remains>3" );
else
san_st->add_action( "death_coil,if=buff.sudden_doom.react&buff.gift_of_the_sanlayn.remains&(talent.doomed_bidding|talent.rotten_touch)|rune<3&!buff.runic_corruption.up" );
san_st->add_action( "wound_spender,if=buff.gift_of_the_sanlayn.up&buff.vampiric_strike.react|talent.gift_of_the_sanlayn&buff.dark_transformation.up&buff.dark_transformation.remains<gcd" );
san_st->add_action( "soul_reaper,if=target.health.pct<=35&!buff.gift_of_the_sanlayn.up&fight_remains>5" );
san_st->add_action( "wound_spender,if=buff.vampiric_strike.react&debuff.festering_wound.stack>=1" );
Expand Down
28 changes: 9 additions & 19 deletions engine/class_modules/monk/sc_monk.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,9 @@ void monk_action_t<Base>::apply_buff_effects()
parse_effects( p()->buff.pressure_point );
parse_effects( p()->buff.storm_earth_and_fire, IGNORE_STACKS, effect_mask_t( false ).enable( 1, 2, 3, 7, 8 ),
affect_list_t( 1, 2 ).add_spell( p()->passives.chi_explosion->id() ) );
parse_effects( p()->buff.bok_proc, p()->talent.windwalker.courageous_impulse );
parse_effects(
p()->buff.bok_proc, p()->talent.windwalker.courageous_impulse,
affect_list_t( 1, 2, 3 ).remove_spell( p()->talent.windwalker.teachings_of_the_monastery_blackout_kick->id() ) );

// Conduit of the Celestials
parse_effects( p()->buff.august_dynasty, EXPIRE_BUFF );
Expand Down Expand Up @@ -1258,19 +1260,7 @@ struct tiger_palm_t : public overwhelming_force_t<monk_melee_attack_t>
if ( result_is_miss( execute_state->result ) )
return;

//-----------

//============
// Post-hit
//============

// Combo Breaker calculation
if ( p()->baseline.windwalker.combo_breaker->ok() && p()->buff.bok_proc->trigger() &&
p()->buff.storm_earth_and_fire->up() )
{
p()->trigger_storm_earth_and_fire_bok_proc( pets::sef_pet_e::SEF_FIRE );
p()->trigger_storm_earth_and_fire_bok_proc( pets::sef_pet_e::SEF_EARTH );
}
p()->buff.bok_proc->trigger();

// Reduces the remaining cooldown on your Brews by 1 sec
p()->baseline.brewmaster.brews.adjust(
Expand Down Expand Up @@ -1843,7 +1833,8 @@ struct blackout_kick_t : overwhelming_force_t<charred_passions_t<monk_melee_atta

for ( int i = 0; i < totm_stacks; ++i )
{
bok_totm_proc->execute_on_target( target );
// quick estimate for delay between totm activations, not rigorously tested for
make_event<events::delayed_execute_event_t>( *sim, p(), bok_totm_proc, p()->target, i * 100_ms );
if ( p()->rng().roll( p()->talent.conduit_of_the_celestials.xuens_guidance->effectN( 1 ).percent() ) )
p()->buff.teachings_of_the_monastery->trigger();
}
Expand Down Expand Up @@ -1930,7 +1921,7 @@ struct rushing_jade_wind_t : public monk_melee_attack_t
buff_t *buff;

rushing_jade_wind_t( monk_t *player, util::string_view options_str )
: monk_melee_attack_t( player, "rushing_jade_wind", player->shared.rushing_jade_wind ),
: monk_melee_attack_t( player, "rushing_jade_wind", player->talent.brewmaster.rushing_jade_wind ),
buff( player->buff.rushing_jade_wind )
{
parse_options( options_str );
Expand Down Expand Up @@ -2124,7 +2115,7 @@ struct spinning_crane_kick_t : public monk_melee_attack_t
p()->buff.dance_of_chiji_hidden->trigger();

if ( p()->rng().roll( p()->talent.windwalker.sequenced_strikes->effectN( 1 ).percent() ) )
p()->buff.bok_proc->increment(); // increment is used to not incur the rppm cooldown
p()->buff.bok_proc->increment(); // increment is used to directly trigger without rolling chance
}
}

Expand Down Expand Up @@ -5368,6 +5359,7 @@ struct rushing_jade_wind_buff_t : public monk_buff_t
{
ww_mastery = true;

sef_ability = actions::sef_ability_e::SEF_RJW_TICK;
dual = background = true;
aoe = -1;
reduced_aoe_targets = p->passives.rushing_jade_wind->effectN( 1 ).base_value();
Expand Down Expand Up @@ -7083,8 +7075,6 @@ void monk_t::init_spells()

shared.invokers_delight = _priority( talent.windwalker.invokers_delight, talent.mistweaver.invokers_delight );

shared.rushing_jade_wind = _priority( talent.windwalker.rushing_jade_wind, talent.brewmaster.rushing_jade_wind );

if ( talent.windwalker.teachings_of_the_monastery->ok() )
shared.teachings_of_the_monastery = talent.windwalker.teachings_of_the_monastery;
else if ( baseline.mistweaver.teachings_of_the_monastery->ok() )
Expand Down
4 changes: 1 addition & 3 deletions engine/class_modules/monk/sc_monk.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ enum class sef_ability_e
SEF_STRIKE_OF_THE_WINDLORD,
SEF_STRIKE_OF_THE_WINDLORD_OH,
SEF_CELESTIAL_CONDUIT,
SEF_RJW_TICK,
SEF_ATTACK_MAX,
// Attacks end here

Expand Down Expand Up @@ -1334,9 +1335,7 @@ struct monk_t : public stagger_t<parse_player_effects_t, monk_t>
struct
{
const spell_data_t *jadefire_stomp;
const spell_data_t *healing_elixir;
const spell_data_t *invokers_delight;
const spell_data_t *rushing_jade_wind;
const spell_data_t *teachings_of_the_monastery;
} shared;

Expand Down Expand Up @@ -1468,7 +1467,6 @@ struct monk_t : public stagger_t<parse_player_effects_t, monk_t>
void storm_earth_and_fire_fixate( player_t *target );
bool storm_earth_and_fire_fixate_ready( player_t *target );
player_t *storm_earth_and_fire_fixate_target( pets::sef_pet_e sef_pet );
void trigger_storm_earth_and_fire_bok_proc( pets::sef_pet_e sef_pet );
};

struct sef_despawn_cb_t
Expand Down
93 changes: 13 additions & 80 deletions engine/class_modules/monk/sc_monk_pets.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -349,20 +349,6 @@ struct monk_pet_buff_t : public buff_t
return p().o();
};
};

// ===============================================================================
// Tier 28 Primordial Power Buff
// ===============================================================================

struct primordial_power_buff_t : public monk_pet_buff_t<buff_t>
{
primordial_power_buff_t( monk_pet_t &p, util::string_view n, const spell_data_t *s ) : monk_pet_buff_t( p, n, s )
{
add_invalidate( CACHE_PLAYER_DAMAGE_MULTIPLIER );
set_reverse( true );
set_reverse_stack_count( s->max_stacks() );
}
};
} // namespace buffs

// ==========================================================================
Expand All @@ -381,12 +367,6 @@ struct storm_earth_and_fire_pet_t : public monk_pet_t

const action_t *source_action;

// Windwalker Tier 28 4-piece info
// Currently Primordial Power is only a visual buff and not tied to any direct damage buff
// the buff is pulled from the player
// Currently the buff appears if SEF is summoned before Primordial Potential becomes Primordial Power
// buff does not appear if SEF is summoned after Primordial Power is active.

sef_action_base_t( util::string_view n, storm_earth_and_fire_pet_t *p,
const spell_data_t *data = spell_data_t::nil() )
: super_t( n, p, data ), source_action( nullptr )
Expand Down Expand Up @@ -662,8 +642,7 @@ struct storm_earth_and_fire_pet_t : public monk_pet_t
{
double am = sef_melee_attack_t::action_multiplier();

if ( p()->o()->buff.tigers_ferocity->check() )
am /= 1.0 + p()->o()->buff.tigers_ferocity->check_stack_value();
am /= 1.0 + p()->o()->buff.tigers_ferocity->check_stack_value();

return am;
}
Expand Down Expand Up @@ -711,16 +690,22 @@ struct storm_earth_and_fire_pet_t : public monk_pet_t
}
}

double action_multiplier() const override
{
double am = sef_melee_attack_t::action_multiplier();

if ( p()->o()->talent.windwalker.courageous_impulse->ok() && p()->o()->buff.bok_proc->check() )
am /= 1.0 + p()->o()->talent.windwalker.courageous_impulse->effectN( 1 ).percent();

return am;
}

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

if ( result_is_hit( state->result ) )
{
o()->trigger_mark_of_the_crane( state );

p()->buff.bok_proc_sef->expire();
}
}
};

Expand Down Expand Up @@ -1126,27 +1111,11 @@ struct storm_earth_and_fire_pet_t : public monk_pet_t

bool sticky_target; // When enabled, SEF pets will stick to the target they have

struct
{
action_t *rushing_jade_wind_sef = nullptr;
} active_actions;

struct
{
propagate_const<buff_t *> bok_proc_sef = nullptr;
propagate_const<buff_t *> pressure_point_sef = nullptr;
propagate_const<buff_t *> rushing_jade_wind_sef = nullptr;
// Tier 28 Buff
propagate_const<buff_t *> primordial_power = nullptr;
} buff;

storm_earth_and_fire_pet_t( util::string_view name, monk_t *owner, bool dual_wield, weapon_e weapon_type )
: monk_pet_t( owner, name, PET_NONE, true, true ),
attacks( (int)actions::sef_ability_e::SEF_ATTACK_MAX ),
spells( (int)actions::sef_ability_e::SEF_SPELL_MAX - (int)actions::sef_ability_e::SEF_SPELL_MIN ),
sticky_target( false ),
active_actions(),
buff()
sticky_target( false )
{
// Storm, Earth, and Fire pets have to become "Windwalkers", so we can get
// around some sanity checks in the action execution code, that prevents
Expand Down Expand Up @@ -1199,12 +1168,11 @@ struct storm_earth_and_fire_pet_t : public monk_pet_t
attacks.at( (int)actions::sef_ability_e::SEF_STRIKE_OF_THE_WINDLORD_OH ) =
new sef_strike_of_the_windlord_oh_t( this );
attacks.at( (int)actions::sef_ability_e::SEF_CELESTIAL_CONDUIT ) = new sef_celestial_conduit_t( this );
attacks.at( (int)actions::sef_ability_e::SEF_RJW_TICK ) = new sef_rushing_jade_wind_tick_t( this );

spells.at( sef_spell_index( (int)actions::sef_ability_e::SEF_CHI_WAVE ) ) = new sef_chi_wave_damage_t( this );
spells.at( sef_spell_index( (int)actions::sef_ability_e::SEF_CRACKLING_JADE_LIGHTNING ) ) =
new sef_crackling_jade_lightning_t( this );

active_actions.rushing_jade_wind_sef = new sef_rushing_jade_wind_tick_t( this );
}

void init_action_list() override
Expand All @@ -1228,12 +1196,6 @@ struct storm_earth_and_fire_pet_t : public monk_pet_t

o()->buff.storm_earth_and_fire->trigger( 1, buff_t::DEFAULT_VALUE(), 1, duration );

if ( o()->buff.bok_proc->up() )
buff.bok_proc_sef->trigger( 1, buff_t::DEFAULT_VALUE(), 1, o()->buff.bok_proc->remains() );

if ( o()->buff.rushing_jade_wind->up() )
buff.rushing_jade_wind_sef->trigger( 1, buff_t::DEFAULT_VALUE(), 1, o()->buff.rushing_jade_wind->remains() );

sticky_target = false;
}

Expand All @@ -1244,31 +1206,6 @@ struct storm_earth_and_fire_pet_t : public monk_pet_t
o()->buff.storm_earth_and_fire->decrement();
}

void create_buffs() override
{
monk_pet_t::create_buffs();

buff.bok_proc_sef =
make_buff( this, "bok_proc_sef", o()->passives.bok_proc )
->set_trigger_spell( o()->baseline.windwalker.combo_breaker )
->set_quiet( true ); // In-game does not show this buff but I would like to use it for background stuff;

buff.rushing_jade_wind_sef = make_buff( this, "rushing_jade_wind_sef", o()->passives.rushing_jade_wind )
->set_can_cancel( true )
->set_tick_zero( true )
->set_cooldown( timespan_t::zero() )
->set_period( o()->passives.rushing_jade_wind->effectN( 1 ).period() )
->set_refresh_behavior( buff_refresh_behavior::PANDEMIC )
->set_duration( sim->expected_iteration_time * 2 )
->set_tick_behavior( buff_tick_behavior::CLIP )
->set_tick_callback( [ this ]( buff_t *d, int, timespan_t ) {
if ( o()->buff.rushing_jade_wind->up() )
active_actions.rushing_jade_wind_sef->execute();
else
d->expire( timespan_t::from_millis( 1 ) );
} );
}

void trigger_attack( actions::sef_ability_e ability, const action_t *source_action, bool combo_strike = false )
{
if ( channeling )
Expand Down Expand Up @@ -1880,10 +1817,6 @@ void sef_despawn_cb_t::operator()( player_t * )
}
} );
}
void monk_t::trigger_storm_earth_and_fire_bok_proc( pets::sef_pet_e sef_pet )
{
pets.sef[ (int)sef_pet ]->buff.bok_proc_sef->trigger();
}

player_t *monk_t::storm_earth_and_fire_fixate_target( pets::sef_pet_e sef_pet )
{
Expand Down
Loading

0 comments on commit 62f92a3

Please sign in to comment.