Elin Decompiled Documentation EA 23.102 Nightly
Loading...
Searching...
No Matches
Person Class Reference
Inheritance diagram for Person:
EClass

Public Member Functions

 Person ()
 
 Person (string _id, Chara c=null)
 
 Person (Religion r)
 
 Person (Chara c)
 
void SetChara (Chara c)
 
string ApplyTone (string text)
 
string GetDramaTitle ()
 
void SetImage (Image image)
 

Public Attributes

string name
 
string idPortrait
 
string id
 
string tones
 
int uidChara
 
int gender
 
SerializableColor colorHair
 
RefChara refChara = new RefChara()
 
Chara _tempChara
 
string tempName
 

Properties

SourcePerson.Row source [get]
 
Chara chara [get]
 
bool hasChara [get]
 
bool HumanSpeak [get]
 
string Name [get]
 
string NameBraced [get]
 
string Aka [get]
 
- Properties inherited from EClass
static Game game [get]
 
static bool AdvMode [get]
 
static Player player [get]
 
static Chara pc [get]
 
static UI ui [get]
 
static Map _map [get]
 
static Zone _zone [get]
 
static FactionBranch Branch [get]
 
static FactionBranch BranchOrHomeBranch [get]
 
static Faction Home [get]
 
static Faction Wilds [get]
 
static Scene scene [get]
 
static BaseGameScreen screen [get]
 
static GameSetting setting [get]
 
static GameData gamedata [get]
 
static ColorProfile Colors [get]
 
static World world [get]
 
static SourceManager sources [get]
 
static SourceManager editorSources [get]
 
static SoundManager Sound [get]
 
static CoreDebug debug [get]
 

Additional Inherited Members

- Static Public Member Functions inherited from EClass
static int rnd (int a)
 
static int curve (int a, int start, int step, int rate=75)
 
static int rndHalf (int a)
 
static float rndf (float a)
 
static int rndSqrt (int a)
 
static void Wait (float a, Card c)
 
static void Wait (float a, Point p)
 
static int Bigger (int a, int b)
 
static int Smaller (int a, int b)
 
- Static Public Attributes inherited from EClass
static Core core
 

Detailed Description

Definition at line 5 of file Person.cs.

Constructor & Destructor Documentation

◆ Person() [1/4]

Person.Person ( )
inline

Definition at line 62 of file Person.cs.

63 {
64 }

◆ Person() [2/4]

Person.Person ( string  _id,
Chara  c = null 
)
inline

Definition at line 66 of file Person.cs.

67 {
68 id = _id;
69 SetChara(c);
70 }
void SetChara(Chara c)
Definition: Person.cs:88

References SetChara().

◆ Person() [3/4]

Person.Person ( Religion  r)
inline

Definition at line 72 of file Person.cs.

73 {
74 id = r.id;
75 name = r.Name;
76 idPortrait = "UN_" + r.id;
77 if (!Portrait.modPortraits.dict.ContainsKey(idPortrait))
78 {
79 idPortrait = "UN_eyth";
80 }
81 }
Dictionary< string, ModItem< T > > dict
Definition: ModItemList.cs:11
string idPortrait
Definition: Person.cs:11
string name
Definition: Person.cs:8
static ModItemList< Sprite > modPortraits
Definition: Portrait.cs:12
string Name
Definition: Religion.cs:30
virtual string id
Definition: Religion.cs:26

References ModItemList< T >.dict, Religion.id, idPortrait, Portrait.modPortraits, name, and Religion.Name.

◆ Person() [4/4]

Person.Person ( Chara  c)
inline

Definition at line 83 of file Person.cs.

84 {
85 SetChara(c);
86 }

References SetChara().

Member Function Documentation

◆ ApplyTone()

string Person.ApplyTone ( string  text)
inline

Definition at line 101 of file Person.cs.

102 {
103 return chara?.ApplyTone(text) ?? text;
104 }
string ApplyTone(string text, bool stripPun=false)
Definition: Card.cs:6092
Chara chara
Definition: Person.cs:36

References Card.ApplyTone(), and chara.

◆ GetDramaTitle()

string Person.GetDramaTitle ( )
inline

Definition at line 106 of file Person.cs.

107 {
108 if (!tempName.IsEmpty())
109 {
110 return tempName;
111 }
112 if (chara != null)
113 {
114 Biography bio = chara.bio;
115 string text = ((!EClass.debug.showTone || !Lang.setting.useTone || chara.c_idTalk.IsEmpty() || chara.c_idTone.IsEmpty()) ? "" : (" (" + chara.c_idTone.Split('|')[0].TrimEnd('-') + "な" + MOD.listTalk.GetTalk(chara.c_idTalk, "name") + ")"));
116 string dramaText = chara.trait.GetDramaText();
117 if (!dramaText.IsEmpty())
118 {
119 text = text + " " + dramaText;
120 }
121 return chara.Name.ToTitleCase() + " - " + chara.race.GetText().ToTitleCase() + " " + Lang.Parse("age", bio.TextAge(chara)) + " " + Lang._gender(bio.gender) + text;
122 }
123 if (Name.IsEmpty())
124 {
125 return Aka;
126 }
127 if (Aka.IsEmpty())
128 {
129 return "「" + Name + "」";
130 }
131 return Aka.ToTitleCase() + "「" + Name + "」";
132 }
int gender
Definition: Biography.cs:29
string TextAge(Chara c)
Definition: Biography.cs:280
Biography bio
Definition: Card.cs:40
string Name
Definition: Card.cs:2013
string c_idTone
Definition: Card.cs:1445
string c_idTalk
Definition: Card.cs:1469
new TraitChara trait
Definition: Chara.cs:488
SourceRace.Row race
Definition: Chara.cs:449
Definition: Lang.cs:6
static string _gender(int id)
Definition: Lang.cs:177
static string Parse(string idLang, string val1, string val2=null, string val3=null, string val4=null, string val5=null)
Definition: Lang.cs:147
Definition: MOD.cs:7
static TalkDataList listTalk
Definition: MOD.cs:10
string Name
Definition: Person.cs:56
string Aka
Definition: Person.cs:60
string tempName
Definition: Person.cs:32
string GetTalk(string id, string idTopic, bool useDefault=false, bool human=true)
Definition: TalkDataList.cs:23
virtual string GetDramaText()
Definition: TraitChara.cs:146

References Lang._gender(), Aka, Card.bio, Card.c_idTalk, Card.c_idTone, chara, Biography.gender, TraitChara.GetDramaText(), TalkDataList.GetTalk(), MOD.listTalk, Card.Name, Name, Lang.Parse(), Chara.race, tempName, Biography.TextAge(), and Chara.trait.

Referenced by DramaActor.Talk().

◆ SetChara()

void Person.SetChara ( Chara  c)
inline

Definition at line 88 of file Person.cs.

89 {
90 if (c != null)
91 {
92 _tempChara = c;
93 uidChara = c.uid;
94 name = chara.Name;
98 }
99 }
int uid
Definition: Card.cs:118
string GetIdPortrait()
Definition: Chara.cs:7334
int uidChara
Definition: Person.cs:20
string tones
Definition: Person.cs:17
int gender
Definition: Person.cs:23
Chara _tempChara
Definition: Person.cs:30

References _tempChara, Card.bio, Card.c_idTone, chara, Biography.gender, gender, Chara.GetIdPortrait(), idPortrait, Card.Name, name, tones, Card.uid, and uidChara.

Referenced by Person().

◆ SetImage()

void Person.SetImage ( Image  image)
inline

Definition at line 134 of file Person.cs.

135 {
136 Sprite sprite = chara?.GetSprite() ?? Resources.Load<Sprite>("Media/Drama/Actor/" + source.idActor) ?? SpriteSheet.Get(source.idActor);
137 if ((bool)sprite)
138 {
139 image.sprite = sprite;
140 image.SetNativeSize();
141 }
142 }
override Sprite GetSprite(int dir=0)
Definition: Chara.cs:6046
SourcePerson.Row source
Definition: Person.cs:34
static Sprite Get(string id)
Definition: SpriteSheet.cs:28

References chara, SpriteSheet.Get(), Chara.GetSprite(), and source.

Member Data Documentation

◆ _tempChara

Chara Person._tempChara

Definition at line 30 of file Person.cs.

Referenced by SetChara().

◆ colorHair

SerializableColor Person.colorHair

Definition at line 26 of file Person.cs.

◆ gender

int Person.gender

Definition at line 23 of file Person.cs.

Referenced by Quest.Parse(), and SetChara().

◆ id

string Person.id

Definition at line 14 of file Person.cs.

◆ idPortrait

string Person.idPortrait

Definition at line 11 of file Person.cs.

Referenced by Person(), SetChara(), and Portrait.SetPerson().

◆ name

string Person.name

Definition at line 8 of file Person.cs.

Referenced by Person(), and SetChara().

◆ refChara

RefChara Person.refChara = new RefChara()

Definition at line 28 of file Person.cs.

◆ tempName

string Person.tempName

Definition at line 32 of file Person.cs.

Referenced by GetDramaTitle().

◆ tones

string Person.tones

Definition at line 17 of file Person.cs.

Referenced by Quest.Parse(), and SetChara().

◆ uidChara

int Person.uidChara

Definition at line 20 of file Person.cs.

Referenced by SetChara(), and Portrait.SetPerson().

Property Documentation

◆ Aka

string Person.Aka
get

Definition at line 60 of file Person.cs.

Referenced by GetDramaTitle().

◆ chara

◆ hasChara

bool Person.hasChara
get

◆ HumanSpeak

bool Person.HumanSpeak
get

Definition at line 40 of file Person.cs.

41 {
42 get
43 {
44 if (chara != null)
45 {
46 if (!chara.IsPC)
47 {
48 return chara.IsHumanSpeak;
49 }
50 return true;
51 }
52 return true;
53 }
54 }
bool IsHumanSpeak
Definition: Chara.cs:838
override bool IsPC
Definition: Chara.cs:597

Referenced by DramaActor.Talk().

◆ Name

string Person.Name
get

Definition at line 56 of file Person.cs.

Referenced by GetDramaTitle().

◆ NameBraced

string Person.NameBraced
get

Definition at line 58 of file Person.cs.

Referenced by ContentQuest.SelectQuest(), and ItemQuest.SetQuest().

◆ source

SourcePerson.Row Person.source
get

Definition at line 34 of file Person.cs.

Referenced by SetImage(), and Portrait.SetPerson().


The documentation for this class was generated from the following file: