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

Static Public Member Functions

static SourceMaterial.Row FromElement (int id)
 
static SourceMaterial.Row GetRandomMaterial (int lv, string group=null, bool tryLevelMatTier=false)
 
static SourceMaterial.Row GetRandomMaterialFromCategory (int lv, string cat, SourceMaterial.Row fallback)
 
static SourceMaterial.Row GetRandomMaterialFromCategory (int lv, string[] cat, SourceMaterial.Row fallback)
 
- 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 sqrt (int a)
 
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

const byte idNull = 1
 
const byte oak = 1
 
const byte granite = 3
 
const byte mud = 4
 
const byte sand = 8
 
const byte soil = 45
 
const byte snow = 48
 
const byte water = 66
 
const byte water_fresh = 67
 
const byte ice = 61
 
const byte gold = 12
 
const byte water_sea = 88
 
const byte process = 94
 
const byte sand_sea = 97
 
const string aliasNull = "oak"
 
const int MaxRandomTier = 4
 
const int MaxTier = 7
 
static SourceMaterial.Row sourceSnow = EClass.sources.materials.rows[48]
 
static SourceMaterial.Row sourceIce = EClass.sources.materials.rows[61]
 
static SourceMaterial.Row sourceGold = EClass.sources.materials.rows[12]
 
static SourceMaterial.Row sourceOak = EClass.sources.materials.rows[1]
 
- Static Public Attributes inherited from EClass
static Core core
 

Properties

static SourceMaterial.Row sourceWaterSea [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 5 of file MATERIAL.cs.

Member Function Documentation

◆ FromElement()

static SourceMaterial.Row MATERIAL.FromElement ( int  id)
inlinestatic

Definition at line 51 of file MATERIAL.cs.

52 {
53 return EClass.sources.materials.alias["rubinus"];
54 }
Definition: EClass.cs:6
static SourceManager sources
Definition: EClass.cs:43
SourceMaterial materials

References SourceManager.materials, and EClass.sources.

◆ GetRandomMaterial()

static SourceMaterial.Row MATERIAL.GetRandomMaterial ( int  lv,
string  group = null,
bool  tryLevelMatTier = false 
)
inlinestatic

Definition at line 56 of file MATERIAL.cs.

57 {
58 if (group == null)
59 {
60 group = ((EClass.rnd(2) == 0) ? "metal" : "leather");
61 }
62 if (!(group == "metal"))
63 {
64 if (group == "leather" && EClass.rnd(15) == 0)
65 {
66 group = "metal";
67 }
68 }
69 else if (EClass.rnd(15) == 0)
70 {
71 group = "leather";
72 }
74 int num = 0;
75 if (tryLevelMatTier)
76 {
77 num = Mathf.Clamp(lv / 15, 0, 4);
78 num = Mathf.Clamp(num + EClass.rnd(2) - EClass.rnd(2), 0, 4);
79 }
80 else
81 {
82 num = Mathf.Clamp(min: (lv >= 60) ? 2 : ((lv >= 25) ? 1 : 0), value: EClass.rnd(EClass.rnd(EClass.rnd(lv / 10 + 2) + 1) + 1), max: 4);
83 }
84 SourceMaterial.Tier obj = tierList.tiers[num];
85 SourceMaterial.Row result = obj.Select();
86 if (obj.list.Count == 0)
87 {
88 Debug.Log(lv + "/" + group + "/" + num + "/");
89 }
90 return result;
91 }
static int rnd(long a)
Definition: EClass.cs:59
static Dictionary< string, TierList > tierMap

References Debug, SourceMaterial.Tier.list, EClass.rnd(), SourceMaterial.Tier.Select(), SourceMaterial.tierMap, and SourceMaterial.TierList.tiers.

Referenced by TraitGodStatue._OnUse(), Card.Create(), TraitShrine.GetMaterial(), CoreDebug.QuickStart(), FortuneRollData.RefreshPrize(), TraitSwitch.TryDisarmTrap(), and Zone.TryGenerateOre().

◆ GetRandomMaterialFromCategory() [1/2]

static SourceMaterial.Row MATERIAL.GetRandomMaterialFromCategory ( int  lv,
string  cat,
SourceMaterial::Row  fallback 
)
inlinestatic

Definition at line 93 of file MATERIAL.cs.

94 {
95 return GetRandomMaterialFromCategory(lv, new string[1] { cat }, fallback);
96 }
static SourceMaterial.Row GetRandomMaterialFromCategory(int lv, string cat, SourceMaterial.Row fallback)
Definition: MATERIAL.cs:93

References GetRandomMaterialFromCategory().

Referenced by GetRandomMaterialFromCategory(), MapGenDungen.OnGenerateTerrain(), Map.SetObj(), and Card.TryMakeRandomItem().

◆ GetRandomMaterialFromCategory() [2/2]

static SourceMaterial.Row MATERIAL.GetRandomMaterialFromCategory ( int  lv,
string[]  cat,
SourceMaterial::Row  fallback 
)
inlinestatic

Definition at line 98 of file MATERIAL.cs.

99 {
100 int min = ((lv >= 60) ? 2 : ((lv >= 25) ? 1 : 0));
101 int a2 = lv / 5 + 2;
102 int idTier = Mathf.Clamp(EClass.rnd(EClass.rnd(EClass.rnd(a2) + 1) + 1), min, 4);
103 List<SourceMaterial.Row> list = EClass.sources.materials.rows.Where((SourceMaterial.Row m) => cat.Contains(m.category) && m.tier <= idTier).ToList();
104 if (list.Count > 0)
105 {
106 return list.RandomItemWeighted((SourceMaterial.Row a) => a.chance * ((a.tier != idTier) ? 1 : 5));
107 }
108 return fallback;
109 }

References SourceManager.materials, EClass.rnd(), and EClass.sources.

Member Data Documentation

◆ aliasNull

const string MATERIAL.aliasNull = "oak"
static

Definition at line 35 of file MATERIAL.cs.

◆ gold

const byte MATERIAL.gold = 12
static

Definition at line 27 of file MATERIAL.cs.

◆ granite

const byte MATERIAL.granite = 3
static

Definition at line 11 of file MATERIAL.cs.

◆ ice

const byte MATERIAL.ice = 61
static

Definition at line 25 of file MATERIAL.cs.

◆ idNull

const byte MATERIAL.idNull = 1
static

Definition at line 7 of file MATERIAL.cs.

◆ MaxRandomTier

const int MATERIAL.MaxRandomTier = 4
static

Definition at line 37 of file MATERIAL.cs.

◆ MaxTier

const int MATERIAL.MaxTier = 7
static

Definition at line 39 of file MATERIAL.cs.

◆ mud

const byte MATERIAL.mud = 4
static

Definition at line 13 of file MATERIAL.cs.

◆ oak

const byte MATERIAL.oak = 1
static

Definition at line 9 of file MATERIAL.cs.

◆ process

const byte MATERIAL.process = 94
static

Definition at line 31 of file MATERIAL.cs.

◆ sand

const byte MATERIAL.sand = 8
static

Definition at line 15 of file MATERIAL.cs.

◆ sand_sea

const byte MATERIAL.sand_sea = 97
static

Definition at line 33 of file MATERIAL.cs.

◆ snow

const byte MATERIAL.snow = 48
static

Definition at line 19 of file MATERIAL.cs.

◆ soil

const byte MATERIAL.soil = 45
static

Definition at line 17 of file MATERIAL.cs.

◆ sourceGold

SourceMaterial.Row MATERIAL.sourceGold = EClass.sources.materials.rows[12]
static

Definition at line 45 of file MATERIAL.cs.

Referenced by BaseTileMap.DrawRoof().

◆ sourceIce

SourceMaterial.Row MATERIAL.sourceIce = EClass.sources.materials.rows[61]
static

Definition at line 43 of file MATERIAL.cs.

Referenced by Chara._Move().

◆ sourceOak

SourceMaterial.Row MATERIAL.sourceOak = EClass.sources.materials.rows[1]
static

Definition at line 47 of file MATERIAL.cs.

Referenced by Chara._Move().

◆ sourceSnow

SourceMaterial.Row MATERIAL.sourceSnow = EClass.sources.materials.rows[48]
static

◆ water

const byte MATERIAL.water = 66
static

Definition at line 21 of file MATERIAL.cs.

◆ water_fresh

const byte MATERIAL.water_fresh = 67
static

Definition at line 23 of file MATERIAL.cs.

◆ water_sea

const byte MATERIAL.water_sea = 88
static

Definition at line 29 of file MATERIAL.cs.

Property Documentation

◆ sourceWaterSea

SourceMaterial.Row MATERIAL.sourceWaterSea
staticget

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