things

package
v0.0.10 Latest Latest
Warning

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

Go to latest
Published: Jul 22, 2024 License: GPL-2.0 Imports: 9 Imported by: 0

Documentation

Overview

Package things implements a registry for items, creatures etc.

Index

Constants

View Source
const (
	OutfitOverlayMaskNone = OutfitOverlayMask(1 << iota)
	OutfitOverlayMaskFirst
	OutfitOverlayMaskSecond
	OutfitOverlayMaskThird
	OutfitOverlayMaskFourth

	OutfitOverlayMaskLast
)
View Source
const (
	CreatureDirectionNorth = CreatureDirection(0)
	CreatureDirectionEast  = CreatureDirection(iota)
	CreatureDirectionSouth
	CreatureDirectionWest
)

Variables

This section is empty.

Functions

func OutfitColorCount added in v0.0.3

func OutfitColorCount() int

Types

type Creature

type Creature struct {
	// contains filtered or unexported fields
}

func (*Creature) AnimCount

func (c *Creature) AnimCount() int

func (*Creature) ClientID added in v0.0.3

func (c *Creature) ClientID(clientVersion uint16) uint16

func (*Creature) ColorizedCreatureFrame

func (c *Creature) ColorizedCreatureFrame(idx int, dir CreatureDirection, outfitOverlayMask OutfitOverlayMask, colors []color.Color) image.Image

func (*Creature) CreatureFrame

func (c *Creature) CreatureFrame(idx int, dir CreatureDirection, outfitOverlayMask OutfitOverlayMask, colorTemplate bool) image.Image

func (*Creature) GraphicsSize

func (c *Creature) GraphicsSize() struct{ W, H int }

func (*Creature) IdleAnim

func (c *Creature) IdleAnim() bool

func (*Creature) LightInfo

func (c *Creature) LightInfo() dat.LightInfo

func (*Creature) Name

func (c *Creature) Name() string

func (*Creature) ServerID added in v0.0.3

func (c *Creature) ServerID() int

type CreatureDirection added in v0.0.3

type CreatureDirection int

type Item

type Item struct {
	// contains filtered or unexported fields
}

func (*Item) Article added in v0.0.8

func (i *Item) Article() string

func (*Item) ClientID added in v0.0.8

func (i *Item) ClientID(clientVersion uint16) uint16

func (*Item) Description added in v0.0.8

func (i *Item) Description() string

func (*Item) GraphicsSize

func (i *Item) GraphicsSize() struct{ W, H int }

func (*Item) ItemFrame

func (i *Item) ItemFrame(idx int, x, y, z int) image.Image

func (*Item) LightInfo

func (i *Item) LightInfo() dat.LightInfo

func (*Item) MapColor added in v0.0.3

func (i *Item) MapColor() dat.DatasetColor

func (*Item) MapColorOK added in v0.0.3

func (i *Item) MapColorOK() bool

func (*Item) Name

func (i *Item) Name() string

func (*Item) RawClientDatasetItem780 added in v0.0.5

func (i *Item) RawClientDatasetItem780() *dat.Item

RawClientDatasetItem780 is for debug or viewing use only; please do not access it outside these scenarios, as it may disappear anytime.

It is currently used for showing opt byte descriptions in the web UI.

It may return nil.

func (*Item) ServerID added in v0.0.8

func (i *Item) ServerID() uint16
func (i *Item) Temp__ExternalLink() string

func (*Item) ValidClientItem added in v0.0.3

func (i *Item) ValidClientItem() bool

type OutfitColor

type OutfitColor int

func (OutfitColor) RGBA

func (col OutfitColor) RGBA() (r, g, b, a uint32)

type OutfitOverlayMask

type OutfitOverlayMask int

type Things

type Things struct {
	// contains filtered or unexported fields
}

func New

func New() (*Things, error)

func (*Things) AddItemsOTB

func (t *Things) AddItemsOTB(i *itemsotb.Items) error

func (*Things) AddSpriteSet

func (t *Things) AddSpriteSet(s *spr.SpriteSet) error

func (*Things) AddTibiaDataset

func (t *Things) AddTibiaDataset(d *dat.Dataset) error

func (*Things) ClientItemCount added in v0.0.8

func (t *Things) ClientItemCount(clientVersion uint16) int

ClientItemCount returns the serverside items count that have a known client ID for the passed version.

func (*Things) Creature added in v0.0.3

func (t *Things) Creature(serverID uint16, clientVersion uint16) (*Creature, error)

Creature returns the things-representation of a creature / outfit which has the passed server ID. The used dataset will be for the passed version, if the creature even exists for the passed version.

Currently there is no distinction between client and server IDs. Yet.

func (*Things) CreatureCount added in v0.0.8

func (t *Things) CreatureCount(clientVersion uint16) int

CreatureCount returns the serverside creatures / outfits count that are known for the passed version.

Currently there is no distinction between client and server IDs, so the dataset count is returned.

func (*Things) CreatureWithClientID

func (t *Things) CreatureWithClientID(clientID uint16, clientVersion uint16) (*Creature, error)

CreatureWithClientID returns the things-representation of a creature which has the passed client ID in the passed client version. The outfit returned will have the dataset description for the passed version.

func (*Things) Item

func (t *Things) Item(serverID uint16, clientVersion uint16) (*Item, error)

Item returns the things-representation of an item which has the passed server (otb) ID. The used dataset will be for the passed version, if the item even exists for the passed version.

func (*Things) ItemCount added in v0.0.8

func (t *Things) ItemCount(clientVersion uint16) int

ItemCount returns the serverside items count that are known for the passed version.

func (*Things) ItemWithClientID

func (t *Things) ItemWithClientID(clientID uint16, clientVersion uint16) (*Item, error)

ItemWithClientID returns the things-representation of an item which has the passed client ID in the passed client version. The used dataset will be for the passed version.

func (*Things) ItemWithSequentialClientID added in v0.0.8

func (t *Things) ItemWithSequentialClientID(idx uint16, clientVersion uint16) (*Item, error)

ItemWithSequentialClientID returns Nth item with valid client ID. This is useful only for pagination purposes, and the index may change depending on the client version.

idx is zero-based.

func (*Things) ItemWithSequentialOTBIDX added in v0.0.8

func (t *Things) ItemWithSequentialOTBIDX(idx int, clientVersion uint16) (*Item, error)

ItemWithSequentialOTBID returns Nth item in OTB storage. This is useful only for pagination purposes, and the index may change depending on the client version.

idx is zero-based.

func (*Things) ItemWithSequentialServerID added in v0.0.8

func (t *Things) ItemWithSequentialServerID(idx uint16, clientVersion uint16) (*Item, error)

ItemWithSequentialServerID returns Nth item with valid server ID. This is useful only for pagination purposes, and the index may change depending on the server version.

idx is zero-based.

func (*Things) MaxItemClientID added in v0.0.8

func (t *Things) MaxItemClientID(clientVersion uint16) uint16

MaxItemClientID returns the largest ID of an item for the passed version.

This can be sourced either from OTB or from dataset, with preference for dataset.

func (*Things) MaxItemServerID added in v0.0.8

func (t *Things) MaxItemServerID(clientVersion uint16) uint16

MaxItemServerID returns the maximum ID of an item for the passed version.

Due to gaps, not the same as ItemCount.

func (*Things) MinItemClientID added in v0.0.8

func (t *Things) MinItemClientID(clientVersion uint16) uint16

MinItemClientID returns the minimum ID of an item for the passed version.

func (*Things) MinItemServerID added in v0.0.8

func (t *Things) MinItemServerID(clientVersion uint16) uint16

MinItemServerID returns the minimum ID of an item for the passed version.

func (*Things) ServerItemCount added in v0.0.8

func (t *Things) ServerItemCount(clientVersion uint16) int

ServerItemCount returns the serverside items count that have a known server ID for the passed version.

func (*Things) SpriteSetSignature

func (t *Things) SpriteSetSignature() uint32

func (*Things) Temp__DATItemCount added in v0.0.8

func (t *Things) Temp__DATItemCount(clientVersion uint16) int

func (*Things) Temp__GetClientIDForServerID

func (t *Things) Temp__GetClientIDForServerID(serverID uint16, clientVersion uint16) uint16

func (*Things) Temp__GetItemFromOTB

func (t *Things) Temp__GetItemFromOTB(serverID uint16, clientVersion uint16) *itemsotb.Item

func (*Things) Temp__GetKnownClientIDItemArrayOffsetInOTB added in v0.0.8

func (t *Things) Temp__GetKnownClientIDItemArrayOffsetInOTB(serverID uint16, clientVersion uint16) int

func (*Things) Temp__GetServerItemArrayOffsetInOTB added in v0.0.8

func (t *Things) Temp__GetServerItemArrayOffsetInOTB(serverID uint16, clientVersion uint16) int

func (*Things) TibiaDatasetSignature

func (t *Things) TibiaDatasetSignature() uint32

Directories

Path Synopsis
Package full is unstable; it serves as a helper to populate things.Things hackily.
Package full is unstable; it serves as a helper to populate things.Things hackily.

Jump to

Keyboard shortcuts

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