Elin Decompiled Documentation EA 23.102 Nightly
Loading...
Searching...
No Matches
Hoard Class Reference
Inheritance diagram for Hoard:
EClass

Classes

class  Item
 

Public Types

enum  Mode { all , lux , junk }
 

Public Member Functions

Item AddRandom (int r, bool msg=true)
 
Item AddRandom (bool msg=true)
 
Item Add (string id)
 
Item Add (string id, int num, bool msg=false)
 
Sprite GetSprite (string id)
 
GameObject GetActor (string id)
 
void Clear ()
 

Public Attributes

Dictionary< string, Itemitems = new Dictionary<string, Item>()
 
List< Itemlist = new List<Item>()
 
Mode mode
 
int bg
 
int reflection = 100
 
int maxSounds = 28
 
int volume = 40
 
int hiScore
 
int score
 
bool shadow = true
 
bool voice = true
 
bool pixelPerfect
 
bool hentai
 

Private Member Functions

void OnDeserialized (StreamingContext context)
 

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)
 
- Static Public Attributes inherited from EClass
static Core core
 
- 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 7 of file Hoard.cs.

Member Enumeration Documentation

◆ Mode

enum Hoard.Mode
Enumerator
all 
lux 
junk 

Definition at line 9 of file Hoard.cs.

10 {
11 all,
12 lux,
13 junk
14 }

Member Function Documentation

◆ Add() [1/2]

Item Hoard.Add ( string  id)
inline

Definition at line 161 of file Hoard.cs.

162 {
164 int num = ((row.num == 0) ? 10 : row.num);
165 if (num != 1)
166 {
167 num *= 2;
168 }
169 Item item = Add(row.id, num);
170 item.random = true;
171 return item;
172 }
Definition: EClass.cs:5
static SourceManager sources
Definition: EClass.cs:42
Item Add(string id)
Definition: Hoard.cs:161
SourceCollectible collectibles

References Add(), SourceManager.collectibles, SourceCollectible.Row.id, item, SourceCollectible.Row.num, and EClass.sources.

Referenced by Add(), LayerHoard.AddRandom(), AddRandom(), LayerHoard.Generate(), LayerCollectible.OnAfterInit(), LayerHoard.OnClickClear(), and LayerHoard.Update().

◆ Add() [2/2]

Item Hoard.Add ( string  id,
int  num,
bool  msg = false 
)
inline

Definition at line 174 of file Hoard.cs.

175 {
176 if (num == 0)
177 {
178 return items.TryGetValue(id);
179 }
180 Item value = null;
181 if (!items.TryGetValue(id, out value))
182 {
183 value = new Item
184 {
185 id = id
186 };
187 list.Add(value);
188 items[id] = value;
189 }
190 if (value.num == value.show)
191 {
192 value.show += num;
193 }
194 value.num += num;
195 if (value.IsUnique && value.show > 1)
196 {
197 value.show = 1;
198 }
199 if (msg)
200 {
201 Msg.SetColor(EClass.Colors.GetRarityColor(value.Source.rarity, light: true));
202 Msg.AquireItem(value.Name(num));
203 }
204 if (hentai)
205 {
206 value.show = value.num;
207 }
208 return value;
209 }
Color GetRarityColor(int r, bool light=false)
static ColorProfile Colors
Definition: EClass.cs:38
bool hentai
Definition: Hoard.cs:138
List< Item > list
Definition: Hoard.cs:109
Dictionary< string, Item > items
Definition: Hoard.cs:106
Definition: Msg.cs:5
static void AquireItem(string itemName)
Definition: Msg.cs:140
static void SetColor()
Definition: Msg.cs:22

References Msg.AquireItem(), EClass.Colors, ColorProfile.GetRarityColor(), hentai, Hoard.Item.IsUnique, items, list, Hoard.Item.Name(), Hoard.Item.num, Msg.SetColor(), Hoard.Item.show, and Hoard.Item.Source.

◆ AddRandom() [1/2]

Item Hoard.AddRandom ( bool  msg = true)
inline

Definition at line 155 of file Hoard.cs.

156 {
157 string id = EClass.sources.collectibles.rows.RandomItem().id;
158 return Add(id, 1, msg);
159 }

References Add(), SourceManager.collectibles, and EClass.sources.

◆ AddRandom() [2/2]

Item Hoard.AddRandom ( int  r,
bool  msg = true 
)
inline

Definition at line 149 of file Hoard.cs.

150 {
151 IEnumerable<SourceCollectible.Row> ie = EClass.sources.collectibles.rows.Where((SourceCollectible.Row a) => a.rarity == r);
152 return Add(ie.RandomItem().id, 1, msg);
153 }

References Add(), SourceManager.collectibles, and EClass.sources.

Referenced by LayerGacha.PlayGacha().

◆ Clear()

void Hoard.Clear ( )
inline

Definition at line 226 of file Hoard.cs.

227 {
228 items.Clear();
229 list.Clear();
230 }

References items, and list.

Referenced by LayerHoard.Generate(), and LayerHoard.OnClickClear().

◆ GetActor()

GameObject Hoard.GetActor ( string  id)
inline

Definition at line 217 of file Hoard.cs.

218 {
221 SpriteRenderer spriteRenderer = Object.Instantiate(ResourceCache.Load<SpriteRenderer>("UI/Layer/Hoard/Molds/" + row.prefab.IsEmpty("default")));
222 spriteRenderer.sprite = GetSprite(id);
223 return spriteRenderer.gameObject;
224 }
Sprite GetSprite(string id)
Definition: Hoard.cs:211

References SourceManager.collectibles, GetSprite(), SourceCollectible.Row.prefab, and EClass.sources.

Referenced by HoardActor.Activate().

◆ GetSprite()

Sprite Hoard.GetSprite ( string  id)
inline

Definition at line 211 of file Hoard.cs.

212 {
213 SpriteSheet.Add("UI/Layer/Hoard/Molds/_sprites_hoard");
214 return SpriteSheet.Get("_sprites_hoard_" + id);
215 }
static void Add(Sprite sprite)
Definition: SpriteSheet.cs:10
static Sprite Get(string id)
Definition: SpriteSheet.cs:28

References SpriteSheet.Add(), and SpriteSheet.Get().

Referenced by GetActor(), UIHangIcon.Refresh(), LayerCollectible.RefreshInfo(), and LayerCollectible.SetButton().

◆ OnDeserialized()

void Hoard.OnDeserialized ( StreamingContext  context)
inlineprivate

Definition at line 141 of file Hoard.cs.

142 {
143 foreach (Item item in list)
144 {
145 items.Add(item.id, item);
146 }
147 }

References item, items, and list.

Member Data Documentation

◆ bg

int Hoard.bg

Definition at line 115 of file Hoard.cs.

Referenced by LayerHoard.OnClickConfig().

◆ hentai

bool Hoard.hentai

Definition at line 138 of file Hoard.cs.

Referenced by Add().

◆ hiScore

int Hoard.hiScore

Definition at line 127 of file Hoard.cs.

Referenced by CollectibleActor.OnCollisionEnter2D(), and LayerHoard.Update().

◆ items

Dictionary<string, Item> Hoard.items = new Dictionary<string, Item>()

◆ list

List<Item> Hoard.list = new List<Item>()

Definition at line 109 of file Hoard.cs.

Referenced by Add(), Clear(), and OnDeserialized().

◆ maxSounds

int Hoard.maxSounds = 28

◆ mode

Mode Hoard.mode

Definition at line 112 of file Hoard.cs.

Referenced by HoardActor.Activate(), LayerHoard.OnClickNextMode(), and LayerHoard.Reset().

◆ pixelPerfect

bool Hoard.pixelPerfect

Definition at line 136 of file Hoard.cs.

Referenced by LayerHoard.OnClickConfig(), and HoardActor.RefreshZoom().

◆ reflection

int Hoard.reflection = 100

Definition at line 118 of file Hoard.cs.

Referenced by LayerHoard.OnClickConfig(), and HoardActor.RefreshBG().

◆ score

int Hoard.score

Definition at line 130 of file Hoard.cs.

Referenced by CollectibleActor.OnCollisionEnter2D(), and LayerHoard.Update().

◆ shadow

bool Hoard.shadow = true

Definition at line 132 of file Hoard.cs.

Referenced by LayerHoard.OnClickConfig(), and HoardActor.Update().

◆ voice

bool Hoard.voice = true

Definition at line 134 of file Hoard.cs.

Referenced by HoardActor.Activate(), and LayerHoard.OnClickConfig().

◆ volume

int Hoard.volume = 40

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