Table of Contents

Struct TalkAction.TalkSettings

Namespace
TinyLife.Actions
Assembly
Tiny Life.dll
public struct TalkAction.TalkSettings
Inherited Members
Extension Methods

Constructors

TalkSettings()

Creates a new talk settings instance with the default values.

public TalkSettings()

Fields

EmoteCategory

The category of emotes that should be displayed as part of this conversation

public EmoteCategory EmoteCategory

Field Value

EmoteCategory

FailEmotion

A EmotionModifier that is added to the IsMain person if this talk action fails. The talk actions fails if the GoBadlyChance has been randomly reached.

public (EmotionModifier Modifier, int Amount, TimeSpan Time) FailEmotion

Field Value

(EmotionModifier Modifier, int Amount, TimeSpan Time)

FriendshipGain

The amount of friendship that can be gained at max. If friendship should primiarily be lost through this action (because it is a mean action, for example), set GoBadlyChance to greater than or equal to 1.

public required Func<ActionInfo, uint> FriendshipGain

Field Value

Func<ActionInfo, uint>

GainRomancePercentage

A function that returns what percentage (between 0 and 1) of FriendshipGain is added to the relationship as RomanceLevel rather than FriendLevel. If an interaction is romantic in nature, this function should return a value greater than 0. If this function is null, 0% of the friendship gain will be romantic.

public Func<ActionInfo, float> GainRomancePercentage

Field Value

Func<ActionInfo, float>

GainSkillOnFailure

Whether the GainSkillOnFailure should be gained on failure rather than success. This is useful for skills that are considered "mean", where the gained skill is mischievious etc.

public bool GainSkillOnFailure

Field Value

bool

GainedSkill

The skill that is gained if this conversation goes well. Higher levels in this skill also reduce the chance of the conversation going badly.

public (SkillType Type, int Amount) GainedSkill

Field Value

(SkillType Type, int Level)

GoBadlyChance

The chance (should be 0 or greater) that this action goes badly and friendship is reduced instead. Note that, for very good relationships, this value is multiplied with a value greater than or equal to 0.25. This means that, if an action should go badly with a very high chance, a value greater than 1 should be returned here.

public required Func<ActionInfo, float> GoBadlyChance

Field Value

Func<ActionInfo, float>

LoweredEmotion

An EmotionType that is lowered when this action is successful for both conversation partners. This uses LowerEmotion(EmotionType, float, float) internally.

public (EmotionType Type, float Amount) LoweredEmotion

Field Value

(EmotionType Type, float Amount)

OnFailure

An action that is invoked when this talk action fails. Note that this is only invoked for the main partner (IsMain), and it receives the Partner as an additional parameter.

public Action<Action, Person> OnFailure

Field Value

Action<Action, Person>

OnSuccess

An action that is invoked when this talk action succeeds. Note that this is only invoked for the main partner (IsMain), and it receives the Partner as an additional parameter.

public Action<Action, Person> OnSuccess

Field Value

Action<Action, Person>

PartnerEmoteCategory

The emote categories for the interaction partner to use. If this is not set, EmoteCategory is used for the partner as well.

public EmoteCategory? PartnerEmoteCategory

Field Value

EmoteCategory?

PartnerSpeakStyle

The speak styles for the interaction partner to use. If this is not set, SpeakStyle is used for the partner as well.

public SpeakStyle? PartnerSpeakStyle

Field Value

SpeakStyle?

RestoredNeed

The need (alongside Social) that is restored during the conversation. Note that, if the amount is set to 0, the action's SolvedNeeds will still be set.

public (NeedType Type, int Amount) RestoredNeed

Field Value

(NeedType Type, int Amount)

Settings

public ActionType.TypeSettings Settings

Field Value

ActionType.TypeSettings

SpeakStyle

The speak styles to use when talking, can be a combined flag

public SpeakStyle SpeakStyle

Field Value

SpeakStyle

SuccessEmotion

A EmotionModifier that is added to the IsMain person if this talk action succeeds

public (EmotionModifier Modifier, int Amount, TimeSpan Time) SuccessEmotion

Field Value

(EmotionModifier Modifier, int Amount, TimeSpan Time)

TalkMinutes

The amount of in-game minutes that this action should last

public float TalkMinutes

Field Value

float

Methods

EvaluateFully(SocialAction)

Evaluates these TalkAction.TalkSettings fully from the perspective of the main conversation partner (IsMain) after a SocialAction is completed. This method internally calls EvaluateSimple(Action, Person, float, float) using the passed parameters, but additionally evaluates information that can only be evaluated using SocialAction, like the GetSocialEffectiveness(ActionType) of a relationship. This method is automatically called by the main conversation partner (IsMain) in TalkAction.

public readonly void EvaluateFully(SocialAction action)

Parameters

action SocialAction

The action.

EvaluateSimple(Action, Person, float, float)

Evaluates these TalkAction.TalkSettings from the perspective of the main conversation partner (IsMain) after an Action has completed. This method causes friendship and romance to be added to the involved people's Relationship, adds the GainedSkill etc. This method is automatically called by the main conversation partner (IsMain) in TalkAction.

public readonly void EvaluateSimple(Action action, Person partner, float completion = 1, float effectiveness = 1)

Parameters

action Action

The action.

partner Person

The action partner.

completion float

The completion percentage of the action, where 0 is an action that has not been started yet, and 1 is full completion. Defaults to 1.

effectiveness float

The effectiveness of the action, where 0 represents a boring, overused action, and 1 represents a unique action. Defaults to 1.

EvaluateValues(ActionInfo, Person, float, float)

Evaluates these TalkAction.TalkSettings after an Action has completed. This method just returns the values that are calculated based on these TalkAction.TalkSettings, but does not actually apply them. This method is used by EvaluateSimple(Action, Person, float, float) and EvaluateFully(SocialAction).

public readonly (float RomanceGain, float FriendshipGain, float RomanceLoss, float FriendshipLoss, float GoBadlyChance) EvaluateValues(ActionInfo info, Person partner, float completion = 1, float effectiveness = 1)

Parameters

info ActionInfo

The action info.

partner Person

The action partner.

completion float

The completion percentage of the action, where 0 is an action that has not been started yet, and 1 is full completion. Defaults to 1.

effectiveness float

The effectiveness of the action, where 0 represents a boring, overused action, and 1 represents a unique action. Defaults to 1.

Returns

(float RomanceGain, float FriendshipGain, float RomanceLoss, float FriendshipLoss, float GoBadlyChance)

The romance gain if the action succeeds, the friendship gain if the action succeeds, the romance loss if the action fails, the friendship loss if the action fails, and the chance that the action will succeed.

Update(SocialAction, GameTime, float)

public readonly void Update(SocialAction action, GameTime time, float speedMultiplier)

Parameters

action SocialAction

The action to update.

time GameTime

The game's current time.

speedMultiplier float

The current speed multiplier.