Added States for monsters and corpses (#43)

This commit is contained in:
elb
2024-09-29 07:32:19 -04:00
committed by GitHub
parent 8239f1bbe4
commit 9020cc396e
5 changed files with 35 additions and 7 deletions

View File

@@ -139,6 +139,7 @@ type Corpse struct {
Found bool
IsHovered bool
Position Position
States state.States
}
type Position struct {
@@ -290,3 +291,23 @@ type OpenMenus struct {
func (om OpenMenus) IsMenuOpen() bool {
return om.Inventory || om.NPCInteract || om.NPCShop || om.Stash || om.Waypoint || om.SkillTree || om.Character || om.QuitMenu || om.Cube || om.SkillSelect || om.Anvil
}
func (c Corpse) StateNotInteractable() bool {
CorpseStates := []state.State{
state.CorpseNoselect,
state.CorpseNodraw,
state.Revive,
state.Redeemed,
state.Shatter,
state.Freeze,
}
for _, s := range c.States {
for _, d := range CorpseStates {
if s == d {
return true
}
}
}
return false
}