Skip to main content

wowlab_engine_combat/builder/spell_builder/
gating.rs

1use super::SpellDefinitionDraft;
2
3impl SpellDefinitionDraft {
4    /// Gate this spell on `aura_id` being active with at least `min_stacks` stacks (`aura_id = 0` clears).
5    pub fn requires_aura_at_min_stacks(mut self, aura_id: u32, min_stacks: u8) -> Self {
6        self.gating_aura_id = aura_id;
7        self.gating_aura_min_stacks = min_stacks;
8
9        self
10    }
11
12    /// Bypass all resource costs while `aura_id` is active (`aura_id = 0` clears).
13    pub fn cost_free_when_aura(mut self, aura_id: u32) -> Self {
14        self.cost_bypass_aura_id = aura_id;
15
16        self
17    }
18
19    /// Consume one stack of `aura_id` after a successful cast.
20    pub fn consume_aura_on_cast(mut self, aura_id: u32) -> Self {
21        self.consume_aura_on_cast_id = aura_id;
22
23        self
24    }
25
26    /// Do not start this spell's cooldown while `aura_id` is active.
27    pub fn cooldown_bypass_when_aura(mut self, aura_id: u32) -> Self {
28        self.cooldown_bypass_aura_id = aura_id;
29
30        self
31    }
32
33    /// Gate castability on the target being at or below `percent` health.
34    pub fn execute_below_pct(mut self, percent: f64) -> Self {
35        self.execute_below_pct = percent;
36
37        self
38    }
39
40    /// Make this spell instant while `aura_id` is active.
41    pub fn instant_when_aura(mut self, aura_id: u32) -> Self {
42        self.instant_cast_aura_id = aura_id;
43
44        self
45    }
46
47    /// Make an action replacement share the requested action's cooldown.
48    pub fn override_shares_base_cooldown(mut self) -> Self {
49        self.override_shares_base_cooldown = true;
50
51        self
52    }
53
54    /// Keep a stance/form aura active when it selects a replacement action.
55    pub fn override_preserves_aura(mut self) -> Self {
56        self.override_preserves_aura = true;
57
58        self
59    }
60
61    /// Replace this action with `spell_id` while `aura_id` is active.
62    pub fn overridden_by(mut self, spell_id: u32, aura_id: u32) -> Self {
63        self.override_aura_id = aura_id;
64        self.override_spell_id = spell_id;
65
66        self
67    }
68
69    /// Replace this action only when the controlling aura reaches `min_stacks`.
70    pub fn override_at_min_stacks(mut self, min_stacks: u8) -> Self {
71        self.override_aura_min_stacks = min_stacks;
72
73        self
74    }
75}