ActionAdventureKit 1.7.3
|
generic base class for item slots, slots are used to equip items
the protected equip(T) and unequip(T) are most important for equipment behaviour
for example a helmet item on an amor slot may instantiate some visual and add a modifier to the characters defense in equip, in unequip it would destroy the visual and remove the modifier
canEquip can be overridden to define whether a specific item can be equipped at the moment, applyVisibility is used when a slot is hidden(like weapons being hidden while pulling a lever)
T |
T | : | ItemBase |
Public Member Functions | |
override void | Initialize (CharacterBase character) |
override bool | CanEquip (InventoryItem inventoryItem, bool clear=true) |
checks if an inventory item can be equipped | |
override void | Equip (InventoryItem inventoryItem) |
equips an inventory item(if another item is already equipped it is unequipped first) | |
override void | Clear () |
clears the slot of its currently equipped item | |
Public Member Functions inherited from AdventureCore.ItemSlotBase | |
virtual bool | CanEquipPrevious (bool clear=true) |
checks if the slot can switch its equipped item to the previous one in its characters inventory | |
virtual bool | EquipPrevious (bool clear=true) |
equips the previous item in its characters inventory | |
virtual bool | CanEquipNext (bool clear=true) |
checks if the slot can switch its equipped item to the next one in its characters inventory | |
virtual bool | EquipNext (bool clear=true) |
equips the next item in its characters inventory | |
virtual bool | CanClear () |
checks whether the slot can be cleared of its equipped items | |
virtual void | Show () |
shows the slot if it was hidden before | |
virtual void | Hide () |
hides the slot | |
virtual bool | CanUse (int quantity=1) |
checks if the equipped item can be used | |
virtual void | Use (int quantity=1) |
uses the equipped item | |
Public Attributes | |
T | FallbackItem |
Public Attributes inherited from AdventureCore.ItemSlotBase | |
string | Key |
ItemSlotCategory | Category |
int | Index |
Protected Member Functions | |
override void | onIsHiddenChanged () |
virtual bool | canEquip (T item) |
virtual void | equip (T item) |
virtual void | unequip (T item) |
virtual void | applyVisibility () |
Protected Member Functions inherited from AdventureCore.ItemSlotBase | |
virtual InventoryItem | getPrevious (bool clear=true) |
virtual InventoryItem | getNext (bool clear=true) |
virtual void | onEquippedInventoryItemChanged () |
virtual void | onIsInUseChanged () |
Properties | |
T | EquippedItem [get] |
override Type | ItemType [get] |
Properties inherited from AdventureCore.ItemSlotBase | |
virtual InventoryItem | EquippedInventoryItem [get] |
bool | IsHidden [get] |
virtual bool | IsInUse [get, set] |
Type | ItemType [get] |
CharacterBase | Character [get] |
Additional Inherited Members | |
Events inherited from AdventureCore.ItemSlotBase | |
Action< bool > | IsInUseChanged |
Action< bool > | IsHiddenChanged |
Action< InventoryItem > | EquippedInventoryItemChanged |
|
inlinevirtual |
checks if an inventory item can be equipped
inventoryItem | the inventory item to equip |
clear | whether clearing the slot by equipping null is valid |
Reimplemented from AdventureCore.ItemSlotBase.
|
inlinevirtual |
clears the slot of its currently equipped item
Reimplemented from AdventureCore.ItemSlotBase.
|
inlinevirtual |
equips an inventory item(if another item is already equipped it is unequipped first)
inventoryItem | the inventory item to equip |
Reimplemented from AdventureCore.ItemSlotBase.
|
inlinevirtual |
Reimplemented from AdventureCore.ItemSlotBase.
|
inlineprotectedvirtual |
Reimplemented from AdventureCore.ItemSlotBase.