data

package
v0.0.0-...-52bb744 Latest Latest
Warning

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

Go to latest
Published: May 20, 2024 License: MIT Imports: 10 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
	Inventory      Inventory
	Objects        Objects
	AdjacentLevels []Level
	Rooms          []Room
	OpenMenus      OpenMenus
	Roster         Roster
	HoverData      HoverData
	TerrorZones    []area.ID
	Quests         quest.Quests
	KeyBindings    KeyBindings
}

func (Data) MercHPPercent

func (d Data) MercHPPercent() int

type HoverData

type HoverData struct {
	IsHovered bool
	UnitID
	UnitType int
}

type Inventory

type Inventory struct {
	Belt        Belt
	AllItems    []Item
	Gold        int
	StashedGold [4]int
}

func (Inventory) ByLocation

func (i Inventory) ByLocation(locations ...item.LocationType) []Item

func (Inventory) Find

func (i Inventory) Find(name item.Name, locations ...item.LocationType) (Item, bool)

type Item

type Item struct {
	ID int
	UnitID
	Name       item.Name
	Quality    item.Quality
	Position   Position
	Location   item.Location
	Ethereal   bool
	IsHovered  bool
	BaseStats  stat.Stats
	Stats      stat.Stats
	Identified bool
}

func (Item) Desc

func (i Item) Desc() item.Description

func (Item) FindStat

func (i Item) FindStat(id stat.ID, layer int) (stat.Data, 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() item.Type

type KeyBinding

type KeyBinding struct {
	Key1 [2]byte
	Key2 [2]byte
}

type KeyBindings

type KeyBindings struct {
	CharacterScreen KeyBinding
	Inventory       KeyBinding
	HoradricCube    KeyBinding
	PartyScreen     KeyBinding
	MercenaryScreen KeyBinding
	MessageLog      KeyBinding
	QuestLog        KeyBinding
	HelpScreen      KeyBinding

	SkillTree           KeyBinding
	SkillSpeedBar       KeyBinding
	Skills              [16]SkillBinding
	SelectPreviousSkill KeyBinding
	SelectNextSkill     KeyBinding

	ShowBelt    KeyBinding
	UseBelt     [4]KeyBinding
	SwapWeapons KeyBinding

	Chat          KeyBinding
	Run           KeyBinding
	ToggleRunWalk KeyBinding
	StandStill    KeyBinding
	ForceMove     KeyBinding
	ShowItems     KeyBinding
	ShowPortraits KeyBinding

	Automap        KeyBinding
	CenterAutomap  KeyBinding
	FadeAutomap    KeyBinding
	PartyOnAutomap KeyBinding
	NamesOnAutomap KeyBinding
	ToggleMiniMap  KeyBinding

	SayHelp         KeyBinding
	SayFollowMe     KeyBinding
	SayThisIsForYou KeyBinding
	SayThanks       KeyBinding
	SaySorry        KeyBinding
	SayBye          KeyBinding
	SayNowYouDie    KeyBinding
	SayRetreat      KeyBinding

	ClearScreen   KeyBinding
	ClearMessages KeyBinding
	Zoom          KeyBinding
	LegacyToggle  KeyBinding
}

func (KeyBindings) KeyBindingForSkill

func (kb KeyBindings) KeyBindingForSkill(skillID skill.ID) (KeyBinding, bool)

func (KeyBindings) MustKBForSkill

func (kb KeyBindings) MustKBForSkill(skillID skill.ID) KeyBinding

type Level

type Level struct {
	Area       area.ID
	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

IsSkip monster can not be killed as a normal enemy, for example can not be targeted

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 {
	ID           UnitID
	Name         object.Name
	IsHovered    bool
	Selectable   bool
	InteractType object.InteractType
	Position     Position
	Owner        string
}

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 {
	Address            uintptr
	Name               string
	ID                 UnitID
	Area               area.ID
	Position           Position
	Stats              stat.Stats
	BaseStats          stat.Stats
	Skills             map[skill.ID]skill.Points
	States             state.States
	Class              Class
	LeftSkill          skill.ID
	RightSkill         skill.ID
	AvailableWaypoints []area.ID // Is only filled when WP menu is open and only for the specific selected tab
}

func (PlayerUnit) CastingFrames

func (pu PlayerUnit) CastingFrames() int

func (PlayerUnit) FindStat

func (pu PlayerUnit) FindStat(id stat.ID, layer int) (stat.Data, bool)

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) TotalPlayerGold

func (pu PlayerUnit) TotalPlayerGold() int

TotalPlayerGold returns the amount of gold, including inventory and player stash (excluding shared stash)

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.ID
	Position Position
}

type SkillBinding

type SkillBinding struct {
	SkillID skill.ID
	KeyBinding
}

type UnitID

type UnitID int

Directories

Path Synopsis
Code generated by cmd/txttocode.
Code generated by cmd/txttocode.
Code generated by cmd/txttocode.
Code generated by cmd/txttocode.
Code generated by cmd/txttocode.
Code generated by cmd/txttocode.

Jump to

Keyboard shortcuts

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