-
Notifications
You must be signed in to change notification settings - Fork 762
Expand file tree
/
Copy pathsc_mage.cpp
More file actions
7514 lines (6252 loc) · 256 KB
/
sc_mage.cpp
File metadata and controls
7514 lines (6252 loc) · 256 KB
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
// ==========================================================================
#include "simulationcraft.hpp"
#include "util/util.hpp"
#include "class_modules/apl/mage.hpp"
#include "report/charts.hpp"
#include "report/highchart.hpp"
namespace {
// ==========================================================================
// Mage
// ==========================================================================
// Forward declarations
struct mage_t;
// Finds an action with the given name. If no action exists, a new one will
// be created.
//
// Use this with secondary background actions to ensure the player only has
// one copy of the action.
template <typename Action, typename Actor, typename... Args>
action_t* get_action( std::string_view name, Actor* actor, Args&&... args )
{
action_t* a = actor->find_action( name );
if ( !a )
a = new Action( name, actor, std::forward<Args>( args )... );
assert( dynamic_cast<Action*>( a ) && a->name_str == name && a->background );
return a;
}
// Returns the remaining damage in an Ignite DoT.
// TODO: When an Ignite has a partial tick, how is the bank amount calculated to determine valid spread targets?
double ignite_bank( dot_t* ignite )
{
if ( !ignite->is_ticking() )
return 0.0;
auto ignite_state = debug_cast<residual_action::residual_periodic_state_t*>( ignite->state );
return ignite_state->tick_amount * ignite->ticks_left_fractional();
}
enum ground_aoe_type_e
{
AOE_BLIZZARD = 0,
AOE_COMET_STORM,
AOE_FROZEN_ORB,
AOE_METEOR_BURN,
AOE_MAX
};
enum target_trigger_type_e
{
TT_NONE,
TT_MAIN_TARGET,
TT_ALL_TARGETS
};
enum trigger_override_e
{
TO_DEFAULT,
TO_ALWAYS,
TO_NEVER
};
enum hot_streak_trigger_type_e
{
HS_HIT,
HS_CRIT,
HS_CUSTOM
};
enum class ao_type
{
NORMAL,
ORB_BARRAGE,
ORB_MASTERY
};
enum class meteor_type
{
NORMAL,
ISOTHERMIC
};
enum class arcane_phoenix_rotation
{
DEFAULT,
ST,
AOE
};
struct buff_adjust_info_t
{
buff_t* buff;
bool expire;
int stacks;
};
struct mage_td_t final : public actor_target_data_t
{
struct debuffs_t
{
buff_t* controlled_destruction;
buff_t* freezing;
buff_t* freezing_winds;
buff_t* molten_fury;
buff_t* touch_of_the_archmage;
buff_t* touch_of_the_magi;
} debuffs;
mage_td_t( player_t* target, mage_t* mage );
};
// Generalization of buff benefit tracking (up(), value(), etc).
// Keeps a track of the benefit for each stack separately.
struct buff_stack_benefit_t
{
const buff_t* buff;
std::vector<benefit_t*> buff_stack_benefit;
buff_stack_benefit_t( const buff_t* _buff, std::string_view prefix ) :
buff( _buff ),
buff_stack_benefit()
{
for ( int i = 0; i <= buff->max_stack(); i++ )
{
auto benefit_name = fmt::format( "{} {} {}", prefix, buff->data().name_cstr(), i );
buff_stack_benefit.push_back( buff->player->get_benefit( benefit_name ) );
}
}
void update()
{
auto stack = as<unsigned>( buff->check() );
for ( unsigned i = 0; i < buff_stack_benefit.size(); i++ )
buff_stack_benefit[ i ]->update( i == stack );
}
};
struct shatter_source_t : private noncopyable
{
const std::string name_str;
const int max_stack;
std::vector<simple_sample_data_t> counts;
std::vector<int> iteration_counts;
shatter_source_t( std::string_view name, int max_stack_ ) :
name_str( name ),
max_stack( max_stack_ ),
counts(),
iteration_counts()
{
assert( max_stack >= 0 );
counts.resize( max_stack + 1 );
iteration_counts.resize( max_stack + 1 );
}
void occur( int stack )
{
assert( stack >= 0 && stack <= max_stack );
iteration_counts[ stack ]++;
}
double count( int stack ) const
{
assert( stack >= 0 && stack <= max_stack );
return counts[ stack ].pretty_mean();
}
double count_total() const
{
double res = 0.0;
for ( const auto& c : counts )
res += c.pretty_mean();
return res;
}
bool active() const
{
return count_total() > 0.0;
}
void merge( const shatter_source_t& other )
{
assert( max_stack == other.max_stack );
for ( size_t i = 0; i < counts.size(); i++ )
counts[ i ].merge( other.counts[ i ] );
}
void datacollection_begin()
{
range::fill( iteration_counts, 0 );
}
void datacollection_end()
{
for ( size_t i = 0; i < counts.size(); i++ )
counts[ i ].add( as<double>( iteration_counts[ i ] ) );
}
};
struct mage_t final : public player_t
{
public:
// Buffs waiting to be triggered/expired
std::vector<buff_adjust_info_t> buff_queue;
// Events
struct events_t
{
event_t* icicle;
event_t* merged_buff_execute;
event_t* meteor_burn;
} events;
// Ground AoE tracking
std::array<timespan_t, AOE_MAX> ground_aoe_expiration;
// Data collection
auto_dispose<std::vector<shatter_source_t*> > shatter_source_list;
// Cached actions
struct actions_t
{
action_t* arcane_assault;
action_t* arcane_echo;
action_t* burnout;
action_t* cinderstorm;
action_t* flash_freezeburn;
action_t* frostfire_empowerment;
action_t* glacial_assault;
action_t* hand_of_frost;
action_t* ignite;
action_t* isothermic_comet_storm;
action_t* isothermic_meteor;
action_t* meteorite;
action_t* molten_chill_ignite;
action_t* pet_freeze;
action_t* pet_water_jet;
action_t* splinter;
action_t* touch_of_the_archmage;
action_t* touch_of_the_magi_explosion;
action_t* winters_end;
struct shatter_actions_t
{
action_t* comet_storm;
action_t* glacial_spike;
action_t* ice_lance;
action_t* meteor;
} shatter;
} action;
// Benefits
struct benefits_t
{
struct arcane_charge_benefits_t
{
std::unique_ptr<buff_stack_benefit_t> arcane_barrage;
std::unique_ptr<buff_stack_benefit_t> arcane_blast;
std::unique_ptr<buff_stack_benefit_t> arcane_pulse;
} arcane_charge;
} benefits;
// Buffs
struct buffs_t
{
// Arcane
buff_t* arcane_charge;
buff_t* arcane_familiar;
buff_t* arcane_salvo;
buff_t* arcane_surge;
buff_t* clearcasting;
buff_t* enlightened;
buff_t* evocation;
buff_t* intuition;
buff_t* overpowered_missiles;
buff_t* presence_of_mind;
// Fire
buff_t* combustion;
buff_t* feel_the_burn;
buff_t* fevered_incantation;
buff_t* fiery_rush;
buff_t* fired_up;
buff_t* heat_shimmer;
buff_t* heating_up;
buff_t* hot_streak;
buff_t* pyroclasm;
// Frost
buff_t* brain_freeze;
buff_t* comet_storm;
buff_t* fingers_of_frost;
buff_t* freezing_rain;
buff_t* glacial_spike;
buff_t* hand_of_frost;
buff_t* permafrost_lances;
buff_t* thermal_void;
// Frostfire
buff_t* frostfire_empowerment;
// Spellslinger
buff_t* splinterstorm;
// Sunfury
buff_t* arcane_soul;
buff_t* glorious_incandescence;
buff_t* hyperthermia;
buff_t* hyperthermia_damage;
buff_t* lesser_time_warp;
buff_t* mana_cascade;
buff_t* spellfire_sphere;
// Shared
buff_t* brainstorm;
buff_t* overflowing_energy;
} buffs;
// Cooldowns
struct cooldowns_t
{
cooldown_t* arcane_echo;
cooldown_t* arcane_orb;
cooldown_t* augury_abounds;
cooldown_t* combustion;
cooldown_t* cone_of_cold;
cooldown_t* dragons_breath;
cooldown_t* fire_blast;
cooldown_t* flurry;
cooldown_t* from_the_ashes;
cooldown_t* frost_nova;
cooldown_t* frozen_orb;
cooldown_t* meteor;
cooldown_t* presence_of_mind;
cooldown_t* pyromaniac;
cooldown_t* ray_of_frost;
} cooldowns;
// Gains
struct gains_t
{
gain_t* arcane_surge;
gain_t* arcane_barrage;
gain_t* energized_familiar;
} gains;
// Options
struct options_t
{
timespan_t scorch_delay = 15_ms;
timespan_t arcane_missiles_chain_delay = 200_ms;
double arcane_missiles_chain_relstddev = 0.1;
timespan_t arcane_missiles_delay = 100_ms;
unsigned initial_spellfire_spheres = 5;
unsigned initial_icicles = 5;
arcane_phoenix_rotation arcane_phoenix_rotation_override = arcane_phoenix_rotation::DEFAULT;
unsigned clearcasting_blp_threshold = 0;
unsigned sphere_blp_threshold = 11;
unsigned augury_blp_threshold = 21;
unsigned infused_blp_threshold = 10;
bool il_requires_freezing = false;
bool il_sort_by_freezing = true;
bool randomize_si_target = false;
} options;
// Pets
struct pets_t
{
pet_t* water_elemental = nullptr;
std::vector<pet_t*> mirror_images;
pet_t* arcane_phoenix = nullptr;
} pets;
// Procs
struct procs_t
{
proc_t* salvo_applied;
proc_t* salvo_overflow;
proc_t* heating_up_generated; // Crits without HU/HS
proc_t* heating_up_removed; // Non-crits with HU >200ms after application
proc_t* heating_up_ib_converted; // IBs used on HU
proc_t* hot_streak; // Total HS generated
proc_t* hot_streak_spell; // HU/HS spell impacts
proc_t* hot_streak_spell_crit; // HU/HS spell crits
proc_t* hot_streak_spell_crit_wasted; // HU/HS spell crits with HS
proc_t* ignite_applied; // Direct ignite applications
proc_t* ignite_new_spread; // Spread to new target
proc_t* ignite_overwrite; // Spread to target with existing ignite
proc_t* brain_freeze;
proc_t* fingers_of_frost;
proc_t* freezing_applied;
proc_t* freezing_expired;
proc_t* freezing_overflow;
} procs;
struct accumulated_rngs_t
{
accumulated_rng_t* pyromaniac;
accumulated_rng_t* clearcasting;
accumulated_rng_t* spellfire_spheres;
accumulated_rng_t* augury_abounds;
accumulated_rng_t* infused_splinters;
} accumulated_rng;
// Sample data
struct sample_data_t
{
std::unique_ptr<simple_sample_data_t> low_mana_iteration;
} sample_data;
// Specializations
struct specializations_t
{
// Arcane
const spell_data_t* arcane_charge;
const spell_data_t* arcane_mage;
const spell_data_t* clearcasting;
const spell_data_t* savant;
// Fire
const spell_data_t* fire_mage;
const spell_data_t* hot_streak;
const spell_data_t* ignite;
const spell_data_t* pyroblast_clearcasting_driver;
// Frost
const spell_data_t* frost_mage;
const spell_data_t* freeze_and_shatter;
const spell_data_t* shatter;
const spell_data_t* winters_end;
} spec;
// State
struct state_t
{
bool brain_freeze_active;
bool fingers_of_frost_active;
bool had_low_mana;
bool trigger_ff_empowerment;
bool trigger_overpowered_missiles;
bool gained_initial_clearcasting; // Used to prevent queueing Arcane Missiles immediately after gaining the first stack Clearclasting.
timespan_t last_random_clearcasting; // Brainstorm cannot be triggered twice if a singular spell/action triggers Clearcasting twice.
bool eureka;
bool thermal_void_active;
int glorious_incandescence_snapshot;
int icicles;
int fired_up_count; // number of Fired Up procs in this Combustion
} state;
// Talents
struct talents_list_t
{
// Mage
// Row 1
player_talent_t blazing_barrier;
player_talent_t ice_barrier;
player_talent_t prismatic_barrier;
// Row 2
player_talent_t alter_time;
player_talent_t ice_block;
// Row 3
player_talent_t temporal_realignment;
player_talent_t time_walk;
player_talent_t master_of_time;
player_talent_t winters_protection;
player_talent_t frost_conditioning;
// Row 4
player_talent_t arcane_warding;
player_talent_t inspired_intellect;
player_talent_t mirror_image;
// Row 5
player_talent_t spellsteal;
player_talent_t quick_witted;
player_talent_t dragons_breath;
player_talent_t supernova;
player_talent_t remove_curse;
player_talent_t improved_conjuration;
// Row 6
player_talent_t improved_spellsteal;
player_talent_t improved_blink;
player_talent_t shimmer;
player_talent_t improved_counterspell;
player_talent_t overflowing_energy;
player_talent_t improved_remove_curse;
player_talent_t greater_invisibility;
// Row 7
player_talent_t ice_ward;
player_talent_t improved_frost_nova;
player_talent_t captured_thoughts;
player_talent_t tome_of_rhonin;
player_talent_t tome_of_antonidas;
player_talent_t incantation_of_swiftness;
player_talent_t master_of_escape;
// Row 8
player_talent_t charm_of_aegwynn;
player_talent_t brainstorm;
player_talent_t flow_of_time;
player_talent_t mana_confluence;
player_talent_t charm_of_medivh;
// Row 9
player_talent_t permafrost_bauble;
player_talent_t freezing_cold;
player_talent_t ice_nova;
player_talent_t time_manipulation;
player_talent_t mass_polymorph;
player_talent_t ring_of_frost;
player_talent_t energized_barriers;
player_talent_t mass_invisibility;
player_talent_t barrier_diffusion;
// Row 10
player_talent_t ice_cold;
player_talent_t reflection;
player_talent_t spatial_manipulation;
player_talent_t improved_blazing_barrier;
player_talent_t improved_ice_barrier;
player_talent_t improved_prismatic_barrier;
// Arcane
// Row 1
player_talent_t arcane_missiles;
// Row 2
player_talent_t concentrated_power;
player_talent_t arcane_salvo;
// Row 3
player_talent_t amplification;
player_talent_t improved_clearcasting;
player_talent_t arcing_cleave;
// Row 4
player_talent_t arcane_pulse;
player_talent_t arcane_surge;
player_talent_t arcane_orb;
// Row 5
player_talent_t reverberate;
player_talent_t presence_of_mind;
player_talent_t slipstream;
player_talent_t mana_bomb;
player_talent_t arcane_familiar;
player_talent_t charged_orb;
// Row 6
player_talent_t intuition;
player_talent_t touch_of_the_magi;
player_talent_t energized_familiar;
player_talent_t expanded_mind;
// Row 7
player_talent_t consortiums_bauble;
player_talent_t arcane_tempo;
player_talent_t aether_attunement;
player_talent_t aegwynns_technique;
player_talent_t arcane_echo;
player_talent_t resonance;
player_talent_t impetus;
// Row 8
player_talent_t touch_of_the_archmage_1;
player_talent_t evocation;
player_talent_t mana_adept;
player_talent_t enlightened;
player_talent_t focusing_crystal;
player_talent_t illuminated_thoughts;
// Row 9
player_talent_t touch_of_the_archmage_2;
player_talent_t prodigious_savant;
player_talent_t eureka;
player_talent_t arcane_singularity;
// Row 10
player_talent_t touch_of_the_archmage_3;
player_talent_t charged_missiles;
player_talent_t high_voltage;
player_talent_t overflowing_insight;
player_talent_t overpowered_missiles;
player_talent_t orb_mastery;
player_talent_t orb_barrage;
// Fire
// Row 1
player_talent_t pyroblast;
// Row 2
player_talent_t fire_blast;
player_talent_t firestarter;
player_talent_t flamestrike_1;
player_talent_t flamestrike_2;
// Row 3
player_talent_t ignition;
player_talent_t combustion;
player_talent_t fuel_the_fire;
// Row 4
player_talent_t fervent_flickering;
player_talent_t cauterize;
player_talent_t meteor;
// Row 5
player_talent_t scorch;
player_talent_t flame_on;
player_talent_t kindling;
player_talent_t critical_mass;
player_talent_t deep_impact;
// Row 6
player_talent_t heat_shimmer;
player_talent_t scald;
player_talent_t controlled_destruction;
player_talent_t mote_of_flame;
player_talent_t blast_zone;
// Row 7
player_talent_t conflagration;
player_talent_t intensifying_flame;
player_talent_t spontaneous_combustion;
player_talent_t molten_fury;
player_talent_t inflame;
// Row 8
player_talent_t fired_up_1;
player_talent_t wildfire;
player_talent_t fevered_incantation;
player_talent_t fires_ire;
// Row 9
player_talent_t fired_up_2;
player_talent_t master_of_flame;
player_talent_t from_the_ashes;
player_talent_t fiery_rush;
player_talent_t flame_accelerant;
player_talent_t pyromaniac;
// Row 10
player_talent_t fired_up_3;
player_talent_t burnout;
player_talent_t feel_the_burn;
player_talent_t burn_it_all;
player_talent_t slow_burn;
player_talent_t pyroclasm;
player_talent_t cinderstorm;
// Frost
// Row 1
player_talent_t ice_lance;
// Row 2
player_talent_t blizzard_1;
player_talent_t blizzard_2;
player_talent_t fingers_of_frost;
// Row 3
player_talent_t frostbite;
player_talent_t icicles;
// Row 4
player_talent_t flurry;
player_talent_t cold_snap;
player_talent_t glacial_bulwark;
player_talent_t frozen_orb;
// Row 5
player_talent_t brain_freeze;
player_talent_t piercing_cold;
player_talent_t ray_of_frost;
player_talent_t everlasting_frost;
player_talent_t permafrost_lances;
// Row 6
player_talent_t frozen_touch;
player_talent_t splitting_ice;
player_talent_t flash_freeze;
player_talent_t frigid_focus;
player_talent_t splintering_ray;
player_talent_t winters_blessing;
player_talent_t freezing_rain;
player_talent_t cone_of_frost;
// Row 7
player_talent_t fractured_frost;
player_talent_t improved_shatter;
player_talent_t deep_shatter;
player_talent_t white_out;
player_talent_t wintertide;
// Row 8
player_talent_t hand_of_frost_1;
player_talent_t glacial_attunement;
player_talent_t heart_of_ice;
player_talent_t rimecaster;
// Row 9
player_talent_t hand_of_frost_2;
player_talent_t freezing_winds;
player_talent_t improved_flurry;
player_talent_t glacial_assault;
player_talent_t crystalline_refraction;
player_talent_t lonely_winter;
player_talent_t summon_water_elemental;
player_talent_t glacial_chill;
player_talent_t glacial_shatter;
player_talent_t hailstones;
// Row 10
player_talent_t hand_of_frost_3;
player_talent_t thermal_void;
player_talent_t glaciate;
player_talent_t comet_storm;
// Frostfire
// Row 1
player_talent_t frostfire_bolt;
// Row 2
player_talent_t imbued_warding;
player_talent_t meltdown;
player_talent_t frostfire_empowerment;
player_talent_t elemental_affinity;
player_talent_t flame_and_frost;
player_talent_t duality;
// Row 3
player_talent_t heat_sink;
player_talent_t severe_temperatures;
player_talent_t thermal_conditioning;
player_talent_t dualcasting_adept;
player_talent_t molten_chill;
// Row 4
player_talent_t frostfire_infusion;
player_talent_t flash_freezeburn;
player_talent_t blast_radius;
player_talent_t elemental_conduit;
// Row 5
player_talent_t isothermic_core;
// Spellslinger
// Row 1
player_talent_t splintering_sorcery;
// Row 2
player_talent_t augury_abounds;
player_talent_t force_of_will;
player_talent_t splintering_orbs;
player_talent_t attuned_familiar;
player_talent_t shifting_shards;
// Row 3
player_talent_t look_again;
player_talent_t slippery_slinging;
player_talent_t controlled_instincts;
player_talent_t phantasmal_image;
player_talent_t reactive_barrier;
player_talent_t infused_splinters;
// Row 4
player_talent_t archmages_wrath;
player_talent_t signature_spell;
player_talent_t spellfrost_teachings;
player_talent_t polished_focus;
// Row 5
player_talent_t splinterstorm;
// Sunfury
// Row 1
player_talent_t spellfire_spheres;
// Row 2
player_talent_t mana_cascade;
player_talent_t invocation_arcane_phoenix;
player_talent_t burden_of_power;
player_talent_t glorious_incandescence;
// Row 3
player_talent_t merely_a_setback;
player_talent_t time_twist;
player_talent_t codex_of_the_sunstriders;
player_talent_t explosive_potential;
player_talent_t lessons_in_debilitation;
player_talent_t pyrocosm;
// Row 4
player_talent_t savor_the_moment;
player_talent_t sunfury_execution;
player_talent_t ashes_of_inspiration;
player_talent_t rondurmancy;
player_talent_t spellfire_salvo;
// Row 5
player_talent_t memory_of_alar;
} talents;
mage_t( sim_t* sim, std::string_view name, race_e r = RACE_NONE );
// Character Definition
void init_spells() override;
void init_base_stats() override;
void create_buffs() override;
void create_options() override;
void init_action_list() override;
parsed_assisted_combat_rule_t parse_assisted_combat_rule( const assisted_combat_rule_data_t& rule, const assisted_combat_step_data_t& step ) const override;
void parse_assisted_combat_step( const assisted_combat_step_data_t& step, action_priority_list_t* assisted_combat ) override;
std::vector<std::string> action_names_from_spell_id( unsigned int spell_id ) const override;
std::string default_potion() const override { return mage_apl::potion( this ); }
std::string default_flask() const override { return mage_apl::flask( this ); }
std::string default_food() const override { return mage_apl::food( this ); }
std::string default_rune() const override { return mage_apl::rune( this ); }
std::string default_temporary_enchant() const override { return mage_apl::temporary_enchant( this ); }
void init_gains() override;
void init_procs() override;
void init_benefits() override;
void init_uptimes() override;
void init_rng() override;
void init_finished() override;
void invalidate_cache( cache_e ) override;
void init_resources( bool ) override;
void recalculate_resource_max( resource_e, gain_t* = nullptr ) override;
void reset() override;
std::unique_ptr<expr_t> create_expression( std::string_view ) override;
std::unique_ptr<expr_t> create_action_expression( action_t&, std::string_view ) override;
action_t* create_action( std::string_view, std::string_view ) override;
void create_actions() override;
void create_pets() override;
resource_e primary_resource() const override { return RESOURCE_MANA; }
role_e primary_role() const override { return ROLE_SPELL; }
stat_e convert_hybrid_stat( stat_e ) const override;
double resource_regen_per_second( resource_e ) const override;
double composite_player_critical_damage_multiplier( const action_state_t*, school_e school ) const override;
double composite_player_multiplier( school_e ) const override;
double composite_player_target_multiplier( player_t*, school_e ) const override;
double composite_spell_crit_chance() const override;
double composite_attribute_multiplier( attribute_e ) const override;
void arise() override;
void combat_begin() override;
void copy_from( player_t* ) override;
void merge( player_t& ) override;
void analyze( sim_t& ) override;
void datacollection_begin() override;
void datacollection_end() override;
void regen( timespan_t ) override;
void moving() override;
target_specific_t<mage_td_t> target_data;
const mage_td_t* find_target_data( const player_t* target ) const override
{
return target_data[ target ];
}
mage_td_t* get_target_data( player_t* target ) const override
{
mage_td_t*& td = target_data[ target ];
if ( !td )
td = new mage_td_t( target, const_cast<mage_t*>( this ) );
return td;
}
shatter_source_t* get_shatter_source( std::string_view name, int max_stack )
{
for ( auto ss : shatter_source_list )
{
if ( ss->name_str == name )
return ss;
}
auto ss = new shatter_source_t( name, max_stack );
shatter_source_list.push_back( ss );
return ss;
}
void trigger_arcane_charge( int stacks = 1 );
bool trigger_brain_freeze( double chance, proc_t* source, timespan_t delay = 0_ms );
bool trigger_crowd_control( const action_state_t* s, spell_mechanic type );
bool trigger_clearcasting( double chance = 1.0, bool allow_predict = true, bool has_double_proc_delay = false );
bool trigger_fof( double chance, proc_t* source, int stacks = 1 );
void trigger_mana_cascade();
void trigger_fired_up();
void trigger_cinderstorm( player_t* target );
void trigger_merged_buff( buff_t* buff, bool trigger );
void trigger_meteor_burn( action_t* action, player_t* target, timespan_t pulse_time, timespan_t duration );
void trigger_spellfire_sphere( specialization_e m_spec, bool background = false );
void trigger_splinter( player_t* target, int count = -1 );
void trigger_freezing( player_t* target, int stacks, proc_t* source, double chance = 1.0 );
int trigger_shatter( player_t* target, action_t* action, int max_consumption, shatter_source_t* source, bool fof = false );
void trigger_icicle( int count = 1, bool grant_buff = true );
void trigger_arcane_salvo( proc_t* source, int stacks = 1, double chance = 1.0, bool predictable = true );
};
namespace pets {
struct mage_pet_t : public pet_t
{
mage_pet_t( sim_t* sim, mage_t* owner, std::string_view pet_name, bool guardian = false, bool dynamic = false ) :
pet_t( sim, owner, pet_name, guardian, dynamic )
{
resource_regeneration = regen_type::DISABLED;
}
const mage_t* o() const
{ return static_cast<mage_t*>( owner ); }
mage_t* o()
{ return static_cast<mage_t*>( owner ); }
};
struct mage_pet_spell_t : public spell_t
{
mage_pet_spell_t( std::string_view n, mage_pet_t* p, const spell_data_t* s ) :
spell_t( n, p, s )
{
weapon_multiplier = 0.0;
gcd_type = gcd_haste_type::NONE;
}
mage_t* o()
{ return static_cast<mage_pet_t*>( player )->o(); }
const mage_t* o() const
{ return static_cast<mage_pet_t*>( player )->o(); }
};
namespace water_elemental {
// ==========================================================================
// Pet Water Elemental
// ==========================================================================
struct water_elemental_pet_t final : public mage_pet_t
{
water_elemental_pet_t( sim_t* sim, mage_t* owner ) :
mage_pet_t( sim, owner, "water_elemental" )
{
owner_coeff.sp_from_sp = 0.75;
}
void init_action_list() override
{
action_list_str = "water_jet/waterbolt";
mage_pet_t::init_action_list();
}
action_t* create_action( std::string_view, std::string_view ) override;
void create_actions() override;
};
struct waterbolt_t final : public mage_pet_spell_t
{
waterbolt_t( std::string_view n, water_elemental_pet_t* p, std::string_view options_str ) :
mage_pet_spell_t( n, p, p->find_pet_spell( "Waterbolt" ) )
{
parse_options( options_str );
}
void execute() override
{
mage_pet_spell_t::execute();
if ( rng().roll( o()->talents.attuned_familiar->effectN( 2 ).percent() ) )
o()->trigger_splinter( target );
}
};
struct freeze_t final : public mage_pet_spell_t
{