Table of Contents

Class CounterDamageGameActionSO<TContext>

Namespace
ElectricDrill.AstraHealth.GameActions.Actions
Assembly
com.electricdrill.astra-health.Runtime.dll

Abstract base game action that reacts to a resolved damage event by inflicting damage in return. Works with any context implementing ElectricDrill.AstraRpgFramework.Contexts.IHasTarget, ElectricDrill.AstraRpgFramework.Contexts.IHasPerformer and IHasAmount: compatible with DamageResolutionContext, EntityDiedContext, and others.

This class implements ElectricDrill.AstraRpgFramework.Contexts.IEffectInstigator so it can be passed as the instigator of the counter-damage it produces. Listeners can then check ctx.Instigator == thisActionSO to identify and filter self-triggered cycles.

public abstract class CounterDamageGameActionSO<TContext> : GameAction<TContext>, IExecutable<TContext>, ITaggable, IEffectInstigator where TContext : IHasTarget, IHasPerformer, IHasInstigator, IHasAmount, IReactable

Type Parameters

TContext

Context type implementing ElectricDrill.AstraRpgFramework.Contexts.IHasTarget, ElectricDrill.AstraRpgFramework.Contexts.IHasPerformer, ElectricDrill.AstraRpgFramework.Contexts.IHasInstigator and IHasAmount.

Inheritance
object
GameActionBase
GameAction<TContext>
CounterDamageGameActionSO<TContext>
Implements
IExecutable<TContext>
ITaggable
IEffectInstigator
Derived
Inherited Members
GameAction<TContext>.Tags
GameAction<TContext>.DisplayName
GameAction<TContext>.ExecuteAsyncForUnityEvent(TContext)
GameAction<TContext>.OnOperationCanceled()

Methods

ExecuteAsync(TContext, CancellationToken)

Executes the action asynchronously with the provided context. Override this method to implement your action logic.

public override Awaitable ExecuteAsync(TContext context, CancellationToken cancellationToken = default)

Parameters

context TContext

The context object containing information needed for execution.

cancellationToken CancellationToken

Token to cancel the operation. MonoBehaviour owners can use their "destroyCancellationToken" to automatically cancel when destroyed.

Returns

Awaitable

An Awaitable that completes when the action finishes.