Loading...
Searching...
No Matches
AdventureCore.DurableEquipmentItem Class Reference

Detailed Description

special equipment item that has a "Durability" float value
if that value falls to 0 the item is unequipped and cant be equipped again

https://adventure.softleitner.com/manual/item

Inheritance diagram for AdventureCore.DurableEquipmentItem:
AdventureCore.EquipmentItem AdventureCore.PrefabItem AdventureCore.IAttributeModifier AdventureCore.IStatModifier AdventureCore.ItemBase

Public Member Functions

override T OnValueChanging< T > (InventoryBase inventory, InventoryItem inventoryItem, string key, T value)
 called whenever an item value is about to change
gives the item a chance to change the new value or react to the change
for example by enforcing bounds or by unequipping the item
 
override void OnAdded (InventoryBase inventory, InventoryItem inventoryItem)
 called when a new inventory item of the item is created in an inventory
 
override bool CanEquip (CharacterBase character, InventoryItem inventoryItem)
 checks if the item can be equipped on a character
 
- Public Member Functions inherited from AdventureCore.EquipmentItem
override bool CanEquip (CharacterBase character, InventoryItem inventoryItem)
 checks if the item can be equipped on a character
 
override void OnEquip (CharacterBase character, InventoryItem inventoryItem)
 called when the item gets equipped on a character
can be used to apply effects like attribute modifications
 
override void OnUnequip (CharacterBase character, InventoryItem inventoryItem)
 called when the item gets unequipped from a character
can be used to remove effects like attribute modifications
 
int Modify (AttributeStat stat, int value)
 applies the modification
 
- Public Member Functions inherited from AdventureCore.ItemBase
virtual ? bool CanAdd (InventoryBase inventory, int quantity=1, bool fully=true)
 checks if a quantity can be added in cases where the adding is handled by OnAdd(InventoryBase, int, out int)
 
virtual bool OnAdd (InventoryBase inventory, int quantity, out int remaining)
 signals to the item that a quantity of it is about to be added to an inventory
gives the item a chance to interfere in that process and do something else instead
for example items that added different items or are used instead of being added
 
virtual ? bool CanRemove (InventoryBase inventory, InventoryItem inventoryItem, int quantity=1, bool fully=true)
 checks if a quantity can be added in cases where the adding is handled by OnAdd(InventoryBase, int, out int)
 
virtual void OnRemoved (InventoryBase inventory, InventoryItem inventoryItem)
 signals to the item that a quantity of it has been removed from an inventory
 
virtual bool CanUse (CharacterBase character, InventoryItem inventoryItem, int quantity=1)
 checks if the specified quantity of the item can be used on a character
 
virtual bool OnUse (CharacterBase character, InventoryItem inventoryItem, int quantity=1)
 uses a quantity of the item on a character
 
void Add (CharacterBase character)
 adds one of this item to a character, this method can be called from events in the inspector by dragging the item into the target
 
void Remove (CharacterBase character)
 removes one of this item from a character, this method can be called from events in the inspector by dragging the item into the target
 
void Add (CharacterActionBase action)
 adds one of this item to the character currently associated with an action, this method can be called from events in the inspector by dragging the item into the target
 
void Remove (CharacterActionBase action)
 removes one of this item from the character currently associated with an action, this method can be called from events in the inspector by dragging the item into the target
 
override string ToString ()
 

Public Attributes

string ValueKey = "Durability"
 
float ValueMaximum = 1f
 
float ValueMinimum = 0f
 
- Public Attributes inherited from AdventureCore.EquipmentItem
AttributeValue[] AttributeRequirements
 
AttributeValue[] StatRequirements
 
AttributeValue[] AttributeValues
 
AttributeStatValue[] StatValues
 
EffectType[] Effects
 
CharacterInstructionBase[] Instructions
 
- Public Attributes inherited from AdventureCore.PrefabItem
Transform Prefab
 
- Public Attributes inherited from AdventureCore.ItemBase
string Key
 
string Name
 
string Description
 
Sprite Image
 
GameObject Visual
 
ItemCategory Category
 
ItemSlotCategory Slot
 

Additional Inherited Members

- Properties inherited from AdventureCore.EquipmentItem
override bool IsEquippable [get]
 
- Properties inherited from AdventureCore.PrefabItem
override bool IsEquippable [get]
 
- Properties inherited from AdventureCore.ItemBase
virtual bool IsStackable [get]
 whether whether multiple items can be stacked in one inventory item
 
virtual bool IsEquippable [get]
 whether the item can be equipped to a slot
 
virtual bool IsUsable [get]
 whether the item can be used
 
- Properties inherited from AdventureCore.IAttributeModifier
- Properties inherited from AdventureCore.IStatModifier

Member Function Documentation

◆ CanEquip()

override bool AdventureCore.DurableEquipmentItem.CanEquip ( CharacterBase character,
InventoryItem inventoryItem )
inlinevirtual

checks if the item can be equipped on a character

Parameters
characterthe character the item may be equipped on
inventoryItemthe inventory item to equip
Returns
true if the item may be equipped

Reimplemented from AdventureCore.ItemBase.

◆ OnAdded()

override void AdventureCore.DurableEquipmentItem.OnAdded ( InventoryBase inventory,
InventoryItem inventoryItem )
inlinevirtual

called when a new inventory item of the item is created in an inventory

Parameters
inventorythe inventory the item has been added to
inventoryItemthe new inventory item

Reimplemented from AdventureCore.ItemBase.

◆ OnValueChanging< T >()

override T AdventureCore.DurableEquipmentItem.OnValueChanging< T > ( InventoryBase inventory,
InventoryItem inventoryItem,
string key,
T value )
inlinevirtual

called whenever an item value is about to change
gives the item a chance to change the new value or react to the change
for example by enforcing bounds or by unequipping the item

Template Parameters
T
Parameters
inventorythe inventory they contains the item
inventoryItemthe entry in the inventory they is changing
keykey of the item value that is changing
valuethe new value that is about to be assigned
Returns
the potentially modified value

Reimplemented from AdventureCore.ItemBase.