Table of Contents

Class ChoicePromptInfo.Option

Namespace
TinyLife.Actions
Assembly
Tiny Life.dll

An option is a possible action and outcome for a ChoicePromptInfo. It is randomly chosen to be correct or incorrect, based on a multitude of factors that can be specified in the constructors.

public class ChoicePromptInfo.Option
Inheritance
ChoicePromptInfo.Option
Inherited Members
Extension Methods

Constructors

Option(string, Action<ChoicePromptInfo, Person>, Action<ChoicePromptInfo, Person>, Func<Person, float>)

Creates a new option with the given generic settings.

public Option(string name, Action<ChoicePromptInfo, Person> successAction, Action<ChoicePromptInfo, Person> failAction, Func<Person, float> successChance)

Parameters

name string

This option's name, which will be localized.

successAction Action<ChoicePromptInfo, Person>

The action that should be invoked when this option is chosen as the correct option when the player selects it.

failAction Action<ChoicePromptInfo, Person>

The action that should be invoked when this option is chosen as the incorrect option when the player selects it.

successChance Func<Person, float>

A function that determines the success change of this choice prompt option once it's chosen, which is expected to be a value between 0 and 1.

Option(string, Func<Person, float>, Func<Person, float>, Func<Person, float>)

Creates a new option with the given job-related outcomes.

public Option(string name, Func<Person, float> jobPerformanceGained, Func<Person, float> jobPerformanceLost, Func<Person, float> successChance)

Parameters

name string

This option's name, which will be localized.

jobPerformanceGained Func<Person, float>

A function that returns the amount of job performance that should be gained when the correct option is selected by the player.

jobPerformanceLost Func<Person, float>

A function that returns the amount of job performance that should be lost when the incorrect option is selected by the player.

successChance Func<Person, float>

A function that determines the success change of this choice prompt option once it's chosen, which is expected to be a value between 0 and 1.

Option(string, EmotionType, SkillType, float, float, float)

Creates a new option with the given job-related outcomes.

public Option(string name, EmotionType successIncreaseEmotion = null, SkillType successIncreaseSkill = null, float jobPerformanceGained = 0.1, float jobPerformanceLost = 0.1, float successChance = 0.5)

Parameters

name string

This option's name, which will be localized.

successIncreaseEmotion EmotionType

An emotion that optionally increases the success chance of this option.

successIncreaseSkill SkillType

A skill that optionally increases the success chance of this option.

jobPerformanceGained float

The amount of job performance that should be gained when the correct option is selected by the player.

jobPerformanceLost float

The amount of job performance that should be lost when the incorrect option is selected by the player.

successChance float

The success chance of this option, which is expected to be a value between 0 and 1.

Fields

FailAction

The action that should be invoked when this option is chosen as the incorrect option when the player selects it.

public readonly Action<ChoicePromptInfo, Person> FailAction

Field Value

Action<ChoicePromptInfo, Person>

Name

This option's name, which will be localized.

public readonly string Name

Field Value

string

SuccessAction

The action that should be invoked when this option is chosen as the correct option when the player selects it.

public readonly Action<ChoicePromptInfo, Person> SuccessAction

Field Value

Action<ChoicePromptInfo, Person>

SuccessChance

A function that determines the success change of this choice prompt option once it's chosen, which is expected to be a value between 0 and 1.

public readonly Func<Person, float> SuccessChance

Field Value

Func<Person, float>

Methods

Execute(ChoicePromptInfo, Person, bool)

Executes this option's result actions using the given ChoicePromptInfo.

public void Execute(ChoicePromptInfo info, Person person, bool successful)

Parameters

info ChoicePromptInfo

The choice prompt that this option was a part of.

person Person

The person that should be affected by this option's outcome.

successful bool

Whether this option was chosen as the successful one.