Skip to main content

wowlab_engine_gamedata/game_data/
stores.rs

1//! Cohesive private stores backing resolved game data.
2
3use wowlab_engine_macros::ResolvedStore;
4use wowlab_types::{
5    data::WeaponStats,
6    sim::{EffectRef, FastMap, IntMap, SpellIdx},
7};
8
9use super::{
10    AuraProps, ConsumableSpells, EffectValues, PassiveSpellModifiers, PowerTypeProps,
11    ResolvedCurves, ResolvedGameTables, ResolvedMap, SpellClassFlags, SpellProps,
12    default_aura_props, neutral_spell_props,
13};
14
15#[derive(Debug, ResolvedStore)]
16pub(crate) struct EffectStore {
17    pub(crate) values: FastMap<EffectRef, EffectValues>,
18    pub(crate) max_effect_index_by_spell: IntMap<SpellIdx, u8>,
19    #[resolved(neutral = 0)]
20    pub(crate) school_masks: ResolvedMap<SpellIdx, i32>,
21}
22
23#[derive(Debug, ResolvedStore)]
24pub(crate) struct SpellStore {
25    #[resolved(neutral = neutral_spell_props())]
26    pub(crate) props: ResolvedMap<SpellIdx, SpellProps>,
27    #[resolved(neutral = default_aura_props())]
28    pub(crate) aura_props: ResolvedMap<SpellIdx, AuraProps>,
29    #[resolved(neutral = PowerTypeProps::default())]
30    pub(crate) power_types: ResolvedMap<i32, PowerTypeProps>,
31    pub(crate) overrides: IntMap<SpellIdx, SpellIdx>,
32    pub(crate) learns: IntMap<SpellIdx, Vec<SpellIdx>>,
33    pub(crate) labels: IntMap<SpellIdx, Vec<i32>>,
34    pub(crate) class_flags: IntMap<SpellIdx, SpellClassFlags>,
35    pub(crate) specialization: Vec<SpellIdx>,
36}
37
38#[derive(Debug, ResolvedStore)]
39pub(crate) struct PassiveStore {
40    pub(crate) spell_modifiers: IntMap<SpellIdx, PassiveSpellModifiers>,
41    pub(crate) crit_damage_per_crit_chance: Vec<(i32, f64)>,
42    #[resolved(default = 1.0)]
43    pub(crate) auto_attack_damage_mult: f64,
44    #[resolved(default = 1.0)]
45    pub(crate) pet_damage_mult: f64,
46    #[resolved(default = 1.0)]
47    pub(crate) guardian_damage_mult: f64,
48    pub(crate) pet_attack_power_inheritance: IntMap<u32, f64>,
49    pub(crate) pet_spell_power_inheritance: IntMap<u32, f64>,
50    pub(crate) folded_spells: Vec<SpellIdx>,
51    pub(crate) class_target_debuffs: Vec<SpellIdx>,
52}
53
54#[derive(Debug, ResolvedStore)]
55pub(crate) struct EnvironmentStore {
56    pub(crate) armor_constant: f64,
57    pub(crate) creature_armor: f64,
58    #[resolved(default = 1.0)]
59    pub(crate) target_armor_mult: f64,
60    #[resolved(default = 1.0)]
61    pub(crate) armor_constant_mod: f64,
62    pub(crate) main_hand: WeaponStats,
63    pub(crate) off_hand: Option<WeaponStats>,
64    pub(crate) consumables: ConsumableSpells,
65}
66
67#[derive(Debug, Default)]
68pub(crate) struct ScalingStore {
69    pub(crate) curves: ResolvedCurves,
70    pub(crate) game_tables: ResolvedGameTables,
71    pub(crate) level: u32,
72}