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

Public Member Functions

int Select (int lv)
 

Public Attributes

List< SourceElement.RowlistSource = new List<SourceElement.Row>()
 
List< SourceElement.Rowlist = new List<SourceElement.Row>()
 
string type = "B"
 
bool useDomain
 
int lvMod
 

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 4 of file ElementSelecter.cs.

Member Function Documentation

◆ Select()

int ElementSelecter.Select ( int  lv)
inline

Definition at line 16 of file ElementSelecter.cs.

17 {
18 if (listSource.Count == 0 || Application.isEditor)
19 {
20 listSource.Clear();
21 foreach (SourceElement.Row row2 in EClass.sources.elements.rows)
22 {
23 if (row2.thing.Contains(type) && row2.chance != 0 && !(row2.aliasRef == "mold"))
24 {
25 listSource.Add(row2);
26 }
27 }
28 }
29 list.Clear();
30 foreach (SourceElement.Row item in listSource)
31 {
32 if (item.LV > lv + lvMod)
33 {
34 continue;
35 }
36 if (!item.aliasRef.IsEmpty() && item.tag.Contains("domain"))
37 {
38 if (!useDomain && EClass.rnd(4) != 0)
39 {
40 continue;
41 }
42 SourceElement.Row row = EClass.sources.elements.alias[item.aliasRef];
43 if ((useDomain && !EClass.player.domains.Contains(row.id) && EClass.rnd(10) > 1) || !row.tag.Contains(item.alias.Split('_')[0]))
44 {
45 continue;
46 }
47 }
48 list.Add(item);
49 }
50 if (list.Count == 0)
51 {
52 return listSource.RandomItemWeighted((SourceElement.Row r) => r.chance).id;
53 }
54 return list.RandomItemWeighted((SourceElement.Row r) => r.chance).id;
55 }
Definition: EClass.cs:5
static int rnd(int a)
Definition: EClass.cs:50
static SourceManager sources
Definition: EClass.cs:42
static Player player
Definition: EClass.cs:12
List< SourceElement.Row > list
List< SourceElement.Row > listSource
List< int > domains
Definition: Player.cs:880
SourceElement elements

References Player.domains, SourceManager.elements, SourceElement.Row.id, item, list, listSource, lvMod, EClass.player, EClass.rnd(), EClass.sources, SourceElement.Row.tag, type, and useDomain.

Referenced by TraitBaseSpellbook.OnCreate(), TraitPerfume.OnCreate(), TraitPotionRandom.OnCreate(), TraitRodRandom.OnCreate(), and TraitScrollRandom.OnCreate().

Member Data Documentation

◆ list

List<SourceElement.Row> ElementSelecter.list = new List<SourceElement.Row>()

Definition at line 8 of file ElementSelecter.cs.

Referenced by Select().

◆ listSource

List<SourceElement.Row> ElementSelecter.listSource = new List<SourceElement.Row>()

Definition at line 6 of file ElementSelecter.cs.

Referenced by Select().

◆ lvMod

int ElementSelecter.lvMod

Definition at line 14 of file ElementSelecter.cs.

Referenced by Select().

◆ type

string ElementSelecter.type = "B"

Definition at line 10 of file ElementSelecter.cs.

Referenced by Select().

◆ useDomain

bool ElementSelecter.useDomain

Definition at line 12 of file ElementSelecter.cs.

Referenced by Select().


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