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
BaseEntityEffect
Assembly: Assembly-CSharp.dll
Syntax
public abstract class BaseEntityEffect : IEntityEffect, IMacroContextProvider
Constructors
|
Improve this Doc
View Source
BaseEntityEffect()
Declaration
protected BaseEntityEffect()
Fields
|
Improve this Doc
View Source
bypassSavingThrows
Declaration
protected bool bypassSavingThrows
Field Value
|
Improve this Doc
View Source
caster
Declaration
protected DaggerfallEntityBehaviour caster
Field Value
|
Improve this Doc
View Source
currentVariant
Declaration
protected int currentVariant
Field Value
|
Improve this Doc
View Source
manager
Declaration
protected EntityEffectManager manager
Field Value
|
Improve this Doc
View Source
potionProperties
Declaration
protected PotionProperties potionProperties
Field Value
|
Improve this Doc
View Source
properties
Declaration
protected EffectProperties properties
Field Value
|
Improve this Doc
View Source
settings
Declaration
protected EffectSettings settings
Field Value
|
Improve this Doc
View Source
variantCount
Declaration
protected int variantCount
Field Value
Properties
|
Improve this Doc
View Source
BypassSavingThrows
Declaration
public bool BypassSavingThrows { get; }
Property Value
|
Improve this Doc
View Source
Caster
Declaration
public DaggerfallEntityBehaviour Caster { get; }
Property Value
|
Improve this Doc
View Source
ChanceSuccess
Declaration
public virtual bool ChanceSuccess { get; }
Property Value
|
Improve this Doc
View Source
CurrentVariant
Declaration
public int CurrentVariant { get; set; }
Property Value
|
Improve this Doc
View Source
DisplayName
Declaration
public virtual string DisplayName { get; }
Property Value
|
Improve this Doc
View Source
EnchantmentParam
Declaration
public EnchantmentParam? EnchantmentParam { get; set; }
Property Value
|
Improve this Doc
View Source
GroupName
Declaration
public virtual string GroupName { get; }
Property Value
|
Improve this Doc
View Source
HasEnded
Declaration
public bool HasEnded { get; protected set; }
Property Value
|
Improve this Doc
View Source
Key
Declaration
public string Key { get; }
Property Value
|
Improve this Doc
View Source
ParentBundle
Declaration
public LiveEffectBundle ParentBundle { get; set; }
Property Value
|
Improve this Doc
View Source
PotionProperties
Declaration
public virtual PotionProperties PotionProperties { get; }
Property Value
|
Improve this Doc
View Source
Properties
Declaration
public virtual EffectProperties Properties { get; }
Property Value
|
Improve this Doc
View Source
ResistanceMods
Declaration
public int[] ResistanceMods { get; }
Property Value
|
Improve this Doc
View Source
RoundsRemaining
Declaration
public virtual int RoundsRemaining { get; set; }
Property Value
|
Improve this Doc
View Source
Settings
Declaration
public EffectSettings Settings { get; set; }
Property Value
|
Improve this Doc
View Source
SkillMods
Declaration
public int[] SkillMods { get; }
Property Value
|
Improve this Doc
View Source
SpellBookDescription
Declaration
public virtual TextFile.Token[] SpellBookDescription { get; }
Property Value
|
Improve this Doc
View Source
SpellMakerDescription
Declaration
public virtual TextFile.Token[] SpellMakerDescription { get; }
Property Value
|
Improve this Doc
View Source
StatMaxMods
Declaration
public int[] StatMaxMods { get; }
Property Value
|
Improve this Doc
View Source
StatMods
Declaration
public int[] StatMods { get; }
Property Value
|
Improve this Doc
View Source
SubGroupName
Declaration
public virtual string SubGroupName { get; }
Property Value
|
Improve this Doc
View Source
VariantCount
Declaration
public int VariantCount { get; }
Property Value
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
|
Improve this Doc
View Source
ChanceResistanceMod(DFCareer.Elements, Int32)
Declaration
protected void ChanceResistanceMod(DFCareer.Elements resistance, int amount)
Parameters
|
Improve this Doc
View Source
ChanceValue()
Gets final chance value based on caster level and effect settings.
Declaration
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
|
Improve this Doc
View Source
ChangeStatMaxMod(DFCareer.Stats, Int32)
Declaration
protected void ChangeStatMaxMod(DFCareer.Stats stat, int amount)
Parameters
|
Improve this Doc
View Source
ChangeStatMod(DFCareer.Stats, Int32)
Declaration
protected void ChangeStatMod(DFCareer.Stats stat, int amount)
Parameters
|
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
|
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
|
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
Returns
|
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
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
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
Returns
|
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
Returns
|
Improve this Doc
View Source
GetMacroDataSource()
Declaration
public virtual MacroDataSource GetMacroDataSource()
Returns
|
Improve this Doc
View Source
GetMagnitude(DaggerfallEntityBehaviour)
Declaration
protected int GetMagnitude(DaggerfallEntityBehaviour caster = null)
Parameters
Returns
|
Improve this Doc
View Source
GetPeeredEntityBehaviour(EntityEffectManager)
Declaration
protected DaggerfallEntityBehaviour GetPeeredEntityBehaviour(EntityEffectManager manager)
Parameters
Returns
|
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
|
Improve this Doc
View Source
GetSkillMod(DFCareer.Skills)
Gets the skill modifier of the effect.
Declaration
protected int GetSkillMod(DFCareer.Skills skill)
Parameters
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
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
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
Returns
|
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
Returns
|
Improve this Doc
View Source
MakeEffectCosts(Single, Single, Single)
Declaration
public static EffectCosts MakeEffectCosts(float costA, float costB, float offsetGold = 0F)
Parameters
Returns
|
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
|
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
|
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
|
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
Returns
|
Improve this Doc
View Source
SetEffectDuration(EffectSettings, Int32, Int32, Int32)
Declaration
public static EffectSettings SetEffectDuration(EffectSettings settings, int durationBase, int durationPlus, int durationPerLevel)
Parameters
Returns
|
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
Returns
|
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
|
Improve this Doc
View Source
SetSkillMod(DFCareer.Skills, Int32)
Declaration
protected void SetSkillMod(DFCareer.Skills skill, int value)
Parameters
|
Improve this Doc
View Source
SetStatMaxMod(DFCareer.Stats, Int32)
Declaration
protected void SetStatMaxMod(DFCareer.Stats stat, int value)
Parameters
|
Improve this Doc
View Source
SetStatMod(DFCareer.Stats, Int32)
Declaration
protected void SetStatMod(DFCareer.Stats stat, int value)
Parameters
|
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
Implements