Show / Hide Table of Contents

Class EntityEffectManager

Peered with a DaggerfallEntityBehaviour for magic and effect handling related to that entity. Manages list of active effects currently operating on peered entity. Used by player and enemies to send and receive magic effects from various sources. NOTE: Under active development and subject to frequent change.

Inheritance
Object
Object
Component
Behaviour
MonoBehaviour
EntityEffectManager
Namespace: DaggerfallWorkshop.Game.MagicAndEffects
Assembly: Assembly-CSharp.dll
Syntax
public class EntityEffectManager : MonoBehaviour

Fields

| Improve this Doc View Source

ColdMissilePrefab

Declaration
public DaggerfallMissile ColdMissilePrefab
Field Value
Type Description
DaggerfallMissile
| Improve this Doc View Source

FireMissilePrefab

Declaration
public DaggerfallMissile FireMissilePrefab
Field Value
Type Description
DaggerfallMissile
| Improve this Doc View Source

MagicMissilePrefab

Declaration
public DaggerfallMissile MagicMissilePrefab
Field Value
Type Description
DaggerfallMissile
| Improve this Doc View Source

PoisonMissilePrefab

Declaration
public DaggerfallMissile PoisonMissilePrefab
Field Value
Type Description
DaggerfallMissile
| Improve this Doc View Source

ShockMissilePrefab

Declaration
public DaggerfallMissile ShockMissilePrefab
Field Value
Type Description
DaggerfallMissile

Properties

| Improve this Doc View Source

DiseaseBundles

Declaration
public LiveEffectBundle[] DiseaseBundles { get; }
Property Value
Type Description
LiveEffectBundle[]
| Improve this Doc View Source

DiseaseCount

Declaration
public int DiseaseCount { get; }
Property Value
Type Description
Int32
| Improve this Doc View Source

EffectBundles

Declaration
public LiveEffectBundle[] EffectBundles { get; }
Property Value
Type Description
LiveEffectBundle[]
| Improve this Doc View Source

EffectCount

Declaration
public int EffectCount { get; }
Property Value
Type Description
Int32
| Improve this Doc View Source

EntityBehaviour

Declaration
public DaggerfallEntityBehaviour EntityBehaviour { get; }
Property Value
Type Description
DaggerfallEntityBehaviour
| Improve this Doc View Source

HasReadySpell

Declaration
public bool HasReadySpell { get; }
Property Value
Type Description
Boolean
| Improve this Doc View Source

IsPlayerEntity

Declaration
public bool IsPlayerEntity { get; }
Property Value
Type Description
Boolean
| Improve this Doc View Source

LastSpell

Declaration
public EntityEffectBundle LastSpell { get; }
Property Value
Type Description
EntityEffectBundle
| Improve this Doc View Source

PoisonBundles

Declaration
public LiveEffectBundle[] PoisonBundles { get; }
Property Value
Type Description
LiveEffectBundle[]
| Improve this Doc View Source

PoisonCount

Declaration
public int PoisonCount { get; }
Property Value
Type Description
Int32
| Improve this Doc View Source

ReadySpell

Declaration
public EntityEffectBundle ReadySpell { get; set; }
Property Value
Type Description
EntityEffectBundle

Methods

| Improve this Doc View Source

AbortReadySpell()

Declaration
public void AbortReadySpell()
| Improve this Doc View Source

AssignBundle(EntityEffectBundle, AssignBundleFlags)

Declaration
public void AssignBundle(EntityEffectBundle sourceBundle, AssignBundleFlags flags = AssignBundleFlags.None)
Parameters
Type Name Description
EntityEffectBundle sourceBundle
AssignBundleFlags flags
| Improve this Doc View Source

BreakNormalPowerConcealmentEffects(DaggerfallEntityBehaviour)

Declaration
public static void BreakNormalPowerConcealmentEffects(DaggerfallEntityBehaviour entityBehaviour)
Parameters
Type Name Description
DaggerfallEntityBehaviour entityBehaviour
| Improve this Doc View Source

CastNoAnimSpell()

Declaration
public void CastNoAnimSpell()
| Improve this Doc View Source

CastReadySpell()

Declaration
public void CastReadySpell()
| Improve this Doc View Source

ClearSpellBundles()

Clears all bundles of BundleTypes.Spell.

Declaration
public void ClearSpellBundles()
| Improve this Doc View Source

CreateDisease(Diseases)

Helper to create a classic disease effect bundle.

Declaration
public EntityEffectBundle CreateDisease(Diseases diseaseType)
Parameters
Type Name Description
Diseases diseaseType

Classic disease type.

Returns
Type Description
EntityEffectBundle

EntityEffectBundle.

| Improve this Doc View Source

CreateDisease(String)

Helper to create a disease effect bundle from any effect key. This is just here for testing right now as no custom diseases exist.

Declaration
public EntityEffectBundle CreateDisease(string key)
Parameters
Type Name Description
String key

Effect key to use as infection.

Returns
Type Description
EntityEffectBundle

EntityEffectBundle.

| Improve this Doc View Source

CreateLycanthropyCurse()

Helper to create stage two curse of lycanthropy.

Declaration
public EntityEffectBundle CreateLycanthropyCurse()
Returns
Type Description
EntityEffectBundle

EntityEffectBundle.

| Improve this Doc View Source

CreateLycanthropyDisease(LycanthropyTypes)

Declaration
public EntityEffectBundle CreateLycanthropyDisease(LycanthropyTypes infectionType)
Parameters
Type Name Description
LycanthropyTypes infectionType
Returns
Type Description
EntityEffectBundle
| Improve this Doc View Source

CreatePoison(Poisons)

Helper to create a classic poison effect bundle.

Declaration
public EntityEffectBundle CreatePoison(Poisons poisonType)
Parameters
Type Name Description
Poisons poisonType

Classic poison type.

Returns
Type Description
EntityEffectBundle

EntityEffectBundle.

| Improve this Doc View Source

CreateSpellBundle(String, ElementTypes, Nullable<EffectSettings>)

Creates a simple single-effect spell bundle from the specified effect key.

Declaration
public EntityEffectBundle CreateSpellBundle(string effectKey, ElementTypes element = ElementTypes.Magic, EffectSettings? effectSettings = null)
Parameters
Type Name Description
String effectKey

Effect key to create bundle from.

ElementTypes element

Element type for bundle. Defaults to Magic.

Nullable<EffectSettings> effectSettings

Effect settings. Uses full defaults if null.

Returns
Type Description
EntityEffectBundle

EntityEffectBundle.

| Improve this Doc View Source

CreateVampirismCurse()

Helper to create stage two curse of vampirism.

Declaration
public EntityEffectBundle CreateVampirismCurse()
Returns
Type Description
EntityEffectBundle

EntityEffectBundle.

| Improve this Doc View Source

CreateVampirismDisease()

Helper to create stage one infection disease for vampirism.

Declaration
public EntityEffectBundle CreateVampirismDisease()
Returns
Type Description
EntityEffectBundle

EntityEffectBundle.

| Improve this Doc View Source

CureAll()

Declaration
public void CureAll()
| Improve this Doc View Source

CureAllAttributes()

Declaration
public void CureAllAttributes()
| Improve this Doc View Source

CureAllDiseases()

Declaration
public void CureAllDiseases()
| Improve this Doc View Source

CureAllPoisons()

Declaration
public void CureAllPoisons()
| Improve this Doc View Source

CureAllSkills()

Declaration
public void CureAllSkills()
| Improve this Doc View Source

CureDisease(Diseases)

Declaration
public void CureDisease(Diseases disease)
Parameters
Type Name Description
Diseases disease
| Improve this Doc View Source

DoItemEnchantmentPayloads(EnchantmentPayloadFlags, DaggerfallUnityItem, ItemCollection, DaggerfallEntityBehaviour, Int32)

Executes payloads on enchanted items.

Declaration
public int DoItemEnchantmentPayloads(EnchantmentPayloadFlags flags, DaggerfallUnityItem sourceItem, ItemCollection sourceCollection = null, DaggerfallEntityBehaviour targetEntity = null, int damageIn = 0)
Parameters
Type Name Description
EnchantmentPayloadFlags flags

Payloads to execute. Required by all payloads.

DaggerfallUnityItem sourceItem

Item to execute payloads from. Required by all payloads. Item must be enchanted.

ItemCollection sourceCollection

ItemCollection the enchanted item belongs to. Required by Used payload.

DaggerfallEntityBehaviour targetEntity

Target entity of attack by this entity. Required by Strikes payload.

Int32 damageIn

Input damage before effects. Required by Strikes payload.

Returns
Type Description
Int32

Output damage after effect. Only changes for Strikes payload.

| Improve this Doc View Source

DrinkPotion(DaggerfallUnityItem)

Declaration
public void DrinkPotion(DaggerfallUnityItem item)
Parameters
Type Name Description
DaggerfallUnityItem item
| Improve this Doc View Source

EndIncumbentEffect<T>()

Cancels all remaining rounds of any active incumbent effect of type T and calls End() on that effect. If incumbent effect T is only live effect in bundle then whole bundle will be removed. If other effects remain in bundle then incumbent effect will stop operation and bundle will expire when other effects allow it. Does nothing if no incumbent effect of type T found.

Declaration
public void EndIncumbentEffect<T>()
Type Parameters
Name Description
T

IncumbentEffect type T to end.

| Improve this Doc View Source

EndLycanthropy()

Declaration
public void EndLycanthropy()
| Improve this Doc View Source

EndVampirism()

Declaration
public void EndVampirism()
| Improve this Doc View Source

FindIncumbentEffect<T>()

Searches all effects in all bundles to find incumbent of type T.

Declaration
public IEntityEffect FindIncumbentEffect<T>()
Returns
Type Description
IEntityEffect

Found incumbent effect of type T or null.

Type Parameters
Name Description
T

Effect class to search for.

| Improve this Doc View Source

FindIncumbentEffects<T>()

Searches all effects in all bundles to find all incumbents of type T. Useful for finding all effects inheriting from a specific parent effect.

Declaration
public IEntityEffect[] FindIncumbentEffects<T>()
Returns
Type Description
IEntityEffect[]

All found incumbent effect of type T. Can be null or empty.

Type Parameters
Name Description
T

Effect class to search for.

| Improve this Doc View Source

GetCastSoundID(ElementTypes)

Declaration
public int GetCastSoundID(ElementTypes elementType)
Parameters
Type Name Description
ElementTypes elementType
Returns
Type Description
Int32
| Improve this Doc View Source

GetEffectSaveData(IEntityEffect)

Get full effect save data including effect specific data.

Declaration
public EntityEffectManager.EffectSaveData_v1 GetEffectSaveData(IEntityEffect effect)
Parameters
Type Name Description
IEntityEffect effect
Returns
Type Description
EntityEffectManager.EffectSaveData_v1
| Improve this Doc View Source

GetInstancedBundlesSaveData()

Get instanced bundles save data.

Declaration
public EntityEffectManager.EffectBundleSaveData_v1[] GetInstancedBundlesSaveData()
Returns
Type Description
EntityEffectManager.EffectBundleSaveData_v1[]
| Improve this Doc View Source

GetRacialOverrideEffect()

Gets current racial override effect if one is present. Racial override is a special case effect that is cached when started/resumed on entity. While is possible to use FindIncumbentEffect<T>(), this method is more efficient.

Declaration
public RacialOverrideEffect GetRacialOverrideEffect()
Returns
Type Description
RacialOverrideEffect

RacialOverrideEffect or null.

| Improve this Doc View Source

HasDamagedAttributes()

Declaration
public bool HasDamagedAttributes()
Returns
Type Description
Boolean
| Improve this Doc View Source

HasDamagedSkills()

Declaration
public bool HasDamagedSkills()
Returns
Type Description
Boolean
| Improve this Doc View Source

HasLycanthropy()

Declaration
public bool HasLycanthropy()
Returns
Type Description
Boolean
| Improve this Doc View Source

HasVampirism()

Declaration
public bool HasVampirism()
Returns
Type Description
Boolean
| Improve this Doc View Source

HealAttribute(DFCareer.Stats, Int32)

Searches all effects in all bundles to heal an amount of attribute loss. Will spread healing amount across multiple effects if required.

Declaration
public void HealAttribute(DFCareer.Stats stat, int amount)
Parameters
Type Name Description
DFCareer.Stats stat

Attribute to heal.

Int32 amount

Amount to heal. Must be a positive value.

| Improve this Doc View Source

InstantiateSpellMissile(ElementTypes)

Instantiates a spell missile based on prefabs set to player. Mainly used by player casting and action records that throw spells at player.

Declaration
public DaggerfallMissile InstantiateSpellMissile(ElementTypes elementType)
Parameters
Type Name Description
ElementTypes elementType

Element of missile.

Returns
Type Description
DaggerfallMissile

DaggerfallMissile.

| Improve this Doc View Source

IsEntityImmuneToDisease()

Checks if peered entity is globally immune to disease from career, race, and effect system.

Declaration
public bool IsEntityImmuneToDisease()
Returns
Type Description
Boolean

True if entity immune to disease.

| Improve this Doc View Source

IsEntityImmuneToParalysis()

Checks if peered entity is globally immune to paralysis from career, race, and effect system.

Declaration
public bool IsEntityImmuneToParalysis()
Returns
Type Description
Boolean

True if entity immune to paralysis.

| Improve this Doc View Source

IsTransformedLycanthrope()

Declaration
public bool IsTransformedLycanthrope()
Returns
Type Description
Boolean
| Improve this Doc View Source

LycanthropyType()

Declaration
public LycanthropyTypes LycanthropyType()
Returns
Type Description
LycanthropyTypes
| Improve this Doc View Source

MergeDirectSkillMods(Int32[])

Merge custom skill mods directly into this entity. Changes reset at the start of each magic round.

Declaration
public void MergeDirectSkillMods(int[] skillMods)
Parameters
Type Name Description
Int32[] skillMods

Skill mods array, must be DaggerfallSkills.Count length.

| Improve this Doc View Source

MergeDirectStatMods(Int32[])

Merge custom stat mods directly into this entity. Changes reset at the start of each magic round.

Declaration
public void MergeDirectStatMods(int[] statMods)
Parameters
Type Name Description
Int32[] statMods

Stat mods array, must be DaggerfallStats.Count length.

| Improve this Doc View Source

PlayCastSound(DaggerfallEntityBehaviour, Int32, Boolean)

Declaration
public void PlayCastSound(DaggerfallEntityBehaviour casterEntityBehaviour, int castSoundID, bool throttle = false)
Parameters
Type Name Description
DaggerfallEntityBehaviour casterEntityBehaviour
Int32 castSoundID
Boolean throttle
| Improve this Doc View Source

RaiseOnAddIncumbentState()

Declaration
protected virtual void RaiseOnAddIncumbentState()
| Improve this Doc View Source

RaiseOnAssignBundle(LiveEffectBundle)

Declaration
protected virtual void RaiseOnAssignBundle(LiveEffectBundle bundleAdded)
Parameters
Type Name Description
LiveEffectBundle bundleAdded
| Improve this Doc View Source

RaiseOnCastReadySpell(EntityEffectBundle)

Declaration
protected virtual void RaiseOnCastReadySpell(EntityEffectBundle spell)
Parameters
Type Name Description
EntityEffectBundle spell
| Improve this Doc View Source

RaiseOnNewReadySpell(EntityEffectBundle)

Declaration
protected virtual void RaiseOnNewReadySpell(EntityEffectBundle spell)
Parameters
Type Name Description
EntityEffectBundle spell
| Improve this Doc View Source

RaiseOnRemoveBundle(LiveEffectBundle)

Declaration
protected virtual void RaiseOnRemoveBundle(LiveEffectBundle bundleRemoved)
Parameters
Type Name Description
LiveEffectBundle bundleRemoved
| Improve this Doc View Source

RemoveBundle(LiveEffectBundle)

Declaration
public void RemoveBundle(LiveEffectBundle bundle)
Parameters
Type Name Description
LiveEffectBundle bundle
| Improve this Doc View Source

RestoreInstancedBundleSaveData(EntityEffectManager.EffectBundleSaveData_v1[])

Restore instanced bundles save data.

Declaration
public void RestoreInstancedBundleSaveData(EntityEffectManager.EffectBundleSaveData_v1[] data)
Parameters
Type Name Description
EntityEffectManager.EffectBundleSaveData_v1[] data
| Improve this Doc View Source

SetReadySpell(EntityEffectBundle, Boolean)

Assigns a new spell to be cast. For player entity, this will display "press button to fire spell" message.

Declaration
public bool SetReadySpell(EntityEffectBundle spell, bool noSpellPointCost = false)
Parameters
Type Name Description
EntityEffectBundle spell
Boolean noSpellPointCost
Returns
Type Description
Boolean
| Improve this Doc View Source

SetReadySpell(Int32, Boolean)

Sets ready spell directly from a classic spell index.

Declaration
public bool SetReadySpell(int classicSpellIndex, bool noSpellPointCost = false)
Parameters
Type Name Description
Int32 classicSpellIndex
Boolean noSpellPointCost
Returns
Type Description
Boolean
| Improve this Doc View Source

UpdateHUDSpellIcons()

Allows any effect to update HUD icons when an immediate refresh is required. Example is when an effect ends prematurely due to some condition (e.g. Shield spell busted).

Declaration
public void UpdateHUDSpellIcons()

Events

| Improve this Doc View Source

OnAddIncumbentState

Declaration
public event EntityEffectManager.OnAddIncumbentStateEventHandler OnAddIncumbentState
Event Type
Type Description
EntityEffectManager.OnAddIncumbentStateEventHandler
| Improve this Doc View Source

OnAssignBundle

Declaration
public event EntityEffectManager.OnAssignBundleEventHandler OnAssignBundle
Event Type
Type Description
EntityEffectManager.OnAssignBundleEventHandler
| Improve this Doc View Source

OnCastReadySpell

Declaration
public event EntityEffectManager.OnCastReadySpellEventHandler OnCastReadySpell
Event Type
Type Description
EntityEffectManager.OnCastReadySpellEventHandler
| Improve this Doc View Source

OnNewReadySpell

Declaration
public event EntityEffectManager.OnNewReadySpellEventHandler OnNewReadySpell
Event Type
Type Description
EntityEffectManager.OnNewReadySpellEventHandler
| Improve this Doc View Source

OnRemoveBundle

Declaration
public event EntityEffectManager.OnRemoveBundleEventHandler OnRemoveBundle
Event Type
Type Description
EntityEffectManager.OnRemoveBundleEventHandler

Extension Methods

MBExtensions.Invoke(MonoBehaviour, Action, Single)
MBExtensions.Invoke<T>(MonoBehaviour, Action<T>, T, Single)
MBExtensions.Invoke<T1, T2>(MonoBehaviour, Action<T1, T2>, T1, T2, Single)
MBExtensions.Invoke<T1, T2, T3>(MonoBehaviour, Action<T1, T2, T3>, T1, T2, T3, Single)
MBExtensions.Invoke<T1, T2, T3, T4>(MonoBehaviour, Action<T1, T2, T3, T4>, T1, T2, T3, T4, Single)
  • Improve this Doc
  • View Source
In This Article
Back to top Generated by DocFX