Added States for monsters and corpses (#43)
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
@@ -3,6 +3,7 @@ package data
|
||||
import (
|
||||
"github.com/hectorgimenez/d2go/pkg/data/npc"
|
||||
"github.com/hectorgimenez/d2go/pkg/data/stat"
|
||||
"github.com/hectorgimenez/d2go/pkg/data/state"
|
||||
)
|
||||
|
||||
type NPC struct {
|
||||
@@ -20,6 +21,7 @@ type Monster struct {
|
||||
Position Position
|
||||
Stats map[stat.ID]int
|
||||
Type MonsterType
|
||||
States state.States
|
||||
}
|
||||
|
||||
type Monsters []Monster
|
||||
|
||||
Reference in New Issue
Block a user