Show / Hide Table of Contents

Class BaseEntityEffect

Base implementation of an entity effect. Entity effects are like "actions" for spells, potions, items, advantages, diseases, etc. They generally perform work against one or more entities (e.g. damage or restore health). Some effects perform highly custom operations unique to player (e.g. anchor/teleport UI). Magic effects are scripted in C# so they have full access to engine and UI as required. Classic magic effects are included in build for cross-platform compatibility. Custom effects can be added later using mod system (todo:).

Inheritance
Object
BaseEntityEffect
AbsorbsSpells
AzurasStarEffect
BadReactionsFrom
BadRepWith
CastWhenHeld
CastWhenStrikes
CastWhenUsed
CharmEffect
CreateItem
CureDisease
CureParalyzation
CurePoison
DamageFatigue
DamageHealth
DamageSpellPoints
Disintegrate
DispelDaedra
DispelMagic
DispelUndead
EnhancesSkill
ExtraSpellPts
ExtraWeight
FeatherWeight
GoodRepWith
HealEffect
HealFatigue
HealHealth
HealSpellPoints
HealthLeech
Identify
ImprovesTalents
IncreasedWeightAllowance
IncumbentEffect
ItemDeteriorates
LowDamageVs
MasqueOfClavicusEffect
MehrunesRazorEffect
MorphSelf
OghmaInfiniumEffect
PacifyEffect
PotentVs
RegensHealth
RepairsObjects
RingOfNamiraEffect
SanguineRoseEffect
SoulBound
StrengthensArmor
Teleport
TransferFatigue
TransferHealth
UserTakesDamage
VampiricEffect
WabbajackEffect
WeakensArmor
Implements
IEntityEffect
IMacroContextProvider
Namespace: DaggerfallWorkshop.Game.MagicAndEffects
Assembly: Assembly-CSharp.dll
Syntax
public abstract class BaseEntityEffect : IEntityEffect, IMacroContextProvider

Constructors

| Improve this Doc View Source

BaseEntityEffect()

Default constructor.

Declaration
protected BaseEntityEffect()

Fields

| Improve this Doc View Source

bypassSavingThrows

Declaration
protected bool bypassSavingThrows
Field Value
Type Description
Boolean
| Improve this Doc View Source

caster

Declaration
protected DaggerfallEntityBehaviour caster
Field Value
Type Description
DaggerfallEntityBehaviour
| Improve this Doc View Source

currentVariant

Declaration
protected int currentVariant
Field Value
Type Description
Int32
| Improve this Doc View Source

manager

Declaration
protected EntityEffectManager manager
Field Value
Type Description
EntityEffectManager
| Improve this Doc View Source

potionProperties

Declaration
protected PotionProperties potionProperties
Field Value
Type Description
PotionProperties
| Improve this Doc View Source

properties

Declaration
protected EffectProperties properties
Field Value
Type Description
EffectProperties
| Improve this Doc View Source

settings

Declaration
protected EffectSettings settings
Field Value
Type Description
EffectSettings
| Improve this Doc View Source

variantCount

Declaration
protected int variantCount
Field Value
Type Description
Int32

Properties

| Improve this Doc View Source

BypassSavingThrows

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

Caster

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

ChanceSuccess

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

CurrentVariant

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

DisplayName

Declaration
public virtual string DisplayName { get; }
Property Value
Type Description
String
| Improve this Doc View Source

EnchantmentParam

Declaration
public EnchantmentParam? EnchantmentParam { get; set; }
Property Value
Type Description
Nullable<EnchantmentParam>
| Improve this Doc View Source

GroupName

Declaration
public virtual string GroupName { get; }
Property Value
Type Description
String
| Improve this Doc View Source

HasEnded

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

Key

Declaration
public string Key { get; }
Property Value
Type Description
String
| Improve this Doc View Source

ParentBundle

Declaration
public LiveEffectBundle ParentBundle { get; set; }
Property Value
Type Description
LiveEffectBundle
| Improve this Doc View Source

PotionProperties

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

Properties

Declaration
public virtual EffectProperties Properties { get; }
Property Value
Type Description
EffectProperties
| Improve this Doc View Source

ResistanceMods

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

RoundsRemaining

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

Settings

Declaration
public EffectSettings Settings { get; set; }
Property Value
Type Description
EffectSettings
| Improve this Doc View Source

SkillMods

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

SpellBookDescription

Declaration
public virtual TextFile.Token[] SpellBookDescription { get; }
Property Value
Type Description
TextFile.Token[]
| Improve this Doc View Source

SpellMakerDescription

Declaration
public virtual TextFile.Token[] SpellMakerDescription { get; }
Property Value
Type Description
TextFile.Token[]
| Improve this Doc View Source

StatMaxMods

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

StatMods

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

SubGroupName

Declaration
public virtual string SubGroupName { get; }
Property Value
Type Description
String
| Improve this Doc View Source

VariantCount

Declaration
public int VariantCount { get; }
Property Value
Type Description
Int32

Methods

| Improve this Doc View Source

AllAttributesHealed()

Checks if all damaged attributes are healed back to 0.

Declaration
public bool AllAttributesHealed()
Returns
Type Description
Boolean

True if all attributes have returned to baseline.

| Improve this Doc View Source

AllSkillsHealed()

Checks if all damaged skills are healed back to 0.

Declaration
public bool AllSkillsHealed()
Returns
Type Description
Boolean

True if all skills have returned to baseline.

| Improve this Doc View Source

AssignPotionRecipes(PotionRecipe[])

Declaration
protected void AssignPotionRecipes(params PotionRecipe[] recipes)
Parameters
Type Name Description
PotionRecipe[] recipes
| Improve this Doc View Source

ChanceResistanceMod(DFCareer.Elements, Int32)

Declaration
protected void ChanceResistanceMod(DFCareer.Elements resistance, int amount)
Parameters
Type Name Description
DFCareer.Elements resistance
Int32 amount
| Improve this Doc View Source

ChanceValue()

Gets final chance value based on caster level and effect settings.

Declaration
public int ChanceValue()
Returns
Type Description
Int32

Chance value.

| Improve this Doc View Source

ChangeSkillMod(DFCareer.Skills, Int32)

Declaration
protected void ChangeSkillMod(DFCareer.Skills skill, int amount)
Parameters
Type Name Description
DFCareer.Skills skill
Int32 amount
| Improve this Doc View Source

ChangeStatMaxMod(DFCareer.Stats, Int32)

Declaration
protected void ChangeStatMaxMod(DFCareer.Stats stat, int amount)
Parameters
Type Name Description
DFCareer.Stats stat
Int32 amount
| Improve this Doc View Source

ChangeStatMod(DFCareer.Stats, Int32)

Declaration
protected void ChangeStatMod(DFCareer.Stats stat, int amount)
Parameters
Type Name Description
DFCareer.Stats stat
Int32 amount
| Improve this Doc View Source

CompareSettings(IEntityEffect)

Helper to compare the settings of this effect with another effect. Used to determine if the Duration, Chance, Magnitude settings are equivalent in both effects.

Declaration
public virtual bool CompareSettings(IEntityEffect other)
Parameters
Type Name Description
IEntityEffect other

Other effect for comparison.

Returns
Type Description
Boolean
| Improve this Doc View Source

ConstantEffect()

Called for effects that need to perform work each frame, such as setting a toggle in entity.

Declaration
public virtual void ConstantEffect()
| Improve this Doc View Source

CureAttributeDamage()

Cure all attribute damage by this effect.

Declaration
public virtual void CureAttributeDamage()
| Improve this Doc View Source

CureSkillDamage()

Cure all skill damage by this effect.

Declaration
public virtual void CureSkillDamage()
| Improve this Doc View Source

DefaultEffectSettings()

Declaration
public static EffectSettings DefaultEffectSettings()
Returns
Type Description
EffectSettings
| Improve this Doc View Source

EnchantmentPayloadCallback(EnchantmentPayloadFlags, Nullable<EnchantmentParam>, DaggerfallEntityBehaviour, DaggerfallEntityBehaviour, DaggerfallUnityItem, Int32)

Enchantment payload callback for enchantment to perform custom execution based on context. These callbacks are performed directly from template, not from a live instance of effect. Do not store state in effect during callbacks. Not used by EnchantmentPayloadFlags.Held - rather, an effect instance bundle is assigned to entity's effect manager to execute as normal.

Declaration
public virtual PayloadCallbackResults? EnchantmentPayloadCallback(EnchantmentPayloadFlags context, EnchantmentParam? param = null, DaggerfallEntityBehaviour sourceEntity = null, DaggerfallEntityBehaviour targetEntity = null, DaggerfallUnityItem sourceItem = null, int sourceDamage = 0)
Parameters
Type Name Description
EnchantmentPayloadFlags context
Nullable<EnchantmentParam> param
DaggerfallEntityBehaviour sourceEntity
DaggerfallEntityBehaviour targetEntity
DaggerfallUnityItem sourceItem
Int32 sourceDamage
Returns
Type Description
Nullable<PayloadCallbackResults>
| Improve this Doc View Source

End()

Called to perform any cleanup at end of lifetime, or when manually removed from host.

Declaration
public virtual void End()
| Improve this Doc View Source

GetAttributeMaximumMod(DFCareer.Stats)

Gets the attribute maximum modifier of this effect.

Declaration
public int GetAttributeMaximumMod(DFCareer.Stats stat)
Parameters
Type Name Description
DFCareer.Stats stat

Attribute to query.

Returns
Type Description
Int32

Current attribute maximum modifier.

| Improve this Doc View Source

GetAttributeMod(DFCareer.Stats)

Gets the attribute modifier of this effect.

Declaration
public int GetAttributeMod(DFCareer.Stats stat)
Parameters
Type Name Description
DFCareer.Stats stat

Attribute to query.

Returns
Type Description
Int32

Current attribute modifier.

| Improve this Doc View Source

GetEnchantmentSettings()

Gets all enchantment settings supported by this effect. Effects supporting MagicCraftingStations.ItemMaker must implement this method to become usable in item maker. The effect must also be able to execute enchantment payload when handed back settings.

Declaration
public virtual EnchantmentSettings[] GetEnchantmentSettings()
Returns
Type Description
EnchantmentSettings[]

EnchantmentSettings array. Can return null or empty array.

| Improve this Doc View Source

GetEnchantmentSettings(EnchantmentParam)

Helper to get specific enchantment based on param.

Declaration
public virtual EnchantmentSettings? GetEnchantmentSettings(EnchantmentParam param)
Parameters
Type Name Description
EnchantmentParam param

Param of enchantment to retrieve.

Returns
Type Description
Nullable<EnchantmentSettings>

EnchantmentSettings for specificed param or null if not found.

| Improve this Doc View Source

GetForcedEnchantments(Nullable<EnchantmentParam>)

Gets related enchantments that will be forced onto item along with this enchantment. Only used by Soul Bound in classic gameplay.

Declaration
public virtual ForcedEnchantmentSet? GetForcedEnchantments(EnchantmentParam? param = null)
Parameters
Type Name Description
Nullable<EnchantmentParam> param
Returns
Type Description
Nullable<ForcedEnchantmentSet>
| Improve this Doc View Source

GetMacroDataSource()

Declaration
public virtual MacroDataSource GetMacroDataSource()
Returns
Type Description
MacroDataSource
| Improve this Doc View Source

GetMagnitude(DaggerfallEntityBehaviour)

Declaration
protected int GetMagnitude(DaggerfallEntityBehaviour caster = null)
Parameters
Type Name Description
DaggerfallEntityBehaviour caster
Returns
Type Description
Int32
| Improve this Doc View Source

GetPeeredEntityBehaviour(EntityEffectManager)

Declaration
protected DaggerfallEntityBehaviour GetPeeredEntityBehaviour(EntityEffectManager manager)
Parameters
Type Name Description
EntityEffectManager manager
Returns
Type Description
DaggerfallEntityBehaviour
| Improve this Doc View Source

GetSaveData()

Override to provide save data for effect. Not all effects need to be stateful.

Declaration
public virtual object GetSaveData()
Returns
Type Description
Object
| Improve this Doc View Source

GetSkillMod(DFCareer.Skills)

Gets the skill modifier of the effect.

Declaration
protected int GetSkillMod(DFCareer.Skills skill)
Parameters
Type Name Description
DFCareer.Skills skill

Skill to query.

Returns
Type Description
Int32

Current skill modifier.

| Improve this Doc View Source

HasEnchantmentPayloadFlags(EnchantmentPayloadFlags)

Helper to check if properties contain the specified enchantment payload flags

Declaration
public virtual bool HasEnchantmentPayloadFlags(EnchantmentPayloadFlags flags)
Parameters
Type Name Description
EnchantmentPayloadFlags flags

Flags to check.

Returns
Type Description
Boolean

True if flags specified.

| Improve this Doc View Source

HasItemMakerFlags(ItemMakerFlags)

Helper to check properties carry specified item maker flags.

Declaration
public virtual bool HasItemMakerFlags(ItemMakerFlags flags)
Parameters
Type Name Description
ItemMakerFlags flags

Flags to check.

Returns
Type Description
Boolean

True if flags specified.

| Improve this Doc View Source

HealAttributeDamage(DFCareer.Stats, Int32)

Heal attribute damage by amount. Does nothing if this effect does not damage attributes. Attribute will not heal past 0.

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

Attribute to heal.

Int32 amount

Amount to heal. Must be positive value.

| Improve this Doc View Source

HealSkillDamage(DFCareer.Skills, Int32)

Heal skill damage by amount. Does nothing if this effect does not damage skills. Skill will not heal past 0.

Declaration
public virtual void HealSkillDamage(DFCareer.Skills skill, int amount)
Parameters
Type Name Description
DFCareer.Skills skill

Skill to heal.

Int32 amount

Amount to heal. Must be positive value.

| Improve this Doc View Source

IsEnchantmentExclusiveTo(EnchantmentSettings[], Nullable<EnchantmentParam>)

Enchantment can flag that it is exclusive to one or more enchantments in array provided. Used by enchanting window to prevent certain enchantments from being selected together.

Declaration
public virtual bool IsEnchantmentExclusiveTo(EnchantmentSettings[] settingsToTest, EnchantmentParam? comparerParam = null)
Parameters
Type Name Description
EnchantmentSettings[] settingsToTest
Nullable<EnchantmentParam> comparerParam
Returns
Type Description
Boolean
| Improve this Doc View Source

MagicRound()

Called to execute effect payload on host and count down a magic round. Child classes must call base.MagicRound() when overriding to properly count rounds.

Declaration
public virtual void MagicRound()
| Improve this Doc View Source

MakeClassicKey(Byte, Byte, BaseEntityEffect.ClassicEffectFamily)

Declaration
public static int MakeClassicKey(byte groupIndex, byte subgroupIndex, BaseEntityEffect.ClassicEffectFamily family = BaseEntityEffect.ClassicEffectFamily.Spells)
Parameters
Type Name Description
Byte groupIndex
Byte subgroupIndex
BaseEntityEffect.ClassicEffectFamily family
Returns
Type Description
Int32
| Improve this Doc View Source

MakeEffectCosts(Single, Single, Single)

Declaration
public static EffectCosts MakeEffectCosts(float costA, float costB, float offsetGold = 0F)
Parameters
Type Name Description
Single costA
Single costB
Single offsetGold
Returns
Type Description
EffectCosts
| Improve this Doc View Source

PlayerAggro()

Declaration
protected void PlayerAggro()
| Improve this Doc View Source

RemoveRound()

Called to remove a magic round. Child classes should call base.RemoveRound() when overriding to properly count rounds. Otherwise child class will need to manually count rounds.

Declaration
protected virtual int RemoveRound()
Returns
Type Description
Int32
| Improve this Doc View Source

RestoreSaveData(Object)

Override to restore save data for effect.

Declaration
public virtual void RestoreSaveData(object dataIn)
Parameters
Type Name Description
Object dataIn
| Improve this Doc View Source

Resume(EntityEffectManager.EffectSaveData_v1, EntityEffectManager, DaggerfallEntityBehaviour)

Restarts effect running after deserialization. Does not execute a MagicRound() tick.

Declaration
public virtual void Resume(EntityEffectManager.EffectSaveData_v1 effectData, EntityEffectManager manager, DaggerfallEntityBehaviour caster = null)
Parameters
Type Name Description
EntityEffectManager.EffectSaveData_v1 effectData
EntityEffectManager manager
DaggerfallEntityBehaviour caster
| Improve this Doc View Source

ReverseClasicKey(Int32, out Byte, out Byte, out BaseEntityEffect.ClassicEffectFamily)

Declaration
public static void ReverseClasicKey(int key, out byte groupIndex, out byte subgroupIndex, out BaseEntityEffect.ClassicEffectFamily family)
Parameters
Type Name Description
Int32 key
Byte groupIndex
Byte subgroupIndex
BaseEntityEffect.ClassicEffectFamily family
| Improve this Doc View Source

RollChance()

Performs a chance roll for this effect based on chance settings.

Declaration
public virtual bool RollChance()
Returns
Type Description
Boolean

True if chance roll succeeded.

| Improve this Doc View Source

SetEffectChance(EffectSettings, Int32, Int32, Int32)

Declaration
public static EffectSettings SetEffectChance(EffectSettings settings, int chanceBase, int chancePlus, int chancePerLevel)
Parameters
Type Name Description
EffectSettings settings
Int32 chanceBase
Int32 chancePlus
Int32 chancePerLevel
Returns
Type Description
EffectSettings
| Improve this Doc View Source

SetEffectDuration(EffectSettings, Int32, Int32, Int32)

Declaration
public static EffectSettings SetEffectDuration(EffectSettings settings, int durationBase, int durationPlus, int durationPerLevel)
Parameters
Type Name Description
EffectSettings settings
Int32 durationBase
Int32 durationPlus
Int32 durationPerLevel
Returns
Type Description
EffectSettings
| Improve this Doc View Source

SetEffectMagnitude(EffectSettings, Int32, Int32, Int32, Int32, Int32)

Declaration
public static EffectSettings SetEffectMagnitude(EffectSettings settings, int magnitudeBaseMin, int magnitudeBaseMax, int magnitudePlusMin, int magnitudePlusMax, int magnitudePerLevel)
Parameters
Type Name Description
EffectSettings settings
Int32 magnitudeBaseMin
Int32 magnitudeBaseMax
Int32 magnitudePlusMin
Int32 magnitudePlusMax
Int32 magnitudePerLevel
Returns
Type Description
EffectSettings
| Improve this Doc View Source

SetPotionProperties()

Declaration
public virtual void SetPotionProperties()
| Improve this Doc View Source

SetProperties()

Declaration
public abstract void SetProperties()
| Improve this Doc View Source

SetResistanceMod(DFCareer.Elements, Int32)

Declaration
protected void SetResistanceMod(DFCareer.Elements resistance, int amount)
Parameters
Type Name Description
DFCareer.Elements resistance
Int32 amount
| Improve this Doc View Source

SetSkillMod(DFCareer.Skills, Int32)

Declaration
protected void SetSkillMod(DFCareer.Skills skill, int value)
Parameters
Type Name Description
DFCareer.Skills skill
Int32 value
| Improve this Doc View Source

SetStatMaxMod(DFCareer.Stats, Int32)

Declaration
protected void SetStatMaxMod(DFCareer.Stats stat, int value)
Parameters
Type Name Description
DFCareer.Stats stat
Int32 value
| Improve this Doc View Source

SetStatMod(DFCareer.Stats, Int32)

Declaration
protected void SetStatMod(DFCareer.Stats stat, int value)
Parameters
Type Name Description
DFCareer.Stats stat
Int32 value
| Improve this Doc View Source

Start(EntityEffectManager, DaggerfallEntityBehaviour)

Starts effect running when first attached to an entity. Executes a MagicRound() tick immediately. Child classes must call base.Start() when overriding. NOTE: Start() is only called when effect is first instantiated - it not called again on load, see Resume().

Declaration
public virtual void Start(EntityEffectManager manager, DaggerfallEntityBehaviour caster = null)
Parameters
Type Name Description
EntityEffectManager manager
DaggerfallEntityBehaviour caster

Implements

IEntityEffect
IMacroContextProvider
  • Improve this Doc
  • View Source
In This Article
Back to top Generated by DocFX