A class in Root.Township, Alta.Liquid.
Describes a liquid: its colour and visual, the alchemy effects it applies, and any chunk visuals. Liquid containers hold it, save it and sync it.
Constructors
Fields
| Member | What it is |
|---|
const int MaxNumberOfEffects | Upper bound for the number of effects. The network code allows up to 1023. |
8 private and internal fields
| Member | What it is |
|---|
private LiquidVisualChunkDefinition[] chunkVisuals | Backing field for ChunkVisuals: floating chunk visuals (such as food bits) shown in the liquid. |
private Color colorTint | Backing field for ColorTint. Multiplied by the visual's colour for TintedLiquidColor. |
private CookableItem[] cookablesUsed | Backing field for CookablesUsed, the cooked items that went into this liquid. Not saved or synced here. |
private EffectDefinitionApplication[] effects | Backing field for Effects, the effects Apply runs on whoever drinks or is splashed. |
private bool isConsumableThroughSkin | Backing field for IsConsumableThroughSkin. Splash liquids (such as the teleport potion) apply on particle contact. |
private LiquidVisualData liquidVisual | Backing field for LiquidVisual, the liquid's look and base colour. |
private static Logger logger | NLog logger for this class. |
private float splashParticlesStrength | Backing field for SplashParticlesStrength: effect strength when applied by splash particles. 1 by default. |
Properties
| Member | What it is |
|---|
IEnumerable<LiquidVisualChunkDefinition> ChunkVisuals { get; } | Visuals for solid chunks floating in the liquid. |
Color ColorTint { get; } | Tint applied over the visual's colour. |
CookableItem[] CookablesUsed { get; } | Cookable ingredients that went into the liquid. Not saved or synced. |
IEnumerable<EffectDefinitionApplication> Effects { get; } | Effects applied when the liquid is consumed or splashed. |
bool IsConsumableThroughSkin { get; } | True for splash liquids (such as the teleport potion) that work on contact. |
LiquidVisualData LiquidVisual { get; } | Base visual data for the liquid. |
float SplashParticlesStrength { get; } | Strength for splash particles when consumable through skin. |
Color TintedLiquidColor { get; } | The visual's colour times the tint. |
Methods
| Member | What it is |
|---|
void Apply(EffectHandler target, float strength) | Server: applies all its effects to a target at the given strength. Logs an error on a client. |
override bool Equals(object obj) | True if colour, visual, skin flag, effects and chunk visuals all match (effects and chunks in any order). |
override int GetHashCode() | Hash of the colour, visual, skin flag and the effect and chunk arrays. |
LiquidContainerSaveData.CustomData GetSave() | Builds save data with the colour, skin flag, visual, effects and chunks. |
void Load(LiquidContainerSaveData.CustomData data) | Fills the liquid from save data. |
static bool op_Equality(LiquidData a, LiquidData b) | Compares with Equals; two nulls are equal. |
static bool op_Inequality(LiquidData a, LiquidData b) | Opposite of ==. |
void Serialize(Stream stream) | Reads or writes the colour, skin flag, visual, effects and chunk visuals on a network stream. |
2 private and internal methods
| Member | What it is |
|---|
private void SerializeChunksArray(Stream stream) | Reads or writes the chunk visuals as a count and their hashes. |
private void SerializeEffectsArray(Stream stream) | Reads or writes the effect applications as a count and each entry. |
Used in
Members of other types that take, return or hold a LiquidData:
CookingLiquidVisual.SetLiquid, CookingLiquidVisual.SetLODRendererPropertyBlockFromLiquid, CookingLiquidVisual.SetPropertyBlockFromLiquid, BoilingParticles.SetupForLiquid, BottledLiquid.SetLODRendererPropertyBlockFromLiquid, BottledLiquid.SetPropertyBlockFromLiquid, LiquidContainerLid.AddFilter, LiquidContent.Data, LiquidDataEventHandler.BeginInvoke, LiquidDataEventHandler.Invoke, LiquidDefinition.data, LiquidDefinition.Data, LiquidFillFilter.BeginInvoke, LiquidFillFilter.Invoke, LiquidSurfaceVisual.Liquid, LiquidSurfaceVisual.SetLiquid, LiquidSurfaceVisual.SetLODRendererPropertyBlockFromLiquid, LiquidSurfaceVisual.SetMaterialsAcordingToLiquid, LiquidSurfaceVisual.SetPropertyBlockFromLiquid, PickupLiquidContainerEnabler.FilterLiquidAdding, PotionImpactColorer.SetToLiquid, ColoredPooledParticleSpawner.LiquidData, ConsumptionManager.CanConsumeLiquid, ConsumptionManager.HandleFailedDrinking, LiquidParticlesRendererColorer.ColorToLiquid, LiquidParticlesRendererColorer.OverrideLiquidColorToTintedOnPouringRenderers, LiquidParticlesRendererColorer.SetParticleRenderersMaterials, PlayerDrinkingMouth.HandleLiquidAdd.