2022-01-03 16:30:14 -05:00
|
|
|
use std::collections::HashMap;
|
|
|
|
|
2021-12-24 10:38:44 -05:00
|
|
|
use ::serde::Deserialize;
|
2021-12-23 12:31:03 -05:00
|
|
|
|
|
|
|
use super::item_structs::Renderable;
|
|
|
|
|
|
|
|
#[derive(Deserialize, Debug)]
|
|
|
|
pub struct Mob {
|
|
|
|
pub name: String,
|
|
|
|
pub renderable: Option<Renderable>,
|
|
|
|
pub blocks_tile: bool,
|
|
|
|
pub vision_range: i32,
|
2022-01-11 14:16:23 -05:00
|
|
|
pub movement: String,
|
2022-01-03 10:49:12 -05:00
|
|
|
pub quips: Option<Vec<String>>,
|
2022-01-03 15:21:12 -05:00
|
|
|
pub attributes: MobAttributes,
|
2022-01-03 16:30:14 -05:00
|
|
|
pub skills: Option<HashMap<String, i32>>,
|
|
|
|
pub level: Option<i32>,
|
|
|
|
pub hp: Option<i32>,
|
|
|
|
pub mana: Option<i32>,
|
2022-01-04 11:11:38 -05:00
|
|
|
pub equipped: Option<Vec<String>>,
|
2022-01-04 11:29:23 -05:00
|
|
|
pub natural: Option<MobNatural>,
|
2022-01-05 09:42:36 -05:00
|
|
|
pub loot_table: Option<String>,
|
2022-01-10 10:28:04 -05:00
|
|
|
pub light: Option<MobLight>,
|
2022-01-11 14:16:23 -05:00
|
|
|
pub faction: Option<String>,
|
2022-01-13 10:42:02 -05:00
|
|
|
pub gold: Option<String>,
|
2022-01-13 11:29:20 -05:00
|
|
|
pub vendor: Option<Vec<String>>,
|
2022-01-10 10:28:04 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
#[derive(Deserialize, Debug)]
|
|
|
|
pub struct MobLight {
|
|
|
|
pub range: i32,
|
|
|
|
pub color: String,
|
2021-12-23 12:31:03 -05:00
|
|
|
}
|
2022-01-03 15:21:12 -05:00
|
|
|
|
|
|
|
#[derive(Deserialize, Debug)]
|
|
|
|
pub struct MobAttributes {
|
|
|
|
pub might: Option<i32>,
|
|
|
|
pub fitness: Option<i32>,
|
|
|
|
pub quickness: Option<i32>,
|
|
|
|
pub intelligence: Option<i32>,
|
|
|
|
}
|
2022-01-04 11:16:36 -05:00
|
|
|
|
|
|
|
#[derive(Deserialize, Debug)]
|
|
|
|
pub struct MobNatural {
|
|
|
|
pub armor_class: Option<i32>,
|
|
|
|
pub attacks: Option<Vec<NaturalAttack>>,
|
|
|
|
}
|
|
|
|
|
|
|
|
#[derive(Deserialize, Debug)]
|
|
|
|
pub struct NaturalAttack {
|
|
|
|
pub name: String,
|
|
|
|
pub hit_bonus: i32,
|
|
|
|
pub damage: String,
|
|
|
|
}
|