Elin Decompiled Documentation EA 23.102 Nightly
Loading...
Searching...
No Matches
Stats Class Reference
Inheritance diagram for Stats:
BaseStats EClass StatsBurden StatsHunger StatsHygiene StatsMana StatsSAN StatsSleepiness StatsStamina

Public Member Functions

override int GetValue ()
 
override string ToString ()
 
override string GetText ()
 
override Color GetColor (Gradient g)
 
Stats Set (int[] _raw, int _rawIndex, Chara _CC)
 
override int GetPhase ()
 
virtual void Set (int a)
 
virtual void Mod (int a)
 
virtual void OnChangePhase (int phase, int lastPhase)
 
- Public Member Functions inherited from BaseStats
virtual Color GetColor (Gradient gradient)
 
virtual Color GetColor (SkinColorProfile c)
 
Color GetColor ()
 
virtual string GetText ()
 
virtual string GetPhaseStr ()
 
virtual int GetValue ()
 
virtual Sprite GetSprite ()
 
virtual void SetText (UIText t, SkinColorProfile cols=null)
 
virtual int GetPhase ()
 
void PopText ()
 
virtual void WriteNote (UINote n, Action< UINote > onWriteNote=null)
 
virtual void _WriteNote (UINote n, bool asChild=false)
 

Public Attributes

int rawIndex
 
int[] raw
 
- Public Attributes inherited from BaseStats
int id
 
SourceStat.Row _source
 

Static Public Attributes

static StatsHunger Hunger
 
static StatsBurden Burden
 
static StatsStamina Stamina
 
static StatsSleepiness Sleepiness
 
static Stats Depression
 
static Stats Bladder
 
static StatsHygiene Hygiene
 
static StatsMana Mana
 
static StatsSAN SAN
 
- Static Public Attributes inherited from BaseStats
static Chara CC
 
- Static Public Attributes inherited from EClass
static Core core
 

Properties

virtual int value [get, set]
 
virtual int max [get, set]
 
string name [get]
 
virtual bool TrackPhaseChange [get]
 
virtual int min [get]
 
- Properties inherited from BaseStats
SourceStat.Row source [get]
 
virtual Emo2 EmoIcon [get]
 
virtual ConditionType Type [get]
 
virtual string idSprite [get]
 
virtual bool ShowInWidget [get]
 
virtual Chara Owner [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]
 

Additional Inherited Members

- 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)
 

Detailed Description

Definition at line 4 of file Stats.cs.

Member Function Documentation

◆ GetColor()

override Color Stats.GetColor ( Gradient  g)
inlinevirtual

Reimplemented from BaseStats.

Definition at line 104 of file Stats.cs.

105 {
106 return g.Evaluate((float)value / (float)max);
107 }
virtual int value
Definition: Stats.cs:56
virtual int max
Definition: Stats.cs:68

References max, and value.

Referenced by WindowChara.AddNeeds().

◆ GetPhase()

override int Stats.GetPhase ( )
inlinevirtual

Reimplemented from BaseStats.

Reimplemented in StatsBurden, and StatsStamina.

Definition at line 117 of file Stats.cs.

118 {
119 return base.source.phase[(int)Mathf.Clamp(10f * (float)value / (float)max, 0f, 9f)];
120 }

References max, and value.

Referenced by Chara._Move(), Chara.CanSleep(), GetText(), TraitMoongate.LoadMap(), Mod(), Chara.ModAffinity(), Scene.OnUpdate(), FoodEffect.Proc(), LayerTravel.Refresh(), Chara.RefreshSpeed(), AI_Eat.Run(), AI_Idle.Run(), Chara.Tick(), ConSleep.Tick(), Chara.TickConditions(), ToString(), Chara.TryUse(), and Chara.Vomit().

◆ GetText()

override string Stats.GetText ( )
inlinevirtual

Reimplemented from BaseStats.

Definition at line 94 of file Stats.cs.

95 {
96 string text = base.source.GetTextArray("strPhase")[GetPhase()];
97 if (!(text == "#"))
98 {
99 return text;
100 }
101 return "";
102 }
override int GetPhase()
Definition: Stats.cs:117

References GetPhase().

Referenced by WindowChara.AddNeeds().

◆ GetValue()

override int Stats.GetValue ( )
inlinevirtual

Reimplemented from BaseStats.

Definition at line 84 of file Stats.cs.

85 {
86 return value;
87 }

References value.

◆ Mod()

virtual void Stats.Mod ( int  a)
inlinevirtual

Reimplemented in StatsMana, and StatsStamina.

Definition at line 135 of file Stats.cs.

136 {
137 if (BaseStats.CC.IsAgent)
138 {
139 return;
140 }
142 {
143 int phase = GetPhase();
144 value += a;
145 if (value < min)
146 {
147 value = min;
148 }
149 else if (value > max)
150 {
151 value = max;
152 }
153 int phase2 = GetPhase();
154 if (phase2 != phase)
155 {
156 OnChangePhase(phase2, phase);
157 }
158 }
159 else
160 {
161 value += a;
162 if (value < min)
163 {
164 value = min;
165 }
166 else if (value > max)
167 {
168 value = max;
169 }
170 }
171 }
static Chara CC
Definition: BaseStats.cs:8
bool IsAgent
Definition: Card.cs:2109
virtual bool TrackPhaseChange
Definition: Stats.cs:80
virtual int min
Definition: Stats.cs:82
virtual void OnChangePhase(int phase, int lastPhase)
Definition: Stats.cs:173

References BaseStats.CC, GetPhase(), Card.IsAgent, max, min, OnChangePhase(), TrackPhaseChange, and value.

Referenced by TraitShrine._OnUse(), AI_PracticeDummy.CreateProgress(), Chara.Cure(), ActEffect.DamageEle(), Card.DamageHP(), Chara.Drink(), AI_Fish.ProgressFish.Fail(), AI_Fuck.Finish(), AI_Massage.Finish(), Chara.GiveGift(), TaskChopWood.OnCreateProgress(), TaskDrawWater.OnCreateProgress(), TaskHarvest.OnCreateProgress(), TaskPlow.OnCreateProgress(), TaskPourWater.OnCreateProgress(), MiniGame.OnPlay(), AI_Fish.ProgressFish.OnProgressComplete(), TaskCraft.OnProgressComplete(), TaskDig.OnProgressComplete(), TaskMine.OnProgressComplete(), TraitBaseSpellbook.OnRead(), ConSleep.OnRemoved(), Chara.OnSleep(), LayerMiniGame.OnUpdateInput(), ActRanged.Perform(), ActPray.Pray(), FoodEffect.Proc(), TraitBaseSpellbook.ReadFailEffect(), AI_Bladder.Run(), AI_Craft_Snowman.Run(), AI_Fuck.Run(), AI_Idle.Run(), AI_OpenGambleChest.Run(), AI_PassTime.Run(), AI_PlayMusic.Run(), AI_Shear.Run(), AI_Slaughter.Run(), AI_Steal.Run(), AI_UseCrafter.Run(), TaskClean.Run(), Zone.Simulate(), ActThrow.Throw(), Chara.Tick(), ConSleep.Tick(), Chara.TickConditions(), Chara.TryAbsorbRod(), Trait.TryOpenLock(), Chara.UseAbility(), and Chara.Vomit().

◆ OnChangePhase()

virtual void Stats.OnChangePhase ( int  phase,
int  lastPhase 
)
inlinevirtual

Definition at line 173 of file Stats.cs.

174 {
175 bool flag = phase > lastPhase;
176 if (base.source.invert)
177 {
178 flag = !flag;
179 }
180 string[] array = (flag ? base.source.GetText("textPhase") : base.source.GetText("textPhase2")).Split(Environment.NewLine.ToCharArray());
181 if (array.Length > phase)
182 {
183 if (flag)
184 {
185 Msg.SetColor("negative");
186 }
187 BaseStats.CC.Say(array[phase].Split('|').RandomItem(), BaseStats.CC);
189 {
190 PopText();
191 }
192 }
193 }
void PopText()
Definition: BaseStats.cs:76
bool ShouldShowMsg
Definition: Card.cs:2314
void Say(string lang, string ref1=null, string ref2=null)
Definition: Card.cs:6046
Definition: Msg.cs:5
static void SetColor()
Definition: Msg.cs:22

References BaseStats.CC, BaseStats.PopText(), Card.Say(), Msg.SetColor(), and Card.ShouldShowMsg.

Referenced by Mod().

◆ Set() [1/2]

virtual void Stats.Set ( int  a)
inlinevirtual

Definition at line 122 of file Stats.cs.

123 {
124 value = a;
125 if (value < min)
126 {
127 value = min;
128 }
129 else if (value > max)
130 {
131 value = max;
132 }
133 }

References max, min, and value.

◆ Set() [2/2]

Stats Stats.Set ( int[]  _raw,
int  _rawIndex,
Chara  _CC 
)
inline

Definition at line 109 of file Stats.cs.

110 {
111 raw = _raw;
112 rawIndex = _rawIndex;
113 BaseStats.CC = _CC;
114 return this;
115 }
int[] raw
Definition: Stats.cs:53
int rawIndex
Definition: Stats.cs:51

References raw, and rawIndex.

Referenced by Chara.CalcBurden(), Chara.OnSleep(), and Game.StartNewGame().

◆ ToString()

override string Stats.ToString ( )
inline

Definition at line 89 of file Stats.cs.

90 {
91 return name + " " + value + " " + GetPhase();
92 }
string name
Definition: Stats.cs:78

References GetPhase(), name, and value.

Member Data Documentation

◆ Bladder

Stats Stats.Bladder
static
Initial value:
= new Stats
{
id = 6
}
Definition: Stats.cs:5

Definition at line 31 of file Stats.cs.

◆ Burden

StatsBurden Stats.Burden
static
Initial value:
{
id = 1
}

Definition at line 11 of file Stats.cs.

◆ Depression

Stats Stats.Depression
static
Initial value:
= new Stats
{
id = 5
}

Definition at line 26 of file Stats.cs.

◆ Hunger

StatsHunger Stats.Hunger
static
Initial value:
{
id = 0
}

Definition at line 6 of file Stats.cs.

◆ Hygiene

StatsHygiene Stats.Hygiene
static
Initial value:
{
id = 7
}

Definition at line 36 of file Stats.cs.

◆ Mana

StatsMana Stats.Mana
static
Initial value:
= new StatsMana
{
id = 8
}

Definition at line 41 of file Stats.cs.

◆ raw

int [] Stats.raw

Definition at line 53 of file Stats.cs.

Referenced by Set().

◆ rawIndex

int Stats.rawIndex

Definition at line 51 of file Stats.cs.

Referenced by Set().

◆ SAN

StatsSAN Stats.SAN
static
Initial value:
= new StatsSAN
{
id = 13
}

Definition at line 46 of file Stats.cs.

◆ Sleepiness

StatsSleepiness Stats.Sleepiness
static
Initial value:

Definition at line 21 of file Stats.cs.

◆ Stamina

StatsStamina Stats.Stamina
static
Initial value:
{
id = 3
}

Definition at line 16 of file Stats.cs.

Property Documentation

◆ max

◆ min

virtual int Stats.min
get

Definition at line 82 of file Stats.cs.

Referenced by Mod(), and Set().

◆ name

string Stats.name
get

Definition at line 78 of file Stats.cs.

Referenced by ToString().

◆ TrackPhaseChange

virtual bool Stats.TrackPhaseChange
get

Definition at line 80 of file Stats.cs.

Referenced by Mod().

◆ value


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