Elin Decompiled Documentation EA 23.290 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 (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

◆ CanForceTradeEquip()

bool Affinity.CanForceTradeEquip ( )
inline

Definition at line 51 of file Affinity.cs.

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

References CurrentStage.

Referenced by InvOwner.AllowHold().

◆ CanGiveCard()

bool Affinity.CanGiveCard ( )
inline

Definition at line 65 of file Affinity.cs.

66 {
67 return CurrentStage >= Stage.Love;
68 }

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:222
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 70 of file Affinity.cs.

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

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

◆ CanSleepBeside()

bool Affinity.CanSleepBeside ( )
inline

Definition at line 79 of file Affinity.cs.

80 {
82 {
83 return CurrentStage >= Stage.Fond;
84 }
85 return true;
86 }

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

110 {
111 int affinity = CC._affinity;
112 if (affinity <= -100)
113 {
115 }
116 if (affinity <= -10)
117 {
119 }
120 if (CurrentStage >= Stage.Love)
121 {
123 }
124 if (CurrentStage >= Stage.Respected)
125 {
127 }
128 return null;
129 }
Affinity affnity
Definition: CoreRef.cs:132
Icons icons
Definition: CoreRef.cs:355
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 88 of file Affinity.cs.

89 {
90 if (!EClass.debug.enable)
91 {
92 if (CurrentStage < Stage.LoveLoveLove)
93 {
94 if (CurrentStage < Stage.LoveLove)
95 {
96 if (CurrentStage < Stage.Love)
97 {
98 return 0;
99 }
100 return 10;
101 }
102 return 40;
103 }
104 return 80;
105 }
106 return 100;
107 }
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 194 of file Affinity.cs.

195 {
196 if (a < 0)
197 {
198 CC._affinity += a;
199 return a;
200 }
201 int num = 0;
202 for (int i = 0; i < a; i++)
203 {
204 Affinity affinity = Get(CC);
205 if (EClass.rnd(100 + affinity.difficulty) < 100)
206 {
207 CC._affinity++;
208 num++;
209 }
210 }
211 return num;
212 }
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 131 of file Affinity.cs.

132 {
133 t.CheckJustCooked();
134 Thing result = CC.AddThing(t.Thing);
135 EClass.pc.PlaySound("build_resource");
136 int num = 0;
137 bool flag = t.HasTag(CTAG.gift);
138 if (t.trait is TraitFoodChuryu && CC.IsCat)
139 {
140 flag = true;
141 }
142 bool flag2 = t.category.IsChildOf(CC.GetFavCat());
143 bool flag3 = t.id == CC.GetFavFood().id;
145 {
146 flag3 = true;
147 }
148 num = Mathf.Clamp(t.GetPrice() / (flag3 ? 10 : (flag2 ? 20 : 200)), 0, 50) + (flag3 ? 20 : (flag2 ? 5 : 0));
149 num = num * (100 + (t.HasElement(757) ? 50 : 0)) / (100 + CC.LV * 10);
150 if (flag)
151 {
152 num += 100;
153 CC.Say("give_ring", CC);
154 CC.Talk("thanks3");
155 }
156 else if (flag3 || num > 20)
157 {
158 CC.Talk("thanks3");
159 }
160 else if (flag2 || num > 10)
161 {
162 CC.Talk("thanks");
163 }
164 else
165 {
166 CC.Talk("thanks2");
167 }
168 CC.ModAffinity(EClass.pc, num);
169 return result;
170 }
CTAG
Definition: CTAG.cs:2
SoundSource PlaySound(string id, float v=1f, bool spatial=true)
Definition: Card.cs:6405
virtual int GetPrice(CurrencyType currency=CurrencyType.Money, bool sell=false, PriceType priceType=PriceType.Default, Chara c=null)
Definition: Card.cs:7534
Thing AddThing(string id, int lv=-1)
Definition: Card.cs:3180
void Talk(string idTopic, string ref1=null, string ref2=null, bool forceSync=false)
Definition: Card.cs:6965
bool HasTag(CTAG tag)
Definition: Card.cs:2635
Trait trait
Definition: Card.cs:54
virtual Thing Thing
Definition: Card.cs:2096
void CheckJustCooked()
Definition: Card.cs:6868
SourceCategory.Row category
Definition: Card.cs:2087
bool HasElement(int ele, bool includeNagative=false)
Definition: Card.cs:6152
void Say(string lang, string ref1=null, string ref2=null)
Definition: Card.cs:7082
SourceCategory.Row GetFavCat()
Definition: Chara.cs:8235
void ModAffinity(Chara c, int a, bool show=true, bool showOnlyEmo=false)
Definition: Chara.cs:8116
SourceThing.Row GetFavFood()
Definition: Chara.cs:8215
bool IsCat
Definition: Chara.cs:1001
bool alwaysFavFood
Definition: CoreDebug.cs:228
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 172 of file Affinity.cs.

173 {
174 bool flag = EClass.rnd(60 + EClass.pc.CHA * 2 + EClass.pc.Evalue(291) * 3) > 50 + difficulty + EClass.rnd(CC.CHA + 1);
176 {
177 CC.interest -= 10 + EClass.rnd(10);
178 }
180 {
181 if (EClass.rnd(4) == 0)
182 {
183 CC.ModAffinity(EClass.pc, flag ? 1 : 0, show: false);
184 EClass.pc.ModExp(291, 5);
185 }
186 }
187 else
188 {
189 CC.ModAffinity(EClass.pc, flag ? (EClass.rnd(4) + 1) : (-EClass.rnd(4) - 1), show: false);
190 EClass.pc.ModExp(291, 20);
191 }
192 }
bool IsPCFactionOrMinion
Definition: Card.cs:2312
int CHA
Definition: Card.cs:2387
int Evalue(int ele)
Definition: Card.cs:2611
void ModExp(string alias, int a)
Definition: Card.cs:2688
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

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: