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

Static Public Member Functions

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

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

◆ GetRandomMaterial()

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

Definition at line 43 of file MATERIAL.cs.

44 {
45 if (group == null)
46 {
47 group = ((EClass.rnd(2) == 0) ? "metal" : "leather");
48 }
49 if (!(group == "metal"))
50 {
51 if (group == "leather" && EClass.rnd(15) == 0)
52 {
53 group = "metal";
54 }
55 }
56 else if (EClass.rnd(15) == 0)
57 {
58 group = "leather";
59 }
61 int num = 0;
62 if (tryLevelMatTier)
63 {
64 num = Mathf.Clamp(lv / 15, 0, tierList.tiers.Length - 1);
65 num = Mathf.Clamp(num + EClass.rnd(2) - EClass.rnd(2), 0, tierList.tiers.Length - 1);
66 }
67 else
68 {
69 int min = ((lv >= 60) ? 2 : ((lv >= 25) ? 1 : 0));
70 num = Mathf.Clamp(EClass.rnd(EClass.rnd(EClass.rnd(lv / 10 + 2) + 1) + 1), min, tierList.tiers.Length - 1);
71 }
72 SourceMaterial.Tier obj = tierList.tiers[num];
73 SourceMaterial.Row result = obj.Select();
74 if (obj.list.Count == 0)
75 {
76 Debug.Log(lv + "/" + group + "/" + num + "/");
77 }
78 return result;
79 }
Definition: EClass.cs:5
static int rnd(int a)
Definition: EClass.cs:50
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 81 of file MATERIAL.cs.

82 {
83 return GetRandomMaterialFromCategory(lv, new string[1] { cat }, fallback);
84 }
static SourceMaterial.Row GetRandomMaterialFromCategory(int lv, string cat, SourceMaterial.Row fallback)
Definition: MATERIAL.cs:81

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 86 of file MATERIAL.cs.

87 {
88 int min = ((lv >= 60) ? 2 : ((lv >= 25) ? 1 : 0));
89 int a2 = lv / 5 + 2;
90 int idTier = Mathf.Clamp(EClass.rnd(EClass.rnd(EClass.rnd(a2) + 1) + 1), min, 4);
91 List<SourceMaterial.Row> list = EClass.sources.materials.rows.Where((SourceMaterial.Row m) => cat.Contains(m.category) && m.tier <= idTier).ToList();
92 if (list.Count > 0)
93 {
94 return list.RandomItemWeighted((SourceMaterial.Row a) => a.chance * ((a.tier != idTier) ? 1 : 5));
95 }
96 return fallback;
97 }
static SourceManager sources
Definition: EClass.cs:42
SourceMaterial materials

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

Member Data Documentation

◆ gold

const byte MATERIAL.gold = 12
static

Definition at line 25 of file MATERIAL.cs.

◆ granite

const byte MATERIAL.granite = 3
static

Definition at line 9 of file MATERIAL.cs.

◆ ice

const byte MATERIAL.ice = 61
static

Definition at line 23 of file MATERIAL.cs.

◆ mud

const byte MATERIAL.mud = 4
static

Definition at line 11 of file MATERIAL.cs.

◆ oak

const byte MATERIAL.oak = 1
static

Definition at line 7 of file MATERIAL.cs.

◆ process

const byte MATERIAL.process = 94
static

Definition at line 29 of file MATERIAL.cs.

◆ sand

const byte MATERIAL.sand = 8
static

Definition at line 13 of file MATERIAL.cs.

◆ sand_sea

const byte MATERIAL.sand_sea = 97
static

Definition at line 31 of file MATERIAL.cs.

◆ snow

const byte MATERIAL.snow = 48
static

Definition at line 17 of file MATERIAL.cs.

◆ soil

const byte MATERIAL.soil = 45
static

Definition at line 15 of file MATERIAL.cs.

◆ sourceGold

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

Definition at line 37 of file MATERIAL.cs.

Referenced by BaseTileMap.DrawRoof().

◆ sourceIce

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

Definition at line 35 of file MATERIAL.cs.

Referenced by Chara._Move().

◆ sourceOak

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

Definition at line 39 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 19 of file MATERIAL.cs.

◆ water_fresh

const byte MATERIAL.water_fresh = 67
static

Definition at line 21 of file MATERIAL.cs.

◆ water_sea

const byte MATERIAL.water_sea = 88
static

Definition at line 27 of file MATERIAL.cs.

Property Documentation

◆ sourceWaterSea

SourceMaterial.Row MATERIAL.sourceWaterSea
staticget

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