/
sc_rogue.cpp
8446 lines (6914 loc) · 275 KB
/
sc_rogue.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
// ==========================================================================
// Dedmonwakeen's DPS-DPM Simulator.
// Send questions to natehieter@gmail.com
// ==========================================================================
// TODO + BlizzardFeatures + Bugs
// Subtlety
// - Dreadlord's Deceit doesn't work on weaponmastered Shuriken Storm (Blizzard Bug ?)
// - Insignia of Ravenholdt doesn't proc from Shuriken Storm nor Shuriken Toss (Blizzard Bug ?)
// - Akaari's Soul Rip action doesn't benefits from SoD and MoS (Blizzard Bug) despite showing the increases in the tooltip.
//
// Assassination
// - Balanced Blades [artifact power] spell data claims it's not flat modifier?
// - Poisoned Knives [artifact power] does the damage doubledip in any way?
// - Does Kingsbane debuff get procced 2x on Mutilate? (If both hands apply lethal poison).
// - Insignia of Ravenholdt doesn't proc from Fan of Knives nor Poisoned Knife nor Kingsbane (Blizzard Bug ?)
#include "simulationcraft.hpp"
namespace { // UNNAMED NAMESPACE
enum
{
COMBO_POINT_MAX = 5
};
enum secondary_trigger_e
{
TRIGGER_NONE = 0U,
TRIGGER_DEATH_FROM_ABOVE,
TRIGGER_WEAPONMASTER
};
struct rogue_t;
namespace actions
{
struct rogue_attack_state_t;
struct residual_damage_state_t;
struct rogue_poison_t;
struct rogue_attack_t;
struct rogue_poison_buff_t;
struct melee_t;
struct shadow_blade_t;
}
namespace buffs
{
struct marked_for_death_debuff_t;
}
enum current_weapon_e
{
WEAPON_PRIMARY = 0u,
WEAPON_SECONDARY
};
enum weapon_slot_e
{
WEAPON_MAIN_HAND = 0u,
WEAPON_OFF_HAND
};
struct weapon_info_t
{
// State of the hand, i.e., primary or secondary weapon currently equipped
current_weapon_e current_weapon;
// Pointers to item data
const item_t* item_data[ 2 ];
// Computed weapon data
weapon_t weapon_data[ 2 ];
// Computed stats data
gear_stats_t stats_data[ 2 ];
// Callbacks, associated with special effects on each weapons
std::vector<dbc_proc_callback_t*> cb_data[ 2 ];
// Item data storage for secondary weapons
item_t secondary_weapon_data;
// Protect against multiple initialization since the init is done in an action_t object.
bool initialized;
// Track secondary weapon uptime through a buff
buff_t* secondary_weapon_uptime;
weapon_info_t() :
current_weapon( WEAPON_PRIMARY ), initialized( false ), secondary_weapon_uptime( nullptr )
{
range::fill( item_data, nullptr );
}
weapon_slot_e slot() const;
void initialize();
void reset();
// Enable/disable callbacks on the primary/secondary weapons.
void callback_state( current_weapon_e weapon, bool state );
};
// ==========================================================================
// Rogue
// ==========================================================================
struct rogue_td_t : public actor_target_data_t
{
struct dots_t
{
dot_t* deadly_poison;
dot_t* garrote;
dot_t* internal_bleeding;
dot_t* killing_spree; // Strictly speaking, this should probably be on player
dot_t* kingsbane;
dot_t* mutilated_flesh; // Assassination T19 2PC
dot_t* nightblade;
dot_t* rupture;
} dots;
struct debuffs_t
{
buff_t* hemorrhage;
buff_t* vendetta;
buff_t* wound_poison;
buff_t* crippling_poison;
buff_t* leeching_poison;
buff_t* agonizing_poison;
buffs::marked_for_death_debuff_t* marked_for_death;
buff_t* ghostly_strike;
buff_t* garrote; // Hidden proxy buff for garrote to get Thuggee working easily(ish)
buff_t* surge_of_toxins;
buff_t* kingsbane;
buff_t* blood_of_the_assassinated;
} debuffs;
rogue_td_t( player_t* target, rogue_t* source );
bool poisoned() const
{
return dots.deadly_poison -> is_ticking() ||
debuffs.wound_poison -> check() ||
debuffs.crippling_poison -> check() ||
debuffs.leeching_poison -> check() ||
debuffs.agonizing_poison -> check();
}
};
struct rogue_t : public player_t
{
// Custom options
std::vector<size_t> fixed_rtb;
// Duskwalker footpads counter
double df_counter;
// Shadow techniques swing counter;
unsigned shadow_techniques;
// Venom Rush poison tracking
unsigned poisoned_enemies;
// Active
attack_t* active_blade_flurry;
actions::rogue_poison_t* active_lethal_poison;
actions::rogue_poison_t* active_nonlethal_poison;
action_t* active_main_gauche;
action_t* weaponmaster_dot_strike;
action_t* shadow_nova;
action_t* second_shuriken;
action_t* poison_knives;
action_t* from_the_shadows_;
action_t* poison_bomb;
action_t* greed;
action_t* soul_rip; // Akaari
action_t* t19_2pc_assassination;
// Legendary
action_t* insignia_of_ravenholdt_;
// Autoattacks
action_t* auto_attack;
actions::melee_t* melee_main_hand;
actions::melee_t* melee_off_hand;
actions::shadow_blade_t* shadow_blade_main_hand;
actions::shadow_blade_t* shadow_blade_off_hand;
// Data collection
luxurious_sample_data_t* dfa_mh, *dfa_oh;
// Experimental weapon swapping
weapon_info_t weapon_data[ 2 ];
// Blurred time cooldown shenanigans
std::vector<cooldown_t*> blurred_time_cooldowns;
// Buffs
struct buffs_t
{
haste_buff_t* adrenaline_rush;
buff_t* blade_flurry;
buff_t* deadly_poison;
buff_t* death_from_above;
buff_t* feint;
buff_t* killing_spree;
buff_t* master_of_subtlety;
buff_t* master_of_subtlety_aura;
buff_t* opportunity; // TODO: Not its real name, need to see in game what it is
buff_t* shadow_dance;
buff_t* shadowstep;
buff_t* sprint;
buff_t* stealth;
buff_t* subterfuge;
buff_t* tot_trigger;
buff_t* vanish;
buff_t* wound_poison;
// Ticking buffs
buff_t* envenom;
buff_t* slice_and_dice;
// Legendary buffs
buff_t* fof_fod; // Fangs of the Destroyer
stat_buff_t* fof_p1; // Phase 1
stat_buff_t* fof_p2;
stat_buff_t* fof_p3;
// Legendary 7.0 buffs
buff_t* shivarran_symmetry;
buff_t* greenskins_waterlogged_wristcuffs;
buff_t* the_dreadlords_deceit;
buff_t* the_dreadlords_deceit_driver;
buff_t* mantle_of_the_master_assassin;
buff_t* mantle_of_the_master_assassin_aura;
buff_t* deceit;
buff_t* shadow_strikes;
buff_t* deathly_shadows;
buff_t* elaborate_planning;
haste_buff_t* alacrity;
buff_t* symbols_of_death;
buff_t* shadow_blades;
buff_t* enveloping_shadows;
buff_t* goremaws_bite;
buff_t* hidden_blade;
buff_t* curse_of_the_dreadblades;
buff_t* blurred_time;
buff_t* death;
buff_t* t19_4pc_outlaw;
buff_t* t19oh_8pc;
buff_t* blunderbuss;
buff_t* finality_eviscerate;
buff_t* finality_nightblade;
buff_t* faster_than_light_trigger;
// Roll the bones
buff_t* roll_the_bones;
buff_t* jolly_roger;
haste_buff_t* grand_melee;
buff_t* shark_infested_waters;
buff_t* true_bearing;
buff_t* broadsides;
buff_t* buried_treasure;
} buffs;
// Cooldowns
struct cooldowns_t
{
cooldown_t* adrenaline_rush;
cooldown_t* garrote;
cooldown_t* killing_spree;
cooldown_t* shadow_dance;
cooldown_t* sprint;
cooldown_t* vanish;
cooldown_t* between_the_eyes;
cooldown_t* blind;
cooldown_t* gouge;
cooldown_t* cloak_of_shadows;
cooldown_t* riposte;
cooldown_t* grappling_hook;
cooldown_t* cannonball_barrage;
cooldown_t* marked_for_death;
cooldown_t* death_from_above;
cooldown_t* weaponmaster;
cooldown_t* vendetta;
cooldown_t* shadow_nova;
} cooldowns;
// Gains
struct gains_t
{
gain_t* adrenaline_rush;
gain_t* combat_potency;
gain_t* deceit;
gain_t* energetic_recovery;
gain_t* energy_refund;
gain_t* murderous_intent;
gain_t* overkill;
gain_t* master_of_shadows;
gain_t* shadow_strikes;
gain_t* t17_2pc_assassination;
gain_t* t17_4pc_assassination;
gain_t* t17_2pc_subtlety;
gain_t* t17_4pc_subtlety;
gain_t* t18_2pc_assassination;
gain_t* venomous_wounds;
gain_t* venomous_wounds_death;
gain_t* vitality;
gain_t* energetic_stabbing;
gain_t* urge_to_kill;
gain_t* goremaws_bite;
gain_t* curse_of_the_dreadblades;
gain_t* relentless_strikes;
gain_t* shadow_satyrs_walk;
// CP Gains
gain_t* empowered_fan_of_knives;
gain_t* seal_fate;
gain_t* legendary_daggers;
gain_t* quick_draw;
gain_t* broadsides;
gain_t* ruthlessness;
gain_t* shadow_techniques;
gain_t* shadow_blades;
gain_t* enveloping_shadows;
gain_t* t19_4pc_subtlety;
} gains;
// Spec passives
struct spec_t
{
// Shared
const spell_data_t* shadowstep;
// Generic
const spell_data_t* assassination_rogue;
const spell_data_t* outlaw_rogue;
const spell_data_t* subtlety_rogue;
// Assassination
const spell_data_t* assassins_resolve;
const spell_data_t* improved_poisons;
const spell_data_t* seal_fate;
const spell_data_t* venomous_wounds;
const spell_data_t* vendetta;
const spell_data_t* garrote;
const spell_data_t* garrote_2;
// Outlaw
const spell_data_t* blade_flurry;
const spell_data_t* combat_potency;
const spell_data_t* roll_the_bones;
const spell_data_t* ruthlessness;
const spell_data_t* saber_slash;
const spell_data_t* vitality;
// Subtlety
const spell_data_t* deepening_shadows;
const spell_data_t* energetic_recovery; // TODO: Not used?
const spell_data_t* relentless_strikes;
const spell_data_t* shadow_blades;
const spell_data_t* shadow_dance;
const spell_data_t* shadow_techniques;
const spell_data_t* symbols_of_death;
const spell_data_t* eviscerate;
const spell_data_t* eviscerate_2;
const spell_data_t* shadowstrike;
const spell_data_t* shadowstrike_2;
} spec;
// Spell Data
struct spells_t
{
const spell_data_t* bag_of_tricks_driver;
const spell_data_t* critical_strikes;
const spell_data_t* death_from_above;
const spell_data_t* fan_of_knives;
const spell_data_t* fleet_footed;
const spell_data_t* master_of_shadows;
const spell_data_t* sprint;
const spell_data_t* relentless_strikes_energize;
const spell_data_t* ruthlessness_cp_driver;
const spell_data_t* ruthlessness_driver;
const spell_data_t* ruthlessness_cp;
const spell_data_t* shadow_focus;
const spell_data_t* subterfuge;
const spell_data_t* tier18_2pc_combat_ar;
const spell_data_t* insignia_of_ravenholdt;
} spell;
// Talents
struct talents_t
{
// Shared - Level 45
const spell_data_t* deeper_stratagem;
const spell_data_t* anticipation;
const spell_data_t* vigor;
// Shared - Level 90
const spell_data_t* alacrity;
// Shared - Level 100
const spell_data_t* marked_for_death;
const spell_data_t* death_from_above;
// Assassination/Subtlety - Level 30
const spell_data_t* nightstalker;
const spell_data_t* subterfuge;
const spell_data_t* shadow_focus;
// Assassination - Level 15
const spell_data_t* master_poisoner;
const spell_data_t* elaborate_planning;
const spell_data_t* hemorrhage;
// Assassination - Level 60
const spell_data_t* thuggee;
const spell_data_t* internal_bleeding;
// Assassination - Level 90
const spell_data_t* agonizing_poison;
const spell_data_t* exsanguinate;
// Assassination - Level 100
const spell_data_t* venom_rush;
// Outlaw - Level 15
const spell_data_t* ghostly_strike;
const spell_data_t* swordmaster;
const spell_data_t* quick_draw;
// Outlaw - Level 30 (NYI)
const spell_data_t* hit_and_run;
// Outlaw - Level 75 (Partially Implemented for Gouge)
const spell_data_t* dirty_tricks;
// Outlaw - Level 90
const spell_data_t* cannonball_barrage;
const spell_data_t* killing_spree;
// Outlaw - Level 100
const spell_data_t* slice_and_dice;
// Subtlety - Level 15
const spell_data_t* master_of_subtlety;
const spell_data_t* weaponmaster;
const spell_data_t* gloomblade;
// Subtlety - Level 90
const spell_data_t* premeditation;
const spell_data_t* enveloping_shadows;
// Subtlety - Level 100
const spell_data_t* master_of_shadows;
} talent;
// Masteries
struct masteries_t
{
const spell_data_t* executioner;
const spell_data_t* main_gauche;
const spell_data_t* potent_poisons;
} mastery;
// Artifact powers
struct artifact_t
{
// Subtlety
artifact_power_t goremaws_bite;
artifact_power_t shadow_fangs;
artifact_power_t the_quiet_knife;
artifact_power_t demons_kiss;
artifact_power_t gutripper;
artifact_power_t precision_strike;
artifact_power_t fortunes_bite;
artifact_power_t soul_shadows;
artifact_power_t energetic_stabbing;
artifact_power_t catwalk;
artifact_power_t second_shuriken;
artifact_power_t akaaris_soul;
artifact_power_t shadow_nova;
artifact_power_t finality;
artifact_power_t legionblade;
// Assassination
artifact_power_t kingsbane;
artifact_power_t assassins_blades;
artifact_power_t toxic_blades;
artifact_power_t urge_to_kill;
artifact_power_t shadow_walker;
artifact_power_t bag_of_tricks;
artifact_power_t master_alchemist;
artifact_power_t master_assassin;
artifact_power_t gushing_wound;
artifact_power_t blood_of_the_assassinated;
artifact_power_t balanced_blades;
artifact_power_t poison_knives;
artifact_power_t surge_of_toxins;
artifact_power_t serrated_edge;
artifact_power_t from_the_shadows;
artifact_power_t slayers_precision;
// Swashbuckler
artifact_power_t curse_of_the_dreadblades;
artifact_power_t cursed_edges;
artifact_power_t black_powder;
artifact_power_t fortune_strikes;
artifact_power_t gunslinger;
artifact_power_t blunderbuss;
artifact_power_t fatebringer;
artifact_power_t blade_dancer;
artifact_power_t blurred_time;
artifact_power_t greed;
artifact_power_t hidden_blade;
artifact_power_t fortunes_boon;
artifact_power_t fates_thirst;
artifact_power_t fortunes_strike;
artifact_power_t cursed_steel;
} artifact;
// Procs
struct procs_t
{
proc_t* deepening_shadows;
proc_t* seal_fate;
proc_t* t18_2pc_combat;
proc_t* weaponmaster;
proc_t* roll_the_bones_1;
proc_t* roll_the_bones_2;
proc_t* roll_the_bones_3;
proc_t* roll_the_bones_6;
} procs;
struct prng_t
{
real_ppm_t* bag_of_tricks;
} prng;
struct legendary_t
{
const spell_data_t* duskwalker_footpads;
const spell_data_t* denial_of_the_halfgiants;
const spell_data_t* zoldyck_family_training_shackles;
const spell_data_t* the_dreadlords_deceit;
const spell_data_t* insignia_of_ravenholdt;
const spell_data_t* mantle_of_the_master_assassin;
} legendary;
// Options
uint32_t fof_p1, fof_p2, fof_p3;
int initial_combo_points;
int ssw_refund_offset;
rogue_t( sim_t* sim, const std::string& name, race_e r = RACE_NIGHT_ELF ) :
player_t( sim, ROGUE, name, r ),
df_counter( 0 ),
shadow_techniques( 0 ),
poisoned_enemies( 0 ),
active_blade_flurry( nullptr ),
active_lethal_poison( nullptr ),
active_nonlethal_poison( nullptr ),
active_main_gauche( nullptr ),
weaponmaster_dot_strike( nullptr ),
shadow_nova( nullptr ),
second_shuriken( nullptr ),
poison_knives( nullptr ),
from_the_shadows_( nullptr ),
poison_bomb( nullptr ),
greed( nullptr ),
soul_rip( nullptr ),
insignia_of_ravenholdt_( nullptr ),
auto_attack( nullptr ), melee_main_hand( nullptr ), melee_off_hand( nullptr ),
shadow_blade_main_hand( nullptr ), shadow_blade_off_hand( nullptr ),
dfa_mh( nullptr ), dfa_oh( nullptr ),
buffs( buffs_t() ),
cooldowns( cooldowns_t() ),
gains( gains_t() ),
spec( spec_t() ),
spell( spells_t() ),
talent( talents_t() ),
mastery( masteries_t() ),
procs( procs_t() ),
prng( prng_t() ),
legendary( legendary_t() ),
fof_p1( 0 ), fof_p2( 0 ), fof_p3( 0 ),
initial_combo_points( 0 ),
ssw_refund_offset(0)
{
// Cooldowns
cooldowns.adrenaline_rush = get_cooldown( "adrenaline_rush" );
cooldowns.garrote = get_cooldown( "garrote" );
cooldowns.killing_spree = get_cooldown( "killing_spree" );
cooldowns.shadow_dance = get_cooldown( "shadow_dance" );
cooldowns.sprint = get_cooldown( "sprint" );
cooldowns.vanish = get_cooldown( "vanish" );
cooldowns.between_the_eyes = get_cooldown( "between_the_eyes" );
cooldowns.blind = get_cooldown( "blind" );
cooldowns.gouge = get_cooldown( "gouge" );
cooldowns.cannonball_barrage = get_cooldown( "cannon_ball_barrage" );
cooldowns.cloak_of_shadows = get_cooldown( "cloak_of_shadows" );
cooldowns.death_from_above = get_cooldown( "death_from_above" );
cooldowns.grappling_hook = get_cooldown( "grappling_hook" );
cooldowns.marked_for_death = get_cooldown( "marked_for_death" );
cooldowns.riposte = get_cooldown( "riposte" );
cooldowns.weaponmaster = get_cooldown( "weaponmaster" );
cooldowns.vendetta = get_cooldown( "vendetta" );
cooldowns.shadow_nova = get_cooldown( "shadow_nova" );
regen_type = REGEN_DYNAMIC;
regen_caches[CACHE_HASTE] = true;
regen_caches[CACHE_ATTACK_HASTE] = true;
}
// Character Definition
void init_spells() override;
void init_base_stats() override;
void init_gains() override;
void init_procs() override;
void init_scaling() override;
void init_resources( bool force ) override;
bool init_items() override;
bool init_special_effects() override;
void init_rng() override;
bool init_finished() override;
void create_buffs() override;
void create_options() override;
void copy_from( player_t* source ) override;
std::string create_profile( save_e stype ) override;
void init_action_list() override;
void reset() override;
void arise() override;
void combat_begin() override;
void regen( timespan_t periodicity ) override;
timespan_t available() const override;
action_t* create_action( const std::string& name, const std::string& options ) override;
expr_t* create_expression( action_t* a, const std::string& name_str ) override;
resource_e primary_resource() const override { return RESOURCE_ENERGY; }
role_e primary_role() const override { return ROLE_ATTACK; }
stat_e convert_hybrid_stat( stat_e s ) const override;
double composite_melee_speed() const override;
double composite_melee_haste() const override;
double composite_melee_crit_chance() const override;
double composite_spell_crit_chance() const override;
double composite_spell_haste() const override;
double matching_gear_multiplier( attribute_e attr ) const override;
double composite_attack_power_multiplier() const override;
double composite_player_multiplier( school_e school ) const override;
double composite_player_target_multiplier( player_t* target, school_e school ) const override;
double energy_regen_per_second() const override;
double passive_movement_modifier() const override;
double temporary_movement_modifier() const override;
bool poisoned_enemy( player_t* target, bool deadly_fade = false ) const;
void trigger_auto_attack( const action_state_t* );
void trigger_seal_fate( const action_state_t* );
void trigger_main_gauche( const action_state_t*, double = 0 );
void trigger_combat_potency( const action_state_t* );
void trigger_energy_refund( const action_state_t* );
void trigger_venomous_wounds( const action_state_t* );
void trigger_blade_flurry( const action_state_t* );
void trigger_ruthlessness_cp( const action_state_t* );
void trigger_combo_point_gain( int, gain_t* gain = nullptr, action_t* action = nullptr );
void spend_combo_points( const action_state_t* );
bool trigger_t17_4pc_combat( const action_state_t* );
void trigger_t19oh_8pc( const action_state_t* );
void trigger_elaborate_planning( const action_state_t* );
void trigger_alacrity( const action_state_t* );
void trigger_deepening_shadows( const action_state_t* );
void trigger_shadow_techniques( const action_state_t* );
void trigger_weaponmaster( const action_state_t* );
void trigger_energetic_stabbing( const action_state_t* );
void trigger_second_shuriken( const action_state_t* );
void trigger_surge_of_toxins( const action_state_t* );
void trigger_poison_knives( const action_state_t* );
void trigger_true_bearing( const action_state_t* );
void trigger_exsanguinate( const action_state_t* );
void trigger_relentless_strikes( const action_state_t* );
void trigger_insignia_of_ravenholdt( action_state_t* );
void trigger_shadow_nova( const action_state_t* );
// Computes the composite Agonizing Poison stack multiplier for Assassination Rogue
double agonizing_poison_stack_multiplier( const rogue_td_t* ) const;
// On-death trigger for Venomous Wounds energy replenish
void trigger_venomous_wounds_death( player_t* );
double consume_cp_max() const
{ return COMBO_POINT_MAX + as<double>( talent.deeper_stratagem -> effectN( 1 ).base_value() ); }
target_specific_t<rogue_td_t> target_data;
virtual rogue_td_t* get_target_data( player_t* target ) const override
{
rogue_td_t*& td = target_data[ target ];
if ( ! td )
{
td = new rogue_td_t( target, const_cast<rogue_t*>(this) );
}
return td;
}
static actions::rogue_attack_t* cast_attack( action_t* action )
{ return debug_cast<actions::rogue_attack_t*>( action ); }
static const actions::rogue_attack_t* cast_attack( const action_t* action )
{ return debug_cast<const actions::rogue_attack_t*>( action ); }
void swap_weapon( weapon_slot_e slot, current_weapon_e to_weapon, bool in_combat = true );
};
namespace actions { // namespace actions
// ==========================================================================
// Static Functions
// ==========================================================================
// break_stealth ============================================================
static void break_stealth( rogue_t* p )
{
if ( p -> buffs.stealth -> check() )
p -> buffs.stealth -> expire();
if ( p -> buffs.vanish -> check() )
p -> buffs.vanish -> expire();
}
// ==========================================================================
// Rogue Attack
// ==========================================================================
struct rogue_attack_state_t : public action_state_t
{
int cp;
bool exsanguinated;
rogue_attack_state_t( action_t* action, player_t* target ) :
action_state_t( action, target ), cp( 0 ), exsanguinated( false )
{ }
void initialize() override
{ action_state_t::initialize(); cp = 0; exsanguinated = false; }
std::ostringstream& debug_str( std::ostringstream& s ) override
{
action_state_t::debug_str( s ) << " cp=" << cp << " exsanguinated=" << exsanguinated;
return s;
}
void copy_state( const action_state_t* o ) override
{
action_state_t::copy_state( o );
const rogue_attack_state_t* st = debug_cast<const rogue_attack_state_t*>( o );
cp = st -> cp;
exsanguinated = st -> exsanguinated;
}
};
struct rogue_attack_t : public melee_attack_t
{
bool requires_stealth;
position_e requires_position;
weapon_e requires_weapon;
// Secondary triggered ability, due to Weaponmaster talent or Death from Above. Secondary
// triggered abilities cost no resources or incur cooldowns.
secondary_trigger_e secondary_trigger;
// Akaari's Soul stats object. Created for every "opener" (requires_stealth = true) that does
// damage. Swapped into the action when Akaari's Soul secondary trigger event executes.
stats_t* akaari;
// Affect flags for various dynamic effects
struct
{
bool blurred_time;
bool shadow_blades;
bool ruthlessness;
bool relentless_strikes;
bool deepening_shadows;
bool weaponmaster;
bool ghostly_strike;
bool vendetta;
bool agonizing_poison;
bool alacrity;
bool adrenaline_rush_gcd;
} affected_by;
rogue_attack_t( const std::string& token, rogue_t* p,
const spell_data_t* s = spell_data_t::nil(),
const std::string& options = std::string() ):
melee_attack_t( token, p, s ),
requires_stealth( false ), requires_position( POSITION_NONE ),
requires_weapon( WEAPON_NONE ), secondary_trigger( TRIGGER_NONE ),
akaari( nullptr )
{
parse_options( options );
may_crit = true;
may_glance = false;
special = true;
tick_may_crit = true;
hasted_ticks = false;
memset( &affected_by, 0, sizeof( affected_by ) );
for ( size_t i = 1; i <= s -> effect_count(); i++ )
{
const spelleffect_data_t& effect = s -> effectN( i );
switch ( effect.type() )
{
case E_ADD_COMBO_POINTS:
if ( energize_type != ENERGIZE_NONE )
{
energize_type = ENERGIZE_ON_HIT;
energize_amount = effect.base_value();
energize_resource = RESOURCE_COMBO_POINT;
}
break;
default:
break;
}
if ( effect.type() == E_APPLY_AURA && effect.subtype() == A_PERIODIC_DAMAGE )
{
base_ta_adder = effect.bonus( player );
}
else if ( effect.type() == E_SCHOOL_DAMAGE )
{
base_dd_adder = effect.bonus( player );
}
}
// FIXME: Apply "spec aura"
// The Assassination is special since some spells are flagged 2 times.
if ( data().affected_by( p -> spec.assassination_rogue -> effectN( 1 ) ) &&
! data().affected_by( p -> spec.assassination_rogue -> effectN( 2 ) ) )
{
base_multiplier *= 1.0 + p -> spec.assassination_rogue -> effectN( 1 ).percent();
}
if ( data().affected_by( p -> spec.assassination_rogue -> effectN( 2 ) ) )
{
base_multiplier *= 1.0 + p -> spec.assassination_rogue -> effectN( 2 ).percent();
}
if ( data().affected_by( p -> spec.outlaw_rogue -> effectN( 1 ) ) )
{
base_multiplier *= 1.0 + p -> spec.outlaw_rogue -> effectN( 1 ).percent();
}
if ( data().affected_by( p -> spec.subtlety_rogue -> effectN( 1 ) ) )
{
base_multiplier *= 1.0 + p -> spec.subtlety_rogue -> effectN( 1 ).percent();
}
if ( data().affected_by( p -> spec.subtlety_rogue -> effectN( 2 ) ) )
{
base_multiplier *= 1.0 + p -> spec.subtlety_rogue -> effectN( 2 ).percent();
}
}
void init() override
{
melee_attack_t::init();
// If the ability is a finisher, just disable weapon damage by default
if ( base_costs[ RESOURCE_COMBO_POINT ] > 0 )
{
weapon_multiplier = 0;
weapon_power_mod = 0;
}
// Figure out the affected flags
affected_by.blurred_time = p() -> artifact.blurred_time.rank() && ! background &&
cooldown -> duration > timespan_t::zero();
affected_by.shadow_blades = data().affected_by( p() -> spec.shadow_blades -> effectN( 2 ) ) ||
data().affected_by( p() -> spec.shadow_blades -> effectN( 3 ) ) ||
data().affected_by( p() -> spec.shadow_blades -> effectN( 4 ) );
affected_by.ruthlessness = base_costs[ RESOURCE_COMBO_POINT ] > 0;
affected_by.relentless_strikes = base_costs[ RESOURCE_COMBO_POINT ] > 0;
affected_by.deepening_shadows = base_costs[ RESOURCE_COMBO_POINT ] > 0;
affected_by.ghostly_strike = data().affected_by( p() -> talent.ghostly_strike -> effectN( 5 ) );
affected_by.vendetta = data().affected_by( p() -> spec.vendetta -> effectN( 1 ) );
affected_by.weaponmaster = p() -> talent.weaponmaster -> ok() && harmful && special &&
( weapon_multiplier > 0 || attack_power_mod.direct > 0 );
affected_by.agonizing_poison = p() -> talent.agonizing_poison -> ok();
affected_by.alacrity = base_costs[ RESOURCE_COMBO_POINT ] > 0;
affected_by.adrenaline_rush_gcd = data().affected_by( p() -> buffs.adrenaline_rush -> data().effectN( 3 ) );
}
bool init_finished() override
{
if ( p() -> artifact.akaaris_soul.rank() && harmful && requires_stealth && ! background &&
( weapon_multiplier > 0 || attack_power_mod.direct > 0 ) )
{
akaari = player -> get_stats( name_str + "_akaari", this );
akaari -> school = school;
stats -> add_child( akaari );
}
if ( affected_by.blurred_time )
{
p() -> blurred_time_cooldowns.push_back( cooldown );
}
return melee_attack_t::init_finished();
}
void snapshot_state( action_state_t* state, dmg_e rt ) override
{
melee_attack_t::snapshot_state( state, rt );
if ( base_costs[ RESOURCE_COMBO_POINT ] > 0 )
{
double max_cp = std::min( player -> resources.current[ RESOURCE_COMBO_POINT ], p() -> consume_cp_max() );
cast_state( state ) -> cp = static_cast<int>( max_cp );
}
}
void update_ready( timespan_t cd_duration = timespan_t::min() ) override
{
if ( secondary_trigger != TRIGGER_NONE )
{
cd_duration = timespan_t::zero();
}
melee_attack_t::update_ready( cd_duration );
}
timespan_t gcd() const override
{
timespan_t t = melee_attack_t::gcd();
if ( affected_by.adrenaline_rush_gcd &&
t != timespan_t::zero() && p() -> buffs.adrenaline_rush -> check() )
{
t += p() -> buffs.adrenaline_rush -> data().effectN( 3 ).time_value();
}
return t;
}
bool stealthed()
{
return p() -> buffs.vanish -> check() || p() -> buffs.stealth -> check() || player -> buffs.shadowmeld -> check();
}
// Helper function for expressions. Returns the number of guaranteed generated combo points for
// this ability, taking into account any potential buffs.
virtual double generate_cp() const
{
double cp = 0;
if ( energize_type != ENERGIZE_NONE && energize_resource == RESOURCE_COMBO_POINT )
{
cp += energize_amount;
}
if ( cp > 0 )
{
if ( p() -> buffs.broadsides -> check() )
{
cp += 1;
}
if ( affected_by.shadow_blades && p() -> buffs.shadow_blades -> check() )
{
cp += 1;
}
}
return cp;
}
virtual bool procs_poison() const
{ return weapon != nullptr; }
// Generic rules for proccing Main Gauche, used by rogue_t::trigger_main_gauche()
virtual bool procs_main_gauche() const
{ return callbacks && ! proc && weapon != nullptr && weapon -> slot == SLOT_MAIN_HAND; }
// Generic rules for proccing Combat Potency, used by rogue_t::trigger_combat_potency()
virtual bool procs_combat_potency() const
{ return callbacks && ! proc && weapon != nullptr && weapon -> slot == SLOT_OFF_HAND; }
// Generic rules for proccing Insignia of Ravenholdt, used by
// rogue_t::trigger_insignia_of_ravenholdt()
virtual bool procs_insignia_of_ravenholdt() const
{ return energize_type != ENERGIZE_NONE && energize_resource == RESOURCE_COMBO_POINT; }
virtual double proc_chance_main_gauche() const
{ return p() -> cache.mastery_value(); }
action_state_t* new_state() override
{ return new rogue_attack_state_t( this, target ); }
static const rogue_attack_state_t* cast_state( const action_state_t* st )
{ return debug_cast< const rogue_attack_state_t* >( st ); }