roguelike-game/src/raws/item_structs.rs

43 lines
884 B
Rust
Raw Normal View History

use std::collections::HashMap;
2021-12-24 10:38:44 -05:00
use ::serde::Deserialize;
#[derive(Deserialize, Debug)]
pub struct Item {
pub name: String,
pub renderable: Option<Renderable>,
pub consumable: Option<Consumable>,
pub weapon: Option<Weapon>,
2022-01-04 11:11:38 -05:00
pub wearable: Option<Wearable>,
2022-01-13 10:14:13 -05:00
pub initiative_penalty: Option<f32>,
pub weight_lbs: Option<f32>,
pub base_value: Option<f32>,
}
#[derive(Deserialize, Debug)]
pub struct Renderable {
pub glyph: String,
pub fg: String,
pub bg: String,
pub order: i32,
}
#[derive(Deserialize, Debug)]
pub struct Consumable {
pub effects: HashMap<String, String>,
}
#[derive(Deserialize, Debug)]
pub struct Weapon {
pub range: String,
pub attribute: String,
pub base_damage: String,
pub hit_bonus: i32,
}
#[derive(Deserialize, Debug)]
2022-01-04 11:11:38 -05:00
pub struct Wearable {
pub armor_class: f32,
pub slot: String,
}