Skip to main content

wowlab_engine_content/hooks/devastation_evoker/
config.rs

1use wowlab_engine_combat::BuffEffect;
2use wowlab_engine_domain::dbc::ResolvedGameDataEffectExt as _;
3use wowlab_types::{constants::HUNDRED};
4
5use crate::generated::specs::devastation_evoker::{
6    AURA_IRIDESCENCE_BLUE, AURA_IRIDESCENCE_RED, EFFECT, REPORTED_SPELL, TALENT,
7};
8
9static IRIDESCENCE_BLUE_REPORTED_SPELLS: [u32; 1] = [REPORTED_SPELL::ETERNITY_SURGE_DAMAGE];
10#[rustfmt::skip]
11static IRIDESCENCE_RED_REPORTED_SPELLS: [u32; 3] = [
12    REPORTED_SPELL::LIVING_FLAME_DAMAGE,
13    REPORTED_SPELL::FIRE_BREATH_DAMAGE,
14    REPORTED_SPELL::PYRE_DAMAGE,
15];
16
17crate::hooks::define_spec_config! {
18    pub(super) struct DevastationConfig {
19        causality_tick_cdr_ms: u32 { provenance: "Causality 375777 e1: empower CDR per Disintegrate tick.", gate: params.talent_picked(TALENT::CAUSALITY), source: base_points(EFFECT::CAUSALITY_DISINTEGRATE_CDR), transform: |value: f64| wowlab_types::numeric::f64_to_u32_saturating_trunc(value.abs()) },
20        scintillation_chance: f64 { provenance: "Scintillation 370821 e2: chance per Disintegrate tick.", gate: params.talent_picked(TALENT::SCINTILLATION), source: base_points(EFFECT::SCINTILLATION_CHANCE), transform: |value| value / HUNDRED },
21        scintillation_coef: f64 { provenance: "Scintillation 370821 e1 scales Eternity Surge rank-one SP coefficient.", gate: params.talent_picked(TALENT::SCINTILLATION), source: data.effect_sp_coefficient(EFFECT::ETERNITY_SURGE_DAMAGE) * base_points(EFFECT::SCINTILLATION_POWER), transform: |value| value / HUNDRED },
22        shattering_star_coef: f64 { provenance: "Shattering Stars 1265804 e1 SP coefficient.", gate: params.talent_picked(TALENT::SHATTERING_STARS), source: data.effect_sp_coefficient(EFFECT::SHATTERING_STAR), transform: |value| value },
23        titanic_wrath_mult: f64 { provenance: "Titanic Wrath 386272 e1 snapshots its Disintegrate damage multiplier when Essence Burst is consumed.", gate: params.talent_picked(TALENT::TITANIC_WRATH), source: base_points(EFFECT::TITANIC_WRATH_MULT), transform: |value| 1.0 + value / HUNDRED, fallback: 1.0 },
24        animosity_extend_ms: u32 { provenance: "Animosity 375797 e1 Dragonrage extension milliseconds.", gate: params.talent_picked(TALENT::ANIMOSITY), source: base_points(EFFECT::ANIMOSITY_EXTEND), transform: wowlab_types::numeric::f64_to_u32_saturating_trunc },
25        ruby_eb_chance: f64 { provenance: "Ruby Essence Burst 376872 e1 proc chance.", gate: params.talent_picked(TALENT::RUBY_ESSENCE_BURST), source: base_points(EFFECT::RUBY_EB_CHANCE), transform: |value| value / HUNDRED },
26        azure_eb_chance: f64 { provenance: "Azure Essence Burst 375721 e1 proc chance.", gate: params.talent_picked(TALENT::AZURE_ESSENCE_BURST), source: base_points(EFFECT::AZURE_EB_CHANCE), transform: |value| value / HUNDRED },
27        burnout_chance: f64 { provenance: "Burnout 375801 e1 proc chance.", gate: params.talent_picked(TALENT::BURNOUT), source: base_points(EFFECT::BURNOUT_CHANCE), transform: |value| value / HUNDRED },
28        eye_of_infinity: bool { provenance: "Eye of Infinity 411165 enables Essence Burst on Eternity Surge crits.", gate: params.talent_picked(TALENT::EYE_OF_INFINITY), source: true, transform: |value| value },
29        mass_disintegrate: bool { provenance: "Mass Disintegrate 436335 gate enables empower-generated stacks.", gate: params.talent_picked(TALENT::MASS_DISINTEGRATE_GATE), source: true, transform: |value| value },
30        bombardments: bool { provenance: "Bombardments gate enables application during Mass Disintegrate.", gate: params.talent_picked(TALENT::BOMBARDMENTS_GATE), source: true, transform: |value| value },
31        blast_furnace_bonus_ticks: u8 { provenance: "Blast Furnace 375510 e1 adds Fire Breath duration; the server converts its seconds to two-second ticks.", gate: params.talent_picked(TALENT::BLAST_FURNACE), source: base_points(EFFECT::BLAST_FURNACE_DURATION), transform: |value| wowlab_types::numeric::f64_to_u8_saturating_trunc(value / 2.0) },
32        melt_armor: bool { provenance: "Melt Armor requires its gate and Maneuverability.", gate: params.talent_picked(TALENT::MELT_ARMOR_GATE) && params.talent_picked(TALENT::MANEUVERABILITY_GATE), source: true, transform: |value| value },
33        imminent_destruction: bool { provenance: "Imminent Destruction 370781 triggers from Deep Breath.", gate: params.talent_picked(TALENT::IMMINENT_DESTRUCTION), source: true, transform: |value| value },
34        rising_fury: bool { provenance: "Rising Fury 1271687 stacks during Dragonrage.", gate: params.talent_picked(TALENT::RISING_FURY), source: true, transform: |value| value },
35        iridescence: bool { provenance: "Iridescence 370867 enables color damage windows.", gate: params.talent_picked(TALENT::IRIDESCENCE), source: true, transform: |value| value },
36        strafing_run: bool { provenance: "Strafing Run 1266151 enables the Deep Breath recast window.", gate: params.talent_picked(TALENT::STRAFING_RUN_GATE), source: true, transform: |value| value },
37    }
38    accessor pub(super) fn config(ctx);
39    register pub(super) fn register_devastation(built, params) -> ();
40    prepare {
41        let data = &params.game_data;
42        let base_points = |effect| data.effect_base_points(effect);
43    }
44    auras {
45        { provenance: "Iridescence blue-school damage window.", gate: params.talent_picked(TALENT::IRIDESCENCE), aura: AURA_IRIDESCENCE_BLUE, effect: BuffEffect::DamageMultSpells(1.0 + base_points(EFFECT::IRIDESCENCE_BLUE_MULT) / HUNDRED, &IRIDESCENCE_BLUE_REPORTED_SPELLS) },
46        { provenance: "Iridescence red-school damage window.", gate: params.talent_picked(TALENT::IRIDESCENCE), aura: AURA_IRIDESCENCE_RED, effect: BuffEffect::DamageMultSpells(1.0 + base_points(EFFECT::IRIDESCENCE_RED_MULT) / HUNDRED, &IRIDESCENCE_RED_REPORTED_SPELLS) },
47    }
48    finish |cfg| {
49        built.state.set_spec_config(cfg);
50    }
51}
52
53#[cfg(test)]
54#[path = "config_tests.rs"]
55mod tests;