wowlab_engine_gamedata/game_data/
passive_access.rs1use wowlab_types::sim::SpellIdx;
4
5use super::{PassiveSpellModifiers, ResolvedGameData};
6
7impl ResolvedGameData {
8 #[must_use]
10 pub fn passive_spell_modifiers(&self, spell_id: SpellIdx) -> PassiveSpellModifiers {
11 wowlab_types::bench_metrics::record_game_data_hot_read();
12
13 self.inner
14 .passives
15 .spell_modifiers
16 .get(&spell_id)
17 .copied()
18 .unwrap_or_default()
19 }
20
21 #[must_use]
23 pub fn crit_damage_per_crit_chance(&self) -> &[(i32, f64)] {
24 wowlab_types::bench_metrics::record_game_data_hot_read();
25
26 &self.inner.passives.crit_damage_per_crit_chance
27 }
28
29 #[must_use]
31 pub fn auto_attack_damage_mult(&self) -> f64 {
32 wowlab_types::bench_metrics::record_game_data_hot_read();
33
34 self.inner.passives.auto_attack_damage_mult
35 }
36
37 #[must_use]
39 pub fn pet_damage_mult(&self) -> f64 {
40 wowlab_types::bench_metrics::record_game_data_hot_read();
41
42 self.inner.passives.pet_damage_mult
43 }
44
45 #[must_use]
47 pub fn guardian_damage_mult(&self) -> f64 {
48 wowlab_types::bench_metrics::record_game_data_hot_read();
49
50 self.inner.passives.guardian_damage_mult
51 }
52
53 #[must_use]
55 pub fn pet_attack_power_inheritance_mult(&self, npc_id: u32) -> f64 {
56 wowlab_types::bench_metrics::record_game_data_hot_read();
57
58 self.inner
59 .passives
60 .pet_attack_power_inheritance
61 .get(&npc_id)
62 .copied()
63 .unwrap_or(1.0)
64 }
65
66 #[must_use]
68 pub fn pet_spell_power_inheritance_mult(&self, npc_id: u32) -> f64 {
69 wowlab_types::bench_metrics::record_game_data_hot_read();
70
71 self.inner
72 .passives
73 .pet_spell_power_inheritance
74 .get(&npc_id)
75 .copied()
76 .unwrap_or(1.0)
77 }
78
79 #[must_use]
81 pub fn is_specialization_spell(&self, spell_id: SpellIdx) -> bool {
82 wowlab_types::bench_metrics::record_game_data_hot_read();
83
84 self.inner.spells.specialization.contains(&spell_id)
85 }
86
87 #[must_use]
89 pub fn is_folded_passive(&self, spell_id: SpellIdx) -> bool {
90 wowlab_types::bench_metrics::record_game_data_hot_read();
91
92 self.inner.passives.folded_spells.contains(&spell_id)
93 }
94
95 #[must_use]
97 pub fn folded_passive_spells(&self) -> &[SpellIdx] {
98 wowlab_types::bench_metrics::record_game_data_hot_read();
99
100 &self.inner.passives.folded_spells
101 }
102
103 #[must_use]
107 pub fn class_target_debuffs(&self) -> &[SpellIdx] {
108 wowlab_types::bench_metrics::record_game_data_hot_read();
109
110 &self.inner.passives.class_target_debuffs
111 }
112}