Class WeatherExposureRecipe
A state that exists only where two or more others do at once: soaked AND chilled is frozen, which is not what either one alone means.
[CreateAssetMenu(fileName = "New Weather Exposure Recipe", menuName = "FishMMO/Weather/Exposure Recipe", order = 7)]
public class WeatherExposureRecipe : CachedScriptableObject<WeatherExposureRecipe>, ICachedObject
- Inheritance
-
ObjectScriptableObjectWeatherExposureRecipe
- Implements
- Inherited Members
-
ScriptableObject.SetDirty()ScriptableObject.CreateInstance<T>()Object.GetEntityId()Object.MemberwiseClone()Object.GetInstanceID()Object.GetHashCode()Object.InstantiateAsync<T>(T)Object.InstantiateAsync<T>(T, Transform)Object.InstantiateAsync<T>(T, Vector3, Quaternion)Object.InstantiateAsync<T>(T, Transform, Vector3, Quaternion)Object.Instantiate(Object, Vector3, Quaternion)Object.Instantiate(Object, Vector3, Quaternion, Transform)Object.Instantiate(Object)Object.Instantiate(Object, Scene)Object.Instantiate<T>(T, InstantiateParameters)Object.Instantiate<T>(T, Vector3, Quaternion, InstantiateParameters)Object.Instantiate(Object, Transform)Object.Instantiate<T>(T)Object.Instantiate<T>(T, Vector3, Quaternion)Object.Instantiate<T>(T, Vector3, Quaternion, Transform)Object.Instantiate<T>(T, Transform)Object.Destroy(Object)Object.DestroyImmediate(Object)Object.DontDestroyOnLoad(Object)Object.DestroyObject(Object)Object.FindObjectsOfType<T>()Object.FindObjectsByType<T>(FindObjectsSortMode)Object.FindObjectsByType<T>(FindObjectsInactive, FindObjectsSortMode)Object.FindObjectOfType<T>()Object.FindFirstObjectByType<T>()Object.FindAnyObjectByType<T>()Object.FindFirstObjectByType<T>(FindObjectsInactive)Object.FindAnyObjectByType<T>(FindObjectsInactive)Object.FindObjectsByType<T>()Object.FindObjectsByType<T>(FindObjectsInactive)Object.ToString()Object.nameObject.hideFlags
Remarks
It reads levels, never other recipes. A recipe's ingredients are always WeatherExposureTemplate levels, so the whole set can be evaluated in one pass with no ordering to get right and no way to write a cycle. Two recipes can name the same ingredient, and both hold.
Nothing of it rides the wire. A recipe is a pure function of the levels, and the levels already reconcile — so both peers reach the same verdict from the same numbers, and the reconcile payload does not grow by a byte for any number of recipes. What is NOT derivable is which side of the hysteresis band a recipe was on, and that is re-derived after a reconcile exactly the way a single state's hold is: see WeatherExposureController.
Static content only. Like every template, this holds no runtime state; which recipes a given character currently satisfies lives on that character's controller.
Fields
Buff
[Header("What it does")]
[Tooltip("The buff applied while the recipe holds. Optional — a recipe with no buff is still tracked and still suppresses, which is how a combined state can simply replace its parts.")]
public BaseBuffTemplate Buff
Field Value
Description
[Tooltip("Shown in tooltips and logs. The asset's name is used when this is empty.")]
public string Description
Field Value
Ingredients
[Header("What it takes")]
[Tooltip("Every one of these states must be at or above its level at the same time.")]
public List<WeatherExposureIngredient> Ingredients
Field Value
ReleaseMargin
[Tooltip("How far an ingredient has to fall back below its level before the recipe lets go. Keeps a character sitting exactly on a threshold from flickering in and out of the combined state.")]
[Range(0, 0.5)]
public float ReleaseMargin
Field Value
SuppressIngredients
[Tooltip("Take the ingredients' own buffs off while this one holds, so the combined state replaces its parts instead of stacking three icons on top of each other.")]
public bool SuppressIngredients
Field Value
Properties
DisplayName
public string DisplayName { get; }
Property Value
Methods
IsSatisfied(bool, Func<WeatherExposureTemplate, float>)
Whether the recipe is satisfied, given a way to read each state's level.
public bool IsSatisfied(bool holding, Func<WeatherExposureTemplate, float> levelOf)
Parameters
holdingboolWhether this recipe is currently held, which decides which threshold applies.
levelOfFunc<WeatherExposureTemplate, float>Reads a state's current level, 0..1.
Returns
Remarks
Two thresholds, as everywhere else in exposure: a recipe that is not currently held needs every ingredient at its AtLeast, while one that IS held only lets go once an ingredient drops ReleaseMargin below it. Without the gap, a character standing in weather that parks an ingredient exactly on its threshold would gain and lose the combined buff on alternate ticks.
Uses(WeatherExposureTemplate)
True when this recipe names that state as one of its ingredients.
public bool Uses(WeatherExposureTemplate state)
Parameters
stateWeatherExposureTemplate