Class ChoicePromptInfo.Option
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
stringThis 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
stringThis 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
stringThis option's name, which will be localized.
successIncreaseEmotion
EmotionTypeAn emotion that optionally increases the success chance of this option.
successIncreaseSkill
SkillTypeA skill that optionally increases the success chance of this option.
jobPerformanceGained
floatThe amount of job performance that should be gained when the correct option is selected by the player.
jobPerformanceLost
floatThe amount of job performance that should be lost when the incorrect option is selected by the player.
successChance
floatThe 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
Name
This option's name, which will be localized.
public readonly string Name
Field Value
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
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
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
ChoicePromptInfoThe choice prompt that this option was a part of.
person
PersonThe person that should be affected by this option's outcome.
successful
boolWhether this option was chosen as the successful one.