items

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: Nov 10, 2022 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ByID = map[int32]Item{}
View Source
var ByName = map[string]Item{}
View Source
var Enchants = []Enchant{}/* 223 elements not displayed */
View Source
var EnchantsByItemByID = map[proto.ItemType]map[int32]Enchant{}
View Source
var Gems = []Gem{}/* 545 elements not displayed */
View Source
var GemsByID = map[int32]Gem{}
View Source
var Items = []Item{}/* 8546 elements not displayed */

Functions

func ColorIntersects

func ColorIntersects(g proto.GemColor, o proto.GemColor) bool

func EquipmentSpecFromJsonString

func EquipmentSpecFromJsonString(jsonString string) *proto.EquipmentSpec

Types

type Enchant

type Enchant struct {
	EffectID    int32 // Used by UI to apply effect to tooltip
	ItemID      int32 // ID of the enchant item.
	SpellID     int32 // ID of the enchant spell.
	Name        string
	Quality     proto.ItemQuality
	Bonus       stats.Stats
	ItemType    proto.ItemType    // Which slot the enchant goes on.
	EnchantType proto.EnchantType // Additional category when ItemType isn't enough.
	Phase       int32

	RequiredProfession proto.Profession

	// Used by the UI to filter which enchants are shown.
	ClassAllowlist []proto.Class
}

func (Enchant) ToProto

func (enchant Enchant) ToProto() *proto.Enchant

type Equipment

type Equipment [proto.ItemSlot_ItemSlotRanged + 1]Item

func NewEquipmentSet

func NewEquipmentSet(equipSpec EquipmentSpec) Equipment

func ProtoToEquipment

func ProtoToEquipment(es *proto.EquipmentSpec) Equipment

func (Equipment) Clone

func (equipment Equipment) Clone() Equipment

func (*Equipment) EquipItem

func (equipment *Equipment) EquipItem(item Item)

func (Equipment) Stats

func (equipment Equipment) Stats() stats.Stats

func (*Equipment) ToEquipmentSpecProto

func (equipment *Equipment) ToEquipmentSpecProto() *proto.EquipmentSpec

type EquipmentSpec

type EquipmentSpec [proto.ItemSlot_ItemSlotRanged + 1]ItemSpec

Structs used for looking up items/gems/enchants

func ProtoToEquipmentSpec

func ProtoToEquipmentSpec(es *proto.EquipmentSpec) EquipmentSpec

type Gem

type Gem struct {
	ID      int32
	Name    string
	Stats   stats.Stats // flat stats gem adds
	Color   proto.GemColor
	Phase   byte
	Quality proto.ItemQuality
	Unique  bool

	RequiredProfession proto.Profession
}

func (Gem) ToProto

func (gem Gem) ToProto() *proto.Gem

type Item

type Item struct {
	ID        int32
	WowheadID int32
	Heroic    bool
	Type      proto.ItemType
	ArmorType proto.ArmorType
	// Weapon Stats
	WeaponType       proto.WeaponType
	HandType         proto.HandType
	RangedWeaponType proto.RangedWeaponType
	WeaponDamageMin  float64
	WeaponDamageMax  float64
	SwingSpeed       float64

	// Used by the UI to filter which items are shown.
	ClassAllowlist []proto.Class

	Name       string
	SourceZone string
	SourceDrop string
	Stats      stats.Stats // Stats applied to wearer
	Phase      byte
	Quality    proto.ItemQuality
	Unique     bool
	Ilvl       int32
	SetName    string // Empty string if not part of a set.

	RequiredProfession proto.Profession

	// Hidden variable used for a few obscure mechanics (Seal of Righteousness).
	// Intuitively, this is a measure of the difference between the expected stats
	// and the actual stats of an item, e.g. decreased weapon DPS on caster weapons.
	QualityModifier float64

	GemSockets  []proto.GemColor
	SocketBonus stats.Stats

	// Modified for each instance of the item.
	Gems    []Gem
	Enchant Enchant
}

func NewItem

func NewItem(itemSpec ItemSpec) Item

func (Item) ToItemSpecProto

func (item Item) ToItemSpecProto() *proto.ItemSpec

func (Item) ToProto

func (item Item) ToProto() *proto.Item

type ItemSlot

type ItemSlot byte
const (
	ItemSlotHead ItemSlot = iota
	ItemSlotNeck
	ItemSlotShoulder
	ItemSlotBack
	ItemSlotChest
	ItemSlotWrist
	ItemSlotHands
	ItemSlotWaist
	ItemSlotLegs
	ItemSlotFeet
	ItemSlotFinger1
	ItemSlotFinger2
	ItemSlotTrinket1
	ItemSlotTrinket2
	ItemSlotMainHand // can be 1h or 2h
	ItemSlotOffHand
	ItemSlotRanged
)

func ItemTypeToSlot

func ItemTypeToSlot(it proto.ItemType) ItemSlot

type ItemSpec

type ItemSpec struct {
	ID      int32
	Enchant int32
	Gems    []int32
}

type ItemStringSpec

type ItemStringSpec struct {
	Name    string
	Enchant string
	Gems    []string
}

Like ItemSpec, but uses names for reference instead of ID.

Jump to

Keyboard shortcuts

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