wowlab_engine_combat/builder/def/
aura.rs1use wowlab_engine_macros::LowerData;
2
3use super::{AuraOn, BuilderSpellEffect, PeriodicDef};
4use crate::{
5 builder::lower::{self, BuilderToRuntimeCtx, InfoCtx},
6 state::{BuffEffect, MAX_AURA_BUFF_EFFECTS, SpellGroup},
7};
8
9#[derive(Clone, Debug, LowerData)]
10#[expect(
11 clippy::struct_excessive_bools,
12 reason = "lowered aura behavior preserves independent DBC flags"
13)]
14#[lower(
15 data = "crate::state::AuraData",
16 ctx = "BuilderToRuntimeCtx<'_>",
17 extra(
18 apply_effects = lower::aura_apply_effects,
19 on_consume = lower::aura_on_consume,
20 tick_effects = lower::aura_tick_effects,
21 ),
22 info = "wowlab_types::game::AuraInfo",
23 info_ctx = "InfoCtx<'_>",
24 info_fields(
25 aura_id,
26 name = lower::aura_name,
27 slug = lower::aura_slug,
28 on = lower::aura_on,
29 base_duration_ms,
30 max_stacks,
31 pandemic,
32 haste_buff_pct = lower::aura_haste_buff_pct,
33 damage_mult_pct = lower::aura_damage_mult_pct,
34 periodic = lower::aura_periodic_info,
35 ),
36 finalize = "crate::builder::aura_builder::AuraDefinitionDraft",
37 finalize_method = "from_draft",
38 finalize_rename(base_duration_ms = duration_ms),
39)]
40pub(crate) struct BuilderAuraDef {
41 #[lower(copy)]
42 pub(crate) aura_id: u32,
43 #[lower(name_idx = lower::resolve_name_idx)]
44 pub(crate) name: String,
45 #[lower(copy)]
46 pub(crate) on: AuraOn,
47 #[lower(copy)]
48 pub(crate) propagates_to_pet: bool,
49 #[lower(copy)]
50 pub(crate) base_duration_ms: u32,
51 #[lower(copy)]
52 pub(crate) doses: u8,
53 #[lower(copy)]
54 pub(crate) max_stacks: u8,
55 #[lower(copy)]
56 pub(crate) pandemic: bool,
57 #[lower(copy)]
58 pub(crate) refresh_behavior: wowlab_types::data::RefreshBehavior,
59 #[lower(copy)]
60 pub(crate) duration_hasted: bool,
61 #[lower(copy)]
62 pub(crate) shapeshift_form: i32,
63 #[lower(copy)]
64 pub(crate) shapeshift_form_flags: i32,
65 #[lower(copy)]
66 pub(crate) shapeshift_combat_round_time_ms: u32,
67 #[lower(copy)]
68 pub(crate) effects: [Option<BuffEffect>; MAX_AURA_BUFF_EFFECTS],
69 #[lower(convert = lower::aura_periodic)]
70 pub(crate) periodic: Option<PeriodicDef>,
71 #[lower(copy)]
72 pub(crate) spell_group: Option<SpellGroup>,
73 #[lower(copy)]
74 pub(crate) granted_aura_state: Option<crate::state::AuraState>,
75 #[lower(copy)]
76 pub(crate) crowd_control: Option<wowlab_engine_domain::dbc::CrowdControlSemantic>,
77 #[lower(copy)]
78 pub(crate) is_snapshot: bool,
79 #[lower(copy)]
80 pub(crate) dynamic_tick_action: crate::state::DynamicTickAction,
81 #[lower(copy)]
82 pub(crate) apply_at_max_stacks: bool,
83 #[lower(copy)]
84 pub(crate) reverse: bool,
85 #[lower(copy)]
86 pub(crate) freeze_stacks: bool,
87 #[lower(copy)]
88 pub(crate) tick_behavior: crate::state::AuraTickBehavior,
89 #[lower(copy)]
90 pub(crate) tick_stack_change: u8,
91 #[lower(copy)]
92 pub(crate) async_stacks: bool,
93 #[lower(copy)]
94 pub(crate) periodic_damage_scales_with_stacks: bool,
95 #[lower(copy)]
96 pub(crate) interrupt_flags: wowlab_engine_domain::dbc::SpellAuraInterruptFlags,
97 #[lower(copy)]
98 pub(crate) reapply_on_expire: bool,
99 #[lower(copy)]
100 pub(crate) application_excluded_auras: [u32; crate::state::MAX_AURA_APPLICATION_EXCLUSIONS],
101 #[lower(copy)]
102 pub(crate) application_followup_aura_id: u32,
103 #[lower(skip)]
104 pub(crate) apply_effects: Vec<BuilderSpellEffect>,
105 #[lower(copy)]
106 pub(crate) apply_profile_spell_id: u32,
107 #[lower(skip)]
108 pub(crate) on_consume: Vec<BuilderSpellEffect>,
109 #[lower(skip)]
110 pub(crate) tick_effects: Vec<BuilderSpellEffect>,
111 #[lower(copy)]
112 pub(crate) tick_profile_spell_id: u32,
113 #[lower(copy)]
114 pub(crate) expire_trigger_spell_id: u32,
115 #[lower(copy)]
116 pub(crate) expire_trigger_from_caster: bool,
117 #[lower(copy)]
118 pub(crate) on_expire: Option<crate::state::CastHookFn>,
119 #[lower(copy)]
120 pub(crate) on_tick: Option<crate::state::CastHookFn>,
121}