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

Public Types

enum  Stage {
  Foe , Hate , Annoying , Normal ,
  Approved , Friendly , Respected , Intimate ,
  Fond , Love , LoveLove , LoveLoveLove
}
 

Public Member Functions

bool CanForceTradeEquip ()
 
bool CanInvite ()
 
bool CanGiveCard ()
 
bool CanMarry ()
 
bool CanSleepBeside ()
 
int GetLunchChance ()
 
Sprite GetIcon ()
 
Thing OnGift (Thing t)
 
void OnTalkRumor ()
 
int Mod (int a)
 

Static Public Member Functions

static Affinity Get (Chara c)
 
- 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)
 

Public Attributes

int value
 
int difficulty
 

Static Public Attributes

static Chara CC
 
- Static Public Attributes inherited from EClass
static Core core
 

Properties

static List< Affinitylist [get]
 
Stage CurrentStage [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]
 

Detailed Description

Definition at line 6 of file Affinity.cs.

Member Enumeration Documentation

◆ Stage

Enumerator
Foe 
Hate 
Annoying 
Normal 
Approved 
Friendly 
Respected 
Intimate 
Fond 
Love 
LoveLove 
LoveLoveLove 

Definition at line 8 of file Affinity.cs.

Member Function Documentation

◆ CanForceTradeEquip()

bool Affinity.CanForceTradeEquip ( )
inline

Definition at line 49 of file Affinity.cs.

50 {
51 return CurrentStage >= Stage.Respected;
52 }
Stage CurrentStage
Definition: Affinity.cs:32

References CurrentStage.

Referenced by InvOwner.AllowHold().

◆ CanGiveCard()

bool Affinity.CanGiveCard ( )
inline

Definition at line 63 of file Affinity.cs.

64 {
65 return CurrentStage >= Stage.Love;
66 }

References CurrentStage.

Referenced by TCOrbitChara.RefreshAll(), and Chara.ShowDialog().

◆ CanInvite()

bool Affinity.CanInvite ( )
inline

Definition at line 54 of file Affinity.cs.

55 {
57 {
58 return CurrentStage >= Stage.Respected;
59 }
60 return true;
61 }
bool inviteAnytime
Definition: CoreDebug.cs:222
Definition: EClass.cs:5
static CoreDebug debug
Definition: EClass.cs:48

References CurrentStage, EClass.debug, and CoreDebug.inviteAnytime.

Referenced by DramaCustomSequence.Build(), and AI_Fuck.Finish().

◆ CanMarry()

bool Affinity.CanMarry ( )
inline

Definition at line 68 of file Affinity.cs.

69 {
71 {
72 return CurrentStage >= Stage.Love;
73 }
74 return true;
75 }
bool marryAnytime
Definition: CoreDebug.cs:224

References CurrentStage, EClass.debug, and CoreDebug.marryAnytime.

◆ CanSleepBeside()

bool Affinity.CanSleepBeside ( )
inline

Definition at line 77 of file Affinity.cs.

78 {
80 {
81 return CurrentStage >= Stage.Fond;
82 }
83 return true;
84 }

References CurrentStage, EClass.debug, and CoreDebug.marryAnytime.

Referenced by Chara.GetSubPassData(), and TraitBed.TrySetAct().

◆ Get()

static Affinity Affinity.Get ( Chara  c)
inlinestatic

Definition at line 36 of file Affinity.cs.

37 {
38 CC = c;
39 foreach (Affinity item in list)
40 {
41 if (c._affinity < item.value)
42 {
43 return item;
44 }
45 }
46 return list.LastItem();
47 }
static Chara CC
Definition: Affinity.cs:24
static List< Affinity > list
Definition: Affinity.cs:30
int _affinity
Definition: Chara.cs:301

References CC, item, and list.

Referenced by Mod().

◆ GetIcon()

Sprite Affinity.GetIcon ( )
inline

Definition at line 107 of file Affinity.cs.

108 {
109 int affinity = CC._affinity;
110 if (affinity <= -100)
111 {
113 }
114 if (affinity <= -10)
115 {
117 }
118 if (CurrentStage >= Stage.Love)
119 {
121 }
122 if (CurrentStage >= Stage.Respected)
123 {
125 }
126 return null;
127 }
Affinity affnity
Definition: CoreRef.cs:132
Icons icons
Definition: CoreRef.cs:355
CoreRef refs
Definition: Core.cs:51
static Core core
Definition: EClass.cs:6

References Chara._affinity, CoreRef.Icons.affnity, CC, EClass.core, CurrentStage, CoreRef.Icons.Affinity.dontLike, CoreRef.Icons.Affinity.hate, CoreRef.icons, CoreRef.Icons.Affinity.like, CoreRef.Icons.Affinity.love, and Core.refs.

Referenced by BaseListPeople.OnInstantiate().

◆ GetLunchChance()

int Affinity.GetLunchChance ( )
inline

Definition at line 86 of file Affinity.cs.

87 {
88 if (!EClass.debug.enable)
89 {
90 if (CurrentStage < Stage.LoveLoveLove)
91 {
92 if (CurrentStage < Stage.LoveLove)
93 {
94 if (CurrentStage < Stage.Love)
95 {
96 return 0;
97 }
98 return 10;
99 }
100 return 40;
101 }
102 return 80;
103 }
104 return 100;
105 }
bool enable
Definition: CoreDebug.cs:286

References CurrentStage, EClass.debug, and CoreDebug.enable.

Referenced by LayerSleep.Advance(), and Chara.ModAffinity().

◆ Mod()

int Affinity.Mod ( int  a)
inline

Definition at line 188 of file Affinity.cs.

189 {
190 if (a < 0)
191 {
192 CC._affinity += a;
193 return a;
194 }
195 int num = 0;
196 for (int i = 0; i < a; i++)
197 {
198 Affinity affinity = Get(CC);
199 if (EClass.rnd(100 + affinity.difficulty) < 100)
200 {
201 CC._affinity++;
202 num++;
203 }
204 }
205 return num;
206 }
static Affinity Get(Chara c)
Definition: Affinity.cs:36
int difficulty
Definition: Affinity.cs:28
static int rnd(long a)
Definition: EClass.cs:58

References Chara._affinity, CC, difficulty, Get(), and EClass.rnd().

Referenced by Chara.ModAffinity().

◆ OnGift()

Thing Affinity.OnGift ( Thing  t)
inline

Definition at line 129 of file Affinity.cs.

130 {
131 t.CheckJustCooked();
132 Thing result = CC.AddThing(t.Thing);
133 EClass.pc.PlaySound("build_resource");
134 int num = 0;
135 bool num2 = t.HasTag(CTAG.gift);
136 bool flag = t.category.IsChildOf(CC.GetFavCat());
137 bool flag2 = t.id == CC.GetFavFood().id;
139 {
140 flag2 = true;
141 }
142 num = Mathf.Clamp(t.GetPrice() / (flag2 ? 10 : (flag ? 20 : 200)), 0, 50) + (flag2 ? 20 : (flag ? 5 : 0));
143 num = num * (100 + (t.HasElement(757) ? 50 : 0)) / (100 + CC.LV * 10);
144 if (num2)
145 {
146 num += 100;
147 CC.Say("give_ring", CC);
148 CC.Talk("thanks3");
149 }
150 else if (flag2 || num > 20)
151 {
152 CC.Talk("thanks3");
153 }
154 else if (flag || num > 10)
155 {
156 CC.Talk("thanks");
157 }
158 else
159 {
160 CC.Talk("thanks2");
161 }
162 CC.ModAffinity(EClass.pc, num);
163 return result;
164 }
CTAG
Definition: CTAG.cs:2
bool HasElement(int ele, int req=1)
Definition: Card.cs:5698
SoundSource PlaySound(string id, float v=1f, bool spatial=true)
Definition: Card.cs:5912
virtual int GetPrice(CurrencyType currency=CurrencyType.Money, bool sell=false, PriceType priceType=PriceType.Default, Chara c=null)
Definition: Card.cs:7011
Thing AddThing(string id, int lv=-1)
Definition: Card.cs:3057
void Talk(string idTopic, string ref1=null, string ref2=null, bool forceSync=false)
Definition: Card.cs:6462
bool HasTag(CTAG tag)
Definition: Card.cs:2557
Trait trait
Definition: Card.cs:51
virtual Thing Thing
Definition: Card.cs:2020
void CheckJustCooked()
Definition: Card.cs:6365
SourceCategory.Row category
Definition: Card.cs:2011
void Say(string lang, string ref1=null, string ref2=null)
Definition: Card.cs:6559
SourceCategory.Row GetFavCat()
Definition: Chara.cs:7719
void ModAffinity(Chara c, int a, bool show=true, bool showOnlyEmo=false)
Definition: Chara.cs:7606
SourceThing.Row GetFavFood()
Definition: Chara.cs:7699
bool alwaysFavFood
Definition: CoreDebug.cs:228
static Chara pc
Definition: EClass.cs:14
Definition: Thing.cs:8

References Card.AddThing(), CoreDebug.alwaysFavFood, Card.category, CC, Card.CheckJustCooked(), EClass.debug, Chara.GetFavCat(), Chara.GetFavFood(), Card.GetPrice(), Card.HasElement(), Card.HasTag(), Chara.ModAffinity(), EClass.pc, Card.PlaySound(), Card.Say(), Card.Talk(), Card.Thing, and Card.trait.

Referenced by Chara.GiveGift().

◆ OnTalkRumor()

void Affinity.OnTalkRumor ( )
inline

Definition at line 166 of file Affinity.cs.

167 {
168 bool flag = EClass.rnd(60 + EClass.pc.CHA * 2 + EClass.pc.Evalue(291) * 3) > 50 + difficulty + EClass.rnd(CC.CHA + 1);
170 {
171 CC.interest -= 10 + EClass.rnd(10);
172 }
174 {
175 if (EClass.rnd(4) == 0)
176 {
177 CC.ModAffinity(EClass.pc, flag ? 1 : 0, show: false);
178 EClass.pc.ModExp(291, 5);
179 }
180 }
181 else
182 {
183 CC.ModAffinity(EClass.pc, flag ? (EClass.rnd(4) + 1) : (-EClass.rnd(4) - 1), show: false);
184 EClass.pc.ModExp(291, 20);
185 }
186 }
bool IsPCFactionOrMinion
Definition: Card.cs:2234
int CHA
Definition: Card.cs:2309
int Evalue(int ele)
Definition: Card.cs:2533
void ModExp(string alias, int a)
Definition: Card.cs:2610
bool unlimitedInterest
Definition: CoreDebug.cs:220

References CC, Card.CHA, CurrentStage, EClass.debug, difficulty, Card.Evalue(), Card.IsPCFactionOrMinion, Chara.ModAffinity(), Card.ModExp(), EClass.pc, EClass.rnd(), and CoreDebug.unlimitedInterest.

Referenced by DramaCustomSequence.Build().

Member Data Documentation

◆ CC

Chara Affinity.CC
static

Definition at line 24 of file Affinity.cs.

Referenced by Get(), GetIcon(), Mod(), OnGift(), and OnTalkRumor().

◆ difficulty

int Affinity.difficulty

Definition at line 28 of file Affinity.cs.

Referenced by Mod(), and OnTalkRumor().

◆ value

int Affinity.value

Definition at line 26 of file Affinity.cs.

Referenced by Card.GetAffinityExpBonus(), and Hobby.GetEfficiency().

Property Documentation

◆ CurrentStage

◆ list

List<Affinity> Affinity.list
staticget

Definition at line 30 of file Affinity.cs.

Referenced by Get().

◆ Name

string Affinity.Name
get

Definition at line 34 of file Affinity.cs.

Referenced by WindowChara.RefreshNote(), and DramaActor.Talk().


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