API

Assembly: Spark.Combat Interface: ICombatPlugin Implementation: CombatPlugin

Interface

public interface ICombatPlugin
{
    // Ability execution
    void ExecuteAbility(GameObject caster, AbilityEntry actionEntry,
        CombatContext context);
    void ApplyEffectsToTargets(CombatContext context, List<GameObject> targets);

    // Type registration
    void RegisterAbilityType(Type abilityType, CombatTypeInfo info);
    void RegisterEffectType(Type effectType, CombatTypeInfo info);
    IReadOnlyDictionary<string, CombatTypeInfo> GetRegisteredAbilityTypes();
    IReadOnlyDictionary<string, CombatTypeInfo> GetRegisteredEffectTypes();
    AbilityTypeBase CreateAbilityTypeInstance(string typeId);
    EffectTypeBase CreateEffectTypeInstance(string typeId);

    // Stat system
    StatModificationBuilder Modify(GameObject target);
    StatModificationBuilder Modify(StatEntity statEntity);
    float GetValue(GameObject target, string statId, string propertyId);
    float GetValue(StatEntity statEntity, string statId, string propertyId);
    void ApplyModifier(GameObject target, StatModifierEntry statModifier);
    void RemoveModifier(GameObject target, StatModifierEntry statModifier);
    List<StatEntry> GetAllStatEntries();
    void ClearStatEntriesCache();
    StatEntry GetStatEntry(string statId);
}

CombatContext

Carries data through the ability execution pipeline.

Property
Type
Description

CasterEntity

SparkEntity

Entity casting the ability

AbilityEntry

AbilityEntry

The ability being executed

TargetPosition

Vector3

World position target

TargetEntity

SparkEntity

Single target entity

HitTargets

List<SparkEntity>

All entities hit

StatModificationBuilder

Fluent API for applying stat changes.

Key Database Entries

AbilityEntry

Defines an ability with a targeting type and activation type. See Ability Types for the full list of targeting and activation types.

StatEntry

Defines a character stat (health, mana, strength, etc.) with associated properties.

StatModifierEntry

Defines a reusable stat modification (buff, debuff, equipment bonus).

DamageTypeEntry / HealingTypeEntry

Define damage and healing categories with associated scaling.

FactionEntry

Defines NPC factions with relationship data.

StatusTagEntry

Tags for status effects (stunned, burning, frozen, etc.).

Abstract Base Classes

AbilityTypeBase

Base for ability targeting types. Override to create custom targeting behavior.

EffectTypeBase

Base for ability effects. Override to create custom damage, healing, or utility effects.

StatDataAsset

Abstract base for stat-specific nested data (ValueStatDataAsset, ResourceStatDataAsset, etc.).

AbilityDataAsset

Abstract base for ability execution configuration (TargetAbilityDataAsset, AoEAbilityDataAsset, ProjectileAbilityDataAsset, etc.).

EffectDataAsset

Abstract base for effect execution configuration.

Events

Event
Description

AbilityExecutedEvent

Ability finished executing (targets, success)

AbilityHitEvent

Ability hit targets with effects

StatModificationEvent

Single stat modified (target, stat, value, type)

BatchStatModificationEvent

Multiple stats modified at once

StatusAppliedEvent

Status effect applied

StatusRemovedEvent

Status effect removed

StatusRefreshedEvent

Status effect duration refreshed

StatusTickEvent

Status effect ticked

StatusImmuneEvent

Target immune to status

RevivePlayerRequestedEvent

Player revival requested

TargetLockedEvent

Target lock acquired

TargetUnlockedEvent

Target lock released

Commands

Command
Description

ModifyStatCommand

Modify a stat on a target entity

RemoveModifierCommand

Remove a stat modifier

Components

Component
Description

StatEntity

Manages stat values on a GameObject

ObjectCombatEntity

Combat identity and faction on a GameObject

CombatInputTriggerSlot

Input binding for ability execution

ThirdPersonTargetLock

Target lock-on system

CharacterControllerKnockbackReceiver

Knockback physics

Usage

Last updated

Was this helpful?