Table of Contents

Class MixReactions

Namespace
S1API.Products
Assembly
S1API.dll

Registers custom mixing reactions: deterministic rules that transform the effects a mix produces. A rule fires when a product is mixed with an ingredient contributing a specific effect and the result already carries another specific effect, letting mods build combo and chain effects.

public static class MixReactions
Inheritance
MixReactions
Inherited Members

Remarks

Rules are applied after the game's own mixing calculation, on every client (the calculation is deterministic, so no networking is required as long as every peer has the same rules and effects).

Methods

AddRule(PropertyBase, PropertyBase, PropertyBase, DrugType?, bool)

Adds a mixing reaction rule.

public static void AddRule(PropertyBase mixerEffect, PropertyBase whenResultContains, PropertyBase addResult, DrugType? drug = null, bool replaceMatched = false)

Parameters

mixerEffect PropertyBase

The effect the mixed-in ingredient contributes (drives this reaction).

whenResultContains PropertyBase

An effect that must already be present in the mix result for the rule to fire.

addResult PropertyBase

The effect produced by the reaction.

drug DrugType?

Restrict the rule to a specific drug, or null to apply to all drugs.

replaceMatched bool

If true, the produced effect replaces whenResultContains; if false, it is added alongside it (up to the 8-effect cap).

Clear()

Removes all registered mixing reaction rules.

public static void Clear()