use std::collections::HashMap; use ::serde::Deserialize; #[derive(Deserialize, Debug)] pub struct Item { pub name: String, pub renderable: Option, pub consumable: Option, pub weapon: Option, pub wearable: Option, pub initiative_penalty: Option, pub weight_lbs: Option, pub base_value: Option, pub vendor_category: Option, pub magic: Option, pub attributes: Option, } #[derive(Deserialize, Debug)] pub struct Renderable { pub glyph: String, pub fg: String, pub bg: String, pub order: i32, pub x_size: Option, pub y_size: Option, } #[derive(Deserialize, Debug)] pub struct Consumable { pub effects: HashMap, pub charges: Option, } #[derive(Deserialize, Debug)] pub struct Weapon { pub range: String, pub attribute: String, pub base_damage: String, pub hit_bonus: i32, pub proc_chance: Option, pub proc_target: Option, pub proc_effects: Option>, } #[derive(Deserialize, Debug)] pub struct Wearable { pub armor_class: f32, pub slot: String, } #[derive(Deserialize, Debug)] pub struct MagicItem { pub class: String, pub naming: String, pub cursed: Option, } #[derive(Deserialize, Debug)] pub struct ItemAttributeBonus { pub might: Option, pub fitness: Option, pub quickness: Option, pub intelligence: Option, }