Search Results for

    Show / Hide Table of Contents

    Class AbilityInstance

    Ability instance is an instance of spell / ability / skill, usually cast by an entity.
    e.g. Flying fireball, basic attack projectiles, meteor rain spawner

    Inheritance
    object
    UnityEngine.Object
    UnityEngine.Component
    UnityEngine.Behaviour
    UnityEngine.MonoBehaviour
    Mirror.NetworkBehaviour
    DewNetworkBehaviour
    Actor
    AbilityInstance
    DamageInstance
    MeleeAttackInstance
    MockAbilityInstance
    PickupInstance
    Projectile
    PunishmentInstance
    StatusEffect
    Implements
    ILogicUpdate
    ICleanup
    ICustomDestroyRoutine
    Inherited Members
    Actor.TrackKills(float, Action<EventInfoKill>)
    Actor.CustomRpc_RegisterClientMessageHandler<T>(Action<T>)
    Actor.CustomRpc_ClearClientMessageHandlers()
    Actor.CustomRpc_UnregisterClientMessageHandler<T>()
    Actor.CustomRpc_UnregisterClientMessageHandler<T>(Action<T>)
    Actor.CustomRpc_RegisterServerMessageHandler<T>(Action<T>)
    Actor.CustomRpc_RegisterServerMessageHandler<T>(string, Action<T, DewPlayer>)
    Actor.CustomRpc_ClearServerMessageHandlers()
    Actor.CustomRpc_UnregisterServerMessageHandler<T>()
    Actor.CustomRpc_UnregisterServerMessageHandler<T>(Action<T>)
    Actor.CustomRpc_UnregisterServerMessageHandler<T>(Action<T, DewPlayer>)
    Actor.CustomRpc_SendMessageToServer<T>(T)
    Actor.CustomRpc_SendMessageToClient<T>(DewPlayer, T)
    Actor.CustomRpc_SendMessageToAllClients<T>(T)
    Actor.ActorEvent_OnAbilityInstanceCreated
    Actor.ActorEvent_OnAbilityInstanceBeforePrepare
    Actor.ActorEvent_OnDealDamage
    Actor.ActorEvent_OnDoHeal
    Actor.ActorEvent_OnDoManaHeal
    Actor.ActorEvent_OnSpendMana
    Actor.ActorEvent_OnKill
    Actor.ActorEvent_OnAttackHit
    Actor.ActorEvent_OnAttackEffectTriggered
    Actor.ActorEvent_OnSpawnSummon
    Actor.ActorEvent_OnApplyElemental
    Actor.ActorEvent_OnGiveShield
    Actor.ClientActorEvent_OnDestroyed
    Actor.ClientActorEvent_OnCreate
    Actor.DoHeal(HealData, Entity, ReactionChain)
    Actor.DoManaHeal(HealData, Entity, ReactionChain)
    Actor.DefaultDamage(float, float)
    Actor.PhysicalDamage(float, float)
    Actor.MagicDamage(float, float)
    Actor.PureDamage(float, float)
    Actor.CreateDamage(DamageData.SourceType, float, float)
    Actor.Heal(float)
    Actor.DealDamage(DamageData, Entity, ReactionChain)
    Actor.DoBasicAttackHit(Entity, bool, bool, float, float)
    Actor.TriggerAttackEffects(Entity, float, AttackEffectType, ReactionChain)
    Actor.RefundMana(float, Entity)
    Actor.SpendMana(float, Entity)
    Actor.CreateAbilityInstance<T>(T, Vector3, Quaternion?, CastInfo, Action<T>)
    Actor.CreateAbilityInstance<T>(Vector3, Quaternion?, CastInfo, Action<T>)
    Actor.CreateAbilityInstance(Type, Vector3, Quaternion?, CastInfo, Action<AbilityInstance>)
    Actor.CreateStatusEffect<T>(T, Entity, CastInfo, Action<T>)
    Actor.CreateStatusEffect<T>(Entity, CastInfo, Action<T>)
    Actor.CreateStatusEffect(Type, Entity, CastInfo, Action<StatusEffect>)
    Actor.GiveShield(Entity, float, float, bool, ReactionChain)
    Actor.CreateActor<T>(Vector3, Quaternion?, Action<T>)
    Actor.CreateActor<T>(T, Vector3, Quaternion?, Action<T>)
    Actor.SpawnEntity<T>(Vector3, Quaternion?, DewPlayer, int, Action<T>)
    Actor.SpawnEntity<T>(T, Vector3, Quaternion?, DewPlayer, int, Action<T>)
    Actor.Teleport(Entity, Vector3)
    Actor.ShowOnScreenTimerLocally(OnScreenTimerHandle)
    Actor.HideOnScreenTimerLocally(OnScreenTimerHandle)
    Actor.ApplyElemental(ElementalType, Entity, int)
    Actor.KilledByUnstoppableEffects
    Actor.ScaleDurationByTenacityEffects
    Actor.CreateBasicEffect(Entity, BasicEffect, float, string, DuplicateEffectBehavior)
    Actor.SpawnSummon<T>(Vector3, Quaternion?, Action<T>)
    Actor.ApplyCooldownReduction(AbilityTrigger, float, bool, bool)
    Actor.ApplyCooldownReductionByRatio(AbilityTrigger, float, bool)
    Actor.ResetCooldown(AbilityTrigger, bool)
    Actor.ApplyCooldownReductionByRatio(AbilityTrigger, CooldownReductionByRatioSettings)
    Actor.ApplyCooldownReduction(AbilityTrigger, CooldownReductionSettings)
    Actor.dealtDamageProcessor
    Actor.dealtHealProcessor
    Actor.dealtManaHealProcessor
    Actor.dealtShieldProcessor
    Actor.dealtCooldownReductionProcessor
    Actor.dealtCooldownReductionByRatioProcessor
    Actor.spawnedChildVarDefProcessor
    Actor.ProcessShieldAmount(float, Entity)
    Actor.ProcessSpawnedChildVarDefProcessor(ref VariantDef, Type)
    Actor.persistentData
    Actor.persistentSyncedData
    Actor.ClientEvent_OnPersistentSyncedDataChanged
    Actor.OnCreate_ActorData()
    Actor.HasData<T>()
    Actor.RemoveData<T>()
    Actor.RemoveData(object)
    Actor.AddData<T>(T)
    Actor.TryGetData<T>(out T)
    Actor.GetData<T>()
    Actor.FindData<T>(Predicate<T>)
    Actor.TryFindData<T>(Predicate<T>, out T)
    Actor.isDestroyedOnRoomChange
    Actor.isNewInstance
    Actor.creationTime
    Actor.persistentNetId
    Actor.isDestroyLocked
    Actor.parentActor
    Actor.position
    Actor.rotation
    Actor.chainTempName
    Actor.children
    Actor.childrenInNetwork
    Actor.Awake()
    Actor.OnStartServer()
    Actor.OnStartClient()
    Actor.FrameUpdate()
    Actor.ActiveFrameUpdate()
    Actor.ActiveLogicUpdate(float)
    Actor.ToString()
    Actor.CustomDestroyRoutine()
    Actor.ICleanup.canDestroy
    Actor.ICleanup.OnCleanup()
    Actor.isActive
    Actor.isDestroyed
    Actor.OnStopServer()
    Actor.OnStopClient()
    Actor.OnEnable()
    Actor.OnDisable()
    Actor.ShouldBeSavedWithRoom()
    Actor.ICustomDestroyRoutine.CustomDestroyRoutine()
    Actor.GetNetworkAuthorityConnection()
    Actor.GetOriginalName()
    Actor.parentActorNetId
    Actor.ancestors
    Actor.firstEntity
    Actor.firstTrigger
    Actor.IsDescendantOf(Actor)
    Actor.IsDescendantOf<T>()
    Actor.FindFirstAncestorOfType<T>()
    Actor.FindFirstOfType<T>()
    Actor.Destroy()
    Actor.DestroyIfActive()
    Actor.LockDestroy()
    Actor.UnlockDestroy()
    Actor.IsExcludedFromRoomSave()
    Actor.ExcludeFromRoomSave()
    Actor.ClearExcludeFromRoomSave()
    DewNetworkBehaviour.FxPlayNewNetworked(GameObject, Vector3, Quaternion?)
    DewNetworkBehaviour.FxPlayNewNetworked(GameObject, Entity)
    DewNetworkBehaviour.FxPlayNewNetworked(GameObject, Entity, Vector3, Quaternion?)
    DewNetworkBehaviour.FxPlayNewNetworked(GameObject)
    DewNetworkBehaviour.FxPlayNetworked(GameObject)
    DewNetworkBehaviour.FxPlayNetworked(GameObject, Vector3, Quaternion?)
    DewNetworkBehaviour.FxPlayNetworked(GameObject, Entity)
    DewNetworkBehaviour.FxPlayNetworked(GameObject, Entity, Vector3, Quaternion?)
    DewNetworkBehaviour.FxStopNetworked(GameObject)
    DewNetworkBehaviour.FxPlayNew(GameObject)
    DewNetworkBehaviour.FxPlayNew(GameObject, Vector3, Quaternion?)
    DewNetworkBehaviour.FxPlayNew(GameObject, Entity)
    DewNetworkBehaviour.FxPlayNew(GameObject, Entity, Vector3, Quaternion?)
    DewNetworkBehaviour.FxPlay(GameObject)
    DewNetworkBehaviour.FxPlay(GameObject, Vector3, Quaternion?)
    DewNetworkBehaviour.FxPlay(GameObject, Entity)
    DewNetworkBehaviour.FxPlay(GameObject, Entity, Vector3, Quaternion?)
    DewNetworkBehaviour.FxStop(GameObject)
    DewNetworkBehaviour.FxApplySpeedMultiplier(GameObject, float)
    DewNetworkBehaviour.FxApplySpeedMultiplierNetworked(GameObject, float)
    DewNetworkBehaviour.InvalidateInstance()
    DewNetworkBehaviour.OnLateStart()
    DewNetworkBehaviour.OnLateStartServer()
    DewNetworkBehaviour.OnStop()
    DewNetworkBehaviour.OnDestroy()
    DewNetworkBehaviour.GetComponent<T>(out T)
    Namespace: Global
    Assembly: Dew.Core.dll
    Syntax
    [LogicUpdatePriority(-200)]
    public abstract class AbilityInstance : Actor, ILogicUpdate, ICleanup, ICustomDestroyRoutine

    Fields

    budgetCost

    Declaration
    [BoxGroup("Ability Instance Settings", true, false, 0)]
    public int budgetCost
    Field Value
    Type Description
    int

    chain

    If this instance is part of reaction, you can provide ReactionChain in this variable. Available only on server.

    Declaration
    [NonSerialized]
    public ReactionChain chain
    Field Value
    Type Description
    ReactionChain

    currentCostSum

    Declaration
    public static int currentCostSum
    Field Value
    Type Description
    int

    currentCostSumPerPlayer

    Declaration
    public static Dictionary<DewPlayer, int> currentCostSumPerPlayer
    Field Value
    Type Description
    System.Collections.Generic.Dictionary<TKey, TValue><DewPlayer, int>

    endEffect

    Declaration
    [BoxGroup("Ability Instance Settings", true, false, 0)]
    [LabelText("End Effect (Attached To Caster)")]
    public GameObject endEffect
    Field Value
    Type Description
    UnityEngine.GameObject

    maxBudget

    Declaration
    public static int maxBudget
    Field Value
    Type Description
    int

    startEffect

    Declaration
    [BoxGroup("Ability Instance Settings", true, false, 0)]
    [LabelText("Loop Effect (Attached To Caster)")]
    public GameObject startEffect
    Field Value
    Type Description
    UnityEngine.GameObject

    startEffectNoStop

    Declaration
    [BoxGroup("Ability Instance Settings", true, false, 0)]
    [LabelText("Start Effect (Attached To Caster)")]
    public GameObject startEffectNoStop
    Field Value
    Type Description
    UnityEngine.GameObject

    tvDefaultAllExceptSelf

    Declaration
    protected AbilityTargetValidatorWrapper tvDefaultAllExceptSelf
    Field Value
    Type Description
    AbilityTargetValidatorWrapper

    tvDefaultHarmfulEffectTargets

    Declaration
    protected AbilityTargetValidatorWrapper tvDefaultHarmfulEffectTargets
    Field Value
    Type Description
    AbilityTargetValidatorWrapper

    tvDefaultUsefulEffectTargets

    Declaration
    protected AbilityTargetValidatorWrapper tvDefaultUsefulEffectTargets
    Field Value
    Type Description
    AbilityTargetValidatorWrapper

    useBudgetSystem

    Declaration
    public static bool useBudgetSystem
    Field Value
    Type Description
    bool

    Properties

    budgetPressure

    Returns current budget pressure. Costly ability instances must adjust their resource spending according to this value.
    Requires budgetCost to be set to non-zero value.

    Declaration
    public BudgetPressure budgetPressure { get; }
    Property Value
    Type Description
    BudgetPressure

    effectiveLevel

    Declaration
    public int effectiveLevel { get; }
    Property Value
    Type Description
    int

    gem

    If this instance is from a gem, you can access the gem from here.

    Declaration
    public Gem gem { get; set; }
    Property Value
    Type Description
    Gem

    hasOngoingSequences

    Declaration
    public bool hasOngoingSequences { get; }
    Property Value
    Type Description
    bool

    info

    Declaration
    [SaveVar(SaveVarFlags.Default)]
    public CastInfo info { get; set; }
    Property Value
    Type Description
    CastInfo

    skillLevel

    Level of its origin skill trigger at the time this instance was cast. Defaults to -1 or that of parent's level.

    Parent type can either be SkillTrigger, AbilityInstance, or Gem.

    You can override level by setting this field when the instance is preparing.

    Declaration
    [SaveVar(SaveVarFlags.Default)]
    public int skillLevel { get; set; }
    Property Value
    Type Description
    int

    statEntity

    Declaration
    public Entity statEntity { get; }
    Property Value
    Type Description
    Entity

    Methods

    Budget_ShouldDoFullCalculations()

    Should this instance skip calculations? Based on current budget pressure.
    Use this as a default suggested behavior.

    Declaration
    public bool Budget_ShouldDoFullCalculations()
    Returns
    Type Description
    bool

    Budget_ShouldPlayEffects()

    Should this instance play effects? Based on current budget pressure.
    Use this as a default suggested behavior.

    Declaration
    public bool Budget_ShouldPlayEffects()
    Returns
    Type Description
    bool

    CreateDamage(SourceType, ScalingValue, float)

    Declaration
    public DamageData CreateDamage(DamageData.SourceType type, ScalingValue value, float procCoefficient = 1)
    Parameters
    Type Name Description
    DamageData.SourceType type
    ScalingValue value
    float procCoefficient
    Returns
    Type Description
    DamageData

    CreateStatusEffect<T>(T, Entity, Action<T>)

    Create a new status effect and attach it to an entity.

    This can return null if the creation fails:

    e.g. Trying to apply a status effect with isKilledByUnstoppable flag to an unstoppable/invulnerable entity.

    Declaration
    public T CreateStatusEffect<T>(T prefab, Entity victim, Action<T> beforePrepare = null) where T : StatusEffect
    Parameters
    Type Name Description
    T prefab
    Entity victim
    System.Action<T><T> beforePrepare
    Returns
    Type Description
    T
    Type Parameters
    Name Description
    T

    CreateStatusEffect<T>(Entity, Action<T>)

    Create a new status effect and attach it to an entity.

    This can return null if the creation fails:

    e.g. Trying to apply a status effect with isKilledByUnstoppable flag to an unstoppable/invulnerable entity.

    Declaration
    public T CreateStatusEffect<T>(Entity victim, Action<T> beforePrepare = null) where T : StatusEffect
    Parameters
    Type Name Description
    Entity victim
    System.Action<T><T> beforePrepare
    Returns
    Type Description
    T
    Type Parameters
    Name Description
    T

    Damage(ScalingValue, float)

    Declaration
    public DamageData Damage(ScalingValue value, float procCoefficient = 1)
    Parameters
    Type Name Description
    ScalingValue value
    float procCoefficient
    Returns
    Type Description
    DamageData

    DefaultDamage(ScalingValue, float)

    Declaration
    public DamageData DefaultDamage(ScalingValue value, float procCoefficient = 1)
    Parameters
    Type Name Description
    ScalingValue value
    float procCoefficient
    Returns
    Type Description
    DamageData

    DestroyOnCondition(Func<bool>)

    Kill this instance when condition is met.

    Declaration
    public AbilityInstance.WatchedCondition DestroyOnCondition(Func<bool> condition)
    Parameters
    Type Name Description
    System.Func<TResult><bool> condition
    Returns
    Type Description
    AbilityInstance.WatchedCondition

    DestroyOnDeath(Entity, bool)

    Kill this instance when the specified entity dies/gets destroyed.

    Declaration
    public void DestroyOnDeath(Entity entity, bool includeKnockOuts = false)
    Parameters
    Type Name Description
    Entity entity
    bool includeKnockOuts

    DestroyOnDestroy(Actor)

    Remove this instance when the specified actor gets destroyed.

    Declaration
    public void DestroyOnDestroy(Actor actor)
    Parameters
    Type Name Description
    Actor actor

    GetActorReadableName()

    Declaration
    public override string GetActorReadableName()
    Returns
    Type Description
    string
    Overrides
    Actor.GetActorReadableName()

    GetValue(ScalingValue)

    Declaration
    public float GetValue(ScalingValue val)
    Parameters
    Type Name Description
    ScalingValue val
    Returns
    Type Description
    float

    GetValue(StarScalingValue)

    Declaration
    public float GetValue(StarScalingValue value)
    Parameters
    Type Name Description
    StarScalingValue value
    Returns
    Type Description
    float

    GetValue<T>(T[])

    Declaration
    public T GetValue<T>(T[] val)
    Parameters
    Type Name Description
    T[] val
    Returns
    Type Description
    T
    Type Parameters
    Name Description
    T

    GetValueInt(StarScalingValue)

    Declaration
    public int GetValueInt(StarScalingValue value)
    Parameters
    Type Name Description
    StarScalingValue value
    Returns
    Type Description
    int

    Heal(ScalingValue)

    Declaration
    public HealData Heal(ScalingValue amount)
    Parameters
    Type Name Description
    ScalingValue amount
    Returns
    Type Description
    HealData

    LogicUpdate(float)

    Declaration
    public override void LogicUpdate(float dt)
    Parameters
    Type Name Description
    float dt
    Overrides
    Actor.LogicUpdate(float)

    MagicDamage(ScalingValue, float)

    Declaration
    public DamageData MagicDamage(ScalingValue value, float procCoefficient = 1)
    Parameters
    Type Name Description
    ScalingValue value
    float procCoefficient
    Returns
    Type Description
    DamageData

    OnCreate()

    Declaration
    protected override void OnCreate()
    Overrides
    Actor.OnCreate()

    OnCreateSequenced()

    Started everywhere when this ability instance is created, running on LogicUpdates.

    This will stop running when this instance gets killed.

    Return SequenceInstructions (e.g. new SI.WaitForSeconds()) to yield this sequence.

    Returning null has same effect of new SI.WaitForNextLogicUpdate().

    Declaration
    protected virtual IEnumerator OnCreateSequenced()
    Returns
    Type Description
    System.Collections.IEnumerator

    OnDestroyActor()

    Declaration
    protected override void OnDestroyActor()
    Overrides
    Actor.OnDestroyActor()

    OnPrepare()

    Called on server right before this instance to be spawned.
    Configure this instance's initial state here.
    By default this sets skillLevel to parent's level.
    Parent type can either be SkillTrigger, AbilityInstance, or Gem.

    Declaration
    protected override void OnPrepare()
    Overrides
    Actor.OnPrepare()

    OnStart()

    Declaration
    public override void OnStart()
    Overrides
    Actor.OnStart()

    PhysicalDamage(ScalingValue, float)

    Declaration
    public DamageData PhysicalDamage(ScalingValue value, float procCoefficient = 1)
    Parameters
    Type Name Description
    ScalingValue value
    float procCoefficient
    Returns
    Type Description
    DamageData

    PhysicalMagicDamage(ScalingValue, float)

    Declaration
    public DamageData PhysicalMagicDamage(ScalingValue value, float procCoefficient = 1)
    Parameters
    Type Name Description
    ScalingValue value
    float procCoefficient
    Returns
    Type Description
    DamageData

    PureDamage(ScalingValue, float)

    Declaration
    public DamageData PureDamage(ScalingValue value, float procCoefficient = 1)
    Parameters
    Type Name Description
    ScalingValue value
    float procCoefficient
    Returns
    Type Description
    DamageData

    ResetBudget()

    Declaration
    public static void ResetBudget()

    StartChargingChannel(ChargingChannel)

    Declaration
    public void StartChargingChannel(ChargingChannel channel)
    Parameters
    Type Name Description
    ChargingChannel channel

    StartSequence(IEnumerator)

    Start a sequence that will run while this instance is alive on LogicUpdates.

    Declaration
    protected void StartSequence(IEnumerator sequence)
    Parameters
    Type Name Description
    System.Collections.IEnumerator sequence

    Implements

    ILogicUpdate
    ICleanup
    ICustomDestroyRoutine

    Extension Methods

    DewGUI.SetExpandHeight<T>(T, bool)
    DewGUI.SetExpandHeight<T>(T, float)
    DewGUI.SetExpandWidth<T>(T, bool)
    DewGUI.SetExpandWidth<T>(T, float)
    DewGUI.SetHeight<T>(T, float)
    DewGUI.SetText<T>(T, string)
    DewGUI.SetTextLocalized<T>(T, string)
    DewGUI.SetWidth<T>(T, float)
    ActorCheck.IsNullOrInactive(Actor)
    In This Article
    Back to top Shape of Dreams API Documentation