Elin Decompiled Documentation
EA 23.102 Nightly
Loading...
Searching...
No Matches
ElementSelecter.cs
Go to the documentation of this file.
1
using
System.Collections.Generic;
2
using
UnityEngine;
3
4
public
class
ElementSelecter
:
EClass
5
{
6
public
List<
SourceElement
.
Row
>
listSource
=
new
List<
SourceElement
.
Row
>();
7
8
public
List<
SourceElement
.
Row
>
list
=
new
List<
SourceElement
.
Row
>();
9
10
public
string
type
=
"B"
;
11
12
public
bool
useDomain
;
13
14
public
int
lvMod
;
15
16
public
int
Select
(
int
lv)
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
}
56
}
ContainerFlag.item
@ item
EClass
Definition:
EClass.cs:5
EClass.rnd
static int rnd(int a)
Definition:
EClass.cs:50
EClass.sources
static SourceManager sources
Definition:
EClass.cs:42
EClass.player
static Player player
Definition:
EClass.cs:12
ElementSelecter
Definition:
ElementSelecter.cs:5
ElementSelecter.type
string type
Definition:
ElementSelecter.cs:10
ElementSelecter.useDomain
bool useDomain
Definition:
ElementSelecter.cs:12
ElementSelecter.lvMod
int lvMod
Definition:
ElementSelecter.cs:14
ElementSelecter.list
List< SourceElement.Row > list
Definition:
ElementSelecter.cs:8
ElementSelecter.Select
int Select(int lv)
Definition:
ElementSelecter.cs:16
ElementSelecter.listSource
List< SourceElement.Row > listSource
Definition:
ElementSelecter.cs:6
Player.domains
List< int > domains
Definition:
Player.cs:880
SourceElement.Row
Definition:
SourceElement.cs:11
SourceElement.Row.tag
string[] tag
Definition:
SourceElement.cs:66
SourceElement.Row.id
int id
Definition:
SourceElement.cs:12
SourceElement
Definition:
SourceElement.cs:8
SourceManager.elements
SourceElement elements
Definition:
SourceManager.cs:28
Elin
ElementSelecter.cs
Generated by
1.9.6