Skip to content

Commit ee52a3d

Browse files
committed
[DK] Some adjustments to blizzard assisted combat rotations
1 parent 417ade2 commit ee52a3d

File tree

1 file changed

+61
-19
lines changed

1 file changed

+61
-19
lines changed

engine/class_modules/sc_death_knight.cpp

Lines changed: 61 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@
2222
#include "class_modules/apl/apl_death_knight.hpp"
2323
#include "player/pet_spawner.hpp"
2424

25+
#include <regex>
26+
2527
#include "simulationcraft.hpp"
2628

2729
namespace
@@ -1777,6 +1779,7 @@ struct death_knight_t : public parse_player_effects_t
17771779
void parse_assisted_combat_step( const assisted_combat_step_data_t& step, action_priority_list_t* assisted_combat ) override;
17781780
std::string parse_assisted_combat_rule( const assisted_combat_rule_data_t& rule, const assisted_combat_step_data_t& step ) const override;
17791781
std::vector<std::string> action_names_from_spell_id( unsigned int spell_id ) const override;
1782+
std::string aura_expr_from_spell_id( unsigned int spell_id, bool on_self ) const override;
17801783
void init_rng() override;
17811784
void init_base_stats() override;
17821785
void init_scaling() override;
@@ -1860,6 +1863,7 @@ struct death_knight_t : public parse_player_effects_t
18601863
double tick_damage_over_time( timespan_t duration, const dot_t* dot ) const;
18611864
double psuedo_random_p_from_c( double c );
18621865
double pseudo_random_c_from_p( double p );
1866+
std::string blizzard_apl_action_replace( std::string options );
18631867
// Rider of the Apocalypse
18641868
int get_random_rider();
18651869
void summon_rider( timespan_t duration, bool random );
@@ -13893,21 +13897,60 @@ std::string death_knight_t::parse_assisted_combat_rule( const assisted_combat_ru
1389313897
return player_t::parse_assisted_combat_rule( rule, step );
1389413898
}
1389513899

13900+
// death_knight_t::blizzard_apl_action_replace ================================
13901+
std::string death_knight_t::blizzard_apl_action_replace( std::string options )
13902+
{
13903+
switch (specialization())
13904+
{
13905+
case DEATH_KNIGHT_BLOOD:
13906+
break;
13907+
case DEATH_KNIGHT_FROST:
13908+
break;
13909+
case DEATH_KNIGHT_UNHOLY:
13910+
if (options.find( "talent.clawing_shadows" ) != std::string::npos)
13911+
return "clawing_shadows";
13912+
break;
13913+
default:
13914+
break;
13915+
}
13916+
13917+
return "";
13918+
}
13919+
1389613920
// death_knight_t::parse_assisted_combat_step ===============================
1389713921
void death_knight_t::parse_assisted_combat_step( const assisted_combat_step_data_t& step,
1389813922
action_priority_list_t* assisted_combat )
1389913923
{
13900-
//if ( ( step.spell_id == talent.unholy.scourge_strike->id() ||
13901-
// step.spell_id == talent.unholy.scourge_strike->effectN( 3 ).trigger()->id() ) &&
13902-
// talent.unholy.clawing_shadows.ok() )
13903-
//{
13904-
// assisted_combat_step_data_t step_copy = step; // Make a copy to modify
13905-
// step_copy.spell_id = talent.unholy.clawing_shadows->id(); // Use Clawing Shadows spell ID
13924+
std::string options = "";
13925+
std::string rule_str;
13926+
for ( const auto& rule : assisted_combat_rule_data_t::data( step.id, is_ptr() ) )
13927+
{
13928+
std::string rule_str = parse_assisted_combat_rule( rule, step );
13929+
if ( !rule_str.empty() )
13930+
options += options.empty() ? rule_str : "&" + rule_str;
13931+
}
1390613932

13907-
// return player_t::parse_assisted_combat_step( step_copy, assisted_combat );
13908-
//}
13933+
// This is kinda ugly, maybe find a better way to do this?
13934+
if ( !options.empty() )
13935+
{
13936+
std::string name = blizzard_apl_action_replace( options );
13937+
if ( name != "" )
13938+
{
13939+
assisted_combat->add_action( name + ",if=" + options );
13940+
return;
13941+
}
13942+
}
1390913943

13910-
return player_t::parse_assisted_combat_step( step, assisted_combat );
13944+
for ( const auto& name : action_names_from_spell_id( step.spell_id ) )
13945+
{
13946+
if ( !name.empty() )
13947+
{
13948+
if ( options.empty() )
13949+
assisted_combat->add_action( name );
13950+
else
13951+
assisted_combat->add_action( name + ",if=" + options );
13952+
}
13953+
}
1391113954
}
1391213955

1391313956
// death_knight_t::action_names_from_spell_id ===============================
@@ -13931,19 +13974,18 @@ std::vector<std::string> death_knight_t::action_names_from_spell_id( unsigned in
1393113974
}
1393213975
}
1393313976

13934-
// This is incredibly ugly, and not the proper way to do this at all.
13935-
//
13936-
// TODO: Figure out why the parse_assisted_combat_step() function is not functioning right and remove
13937-
// this hack.
13938-
if ( spell_id == talent.unholy.scourge_strike->id() || spell_id == talent.unholy.clawing_shadows->id() )
13939-
{
13940-
std::vector<std::string> names = { "wound_spender" };
13941-
return names;
13942-
}
13943-
1394413977
return player_t::action_names_from_spell_id( spell_id );
1394513978
}
1394613979

13980+
std::string death_knight_t::aura_expr_from_spell_id( unsigned int spell_id, bool on_self ) const
13981+
{
13982+
std::string aura_expr = player_t::aura_expr_from_spell_id( spell_id, on_self );
13983+
if ( aura_expr == "debuff.reapers_mark" )
13984+
aura_expr.append( "_debuff" );
13985+
13986+
return aura_expr;
13987+
}
13988+
1394713989
// death_knight_t::init_scaling =============================================
1394813990

1394913991
void death_knight_t::init_scaling()

0 commit comments

Comments
 (0)