Elin Decompiled Documentation EA 23.102 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 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 3 of file Hobby.cs.

Member Function Documentation

◆ GetAI()

AIWork Hobby.GetAI ( Chara  c)
inline

Definition at line 11 of file Hobby.cs.

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

References source.

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

◆ GetEfficiency()

int Hobby.GetEfficiency ( Chara  c)
inline

Definition at line 30 of file Hobby.cs.

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

22 {
23 if (!source.skill.IsEmpty())
24 {
25 return c.Evalue(source.skill);
26 }
27 return c.LV;
28 }
int LV
Definition: Card.cs:370

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

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

Member Data Documentation

◆ id

int Hobby.id

Definition at line 5 of file Hobby.cs.

Property Documentation

◆ Name

string Hobby.Name
get

Definition at line 9 of file Hobby.cs.

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

◆ source


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