Class PersonalityType
- Namespace
- TinyLife
- Assembly
- Tiny Life.dll
A personality type is a trait that a PersonLike can have. Each personality type is meant to influence the person's behavior and abilities slightly in a certain way.
[JsonConverter(typeof(MigratingStaticJsonConverter<PersonalityType>), new object[] { typeof(PersonalityType), "PrivateTypes", true })]
public class PersonalityType : IEmotionSource
- Inheritance
-
PersonalityType
- Implements
- Inherited Members
- Extension Methods
Constructors
PersonalityType(string, TextureRegion)
Creates a new personality type with the given name
public PersonalityType(string name, TextureRegion texture)
Parameters
name
stringThe name of this personality type
texture
TextureRegionThe icon texture for this personality type
Fields
AfraidOfStrangers
public static readonly PersonalityType AfraidOfStrangers
Field Value
Ambitious
public static readonly PersonalityType Ambitious
Field Value
Aromantic
public static readonly PersonalityType Aromantic
Field Value
Asexual
public static readonly PersonalityType Asexual
Field Value
Brave
public static readonly PersonalityType Brave
Field Value
CapableCarpenter
public static readonly PersonalityType CapableCarpenter
Field Value
Cheerful
public static readonly PersonalityType Cheerful
Field Value
CityNative
public static readonly PersonalityType CityNative
Field Value
Clingy
public static readonly PersonalityType Clingy
Field Value
CommunicativeBaby
public static readonly PersonalityType CommunicativeBaby
Field Value
ComputerAddict
public static readonly PersonalityType ComputerAddict
Field Value
Creative
public static readonly PersonalityType Creative
Field Value
CreativeChild
public static readonly PersonalityType CreativeChild
Field Value
Daydreamer
public static readonly PersonalityType Daydreamer
Field Value
Energetic
public static readonly PersonalityType Energetic
Field Value
Extroverted
public static readonly PersonalityType Extroverted
Field Value
FamilyFocused
public static readonly PersonalityType FamilyFocused
Field Value
FastLearner
public static readonly PersonalityType FastLearner
Field Value
Foodie
public static readonly PersonalityType Foodie
Field Value
FriendOfEveryone
public static readonly PersonalityType FriendOfEveryone
Field Value
GymRat
public static readonly PersonalityType GymRat
Field Value
HatesChildren
public static readonly PersonalityType HatesChildren
Field Value
Homebody
public static readonly PersonalityType Homebody
Field Value
HouseholdHero
public static readonly PersonalityType HouseholdHero
Field Value
Independent
public static readonly PersonalityType Independent
Field Value
Introverted
public static readonly PersonalityType Introverted
Field Value
Lazy
public static readonly PersonalityType Lazy
Field Value
Likeable
public static readonly PersonalityType Likeable
Field Value
MasterChef
public static readonly PersonalityType MasterChef
Field Value
MaxMajorsPerPerson
The amount of major (non-Minor) personality types that each PersonLike can have, based on their AgeGroup
public static readonly Dictionary<(Type, AgeGroup), int> MaxMajorsPerPerson
Field Value
- Dictionary<(Type, AgeGroup), int>
Mean
public static readonly PersonalityType Mean
Field Value
Millionaire
public static readonly PersonalityType Millionaire
Field Value
Name
The name of this personality type. As this is used for Types, this name needs to be unique across all installed mods.
public readonly string Name
Field Value
Outdoorsy
public static readonly PersonalityType Outdoorsy
Field Value
PerfectPainter
public static readonly PersonalityType PerfectPainter
Field Value
Pescetarian
public static readonly PersonalityType Pescetarian
Field Value
ReadBaby
public static readonly PersonalityType ReadBaby
Field Value
RemovableWhenAgingUp
The amount of personality types that can be removed (switched out) when a person of the given Type grows up to the given AgeGroup. If a type and age group combination is not included in this collection, no existing personality types will be removable when aging up.
public static readonly Dictionary<(Type, AgeGroup), int> RemovableWhenAgingUp
Field Value
- Dictionary<(Type, AgeGroup), int>
SmartKid
public static readonly PersonalityType SmartKid
Field Value
Techie
public static readonly PersonalityType Techie
Field Value
Texture
The icon texture for this personality type
public readonly TextureRegion Texture
Field Value
- TextureRegion
Thinker
public static readonly PersonalityType Thinker
Field Value
Thrifty
public static readonly PersonalityType Thrifty
Field Value
Types
A registry of all of the personality types in the game. Use Register(PersonalityType) to register custom personality types.
public static readonly ReadOnlyDictionary<string, PersonalityType> Types
Field Value
Vegan
public static readonly PersonalityType Vegan
Field Value
Vegetarian
public static readonly PersonalityType Vegetarian
Field Value
Writer
public static readonly PersonalityType Writer
Field Value
Properties
AllowedAges
A set of age group flags that represent people of which ages can have this personality type. This value defaults to ChildOrOlder.
public AgeGroup AllowedAges { get; init; }
Property Value
AllowedPersonType
The type of PersonLike that is able to have this personality. This value default to the Person type.
public Type AllowedPersonType { get; init; }
Property Value
BoostedSkillTypes
A set of SkillType values that represent the exact skills that are boosted by this personality type, along with the amount that they are boosted by. If the amount is set to 0.1, for example, any skill gain will be multiplied by 1 + 0.1 (= 1.1). The boost for a specific skill can then be retrieved using GetPersonalitySkillBoost(SkillType).
public (SkillType Type, float Amount)[] BoostedSkillTypes { get; init; }
Property Value
- See Also
BoostedSkills
A set of SkillCategory values that represent the skill categories that are boosted by this personality type, along with the amount that they are boosted by. If the amount is set to 0.1, for example, any skill gain will be multiplied by 1 + 0.1 (= 1.1). The boost for a specific skill can then be retrieved using GetPersonalitySkillBoost(SkillType).
public (SkillCategory Skill, float Amount) BoostedSkills { get; init; }
Property Value
- See Also
Category
This personality type's PersonalityType.TypeCategory, which defaults to Major
public PersonalityType.TypeCategory Category { get; init; }
Property Value
Incompatible
A set of personality types that cannot be applied together with this one. This property is queried in IsCompatible(PersonalityType). Defaults to null, meaning all other personality types are compatible with this one.
public Func<PersonalityType[]> Incompatible { get; init; }
Property Value
ModifiedEmotions
A set of EmotionType instances that are modified by this personality type, along with the amount that they are modified by and the time multiplier that is applied to the duration of the emotion. This property is applied in AddEmotion(EmotionModifier, int, TimeSpan, IEmotionSource, bool).
public (EmotionType Emotion, int AmountChange, float TimeMultiplier)[] ModifiedEmotions { get; init; }
Property Value
ModifiedNeedReductions
A set of NeedType instances whose PassiveReduction values are modified by this personality type, along with the amount that they are modified by. This property is applied in GetPassiveNeedReduction(NeedType).
public (NeedType Need, float Modifier)[] ModifiedNeedReductions { get; init; }
Property Value
SourceString
A (localized) string that is displayed when hovering over an EmotionModifier that has this source
public string SourceString { get; }
Property Value
Methods
CreateInfoGroup(Anchor, float)
Creates a new MLEM.Ui.Elements.Group element that contains information about this PersonalityType.
public Group CreateInfoGroup(Anchor anchor, float scale)
Parameters
Returns
- Group
The created group.
FillRandomly(PersonLike, Random, bool)
Fills the given PersonLike's PersonalityTypes list until it has reached the amount required by MaxMajorsPerPerson. Additionally ,Minor personalities may be added randomly.
public static void FillRandomly(PersonLike person, Random random, bool includeMinor = true)
Parameters
person
PersonLikeThe person.
random
RandomThe Random instance to use.
includeMinor
boolWhether minor personalities should also be filled randomly.
IsCompatible(PersonalityType)
Returns whether this personality type is compatible with the other personality type, based on Incompatible.
public bool IsCompatible(PersonalityType other)
Parameters
other
PersonalityTypeThe personality type to compare with.
Returns
- bool
Whether the two personalities are compatible.
Register(PersonalityType)
Registers this personality type to the Types registry
public static PersonalityType Register(PersonalityType type)
Parameters
type
PersonalityTypeThe personality type to register
Returns
- PersonalityType
The personality type, for chaining