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

Public Member Functions

string TextAge (Chara c)
 
int GetOriginalAge (Chara c)
 
void Generate (Chara c)
 
void RerollBio (Chara c, int ageIndex=0, bool keepParent=false)
 
void GenerateBirthday (Chara c, int ageIndex=0)
 
void GenerateAppearance (Chara c)
 
void GenerateDad ()
 
void GenerateMom ()
 
void SetGender (int g)
 
void SetPortrait (Chara c)
 
string TextBio (Chara c)
 
string TextBio2 (Chara c)
 
string TextBirthDate (Chara c, bool _age=false)
 
string TextAppearance ()
 

Public Attributes

int[] ints = new int[20]
 
string[] strs = new string[3]
 
int[] personalities = new int[5]
 

Static Public Attributes

static string[] idFemale = new string[5] { "shojo", "sister", "sister_cat", "younglady", "sister_undead" }
 
- Static Public Attributes inherited from EClass
static Core core
 

Properties

string idLike [get, set]
 
int gender [get, set]
 
int weight [get, set]
 
int height [get, set]
 
int birthDay [get, set]
 
int birthMonth [get, set]
 
int birthYear [get, set]
 
int idHome [get, set]
 
int idDad [get, set]
 
int idMom [get, set]
 
int idLoc [get, set]
 
int idAdvDad [get, set]
 
int idAdvMom [get, set]
 
int idHobby [get, set]
 
int stability [get, set]
 
int law [get, set]
 
int affection [get, set]
 
int dominance [get, set]
 
int extroversion [get, set]
 
int idInterest [get, set]
 
string nameHome [get]
 
string nameLoc [get]
 
string nameDad [get]
 
string nameMom [get]
 
string nameBirthplace [get]
 
int age [get, set]
 
bool IsUnderAge [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]
 

Private Member Functions

int RndBio (string group)
 
string StrBio (int id)
 

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)
 

Detailed Description

Definition at line 4 of file Biography.cs.

Member Function Documentation

◆ Generate()

void Biography.Generate ( Chara  c)
inline

Definition at line 308 of file Biography.cs.

309 {
310 string bio = c.source.bio;
311 _ = c.Chara.race;
312 stability = Rand.rndNormal(100);
313 law = Rand.rndNormal(100);
314 affection = Rand.rndNormal(100);
315 dominance = Rand.rndNormal(100);
317 idInterest = EClass.rnd(Enum.GetNames(typeof(Interest)).Length);
318 if (idFemale.Contains(c.id) || c.race.id == "roran")
319 {
320 SetGender(1);
321 }
322 else
323 {
325 }
326 RerollBio(c);
327 c.SetRandomTone();
328 c.SetRandomTalk();
329 bool flag = c.IsHuman;
330 if (!bio.IsEmpty())
331 {
332 string[] array = bio.Split('/');
333 SetGender((array[0] == "f") ? 1 : 2);
334 if (array.Length > 1)
335 {
336 if (!c.source.HasTag(CTAG.randomPortrait))
337 {
338 flag = false;
339 }
340 age = int.Parse(array[1]);
341 c.pccData = IO.LoadFile<PCCData>(CorePath.packageCore + "Data/PCC/" + c.id + ".txt");
342 }
343 if (array.Length > 2)
344 {
345 height = int.Parse(array[2]);
346 }
347 if (array.Length > 3)
348 {
349 weight = int.Parse(array[3]);
350 }
351 if (array.Length > 4)
352 {
353 c.c_idTone = array[4];
354 }
355 if (array.Length > 5 && !array[5].IsEmpty())
356 {
357 c.c_idTalk = array[5];
358 }
359 }
360 if (c.trait is TraitGuildClerk)
361 {
362 flag = true;
363 }
364 if (flag && !c.HasTag(CTAG.noPortrait))
365 {
366 SetPortrait(c);
367 }
368 if (c.id == "prostitute" && age < 15)
369 {
370 age = 15;
371 }
372 SourceThing.Row row = EClass.sources.things.rows.RandomItem();
373 idLike = row.id;
374 idHobby = EClass.sources.elements.hobbies.RandomItem().id;
375 }
CTAG
Definition: CTAG.cs:2
Interest
Definition: Interest.cs:2
int affection
Definition: Biography.cs:209
static string[] idFemale
Definition: Biography.cs:6
void SetGender(int g)
Definition: Biography.cs:450
int height
Definition: Biography.cs:53
int weight
Definition: Biography.cs:41
void RerollBio(Chara c, int ageIndex=0, bool keepParent=false)
Definition: Biography.cs:377
int idInterest
Definition: Biography.cs:245
int extroversion
Definition: Biography.cs:233
int stability
Definition: Biography.cs:185
void SetPortrait(Chara c)
Definition: Biography.cs:459
string idLike
Definition: Biography.cs:17
int idHobby
Definition: Biography.cs:173
int dominance
Definition: Biography.cs:221
string id
Definition: CardRow.cs:7
virtual Chara Chara
Definition: Card.cs:1946
string id
Definition: Card.cs:31
void SetRandomTone()
Definition: Card.cs:6155
bool HasTag(CTAG tag)
Definition: Card.cs:2455
void SetRandomTalk()
Definition: Card.cs:6146
new TraitChara trait
Definition: Chara.cs:488
bool IsHuman
Definition: Chara.cs:835
SourceChara.Row source
Definition: Chara.cs:143
SourceRace.Row race
Definition: Chara.cs:449
Definition: EClass.cs:5
static int rnd(int a)
Definition: EClass.cs:50
static SourceManager sources
Definition: EClass.cs:42
Definition: Gender.cs:2
static int GetRandom()
Definition: Gender.cs:19
Definition: IO.cs:11
Definition: Rand.cs:4
static int rndNormal(int max)
Definition: Rand.cs:77
List< Row > hobbies
SourceThing things
SourceElement elements

References affection, age, Card.Chara, dominance, SourceManager.elements, extroversion, Gender.GetRandom(), Card.HasTag(), height, SourceElement.hobbies, Card.id, CardRow.id, idFemale, idHobby, idInterest, idLike, Chara.IsHuman, law, Chara.race, RerollBio(), EClass.rnd(), Rand.rndNormal(), SetGender(), SetPortrait(), Card.SetRandomTalk(), Card.SetRandomTone(), Chara.source, EClass.sources, stability, SourceManager.things, Chara.trait, and weight.

Referenced by Chara.OnCreate().

◆ GenerateAppearance()

void Biography.GenerateAppearance ( Chara  c)
inline

Definition at line 408 of file Biography.cs.

409 {
410 SourceRace.Row race = c.race;
411 height = race.height + EClass.rnd(race.height / 5 + 1) - EClass.rnd(race.height / 5 + 1);
412 weight = height * height * (EClass.rnd(6) + 18) / 10000;
413 }

References height, SourceRace.Row.height, Chara.race, EClass.rnd(), and weight.

Referenced by RerollBio().

◆ GenerateBirthday()

void Biography.GenerateBirthday ( Chara  c,
int  ageIndex = 0 
)
inline

Definition at line 390 of file Biography.cs.

391 {
392 SourceRace.Row race = c.race;
393 int num = race.age[0];
394 int num2 = race.age[1];
395 if (ageIndex != 0)
396 {
397 int num3 = (num2 - num) / 4;
398 age = Rand.Range(num + num3 * (ageIndex - 1), num + num3 * ageIndex);
399 }
400 else
401 {
402 age = Rand.Range(num, num2);
403 }
404 birthDay = EClass.rnd(30) + 1;
405 birthMonth = EClass.rnd(12) + 1;
406 }
int birthDay
Definition: Biography.cs:65
int birthMonth
Definition: Biography.cs:77
static int Range(int min, int max)
Definition: Rand.cs:42

References age, SourceRace.Row.age, birthDay, birthMonth, Chara.race, Rand.Range(), and EClass.rnd().

Referenced by RerollBio().

◆ GenerateDad()

void Biography.GenerateDad ( )
inline

Definition at line 415 of file Biography.cs.

416 {
417 idDad = RndBio("parent");
418 idAdvDad = RndBio("adv");
419 }
int idDad
Definition: Biography.cs:113
int idAdvDad
Definition: Biography.cs:149
int RndBio(string group)
Definition: Biography.cs:427

References idAdvDad, idDad, and RndBio().

Referenced by RerollBio().

◆ GenerateMom()

void Biography.GenerateMom ( )
inline

Definition at line 421 of file Biography.cs.

422 {
423 idMom = RndBio("parent");
424 idAdvMom = RndBio("adv");
425 }
int idAdvMom
Definition: Biography.cs:161
int idMom
Definition: Biography.cs:125

References idAdvMom, idMom, and RndBio().

Referenced by RerollBio().

◆ GetOriginalAge()

int Biography.GetOriginalAge ( Chara  c)
inline

Definition at line 298 of file Biography.cs.

299 {
300 string[] array = c.source.bio.Split('/');
301 if (array.Length > 1)
302 {
303 return int.Parse(array[1]);
304 }
305 return age;
306 }

References age, and Chara.source.

Referenced by TextAge().

◆ RerollBio()

void Biography.RerollBio ( Chara  c,
int  ageIndex = 0,
bool  keepParent = false 
)
inline

Definition at line 377 of file Biography.cs.

378 {
379 GenerateBirthday(c, ageIndex);
381 if (!keepParent)
382 {
383 GenerateDad();
384 GenerateMom();
385 idHome = RndBio("home");
386 idLoc = RndBio("loc");
387 }
388 }
void GenerateMom()
Definition: Biography.cs:421
int idLoc
Definition: Biography.cs:137
void GenerateDad()
Definition: Biography.cs:415
void GenerateAppearance(Chara c)
Definition: Biography.cs:408
int idHome
Definition: Biography.cs:101
void GenerateBirthday(Chara c, int ageIndex=0)
Definition: Biography.cs:390

References GenerateAppearance(), GenerateBirthday(), GenerateDad(), GenerateMom(), idHome, idLoc, and RndBio().

Referenced by Generate(), and UICharaMaker.RerollBio().

◆ RndBio()

int Biography.RndBio ( string  group)
inlineprivate

Definition at line 427 of file Biography.cs.

428 {
429 return WordGen.GetID(group);
430 }

Referenced by GenerateDad(), GenerateMom(), and RerollBio().

◆ SetGender()

void Biography.SetGender ( int  g)
inline

Definition at line 450 of file Biography.cs.

451 {
452 gender = g;
453 if (gender > 2)
454 {
455 gender = 0;
456 }
457 }
int gender
Definition: Biography.cs:29

References gender.

Referenced by Card.ApplyBacker(), Chara.ApplyEditorTags(), Generate(), UICharaMaker.ListGender(), and AM_MoveInstalled.SetTarget().

◆ SetPortrait()

void Biography.SetPortrait ( Chara  c)
inline

Definition at line 459 of file Biography.cs.

460 {
461 string id = c.id;
462 if (!(id == "shojo"))
463 {
464 if (id == "sister")
465 {
466 c.c_idPortrait = Portrait.GetRandomPortrait("special_f-littlesister");
467 }
468 else
469 {
470 c.c_idPortrait = Portrait.GetRandomPortrait(gender, c.GetIdPortraitCat());
471 }
472 }
473 else
474 {
475 c.c_idPortrait = Portrait.GetRandomPortrait("special_f-littlegirl");
476 }
477 }
string GetIdPortraitCat()
Definition: Chara.cs:7320
static string GetRandomPortrait(string idDict)
Definition: Portrait.cs:105

References gender, Chara.GetIdPortraitCat(), Portrait.GetRandomPortrait(), and Card.id.

Referenced by Card.ApplyBacker(), and Generate().

◆ StrBio()

string Biography.StrBio ( int  id)
inlineprivate

Definition at line 432 of file Biography.cs.

433 {
434 object obj;
435 if (!EClass.sources.langWord.map.ContainsKey(id))
436 {
437 obj = id.ToString();
438 if (obj == null)
439 {
440 return "";
441 }
442 }
443 else
444 {
445 obj = EClass.sources.langWord.map[id].GetText().Split(',')[0];
446 }
447 return (string)obj;
448 }
LangWord langWord

References SourceManager.langWord, and EClass.sources.

◆ TextAge()

string Biography.TextAge ( Chara  c)
inline

Definition at line 280 of file Biography.cs.

281 {
282 object obj;
283 if (age < 1000)
284 {
285 obj = (c.IsUnique ? GetOriginalAge(c) : age).ToString();
286 if (obj == null)
287 {
288 return "";
289 }
290 }
291 else
292 {
293 obj = "???";
294 }
295 return (string)obj;
296 }
int GetOriginalAge(Chara c)
Definition: Biography.cs:298

References age, and GetOriginalAge().

Referenced by Person.GetDramaTitle(), ButtonChara.SetChara(), TextBio(), and TextBirthDate().

◆ TextAppearance()

string Biography.TextAppearance ( )
inline

Definition at line 494 of file Biography.cs.

495 {
496 return Lang.Parse("heightWeight", height.ToString() ?? "", weight.ToString() ?? "");
497 }
Definition: Lang.cs:6
static string Parse(string idLang, string val1, string val2=null, string val3=null, string val4=null, string val5=null)
Definition: Lang.cs:147

References height, Lang.Parse(), and weight.

Referenced by UICharaMaker.Refresh().

◆ TextBio()

string Biography.TextBio ( Chara  c)
inline

Definition at line 479 of file Biography.cs.

480 {
481 return c.race.GetText().ToTitleCase(wholeText: true) + " " + Lang.Parse("age", TextAge(c)) + " " + Lang._gender(gender);
482 }
string TextAge(Chara c)
Definition: Biography.cs:280
static string _gender(int id)
Definition: Lang.cs:177

References Lang._gender(), gender, Lang.Parse(), Chara.race, and TextAge().

Referenced by WindowChara.RefreshNote(), WindowChara.RefreshProfile(), and ItemGachaResult.SetChara().

◆ TextBio2()

string Biography.TextBio2 ( Chara  c)
inline

Definition at line 484 of file Biography.cs.

485 {
486 return Lang.Parse("heightWeight", height.ToString() ?? "", weight.ToString() ?? "") + " " + ((c.material.alias == "meat") ? "" : c.material.GetName().ToTitleCase(wholeText: true));
487 }
SourceMaterial.Row material
Definition: Card.cs:1927

References height, Card.material, Lang.Parse(), and weight.

Referenced by WindowChara.RefreshNote(), and WindowChara.RefreshProfile().

◆ TextBirthDate()

string Biography.TextBirthDate ( Chara  c,
bool  _age = false 
)
inline

Definition at line 489 of file Biography.cs.

490 {
491 return Lang.Parse("birthText", (birthYear >= 0) ? (birthYear.ToString() ?? "") : "???", birthMonth.ToString() ?? "", birthDay.ToString() ?? "") + (_age ? (" (" + Lang.Parse("age", TextAge(c)) + ")") : "");
492 }
int birthYear
Definition: Biography.cs:89

References birthDay, birthMonth, birthYear, Lang.Parse(), and TextAge().

Referenced by UICharaMaker.Refresh(), and WindowChara.RefreshInfo().

Member Data Documentation

◆ idFemale

string [] Biography.idFemale = new string[5] { "shojo", "sister", "sister_cat", "younglady", "sister_undead" }
static

Definition at line 6 of file Biography.cs.

Referenced by Generate().

◆ ints

int [] Biography.ints = new int[20]

Definition at line 9 of file Biography.cs.

◆ personalities

int [] Biography.personalities = new int[5]

Definition at line 14 of file Biography.cs.

◆ strs

string [] Biography.strs = new string[3]

Definition at line 12 of file Biography.cs.

Property Documentation

◆ affection

int Biography.affection
getset

Definition at line 208 of file Biography.cs.

209 {
210 get
211 {
212 return ints[16];
213 }
214 set
215 {
216 ints[16] = value;
217 }
218 }
int[] ints
Definition: Biography.cs:9

Referenced by Generate().

◆ age

int Biography.age
getset

Definition at line 266 of file Biography.cs.

267 {
268 get
269 {
270 return EClass.world.date.year - birthYear;
271 }
272 set
273 {
274 birthYear = EClass.world.date.year - value;
275 }
276 }

Referenced by Generate(), GenerateBirthday(), GetOriginalAge(), and TextAge().

◆ birthDay

int Biography.birthDay
getset

Definition at line 64 of file Biography.cs.

65 {
66 get
67 {
68 return ints[4];
69 }
70 set
71 {
72 ints[4] = value;
73 }
74 }

Referenced by GenerateBirthday(), Player.GetBackgroundText(), and TextBirthDate().

◆ birthMonth

int Biography.birthMonth
getset

Definition at line 76 of file Biography.cs.

77 {
78 get
79 {
80 return ints[5];
81 }
82 set
83 {
84 ints[5] = value;
85 }
86 }

Referenced by GenerateBirthday(), Player.GetBackgroundText(), and TextBirthDate().

◆ birthYear

int Biography.birthYear
getset

Definition at line 88 of file Biography.cs.

89 {
90 get
91 {
92 return ints[6];
93 }
94 set
95 {
96 ints[6] = value;
97 }
98 }

Referenced by Player.GetBackgroundText(), and TextBirthDate().

◆ dominance

int Biography.dominance
getset

Definition at line 220 of file Biography.cs.

221 {
222 get
223 {
224 return ints[17];
225 }
226 set
227 {
228 ints[17] = value;
229 }
230 }

Referenced by Generate().

◆ extroversion

int Biography.extroversion
getset

Definition at line 232 of file Biography.cs.

233 {
234 get
235 {
236 return ints[18];
237 }
238 set
239 {
240 ints[18] = value;
241 }
242 }

Referenced by Generate().

◆ gender

int Biography.gender
getset

Definition at line 28 of file Biography.cs.

29 {
30 get
31 {
32 return ints[0];
33 }
34 set
35 {
36 ints[0] = value;
37 }
38 }

Referenced by GameLang.ConvertDrama(), Person.GetDramaTitle(), Faction.IsWearingPanty(), UICharaMaker.ListGender(), UICharaMaker.Refresh(), Person.SetChara(), ButtonChara.SetChara(), SetGender(), SetPortrait(), and TextBio().

◆ height

int Biography.height
getset

Definition at line 52 of file Biography.cs.

53 {
54 get
55 {
56 return ints[3];
57 }
58 set
59 {
60 ints[3] = value;
61 }
62 }

Referenced by Generate(), GenerateAppearance(), TextAppearance(), and TextBio2().

◆ idAdvDad

int Biography.idAdvDad
getset

Definition at line 148 of file Biography.cs.

149 {
150 get
151 {
152 return ints[11];
153 }
154 set
155 {
156 ints[11] = value;
157 }
158 }

Referenced by GenerateDad().

◆ idAdvMom

int Biography.idAdvMom
getset

Definition at line 160 of file Biography.cs.

161 {
162 get
163 {
164 return ints[12];
165 }
166 set
167 {
168 ints[12] = value;
169 }
170 }

Referenced by GenerateMom().

◆ idDad

int Biography.idDad
getset

Definition at line 112 of file Biography.cs.

113 {
114 get
115 {
116 return ints[8];
117 }
118 set
119 {
120 ints[8] = value;
121 }
122 }

Referenced by GenerateDad().

◆ idHobby

int Biography.idHobby
getset

Definition at line 172 of file Biography.cs.

173 {
174 get
175 {
176 return ints[13];
177 }
178 set
179 {
180 ints[13] = value;
181 }
182 }

Referenced by Generate(), and WindowChara.RefreshInfo().

◆ idHome

int Biography.idHome
getset

Definition at line 100 of file Biography.cs.

101 {
102 get
103 {
104 return ints[7];
105 }
106 set
107 {
108 ints[7] = value;
109 }
110 }

Referenced by RerollBio().

◆ idInterest

int Biography.idInterest
getset

Definition at line 244 of file Biography.cs.

245 {
246 get
247 {
248 return ints[19];
249 }
250 set
251 {
252 ints[19] = value;
253 }
254 }

Referenced by Generate(), and DramaCustomSequence.GetRumor().

◆ idLike

string Biography.idLike
getset

Definition at line 16 of file Biography.cs.

17 {
18 get
19 {
20 return strs[0];
21 }
22 set
23 {
24 strs[0] = value;
25 }
26 }
string[] strs
Definition: Biography.cs:12

Referenced by Generate(), and WindowChara.RefreshInfo().

◆ idLoc

int Biography.idLoc
getset

Definition at line 136 of file Biography.cs.

137 {
138 get
139 {
140 return ints[10];
141 }
142 set
143 {
144 ints[10] = value;
145 }
146 }

Referenced by RerollBio().

◆ idMom

int Biography.idMom
getset

Definition at line 124 of file Biography.cs.

125 {
126 get
127 {
128 return ints[9];
129 }
130 set
131 {
132 ints[9] = value;
133 }
134 }

Referenced by GenerateMom().

◆ IsUnderAge

bool Biography.IsUnderAge
get

Definition at line 278 of file Biography.cs.

Referenced by DramaCustomSequence.Build().

◆ law

int Biography.law
getset

Definition at line 196 of file Biography.cs.

197 {
198 get
199 {
200 return ints[15];
201 }
202 set
203 {
204 ints[15] = value;
205 }
206 }

Referenced by Generate().

◆ nameBirthplace

string Biography.nameBirthplace
get

Definition at line 264 of file Biography.cs.

Referenced by UICharaMaker.Refresh(), and WindowChara.RefreshInfo().

◆ nameDad

string Biography.nameDad
get

◆ nameHome

string Biography.nameHome
get

Definition at line 256 of file Biography.cs.

Referenced by Player.GetBackgroundText().

◆ nameLoc

string Biography.nameLoc
get

Definition at line 258 of file Biography.cs.

Referenced by Player.GetBackgroundText().

◆ nameMom

string Biography.nameMom
get

◆ stability

int Biography.stability
getset

Definition at line 184 of file Biography.cs.

185 {
186 get
187 {
188 return ints[14];
189 }
190 set
191 {
192 ints[14] = value;
193 }
194 }

Referenced by Generate().

◆ weight

int Biography.weight
getset

Definition at line 40 of file Biography.cs.

41 {
42 get
43 {
44 return ints[2];
45 }
46 set
47 {
48 ints[2] = value;
49 }
50 }

Referenced by Generate(), GenerateAppearance(), TextAppearance(), and TextBio2().


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