Table of Contents

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 string

The name of this personality type

texture TextureRegion

The icon texture for this personality type

Fields

AfraidOfStrangers

public static readonly PersonalityType AfraidOfStrangers

Field Value

PersonalityType

Ambitious

public static readonly PersonalityType Ambitious

Field Value

PersonalityType

Aromantic

public static readonly PersonalityType Aromantic

Field Value

PersonalityType

Asexual

public static readonly PersonalityType Asexual

Field Value

PersonalityType

Brave

public static readonly PersonalityType Brave

Field Value

PersonalityType

CapableCarpenter

public static readonly PersonalityType CapableCarpenter

Field Value

PersonalityType

Cheerful

public static readonly PersonalityType Cheerful

Field Value

PersonalityType

CityNative

public static readonly PersonalityType CityNative

Field Value

PersonalityType

Clingy

public static readonly PersonalityType Clingy

Field Value

PersonalityType

CommunicativeBaby

public static readonly PersonalityType CommunicativeBaby

Field Value

PersonalityType

ComputerAddict

public static readonly PersonalityType ComputerAddict

Field Value

PersonalityType

Creative

public static readonly PersonalityType Creative

Field Value

PersonalityType

CreativeChild

public static readonly PersonalityType CreativeChild

Field Value

PersonalityType

Daydreamer

public static readonly PersonalityType Daydreamer

Field Value

PersonalityType

Energetic

public static readonly PersonalityType Energetic

Field Value

PersonalityType

Extroverted

public static readonly PersonalityType Extroverted

Field Value

PersonalityType

FamilyFocused

public static readonly PersonalityType FamilyFocused

Field Value

PersonalityType

FastLearner

public static readonly PersonalityType FastLearner

Field Value

PersonalityType

Foodie

public static readonly PersonalityType Foodie

Field Value

PersonalityType

FriendOfEveryone

public static readonly PersonalityType FriendOfEveryone

Field Value

PersonalityType

GymRat

public static readonly PersonalityType GymRat

Field Value

PersonalityType

HatesChildren

public static readonly PersonalityType HatesChildren

Field Value

PersonalityType

Homebody

public static readonly PersonalityType Homebody

Field Value

PersonalityType

HouseholdHero

public static readonly PersonalityType HouseholdHero

Field Value

PersonalityType

Independent

public static readonly PersonalityType Independent

Field Value

PersonalityType

Introverted

public static readonly PersonalityType Introverted

Field Value

PersonalityType

LaidBack

public static readonly PersonalityType LaidBack

Field Value

PersonalityType

Likeable

public static readonly PersonalityType Likeable

Field Value

PersonalityType

MasterChef

public static readonly PersonalityType MasterChef

Field Value

PersonalityType

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

PersonalityType

Millionaire

public static readonly PersonalityType Millionaire

Field Value

PersonalityType

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

string

Outdoorsy

public static readonly PersonalityType Outdoorsy

Field Value

PersonalityType

PerfectPainter

public static readonly PersonalityType PerfectPainter

Field Value

PersonalityType

Pescetarian

public static readonly PersonalityType Pescetarian

Field Value

PersonalityType

ReadBaby

public static readonly PersonalityType ReadBaby

Field Value

PersonalityType

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

PersonalityType

Techie

public static readonly PersonalityType Techie

Field Value

PersonalityType

Texture

The icon texture for this personality type

public readonly TextureRegion Texture

Field Value

TextureRegion

Thinker

public static readonly PersonalityType Thinker

Field Value

PersonalityType

Thrifty

public static readonly PersonalityType Thrifty

Field Value

PersonalityType

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

ReadOnlyDictionary<string, PersonalityType>

Vegan

public static readonly PersonalityType Vegan

Field Value

PersonalityType

Vegetarian

public static readonly PersonalityType Vegetarian

Field Value

PersonalityType

Writer

public static readonly PersonalityType Writer

Field Value

PersonalityType

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

AgeGroup

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

Type

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

(SkillType Type, float Amount)[]
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

(SkillCategory Skill, float Amount)
See Also

Category

This personality type's PersonalityType.TypeCategory, which defaults to Major

public PersonalityType.TypeCategory Category { get; init; }

Property Value

PersonalityType.TypeCategory

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

Func<PersonalityType[]>

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

(EmotionType Emotion, int AmountChange, float TimeMultiplier)[]

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

(NeedType Need, float Modifier)[]

SourceString

A (localized) string that is displayed when hovering over an EmotionModifier that has this source

public string SourceString { get; }

Property Value

string

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

anchor Anchor

The anchor to use.

scale float

The scale to render the Texture with.

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 PersonLike

The person.

random Random

The TinyLife.PersonalityType.Random instance to use.

includeMinor bool

Whether 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 PersonalityType

The 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 PersonalityType

The personality type to register

Returns

PersonalityType

The personality type, for chaining