Class StatusEffect
Status effect is an effect that can be applied to an entity.
Inheritance
object
UnityEngine.Object
UnityEngine.Component
UnityEngine.Behaviour
UnityEngine.MonoBehaviour
Mirror.NetworkBehaviour
StatusEffect
Assembly: Dew.Core.dll
Syntax
public abstract class StatusEffect : AbilityInstance, ILogicUpdate, ICleanup, ICustomDestroyRoutine
Fields
addedMaterials
Declaration
[BoxGroup("StatusEffect Settings", true, false, 0)]
public Material[] addedMaterials
Field Value
| Type |
Description |
| UnityEngine.Material[] |
|
bottomColor
Declaration
[BoxGroup("StatusEffect Settings", true, false, 0)]
[ShowIf("_showIcon", true)]
public Color bottomColor
Field Value
| Type |
Description |
| UnityEngine.Color |
|
endEffectVictim
Declaration
[BoxGroup("StatusEffect Settings", true, false, 0)]
[LabelText("End Effect")]
public GameObject endEffectVictim
Field Value
| Type |
Description |
| UnityEngine.GameObject |
|
HarmfulEffects
Declaration
public const BasicEffectMask HarmfulEffects = Slow | Cripple | Root | Silence | Stun | Blind | ArmorReduction | HealReduction
Field Value
hideOnWorldHealthBar
Declaration
[BoxGroup("StatusEffect Settings", true, false, 0)]
[ShowIf("_showIcon", true)]
[ToggleLeft]
public bool hideOnWorldHealthBar
Field Value
icon
Declaration
[BoxGroup("StatusEffect Settings", true, false, 0)]
[ShowIf("_showIcon", true)]
public Sprite icon
Field Value
| Type |
Description |
| UnityEngine.Sprite |
|
iconOrder
Declaration
[BoxGroup("StatusEffect Settings", true, false, 0)]
[ShowIf("_showIcon", true)]
public int iconOrder
Field Value
isBeneficialBuff
Declaration
[FormerlySerializedAs("isBeneficial")]
[BoxGroup("StatusEffect Settings", true, false, 0)]
[ToggleLeft]
public bool isBeneficialBuff
Field Value
isCleansable
Declaration
[BoxGroup("StatusEffect Settings", true, false, 0)]
[ToggleLeft]
public bool isCleansable
Field Value
isKilledByCrowdControlImmunity
Declaration
[BoxGroup("StatusEffect Settings", true, false, 0)]
[ToggleLeft]
public bool isKilledByCrowdControlImmunity
Field Value
scaleDurationByTenacity
Declaration
[BoxGroup("StatusEffect Settings", true, false, 0)]
[ToggleLeft]
public bool scaleDurationByTenacity
Field Value
startEffectVictim
Declaration
[Title("Effects On Victim", null, TitleAlignments.Left, true, true)]
[BoxGroup("StatusEffect Settings", true, false, 0)]
[LabelText("Start Effect")]
public GameObject startEffectVictim
Field Value
| Type |
Description |
| UnityEngine.GameObject |
|
topColor
Declaration
[BoxGroup("StatusEffect Settings", true, false, 0)]
[ShowIf("_showIcon", true)]
public Color topColor
Field Value
| Type |
Description |
| UnityEngine.Color |
|
Properties
basicEffects
List of BasicEffects this status effect is applying to the victim entity. Only available on server.
Declaration
public IReadOnlyList<BasicEffect> basicEffects { get; }
Property Value
| Type |
Description |
| System.Collections.Generic.IReadOnlyList<T><BasicEffect> |
|
isDestroyedOnRoomChange
Declaration
public override bool isDestroyedOnRoomChange { get; }
Property Value
Overrides
maxDuration
Declaration
public float? maxDuration { get; }
Property Value
normalizedDuration
Normalized remaining duration. Starts on 1.0f and ends on 0.0f.
Declaration
public float? normalizedDuration { get; }
Property Value
numberDisplay
Declaration
public int? numberDisplay { get; set; }
Property Value
remainingDuration
Declaration
public float? remainingDuration { get; }
Property Value
showIcon
Declaration
public bool showIcon { get; set; }
Property Value
victim
Declaration
[SaveVar(SaveVarFlags.Default)]
public Entity victim { get; }
Property Value
Methods
ActiveLogicUpdate(float)
Declaration
protected override void ActiveLogicUpdate(float dt)
Parameters
| Type |
Name |
Description |
| float |
dt |
|
Overrides
DoAbility(Func<AbilityTrigger, bool>, Func<AbilityTrigger, Action>)
Do custom action on all matching ability and do custom cleanup. You can invoke the returned action to immediately call cleanup functions to stop the effect.
Declaration
public SafeAction DoAbility(Func<AbilityTrigger, bool> condition, Func<AbilityTrigger, Action> callback)
Parameters
| Type |
Name |
Description |
| System.Func<T, TResult><AbilityTrigger, bool> |
condition |
|
| System.Func<T, TResult><AbilityTrigger, System.Action> |
callback |
|
Returns
DoArmorBoost(float)
ArmorBoost reduces all taken damage.
Declaration
public ArmorBoostEffect DoArmorBoost(float strength)
Parameters
| Type |
Name |
Description |
| float |
strength |
|
Returns
DoArmorReduction(float)
ArmorReduction increases all taken damage.
Declaration
public ArmorReductionEffect DoArmorReduction(float strength)
Parameters
| Type |
Name |
Description |
| float |
strength |
|
Returns
DoAttackCritical(Action)
AttackCritical makes the entity's attacks to always do a critical hit.
Declaration
public AttackCriticalEffect DoAttackCritical(Action onUse)
Parameters
| Type |
Name |
Description |
| System.Action |
onUse |
|
Returns
DoAttackEmpower(Action<EventInfoAttackEffect, int>, int, Action)
Note this will lock the status effect until basic attack instance is destroyed.
Declaration
public AttackEmpowerEffect DoAttackEmpower(Action<EventInfoAttackEffect, int> onAttackEffect, int maxTriggerCount = 2147483647, Action onDepleted = null)
Parameters
| Type |
Name |
Description |
| System.Action<T1, T2><EventInfoAttackEffect, int> |
onAttackEffect |
|
| int |
maxTriggerCount |
|
| System.Action |
onDepleted |
|
Returns
DoAttackOverride(AbilityTrigger, Action)
AttackOverride replaces the entity's attack AbilityTrigger with something else.
This version uses an existing ability trigger.
Declaration
public AttackOverrideEffect DoAttackOverride(AbilityTrigger trigger, Action onUse)
Parameters
Returns
DoAttackOverride<T>(Action)
AttackOverride replaces the entity's attack AbilityTrigger with something else.
This version creates a new ability trigger of the given type and automatically disposes after use.
Declaration
public AttackOverrideEffect DoAttackOverride<T>(Action onUse) where T : AbilityTrigger
Parameters
| Type |
Name |
Description |
| System.Action |
onUse |
|
Returns
Type Parameters
DoBasicEffect(BasicEffect)
Declaration
public void DoBasicEffect(BasicEffect eff)
Parameters
DoBlind()
Blind makes the entity miss its attacks.
Declaration
public BlindEffect DoBlind()
Returns
DoCripple(float)
Cripple reduces the entity's attack speed.
Declaration
public CrippleEffect DoCripple(float strength)
Parameters
| Type |
Name |
Description |
| float |
strength |
|
Returns
DoDeathInterrupt(Action<EventInfoKill>, int)
Death Interrupt fires before entity's imminent death.
DeathInterrupts with lower priority will be fired/checked earlier.
Healing entity by any amount in an interrupt will prevent entity's death.
If an interrupt prevents the death, other interrupts will not be fired.
Note that interrupts can be ignored by Entity.KillNoInterrupt()
Declaration
public DeathInterruptEffect DoDeathInterrupt(Action<EventInfoKill> onInterrupt, int priority)
Parameters
| Type |
Name |
Description |
| System.Action<T><EventInfoKill> |
onInterrupt |
|
| int |
priority |
|
Returns
DoFakeMaxHealthEffect(float)
FakeMaxHealth increases shown max health only in health bars.
Declaration
public FakeMaxHealthEffect DoFakeMaxHealthEffect(float amount)
Parameters
| Type |
Name |
Description |
| float |
amount |
|
Returns
DoHaste(float)
Haste increases the entity's attack speed.
Declaration
public HasteEffect DoHaste(float strength)
Parameters
| Type |
Name |
Description |
| float |
strength |
|
Returns
DoInvisible()
Invisible makes the entity untargetable by targeted abilities and undetectable to enemies. Note this doesn't change the entity's graphical visibility.
Declaration
public InvisibleEffect DoInvisible()
Returns
DoInvulnerable(Action<EventInfoDamageNegatedByImmunity>)
Invulnerable makes the entity immune to damage and crowd controls.
Declaration
public InvulnerableEffect DoInvulnerable(Action<EventInfoDamageNegatedByImmunity> onDamageNegated = null)
Parameters
Returns
DoProtected(Action<EventInfoDamageNegatedByImmunity>)
Protected makes the entity immune to damage.
Declaration
public ProtectedEffect DoProtected(Action<EventInfoDamageNegatedByImmunity> onDamageNegated)
Parameters
Returns
DoRoot()
Root impairs the entity's movement/movement ability.
Declaration
public RootEffect DoRoot()
Returns
DoShield(float, Action<EventInfoDamageNegatedByShield>)
Declaration
public ShieldEffect DoShield(float amount, Action<EventInfoDamageNegatedByShield> onDamageNegated = null)
Parameters
Returns
DoSilence()
Silence prevents the entity from using abilities.
Declaration
public SilenceEffect DoSilence()
Returns
DoSkill<T>(Action<T>)
Do custom action on all matching skill. You can invoke the returned action to immediately call cleanup functions to stop the effect.
Declaration
public SafeAction DoSkill<T>(Action<T> callback) where T : SkillTrigger
Parameters
| Type |
Name |
Description |
| System.Action<T><T> |
callback |
|
Returns
Type Parameters
DoSkill<T>(Func<T, Action>)
Do custom action on all matching skill and do custom cleanup. You can invoke the returned action to immediately call cleanup functions to stop the effect.
Declaration
public SafeAction DoSkill<T>(Func<T, Action> callback) where T : SkillTrigger
Parameters
| Type |
Name |
Description |
| System.Func<T, TResult><T, System.Action> |
callback |
|
Returns
Type Parameters
DoSlow(float)
Slow reduces the entity's movement speed.
Declaration
public SlowEffect DoSlow(float strength)
Parameters
| Type |
Name |
Description |
| float |
strength |
|
Returns
DoSpeed(float)
Speed increases the entity's movement speed.
Declaration
public SpeedEffect DoSpeed(float strength)
Parameters
| Type |
Name |
Description |
| float |
strength |
|
Returns
DoStatBonus()
Do a stat bonus to victim that expires on destruction of this status effect.
Declaration
public StatBonus DoStatBonus()
Returns
DoStatBonus(StatBonus)
Do a stat bonus to victim that expires on destruction of this status effect.
Declaration
public StatBonus DoStatBonus(StatBonus bonus)
Parameters
Returns
DoStun()
Stun prevents the entity from moving/using abilities/attacking.
Declaration
public StunEffect DoStun()
Returns
DoUncollidable()
Uncollidable makes the entity uncollidable by non-targeted projectiles and abilities.
Declaration
public UncollidableEffect DoUncollidable()
Returns
DoUnstoppable()
Unstoppable makes the entity immune to crowd controls.
Declaration
public UnstoppableEffect DoUnstoppable()
Returns
FrameUpdate()
Declaration
public override void FrameUpdate()
Overrides
GetActorReadableName()
Declaration
public override string GetActorReadableName()
Returns
Overrides
Called on the local client hovering over the status effect icon.
Declaration
public virtual string GetCustomTooltipDescription()
Returns
Called on the local client hovering over the status effect icon.
Declaration
public virtual string GetCustomTooltipName()
Returns
HideOnScreenTimer()
Hide this status effect's timer on the screen of the victim. Has no effect on non-player victim
Declaration
public void HideOnScreenTimer()
OnCreate()
Declaration
protected override void OnCreate()
Overrides
OnDestroyActor()
Declaration
protected override void OnDestroyActor()
Overrides
OnStartServer()
Declaration
public override void OnStartServer()
Overrides
ResetTimer()
Reset a timer set by SetTimer to its initial duration.
Declaration
SetTimer(float, float)
Set a timer that kills this status effect on expiration. The timer will update fillAmount automatically.
Declaration
public void SetTimer(float maxDuration, float duration)
Parameters
| Type |
Name |
Description |
| float |
maxDuration |
|
| float |
duration |
|
SetTimer(float)
Set a timer that kills this status effect on expiration. The timer will update fillAmount automatically.
Declaration
public void SetTimer(float duration)
Parameters
| Type |
Name |
Description |
| float |
duration |
|
ShowOnScreenTimer(string, Color, bool)
Show this status effect's timer on the screen of the victim. Has no effect on non-player victim
Declaration
public void ShowOnScreenTimer(string customNameKey = null, Color color = default, bool invertValue = false)
Parameters
| Type |
Name |
Description |
| string |
customNameKey |
|
| UnityEngine.Color |
color |
|
| bool |
invertValue |
|
StopAllBasicEffects()
Declaration
protected void StopAllBasicEffects()
StopBasicEffect(BasicEffect)
Declaration
protected void StopBasicEffect(BasicEffect eff)
Parameters
StopTimer()
Declaration
Implements
Extension Methods