Documentation ¶
Index ¶
- Constants
- type Armor
- func (a *Armor) Armor() int
- func (a *Armor) EquipEffects() (effs []*effect.Effect)
- func (a *Armor) EquipReqs() []req.Requirement
- func (a *Armor) ID() string
- func (a *Armor) Level() int
- func (a *Armor) Serial() string
- func (a *Armor) SetSerial(s string)
- func (a *Armor) Slots() []Slot
- func (a *Armor) Update(delta int64)
- func (a *Armor) UseAction() *useaction.UseAction
- func (a *Armor) Value() int
- type Container
- type Equiper
- type Inventory
- func (i *Inventory) AddItem(it Item)
- func (i *Inventory) Apply(data res.InventoryData)
- func (i *Inventory) Data() res.InventoryData
- func (i *Inventory) Item(id, serial string) *InventoryItem
- func (i *Inventory) Items() (items []*InventoryItem)
- func (i *Inventory) LootItem(id, serial string) Item
- func (i *Inventory) RemoveItem(it Item)
- func (i *Inventory) SetOnItemRemovedFunc(f func(i Item))
- func (i *Inventory) Size() int
- func (i *Inventory) Update(delta int64)
- type InventoryItem
- type Item
- type Misc
- type Slot
- type Weapon
- func (w *Weapon) Damage() (int, int)
- func (w *Weapon) DamageEffects() []res.EffectData
- func (w *Weapon) DamageType() objects.Element
- func (w *Weapon) EquipReqs() []req.Requirement
- func (w *Weapon) ID() string
- func (w *Weapon) Level() int
- func (w *Weapon) Serial() string
- func (w *Weapon) SetSerial(s string)
- func (w *Weapon) Slots() []Slot
- func (w *Weapon) Update(delta int64)
- func (w *Weapon) UseAction() *useaction.UseAction
- func (w *Weapon) Value() int
Constants ¶
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Armor ¶
type Armor struct {
// contains filtered or unexported fields
}
Struct for armor items.
func (*Armor) EquipEffects ¶
EquipEffects returns armor equip effects
func (*Armor) EquipReqs ¶
func (a *Armor) EquipReqs() []req.Requirement
EquipReqs returns armor equip requirements.
type Equiper ¶
type Equiper interface { ID() string Serial() string EquipReqs() []req.Requirement Slots() []Slot }
Interface for 'equipable' items.
type Inventory ¶
type Inventory struct {
// contains filtered or unexported fields
}
Struct for container with items.
func (*Inventory) AddItem ¶
AddItems add specified item to inventory. Item will be marked as tradeable and lootable inside the inventory. Trade value will be set as the same as item value.
func (*Inventory) Apply ¶
func (i *Inventory) Apply(data res.InventoryData)
Apply applies specified data on the inventory.
func (*Inventory) Data ¶
func (i *Inventory) Data() res.InventoryData
Data creates data resource for inventory.
func (*Inventory) Item ¶
func (i *Inventory) Item(id, serial string) *InventoryItem
Item returns item with specified ID and serial from the inventory or nil if no such item was found.
func (*Inventory) Items ¶
func (i *Inventory) Items() (items []*InventoryItem)
Items returns all items in inventory.
func (*Inventory) RemoveItem ¶
RemoveItem removes specified item from inventory.
func (*Inventory) SetOnItemRemovedFunc ¶
SetOnItemRemoved sets function to trigger after removing item from the inventory.
type InventoryItem ¶
Struct for inventory items.
type Item ¶
type Item interface { serial.Serialer Value() int Level() int UseAction() *useaction.UseAction Update(d int64) }
Interface for items.
type Misc ¶
type Misc struct {
// contains filtered or unexported fields
}
Struct for miscellaneous items.
func (*Misc) Consumable ¶
Consumable checks if item should be deleted after use.
type Weapon ¶
type Weapon struct {
// contains filtered or unexported fields
}
Struct for weapons.
func NewWeapon ¶
func NewWeapon(data res.WeaponData) *Weapon
NewWeapon creates new weapon with specified parameters.
func (*Weapon) DamageEffects ¶
func (w *Weapon) DamageEffects() []res.EffectData
DamageEffects returns weapon hit effects.
func (*Weapon) DamageType ¶
DamageType retruns weapon damage type.
func (*Weapon) EquipReqs ¶
func (w *Weapon) EquipReqs() []req.Requirement
EquipReqs returns weapon equip requirements.