Interface IProbabilityInfluence
Provides a dynamic influence value that modifies the effective selection probability of an entry in a ProbabilityList<T> at pick time.
Namespace: Scylla.Core.Util.Random
Assembly: ScyllaCore.dll
Syntax
public interface IProbabilityInfluence
Remarks
Implement this interface on game objects, buffs, status effects, or any runtime system that should dynamically bias how likely a particular item is to be selected. Because Influence is sampled each time a pick is made, the bias can change continuously without rebuilding the probability table.
The Influence value ranges from -1.0 (fully suppress) to
+1.0 (fully boost). A value of 0.0 leaves the base probability
unchanged. Each entry that uses influence has an associated spread range
(InfluenceMin / InfluenceMax on ProbabilityEntry<T>)
that defines what the probability becomes at the extremes.
The effective probability is computed as:
<pre><code class="lang-csharp">effective = base + (influence > 0
? (influenceMax - base) * influence
: (base - influenceMin) * influence)</code></pre>
The result is clamped to a minimum of <code>0.0</code> but is not clamped at the upper
end, so very large <code>InfluenceMax</code> values and a <code>+1.0</code> influence can
significantly dominate other entries after normalization.
Values of Influence outside [-1.0, +1.0] are accepted but
may produce probabilities outside the configured spread range.
Properties
Description
Gets a human-readable label that identifies the source of this influence, useful for debugging and Inspector display.
Declaration
string Description { get; }
Property Value
| Type | Description |
|---|---|
| string | A short descriptive string such as |
Influence
Gets the current influence value in the range [-1.0, +1.0].
Declaration
float Influence { get; }
Property Value
| Type | Description |
|---|---|
| float |
|