Class: Actor
- Namespace:
Global - Assembly:
Dew.Core.dll - Inheritance / Derived: DewNetworkBehaviour → AbilityInstance → AbilityTrigger → Artifact → Entity → GameEffect → Gem → Rift → Room_Trap_Toggleable → RoomModifierBase → ServerActor → Shrine → Treasure
[SelectionBase]
[DewResourceLink(ResourceLinkBy.Type)]
public class Actor : DewNetworkBehaviour, ILogicUpdate, ICleanup, ICustomDestroyRoutineFields
| Name | Declaration | Description |
|---|---|---|
ActorEvent_OnAbilityInstanceBeforePrepare | public SafeAction<EventInfoAbilityInstance> ActorEvent_OnAbilityInstanceBeforePrepare | Note that ActorEvents can also be from its descendants. |
ActorEvent_OnAbilityInstanceCreated | public SafeAction<EventInfoAbilityInstance> ActorEvent_OnAbilityInstanceCreated | Note that ActorEvents can also be from its descendants. |
ActorEvent_OnApplyElemental | public SafeAction<EventInfoApplyElemental> ActorEvent_OnApplyElemental | Note that ActorEvents can also be from its descendants. |
ActorEvent_OnAttackEffectTriggered | public SafeAction<EventInfoAttackEffect> ActorEvent_OnAttackEffectTriggered | Note that ActorEvents can also be from its descendants. |
ActorEvent_OnAttackHit | public SafeAction<EventInfoAttackHit> ActorEvent_OnAttackHit | Note that ActorEvents can also be from its descendants. |
ActorEvent_OnDealDamage | public SafeAction<EventInfoDamage> ActorEvent_OnDealDamage | Note that ActorEvents can also be from its descendants. |
ActorEvent_OnDoHeal | public SafeAction<EventInfoHeal> ActorEvent_OnDoHeal | Note that ActorEvents can also be from its descendants. |
ActorEvent_OnDoManaHeal | public SafeAction<EventInfoHeal> ActorEvent_OnDoManaHeal | Note that ActorEvents can also be from its descendants. |
ActorEvent_OnGiveShield | public SafeAction<EventInfoShield> ActorEvent_OnGiveShield | Note that ActorEvents can also be from its descendants. |
ActorEvent_OnKill | public SafeAction<EventInfoKill> ActorEvent_OnKill | Note that ActorEvents can also be from its descendants. |
ActorEvent_OnSpawnSummon | public SafeAction<EventInfoSummon> ActorEvent_OnSpawnSummon | Note that ActorEvents can also be from its descendants. |
ActorEvent_OnSpendMana | public SafeAction<EventInfoSpentMana> ActorEvent_OnSpendMana | Note that ActorEvents can also be from its descendants. |
children | public readonly List<Actor> children | Alive, non-destroyed children actors. |
childrenInNetwork | public readonly List<Actor> childrenInNetwork | Children that are alive, or not yet despawned from the network. |
ClientActorEvent_OnCreate | public SafeAction<Actor> ClientActorEvent_OnCreate | Called everywhere when an actor is created including child actors. |
ClientActorEvent_OnDestroyed | public SafeAction<Actor> ClientActorEvent_OnDestroyed | Called everywhere when this actor is destroyed. |
ClientEvent_OnPersistentSyncedDataChanged | public SafeAction<string> ClientEvent_OnPersistentSyncedDataChanged | |
dealtCooldownReductionByRatioProcessor | public DataProcessorGroup<CooldownReductionByRatioSettings, Actor, AbilityTrigger> dealtCooldownReductionByRatioProcessor | Processor for dealt cooldown reductions by ratio. This is only valid on server.All cooldown reductions done by this actor will be processed by this and every ancestor's preprocessors. |
dealtCooldownReductionProcessor | public DataProcessorGroup<CooldownReductionSettings, Actor, AbilityTrigger> dealtCooldownReductionProcessor | Processor for dealt cooldown reductions of fixed amount. This is only valid on server.All cooldown reductions done by this actor will be processed by this and every ancestor's preprocessors. |
dealtDamageProcessor | public DataProcessorGroup<DamageData, Actor, Entity> dealtDamageProcessor | Processor for all dealt damages (Except pure damage). This is only valid on server.All damages from this actor will be processed by this and every ancestors' preprocessors. |
dealtHealProcessor | public DataProcessorGroup<HealData, Actor, Entity> dealtHealProcessor | Processor for dealt heals. This is only valid on server.All heals from this actor will be processed by this and every ancestors' preprocessors. |
dealtManaHealProcessor | public DataProcessorGroup<HealData, Actor, Entity> dealtManaHealProcessor | Processor for dealt mana heals. This is only valid on server.All mana heals from this actor will be processed by this and every ancestors' preprocessors. |
dealtShieldProcessor | public DataProcessorGroup<HealData, Actor, Entity> dealtShieldProcessor | Processor for received shields. This is only valid on server. |
KilledByUnstoppableEffects | public static Type[] KilledByUnstoppableEffects | |
persistentData | `[SaveVar(SaveVarFlags.Default)] | |
| public readonly Dictionary<string, string> persistentData` | Available on server. Generic persistent data storage that will be saved and loaded with this actor. | |
persistentSyncedData | `[SaveVar(SaveVarFlags.Default)] | |
| public readonly SyncDictionary<string, string> persistentSyncedData` | Available everywhere, and can only be set on server. Generic persistent synced data storage that will be saved and loaded with this actor, and be synced across the network.Use this to store states in the network context. (think: synced variables) | |
ScaleDurationByTenacityEffects | public static Type[] ScaleDurationByTenacityEffects | |
spawnedChildVarDefProcessor | public DataProcessorGroup<VariantDef, Actor, Type> spawnedChildVarDefProcessor |
Properties
| Name | Declaration | Description |
|---|---|---|
ancestors | public IEnumerable<Actor> ancestors { get; } | Enumerable ancestors of this actor. Ordering is the same as the actor tree order, first element being the direct parent. |
chainTempName | public ReactionChain chainTempName { get; } | Reaction chain of this actor. Available only on server. |
creationTime | public float creationTime { get; } | Time of this actor's creation byTime.time. |
firstEntity | public Entity firstEntity { get; } | The first entity in this actor's ancestor tree.This property can be used to e.g. find the caster of an ability instance. |
firstTrigger | public AbilityTrigger firstTrigger { get; } | The first ability trigger in this actor's ancestor tree.This property can be used to e.g. find the ability instance's trigger. |
isActive | public bool isActive { get; } | |
isDestroyed | public bool isDestroyed { get; } | |
isDestroyedOnRoomChange | public virtual bool isDestroyedOnRoomChange { get; } | |
isDestroyLocked | public bool isDestroyLocked { get; } | Is someone preventing this actor from being destroyed? Available only on server. |
isNewInstance | public bool isNewInstance { get; } | Is it this actor created in this session of the game, or has been loaded from save?e.g. This will be false if this actor is part of a loaded game, or from previously visited node. |
parentActor | public Actor parentActor { get; set; } | |
parentActorNetId | public uint parentActorNetId { get; } | |
persistentNetId | public uint persistentNetId { get; } | Mirror setsnetIdto 0 on despawn. This property will tell you its former netId even after being despawned. |
position | `[SaveVar(SaveVarFlags.Default)] | |
| public Vector3 position { get; set; }` | Position of this actor. Same astransform.position. | |
rotation | `[SaveVar(SaveVarFlags.Default)] | |
| public Quaternion rotation { get; set; }` | Rotation of this actor. Same astransform.rotation. |
Methods
ActiveFrameUpdate()
Called everywhere every frame while this actor is active.
protected virtual void ActiveFrameUpdate()ActiveLogicUpdate(float)
Called everywhere every logic tick while this actor is active.
protected virtual void ActiveLogicUpdate(float dt)Parameters:
| Name | Type | Description |
|---|---|---|
dt | float |
AddData<T>(T)
public void AddData<T>(T data)Parameters:
| Name | Type | Description |
|---|---|---|
data | T | |
| `` | T |
ApplyCooldownReduction(AbilityTrigger, CooldownReductionSettings)
Apply cooldown reduction to all configs that can receive cooldown reduction.
public void ApplyCooldownReduction(AbilityTrigger trigger, CooldownReductionSettings settings)Parameters:
| Name | Type | Description |
|---|---|---|
trigger | AbilityTrigger | |
settings | CooldownReductionSettings |
ApplyCooldownReduction(AbilityTrigger, float, bool, bool)
Apply cooldown reduction to all configs that can receive cooldown reduction.
public void ApplyCooldownReduction(AbilityTrigger trigger, float amount, bool scaled = true, bool ignoreCanReceiveCooldown = false)Parameters:
| Name | Type | Description |
|---|---|---|
trigger | AbilityTrigger | |
amount | float | |
scaled | bool | |
ignoreCanReceiveCooldown | bool |
ApplyCooldownReductionByRatio(AbilityTrigger, CooldownReductionByRatioSettings)
Apply cooldown reduction to all configs that can receive cooldown reduction by ratio of max cooldown.
public void ApplyCooldownReductionByRatio(AbilityTrigger trigger, CooldownReductionByRatioSettings settings)Parameters:
| Name | Type | Description |
|---|---|---|
trigger | AbilityTrigger | |
settings | CooldownReductionByRatioSettings |
ApplyCooldownReductionByRatio(AbilityTrigger, float, bool)
Apply cooldown reduction to all configs that can receive cooldown reduction by ratio of max cooldown.
public void ApplyCooldownReductionByRatio(AbilityTrigger trigger, float ratio, bool ignoreCanReceiveCooldown = false)Parameters:
| Name | Type | Description |
|---|---|---|
trigger | AbilityTrigger | |
ratio | float | |
ignoreCanReceiveCooldown | bool |
ApplyElemental(ElementalType, Entity, int)
public ElementalStatusEffect ApplyElemental(ElementalType type, Entity to, int appliedStacks = 1)Parameters:
| Name | Type | Description |
|---|---|---|
type | ElementalType | |
to | Entity | |
appliedStacks | int |
Returns: ElementalStatusEffect
Awake()
protected override void Awake()ClearExcludeFromRoomSave()
Clear flag that excludes this actor from room save.Note this won't make non-saving by default actors to be saved.
public void ClearExcludeFromRoomSave()CreateAbilityInstance(Type, Vector3, Quaternion?, CastInfo, Action<AbilityInstance>)
public AbilityInstance CreateAbilityInstance(Type type, Vector3 position, Quaternion? rotation, CastInfo info, Action<AbilityInstance> beforePrepare = null)Parameters:
| Name | Type | Description |
|---|---|---|
type | System.Type | |
position | UnityEngine.Vector3 | |
rotation | UnityEngine.Quaternion? | |
info | CastInfo | |
beforePrepare | System.Action<T><AbilityInstance> |
Returns: AbilityInstance
CreateAbilityInstance<T>(T, Vector3, Quaternion?, CastInfo, Action<T>)
public T CreateAbilityInstance<T>(T prefab, Vector3 position, Quaternion? rotation, CastInfo info, Action<T> beforePrepare = null) where T : AbilityInstanceParameters:
| Name | Type | Description |
|---|---|---|
prefab | T | |
position | UnityEngine.Vector3 | |
rotation | UnityEngine.Quaternion? | |
info | CastInfo | |
beforePrepare | System.Action<T><T> | |
| `` | T |
Returns: T
CreateAbilityInstance<T>(Vector3, Quaternion?, CastInfo, Action<T>)
public T CreateAbilityInstance<T>(Vector3 position, Quaternion? rotation, CastInfo info, Action<T> beforePrepare = null) where T : AbilityInstanceParameters:
| Name | Type | Description |
|---|---|---|
position | UnityEngine.Vector3 | |
rotation | UnityEngine.Quaternion? | |
info | CastInfo | |
beforePrepare | System.Action<T><T> | |
| `` | T |
Returns: T
CreateActor<T>(T, Vector3, Quaternion?, Action<T>)
public T CreateActor<T>(T prefab, Vector3 pos, Quaternion? rot, Action<T> beforePrepare = null) where T : ActorParameters:
| Name | Type | Description |
|---|---|---|
prefab | T | |
pos | UnityEngine.Vector3 | |
rot | UnityEngine.Quaternion? | |
beforePrepare | System.Action<T><T> | |
| `` | T |
Returns: T
CreateActor<T>(Vector3, Quaternion?, Action<T>)
public T CreateActor<T>(Vector3 pos, Quaternion? rot, Action<T> beforePrepare = null) where T : ActorParameters:
| Name | Type | Description |
|---|---|---|
pos | UnityEngine.Vector3 | |
rot | UnityEngine.Quaternion? | |
beforePrepare | System.Action<T><T> | |
| `` | T |
Returns: T
CreateBasicEffect(Entity, BasicEffect, float, string, DuplicateEffectBehavior)
Create a generic container status effect for applying basic effect to an entity.Give an id of null to prevent this behavior.The created status effect will be cleansable and killed by unstoppable if it contains a harmful effect.
public Se_GenericEffectContainer CreateBasicEffect(Entity victim, BasicEffect eff, float duration, string id = null, DuplicateEffectBehavior onDuplicate = DuplicateEffectBehavior.ReplacePrevious)Parameters:
| Name | Type | Description |
|---|---|---|
victim | Entity | |
eff | BasicEffect | |
duration | float | |
id | string | |
onDuplicate | DuplicateEffectBehavior |
Returns: Se_GenericEffectContainer
CreateDamage(SourceType, float, float)
public DamageData CreateDamage(DamageData.SourceType type, float amount, float procCoefficient = 1)Parameters:
| Name | Type | Description |
|---|---|---|
type | DamageData.SourceType | |
amount | float | |
procCoefficient | float |
Returns: DamageData
CreateStatusEffect(Type, Entity, CastInfo, Action<StatusEffect>)
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.
public StatusEffect CreateStatusEffect(Type type, Entity victim, CastInfo info, Action<StatusEffect> beforePrepare = null)Parameters:
| Name | Type | Description |
|---|---|---|
type | System.Type | |
victim | Entity | |
info | CastInfo | |
beforePrepare | System.Action<T><StatusEffect> |
Returns: StatusEffect
CreateStatusEffect<T>(T, Entity, CastInfo, 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.
public T CreateStatusEffect<T>(T prefab, Entity victim, CastInfo info, Action<T> beforePrepare = null) where T : StatusEffectParameters:
| Name | Type | Description |
|---|---|---|
prefab | T | |
victim | Entity | |
info | CastInfo | |
beforePrepare | System.Action<T><T> | |
| `` | T |
Returns: T
CreateStatusEffect<T>(Entity, CastInfo, 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.
public T CreateStatusEffect<T>(Entity victim, CastInfo info, Action<T> beforePrepare = null) where T : StatusEffectParameters:
| Name | Type | Description |
|---|---|---|
victim | Entity | |
info | CastInfo | |
beforePrepare | System.Action<T><T> | |
| `` | T |
Returns: T
CustomDestroyRoutine()
public void CustomDestroyRoutine()CustomRpc_ClearClientMessageHandlers()
public void CustomRpc_ClearClientMessageHandlers()CustomRpc_ClearServerMessageHandlers()
public void CustomRpc_ClearServerMessageHandlers()CustomRpc_RegisterClientMessageHandler<T>(Action<T>)
Register a client RPC handler. (server to clients) Registering multiple handlers for same type will result in all handlers passed being called.
public void CustomRpc_RegisterClientMessageHandler<T>(Action<T> handler)Parameters:
| Name | Type | Description |
|---|---|---|
handler | System.Action<T><T> | |
| `` | T |
CustomRpc_RegisterServerMessageHandler<T>(Action<T>)
Register a server RPC handler. (client to server) Registering multiple handlers for same type will result in all handlers passed being called.
public void CustomRpc_RegisterServerMessageHandler<T>(Action<T> handler)Parameters:
| Name | Type | Description |
|---|---|---|
handler | System.Action<T><T> | |
| `` | T |
CustomRpc_RegisterServerMessageHandler<T>(string, Action<T, DewPlayer>)
Register a server RPC handler. (client to server) Registering multiple handlers for same type will result in all handlers passed being called.This variant allows you to receive the caller client as a parameter.
public void CustomRpc_RegisterServerMessageHandler<T>(string type, Action<T, DewPlayer> handler)Parameters:
| Name | Type | Description |
|---|---|---|
type | string | |
handler | System.Action<T1, T2><T,DewPlayer> | |
| `` | T |
CustomRpc_SendMessageToAllClients<T>(T)
Make a remote procedure call: Server => All Clients
public void CustomRpc_SendMessageToAllClients<T>(T msg)Parameters:
| Name | Type | Description |
|---|---|---|
msg | T | |
| `` | T |
CustomRpc_SendMessageToClient<T>(DewPlayer, T)
Make a remote procedure call: Server => Specific Client
public void CustomRpc_SendMessageToClient<T>(DewPlayer target, T msg)Parameters:
| Name | Type | Description |
|---|---|---|
target | DewPlayer | |
msg | T | |
| `` | T |
CustomRpc_SendMessageToServer<T>(T)
Make a remote procedure call: Client => ServerHosts can also make use of this RPC.
public void CustomRpc_SendMessageToServer<T>(T msg)Parameters:
| Name | Type | Description |
|---|---|---|
msg | T | |
| `` | T |
CustomRpc_UnregisterClientMessageHandler<T>()
public void CustomRpc_UnregisterClientMessageHandler<T>()Parameters:
| Name | Type | Description |
|---|---|---|
| `` | T |
CustomRpc_UnregisterClientMessageHandler<T>(Action<T>)
public void CustomRpc_UnregisterClientMessageHandler<T>(Action<T> handler)Parameters:
| Name | Type | Description |
|---|---|---|
handler | System.Action<T><T> | |
| `` | T |
CustomRpc_UnregisterServerMessageHandler<T>()
public void CustomRpc_UnregisterServerMessageHandler<T>()Parameters:
| Name | Type | Description |
|---|---|---|
| `` | T |
CustomRpc_UnregisterServerMessageHandler<T>(Action<T, DewPlayer>)
public void CustomRpc_UnregisterServerMessageHandler<T>(Action<T, DewPlayer> handler)Parameters:
| Name | Type | Description |
|---|---|---|
handler | System.Action<T1, T2><T,DewPlayer> | |
| `` | T |
CustomRpc_UnregisterServerMessageHandler<T>(Action<T>)
public void CustomRpc_UnregisterServerMessageHandler<T>(Action<T> handler)Parameters:
| Name | Type | Description |
|---|---|---|
handler | System.Action<T><T> | |
| `` | T |
DealDamage(DamageData, Entity, ReactionChain)
Deal custom damage to the target entity.
public void DealDamage(DamageData damage, Entity target, ReactionChain chain = default)Parameters:
| Name | Type | Description |
|---|---|---|
damage | DamageData | |
target | Entity | |
chain | ReactionChain |
DefaultDamage(float, float)
public DamageData DefaultDamage(float amount, float procCoefficient = 1)Parameters:
| Name | Type | Description |
|---|---|---|
amount | float | |
procCoefficient | float |
Returns: DamageData
Destroy()
Destroy this actor.It will do its own cleanups on server and then despawn.This is irreversible.
public void Destroy()DestroyIfActive()
public void DestroyIfActive()DoBasicAttackHit(Entity, bool, bool, float, float)
Make the parent entity do basic attack and deal damage to the target entity.By design this should be only used by basic attacks.This triggers Attack Effects if the hit was successful.
public void DoBasicAttackHit(Entity target, bool isCriticalHit, bool isMain, float damage, float attackEffect)Parameters:
| Name | Type | Description |
|---|---|---|
target | Entity | |
isCriticalHit | bool | |
isMain | bool | |
damage | float | |
attackEffect | float |
DoHeal(HealData, Entity, ReactionChain)
Heal an entity by some amount.
public void DoHeal(HealData heal, Entity target, ReactionChain chain = default)Parameters:
| Name | Type | Description |
|---|---|---|
heal | HealData | |
target | Entity | |
chain | ReactionChain |
DoManaHeal(HealData, Entity, ReactionChain)
Grant an entity some mana.
public void DoManaHeal(HealData heal, Entity target, ReactionChain chain = default)Parameters:
| Name | Type | Description |
|---|---|---|
heal | HealData | |
target | Entity | |
chain | ReactionChain |
ExcludeFromRoomSave()
Mark this actor as excluded from room save.
public void ExcludeFromRoomSave()FindData<T>(Predicate<T>)
public T FindData<T>(Predicate<T> predicate)Parameters:
| Name | Type | Description |
|---|---|---|
predicate | System.Predicate<T><T> | |
| `` | T |
Returns: T
FindFirstAncestorOfType<T>()
Find first actor that matches the given type in this actor's ancestor tree.
public T FindFirstAncestorOfType<T>() where T : ActorParameters:
| Name | Type | Description |
|---|---|---|
| `` | T |
Returns: T
FindFirstOfType<T>()
Find first actor that matches the given type in this actor's ancestor tree including itself.
public T FindFirstOfType<T>() where T : ActorParameters:
| Name | Type | Description |
|---|---|---|
| `` | T |
Returns: T
FrameUpdate()
public override void FrameUpdate()GetActorReadableName()
public virtual string GetActorReadableName()Returns: string
GetData<T>()
public T GetData<T>()Parameters:
| Name | Type | Description |
|---|---|---|
| `` | T |
Returns: T
GetNetworkAuthorityConnection()
protected virtual NetworkConnectionToClient GetNetworkAuthorityConnection()Returns: Mirror.NetworkConnectionToClient
GetOriginalName()
Get the original name of this actor, excluding (Clone) or variant suffixes.Useful when trying to figure out id of name-linked resources.
public string GetOriginalName()Returns: string
GiveShield(Entity, float, float, bool, ReactionChain)
public Se_GenericShield_OneShot GiveShield(Entity victim, float amount, float duration, bool isDecay = false, ReactionChain chain = default)Parameters:
| Name | Type | Description |
|---|---|---|
victim | Entity | |
amount | float | |
duration | float | |
isDecay | bool | |
chain | ReactionChain |
Returns: Se_GenericShield_OneShot
HasData<T>()
public bool HasData<T>()Parameters:
| Name | Type | Description |
|---|---|---|
| `` | T |
Returns: bool
Heal(float)
public HealData Heal(float amount)Parameters:
| Name | Type | Description |
|---|---|---|
amount | float |
Returns: HealData
HideOnScreenTimerLocally(OnScreenTimerHandle)
public void HideOnScreenTimerLocally(OnScreenTimerHandle handle)Parameters:
| Name | Type | Description |
|---|---|---|
handle | OnScreenTimerHandle |
IsDescendantOf(Actor)
Is this actor a descendant of the given actor?Is the given actor this actor's ancestor (parent/grand-parent/grand-grand-parent...)?
public bool IsDescendantOf(Actor actor)Parameters:
| Name | Type | Description |
|---|---|---|
actor | Actor |
Returns: bool
IsDescendantOf<T>()
Is this actor a descendant of the given actor?Is the given actor this actor's ancestor (parent/grand-parent/grand-grand-parent...)?
public bool IsDescendantOf<T>() where T : ActorParameters:
| Name | Type | Description |
|---|---|---|
| `` | T |
Returns: bool
IsExcludedFromRoomSave()
Is this actor marked as excluded from room saves?
public bool IsExcludedFromRoomSave()Returns: bool
LockDestroy()
Prevent this actor from being destroyed. You MUST call UnlockDestroy() after LockDestroy() call.
public void LockDestroy()LogicUpdate(float)
public override void LogicUpdate(float dt)Parameters:
| Name | Type | Description |
|---|---|---|
dt | float |
MagicDamage(float, float)
public DamageData MagicDamage(float amount, float procCoefficient = 1)Parameters:
| Name | Type | Description |
|---|---|---|
amount | float | |
procCoefficient | float |
Returns: DamageData
OnCreate()
Called everywhere when this actor is created.
protected virtual void OnCreate()OnCreate_ActorData()
public void OnCreate_ActorData()OnDestroyActor()
Called everywhere when this actor is being destroyed. This is different from similarly-named Unity event OnDestroy, as it is called before GameObject itself gets destroyed.
protected virtual void OnDestroyActor()OnDisable()
protected virtual void OnDisable()OnEnable()
protected virtual void OnEnable()OnPrepare()
Called on server right before actor is spawned. Configure this actor's initial state here.
protected virtual void OnPrepare()OnStart()
public override void OnStart()OnStartClient()
public override void OnStartClient()OnStartServer()
public override void OnStartServer()OnStopClient()
public override void OnStopClient()OnStopServer()
public override void OnStopServer()PhysicalDamage(float, float)
public DamageData PhysicalDamage(float amount, float procCoefficient = 1)Parameters:
| Name | Type | Description |
|---|---|---|
amount | float | |
procCoefficient | float |
Returns: DamageData
ProcessShieldAmount(float, Entity)
public float ProcessShieldAmount(float amount, Entity target)Parameters:
| Name | Type | Description |
|---|---|---|
amount | float | |
target | Entity |
Returns: float
ProcessSpawnedChildVarDefProcessor(ref VariantDef, Type)
public void ProcessSpawnedChildVarDefProcessor(ref VariantDef data, Type childType)Parameters:
| Name | Type | Description |
|---|---|---|
data | VariantDef | |
childType | System.Type |
PureDamage(float, float)
public DamageData PureDamage(float amount, float procCoefficient = 1)Parameters:
| Name | Type | Description |
|---|---|---|
amount | float | |
procCoefficient | float |
Returns: DamageData
RefundMana(float, Entity)
Refund a certain amount of mana to an entity.This will not be processed, will not proc any callbacks nor display a mana heal number text.This shouldn't be used anywhere other than for canceled channels.
public void RefundMana(float amount, Entity target)Parameters:
| Name | Type | Description |
|---|---|---|
amount | float | |
target | Entity |
RemoveData(object)
public bool RemoveData(object obj)Parameters:
| Name | Type | Description |
|---|---|---|
obj | object |
Returns: bool
RemoveData<T>()
public bool RemoveData<T>()Parameters:
| Name | Type | Description |
|---|---|---|
| `` | T |
Returns: bool
ResetCooldown(AbilityTrigger, bool)
public void ResetCooldown(AbilityTrigger trigger, bool ignoreCanReceiveCooldown = false)Parameters:
| Name | Type | Description |
|---|---|---|
trigger | AbilityTrigger | |
ignoreCanReceiveCooldown | bool |
ShouldBeSavedWithRoom()
Should this actor be saved and loaded back in when revisiting nodes?This is checked on server on all active actors when changing rooms.
public virtual bool ShouldBeSavedWithRoom()Returns: bool
ShowOnScreenTimerLocally(OnScreenTimerHandle)
Show an on-screen timer with custom fill amount to local player.Null rawText will be automatically populated.
public OnScreenTimerHandle ShowOnScreenTimerLocally(OnScreenTimerHandle handle)Parameters:
| Name | Type | Description |
|---|---|---|
handle | OnScreenTimerHandle |
Returns: OnScreenTimerHandle
SpawnEntity<T>(T, Vector3, Quaternion?, DewPlayer, int, Action<T>)
public T SpawnEntity<T>(T entity, Vector3 pos, Quaternion? rot, DewPlayer owner, int level, Action<T> beforeSpawn = null) where T : EntityParameters:
| Name | Type | Description |
|---|---|---|
entity | T | |
pos | UnityEngine.Vector3 | |
rot | UnityEngine.Quaternion? | |
owner | DewPlayer | |
level | int | |
beforeSpawn | System.Action<T><T> | |
| `` | T |
Returns: T
SpawnEntity<T>(Vector3, Quaternion?, DewPlayer, int, Action<T>)
public T SpawnEntity<T>(Vector3 pos, Quaternion? rot, DewPlayer owner, int level, Action<T> beforeSpawn = null) where T : EntityParameters:
| Name | Type | Description |
|---|---|---|
pos | UnityEngine.Vector3 | |
rot | UnityEngine.Quaternion? | |
owner | DewPlayer | |
level | int | |
beforeSpawn | System.Action<T><T> | |
| `` | T |
Returns: T
SpawnSummon<T>(Vector3, Quaternion?, Action<T>)
public T SpawnSummon<T>(Vector3 position, Quaternion? rotation, Action<T> beforePrepare = null) where T : SummonParameters:
| Name | Type | Description |
|---|---|---|
position | UnityEngine.Vector3 | |
rotation | UnityEngine.Quaternion? | |
beforePrepare | System.Action<T><T> | |
| `` | T |
Returns: T
SpendMana(float, Entity)
Spend mana of the entity.
public void SpendMana(float amount, Entity target)Parameters:
| Name | Type | Description |
|---|---|---|
amount | float | |
target | Entity |
Teleport(Entity, Vector3)
Teleport an entity to the targeted position.You should only feed in a valid position by usingDew.GetValidAgentPosition()beforehand.
public void Teleport(Entity entity, Vector3 position)Parameters:
| Name | Type | Description |
|---|---|---|
entity | Entity | |
position | UnityEngine.Vector3 |
ToString()
public override string ToString()Returns: string
TrackKills(float, Action<EventInfoKill>)
Report any kills with contribution of this actor's damage with given grace period.You must Stop() the tracker to properly dispose it.
public KillTracker TrackKills(float gracePeriod, Action<EventInfoKill> callback)Parameters:
| Name | Type | Description |
|---|---|---|
gracePeriod | float | |
callback | System.Action<T><EventInfoKill> |
Returns: KillTracker
TriggerAttackEffects(Entity, float, AttackEffectType, ReactionChain)
public void TriggerAttackEffects(Entity target, float strength, AttackEffectType type, ReactionChain chain = default)Parameters:
| Name | Type | Description |
|---|---|---|
target | Entity | |
strength | float | |
type | AttackEffectType | |
chain | ReactionChain |
TryFindData<T>(Predicate<T>, out T)
public bool TryFindData<T>(Predicate<T> predicate, out T result)Parameters:
| Name | Type | Description |
|---|---|---|
predicate | System.Predicate<T><T> | |
result | T | |
| `` | T |
Returns: bool
TryGetData<T>(out T)
public bool TryGetData<T>(out T data)Parameters:
| Name | Type | Description |
|---|---|---|
data | T | |
| `` | T |
Returns: bool
UnlockDestroy()
public void UnlockDestroy()