wowlab_engine_gamedata/game_data/
consumables.rs1use super::item_budget::ItemBudget;
4
5#[derive(Clone, Debug, PartialEq)]
7pub struct ConsumableBuff {
8 pub spell_id: u32,
9 pub name: String,
10 pub item_budget: Option<ItemBudget>,
11}
12
13#[derive(Clone, Debug, PartialEq)]
15pub struct FoodBuff {
16 pub spell_id: u32,
17 pub name: String,
18 pub coeff_spell_id: u32,
19 pub coeff_effect: u8,
20 pub amount_multiplier: f64,
21}
22
23#[derive(Clone, Debug, Default, PartialEq)]
25pub struct ConsumableSpells {
26 pub potion: Option<ConsumableBuff>,
27 pub flask: Option<ConsumableBuff>,
28 pub food: Option<FoodBuff>,
29 pub augment_rune: Option<ConsumableBuff>,
30}
31
32impl ConsumableSpells {
33 #[must_use]
35 pub fn spell_ids(&self) -> Vec<u32> {
36 let mut ids = Vec::new();
37
38 if let Some(p) = &self.potion {
39 ids.push(p.spell_id);
40 }
41
42 if let Some(f) = &self.flask {
43 ids.push(f.spell_id);
44 }
45
46 if let Some(f) = &self.food {
47 ids.push(f.spell_id);
48 ids.push(f.coeff_spell_id);
49 }
50
51 if let Some(a) = &self.augment_rune {
52 ids.push(a.spell_id);
53 }
54
55 ids
56 }
57}