PersonalityType - Ellpeck/TinyLifeExampleMod Wiki

Tiny Life

TinyLife

PersonalityType Class

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.

public class PersonalityType

Inheritance System.Object 🡒 PersonalityType

Constructors

PersonalityType.PersonalityType(string, TextureRegion, PersonalityType[]) Constructor

Creates a new personality type with the given name

public PersonalityType(string name, MLEM.Textures.TextureRegion texture, params TinyLife.PersonalityType[] disallowedOthers);

Parameters

name System.String
The name of this personality type

texture MLEM.Textures.TextureRegion
The icon texture for this personality type

disallowedOthers PersonalityType[]
A set of personality types that cannot be applied together with this one

Fields

PersonalityType.AmountPerPerson Field

The amount of personality types that each Person can have

public const int AmountPerPerson = 2;

Field Value

System.Int32

PersonalityType.DisallowedOthers Field

A set of personality types that cannot be applied together with this one

public readonly PersonalityType[] DisallowedOthers;

Field Value

PersonalityType[]

PersonalityType.Name Field

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

System.String

PersonalityType.Texture Field

The icon texture for this personality type

public readonly TextureRegion Texture;

Field Value

MLEM.Textures.TextureRegion

PersonalityType.Types Field

A registry of all of the personality types in the game.
Use Register(PersonalityType) to register custom personality types.

public static readonly IDictionary<string,PersonalityType> Types;

Field Value

System.Collections.Generic.IDictionary<System.String,PersonalityType>

Properties

PersonalityType.BoostedSkills Property

A flag of SkillCategory values that represent the skills that are boosted by this personality type.
This value only has an effect if BoostedSkillsModifier is set as well.

public TinyLife.Skills.SkillCategory BoostedSkills { get; set; }

Property Value

SkillCategory

PersonalityType.BoostedSkillsModifier Property

The amount that the BoostedSkills are boosted by.
If this value is set to 0.1, for example, any skill gain will be multiplied by 1 + 0.1 (= 1.1).

public float BoostedSkillsModifier { get; set; }

Property Value

System.Single

Methods

PersonalityType.Register(PersonalityType) Method

Registers this personality type to the Types registry

public static TinyLife.PersonalityType Register(TinyLife.PersonalityType type);

Parameters

type PersonalityType
The personality type to register

Returns

PersonalityType
The personality type, for chaining