Class EmotionModifier
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
stringThe modifier's name
icon
TextureRegionThe modifier's icon
emotion
EmotionTypeThe 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
stringThe modifier's name
icon
TextureRegionThe modifier's icon
emotion
EmotionTypeThe 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
AcquaintanceDied
public static readonly EmotionModifier AcquaintanceDied
Field Value
AdmiredFood
public static readonly EmotionModifier AdmiredFood
Field Value
AdmittedToCheating
public static readonly EmotionModifier AdmittedToCheating
Field Value
AdoptedChild
public static readonly EmotionModifier AdoptedChild
Field Value
AffirmedIdentity
public static readonly EmotionModifier AffirmedIdentity
Field Value
AgedUp
public static readonly EmotionModifier AgedUp
Field Value
AggravatingConversation
public static readonly EmotionModifier AggravatingConversation
Field Value
AmazingCraftedFurniture
public static readonly EmotionModifier AmazingCraftedFurniture
Field Value
AsexualFoolingDeclined
public static readonly EmotionModifier AsexualFoolingDeclined
Field Value
AsexualFoolingPartner
public static readonly EmotionModifier AsexualFoolingPartner
Field Value
Asleep
public static readonly EmotionModifier Asleep
Field Value
AteNonPescetarianFood
public static readonly EmotionModifier AteNonPescetarianFood
Field Value
AteNonVeganFood
public static readonly EmotionModifier AteNonVeganFood
Field Value
AteNonVegetarianFood
public static readonly EmotionModifier AteNonVegetarianFood
Field Value
AteStrawberrySandwichWithHoney
public static readonly EmotionModifier AteStrawberrySandwichWithHoney
Field Value
BabyBookHelpNegative
public static readonly EmotionModifier BabyBookHelpNegative
Field Value
BabyBookNegative
public static readonly EmotionModifier BabyBookNegative
Field Value
BabyBookPositive
public static readonly EmotionModifier BabyBookPositive
Field Value
BadChildFood
public static readonly EmotionModifier BadChildFood
Field Value
BadCreation
public static readonly EmotionModifier BadCreation
Field Value
BadCreationAngry
public static readonly EmotionModifier BadCreationAngry
Field Value
BadFood
public static readonly EmotionModifier BadFood
Field Value
BadLibraryInfo
public static readonly EmotionModifier BadLibraryInfo
Field Value
BadPaintingAdvice
public static readonly EmotionModifier BadPaintingAdvice
Field Value
BadStudyBook
public static readonly EmotionModifier BadStudyBook
Field Value
BadTeammates
public static readonly EmotionModifier BadTeammates
Field Value
BeenAdopted
public static readonly EmotionModifier BeenAdopted
Field Value
BoringHomework
public static readonly EmotionModifier BoringHomework
Field Value
BoringSkillBook
public static readonly EmotionModifier BoringSkillBook
Field Value
BoringWalkthrough
public static readonly EmotionModifier BoringWalkthrough
Field Value
BoringWork
public static readonly EmotionModifier BoringWork
Field Value
BrokeUpWithSomeone
public static readonly EmotionModifier BrokeUpWithSomeone
Field Value
BrokenUpWith
public static readonly EmotionModifier BrokenUpWith
Field Value
CaughtBeingInappropriate
public static readonly EmotionModifier CaughtBeingInappropriate
Field Value
CheatedOn
public static readonly EmotionModifier CheatedOn
Field Value
ChildChef
public static readonly EmotionModifier ChildChef
Field Value
ClosePersonDied
public static readonly EmotionModifier ClosePersonDied
Field Value
ColoringBookNegative
public static readonly EmotionModifier ColoringBookNegative
Field Value
ColoringBookPositive
public static readonly EmotionModifier ColoringBookPositive
Field Value
ColoringBookRelaxing
public static readonly EmotionModifier ColoringBookRelaxing
Field Value
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
DarkRoom
public static readonly EmotionModifier DarkRoom
Field Value
DaydreamEmotions
public static readonly (EmotionModifier Modifier, int Weight)[] DaydreamEmotions
Field Value
- (EmotionModifier Modifier, int Weight)[]
Demoted
public static readonly EmotionModifier Demoted
Field Value
DiaperRash
public static readonly EmotionModifier DiaperRash
Field Value
DirtyConversationPartner
public static readonly EmotionModifier DirtyConversationPartner
Field Value
DirtyDishes
public static readonly EmotionModifier DirtyDishes
Field Value
DirtyHandsAfterToilet
public static readonly EmotionModifier DirtyHandsAfterToilet
Field Value
DirtyObject
public static readonly EmotionModifier DirtyObject
Field Value
DonatedToCharity
public static readonly EmotionModifier[] DonatedToCharity
Field Value
Drunk
public static readonly EmotionModifier[] Drunk
Field Value
ElderWorkout
public static readonly EmotionModifier ElderWorkout
Field Value
EmbarrassingWorkConversation
public static readonly EmotionModifier EmbarrassingWorkConversation
Field Value
EmergencyFood
public static readonly EmotionModifier EmergencyFood
Field Value
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
EnemyDied
public static readonly EmotionModifier EnemyDied
Field Value
EnergizingCoffee
public static readonly EmotionModifier EnergizingCoffee
Field Value
EnergizingDumbbells
public static readonly EmotionModifier EnergizingDumbbells
Field Value
EnergizingJog
public static readonly EmotionModifier EnergizingJog
Field Value
ExcitedByNews
public static readonly EmotionModifier ExcitedByNews
Field Value
ExtrovertedConfusedByIntroversion
public static readonly EmotionModifier ExtrovertedConfusedByIntroversion
Field Value
ExtrovertedNewRelationship
public static readonly EmotionModifier ExtrovertedNewRelationship
Field Value
FailedJoke
public static readonly EmotionModifier FailedJoke
Field Value
FailedPublishing
public static readonly EmotionModifier FailedPublishing
Field Value
FailedRomance
public static readonly EmotionModifier FailedRomance
Field Value
FinishedApp
public static readonly EmotionModifier FinishedApp
Field Value
FinishedBook
public static readonly EmotionModifier FinishedBook
Field Value
FinishedMod
public static readonly EmotionModifier FinishedMod
Field Value
Fired
public static readonly EmotionModifier Fired
Field Value
FirstKiss
public static readonly EmotionModifier FirstKiss
Field Value
FitnessLevelUp
public static readonly EmotionModifier FitnessLevelUp
Field Value
FocusingLibraryInfo
public static readonly EmotionModifier FocusingLibraryInfo
Field Value
FocusingSkillBook
public static readonly EmotionModifier FocusingSkillBook
Field Value
FoolAroundFail
public static readonly EmotionModifier FoolAroundFail
Field Value
FoolingDeclined
public static readonly EmotionModifier FoolingDeclined
Field Value
ForgotHomework
public static readonly EmotionModifier ForgotHomework
Field Value
FriendDied
public static readonly EmotionModifier FriendDied
Field Value
FunFoolingAround
public static readonly EmotionModifier FunFoolingAround
Field Value
FunPlaying
public static readonly EmotionModifier FunPlaying
Field Value
FunSchoolDay
public static readonly EmotionModifier FunSchoolDay
Field Value
FunnyCartoons
public static readonly EmotionModifier FunnyCartoons
Field Value
FunnyNewspaperJoke
public static readonly EmotionModifier FunnyNewspaperJoke
Field Value
GoodChildFood
public static readonly EmotionModifier GoodChildFood
Field Value
GoodFood
public static readonly EmotionModifier GoodFood
Field Value
GoodPaintingAdvice
public static readonly EmotionModifier GoodPaintingAdvice
Field Value
GoodStudyBook
public static readonly EmotionModifier GoodStudyBook
Field Value
GoodWalkthrough
public static readonly EmotionModifier GoodWalkthrough
Field Value
GotRaise
public static readonly EmotionModifier GotRaise
Field Value
GradesDown
public static readonly EmotionModifier GradesDown
Field Value
GradesUp
public static readonly EmotionModifier GradesUp
Field Value
GrossDiaperChange
public static readonly EmotionModifier GrossDiaperChange
Field Value
GymTrainerNegative
public static readonly EmotionModifier GymTrainerNegative
Field Value
GymTrainerPositive
public static readonly EmotionModifier GymTrainerPositive
Field Value
HackingFail
public static readonly EmotionModifier HackingFail
Field Value
HadToGetFoodSomewhereElse
public static readonly EmotionModifier HadToGetFoodSomewhereElse
Field Value
HomeworkHelp
public static readonly EmotionModifier HomeworkHelp
Field Value
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
InspiringIdeas
public static readonly EmotionModifier InspiringIdeas
Field Value
InspiringLibraryInfo
public static readonly EmotionModifier InspiringLibraryInfo
Field Value
InspiringPlaying
public static readonly EmotionModifier InspiringPlaying
Field Value
InspiringSkillBook
public static readonly EmotionModifier InspiringSkillBook
Field Value
InterestingStory
public static readonly EmotionModifier InterestingStory
Field Value
IntrovertedCloseConversation
public static readonly EmotionModifier IntrovertedCloseConversation
Field Value
IntrovertedHomeLong
public static readonly EmotionModifier IntrovertedHomeLong
Field Value
IntrovertedOverstimulated
public static readonly EmotionModifier IntrovertedOverstimulated
Field Value
IntrovertedStrangerDanger
public static readonly EmotionModifier IntrovertedStrangerDanger
Field Value
JobChoicePromptFailed
public static readonly EmotionModifier JobChoicePromptFailed
Field Value
JobChoicePromptFailedPerformance
public static readonly EmotionModifier JobChoicePromptFailedPerformance
Field Value
JobChoicePromptSuccess
public static readonly EmotionModifier JobChoicePromptSuccess
Field Value
JobChoicePromptSuccessPerformance
public static readonly EmotionModifier JobChoicePromptSuccessPerformance
Field Value
JungleGymPositive
public static readonly EmotionModifier JungleGymPositive
Field Value
JungleGymSocialNegative
public static readonly EmotionModifier JungleGymSocialNegative
Field Value
JungleGymSocialPositive
public static readonly EmotionModifier JungleGymSocialPositive
Field Value
LaidBackWorkout
public static readonly EmotionModifier LaidBackWorkout
Field Value
LearnedUpgrade
public static readonly EmotionModifier LearnedUpgrade
Field Value
LostTournament
public static readonly EmotionModifier LostTournament
Field Value
LovelyInteraction
public static readonly EmotionModifier LovelyInteraction
Field Value
MeanConversationPartner
public static readonly EmotionModifier MeanConversationPartner
Field Value
Name
This emotion modifier's name
public readonly string Name
Field Value
NegativeGauge
public static readonly EmotionModifier NegativeGauge
Field Value
NoBabyBathtub
public static readonly EmotionModifier NoBabyBathtub
Field Value
OnVacation
public static readonly EmotionModifier OnVacation
Field Value
OrderCanceled
public static readonly EmotionModifier OrderCanceled
Field Value
ParentalLeave
public static readonly EmotionModifier ParentalLeave
Field Value
PassedOut
public static readonly EmotionModifier PassedOut
Field Value
PeedSelf
public static readonly EmotionModifier PeedSelf
Field Value
PerfectCreation
public static readonly EmotionModifier PerfectCreation
Field Value
PineappleOnPizzaNegative
public static readonly EmotionModifier PineappleOnPizzaNegative
Field Value
PleasantInteraction
public static readonly EmotionModifier PleasantInteraction
Field Value
PositiveGauge
public static readonly EmotionModifier PositiveGauge
Field Value
PottyFail
public static readonly EmotionModifier PottyFail
Field Value
PottyNotListening
public static readonly EmotionModifier PottyNotListening
Field Value
PottySuccess
public static readonly EmotionModifier PottySuccess
Field Value
PregnancyTestNegative
public static readonly EmotionModifier PregnancyTestNegative
Field Value
PregnancyTestPositive
public static readonly EmotionModifier PregnancyTestPositive
Field Value
Promoted
public static readonly EmotionModifier Promoted
Field Value
ProteinShakeCreative
public static readonly EmotionModifier ProteinShakeCreative
Field Value
ProteinShakeEnergetic
public static readonly EmotionModifier ProteinShakeEnergetic
Field Value
ProteinShakeFine
public static readonly EmotionModifier ProteinShakeFine
Field Value
ProteinShakeFocused
public static readonly EmotionModifier ProteinShakeFocused
Field Value
ProteinShakeFrisky
public static readonly EmotionModifier ProteinShakeFrisky
Field Value
ProteinShakeFriskyAsexual
public static readonly EmotionModifier ProteinShakeFriskyAsexual
Field Value
ProteinShakeRelaxed
public static readonly EmotionModifier ProteinShakeRelaxed
Field Value
PsychedUp
public static readonly EmotionModifier PsychedUp
Field Value
PublishedApp
public static readonly EmotionModifier PublishedApp
Field Value
PulledMuscle
public static readonly EmotionModifier PulledMuscle
Field Value
PuzzleNegative
public static readonly EmotionModifier PuzzleNegative
Field Value
PuzzleNegativeChild
public static readonly EmotionModifier PuzzleNegativeChild
Field Value
PuzzlePositive
public static readonly EmotionModifier PuzzlePositive
Field Value
RageQuit
public static readonly EmotionModifier RageQuit
Field Value
ReadBook
public static readonly EmotionModifier ReadBook
Field Value
ReadNewspaperChild
public static readonly EmotionModifier ReadNewspaperChild
Field Value
RepairFail
public static readonly EmotionModifier RepairFail
Field Value
ResearchUpgradesNegative
public static readonly EmotionModifier ResearchUpgradesNegative
Field Value
RoughSchoolDay
public static readonly EmotionModifier RoughSchoolDay
Field Value
SaddenedByNews
public static readonly EmotionModifier SaddenedByNews
Field Value
SandboxNegative
public static readonly EmotionModifier SandboxNegative
Field Value
SandboxPositive
public static readonly EmotionModifier SandboxPositive
Field Value
SandboxSocialNegative
public static readonly EmotionModifier SandboxSocialNegative
Field Value
SandboxSocialPositive
public static readonly EmotionModifier SandboxSocialPositive
Field Value
SawPeopleKissing
public static readonly EmotionModifier SawPeopleKissing
Field Value
SawSomethingPersonal
public static readonly EmotionModifier SawSomethingPersonal
Field Value
ScrappedBook
public static readonly EmotionModifier ScrappedBook
Field Value
ScrappedSomeonesProject
public static readonly EmotionModifier ScrappedSomeonesProject
Field Value
SelfCraftedFurniture
public static readonly EmotionModifier SelfCraftedFurniture
Field Value
ShoodChild
public static readonly EmotionModifier ShoodChild
Field Value
SkilledOrder
public static readonly EmotionModifier SkilledOrder
Field Value
SleptOutside
public static readonly EmotionModifier SleptOutside
Field Value
SomeoneTriedMyFood
public static readonly EmotionModifier SomeoneTriedMyFood
Field Value
StandingDeskPositive
public static readonly EmotionModifier StandingDeskPositive
Field Value
StandingDeskSore
public static readonly EmotionModifier StandingDeskSore
Field Value
StartedDating
public static readonly EmotionModifier StartedDating
Field Value
StressfulSkillBook
public static readonly EmotionModifier StressfulSkillBook
Field Value
StrokeOfGenius
public static readonly EmotionModifier StrokeOfGenius
Field Value
SuccessfulRummaging
public static readonly EmotionModifier SuccessfulRummaging
Field Value
SuccessfullyPublished
public static readonly EmotionModifier SuccessfullyPublished
Field Value
SuddenlyPregnant
public static readonly EmotionModifier SuddenlyPregnant
Field Value
TastyTea
public static readonly EmotionModifier TastyTea
Field Value
TerribleAtSchool
public static readonly EmotionModifier TerribleAtSchool
Field Value
ThrewAwayInsteadOfCleaning
public static readonly EmotionModifier ThrewAwayInsteadOfCleaning
Field Value
ThrewUp
public static readonly EmotionModifier ThrewUp
Field Value
ThriftyBoughtCheapItem
public static readonly EmotionModifier ThriftyBoughtCheapItem
Field Value
ThriftyBoughtExpensiveItem
public static readonly EmotionModifier ThriftyBoughtExpensiveItem
Field Value
TinkerFail
public static readonly EmotionModifier TinkerFail
Field Value
TinkerFocused
public static readonly EmotionModifier TinkerFocused
Field Value
TooManyFoodRepeats
public static readonly EmotionModifier TooManyFoodRepeats
Field Value
TooMuchCoffee
public static readonly EmotionModifier TooMuchCoffee
Field Value
TooMuchProtein
public static readonly EmotionModifier TooMuchProtein
Field Value
TvInspiredToCook
public static readonly EmotionModifier TvInspiredToCook
Field Value
TvRomantic
public static readonly EmotionModifier TvRomantic
Field Value
Types
A registry that contains all EmotionModifier instances from the game and mods
public static readonly ReadOnlyDictionary<string, EmotionModifier> Types
Field Value
UncomfortableCraftedFurniture
public static readonly EmotionModifier UncomfortableCraftedFurniture
Field Value
UnsuccessfulRummaging
public static readonly EmotionModifier UnsuccessfulRummaging
Field Value
UpgradedShowerEmotions
public static readonly EmotionModifier[] UpgradedShowerEmotions
Field Value
UpsettingConversation
public static readonly EmotionModifier UpsettingConversation
Field Value
UsefulProgrammingResearch
public static readonly EmotionModifier UsefulProgrammingResearch
Field Value
VacationDaysAgain
public static readonly EmotionModifier VacationDaysAgain
Field Value
ViewPaintingFocused
public static readonly EmotionModifier ViewPaintingFocused
Field Value
ViewPaintingNegative
public static readonly EmotionModifier ViewPaintingNegative
Field Value
ViewPaintingPositive
public static readonly EmotionModifier ViewPaintingPositive
Field Value
WonTournament
public static readonly EmotionModifier WonTournament
Field Value
WoodworkingSplinter
public static readonly EmotionModifier WoodworkingSplinter
Field Value
WritersBlock
public static readonly EmotionModifier WritersBlock
Field Value
WritingFrenzy
public static readonly EmotionModifier WritingFrenzy
Field Value
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
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
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
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.InstanceThe 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
PersonLikeThe person.
outdoorsRange
intThe 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. If this is null and the object is of type Furniture, the Type is used as the emotion source.
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
PersonLikeThe person.
type
PersonalityTypeThe personality type to query, and return as the IEmotionSource.
value
Func<double>The value to return.
Returns
- (IEmotionSource, int)
The given
type
andvalue
, or default if theperson
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
EmotionModifierThe modifier to register
Returns
- EmotionModifier
The modifier, for chaining