-
Notifications
You must be signed in to change notification settings - Fork 705
/
sc_priest_holy.cpp
562 lines (498 loc) · 17.5 KB
/
sc_priest_holy.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
// ==========================================================================
// Holy Priest Sim File
// Contact: https://github.com/orgs/simulationcraft/teams/priest/members
// Wiki: https://github.com/simulationcraft/simc/wiki/Priests
// ==========================================================================
#include "sc_priest.hpp"
#include "simulationcraft.hpp"
namespace priestspace
{
namespace actions::spells
{
struct holy_word_sanctify_t final : public priest_heal_t
{
holy_word_sanctify_t( priest_t& p, util::string_view options_str )
: priest_heal_t( "holy_word_sanctify", p, p.talents.holy.holy_word_sanctify )
{
parse_options( options_str );
harmful = false;
}
double cost() const override
{
if ( priest().buffs.apotheosis->check() || priest().buffs.answered_prayers->check() )
{
return 0;
}
return priest_heal_t::cost();
}
void execute() override
{
priest_heal_t::execute();
if ( priest().talents.holy.divine_image.enabled() )
{
priest().buffs.divine_image->trigger();
priest().procs.divine_image->occur();
}
}
};
struct holy_word_serenity_t final : public priest_heal_t
{
holy_word_serenity_t( priest_t& p, util::string_view options_str )
: priest_heal_t( "holy_word_serenity", p, p.talents.holy.holy_word_serenity )
{
parse_options( options_str );
harmful = false;
}
double cost() const override
{
if ( priest().buffs.apotheosis->check() || priest().buffs.answered_prayers->check() )
{
return 0;
}
return priest_heal_t::cost();
}
void execute() override
{
priest_heal_t::execute();
if ( priest().talents.holy.divine_image.enabled() )
{
priest().buffs.divine_image->trigger();
priest().procs.divine_image->occur();
}
}
};
struct apotheosis_t final : public priest_spell_t
{
apotheosis_t( priest_t& p, util::string_view options_str )
: priest_spell_t( "apotheosis", p, p.talents.holy.apotheosis )
{
parse_options( options_str );
harmful = false;
}
void execute() override
{
priest_spell_t::execute();
priest().buffs.apotheosis->trigger();
priest().cooldowns.holy_word_chastise->reset( false );
priest().cooldowns.holy_word_serenity->reset( false, 1 );
priest().cooldowns.holy_word_sanctify->reset( false, 1 );
}
};
struct divine_word_t final : public priest_spell_t
{
divine_word_t( priest_t& p, util::string_view options_str )
: priest_spell_t( "divine_word", p, p.talents.holy.divine_word )
{
parse_options( options_str );
harmful = false;
}
void execute() override
{
priest_spell_t::execute();
priest().buffs.divine_word->trigger();
}
};
// holy word cast -> Divine Image [Talent] (392988) -> Divine Image [Buff] (405963) -> Divine Image [Summon] (392990) ->
// Searing Light (196811) procs from Holy Fire, Chastise, Shadow Word: Pain, Shadow Word: Death, and Smite
struct searing_light_t final : public priest_spell_t
{
searing_light_t( priest_t& p ) : priest_spell_t( "searing_light", p, p.talents.holy.divine_image_searing_light )
{
background = true;
may_miss = false;
}
};
// holy word cast -> Divine Image [Talent] (392988) -> Divine Image [Buff] (405963) -> Divine Image [Summon] (392990) ->
// Light Eruption (196811) procs from Holy Nova casts
struct light_eruption_t final : public priest_spell_t
{
light_eruption_t( priest_t& p ) : priest_spell_t( "light_eruption", p, p.talents.holy.divine_image_light_eruption )
{
background = true;
may_miss = false;
aoe = -1;
radius = 8; // Base in spell data is incorrect (100yd)
}
};
struct empyreal_blaze_t final : public priest_spell_t
{
empyreal_blaze_t( priest_t& p, util::string_view options_str )
: priest_spell_t( "empyreal_blaze", p, p.talents.holy.empyreal_blaze )
{
parse_options( options_str );
harmful = false;
}
void execute() override
{
priest_spell_t::execute();
priest().buffs.empyreal_blaze->trigger();
}
};
struct burning_vehemence_t final : public priest_spell_t
{
burning_vehemence_t( priest_t& p ) : priest_spell_t( "burning_vehemence", p, p.talents.holy.burning_vehemence_damage )
{
background = true;
may_crit = false;
may_miss = false;
aoe = -1;
full_amount_targets = as<int>( priest().talents.holy.burning_vehemence_damage->effectN( 2 ).base_value() );
reduced_aoe_targets = priest().talents.holy.burning_vehemence_damage->effectN( 2 ).base_value();
base_multiplier = priest().talents.holy.burning_vehemence->effectN( 3 ).percent();
}
size_t available_targets( std::vector<player_t*>& tl ) const override
{
priest_spell_t::available_targets( tl );
// Remove the main target, this only hits everything else in range.
range::erase_remove( tl, target );
return tl.size();
}
void trigger( double initial_hit_damage )
{
double bv_damage = initial_hit_damage * base_multiplier;
sim->print_debug(
"burning_vehemence splash damage calculating: initial holy_fire hit: {}, multiplier: {}, result: {}",
initial_hit_damage, base_multiplier, bv_damage );
base_dd_min = base_dd_max = bv_damage;
execute();
}
};
struct holy_fire_t final : public priest_spell_t
{
timespan_t manipulation_cdr;
propagate_const<burning_vehemence_t*> child_burning_vehemence;
action_t* child_searing_light;
bool casted;
holy_fire_t( priest_t& p, util::string_view options_str, bool _casted = true )
: priest_spell_t( "holy_fire", p, p.specs.holy_fire ),
manipulation_cdr( timespan_t::from_seconds( priest().talents.manipulation->effectN( 1 ).base_value() / 2 ) ),
child_burning_vehemence( nullptr ),
child_searing_light( priest().background_actions.searing_light )
{
casted = _casted;
if ( !casted )
{
base_dd_max = 0.0;
base_dd_min = 0.0;
spell_power_mod.direct = 0;
}
if ( p.talents.holy.empyreal_blaze.enabled() )
{
dot_behavior = DOT_EXTEND;
}
if ( priest().talents.holy.burning_vehemence.enabled() && casted )
{
child_burning_vehemence = new burning_vehemence_t( priest() );
add_child( child_burning_vehemence );
}
apply_affecting_aura( p.talents.holy.burning_vehemence );
parse_options( options_str );
}
double cost() const override
{
if ( priest().buffs.empyreal_blaze->check() | !casted )
{
return 0;
}
return priest_spell_t::cost();
}
timespan_t execute_time() const override
{
if ( priest().buffs.empyreal_blaze->check() )
{
return 0_ms;
}
return priest_spell_t::execute_time();
}
void execute() override
{
priest_spell_t::execute();
if ( priest().talents.holy.empyreal_blaze.enabled() && priest().buffs.empyreal_blaze->check() )
{
priest().cooldowns.holy_fire->reset( false );
priest().buffs.empyreal_blaze->trigger();
}
if ( priest().talents.manipulation.enabled() )
{
priest().cooldowns.mindgames->adjust( -manipulation_cdr );
}
}
void impact( action_state_t* s ) override
{
priest_spell_t::impact( s );
if ( result_is_hit( s->result ) )
{
if ( priest().talents.holy.holy_word_chastise.enabled() && priest().talents.holy.harmonious_apparatus.enabled() )
{
timespan_t chastise_cdr =
timespan_t::from_seconds( priest().talents.holy.harmonious_apparatus->effectN( 1 ).base_value() );
if ( priest().talents.holy.apotheosis.enabled() && priest().buffs.apotheosis->up() )
{
chastise_cdr *= ( 1 + priest().talents.holy.apotheosis->effectN( 1 ).percent() );
}
if ( priest().talents.holy.light_of_the_naaru.enabled() )
{
chastise_cdr *= ( 1 + priest().talents.holy.light_of_the_naaru->effectN( 1 ).percent() );
}
sim->print_debug( "{} adjusted cooldown of Chastise, by {}, with harmonious_apparatus: {}, apotheosis: {}",
priest(), chastise_cdr, priest().talents.holy.harmonious_apparatus.enabled(),
( priest().buffs.apotheosis->up() || priest().buffs.answered_prayers->check() ) );
priest().cooldowns.holy_word_chastise->adjust( -chastise_cdr );
}
if ( child_searing_light && priest().buffs.divine_image->up() )
{
for ( int i = 1; i <= priest().buffs.divine_image->stack(); i++ )
{
child_searing_light->execute();
}
}
}
if ( child_burning_vehemence )
{
child_burning_vehemence->trigger( s->result_amount );
}
}
};
struct holy_word_chastise_t final : public priest_spell_t
{
action_t* child_searing_light;
holy_word_chastise_t( priest_t& p, util::string_view options_str )
: priest_spell_t( "holy_word_chastise", p, p.talents.holy.holy_word_chastise ),
child_searing_light( priest().background_actions.searing_light )
{
parse_options( options_str );
}
double cost() const override
{
if ( priest().buffs.apotheosis->check() || priest().buffs.answered_prayers->check() )
{
return 0;
}
return priest_spell_t::cost();
}
double composite_da_multiplier( const action_state_t* s ) const override
{
double d = priest_spell_t::composite_da_multiplier( s );
if ( priest().buffs.divine_word->check() )
{
d *= 1.0 + priest().talents.holy.divine_word->effectN( 1 ).percent();
sim->print_debug( "divine_favor increasing holy_word_chastise damage by {}, total: {}",
priest().talents.holy.divine_word->effectN( 1 ).percent(), d );
}
return d;
}
void execute() override
{
priest_spell_t::execute();
if ( priest().talents.holy.divine_word.enabled() && priest().buffs.divine_word->check() )
{
priest().buffs.divine_word->expire();
priest().buffs.divine_favor_chastise->trigger();
}
if ( priest().talents.holy.divine_image.enabled() )
{
priest().buffs.divine_image->trigger();
priest().procs.divine_image->occur();
// Activating cast also immediately executes searing light
for ( int i = 1; i <= priest().buffs.divine_image->stack(); i++ )
{
child_searing_light->execute();
}
}
}
void impact( action_state_t* s ) override
{
priest_spell_t::impact( s );
sim->print_debug( "divine_image_buff: {}", priest().buffs.divine_image->up() );
if ( child_searing_light && priest().buffs.divine_image->up() )
{
for ( int i = 1; i <= priest().buffs.divine_image->stack(); i++ )
{
child_searing_light->execute();
}
}
}
};
} // namespace actions::spells
namespace buffs
{
symbol_of_hope_t::symbol_of_hope_t( player_t* p )
: buff_t( p, "symbol_of_hope", p->find_spell( 64901 ) ), affected_actions_initialized( false )
{
set_cooldown( 0_ms );
s_data_reporting = data().effectN( 1 ).trigger();
set_stack_change_callback( [ this ]( buff_t* /* b */, int /* old */, int new_ ) {
if ( !affected_actions_initialized )
{
affected_actions.clear();
for ( auto a : player->action_list )
{
for ( const spelleffect_data_t& effect : data().effectN( 1 ).trigger()->effects() )
{
if ( a->data().affected_by_label( effect ) || a->data().affected_by_category( effect ) )
{
auto affected_action = range::find_if(
affected_actions,
[ a ]( std::pair<action_t*, double> affected_action ) { return a == affected_action.first; } );
if ( affected_action == affected_actions.end() )
{
affected_actions.emplace_back( a, effect.default_value() );
}
}
}
}
affected_actions_initialized = true;
}
update_cooldowns( new_ );
} );
}
void symbol_of_hope_t::update_cooldowns( int new_ )
{
assert( affected_actions_initialized );
for ( auto a : affected_actions )
{
double recharge_rate_multiplier = 1.0 / ( 1 + a.second );
if ( new_ > 0 )
{
a.first->dynamic_recharge_rate_multiplier *= recharge_rate_multiplier;
}
else
{
a.first->dynamic_recharge_rate_multiplier /= recharge_rate_multiplier;
}
if ( a.first->cooldown->action == a.first )
a.first->cooldown->adjust_recharge_multiplier();
if ( a.first->internal_cooldown->action == a.first )
a.first->internal_cooldown->adjust_recharge_multiplier();
}
}
} // namespace buffs
void priest_t::create_buffs_holy()
{
buffs.apotheosis = make_buff( this, "apotheosis", talents.holy.apotheosis );
buffs.answered_prayers =
make_buff( this, "answered_prayers", talents.holy.apotheosis )
->set_cooldown( timespan_t::from_seconds( talents.holy.answered_prayers->effectN( 2 ).base_value() ) )
->set_duration( timespan_t::from_seconds( talents.holy.answered_prayers->effectN( 2 ).base_value() ) );
buffs.answered_prayers_timer =
make_buff( this, "answered_prayers_timer", talents.holy.answered_prayers )
->set_quiet( true )
// Option default: Prayer of mending bounces onces every 1.5 seconds
// duration = Required # of bounces * bounce rate
->set_duration( timespan_t::from_seconds( talents.holy.answered_prayers->effectN( 1 ).base_value() *
options.prayer_of_mending_bounce_rate ) )
->set_stack_change_callback( ( [ this ]( buff_t*, int, int new_ ) {
if ( new_ == 0 )
{
buffs.answered_prayers->trigger();
buffs.answered_prayers_timer->trigger();
}
} ) );
buffs.empyreal_blaze = make_buff( this, "empyreal_blaze", talents.holy.empyreal_blaze->effectN( 2 ).trigger() )
->set_trigger_spell( talents.holy.empyreal_blaze )
->set_reverse( true )
->set_stack_change_callback( [ this ]( buff_t*, int, int new_ ) {
if ( new_ > 0 )
{
cooldowns.holy_fire->reset( false );
}
} );
buffs.divine_word = make_buff( this, "divine_word", talents.holy.divine_word );
buffs.divine_favor_chastise = make_buff( this, "divine_favor_chastise", talents.holy.divine_favor_chastise );
buffs.divine_image = make_buff( this, "divine_image", talents.holy.divine_image_buff )
->set_refresh_behavior( buff_refresh_behavior::DURATION )
->set_stack_behavior( buff_stack_behavior::ASYNCHRONOUS );
}
void priest_t::init_rng_holy()
{
}
void priest_t::init_spells_holy()
{
auto ST = [ this ]( std::string_view n ) { return find_talent_spell( talent_tree::SPECIALIZATION, n ); };
// Row 1
talents.holy.holy_word_serenity = ST( "Holy Word: Serenity" );
// Row 2
talents.holy.holy_word_chastise = ST( "Holy Word: Chastise" );
// Row 3
talents.holy.empyreal_blaze = ST( "Empyreal Blaze" );
talents.holy.holy_word_sanctify = ST( "Holy Word: Sanctify" );
// Row 4
talents.holy.searing_light = ST( "Searing Light" );
// Row 8
talents.holy.apotheosis = ST( "Apotheosis" );
// Row 9
talents.holy.burning_vehemence = ST( "Burning Vehemence" );
talents.holy.burning_vehemence_damage = find_spell( 400370 );
talents.holy.harmonious_apparatus = ST( "harmonious Apparatus" );
talents.holy.light_of_the_naaru = ST( "Light of the Naaru" );
talents.holy.answered_prayers = ST( "Answered Prayers" );
// Row 10
talents.holy.divine_word = ST( "Divine Word" );
talents.holy.divine_favor_chastise = find_spell( 372761 );
talents.holy.divine_image = ST( "Divine Image" );
talents.holy.divine_image_buff = find_spell( 405963 );
talents.holy.divine_image_summon = find_spell( 392990 );
talents.holy.divine_image_searing_light = find_spell( 196811 );
talents.holy.divine_image_light_eruption = find_spell( 196812 );
talents.holy.miracle_worker = ST( "Miracle Worker" );
// General Spells
specs.holy_fire = find_specialization_spell( "Holy Fire" );
}
action_t* priest_t::create_action_holy( util::string_view name, util::string_view options_str )
{
using namespace actions::spells;
if ( name == "holy_fire" )
{
return new holy_fire_t( *this, options_str );
}
if ( name == "apotheosis" )
{
return new apotheosis_t( *this, options_str );
}
if ( name == "holy_word_chastise" )
{
return new holy_word_chastise_t( *this, options_str );
}
if ( name == "holy_word_serenity" )
{
return new holy_word_serenity_t( *this, options_str );
}
if ( name == "holy_word_sanctify" )
{
return new holy_word_sanctify_t( *this, options_str );
}
if ( name == "empyreal_blaze" )
{
return new empyreal_blaze_t( *this, options_str );
}
if ( name == "divine_word" )
{
return new divine_word_t( *this, options_str );
}
if ( name == "searing_light" )
{
return new searing_light_t( *this );
}
if ( name == "light_eruption" )
{
return new light_eruption_t( *this );
}
return nullptr;
}
void priest_t::init_background_actions_holy()
{
if ( talents.holy.divine_word.enabled() )
{
background_actions.holy_fire = new actions::spells::holy_fire_t( *this, "", false );
}
if ( talents.holy.divine_image.enabled() )
{
background_actions.searing_light = new actions::spells::searing_light_t( *this );
background_actions.light_eruption = new actions::spells::light_eruption_t( *this );
}
}
expr_t* priest_t::create_expression_holy( action_t*, util::string_view /*name_str*/ )
{
return nullptr;
}
} // namespace priestspace