Skip to main content

Chance

A class in Root.Township, Alta.Intelligence.

Scoring rule that rolls a dice on every evaluation: returns success with probability chance, otherwise failure. Made by CreateTargetOperation.Chance.

Constructors​

MemberWhat it is
Chance(float chance, float success = 1, float failure = 0)Creates a Chance from chance, success and failure.

Fields​

3 private and internal fields
MemberWhat it is
private float chanceProbability of success, 0 to 1.
private float failureValue returned on a failed roll (default 0).
private float successValue returned on a successful roll (default 1).

Methods​

MemberWhat it is
override float Evaluate(Agent agent, ITarget target)Rolls Random.value and returns success if it's below chance, else failure.
override string ToString()Returns "Chance".