From da5e2e4b2ede00ae0a52a17797c68ba27fff8a00 Mon Sep 17 00:00:00 2001 From: Alex Date: Sat, 25 Jan 2025 22:07:58 -0500 Subject: [PATCH 1/4] jade empowerment --- engine/class_modules/apl/apl_monk.cpp | 4 +--- engine/class_modules/monk/sc_monk.cpp | 34 +++++++++++++++++++++++---- engine/class_modules/monk/sc_monk.hpp | 3 +++ 3 files changed, 34 insertions(+), 7 deletions(-) diff --git a/engine/class_modules/apl/apl_monk.cpp b/engine/class_modules/apl/apl_monk.cpp index 797cf676ed5..ff1b98a9f6e 100644 --- a/engine/class_modules/apl/apl_monk.cpp +++ b/engine/class_modules/apl/apl_monk.cpp @@ -238,9 +238,6 @@ void mistweaver( player_t *p ) action_priority_list_t *def = p->get_action_priority_list( "default" ); action_priority_list_t *racials = p->get_action_priority_list( "race_actions" ); - pre->add_action( "flask" ); - pre->add_action( "food" ); - pre->add_action( "augmentation" ); pre->add_action( "snapshot_stats" ); pre->add_action( "potion" ); @@ -261,6 +258,7 @@ void mistweaver( player_t *p ) def->add_action( "rising_sun_kick,if=talent.secret_infusion&buff.thunder_focus_tea.up" ); def->add_action( "spinning_crane_kick,if=buff.dance_of_chiji.up" ); def->add_action( "chi_burst,if=active_enemies>=2" ); + def->add_action( "crackling_jade_lightning,if=buff.jade_empowerment.up" ); def->add_action( "jadefire_stomp,if=active_enemies>=4&active_enemies<=10" ); def->add_action( "spinning_crane_kick,if=active_enemies>=4" ); diff --git a/engine/class_modules/monk/sc_monk.cpp b/engine/class_modules/monk/sc_monk.cpp index 2b24e4503dc..a706821b064 100644 --- a/engine/class_modules/monk/sc_monk.cpp +++ b/engine/class_modules/monk/sc_monk.cpp @@ -3404,10 +3404,16 @@ struct crackling_jade_lightning_t : public monk_spell_t // reduction for secondary targets if ( p->is_ptr() ) - base_td_multiplier *= p->talent.windwalker.power_of_the_thunder_king->effectN( 4 ).percent(); + { + if ( p->talent.windwalker.power_of_the_thunder_king.ok() ) + base_td_multiplier *= p->talent.windwalker.power_of_the_thunder_king->effectN( 4 ).percent(); + else if ( p->talent.mistweaver.jade_empowerment.ok() ) + base_td_multiplier *= p->buff.jade_empowerment->data().effectN( 4 ).percent(); + } parse_effects( p->talent.windwalker.power_of_the_thunder_king, effect_mask_t( true ).disable( 1 ) ); parse_effects( p->buff.the_emperors_capacitor ); + parse_effects( p->buff.jade_empowerment, effect_mask_t( true ).disable( 1 ) ); } double cost_per_tick( resource_e ) const override @@ -3435,16 +3441,25 @@ struct crackling_jade_lightning_t : public monk_spell_t parse_effects( p->talent.windwalker.power_of_the_thunder_king, effect_mask_t( true ).disable( 1 ) ); parse_effects( p->buff.the_emperors_capacitor ); + parse_effects( p->buff.jade_empowerment ); if ( p->talent.windwalker.power_of_the_thunder_king->ok() ) add_child( aoe_dot ); } + double cost_per_tick( resource_e r ) const override + { + if ( p()->specialization() == MONK_MISTWEAVER ) + return 0.0; + + return base_t::cost_per_tick( r ); + } + void execute() override { monk_spell_t::execute(); - if ( p()->talent.windwalker.power_of_the_thunder_king->ok() ) + if ( p()->talent.windwalker.power_of_the_thunder_king->ok() || p()->buff.jade_empowerment->up() ) { const auto &tl = target_list(); int count = 0; @@ -3455,7 +3470,11 @@ struct crackling_jade_lightning_t : public monk_spell_t if ( t == target ) continue; - if ( count < p()->talent.windwalker.power_of_the_thunder_king->effectN( 1 ).base_value() ) + const double cleave_targets = p()->talent.windwalker.power_of_the_thunder_king->ok() + ? p()->talent.windwalker.power_of_the_thunder_king->effectN( 1 ).base_value() + : p()->buff.jade_empowerment->data().effectN( 1 ).base_value(); + + if ( count < cleave_targets ) { aoe_dot->execute_on_target( t ); count++; @@ -3468,10 +3487,11 @@ struct crackling_jade_lightning_t : public monk_spell_t { monk_spell_t::last_tick( dot ); - if ( p()->talent.windwalker.power_of_the_thunder_king->ok() ) + if ( p()->talent.windwalker.power_of_the_thunder_king->ok() || p()->buff.jade_empowerment->up() ) // delay expiration so it occurs after final tick of cjl aoe make_event( *sim, p(), 1_ms, [ & ]() { p()->buff.the_emperors_capacitor->expire(); + p()->buff.jade_empowerment->expire(); const auto &tl = target_list(); for ( const auto &t : tl ) { @@ -3830,6 +3850,7 @@ struct thunder_focus_tea_t : public monk_spell_t monk_spell_t::execute(); p()->buff.thunder_focus_tea->trigger( p()->buff.thunder_focus_tea->max_stack() ); + p()->buff.jade_empowerment->trigger(); } }; @@ -6884,6 +6905,8 @@ void monk_t::init_spells() talent.mistweaver.awakened_jadefire = _ST( "Awakened Jadefire" ); talent.mistweaver.awakened_jadefire_buff = find_spell( 389387 ); talent.mistweaver.dance_of_chiji = _ST( "Dance of Chi-Ji" ); + talent.mistweaver.jade_empowerment = _ST( "Jade Empowerment" ); + talent.mistweaver.jade_empowerment_buff = find_spell( 467317 ); talent.mistweaver.tea_of_serenity = _ST( "Tea of Serenity" ); talent.mistweaver.tea_of_plenty = _ST( "Tea of Plenty" ); talent.mistweaver.unison = _ST( "Unison" ); @@ -7575,6 +7598,9 @@ void monk_t::create_buffs() buff.awakened_jadefire = make_buff_fallback( talent.mistweaver.awakened_jadefire->ok(), this, "ancient_concordance", talent.mistweaver.awakened_jadefire_buff ); + buff.jade_empowerment = make_buff_fallback( talent.mistweaver.jade_empowerment->ok(), this, "jade_empowerment", + talent.mistweaver.jade_empowerment_buff ); + buff.jadefire_stomp_reset = make_buff_fallback( talent.mistweaver.jadefire_stomp->ok(), this, "jadefire_stomp_reset", find_spell( 388193 ) ) ->set_trigger_spell( shared.jadefire_stomp ); diff --git a/engine/class_modules/monk/sc_monk.hpp b/engine/class_modules/monk/sc_monk.hpp index 61ca6b60712..b21c10b5b69 100644 --- a/engine/class_modules/monk/sc_monk.hpp +++ b/engine/class_modules/monk/sc_monk.hpp @@ -600,6 +600,7 @@ struct monk_t : public stagger_t // Mistweaver propagate_const life_cocoon; propagate_const dance_of_chiji_mw; + propagate_const jade_empowerment; propagate_const jadefire_stomp_reset; propagate_const secret_infusion_haste; propagate_const secret_infusion_crit; @@ -1073,6 +1074,8 @@ struct monk_t : public stagger_t player_talent_t awakened_jadefire; const spell_data_t *awakened_jadefire_buff; player_talent_t dance_of_chiji; + player_talent_t jade_empowerment; + const spell_data_t *jade_empowerment_buff; player_talent_t tea_of_serenity; player_talent_t tea_of_plenty; player_talent_t unison; From 84b013076deedcc08505d0260bc2208161efa995 Mon Sep 17 00:00:00 2001 From: Kate Martin <51387586+renanthera@users.noreply.github.com> Date: Sat, 25 Jan 2025 23:08:05 -0700 Subject: [PATCH 2/4] [monk] Make member access and arg naming more consistent. Add dot child for both PottK or JE. Set base resource cost if MW instead of override member. Remove `parse_effects` blacklist on dummy effect. Purge ternary. --- engine/class_modules/monk/sc_monk.cpp | 68 ++++++++++++++------------- 1 file changed, 35 insertions(+), 33 deletions(-) diff --git a/engine/class_modules/monk/sc_monk.cpp b/engine/class_modules/monk/sc_monk.cpp index a706821b064..3d7455ac7e9 100644 --- a/engine/class_modules/monk/sc_monk.cpp +++ b/engine/class_modules/monk/sc_monk.cpp @@ -3392,10 +3392,10 @@ struct chi_torpedo_t : public monk_spell_t struct crackling_jade_lightning_t : public monk_spell_t { - struct crackling_jade_lightning_aoe_t : public monk_spell_t + struct aoe_dot_t : public monk_spell_t { - crackling_jade_lightning_aoe_t( monk_t *p ) - : monk_spell_t( p, "crackling_jade_lightning_aoe", p->baseline.monk.crackling_jade_lightning ) + aoe_dot_t( monk_t *player ) + : monk_spell_t( player, "crackling_jade_lightning_aoe", player->baseline.monk.crackling_jade_lightning ) { dual = background = true; ww_mastery = true; @@ -3403,17 +3403,17 @@ struct crackling_jade_lightning_t : public monk_spell_t sef_ability = actions::sef_ability_e::SEF_CRACKLING_JADE_LIGHTNING_AOE; // reduction for secondary targets - if ( p->is_ptr() ) + if ( player->is_ptr() ) { - if ( p->talent.windwalker.power_of_the_thunder_king.ok() ) - base_td_multiplier *= p->talent.windwalker.power_of_the_thunder_king->effectN( 4 ).percent(); - else if ( p->talent.mistweaver.jade_empowerment.ok() ) - base_td_multiplier *= p->buff.jade_empowerment->data().effectN( 4 ).percent(); + if ( player->talent.windwalker.power_of_the_thunder_king->ok() ) + base_td_multiplier *= player->talent.windwalker.power_of_the_thunder_king->effectN( 4 ).percent(); + if ( player->talent.mistweaver.jade_empowerment->ok() ) + base_td_multiplier *= player->buff.jade_empowerment->data().effectN( 4 ).percent(); } - parse_effects( p->talent.windwalker.power_of_the_thunder_king, effect_mask_t( true ).disable( 1 ) ); - parse_effects( p->buff.the_emperors_capacitor ); - parse_effects( p->buff.jade_empowerment, effect_mask_t( true ).disable( 1 ) ); + parse_effects( player->talent.windwalker.power_of_the_thunder_king, effect_mask_t( true ).disable( 1 ) ); + parse_effects( player->buff.the_emperors_capacitor ); + parse_effects( player->buff.jade_empowerment ); } double cost_per_tick( resource_e ) const override @@ -3422,37 +3422,34 @@ struct crackling_jade_lightning_t : public monk_spell_t } }; - crackling_jade_lightning_aoe_t *aoe_dot; + aoe_dot_t *aoe_dot; - crackling_jade_lightning_t( monk_t *p, util::string_view options_str ) - : monk_spell_t( p, "crackling_jade_lightning", p->baseline.monk.crackling_jade_lightning ), - aoe_dot( new crackling_jade_lightning_aoe_t( p ) ) + crackling_jade_lightning_t( monk_t *player, util::string_view options_str ) + : monk_spell_t( player, "crackling_jade_lightning", player->baseline.monk.crackling_jade_lightning ), + aoe_dot( nullptr ) { + parse_options( options_str ); + sef_ability = actions::sef_ability_e::SEF_CRACKLING_JADE_LIGHTNING; may_combo_strike = true; ww_mastery = true; interrupt_auto_attack = true; channeled = true; - parse_options( options_str ); - - // Forcing the minimum GCD to 750 milliseconds for all 3 specs min_gcd = timespan_t::from_millis( 750 ); - parse_effects( p->talent.windwalker.power_of_the_thunder_king, effect_mask_t( true ).disable( 1 ) ); - parse_effects( p->buff.the_emperors_capacitor ); - parse_effects( p->buff.jade_empowerment ); - - if ( p->talent.windwalker.power_of_the_thunder_king->ok() ) - add_child( aoe_dot ); - } + parse_effects( player->talent.windwalker.power_of_the_thunder_king, effect_mask_t( true ).disable( 1 ) ); + parse_effects( player->buff.the_emperors_capacitor ); + parse_effects( player->buff.jade_empowerment ); - double cost_per_tick( resource_e r ) const override - { - if ( p()->specialization() == MONK_MISTWEAVER ) - return 0.0; + if ( player->specialization() == MONK_MISTWEAVER ) + base_costs_per_tick[ RESOURCE_MANA ] = 0.0; - return base_t::cost_per_tick( r ); + if ( player->talent.windwalker.power_of_the_thunder_king->ok() || player->talent.mistweaver.jade_empowerment->ok() ) + { + aoe_dot = new aoe_dot_t( player ); + add_child( aoe_dot ); + } } void execute() override @@ -3470,9 +3467,14 @@ struct crackling_jade_lightning_t : public monk_spell_t if ( t == target ) continue; - const double cleave_targets = p()->talent.windwalker.power_of_the_thunder_king->ok() - ? p()->talent.windwalker.power_of_the_thunder_king->effectN( 1 ).base_value() - : p()->buff.jade_empowerment->data().effectN( 1 ).base_value(); + if ( count >= cleave_targets ) + break; + + int cleave_targets = 0; + if ( const player_talent_t talent = p()->talent.windwalker.power_of_the_thunder_king; talent->ok() ) + cleave_targets += talent->effectN( 1 ).base_value(); + if ( const buff_t *buff = p()->buff.jade_empowerment; !buff->is_fallback ) + cleave_targets += as( buff->data().effectN( 1 ).base_value() ); if ( count < cleave_targets ) { From c159e13f524a1bf81efb5809ba57bf2b8eccd796 Mon Sep 17 00:00:00 2001 From: Kate Martin <51387586+renanthera@users.noreply.github.com> Date: Sat, 25 Jan 2025 23:10:52 -0700 Subject: [PATCH 3/4] [monk] Fix some terrible init order crimes. --- engine/class_modules/monk/sc_monk.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/engine/class_modules/monk/sc_monk.cpp b/engine/class_modules/monk/sc_monk.cpp index 3d7455ac7e9..29ca2bdb056 100644 --- a/engine/class_modules/monk/sc_monk.cpp +++ b/engine/class_modules/monk/sc_monk.cpp @@ -3461,6 +3461,12 @@ struct crackling_jade_lightning_t : public monk_spell_t const auto &tl = target_list(); int count = 0; + int cleave_targets = 0; + if ( const player_talent_t talent = p()->talent.windwalker.power_of_the_thunder_king; talent->ok() ) + cleave_targets += talent->effectN( 1 ).base_value(); + if ( const buff_t *buff = p()->buff.jade_empowerment; !buff->is_fallback ) + cleave_targets += as( buff->data().effectN( 1 ).base_value() ); + for ( auto &t : tl ) { // Don't apply AoE version to primary target @@ -3470,12 +3476,6 @@ struct crackling_jade_lightning_t : public monk_spell_t if ( count >= cleave_targets ) break; - int cleave_targets = 0; - if ( const player_talent_t talent = p()->talent.windwalker.power_of_the_thunder_king; talent->ok() ) - cleave_targets += talent->effectN( 1 ).base_value(); - if ( const buff_t *buff = p()->buff.jade_empowerment; !buff->is_fallback ) - cleave_targets += as( buff->data().effectN( 1 ).base_value() ); - if ( count < cleave_targets ) { aoe_dot->execute_on_target( t ); From 8ed4d62e665be4822228b33a29dd148cd6d1810a Mon Sep 17 00:00:00 2001 From: Kate Martin <51387586+renanthera@users.noreply.github.com> Date: Sun, 26 Jan 2025 19:05:20 -0700 Subject: [PATCH 4/4] [monk] `as(...)` both base values. --- engine/class_modules/monk/sc_monk.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/engine/class_modules/monk/sc_monk.cpp b/engine/class_modules/monk/sc_monk.cpp index 29ca2bdb056..13469661521 100644 --- a/engine/class_modules/monk/sc_monk.cpp +++ b/engine/class_modules/monk/sc_monk.cpp @@ -3463,7 +3463,7 @@ struct crackling_jade_lightning_t : public monk_spell_t int cleave_targets = 0; if ( const player_talent_t talent = p()->talent.windwalker.power_of_the_thunder_king; talent->ok() ) - cleave_targets += talent->effectN( 1 ).base_value(); + cleave_targets += as( talent->effectN( 1 ).base_value() ); if ( const buff_t *buff = p()->buff.jade_empowerment; !buff->is_fallback ) cleave_targets += as( buff->data().effectN( 1 ).base_value() );