Table of Contents

Class PersonalityType

Namespace
TinyLife
Assembly
Tiny Life.dll

A personality type is a trait that a Person can have. Each personality type is meant to influence the person's behavior and abilities slightly in a certain way.

[JsonConverter(typeof(StaticJsonConverter<PersonalityType>), new object[] { typeof(PersonalityType), "PrivateTypes" })]
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

CapableCarpenter

public static readonly PersonalityType CapableCarpenter

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

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

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

Lazy

public static readonly PersonalityType Lazy

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 Person can have, based on their AgeGroup

public static readonly Dictionary<AgeGroup, int> MaxMajorsPerPerson

Field Value

Dictionary<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

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 all ages except babies.

public AgeGroup AllowedAges { get; init; }

Property Value

AgeGroup

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[]>

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(Person, Random)

Fills the given Person's PersonalityTypes list until it has reached the amount required by MaxMajorsPerPerson. Additionally ,Minor personalities may be added randomly.

public static void FillRandomly(Person person, Random random)

Parameters

person Person

The person.

random Random

The Random instance to use.

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