Struct TalkAction.TalkSettings
Additional settings for TalkAction, used by Create(string, Func<PersonLike, float>, TalkSettings)
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 EmoteChoices EmoteCategory
Field Value
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
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
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
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
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
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
IgnorePriorityDecline
Whether the PassivePriority should not be modified based on the number of times this action has been executed recently. By default (ie when this value is false, which it is by default), the priority of a talk action declines with the amount of recent actions of this type (RecentActions) that have been executed.
public bool IgnorePriorityDecline
Field Value
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
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, PersonLike> OnFailure
Field Value
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, PersonLike> OnSuccess
Field Value
PartnerEmoteCategory
The emote categories for the interaction partner to use. If this is not set, EmoteCategory is used for the partner as well.
public EmoteChoices? PartnerEmoteCategory
Field Value
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
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
Settings
The underlying ActionType.TypeSettings to use. These will be amended in the various Create(string, Func<PersonLike, float>, TalkSettings) methods, including CreateFunny(string, Func<PersonLike, float>, TalkSettings, int, int), CreateRomantic(string, Func<PersonLike, float>, TalkSettings), etc.
public ActionType.TypeSettings Settings
Field Value
SpeakStyle
The speak styles to use when talking, can be a combined flag
public SpeakStyle SpeakStyle
Field Value
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
TalkMinutes
The amount of in-game minutes that this action should last
public float TalkMinutes
Field Value
TalkMinutesVariation
The amount of in-game minutes that should be added on to, or removed from, the TalkMinutes, when calculating the actual amount of time that this action should take through GetRandomCompletionTime(TimeSpan, TimeSpan).
public float TalkMinutesVariation
Field Value
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, PersonLike, 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
SocialActionThe action.
EvaluateSimple(Action, PersonLike, 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, PersonLike partner, float completion = 1, float effectiveness = 1)
Parameters
action
ActionThe action.
partner
PersonLikeThe action partner.
completion
floatThe 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
floatThe effectiveness of the action, where 0 represents a boring, overused action, and 1 represents a unique action. Defaults to 1.
EvaluateValues(ActionInfo, PersonLike, 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, PersonLike, float, float) and EvaluateFully(SocialAction).
public readonly (float RomanceGain, float FriendshipGain, float RomanceLoss, float FriendshipLoss, float GoBadlyChance) EvaluateValues(ActionInfo info, PersonLike partner, float completion = 1, float effectiveness = 1)
Parameters
info
ActionInfoThe action info.
partner
PersonLikeThe action partner.
completion
floatThe 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
floatThe 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)
Updates these TalkAction.TalkSettings for an action by displaying the relevant emotes and speak sounds using SpeakInConversation(PersonLike, GameTime, float, EmoteChoices, SpeakStyle, EmoteChoices?, SpeakStyle?, int, float, float, float, float) and restoring the RestoredNeed.
public readonly void Update(SocialAction action, GameTime time, float speedMultiplier)
Parameters
action
SocialActionThe action to update.
time
GameTimeThe game's current time.
speedMultiplier
floatThe current speed multiplier.