Skip to main content

wowlab_engine_content/hooks/frost_death_knight/
targeting.rs

1use wowlab_engine_domain::{
2    dbc::{
3        ImplicitTargetCheck, ImplicitTargetDirection, ImplicitTargetObject,
4        ImplicitTargetReference, ImplicitTargetSelection,
5    },
6    targeting::{
7        TargetEffectCoordinate, TargetGeometryOverlay, TargetOverlayMetadata, TargetPlanOperation,
8        TargetPlanOperations, TargetPlanOverlay, TargetSelector,
9    },
10};
11
12use crate::generated::specs::frost_death_knight::{EFFECT, REPORTED_SPELL};
13
14const fn forward_line() -> TargetPlanOperations {
15    TargetPlanOperations::one(TargetPlanOperation::Select(TargetSelector::custom(
16        ImplicitTargetObject::Unit,
17        ImplicitTargetReference::Caster,
18        ImplicitTargetSelection::Line,
19        ImplicitTargetCheck::Enemy,
20        ImplicitTargetDirection::Front,
21    )))
22}
23
24const fn forward_cone() -> TargetPlanOperations {
25    TargetPlanOperations::one(TargetPlanOperation::Select(TargetSelector::custom(
26        ImplicitTargetObject::Unit,
27        ImplicitTargetReference::Caster,
28        ImplicitTargetSelection::Cone,
29        ImplicitTargetCheck::Enemy,
30        ImplicitTargetDirection::Front,
31    )))
32}
33
34inventory::submit! {
35    TargetPlanOverlay::new(
36        TargetEffectCoordinate {
37            spell_id: EFFECT::ICY_DEATH_TORRENT_DAMAGE.0,
38            effect_index: EFFECT::ICY_DEATH_TORRENT_DAMAGE.1,
39        },
40        TargetOverlayMetadata {
41            name: "Icy Death Torrent frontal cone",
42            reason: "the channel-target and cone selectors are two axes of one caster-facing cone, not two independent selections",
43        },
44        forward_cone(),
45    )
46}
47
48inventory::submit! {
49    TargetPlanOverlay::new(
50        TargetEffectCoordinate {
51            spell_id: EFFECT::GLACIAL_ADVANCE_DAMAGE.0,
52            effect_index: EFFECT::GLACIAL_ADVANCE_DAMAGE.1,
53        },
54        TargetOverlayMetadata {
55            name: "Glacial Advance spike corridor",
56            reason: "the ground-area selector omits the forward area-trigger path",
57        },
58        forward_line(),
59    )
60}
61
62inventory::submit! {
63    TargetGeometryOverlay::new(
64        TargetEffectCoordinate {
65            spell_id: EFFECT::GLACIAL_ADVANCE_DAMAGE.0,
66            effect_index: EFFECT::GLACIAL_ADVANCE_DAMAGE.1,
67        },
68        TargetOverlayMetadata {
69            name: "Glacial Advance corridor dimensions",
70            reason: "the payload supplies a 3-yard radius and 100-yard forward path",
71        },
72    )
73        .dimensions(100.0, 3.0)
74        .facing_explicit_target()
75}
76
77inventory::submit! {
78    TargetPlanOverlay::new(
79        TargetEffectCoordinate {
80            spell_id: EFFECT::FROSTWYRMS_FURY_DAMAGE.0,
81            effect_index: EFFECT::FROSTWYRMS_FURY_DAMAGE.1,
82        },
83        TargetOverlayMetadata {
84            name: "Frostwyrm breath corridor",
85            reason: "the payload is explicit-targeted while its driver owns a forward area trigger",
86        },
87        forward_line(),
88    )
89}
90
91inventory::submit! {
92    TargetGeometryOverlay::new(
93        TargetEffectCoordinate {
94            spell_id: EFFECT::FROSTWYRMS_FURY_DAMAGE.0,
95            effect_index: EFFECT::FROSTWYRMS_FURY_DAMAGE.1,
96        },
97        TargetOverlayMetadata {
98            name: "Frostwyrm breath dimensions",
99            reason: "the forward AreaTrigger driver supplies the payload's 40-yard breath path",
100        },
101    )
102        .dimensions(40.0, 5.0)
103        .facing_explicit_target()
104}
105
106inventory::submit! {
107    TargetPlanOverlay::new(
108        TargetEffectCoordinate {
109            spell_id: REPORTED_SPELL::CHOSEN_OF_FROSTBROOD_RECALL,
110            effect_index: 1,
111        },
112        TargetOverlayMetadata {
113            name: "Frostwyrm recall breath corridor",
114            reason: "the CreateAreaTrigger destination omits the breath corridor's actor selection",
115        },
116        forward_line(),
117    )
118}
119
120inventory::submit! {
121    TargetGeometryOverlay::new(
122        TargetEffectCoordinate {
123            spell_id: REPORTED_SPELL::CHOSEN_OF_FROSTBROOD_RECALL,
124            effect_index: 1,
125        },
126        TargetOverlayMetadata {
127            name: "Frostwyrm recall breath dimensions",
128            reason: "the recall reuses the forward 40-yard breath path",
129        },
130    )
131        .dimensions(40.0, 5.0)
132        .facing_explicit_target()
133}