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

Public Member Functions

AIWork GetAI (Chara c)
 
int GetLv (Chara c)
 
int GetEfficiency (Chara c)
 

Public Attributes

int id
 

Properties

SourceHobby.Row source [get]
 
string Name [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 rndSeed (int a, int seed)
 
static int rnd (long a)
 
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 4 of file Hobby.cs.

Member Function Documentation

◆ GetAI()

AIWork Hobby.GetAI ( Chara  c)
inline

Definition at line 12 of file Hobby.cs.

13 {
14 AIWork aIWork = null;
15 string text = "AIWork_" + source.ai.IsEmpty(source.alias);
16 aIWork = ((!(Type.GetType(text + ", Elin") != null)) ? new AIWork() : ClassCache.Create<AIWork>(text, "Elin"));
17 aIWork.owner = c;
18 aIWork.sourceWork = source;
19 return aIWork;
20 }
Definition: AIWork.cs:6
SourceHobby.Row source
Definition: Hobby.cs:8

References source.

Referenced by GetEfficiency(), Chara.PerformWork(), and GoalWork.TryWork().

◆ GetEfficiency()

int Hobby.GetEfficiency ( Chara  c)
inline

Definition at line 31 of file Hobby.cs.

32 {
33 int num = 50;
34 FactionBranch factionBranch = ((c.currentZone != null) ? c.homeBranch : EClass._zone?.branch);
35 if (factionBranch == null || (c.currentZone != null && c.currentZone != factionBranch.owner))
36 {
37 return 0;
38 }
39 if (source.alias == "Breeding")
40 {
41 return c.race.breeder;
42 }
43 if (c.currentZone == null || c.currentZone == EClass._zone)
44 {
45 if ((!source.destTrait.IsEmpty() || !source.workTag.IsEmpty()) && !GetAI(c).SetDestination())
46 {
47 return 0;
48 }
49 if (c.noMove && c.pos != null && c.pos.FindThing<TraitGeneratorWheel>() != null)
50 {
51 return 0;
52 }
53 if (c.memberType != FactionMemberType.Livestock)
54 {
55 TraitBed traitBed = c.FindBed();
56 if (traitBed != null)
57 {
58 num += 30 + traitBed.owner.GetTotalQuality() + traitBed.owner.Evalue(750);
59 }
60 }
61 }
62 num += GetLv(c);
63 if (c.affinity.value < 0)
64 {
65 num += c.affinity.value;
66 }
67 num = num * (100 + factionBranch.Evalue(3708) * 10) / 100;
68 if (num >= 0)
69 {
70 return num;
71 }
72 return 0;
73 }
FactionMemberType
bool SetDestination()
Definition: AIWork.cs:56
int value
Definition: Affinity.cs:26
Point pos
Definition: Card.cs:57
bool noMove
Definition: Card.cs:756
int Evalue(int ele)
Definition: Card.cs:2533
int GetTotalQuality(bool applyBonus=true)
Definition: Card.cs:3728
TraitBed FindBed()
Definition: Chara.cs:7005
Zone currentZone
Definition: Chara.cs:253
FactionMemberType memberType
Definition: Chara.cs:46
Affinity affinity
Definition: Chara.cs:312
FactionBranch homeBranch
Definition: Chara.cs:1052
SourceRace.Row race
Definition: Chara.cs:462
Definition: EClass.cs:5
static Zone _zone
Definition: EClass.cs:20
int Evalue(int ele)
AIWork GetAI(Chara c)
Definition: Hobby.cs:12
int GetLv(Chara c)
Definition: Hobby.cs:22
Thing FindThing(Func< Thing, bool > func)
Definition: Point.cs:1124
Card owner
Definition: Trait.cs:27
FactionBranch branch
Definition: Zone.cs:34

References EClass._zone, Chara.affinity, Zone.branch, Chara.currentZone, Card.Evalue(), FactionBranch.Evalue(), Chara.FindBed(), Point.FindThing(), GetAI(), GetLv(), Card.GetTotalQuality(), Chara.homeBranch, Chara.memberType, Card.noMove, FactionBranch.owner, Trait.owner, Card.pos, Chara.race, AIWork.SetDestination(), source, and Affinity.value.

Referenced by FactionBranch.AutoClean(), FactionBranch.DailyOutcome(), FactionBranch.GenerateGarbage(), UIHomeInfo.RefreshReport(), Chara.RefreshWorkElements(), and BaseListPeople.WriteHobbies().

◆ GetLv()

int Hobby.GetLv ( Chara  c)
inline

Definition at line 22 of file Hobby.cs.

23 {
24 if (!source.skill.IsEmpty())
25 {
26 return Mathf.Min(c.Evalue(source.skill), 100000);
27 }
28 return Mathf.Min(c.LV, 100000);
29 }
int LV
Definition: Card.cs:372

References Card.Evalue(), Card.LV, and source.

Referenced by FactionBranch.DailyOutcome(), and GetEfficiency().

Member Data Documentation

◆ id

int Hobby.id

Definition at line 6 of file Hobby.cs.

Property Documentation

◆ Name

string Hobby.Name
get

Definition at line 10 of file Hobby.cs.

Referenced by DramaCustomSequence.Build(), and BaseListPeople.WriteHobbies().

◆ source


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