Elin Decompiled Documentation EA 23.306 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 CanBecomeMama ()
 
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 (long _a, int start, int step, int rate=75)
 
static int sqrt (int a)
 
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]
 
bool IsWeddingHater [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

◆ CanBecomeMama()

bool Affinity.CanBecomeMama ( )
inline

Definition at line 65 of file Affinity.cs.

66 {
67 return CurrentStage >= Stage.Respected;
68 }
Stage CurrentStage
Definition: Affinity.cs:32

References CurrentStage.

◆ CanForceTradeEquip()

bool Affinity.CanForceTradeEquip ( )
inline

Definition at line 51 of file Affinity.cs.

52 {
53 return CurrentStage >= Stage.Respected;
54 }

References CurrentStage.

Referenced by InvOwner.AllowHold().

◆ CanGiveCard()

bool Affinity.CanGiveCard ( )
inline

Definition at line 70 of file Affinity.cs.

71 {
72 return CurrentStage >= Stage.Love;
73 }

References CurrentStage.

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

◆ CanInvite()

bool Affinity.CanInvite ( )
inline

Definition at line 56 of file Affinity.cs.

57 {
59 {
60 return CurrentStage >= Stage.Respected;
61 }
62 return true;
63 }
bool inviteAnytime
Definition: CoreDebug.cs:237
Definition: EClass.cs:6
static CoreDebug debug
Definition: EClass.cs:49

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

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

◆ CanMarry()

bool Affinity.CanMarry ( )
inline

Definition at line 75 of file Affinity.cs.

76 {
78 {
79 return CurrentStage >= Stage.Love;
80 }
81 return true;
82 }
bool marryAnytime
Definition: CoreDebug.cs:239

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

◆ CanSleepBeside()

bool Affinity.CanSleepBeside ( )
inline

Definition at line 84 of file Affinity.cs.

85 {
87 {
88 return CurrentStage >= Stage.Fond;
89 }
90 return true;
91 }

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

Referenced by Chara.CanBloom(), AI_Fuck.Finish(), Chara.GetSubPassData(), and TraitBed.TrySetAct().

◆ Get()

static Affinity Affinity.Get ( Chara  c)
inlinestatic

Definition at line 38 of file Affinity.cs.

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

References CC, item, and list.

Referenced by Mod().

◆ GetIcon()

Sprite Affinity.GetIcon ( )
inline

Definition at line 114 of file Affinity.cs.

115 {
116 int affinity = CC._affinity;
117 if (affinity <= -100)
118 {
120 }
121 if (affinity <= -10)
122 {
124 }
125 if (CurrentStage >= Stage.Love)
126 {
128 }
129 if (CurrentStage >= Stage.Respected)
130 {
132 }
133 return null;
134 }
Affinity affnity
Definition: CoreRef.cs:133
Icons icons
Definition: CoreRef.cs:356
CoreRef refs
Definition: Core.cs:51
static Core core
Definition: EClass.cs:7

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 93 of file Affinity.cs.

94 {
95 if (!EClass.debug.enable)
96 {
97 if (CurrentStage < Stage.LoveLoveLove)
98 {
99 if (CurrentStage < Stage.LoveLove)
100 {
101 if (CurrentStage < Stage.Love)
102 {
103 return 0;
104 }
105 return 10;
106 }
107 return 40;
108 }
109 return 80;
110 }
111 return 100;
112 }
bool enable
Definition: CoreDebug.cs:301

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

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

◆ Mod()

int Affinity.Mod ( int  a)
inline

Definition at line 199 of file Affinity.cs.

200 {
201 if (a < 0)
202 {
203 CC._affinity += a;
204 return a;
205 }
206 int num = 0;
207 for (int i = 0; i < a; i++)
208 {
209 Affinity affinity = Get(CC);
210 if (EClass.rnd(100 + affinity.difficulty) < 100)
211 {
212 CC._affinity++;
213 num++;
214 }
215 }
216 return num;
217 }
static Affinity Get(Chara c)
Definition: Affinity.cs:38
int difficulty
Definition: Affinity.cs:28
static int rnd(long a)
Definition: EClass.cs:59

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

Referenced by Chara.ModAffinity().

◆ OnGift()

Thing Affinity.OnGift ( Thing  t)
inline

Definition at line 136 of file Affinity.cs.

137 {
138 t.CheckJustCooked();
139 Thing result = CC.AddThing(t.Thing);
140 EClass.pc.PlaySound("build_resource");
141 int num = 0;
142 bool flag = t.HasTag(CTAG.gift);
143 if (t.trait is TraitFoodChuryu && CC.IsCat)
144 {
145 flag = true;
146 }
147 bool flag2 = t.category.IsChildOf(CC.GetFavCat());
148 bool flag3 = t.id == CC.GetFavFood().id;
150 {
151 flag3 = true;
152 }
153 num = Mathf.Clamp(t.GetPrice() / (flag3 ? 10 : (flag2 ? 20 : 200)), 0, 50) + (flag3 ? 20 : (flag2 ? 5 : 0));
154 num = num * (100 + (t.HasElement(757) ? 50 : 0)) / (100 + CC.LV * 10);
155 if (flag)
156 {
157 num += 100;
158 CC.Say("give_ring", CC);
159 CC.Talk("thanks3");
160 }
161 else if (flag3 || num > 20)
162 {
163 CC.Talk("thanks3");
164 }
165 else if (flag2 || num > 10)
166 {
167 CC.Talk("thanks");
168 }
169 else
170 {
171 CC.Talk("thanks2");
172 }
173 CC.ModAffinity(EClass.pc, num);
174 return result;
175 }
CTAG
Definition: CTAG.cs:2
SoundSource PlaySound(string id, float v=1f, bool spatial=true)
Definition: Card.cs:6472
virtual int GetPrice(CurrencyType currency=CurrencyType.Money, bool sell=false, PriceType priceType=PriceType.Default, Chara c=null)
Definition: Card.cs:7603
Thing AddThing(string id, int lv=-1)
Definition: Card.cs:3182
void Talk(string idTopic, string ref1=null, string ref2=null, bool forceSync=false)
Definition: Card.cs:7032
bool HasTag(CTAG tag)
Definition: Card.cs:2637
Trait trait
Definition: Card.cs:54
virtual Thing Thing
Definition: Card.cs:2098
void CheckJustCooked()
Definition: Card.cs:6935
SourceCategory.Row category
Definition: Card.cs:2089
bool HasElement(int ele, bool includeNagative=false)
Definition: Card.cs:6214
void Say(string lang, string ref1=null, string ref2=null)
Definition: Card.cs:7150
SourceCategory.Row GetFavCat()
Definition: Chara.cs:8270
void ModAffinity(Chara c, int a, bool show=true, bool showOnlyEmo=false)
Definition: Chara.cs:8151
SourceThing.Row GetFavFood()
Definition: Chara.cs:8250
bool IsCat
Definition: Chara.cs:1001
bool alwaysFavFood
Definition: CoreDebug.cs:243
static Chara pc
Definition: EClass.cs:15
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.IsCat, 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 177 of file Affinity.cs.

178 {
179 bool flag = EClass.rnd(60 + EClass.pc.CHA * 2 + EClass.pc.Evalue(291) * 3) > 50 + difficulty + EClass.rnd(CC.CHA + 1);
181 {
182 CC.interest -= 10 + EClass.rnd(10);
183 }
185 {
186 if (EClass.rnd(4) == 0)
187 {
188 CC.ModAffinity(EClass.pc, flag ? 1 : 0, show: false);
189 EClass.pc.ModExp(291, 5);
190 }
191 }
192 else
193 {
194 CC.ModAffinity(EClass.pc, flag ? (EClass.rnd(4) + 1) : (-EClass.rnd(4) - 1), show: false);
195 EClass.pc.ModExp(291, 20);
196 }
197 }
bool IsPCFactionOrMinion
Definition: Card.cs:2314
int CHA
Definition: Card.cs:2389
int Evalue(int ele)
Definition: Card.cs:2613
void ModExp(string alias, int a)
Definition: Card.cs:2690
bool unlimitedInterest
Definition: CoreDebug.cs:235

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

Property Documentation

◆ CurrentStage

◆ IsWeddingHater

bool Affinity.IsWeddingHater
get

Definition at line 36 of file Affinity.cs.

Referenced by AI_Idle.Run(), and Chara.ShowDialog().

◆ 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: