Table of Contents

Class CharacterAspect

Namespace
RisingV.Core.Aspects
Assembly
RisingV.Core.dll

Character aspect in the game, providing access to character-specific data and functionality.

public class CharacterAspect : UnitAspect, IAspect<Entity>, IAspect
Inheritance
BaseAspect<Entity>
CharacterAspect
Implements
IAspect<Entity>
Inherited Members
Extension Methods

Constructors

CharacterAspect(EntityAspect, bool)

Initializes a new instance of the CharacterAspect class from an existing EntityAspect.

public CharacterAspect(EntityAspect aspect, bool strict = true)

Parameters

aspect EntityAspect

The existing EntityAspect to initialize from.

strict bool

If true, enforces strict type checking. Default is true.

CharacterAspect(Entity, bool)

Initializes a new instance of the CharacterAspect class from an Unity.Entities.Entity.

public CharacterAspect(Entity entity, bool strict = true)

Parameters

entity Entity

The Unity.Entities.Entity to initialize from.

strict bool

If true, enforces strict type checking. Default is true.

Properties

Equipment

Gets the equipment aspect of the character, if available.

public EquipmentAspect? Equipment { get; }

Property Value

EquipmentAspect

Level

Gets the level of the character, if available.

public override float? Level { get; }

Property Value

float?

Queries

public static CharacterQueries Queries { get; }

Property Value

CharacterQueries

Methods

AddItemToInventory(PrefabGUID, int, out Entity, int, bool, bool, bool)

Adds an item to an entity's inventory with optional equipping and dropping functionality.

public AddItemResponse AddItemToInventory(PrefabGUID guid, int amount, out Entity entity, int startSlot = 0, bool dropRemainder = true, bool tryEquip = true, bool onlyFillEmptySlots = false)

Parameters

guid PrefabGUID

The prefab GUID of the item to add.

amount int

The quantity of items to add.

entity Entity

Output parameter that receives the newly created item entity.

startSlot int

The inventory slot to place the item in. Default is 0.

dropRemainder bool

If true, drops excess items that don't fit in inventory. Default is true.

tryEquip bool

If true, attempts to equip the item after adding. Default is true.

onlyFillEmptySlots bool

If true, Will only fill empty slots and not auto stack. Default false.

Returns

AddItemResponse

True if the item was successfully added to the inventory, false otherwise.

ClearInventory()

Clears the inventory of a specified entity.

public void ClearInventory()

GetBloodBuffInfo()

Gets the blood buff information for the character, if available.

public BloodBuffInfo? GetBloodBuffInfo()

Returns

BloodBuffInfo

A ProjectM.UI.BloodBuffInfo object containing the blood buff information, or null if not available.

GetDurabilityInfo(EquipmentType)

Gets the durability information for a specified equipment type.

public DurabilityInfo? GetDurabilityInfo(EquipmentType equipmentType)

Parameters

equipmentType EquipmentType

The type of equipment to retrieve durability information for.

Returns

DurabilityInfo?

A ProjectM.UI.DurabilityInfo object containing the durability information, or null if not available.

GetInventoryItems(int)

Gets the inventory items of the character at a specified index.

public List<InventoryItemData>? GetInventoryItems(int index = 0)

Parameters

index int

The index of the inventory to retrieve items from. Default is 0.

Returns

List<InventoryItemData>

A list of inventory items, or null if the inventory entity is not found.

GetItemSetInfo(PrefabGUID)

Gets the item set information for a specified prefab GUID.

public ItemSetInfo GetItemSetInfo(PrefabGUID prefabGuid)

Parameters

prefabGuid PrefabGUID

The prefab GUID to retrieve item set information for.

Returns

ItemSetInfo

A ProjectM.UI.ItemSetInfo object containing the item set information, or null if not available.

GetSlotCounts()

public (int freeSlots, int totalSlots) GetSlotCounts()

Returns

(int freeSlots, int totalSlots)

GetStashes(bool)

Gets the stashes of the character, optionally filtering by allied only.

public IEnumerable<InventoryAspect> GetStashes(bool alliedOnly = false)

Parameters

alliedOnly bool

If true, only retrieves stashes that are allied. Default is false.

Returns

IEnumerable<InventoryAspect>

An enumerable collection of InventoryAspect representing the stashes.

GetUnlockInfo(PrefabGUID)

Gets the unlock information for a specified prefab GUID.

public UnlockInfo? GetUnlockInfo(PrefabGUID prefabGuid)

Parameters

prefabGuid PrefabGUID

The prefab GUID to retrieve unlock information for.

Returns

UnlockInfo

A ProjectM.UI.UnlockInfo object containing the unlock information, or null if not available.

Is(Entity)

public static bool Is(Entity entity)

Parameters

entity Entity

Returns

bool

Qualifies(Entity)

Checks if the entity qualifies for this aspect.

public override bool Qualifies(Entity entity)

Parameters

entity Entity

Returns

bool

Returns true if the entity qualifies, otherwise false.

TryGiveItem(PrefabGUID, int, out Entity)

Attempts to give an item to the character's inventory.

public bool TryGiveItem(PrefabGUID itemGuid, int amount, out Entity itemEntity)

Parameters

itemGuid PrefabGUID

The prefab GUID of the item to give.

amount int

The quantity of the item to give.

itemEntity Entity

Output parameter that receives the newly created item entity.

Returns

bool

True if the item was successfully given, false otherwise.