Table of Contents

Class EmotionModifier

Namespace
TinyLife.Emotions
Assembly
Tiny Life.dll

An emotion modifier stores information about a PersonLike's current or past actions or events that influenced their Emotion in some way. Each emotion modifier contributes to the person's emotion, and the emotion modifier with the highest combined Amount determines the person's Emotion. Emotion modifiers can be applied automatically using Condition or manually using AddEmotion(EmotionModifier, int, TimeSpan, IEmotionSource, bool).

[JsonConverter(typeof(MigratingStaticJsonConverter<EmotionModifier>), new object[] { typeof(EmotionModifier), "PrivateTypes", true })]
public class EmotionModifier
Inheritance
EmotionModifier
Inherited Members
Extension Methods

Constructors

EmotionModifier(string, TextureRegion, EmotionType, Func<PersonLike, int>)

Creates a new emotion modifier with the given settings

public EmotionModifier(string name, TextureRegion icon, EmotionType emotion, Func<PersonLike, int> condition)

Parameters

name string

The modifier's name

icon TextureRegion

The modifier's icon

emotion EmotionType

The modifier's resulting emotion type

condition Func<PersonLike, int>

An optional condition for this modifier

EmotionModifier(string, TextureRegion, EmotionType, Func<PersonLike, (IEmotionSource, int)>)

Creates a new emotion modifier with the given settings

public EmotionModifier(string name, TextureRegion icon, EmotionType emotion, Func<PersonLike, (IEmotionSource, int)> condition = null)

Parameters

name string

The modifier's name

icon TextureRegion

The modifier's icon

emotion EmotionType

The modifier's resulting emotion type

condition Func<PersonLike, (IEmotionSource, int)>

An optional condition for this modifier

Fields

AbortionEmotions

public static readonly EmotionModifier[] AbortionEmotions

Field Value

EmotionModifier[]

AcquaintanceDied

public static readonly EmotionModifier AcquaintanceDied

Field Value

EmotionModifier

AdmiredFood

public static readonly EmotionModifier AdmiredFood

Field Value

EmotionModifier

AdmittedToCheating

public static readonly EmotionModifier AdmittedToCheating

Field Value

EmotionModifier

AdoptedChild

public static readonly EmotionModifier AdoptedChild

Field Value

EmotionModifier

AffirmedIdentity

public static readonly EmotionModifier AffirmedIdentity

Field Value

EmotionModifier

AgedUp

public static readonly EmotionModifier AgedUp

Field Value

EmotionModifier

AggravatingConversation

public static readonly EmotionModifier AggravatingConversation

Field Value

EmotionModifier

AmazingCraftedFurniture

public static readonly EmotionModifier AmazingCraftedFurniture

Field Value

EmotionModifier

AsexualFoolingDeclined

public static readonly EmotionModifier AsexualFoolingDeclined

Field Value

EmotionModifier

AsexualFoolingPartner

public static readonly EmotionModifier AsexualFoolingPartner

Field Value

EmotionModifier

Asleep

public static readonly EmotionModifier Asleep

Field Value

EmotionModifier

AteNonPescetarianFood

public static readonly EmotionModifier AteNonPescetarianFood

Field Value

EmotionModifier

AteNonVeganFood

public static readonly EmotionModifier AteNonVeganFood

Field Value

EmotionModifier

AteNonVegetarianFood

public static readonly EmotionModifier AteNonVegetarianFood

Field Value

EmotionModifier

AteStrawberrySandwichWithHoney

public static readonly EmotionModifier AteStrawberrySandwichWithHoney

Field Value

EmotionModifier

BabyBookHelpNegative

public static readonly EmotionModifier BabyBookHelpNegative

Field Value

EmotionModifier

BabyBookNegative

public static readonly EmotionModifier BabyBookNegative

Field Value

EmotionModifier

BabyBookPositive

public static readonly EmotionModifier BabyBookPositive

Field Value

EmotionModifier

BadChildFood

public static readonly EmotionModifier BadChildFood

Field Value

EmotionModifier

BadCreation

public static readonly EmotionModifier BadCreation

Field Value

EmotionModifier

BadCreationAngry

public static readonly EmotionModifier BadCreationAngry

Field Value

EmotionModifier

BadFood

public static readonly EmotionModifier BadFood

Field Value

EmotionModifier

BadLibraryInfo

public static readonly EmotionModifier BadLibraryInfo

Field Value

EmotionModifier

BadPaintingAdvice

public static readonly EmotionModifier BadPaintingAdvice

Field Value

EmotionModifier

BadStudyBook

public static readonly EmotionModifier BadStudyBook

Field Value

EmotionModifier

BadTeammates

public static readonly EmotionModifier BadTeammates

Field Value

EmotionModifier

BeenAdopted

public static readonly EmotionModifier BeenAdopted

Field Value

EmotionModifier

BoringHomework

public static readonly EmotionModifier BoringHomework

Field Value

EmotionModifier

BoringSkillBook

public static readonly EmotionModifier BoringSkillBook

Field Value

EmotionModifier

BoringWalkthrough

public static readonly EmotionModifier BoringWalkthrough

Field Value

EmotionModifier

BoringWork

public static readonly EmotionModifier BoringWork

Field Value

EmotionModifier

BrokeUpWithSomeone

public static readonly EmotionModifier BrokeUpWithSomeone

Field Value

EmotionModifier

BrokenUpWith

public static readonly EmotionModifier BrokenUpWith

Field Value

EmotionModifier

CaughtBeingInappropriate

public static readonly EmotionModifier CaughtBeingInappropriate

Field Value

EmotionModifier

CheatedOn

public static readonly EmotionModifier CheatedOn

Field Value

EmotionModifier

ChildChef

public static readonly EmotionModifier ChildChef

Field Value

EmotionModifier

ClosePersonDied

public static readonly EmotionModifier ClosePersonDied

Field Value

EmotionModifier

ColoringBookNegative

public static readonly EmotionModifier ColoringBookNegative

Field Value

EmotionModifier

ColoringBookPositive

public static readonly EmotionModifier ColoringBookPositive

Field Value

EmotionModifier

ColoringBookRelaxing

public static readonly EmotionModifier ColoringBookRelaxing

Field Value

EmotionModifier

Condition

An (optional) condition that has to be met for this emotion modifier to be applied to a person. If this value is non-null, and the value returned by this function is greater than zero, this emotion modifier will be applied to a PersonLike with the Amount set to the return value. If this value is not set, the emotion modifier has to be applied manually using AddEmotion(EmotionModifier, int, TimeSpan, IEmotionSource, bool).

public readonly Func<PersonLike, (IEmotionSource, int)> Condition

Field Value

Func<PersonLike, (IEmotionSource, int)>

CreativelyInspired

public static readonly EmotionModifier CreativelyInspired

Field Value

EmotionModifier

DarkRoom

public static readonly EmotionModifier DarkRoom

Field Value

EmotionModifier

DaydreamEmotions

public static readonly (EmotionModifier Modifier, int Weight)[] DaydreamEmotions

Field Value

(EmotionModifier Modifier, int Weight)[]

Demoted

public static readonly EmotionModifier Demoted

Field Value

EmotionModifier

DiaperRash

public static readonly EmotionModifier DiaperRash

Field Value

EmotionModifier

DirtyConversationPartner

public static readonly EmotionModifier DirtyConversationPartner

Field Value

EmotionModifier

DirtyDishes

public static readonly EmotionModifier DirtyDishes

Field Value

EmotionModifier

DirtyHandsAfterToilet

public static readonly EmotionModifier DirtyHandsAfterToilet

Field Value

EmotionModifier

DirtyObject

public static readonly EmotionModifier DirtyObject

Field Value

EmotionModifier

DonatedToCharity

public static readonly EmotionModifier[] DonatedToCharity

Field Value

EmotionModifier[]

Drunk

public static readonly EmotionModifier[] Drunk

Field Value

EmotionModifier[]

EmbarrassingWorkConversation

public static readonly EmotionModifier EmbarrassingWorkConversation

Field Value

EmotionModifier

EmergencyFood

public static readonly EmotionModifier EmergencyFood

Field Value

EmotionModifier

Emotion

The EmotionType that this emotion modifier is set to cause (if the Amount is high enough). To retrieve this value for a specific person, GetCausedEmotion(EmotionModifier) should be used.

public readonly EmotionType Emotion

Field Value

EmotionType

EnemyDied

public static readonly EmotionModifier EnemyDied

Field Value

EmotionModifier

EnergizingCoffee

public static readonly EmotionModifier EnergizingCoffee

Field Value

EmotionModifier

EnergizingDumbbells

public static readonly EmotionModifier EnergizingDumbbells

Field Value

EmotionModifier

EnergizingJog

public static readonly EmotionModifier EnergizingJog

Field Value

EmotionModifier

ExcitedByNews

public static readonly EmotionModifier ExcitedByNews

Field Value

EmotionModifier

ExtrovertedConfusedByIntroversion

public static readonly EmotionModifier ExtrovertedConfusedByIntroversion

Field Value

EmotionModifier

ExtrovertedNewRelationship

public static readonly EmotionModifier ExtrovertedNewRelationship

Field Value

EmotionModifier

FailedJoke

public static readonly EmotionModifier FailedJoke

Field Value

EmotionModifier

FailedPublishing

public static readonly EmotionModifier FailedPublishing

Field Value

EmotionModifier

FailedRomance

public static readonly EmotionModifier FailedRomance

Field Value

EmotionModifier

FinishedApp

public static readonly EmotionModifier FinishedApp

Field Value

EmotionModifier

FinishedBook

public static readonly EmotionModifier FinishedBook

Field Value

EmotionModifier

FinishedMod

public static readonly EmotionModifier FinishedMod

Field Value

EmotionModifier

Fired

public static readonly EmotionModifier Fired

Field Value

EmotionModifier

FirstKiss

public static readonly EmotionModifier FirstKiss

Field Value

EmotionModifier

FitnessLevelUp

public static readonly EmotionModifier FitnessLevelUp

Field Value

EmotionModifier

FocusingLibraryInfo

public static readonly EmotionModifier FocusingLibraryInfo

Field Value

EmotionModifier

FocusingSkillBook

public static readonly EmotionModifier FocusingSkillBook

Field Value

EmotionModifier

FoolAroundFail

public static readonly EmotionModifier FoolAroundFail

Field Value

EmotionModifier

FoolingDeclined

public static readonly EmotionModifier FoolingDeclined

Field Value

EmotionModifier

ForgotHomework

public static readonly EmotionModifier ForgotHomework

Field Value

EmotionModifier

FriendDied

public static readonly EmotionModifier FriendDied

Field Value

EmotionModifier

FunFoolingAround

public static readonly EmotionModifier FunFoolingAround

Field Value

EmotionModifier

FunPlaying

public static readonly EmotionModifier FunPlaying

Field Value

EmotionModifier

FunSchoolDay

public static readonly EmotionModifier FunSchoolDay

Field Value

EmotionModifier

FunnyCartoons

public static readonly EmotionModifier FunnyCartoons

Field Value

EmotionModifier

FunnyNewspaperJoke

public static readonly EmotionModifier FunnyNewspaperJoke

Field Value

EmotionModifier

GoodChildFood

public static readonly EmotionModifier GoodChildFood

Field Value

EmotionModifier

GoodFood

public static readonly EmotionModifier GoodFood

Field Value

EmotionModifier

GoodPaintingAdvice

public static readonly EmotionModifier GoodPaintingAdvice

Field Value

EmotionModifier

GoodStudyBook

public static readonly EmotionModifier GoodStudyBook

Field Value

EmotionModifier

GoodWalkthrough

public static readonly EmotionModifier GoodWalkthrough

Field Value

EmotionModifier

GotRaise

public static readonly EmotionModifier GotRaise

Field Value

EmotionModifier

GradesDown

public static readonly EmotionModifier GradesDown

Field Value

EmotionModifier

GradesUp

public static readonly EmotionModifier GradesUp

Field Value

EmotionModifier

GrossDiaperChange

public static readonly EmotionModifier GrossDiaperChange

Field Value

EmotionModifier

GymTrainerNegative

public static readonly EmotionModifier GymTrainerNegative

Field Value

EmotionModifier

GymTrainerPositive

public static readonly EmotionModifier GymTrainerPositive

Field Value

EmotionModifier

HackingFail

public static readonly EmotionModifier HackingFail

Field Value

EmotionModifier

HadToGetFoodSomewhereElse

public static readonly EmotionModifier HadToGetFoodSomewhereElse

Field Value

EmotionModifier

HomeworkHelp

public static readonly EmotionModifier HomeworkHelp

Field Value

EmotionModifier

Icon

This emotion modifier's icon which will be displayed in the emotions menu

public readonly TextureRegion Icon

Field Value

TextureRegion

InspiredByPride

public static readonly EmotionModifier InspiredByPride

Field Value

EmotionModifier

InspiringIdeas

public static readonly EmotionModifier InspiringIdeas

Field Value

EmotionModifier

InspiringLibraryInfo

public static readonly EmotionModifier InspiringLibraryInfo

Field Value

EmotionModifier

InspiringPlaying

public static readonly EmotionModifier InspiringPlaying

Field Value

EmotionModifier

InspiringSkillBook

public static readonly EmotionModifier InspiringSkillBook

Field Value

EmotionModifier

InterestingStory

public static readonly EmotionModifier InterestingStory

Field Value

EmotionModifier

IntrovertedCloseConversation

public static readonly EmotionModifier IntrovertedCloseConversation

Field Value

EmotionModifier

IntrovertedHomeLong

public static readonly EmotionModifier IntrovertedHomeLong

Field Value

EmotionModifier

IntrovertedOverstimulated

public static readonly EmotionModifier IntrovertedOverstimulated

Field Value

EmotionModifier

IntrovertedStrangerDanger

public static readonly EmotionModifier IntrovertedStrangerDanger

Field Value

EmotionModifier

JobChoicePromptFailed

public static readonly EmotionModifier JobChoicePromptFailed

Field Value

EmotionModifier

JobChoicePromptFailedPerformance

public static readonly EmotionModifier JobChoicePromptFailedPerformance

Field Value

EmotionModifier

JobChoicePromptSuccess

public static readonly EmotionModifier JobChoicePromptSuccess

Field Value

EmotionModifier

JobChoicePromptSuccessPerformance

public static readonly EmotionModifier JobChoicePromptSuccessPerformance

Field Value

EmotionModifier

JungleGymPositive

public static readonly EmotionModifier JungleGymPositive

Field Value

EmotionModifier

JungleGymSocialNegative

public static readonly EmotionModifier JungleGymSocialNegative

Field Value

EmotionModifier

JungleGymSocialPositive

public static readonly EmotionModifier JungleGymSocialPositive

Field Value

EmotionModifier

LazyWorkout

public static readonly EmotionModifier LazyWorkout

Field Value

EmotionModifier

LearnedUpgrade

public static readonly EmotionModifier LearnedUpgrade

Field Value

EmotionModifier

LostTournament

public static readonly EmotionModifier LostTournament

Field Value

EmotionModifier

LovelyInteraction

public static readonly EmotionModifier LovelyInteraction

Field Value

EmotionModifier

MeanConversationPartner

public static readonly EmotionModifier MeanConversationPartner

Field Value

EmotionModifier

Name

This emotion modifier's name

public readonly string Name

Field Value

string

NegativeGauge

public static readonly EmotionModifier NegativeGauge

Field Value

EmotionModifier

NoBabyBathtub

public static readonly EmotionModifier NoBabyBathtub

Field Value

EmotionModifier

OnVacation

public static readonly EmotionModifier OnVacation

Field Value

EmotionModifier

OrderCanceled

public static readonly EmotionModifier OrderCanceled

Field Value

EmotionModifier

ParentalLeave

public static readonly EmotionModifier ParentalLeave

Field Value

EmotionModifier

PassedOut

public static readonly EmotionModifier PassedOut

Field Value

EmotionModifier

PeedSelf

public static readonly EmotionModifier PeedSelf

Field Value

EmotionModifier

PerfectCreation

public static readonly EmotionModifier PerfectCreation

Field Value

EmotionModifier

PineappleOnPizzaNegative

public static readonly EmotionModifier PineappleOnPizzaNegative

Field Value

EmotionModifier

PleasantInteraction

public static readonly EmotionModifier PleasantInteraction

Field Value

EmotionModifier

PositiveGauge

public static readonly EmotionModifier PositiveGauge

Field Value

EmotionModifier

PottyFail

public static readonly EmotionModifier PottyFail

Field Value

EmotionModifier

PottyNotListening

public static readonly EmotionModifier PottyNotListening

Field Value

EmotionModifier

PottySuccess

public static readonly EmotionModifier PottySuccess

Field Value

EmotionModifier

PregnancyTestNegative

public static readonly EmotionModifier PregnancyTestNegative

Field Value

EmotionModifier

PregnancyTestPositive

public static readonly EmotionModifier PregnancyTestPositive

Field Value

EmotionModifier

Promoted

public static readonly EmotionModifier Promoted

Field Value

EmotionModifier

ProteinShakeCreative

public static readonly EmotionModifier ProteinShakeCreative

Field Value

EmotionModifier

ProteinShakeEnergetic

public static readonly EmotionModifier ProteinShakeEnergetic

Field Value

EmotionModifier

ProteinShakeFine

public static readonly EmotionModifier ProteinShakeFine

Field Value

EmotionModifier

ProteinShakeFocused

public static readonly EmotionModifier ProteinShakeFocused

Field Value

EmotionModifier

ProteinShakeFrisky

public static readonly EmotionModifier ProteinShakeFrisky

Field Value

EmotionModifier

ProteinShakeFriskyAsexual

public static readonly EmotionModifier ProteinShakeFriskyAsexual

Field Value

EmotionModifier

ProteinShakeRelaxed

public static readonly EmotionModifier ProteinShakeRelaxed

Field Value

EmotionModifier

PsychedUp

public static readonly EmotionModifier PsychedUp

Field Value

EmotionModifier

PublishedApp

public static readonly EmotionModifier PublishedApp

Field Value

EmotionModifier

PulledMuscle

public static readonly EmotionModifier PulledMuscle

Field Value

EmotionModifier

PuzzleNegative

public static readonly EmotionModifier PuzzleNegative

Field Value

EmotionModifier

PuzzleNegativeChild

public static readonly EmotionModifier PuzzleNegativeChild

Field Value

EmotionModifier

PuzzlePositive

public static readonly EmotionModifier PuzzlePositive

Field Value

EmotionModifier

RageQuit

public static readonly EmotionModifier RageQuit

Field Value

EmotionModifier

ReadBook

public static readonly EmotionModifier ReadBook

Field Value

EmotionModifier

ReadNewspaperChild

public static readonly EmotionModifier ReadNewspaperChild

Field Value

EmotionModifier

RepairFail

public static readonly EmotionModifier RepairFail

Field Value

EmotionModifier

ResearchUpgradesNegative

public static readonly EmotionModifier ResearchUpgradesNegative

Field Value

EmotionModifier

RoughSchoolDay

public static readonly EmotionModifier RoughSchoolDay

Field Value

EmotionModifier

SaddenedByNews

public static readonly EmotionModifier SaddenedByNews

Field Value

EmotionModifier

SandboxNegative

public static readonly EmotionModifier SandboxNegative

Field Value

EmotionModifier

SandboxPositive

public static readonly EmotionModifier SandboxPositive

Field Value

EmotionModifier

SandboxSocialNegative

public static readonly EmotionModifier SandboxSocialNegative

Field Value

EmotionModifier

SandboxSocialPositive

public static readonly EmotionModifier SandboxSocialPositive

Field Value

EmotionModifier

SawPeopleKissing

public static readonly EmotionModifier SawPeopleKissing

Field Value

EmotionModifier

SawSomethingPersonal

public static readonly EmotionModifier SawSomethingPersonal

Field Value

EmotionModifier

ScrappedBook

public static readonly EmotionModifier ScrappedBook

Field Value

EmotionModifier

ScrappedSomeonesProject

public static readonly EmotionModifier ScrappedSomeonesProject

Field Value

EmotionModifier

SelfCraftedFurniture

public static readonly EmotionModifier SelfCraftedFurniture

Field Value

EmotionModifier

ShoodChild

public static readonly EmotionModifier ShoodChild

Field Value

EmotionModifier

SkilledOrder

public static readonly EmotionModifier SkilledOrder

Field Value

EmotionModifier

SleptOutside

public static readonly EmotionModifier SleptOutside

Field Value

EmotionModifier

SomeoneTriedMyFood

public static readonly EmotionModifier SomeoneTriedMyFood

Field Value

EmotionModifier

StandingDeskPositive

public static readonly EmotionModifier StandingDeskPositive

Field Value

EmotionModifier

StandingDeskSore

public static readonly EmotionModifier StandingDeskSore

Field Value

EmotionModifier

StartedDating

public static readonly EmotionModifier StartedDating

Field Value

EmotionModifier

StressfulSkillBook

public static readonly EmotionModifier StressfulSkillBook

Field Value

EmotionModifier

StrokeOfGenius

public static readonly EmotionModifier StrokeOfGenius

Field Value

EmotionModifier

SuccessfulRummaging

public static readonly EmotionModifier SuccessfulRummaging

Field Value

EmotionModifier

SuccessfullyPublished

public static readonly EmotionModifier SuccessfullyPublished

Field Value

EmotionModifier

SuddenlyPregnant

public static readonly EmotionModifier SuddenlyPregnant

Field Value

EmotionModifier

TastyTea

public static readonly EmotionModifier TastyTea

Field Value

EmotionModifier

TerribleAtSchool

public static readonly EmotionModifier TerribleAtSchool

Field Value

EmotionModifier

ThrewAwayInsteadOfCleaning

public static readonly EmotionModifier ThrewAwayInsteadOfCleaning

Field Value

EmotionModifier

ThrewUp

public static readonly EmotionModifier ThrewUp

Field Value

EmotionModifier

ThriftyBoughtCheapItem

public static readonly EmotionModifier ThriftyBoughtCheapItem

Field Value

EmotionModifier

ThriftyBoughtExpensiveItem

public static readonly EmotionModifier ThriftyBoughtExpensiveItem

Field Value

EmotionModifier

TinkerFail

public static readonly EmotionModifier TinkerFail

Field Value

EmotionModifier

TinkerFocused

public static readonly EmotionModifier TinkerFocused

Field Value

EmotionModifier

TooManyFoodRepeats

public static readonly EmotionModifier TooManyFoodRepeats

Field Value

EmotionModifier

TooMuchCoffee

public static readonly EmotionModifier TooMuchCoffee

Field Value

EmotionModifier

TooMuchProtein

public static readonly EmotionModifier TooMuchProtein

Field Value

EmotionModifier

TvInspiredToCook

public static readonly EmotionModifier TvInspiredToCook

Field Value

EmotionModifier

TvRomantic

public static readonly EmotionModifier TvRomantic

Field Value

EmotionModifier

Types

A registry that contains all EmotionModifier instances from the game and mods

public static readonly ReadOnlyDictionary<string, EmotionModifier> Types

Field Value

ReadOnlyDictionary<string, EmotionModifier>

UncomfortableCraftedFurniture

public static readonly EmotionModifier UncomfortableCraftedFurniture

Field Value

EmotionModifier

UnsuccessfulRummaging

public static readonly EmotionModifier UnsuccessfulRummaging

Field Value

EmotionModifier

UpgradedShowerEmotions

public static readonly EmotionModifier[] UpgradedShowerEmotions

Field Value

EmotionModifier[]

UpsettingConversation

public static readonly EmotionModifier UpsettingConversation

Field Value

EmotionModifier

UsefulProgrammingResearch

public static readonly EmotionModifier UsefulProgrammingResearch

Field Value

EmotionModifier

VacationDaysAgain

public static readonly EmotionModifier VacationDaysAgain

Field Value

EmotionModifier

ViewPaintingFocused

public static readonly EmotionModifier ViewPaintingFocused

Field Value

EmotionModifier

ViewPaintingNegative

public static readonly EmotionModifier ViewPaintingNegative

Field Value

EmotionModifier

ViewPaintingPositive

public static readonly EmotionModifier ViewPaintingPositive

Field Value

EmotionModifier

WonTournament

public static readonly EmotionModifier WonTournament

Field Value

EmotionModifier

WoodworkingSplinter

public static readonly EmotionModifier WoodworkingSplinter

Field Value

EmotionModifier

WritersBlock

public static readonly EmotionModifier WritersBlock

Field Value

EmotionModifier

WritingFrenzy

public static readonly EmotionModifier WritingFrenzy

Field Value

EmotionModifier

Properties

DisplayName

A function that can optionally return a string that should be displayed instead of this emotion modifier's default display name. This function receives the default display name, as well as the active EmotionModifier.Instance, as inputs. This function is used in GetDisplayName(Instance).

public Func<string, EmotionModifier.Instance, string> DisplayName { get; init; }

Property Value

Func<string, EmotionModifier.Instance, string>

OnConditionUnmet

An event that is raised when an EmotionModifier.Instance of this emotion modifier is removed when the Condition is not met anymore.

public Action<EmotionModifier.Instance> OnConditionUnmet { get; init; }

Property Value

Action<EmotionModifier.Instance>

OnRanOut

An event that is raised when an EmotionModifier.Instance of this emotion modifier runs out through its timer reaching zero.

public Action<EmotionModifier.Instance> OnRanOut { get; init; }

Property Value

Action<EmotionModifier.Instance>

Methods

GetDisplayName(Instance)

Returns this emotion modifier's display name, which is optionally influenced by the instance and the DisplayName function.

public string GetDisplayName(EmotionModifier.Instance instance)

Parameters

instance EmotionModifier.Instance

The emotion modifier instance that a name should be returned for.

Returns

string

The display name for the given emotion modifier.

Exceptions

ArgumentException

Thrown if the given EmotionModifier.Instance's Type does not match this type instance.

ObjectAroundEmotion<T>(PersonLike, int, Func<T, int>, Func<T, IEmotionSource>)

A helper method to use with Condition which returns an object and a value based on the objects around the person, either in the same room as them, or in a given radius around them outdoors.

public static (IEmotionSource, int) ObjectAroundEmotion<T>(PersonLike person, int outdoorsRange, Func<T, int> objectAmount, Func<T, IEmotionSource> source = null) where T : MapObject

Parameters

person PersonLike

The person.

outdoorsRange int

The range, in tiles, that objects can be away if the person is outdoors.

objectAmount Func<T, int>

The amount of an emotion that the passed object should give, which is returned from this method.

source Func<T, IEmotionSource>

The emotion source that the passed object should display.

Returns

(IEmotionSource, int)

The resulting emotion source and value.

Type Parameters

T

The type of object to find around the person.

PersonalityEmotion(PersonLike, PersonalityType, Func<double>)

A helper method to use with Condition which returns the given type and the result of the value function if the passed person has the given PersonalityType.

public static (IEmotionSource, int) PersonalityEmotion(PersonLike person, PersonalityType type, Func<double> value)

Parameters

person PersonLike

The person.

type PersonalityType

The personality type to query, and return as the IEmotionSource.

value Func<double>

The value to return.

Returns

(IEmotionSource, int)

The given type and value, or default if the person doesn't have the given PersonalityType.

Register(EmotionModifier)

Registers the given emotion type into the Types registry

public static EmotionModifier Register(EmotionModifier modifier)

Parameters

modifier EmotionModifier

The modifier to register

Returns

EmotionModifier

The modifier, for chaining