items

package
v1.2.3 Latest Latest
Warning

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

Go to latest
Published: Jul 18, 2022 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ItemTypeCurrency    ItemType = "currency"
	ItemTypeConsumable           = "consumable"
	ItemTypeArmor                = "armor"
	ItemTypeWeapon               = "weapon"
	ItemTypeCollectible          = "collectible"
	ItemTypeQuest                = "quest"

	ItemTypeCraftingMaterial = "crafting_material"
)
View Source
const (
	// weapons
	ItemSubTypeSword        ItemSubType = "sword"
	ItemSubTypeTwoHandSword ItemSubType = "twohandsword"
	ItemSubTypeAxe                      = "axe"
	ItemSubTypeSpear                    = "spear"

	// shields
	ItemSubTypeShield = "shield"
)
View Source
const (
	ItemSlotInventory ItemSlot = "inventory"
	ItemSlotContainer          = "container"
	ItemSlotPurse              = "purse"
	ItemSlotHead               = "head"
	ItemSlotChest              = "chest"
	ItemSlotLegs               = "legs"
	ItemSlotBoots              = "boots"
	ItemSlotNeck               = "neck"
	ItemSlotRing1              = "ring1"
	ItemSlotRing2              = "ring2"
	ItemSlotHands              = "hands"
	ItemSlotMainHand           = "main_hand"
	ItemSlotOffHand            = "off_hand"
)
View Source
const (
	ItemQualityNormal    ItemQuality = "normal"
	ItemQualityMagic                 = "magic"
	ItemQualityRare                  = "rare"
	ItemQualityLegendary             = "legendary"
	ItemQualityMythic                = "mythic"
)

Variables

This section is empty.

Functions

func ItemTemplateToJSONString

func ItemTemplateToJSONString(itemTemplate ItemTemplate) string

ItemTemplateToJSONString ...

func ItemTemplatesToJSONString

func ItemTemplatesToJSONString(itemTemplates ItemTemplates) string

ItemTemplatesToJSONString ...

func ItemToJSONString

func ItemToJSONString(item Item) string

ItemToJSONString ...

func ItemsToJSONString

func ItemsToJSONString(items Items) string

ItemsToJSONString ...

Types

type Item

type Item struct {
	*entities.Entity `bson:",inline"`
	traits.LookAt    `bson:",inline"` // "detail"

	Name        string `bson:"name,omitempty" json:"name"`
	Description string `bson:"description,omitempty" json:"description"`

	Type    ItemType    `bson:"type,omitempty" json:"type"`
	SubType ItemSubType `bson:"subType,omitempty" json:"subType"`
	Slot    ItemSlot    `bson:"slot,omitempty" json:"slot"`
	Quality ItemQuality `bson:"quality,omitempty" json:"quality"`
	Level   int32       `bson:"level,omitempty" json:"level,omitempty"`

	// custom item properties
	Properties map[string]interface{} `bson:"properties,omitempty" json:"properties,omitempty"`
	// "stats"
	Attributes map[string]interface{} `bson:"attributes,omitempty" json:"attributes,omitempty"`

	// container specifics
	Closed   bool   `bson:"closed,omitempty" json:"closed,omitempty"`
	Locked   bool   `bson:"locked,omitempty" json:"locked,omitempty"`
	LockedBy string `bson:"lockedBy,omitempty" json:"lockedBy,omitempty"`
	Items    Items  `bson:"items,omitempty" json:"items,omitempty"`
	MaxItems int32  `bson:"maxItems,omitempty" json:"maxItems,omitempty"`

	// misc
	NoPickup bool `bson:"noPickup,omitempty" json:"noPickup,omitempty"`

	// metainfo
	Tags      []string  `bson:"tags,omitempty" json:"tags"`
	Created   time.Time `bson:"created,omitempty" json:"created,omitempty"`
	CreatedBy string    `bson:"createdBy,omitempty" json:"createdBy,omitempty"`

	// additional non game critical meta information to enhance player experience on client
	Meta *struct {
		Img string `bson:"img,omitempty" json:"img,omitempty"`
	} `bson:"meta,omitempty" meta:"coords,omitempty"`
}

Item data

func ItemFromJSONString

func ItemFromJSONString(input string) (*Item, error)

ItemFromJSONString ...

type ItemQualities

type ItemQualities []ItemQuality

ItemQualities type

type ItemQuality

type ItemQuality string

ItemQuality ...

type ItemSlot

type ItemSlot string

ItemSlot type

type ItemSlots

type ItemSlots []ItemSlot

ItemSlots type

type ItemSubType

type ItemSubType string

ItemSubType type

type ItemSubTypes

type ItemSubTypes []ItemSubType

ItemSubTypes ...

type ItemTemplate

type ItemTemplate struct {
	Item   `bson:",inline"`
	Script *string `bson:"script,omitempty" json:"script"`
}

ItemTemplate ...

func ItemTemplateFromJSONString

func ItemTemplateFromJSONString(input string) (*ItemTemplate, error)

ItemTemplateFromJSONString ...

type ItemTemplates

type ItemTemplates []*ItemTemplate

ItemTemplates type

func ItemTemplatesFromJSONString

func ItemTemplatesFromJSONString(input string) (ItemTemplates, error)

ItemTemplatesFromJSONString ...

type ItemType

type ItemType string

ItemType type

type ItemTypes

type ItemTypes []ItemType

ItemTypes ...

type Items

type Items []*Item

Items type

func ItemsFromJSONString

func ItemsFromJSONString(input string) (Items, error)

ItemsFromJSONString ...

Jump to

Keyboard shortcuts

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