Skip to main content

wowlab_engine_combat/state/combat_state/
defs.rs

1use super::{
2    AccumulatingImpactProc, AuraData, AutoAttackData, CastHookFn, DriverSpellModifier,
3    EmpowerReleaseHookFn, EnemyActorDefinition, GearSlot, ImpactEffectProc, ImpactProc, IntMap,
4    LandedImpactProc, LocalAuraIdx, PassiveDriverEffect, PeriodicDriver, ResourceGainProc,
5    ResourceThresholdTrigger, RppmTracker, SpellData, SpellEffectData, ThresholdTracker,
6    WeaponEnchantBinding, WeaponImbueBinding,
7};
8
9/// Static combat definitions (spells, auras, auto-attacks, hooks, procs, precombat set).
10#[derive(Debug)]
11pub struct CombatDefs {
12    pub(super) enemies: Vec<EnemyActorDefinition>,
13    pub(crate) spells: Vec<SpellData>,
14    pub(crate) empower_cast_times_ms: Vec<u32>,
15    pub(crate) spell_effects: Vec<SpellEffectData>,
16    pub(crate) auras: Vec<AuraData>,
17    pub(crate) auto_attacks: Vec<AutoAttackData>,
18    pub(crate) cast_hooks: Vec<Option<CastHookFn>>,
19    pub(crate) empower_release_hooks: Vec<Option<EmpowerReleaseHookFn>>,
20    pub(crate) tick_hooks: Vec<Option<CastHookFn>>,
21    pub(crate) player_cast_hooks: Vec<CastHookFn>,
22    pub(crate) resource_threshold_triggers: Vec<ResourceThresholdTrigger>,
23    pub(crate) impact_procs: Vec<ImpactProc>,
24    pub(crate) landed_impact_procs: Vec<LandedImpactProc>,
25    pub(crate) accumulating_impact_procs: Vec<AccumulatingImpactProc>,
26    pub(crate) impact_effect_procs: Vec<ImpactEffectProc>,
27    pub(crate) driver_spell_modifiers: Vec<DriverSpellModifier>,
28    pub(crate) passive_driver_effects: Vec<PassiveDriverEffect>,
29    pub(crate) periodic_drivers: Vec<PeriodicDriver>,
30    pub(crate) talent_ranks: IntMap<u32, u8>,
31    pub(crate) resource_gain_procs: Vec<ResourceGainProc>,
32    pub(crate) item_use_spells: Vec<(GearSlot, u32)>,
33    pub(crate) rppm_trackers: Vec<RppmTracker>,
34    pub(crate) threshold_trackers: Vec<ThresholdTracker>,
35    pub(crate) weapon_enchant_bindings: Vec<WeaponEnchantBinding>,
36    pub(crate) weapon_imbue_bindings: Vec<WeaponImbueBinding>,
37    pub(crate) precombat_auras: Vec<LocalAuraIdx>,
38    pub(crate) talent_aura_stacks: Vec<(LocalAuraIdx, u8)>,
39    pub(crate) stealth_aura_id: Option<u32>,
40}
41
42impl CombatDefs {
43    pub(crate) fn new(enemies: Vec<EnemyActorDefinition>) -> Self {
44        Self {
45            enemies,
46            spells: Vec::new(),
47            empower_cast_times_ms: Vec::new(),
48            spell_effects: Vec::new(),
49            auras: Vec::new(),
50            auto_attacks: Vec::new(),
51            cast_hooks: Vec::new(),
52            empower_release_hooks: Vec::new(),
53            tick_hooks: Vec::new(),
54            player_cast_hooks: Vec::new(),
55            resource_threshold_triggers: Vec::new(),
56            impact_procs: Vec::new(),
57            landed_impact_procs: Vec::new(),
58            accumulating_impact_procs: Vec::new(),
59            impact_effect_procs: Vec::new(),
60            driver_spell_modifiers: Vec::new(),
61            passive_driver_effects: Vec::new(),
62            periodic_drivers: Vec::new(),
63            talent_ranks: IntMap::default(),
64            resource_gain_procs: Vec::new(),
65            item_use_spells: Vec::new(),
66            rppm_trackers: Vec::new(),
67            threshold_trackers: Vec::new(),
68            weapon_enchant_bindings: Vec::new(),
69            weapon_imbue_bindings: Vec::new(),
70            precombat_auras: Vec::new(),
71            talent_aura_stacks: Vec::new(),
72            stealth_aura_id: None,
73        }
74    }
75}