data

package
v0.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 23, 2024 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Belt

type Belt struct {
	Items []Item
	Name  item.Name
}

func (Belt) GetFirstPotion

func (b Belt) GetFirstPotion(potionType PotionType) (Position, bool)

func (Belt) Rows

func (b Belt) Rows() int

type Class

type Class uint
const (
	Amazon Class = iota
	Sorceress
	Necromancer
	Paladin
	Barbarian
	Druid
	Assassin
)

type Corpse

type Corpse struct {
	Found     bool
	IsHovered bool
	Position  Position
}

type Data

type Data struct {
	AreaOrigin Position
	Corpse     Corpse
	Monsters   Monsters
	// First slice represents X and second Y
	CollisionGrid  [][]bool
	PlayerUnit     PlayerUnit
	NPCs           NPCs
	Items          Items
	Objects        Objects
	AdjacentLevels []Level
	Rooms          []Room
	OpenMenus      OpenMenus
	Roster         Roster
	HoverData      HoverData
	TerrorZones    []area.Area
}

func (Data) MercHPPercent

func (d Data) MercHPPercent() int

type HoverData

type HoverData struct {
	IsHovered bool
	UnitID
	UnitType int
}

type Item

type Item struct {
	UnitID
	Name       item.Name
	Quality    item.Quality
	Position   Position
	Location   item.Location
	Ethereal   bool
	IsHovered  bool
	Stats      map[stat.ID]stat.Data
	Identified bool
}

func (Item) IsFromQuest

func (i Item) IsFromQuest() bool

func (Item) IsHealingPotion

func (i Item) IsHealingPotion() bool

func (Item) IsManaPotion

func (i Item) IsManaPotion() bool

func (Item) IsPotion

func (i Item) IsPotion() bool

func (Item) IsRejuvPotion

func (i Item) IsRejuvPotion() bool

func (Item) Type

func (i Item) Type() string

type Items

type Items struct {
	Belt     Belt
	AllItems []Item
}

func (Items) ByLocation

func (i Items) ByLocation(locations ...item.Location) []Item

func (Items) Find

func (i Items) Find(name item.Name, locations ...item.Location) (Item, bool)

type Level

type Level struct {
	Area       area.Area
	Position   Position
	IsEntrance bool // This means the area can not be accessed just walking through it, needs to be clicked
}

type Monster

type Monster struct {
	UnitID
	Name      npc.ID
	IsHovered bool
	Position  Position
	Stats     map[stat.ID]int
	Type      MonsterType
}

func (Monster) IsElite

func (m Monster) IsElite() bool

func (Monster) IsGoodNPC

func (m Monster) IsGoodNPC() bool

func (Monster) IsImmune

func (m Monster) IsImmune(resist stat.Resist) bool

func (Monster) IsMerc

func (m Monster) IsMerc() bool

func (Monster) IsMonsterRaiser

func (m Monster) IsMonsterRaiser() bool

IsMonsterRaiser returns true if the monster is able to spawn new monsters.

func (Monster) IsSkip

func (m Monster) IsSkip() bool

Monster can`t be targeted normally

type MonsterFilter

type MonsterFilter func(m Monsters) []Monster

func MonsterAnyFilter

func MonsterAnyFilter() MonsterFilter

func MonsterEliteFilter

func MonsterEliteFilter() MonsterFilter

type MonsterType

type MonsterType string
const (

	// Monster Types
	MonsterTypeNone        MonsterType = "None"
	MonsterTypeChampion    MonsterType = "Champion"
	MonsterTypeMinion      MonsterType = "Minion"
	MonsterTypeUnique      MonsterType = "Unique"
	MonsterTypeSuperUnique MonsterType = "SuperUnique"
)

type Monsters

type Monsters []Monster

func (Monsters) Enemies

func (m Monsters) Enemies(filters ...MonsterFilter) []Monster

func (Monsters) FindByID

func (m Monsters) FindByID(id UnitID) (Monster, bool)

func (Monsters) FindOne

func (m Monsters) FindOne(id npc.ID, t MonsterType) (Monster, bool)

type NPC

type NPC struct {
	ID        npc.ID
	Name      string
	Positions []Position
}

type NPCs

type NPCs []NPC

func (NPCs) FindOne

func (n NPCs) FindOne(npcid npc.ID) (NPC, bool)

type Object

type Object struct {
	Name         object.Name
	IsHovered    bool
	Selectable   bool
	InteractType object.InteractType
	Position     Position
}

func (Object) IsChest

func (o Object) IsChest() bool

func (Object) IsDoor

func (o Object) IsDoor() bool

func (Object) IsPortal

func (o Object) IsPortal() bool

func (Object) IsRedPortal

func (o Object) IsRedPortal() bool

func (Object) IsSuperChest

func (o Object) IsSuperChest() bool

func (Object) IsWaypoint

func (o Object) IsWaypoint() bool

type Objects

type Objects []Object

func (Objects) FindOne

func (o Objects) FindOne(name object.Name) (Object, bool)

type OpenMenus

type OpenMenus struct {
	Inventory     bool
	LoadingScreen bool
	NPCInteract   bool
	NPCShop       bool
	Stash         bool
	Waypoint      bool
	MapShown      bool
	SkillTree     bool
	Character     bool
	QuitMenu      bool
	Cube          bool
	SkillSelect   bool
	Anvil         bool
}

type PlayerUnit

type PlayerUnit struct {
	Name               string
	ID                 UnitID
	Area               area.Area
	Position           Position
	Stats              map[stat.ID]int
	Skills             map[skill.Skill]int
	States             state.States
	Class              Class
	LeftSkill          skill.Skill
	RightSkill         skill.Skill
	AvailableWaypoints []area.Area // Is only filled when WP menu is open and only for the specific selected tab
}

func (PlayerUnit) HPPercent

func (pu PlayerUnit) HPPercent() int

func (PlayerUnit) HasDebuff

func (pu PlayerUnit) HasDebuff() bool

func (PlayerUnit) MPPercent

func (pu PlayerUnit) MPPercent() int

func (PlayerUnit) MaxGold

func (pu PlayerUnit) MaxGold() int

func (PlayerUnit) TotalGold

func (pu PlayerUnit) TotalGold() int

TotalGold returns the amount of gold, including inventory and stash

type PointCounter

type PointCounter struct {
	MaxPoint   int
	MaxPointBo int
}

since stat.MaxLife is returning max life without stats, we are setting the max life value that we read from the game memory, overwriting this value each time it increases. It's not a good solution but it will provide more accurate values for the life %. This value is checked for each memory iteration.

func (*PointCounter) Percent

func (pc *PointCounter) Percent(point int, maxPoint int, hasBo bool) int

type PointOfInterest

type PointOfInterest struct {
	Name     string
	Position Position
}

type Position

type Position struct {
	X int
	Y int
}

type PotionType

type PotionType string
const (
	HealingPotion      PotionType = "HealingPotion"
	ManaPotion         PotionType = "ManaPotion"
	RejuvenationPotion PotionType = "RejuvenationPotion"
)

type Room

type Room struct {
	Position
	Width  int
	Height int
}

func (Room) GetCenter

func (r Room) GetCenter() Position

func (Room) IsInside

func (r Room) IsInside(p Position) bool

type Roster

type Roster []RosterMember

func (Roster) FindByName

func (r Roster) FindByName(name string) (RosterMember, bool)

type RosterMember

type RosterMember struct {
	Name     string
	Area     area.Area
	Position Position
}

type UnitID

type UnitID int

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL