damage types: phys, magic, fire, cold, poison
This commit is contained in:
parent
de0aa33107
commit
b6abfbce4a
4 changed files with 28 additions and 13 deletions
|
|
@ -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,
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue