Elin Decompiled Documentation EA 23.230 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 Trait.OnBarter(), 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 192 of file Affinity.cs.

193 {
194 if (a < 0)
195 {
196 CC._affinity += a;
197 return a;
198 }
199 int num = 0;
200 for (int i = 0; i < a; i++)
201 {
202 Affinity affinity = Get(CC);
203 if (EClass.rnd(100 + affinity.difficulty) < 100)
204 {
205 CC._affinity++;
206 num++;
207 }
208 }
209 return num;
210 }
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 flag = t.HasTag(CTAG.gift);
136 if (t.trait is TraitFoodChuryu && CC.IsCat)
137 {
138 flag = true;
139 }
140 bool flag2 = t.category.IsChildOf(CC.GetFavCat());
141 bool flag3 = t.id == CC.GetFavFood().id;
143 {
144 flag3 = true;
145 }
146 num = Mathf.Clamp(t.GetPrice() / (flag3 ? 10 : (flag2 ? 20 : 200)), 0, 50) + (flag3 ? 20 : (flag2 ? 5 : 0));
147 num = num * (100 + (t.HasElement(757) ? 50 : 0)) / (100 + CC.LV * 10);
148 if (flag)
149 {
150 num += 100;
151 CC.Say("give_ring", CC);
152 CC.Talk("thanks3");
153 }
154 else if (flag3 || num > 20)
155 {
156 CC.Talk("thanks3");
157 }
158 else if (flag2 || num > 10)
159 {
160 CC.Talk("thanks");
161 }
162 else
163 {
164 CC.Talk("thanks2");
165 }
166 CC.ModAffinity(EClass.pc, num);
167 return result;
168 }
CTAG
Definition: CTAG.cs:2
bool HasElement(int ele, int req=1)
Definition: Card.cs:5822
SoundSource PlaySound(string id, float v=1f, bool spatial=true)
Definition: Card.cs:6054
virtual int GetPrice(CurrencyType currency=CurrencyType.Money, bool sell=false, PriceType priceType=PriceType.Default, Chara c=null)
Definition: Card.cs:7158
Thing AddThing(string id, int lv=-1)
Definition: Card.cs:3085
void Talk(string idTopic, string ref1=null, string ref2=null, bool forceSync=false)
Definition: Card.cs:6609
bool HasTag(CTAG tag)
Definition: Card.cs:2583
Trait trait
Definition: Card.cs:53
virtual Thing Thing
Definition: Card.cs:2046
void CheckJustCooked()
Definition: Card.cs:6512
SourceCategory.Row category
Definition: Card.cs:2037
void Say(string lang, string ref1=null, string ref2=null)
Definition: Card.cs:6706
SourceCategory.Row GetFavCat()
Definition: Chara.cs:7913
void ModAffinity(Chara c, int a, bool show=true, bool showOnlyEmo=false)
Definition: Chara.cs:7794
SourceThing.Row GetFavFood()
Definition: Chara.cs:7893
bool IsCat
Definition: Chara.cs:985
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.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 170 of file Affinity.cs.

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