Show / Hide Table of Contents

Class PotionRecipe

Implements a potion recipe to support equality comparison, hashing, and string output. Internally the recipe is just an array of item template IDs abstracted to an Ingredient type. A recipe can be constructed from any Ingredient[] array or int[] array of item template IDs.

Inheritance
Object
PotionRecipe
Namespace: DaggerfallWorkshop.Game.MagicAndEffects
Assembly: Assembly-CSharp.dll
Syntax
public class PotionRecipe : IEqualityComparer<PotionRecipe.Ingredient[]>

Constructors

| Improve this Doc View Source

PotionRecipe()

Default constructor.

Declaration
public PotionRecipe()
| Improve this Doc View Source

PotionRecipe(List<Int32>)

Ingredient[] array constructor - for finding and comparisons.

Declaration
public PotionRecipe(List<int> ids)
Parameters
Type Name Description
List<Int32> ids

Ingredient ids list.

| Improve this Doc View Source

PotionRecipe(String, Int32, EffectSettings, PotionRecipe.Ingredient[])

Ingredient[] array constructor.

Declaration
public PotionRecipe(string displayNameKey, int price, EffectSettings settings, params PotionRecipe.Ingredient[] ingredients)
Parameters
Type Name Description
String displayNameKey

Potion name key to use for this recipe.

Int32 price

Value of potion in gp.

EffectSettings settings

Settings for this potion recipe.

PotionRecipe.Ingredient[] ingredients

Ingredient array.

| Improve this Doc View Source

PotionRecipe(String, Int32, EffectSettings, Int32[])

int[] array of item template IDs constructor.

Declaration
public PotionRecipe(string displayNameKey, int price, EffectSettings settings, params int[] ids)
Parameters
Type Name Description
String displayNameKey
Int32 price

Value of potion in gp.

EffectSettings settings

Settings for this potion recipe.

Int32[] ids

Array of item template IDs.

Fields

| Improve this Doc View Source

classicRecipeKeys

Declaration
public static readonly int[] classicRecipeKeys
Field Value
Type Description
Int32[]

Properties

| Improve this Doc View Source

CustomDisplayName

Custom display name of this potion recipe. If set, this property will be returned by DisplayName.

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

DisplayName

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

DisplayNameKey

The display name of this potion recipe.

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

Ingredients

Gets or sets potion recipe ingredients. Ingredients must be sorted by id.

Declaration
public PotionRecipe.Ingredient[] Ingredients { get; set; }
Property Value
Type Description
PotionRecipe.Ingredient[]
| Improve this Doc View Source

Price

The price of this potion recipe.

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

SecondaryEffects

Retrieves a list of secondary effect keys.

Declaration
public List<string> SecondaryEffects { get; }
Property Value
Type Description
List<String>
| Improve this Doc View Source

Settings

Gets or sets effect settings for this recipe.

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

TextureRecord

The texture record from archive 205 to use for this potion, default = 11.

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

Methods

| Improve this Doc View Source

AddSecondaryEffect(String)

Adds secondary effects to this potion recipe.

Declaration
public void AddSecondaryEffect(string effectKey)
Parameters
Type Name Description
String effectKey

The EffectKey of the effect to add.

| Improve this Doc View Source

Equals(PotionRecipe.Ingredient[])

Compare a recipe with this one.

Declaration
public bool Equals(PotionRecipe.Ingredient[] ingredients)
Parameters
Type Name Description
PotionRecipe.Ingredient[] ingredients

Other recipe.

Returns
Type Description
Boolean

True if other recipe equal with this one.

| Improve this Doc View Source

Equals(PotionRecipe.Ingredient[], PotionRecipe.Ingredient[])

Compare two recipes for equality.

Declaration
public bool Equals(PotionRecipe.Ingredient[] ingredients1, PotionRecipe.Ingredient[] ingredients2)
Parameters
Type Name Description
PotionRecipe.Ingredient[] ingredients1

First recipe.

PotionRecipe.Ingredient[] ingredients2

Second recipe.

Returns
Type Description
Boolean

True if recipes are equal.

| Improve this Doc View Source

Equals(Object)

Compare another PotionRecipe class with this one.

Declaration
public override bool Equals(object other)
Parameters
Type Name Description
Object other

Other potion recipe class.

Returns
Type Description
Boolean

True if both recipes are equal.

Overrides
Object.Equals(Object)
| Improve this Doc View Source

GetDisplayName()

Declaration
public string GetDisplayName()
Returns
Type Description
String
| Improve this Doc View Source

GetHashCode()

Gets hash code for this recipe.

Declaration
public override int GetHashCode()
Returns
Type Description
Int32

Hash code.

Overrides
Object.GetHashCode()
| Improve this Doc View Source

GetHashCode(PotionRecipe.Ingredient[])

Gets a hash code for recipe from ingredients. Note: Using hash code calculation from: https://stackoverflow.com/questions/263400/what-is-the-best-algorithm-for-an-overridden-system-object-gethashcode

Declaration
public int GetHashCode(PotionRecipe.Ingredient[] ingredients)
Parameters
Type Name Description
PotionRecipe.Ingredient[] ingredients

Ingredients.

Returns
Type Description
Int32

Hash code.

| Improve this Doc View Source

HasRecipe()

Checks if recipe is defined.

Declaration
public bool HasRecipe()
Returns
Type Description
Boolean

True if recipe has at least one ingredient.

| Improve this Doc View Source

ToString()

Gets string listing all ingredients.

Declaration
public override string ToString()
Returns
Type Description
String

Ingredient list.

Overrides
Object.ToString()
  • Improve this Doc
  • View Source
In This Article
Back to top Generated by DocFX