damage types: phys, magic, fire, cold, poison

This commit is contained in:
Llywelwyn 2023-09-21 22:46:14 +01:00
parent de0aa33107
commit b6abfbce4a
4 changed files with 28 additions and 13 deletions

View file

@ -370,14 +370,17 @@ pub struct ProvidesHealing {
#[derive(Debug, PartialEq, Eq, Hash, Copy, Clone, Serialize, Deserialize)]
pub enum DamageType {
Physical,
Magic,
Magic, // e.g. magic missiles, silvered weapons
Fire, // e.g. fireball
Cold, // e.g. cone of cold
Poison, // e.g. poison gas
Forced, // Bypasses any immunities. e.g. Hunger ticks.
}
impl DamageType {
pub fn is_magic(&self) -> bool {
match self {
DamageType::Magic => true,
DamageType::Magic | DamageType::Fire | DamageType::Cold => true,
_ => false,
}
}