pets

package
v0.9.7 Latest Latest
Warning

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

Go to latest
Published: Jul 14, 2025 License: GPL-3.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func LoadDataFiles

func LoadDataFiles()

file self loads due to init()

Types

type Food

type Food int

func (*Food) Add

func (f *Food) Add()

func (*Food) Remove

func (f *Food) Remove()

func (Food) String

func (f Food) String() string

type Pet

type Pet struct {
	Name          string            `yaml:"name,omitempty"`          // Name of the pet (player provided hopefully)
	NameStyle     string            `yaml:"namestyle,omitempty"`     // Optional color pattern to apply
	Type          string            `yaml:"type"`                    // type of pet
	Food          Food              `yaml:"food,omitempty"`          // how much food the pet has
	LastMealRound uint8             `yaml:"lastmealround,omitempty"` // When the pet was last fed
	Damage        items.Damage      `yaml:"damage,omitempty"`        // When the pet was last fed
	StatMods      statmods.StatMods `yaml:"statmods,omitempty"`      // stat mods the pet provides
	BuffIds       []int             `yaml:"buffids,omitempty"`       // Permabuffs this pet affords the player
	Capacity      int               `yaml:"capacity,omitempty"`      // How many items this mob can carry
	Items         []items.Item      `yaml:"items,omitempty"`         // Items held by this pet
}

func GetPetCopy

func GetPetCopy(petId string) Pet

func GetPetSpec

func GetPetSpec(petId string) Pet

func (*Pet) DisplayName

func (p *Pet) DisplayName() string

func (*Pet) Exists

func (p *Pet) Exists() bool

func (*Pet) Filename

func (p *Pet) Filename() string

func (*Pet) Filepath

func (p *Pet) Filepath() string

func (*Pet) FindItem

func (p *Pet) FindItem(itemName string) (items.Item, bool)

func (*Pet) GetBuffs

func (p *Pet) GetBuffs() []int

func (*Pet) GetDiceRoll

func (p *Pet) GetDiceRoll() (attacks int, dCount int, dSides int, bonus int, buffOnCrit []int)

func (*Pet) Id

func (p *Pet) Id() string

func (*Pet) RemoveItem

func (p *Pet) RemoveItem(i items.Item) bool

func (*Pet) Save

func (p *Pet) Save() error

func (*Pet) StatMod

func (p *Pet) StatMod(statName string) int

func (*Pet) StoreItem

func (p *Pet) StoreItem(i items.Item) bool

func (*Pet) Validate

func (p *Pet) Validate() error

Jump to

Keyboard shortcuts

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