Table of Contents

Class BuffAspect

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

Aspect of an entity that understands buffs.

public class BuffAspect : EntityAspect, IAspect<Entity>, IAspect
Inheritance
BaseAspect<Entity>
BuffAspect
Implements
IAspect<Entity>
Inherited Members
Extension Methods

Constructors

BuffAspect(EntityAspect, bool)

Initializes a new instance of the EntityAspect class with another aspect.

public BuffAspect(EntityAspect aspect, bool strict = true)

Parameters

aspect EntityAspect

The aspect to copy from.

strict bool

If true, the aspect will throw an exception if the entity is null.

Exceptions

ArgumentNullException

Thrown when the entity of the aspect is null.

BuffAspect(Entity, bool)

Initializes a new instance of the EntityAspect class with the specified entity.

public BuffAspect(Entity entity, bool strict = true)

Parameters

entity Entity

The entity to associate with this aspect.

strict bool

If true, the aspect will throw an exception if the entity is null.

Exceptions

ArgumentNullException

Thrown when the entity is null.

Properties

Queries

public static BuffQueries Queries { get; }

Property Value

BuffQueries

Methods

ApplyBuff(Entity, PrefabGUID, out Entity, float, bool)

Applies a buff to an entity with optional duration and persistence settings.

public static bool ApplyBuff(Entity target, PrefabGUID buff, out Entity buffEntity, float duration = 0, bool tryPersistThroughDeath = false)

Parameters

target Entity

Entity to apply the buff to.

buff PrefabGUID

The PrefabGUID of the buff to apply.

buffEntity Entity

Output parameter that receives the created buff entity.

duration float

Duration of the buff in seconds. 0 for infinite duration.

tryPersistThroughDeath bool

If true, the buff will attempt to persist through death.

Returns

bool

True if the buff was successfully applied, false otherwise.

ApplyCosmetic(Entity, PrefabGUID)

Applies a cosmetic buff to an entity and removes gameplay-related components.

public static void ApplyCosmetic(Entity entity, PrefabGUID visual)

Parameters

entity Entity

The entity to apply the cosmetic to.

visual PrefabGUID

The PrefabGUID of the cosmetic buff to apply.

CreateAndApply(Entity, out BuffAspect?, float, bool)

public bool CreateAndApply(Entity target, out BuffAspect? buffAspect, float duration = 0, bool tryPersistThroughDeath = false)

Parameters

target Entity
buffAspect BuffAspect
duration float
tryPersistThroughDeath bool

Returns

bool

HasBuff(Entity, PrefabGUID)

Checks if an entity has a specific buff.

public static bool HasBuff(Entity entity, PrefabGUID buff)

Parameters

entity Entity

The entity to check for the buff.

buff PrefabGUID

The PrefabGUID of the buff to check for.

Returns

bool

True if the entity has the specified buff, false otherwise.

Is(Entity)

public static bool Is(Entity entity)

Parameters

entity Entity

Returns

bool

Modify(BuffModificationTypes, bool)

Modifies a buff entity with specified modification types.

public void Modify(BuffModificationTypes buffModificationTypes, bool overwrite = false)

Parameters

buffModificationTypes BuffModificationTypes

The types of modifications to apply.

overwrite bool

If true, clears existing modifications before applying new ones.

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.

RemoveBuff(Entity, PrefabGUID)

Removes a specific buff from an entity.

public static void RemoveBuff(Entity entity, PrefabGUID guid)

Parameters

entity Entity

The entity to remove the buff from.

guid PrefabGUID

The PrefabGUID of the buff to remove.