Class ItemEquipTable
Represents items equipped by an entity. Provides helpers to equip/dequip items.
Namespace: DaggerfallWorkshop.Game.Items
Assembly: Assembly-CSharp.dll
Syntax
public class ItemEquipTable
Constructors
| Improve this Doc View SourceItemEquipTable(DaggerfallEntity)
Declaration
public ItemEquipTable(DaggerfallEntity parentEntity)
Parameters
Type | Name | Description |
---|---|---|
DaggerfallEntity | parentEntity |
Properties
| Improve this Doc View SourceEquipTable
Gets current equip table.
Declaration
public DaggerfallUnityItem[] EquipTable { get; }
Property Value
Type | Description |
---|---|
DaggerfallUnityItem[] |
EquipTableLength
Gets length of equip table.
Declaration
public static int EquipTableLength { get; }
Property Value
Type | Description |
---|---|
Int32 |
Methods
| Improve this Doc View SourceClear()
Clears equip table. Does not unequip items, just wipes table. Used when clearing state for a new game.
Declaration
public void Clear()
DeserializeEquipTable(UInt64[], ItemCollection)
Deserialize equip table and attempt to relink equipped items in collection. Item UID must exist inside collection provided or entry will not be restored and item not equipped.
Declaration
public void DeserializeEquipTable(ulong[] data, ItemCollection items)
Parameters
Type | Name | Description |
---|---|---|
UInt64[] | data | UID array exactly this.equipTableLength in length. |
ItemCollection | items | Item collection. |
EquipItem(DaggerfallUnityItem, Boolean, Boolean)
Attempt to equip item.
Declaration
public List<DaggerfallUnityItem> EquipItem(DaggerfallUnityItem item, bool alwaysEquip = true, bool playEquipSounds = true)
Parameters
Type | Name | Description |
---|---|---|
DaggerfallUnityItem | item | Item to equip. |
Boolean | alwaysEquip | Always equip item, replacing another in the same slot if needed. |
Boolean | playEquipSounds |
Returns
Type | Description |
---|---|
List<DaggerfallUnityItem> | True when item equipped, otherwise false. |
GetEquipSlot(DaggerfallUnityItem)
Get the equipment slot this items belongs in. Not currently 100% known how Daggerfall defines equipment slots. This method uses the best available knowledge at time of writing. When item supports multiple slots:
- If a slot is open, returns first free slot.
- If both slots populated, returns first slot by order.
Declaration
public EquipSlots GetEquipSlot(DaggerfallUnityItem item)
Parameters
Type | Name | Description |
---|---|---|
DaggerfallUnityItem | item | Item to find equipment slot. |
Returns
Type | Description |
---|---|
EquipSlots | EquipSlot. |
GetFirstSlot(EquipSlots, EquipSlots)
Returns first open slot or just first slot if both populated. This follows Daggerfall's behaviour for multi-slot items.
Declaration
public EquipSlots GetFirstSlot(EquipSlots slot1, EquipSlots slot2)
Parameters
Type | Name | Description |
---|---|---|
EquipSlots | slot1 | |
EquipSlots | slot2 |
Returns
Type | Description |
---|---|
EquipSlots |
GetItem(EquipSlots)
Gets item equipped to slot.
Declaration
public DaggerfallUnityItem GetItem(EquipSlots slot)
Parameters
Type | Name | Description |
---|---|---|
EquipSlots | slot | Slot to check. |
Returns
Type | Description |
---|---|
DaggerfallUnityItem | Item present in slot, otherwise null. |
GetItemHands(DaggerfallUnityItem)
Gets how item is held in the hands. Item templates define whether item is 1 or 2 handed, but this method provides more exact information about which hand item can be used in.
Declaration
public static ItemHands GetItemHands(DaggerfallUnityItem item)
Parameters
Type | Name | Description |
---|---|---|
DaggerfallUnityItem | item |
Returns
Type | Description |
---|---|
ItemHands |
IsEquipped(DaggerfallUnityItem)
Checks if an item is currently equipped.
Declaration
public bool IsEquipped(DaggerfallUnityItem item)
Parameters
Type | Name | Description |
---|---|---|
DaggerfallUnityItem | item | Item to check. |
Returns
Type | Description |
---|---|
Boolean | True if item is equipped. |
IsLowerClothed()
Quick test for legs cover.
Declaration
public bool IsLowerClothed()
Returns
Type | Description |
---|---|
Boolean |
IsSlotOpen(EquipSlots)
Checks if a slot is open.
Declaration
public bool IsSlotOpen(EquipSlots slot)
Parameters
Type | Name | Description |
---|---|---|
EquipSlots | slot |
Returns
Type | Description |
---|---|
Boolean |
IsUpperClothed()
Quick test for torso cover.
Declaration
public bool IsUpperClothed()
Returns
Type | Description |
---|---|
Boolean |
SerializeEquipTable()
Serialize equip table into list of equipped UIDs.
Declaration
public ulong[] SerializeEquipTable()
Returns
Type | Description |
---|---|
UInt64[] | ulong array. |
UnequipItem(DaggerfallUnityItem)
Attempt to unequip a specific item.
Declaration
public bool UnequipItem(DaggerfallUnityItem item)
Parameters
Type | Name | Description |
---|---|---|
DaggerfallUnityItem | item | Item to unequip. |
Returns
Type | Description |
---|---|
Boolean | True if item was found to be equipped and was unequipped. |
UnequipItem(EquipSlots)
Attempt to unequip item from slot.
Declaration
public DaggerfallUnityItem UnequipItem(EquipSlots slot)
Parameters
Type | Name | Description |
---|---|---|
EquipSlots | slot | Slot to unequip. |
Returns
Type | Description |
---|---|
DaggerfallUnityItem | The item unequipped, otherwise null. |
UnequipItem(EquipSlots, List<DaggerfallUnityItem>)
Declaration
public void UnequipItem(EquipSlots slot, List<DaggerfallUnityItem> list)
Parameters
Type | Name | Description |
---|---|---|
EquipSlots | slot | |
List<DaggerfallUnityItem> | list |