Show / Hide Table of Contents

Class ItemEquipTable

Represents items equipped by an entity. Provides helpers to equip/dequip items.

Inheritance
Object
ItemEquipTable
Namespace: DaggerfallWorkshop.Game.Items
Assembly: Assembly-CSharp.dll
Syntax
public class ItemEquipTable

Constructors

| Improve this Doc View Source

ItemEquipTable(DaggerfallEntity)

Declaration
public ItemEquipTable(DaggerfallEntity parentEntity)
Parameters
Type Name Description
DaggerfallEntity parentEntity

Properties

| Improve this Doc View Source

EquipTable

Gets current equip table.

Declaration
public DaggerfallUnityItem[] EquipTable { get; }
Property Value
Type Description
DaggerfallUnityItem[]
| Improve this Doc View Source

EquipTableLength

Gets length of equip table.

Declaration
public static int EquipTableLength { get; }
Property Value
Type Description
Int32

Methods

| Improve this Doc View Source

Clear()

Clears equip table. Does not unequip items, just wipes table. Used when clearing state for a new game.

Declaration
public void Clear()
| Improve this Doc View Source

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.

| Improve this Doc View Source

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.

| Improve this Doc View Source

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.

| Improve this Doc View Source

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
| Improve this Doc View Source

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.

| Improve this Doc View Source

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
| Improve this Doc View Source

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.

| Improve this Doc View Source

IsLowerClothed()

Quick test for legs cover.

Declaration
public bool IsLowerClothed()
Returns
Type Description
Boolean
| Improve this Doc View Source

IsSlotOpen(EquipSlots)

Checks if a slot is open.

Declaration
public bool IsSlotOpen(EquipSlots slot)
Parameters
Type Name Description
EquipSlots slot
Returns
Type Description
Boolean
| Improve this Doc View Source

IsUpperClothed()

Quick test for torso cover.

Declaration
public bool IsUpperClothed()
Returns
Type Description
Boolean
| Improve this Doc View Source

SerializeEquipTable()

Serialize equip table into list of equipped UIDs.

Declaration
public ulong[] SerializeEquipTable()
Returns
Type Description
UInt64[]

ulong array.

| Improve this Doc View Source

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.

| Improve this Doc View Source

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.

| Improve this Doc View Source

UnequipItem(EquipSlots, List<DaggerfallUnityItem>)

Declaration
public void UnequipItem(EquipSlots slot, List<DaggerfallUnityItem> list)
Parameters
Type Name Description
EquipSlots slot
List<DaggerfallUnityItem> list
  • Improve this Doc
  • View Source
In This Article
Back to top Generated by DocFX