add immunity checks
This commit is contained in:
@@ -102,6 +102,18 @@ func (m Monster) IsImmune(resist stat.Resist) bool {
|
|||||||
if resist == stat.ColdImmune && st == stat.ColdResist {
|
if resist == stat.ColdImmune && st == stat.ColdResist {
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
|
if resist == stat.FireImmune && st == stat.FireResist {
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
if resist == stat.LightImmune && st == stat.LightningResist {
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
if resist == stat.PoisonImmune && st == stat.PoisonResist {
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
if resist == stat.MagicImmune && st == stat.MagicResist {
|
||||||
|
return true
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -7,4 +7,5 @@ const (
|
|||||||
FireImmune Resist = "fire"
|
FireImmune Resist = "fire"
|
||||||
LightImmune Resist = "light"
|
LightImmune Resist = "light"
|
||||||
PoisonImmune Resist = "poison"
|
PoisonImmune Resist = "poison"
|
||||||
|
MagicImmune Resist = "magic"
|
||||||
)
|
)
|
||||||
|
|||||||
Reference in New Issue
Block a user