2019-05-18 16:46:14 +00:00
|
|
|
use crate::comp::actor;
|
|
|
|
use specs::{Component, VecStorage};
|
|
|
|
|
|
|
|
#[derive(Copy, Clone, Debug, PartialEq, Eq, Hash, Serialize, Deserialize)]
|
|
|
|
pub enum Armor {
|
2019-06-06 14:48:41 +00:00
|
|
|
// TODO: Don't make armor be a body part. Wearing enemy's head is funny but also creepy thing to do.
|
2019-06-28 08:24:13 +00:00
|
|
|
Helmet,
|
2019-05-18 16:46:14 +00:00
|
|
|
Shoulders(actor::Shoulder),
|
2019-06-01 04:52:20 +00:00
|
|
|
Chestplate(actor::Chest),
|
2019-05-18 16:46:14 +00:00
|
|
|
Belt(actor::Belt),
|
|
|
|
Gloves(actor::Hand),
|
|
|
|
Pants(actor::Pants),
|
|
|
|
Boots(actor::Foot),
|
|
|
|
Back,
|
|
|
|
Tabard,
|
|
|
|
Gem,
|
|
|
|
Necklace,
|
|
|
|
}
|
|
|
|
|
|
|
|
#[derive(Copy, Clone, Debug, PartialEq, Eq, Hash, Serialize, Deserialize)]
|
|
|
|
pub enum Rarity {
|
|
|
|
Common,
|
|
|
|
Uncommon,
|
|
|
|
Rare,
|
|
|
|
Legendary,
|
|
|
|
}
|
|
|
|
|
|
|
|
#[derive(Copy, Clone, Debug, PartialEq, Eq, Hash, Serialize, Deserialize)]
|
|
|
|
pub enum Item {
|
|
|
|
Weapon {
|
|
|
|
damage: i32,
|
|
|
|
strength: i32,
|
|
|
|
rarity: Rarity,
|
|
|
|
variant: actor::Weapon,
|
|
|
|
},
|
|
|
|
Armor {
|
|
|
|
defense: i32,
|
|
|
|
health_bonus: i32,
|
|
|
|
rarity: Rarity,
|
|
|
|
variant: Armor,
|
|
|
|
},
|
|
|
|
}
|
|
|
|
|
|
|
|
impl Component for Item {
|
|
|
|
type Storage = VecStorage<Self>;
|
|
|
|
}
|