Elin Decompiled Documentation EA 23.102 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 CanMarry ()
 
bool CanSleepBeside ()
 
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 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().

◆ 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:221
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 63 of file Affinity.cs.

64 {
66 {
67 return CurrentStage >= Stage.Love;
68 }
69 return true;
70 }
bool marryAnytime
Definition: CoreDebug.cs:223

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

◆ CanSleepBeside()

bool Affinity.CanSleepBeside ( )
inline

Definition at line 72 of file Affinity.cs.

73 {
75 {
76 return CurrentStage >= Stage.Fond;
77 }
78 return true;
79 }

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

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

References CC, item, and list.

Referenced by Mod().

◆ GetIcon()

Sprite Affinity.GetIcon ( )
inline

Definition at line 81 of file Affinity.cs.

82 {
83 int affinity = CC._affinity;
84 if (affinity <= -100)
85 {
87 }
88 if (affinity <= -10)
89 {
91 }
92 if (CurrentStage >= Stage.Love)
93 {
95 }
96 if (CurrentStage >= Stage.Respected)
97 {
99 }
100 return null;
101 }
Affinity affnity
Definition: CoreRef.cs:128
Icons icons
Definition: CoreRef.cs:339
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().

◆ Mod()

int Affinity.Mod ( int  a)
inline

Definition at line 162 of file Affinity.cs.

163 {
164 if (a < 0)
165 {
166 CC._affinity += a;
167 return a;
168 }
169 int num = 0;
170 for (int i = 0; i < a; i++)
171 {
172 Affinity affinity = Get(CC);
173 if (EClass.rnd(100 + affinity.difficulty) < 100)
174 {
175 CC._affinity++;
176 num++;
177 }
178 }
179 return num;
180 }
static Affinity Get(Chara c)
Definition: Affinity.cs:36
int difficulty
Definition: Affinity.cs:28
static int rnd(int a)
Definition: EClass.cs:50

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

Referenced by Chara.ModAffinity().

◆ OnGift()

Thing Affinity.OnGift ( Thing  t)
inline

Definition at line 103 of file Affinity.cs.

104 {
105 t.CheckJustCooked();
106 Thing result = CC.AddThing(t.Thing);
107 EClass.pc.PlaySound("build_resource");
108 int num = 0;
109 bool num2 = t.HasTag(CTAG.gift);
110 bool flag = t.category.IsChildOf(CC.GetFavCat());
111 bool flag2 = t.id == CC.GetFavFood().id;
113 {
114 flag2 = true;
115 }
116 num = Mathf.Clamp(t.GetPrice() / (flag2 ? 10 : (flag ? 20 : 200)), 0, 50) + (flag2 ? 20 : (flag ? 5 : 0));
117 num = num * (100 + (t.HasElement(757) ? 50 : 0)) / (100 + CC.LV * 10);
118 if (num2)
119 {
120 num += 100;
121 CC.Say("give_ring", CC);
122 CC.Talk("thanks3");
123 }
124 else if (flag2 || num > 20)
125 {
126 CC.Talk("thanks3");
127 }
128 else if (flag || num > 10)
129 {
130 CC.Talk("thanks");
131 }
132 else
133 {
134 CC.Talk("thanks2");
135 }
136 CC.ModAffinity(EClass.pc, num);
137 return result;
138 }
CTAG
Definition: CTAG.cs:2
bool HasElement(int ele, int req=1)
Definition: Card.cs:5214
SoundSource PlaySound(string id, float v=1f, bool spatial=true)
Definition: Card.cs:5404
virtual int GetPrice(CurrencyType currency=CurrencyType.Money, bool sell=false, PriceType priceType=PriceType.Default, Chara c=null)
Definition: Card.cs:6449
Thing AddThing(string id, int lv=-1)
Definition: Card.cs:2901
void Talk(string idTopic, string ref1=null, string ref2=null, bool forceSync=false)
Definition: Card.cs:5949
bool HasTag(CTAG tag)
Definition: Card.cs:2455
Trait trait
Definition: Card.cs:49
virtual Thing Thing
Definition: Card.cs:1934
void CheckJustCooked()
Definition: Card.cs:5857
SourceCategory.Row category
Definition: Card.cs:1925
void Say(string lang, string ref1=null, string ref2=null)
Definition: Card.cs:6046
SourceCategory.Row GetFavCat()
Definition: Chara.cs:7274
void ModAffinity(Chara c, int a, bool show=true, bool showOnlyEmo=false)
Definition: Chara.cs:7166
SourceThing.Row GetFavFood()
Definition: Chara.cs:7254
bool alwaysFavFood
Definition: CoreDebug.cs:227
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 140 of file Affinity.cs.

141 {
142 bool flag = EClass.rnd(60 + EClass.pc.CHA * 2 + EClass.pc.Evalue(291) * 3) > 50 + difficulty + EClass.rnd(CC.CHA + 1);
144 {
145 CC.interest -= 10 + EClass.rnd(10);
146 }
148 {
149 if (EClass.rnd(4) == 0)
150 {
151 CC.ModAffinity(EClass.pc, flag ? 1 : 0, show: false);
152 EClass.pc.ModExp(291, 5);
153 }
154 }
155 else
156 {
157 CC.ModAffinity(EClass.pc, flag ? (EClass.rnd(4) + 1) : (-EClass.rnd(4) - 1), show: false);
158 EClass.pc.ModExp(291, 20);
159 }
160 }
bool IsPCFactionOrMinion
Definition: Card.cs:2132
int CHA
Definition: Card.cs:2207
int Evalue(int ele)
Definition: Card.cs:2431
void ModExp(string alias, int a)
Definition: Card.cs:2508
bool unlimitedInterest
Definition: CoreDebug.cs:219

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.AddExp(), and Hobby.GetEfficiency().

Property Documentation

◆ CurrentStage

Stage Affinity.CurrentStage
get

◆ 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 DramaActor.Talk().


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