Show / Hide Table of Contents

Class EntityEffectBroker

Enumerates available magic effects and coordinates their instantiation. Also coordinates "magic rounds" at 5-second intervals for all entity EntityEffectManager components active in scene.

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

Constructors

| Improve this Doc View Source

EntityEffectBroker()

Declaration
public EntityEffectBroker()

Fields

| Improve this Doc View Source

CurrentSpellVersion

Declaration
public const int CurrentSpellVersion = 1
Field Value
Type Description
Int32
| Improve this Doc View Source

ElementFlags_All

Declaration
public const ElementTypes ElementFlags_All = ElementTypes.Fire | ElementTypes.Cold | ElementTypes.Poison | ElementTypes.Shock | ElementTypes.Magic
Field Value
Type Description
ElementTypes
| Improve this Doc View Source

ElementFlags_MagicOnly

Declaration
public const ElementTypes ElementFlags_MagicOnly = ElementTypes.Magic
Field Value
Type Description
ElementTypes
| Improve this Doc View Source

ElementFlags_None

Declaration
public const ElementTypes ElementFlags_None = ElementTypes.None
Field Value
Type Description
ElementTypes
| Improve this Doc View Source

MagicCraftingFlags_All

Declaration
public const MagicCraftingStations MagicCraftingFlags_All = MagicCraftingStations.SpellMaker | MagicCraftingStations.PotionMaker | MagicCraftingStations.ItemMaker
Field Value
Type Description
MagicCraftingStations
| Improve this Doc View Source

MagicCraftingFlags_None

Declaration
public const MagicCraftingStations MagicCraftingFlags_None = MagicCraftingStations.None
Field Value
Type Description
MagicCraftingStations
| Improve this Doc View Source

MinimumSupportedSpellVersion

Declaration
public const int MinimumSupportedSpellVersion = 1
Field Value
Type Description
Int32
| Improve this Doc View Source

TargetFlags_All

Declaration
public const TargetTypes TargetFlags_All = TargetTypes.CasterOnly | TargetTypes.ByTouch | TargetTypes.SingleTargetAtRange | TargetTypes.AreaAroundCaster | TargetTypes.AreaAtRange
Field Value
Type Description
TargetTypes
| Improve this Doc View Source

TargetFlags_None

Declaration
public const TargetTypes TargetFlags_None = TargetTypes.None
Field Value
Type Description
TargetTypes
| Improve this Doc View Source

TargetFlags_Other

Declaration
public const TargetTypes TargetFlags_Other = TargetTypes.ByTouch | TargetTypes.SingleTargetAtRange | TargetTypes.AreaAroundCaster | TargetTypes.AreaAtRange
Field Value
Type Description
TargetTypes
| Improve this Doc View Source

TargetFlags_Self

Declaration
public const TargetTypes TargetFlags_Self = TargetTypes.CasterOnly
Field Value
Type Description
TargetTypes

Properties

| Improve this Doc View Source

MagicRoundsSinceStartup

Gets the number of game-minute "magic rounds" since startup. Reset to current game time when player loads a game or starts a new game.

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

StandardSpells

The list of standard spells (aka circinate spells), taken from SPELLS.STD and potentially modified (or added to) by mods

Declaration
public IEnumerable<SpellRecord.SpellRecordData> StandardSpells { get; }
Property Value
Type Description
IEnumerable<SpellRecord.SpellRecordData>
| Improve this Doc View Source

SyntheticTimeIncrease

Gets or sets flag stating if time was just increased synthetically. Should only be raised by fast travel and prison time. Some time-based effects do not operate during these increases, e.g. the "item deteriorates" side-effect This flag is lowered at the end of each magic update.

Declaration
public bool SyntheticTimeIncrease { get; }
Property Value
Type Description
Boolean

Methods

| Improve this Doc View Source

AllEffectsImplemented(SpellRecord.SpellRecordData)

Checks if all classic effects map to an implemented IEntityEffect template.

Declaration
public bool AllEffectsImplemented(SpellRecord.SpellRecordData spellRecordData)
Parameters
Type Name Description
SpellRecord.SpellRecordData spellRecordData

Classic spell record data.

Returns
Type Description
Boolean

True if all classic effects map to an effect template.

| Improve this Doc View Source

ClassicEffectRecordToEffectEntry(SpellRecord.EffectRecordData, out EffectEntry)

Generate EffectEntry from classic EffectRecordData.

Declaration
public bool ClassicEffectRecordToEffectEntry(SpellRecord.EffectRecordData effectRecordData, out EffectEntry effectEntryOut)
Parameters
Type Name Description
SpellRecord.EffectRecordData effectRecordData

Classic effect record data.

EffectEntry effectEntryOut
Returns
Type Description
Boolean

EffectEntry.

| Improve this Doc View Source

ClassicEffectRecordToEffectSettings(SpellRecord.EffectRecordData, Boolean, Boolean, Boolean)

Generate EffectSettings from classic EffectRecordData.

Declaration
public EffectSettings ClassicEffectRecordToEffectSettings(SpellRecord.EffectRecordData effectRecordData, bool supportDuration, bool supportChance, bool supportMagnitude)
Parameters
Type Name Description
SpellRecord.EffectRecordData effectRecordData

Classic effect record data.

Boolean supportDuration
Boolean supportChance
Boolean supportMagnitude
Returns
Type Description
EffectSettings

EffectSettings.

| Improve this Doc View Source

ClassicElementIndexToElementType(Int32)

Maps classic element index to ElementTypes enum.

Declaration
public ElementTypes ClassicElementIndexToElementType(int elementIndex)
Parameters
Type Name Description
Int32 elementIndex

Classic element index.

Returns
Type Description
ElementTypes

ElementTypes.

| Improve this Doc View Source

ClassicSpellRecordDataToEffectBundleSettings(SpellRecord.SpellRecordData, BundleTypes, out EffectBundleSettings)

Generate EffectBundleSettings from classic SpellRecordData.

Declaration
public bool ClassicSpellRecordDataToEffectBundleSettings(SpellRecord.SpellRecordData spellRecordData, BundleTypes bundleType, out EffectBundleSettings effectBundleSettingsOut)
Parameters
Type Name Description
SpellRecord.SpellRecordData spellRecordData

Classic spell record data.

BundleTypes bundleType

Type of bundle to create.

EffectBundleSettings effectBundleSettingsOut

Effect bundle created by conversion.

Returns
Type Description
Boolean

True if successful, otherwise false.

| Improve this Doc View Source

ClassicTargetIndexToTargetType(Int32)

Maps classic target index to TargetTypes.

Declaration
public TargetTypes ClassicTargetIndexToTargetType(int targetIndex)
Parameters
Type Name Description
Int32 targetIndex

Classic target index.

Returns
Type Description
TargetTypes

TargetTypes.

| Improve this Doc View Source

CloneEffect(IEntityEffect)

Clone an effect and its settings.

Declaration
public IEntityEffect CloneEffect(IEntityEffect effect)
Parameters
Type Name Description
IEntityEffect effect

Effect to clone.

Returns
Type Description
IEntityEffect

Interface to cloned effect.

| Improve this Doc View Source

GetClassicSpellRecord(Int32, out SpellRecord.SpellRecordData)

Gets classic spell record data.

Declaration
public bool GetClassicSpellRecord(int id, out SpellRecord.SpellRecordData spellOut)
Parameters
Type Name Description
Int32 id

ID of spell.

SpellRecord.SpellRecordData spellOut

Spell record data (if found).

Returns
Type Description
Boolean

True if spell found, otherwise false.

| Improve this Doc View Source

GetCustomSpellBundleOffer(String)

Gets a specific custom spell bundle offer.

Declaration
public EntityEffectBroker.CustomSpellBundleOffer GetCustomSpellBundleOffer(string key)
Parameters
Type Name Description
String key
Returns
Type Description
EntityEffectBroker.CustomSpellBundleOffer
| Improve this Doc View Source

GetCustomSpellBundleOffers(EntityEffectBroker.CustomSpellBundleOfferUsage)

Gets all custom spell bundle offers based on usage.

Declaration
public EntityEffectBroker.CustomSpellBundleOffer[] GetCustomSpellBundleOffers(EntityEffectBroker.CustomSpellBundleOfferUsage usage = EntityEffectBroker.CustomSpellBundleOfferUsage.All)
Parameters
Type Name Description
EntityEffectBroker.CustomSpellBundleOfferUsage usage
Returns
Type Description
EntityEffectBroker.CustomSpellBundleOffer[]
| Improve this Doc View Source

GetCustomSpellBundles(EntityEffectBroker.CustomSpellBundleOfferUsage)

Gets all custom spell bundles based on usage.

Declaration
public EffectBundleSettings[] GetCustomSpellBundles(EntityEffectBroker.CustomSpellBundleOfferUsage usage = EntityEffectBroker.CustomSpellBundleOfferUsage.All)
Parameters
Type Name Description
EntityEffectBroker.CustomSpellBundleOfferUsage usage
Returns
Type Description
EffectBundleSettings[]
| Improve this Doc View Source

GetEffectPotionRecipe(IEntityEffect, Int32)

Gets PotionRecipe from IEntityEffect. Effect must allow the potion maker crafting station and define potion recipes.

Declaration
public PotionRecipe GetEffectPotionRecipe(IEntityEffect effect, int variant = 0)
Parameters
Type Name Description
IEntityEffect effect

Input effect.

Int32 variant

Variant index, if more than one exists.

Returns
Type Description
PotionRecipe

PotionRecipe if the effect has one, otherwise null.

| Improve this Doc View Source

GetEffectPotionRecipeCount(IEntityEffect)

Gets number of potion properties assigned to this effect. Effect must allow the potion maker crafting station and define potion recipes. Effect

Declaration
public int GetEffectPotionRecipeCount(IEntityEffect effect)
Parameters
Type Name Description
IEntityEffect effect

Input effect.

Returns
Type Description
Int32

Number of recipes for this effect.

| Improve this Doc View Source

GetEffectTemplate(Int32)

Gets interface to effect template from classic key.

Declaration
public IEntityEffect GetEffectTemplate(int classicKey)
Parameters
Type Name Description
Int32 classicKey

Classic key.

Returns
Type Description
IEntityEffect

Interface to effect template only (has default effect settings).

| Improve this Doc View Source

GetEffectTemplate(String)

Gets interface to effect template. Use this to query properties to all effects with this key.

Declaration
public IEntityEffect GetEffectTemplate(string key)
Parameters
Type Name Description
String key

Effect key.

Returns
Type Description
IEntityEffect

Interface to effect template only (has default effect settings).

| Improve this Doc View Source

GetEffectTemplateFromClassicEffectRecordData(SpellRecord.EffectRecordData)

Gets effect template from classic effect record data, if one is available.

Declaration
public IEntityEffect GetEffectTemplateFromClassicEffectRecordData(SpellRecord.EffectRecordData effectRecordData)
Parameters
Type Name Description
SpellRecord.EffectRecordData effectRecordData

Classic effect record data.

Returns
Type Description
IEntityEffect

IEntityEffect of template found or null if no matching template found.

| Improve this Doc View Source

GetEffectTemplates(String, MagicCraftingStations)

Gets interface to all effect templates belonging to group name.

Declaration
public List<IEntityEffect> GetEffectTemplates(string groupName, MagicCraftingStations craftingStations = MagicCraftingStations.SpellMaker | MagicCraftingStations.PotionMaker | MagicCraftingStations.ItemMaker)
Parameters
Type Name Description
String groupName

The group name to collect effects from.

MagicCraftingStations craftingStations

Filter by allowed magic crafting stations.

Returns
Type Description
List<IEntityEffect>

List of effect templates.

| Improve this Doc View Source

GetEnchantmentEffectTemplates(Boolean)

Gets all registered item maker effects. Only classes exposing MagicCraftingStations.ItemMaker in properties will be returned.

Declaration
public List<IEntityEffect> GetEnchantmentEffectTemplates(bool sortAlpha = false)
Parameters
Type Name Description
Boolean sortAlpha

True to sort enchantment names by alpha.

Returns
Type Description
List<IEntityEffect>

List of item enchantment templates.

| Improve this Doc View Source

GetGroupNames(Boolean, MagicCraftingStations)

Gets group names of registered effects.

Declaration
public string[] GetGroupNames(bool sortAlpha = true, MagicCraftingStations craftingStations = MagicCraftingStations.SpellMaker | MagicCraftingStations.PotionMaker | MagicCraftingStations.ItemMaker)
Parameters
Type Name Description
Boolean sortAlpha

True to sort group names by alpha.

MagicCraftingStations craftingStations

Filter by allowed magic crafting stations.

Returns
Type Description
String[]

Array of group names.

| Improve this Doc View Source

GetPotionRecipe(Int32)

Gets PotionRecipe from effect that matches the recipeKey provided.

Declaration
public PotionRecipe GetPotionRecipe(int recipeKey)
Parameters
Type Name Description
Int32 recipeKey

Hashcode of a set of ingredients.

Returns
Type Description
PotionRecipe

PotionRecipe if the key matches one from an effect, otherwise null.

| Improve this Doc View Source

GetPotionRecipeEffect(PotionRecipe)

Gets IEntityEffect from PotionRecipe.

Declaration
public IEntityEffect GetPotionRecipeEffect(PotionRecipe recipe)
Parameters
Type Name Description
PotionRecipe recipe

Input recipe.

Returns
Type Description
IEntityEffect

IEntityEffect if this recipe is linked to an effect, otherwise null.

| Improve this Doc View Source

GetPotionRecipeKeys()

Get recipeKeys for all registered potion recipes.

Declaration
public List<int> GetPotionRecipeKeys()
Returns
Type Description
List<Int32>

List of int recipeKeys

| Improve this Doc View Source

GetSubGroupNames(String, Boolean, MagicCraftingStations)

Gets subgroup names of registered effects.

Declaration
public string[] GetSubGroupNames(string groupName, bool sortAlpha = true, MagicCraftingStations craftingStations = MagicCraftingStations.SpellMaker | MagicCraftingStations.PotionMaker | MagicCraftingStations.ItemMaker)
Parameters
Type Name Description
String groupName

The group name to collect subgroups of.

Boolean sortAlpha

True to sort subgroup names by alpha.

MagicCraftingStations craftingStations

Filter by allowed magic crafting stations.

Returns
Type Description
String[]

Array of subgroup names.

| Improve this Doc View Source

HasEffectTemplate(Int32)

Determine if a classic key exists in the templates dictionary.

Declaration
public bool HasEffectTemplate(int classicKey)
Parameters
Type Name Description
Int32 classicKey

Classic key for template.

Returns
Type Description
Boolean

True if template exists.

| Improve this Doc View Source

HasEffectTemplate(String)

Determine if a key exists in the templates dictionary.

Declaration
public bool HasEffectTemplate(string key)
Parameters
Type Name Description
String key

Key for template.

Returns
Type Description
Boolean

True if template exists.

| Improve this Doc View Source

InstantiateEffect(EffectEntry)

Creates a new instance of effect with specified settings. Use this to create a new effect with unique settings for actual use.

Declaration
public IEntityEffect InstantiateEffect(EffectEntry effectEntry)
Parameters
Type Name Description
EffectEntry effectEntry

EffectEntry with effect settings.

Returns
Type Description
IEntityEffect

Interface to new effect instance.

| Improve this Doc View Source

InstantiateEffect(String, EffectSettings)

Creates a new instance of effect with specified settings. Use this to create a new effect with unique settings for actual use.

Declaration
public IEntityEffect InstantiateEffect(string key, EffectSettings settings)
Parameters
Type Name Description
String key

Effect key.

EffectSettings settings

Effect settings.

Returns
Type Description
IEntityEffect

Interface to new effect instance.

| Improve this Doc View Source

LogRecipeIngredientUsage()

Logs a summary of how many recipes ingredients are used in so new recipes can choose to use little used ingredients. Intended for mod devs, used by invoking 'ingredUsage' console command.

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

RaiseOnEndSyntheticTimeIncreaseEvent()

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

RaiseOnNewMagicRoundEvent()

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

RaiseOnRegisterCustomEffectsEvent()

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

RegisterCustomSpellBundleOffer(EntityEffectBroker.CustomSpellBundleOffer)

Register a custom spell bundle from pre-made settings.

Declaration
public void RegisterCustomSpellBundleOffer(EntityEffectBroker.CustomSpellBundleOffer offer)
Parameters
Type Name Description
EntityEffectBroker.CustomSpellBundleOffer offer

Offer settings.

| Improve this Doc View Source

RegisterEffectTemplate(BaseEntityEffect, Boolean)

Register new effect template with broker. Also maps classic key and potion recipes defined by effect.

Declaration
public bool RegisterEffectTemplate(BaseEntityEffect effect, bool allowReplacement = false)
Parameters
Type Name Description
BaseEntityEffect effect

New effect to register.

Boolean allowReplacement

Allow replacement of existing effect with this key.

Returns
Type Description
Boolean

True if successful.

| Improve this Doc View Source

StartGameBehaviour_OnStartGame(Object, EventArgs)

Declaration
public void StartGameBehaviour_OnStartGame(object sender, EventArgs e)
Parameters
Type Name Description
Object sender
EventArgs e

Events

| Improve this Doc View Source

OnEndSyntheticTimeIncrease

Declaration
public static event EntityEffectBroker.OnEndSyntheticTimeIncreaseEventHandler OnEndSyntheticTimeIncrease
Event Type
Type Description
EntityEffectBroker.OnEndSyntheticTimeIncreaseEventHandler
| Improve this Doc View Source

OnNewMagicRound

Declaration
public static event EntityEffectBroker.OnNewMagicRoundEventHandler OnNewMagicRound
Event Type
Type Description
EntityEffectBroker.OnNewMagicRoundEventHandler
| Improve this Doc View Source

OnRegisterCustomEffects

Declaration
public static event EntityEffectBroker.OnRegisterCustomEffectsEventHandler OnRegisterCustomEffects
Event Type
Type Description
EntityEffectBroker.OnRegisterCustomEffectsEventHandler

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