22
22
#include "class_modules/apl/apl_death_knight.hpp"
23
23
#include "player/pet_spawner.hpp"
24
24
25
+ #include <regex>
26
+
25
27
#include "simulationcraft.hpp"
26
28
27
29
namespace
@@ -1777,6 +1779,7 @@ struct death_knight_t : public parse_player_effects_t
1777
1779
void parse_assisted_combat_step( const assisted_combat_step_data_t& step, action_priority_list_t* assisted_combat ) override;
1778
1780
std::string parse_assisted_combat_rule( const assisted_combat_rule_data_t& rule, const assisted_combat_step_data_t& step ) const override;
1779
1781
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;
1780
1783
void init_rng() override;
1781
1784
void init_base_stats() override;
1782
1785
void init_scaling() override;
@@ -1860,6 +1863,7 @@ struct death_knight_t : public parse_player_effects_t
1860
1863
double tick_damage_over_time( timespan_t duration, const dot_t* dot ) const;
1861
1864
double psuedo_random_p_from_c( double c );
1862
1865
double pseudo_random_c_from_p( double p );
1866
+ std::string blizzard_apl_action_replace( std::string options );
1863
1867
// Rider of the Apocalypse
1864
1868
int get_random_rider();
1865
1869
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
13893
13897
return player_t::parse_assisted_combat_rule( rule, step );
13894
13898
}
13895
13899
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
+
13896
13920
// death_knight_t::parse_assisted_combat_step ===============================
13897
13921
void death_knight_t::parse_assisted_combat_step( const assisted_combat_step_data_t& step,
13898
13922
action_priority_list_t* assisted_combat )
13899
13923
{
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
+ }
13906
13932
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
+ }
13909
13943
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
+ }
13911
13954
}
13912
13955
13913
13956
// 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
13931
13974
}
13932
13975
}
13933
13976
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
-
13944
13977
return player_t::action_names_from_spell_id( spell_id );
13945
13978
}
13946
13979
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
+
13947
13989
// death_knight_t::init_scaling =============================================
13948
13990
13949
13991
void death_knight_t::init_scaling()
0 commit comments