Elin Decompiled Documentation EA 23.102 Nightly
Loading...
Searching...
No Matches
LayerGachaResult Class Reference
Inheritance diagram for LayerGachaResult:
ELayer Layer IUISkin

Classes

class  Data
 

Public Types

enum  Mode { Chara }
 

Public Member Functions

void PlayGacha (int n, string id)
 
void Refresh ()
 
- Public Member Functions inherited from ELayer
override void OnBeforeAddLayer ()
 
void InitInspector ()
 
sealed override void Init ()
 
override void OnAfterAddLayer ()
 
void TryShowHelp ()
 
void AddLayerToUI (string id)
 
void TryShowHint (string _langHint=null)
 
void TalkHomeMemeber (string id)
 
void TalkMaid (string id)
 
override void OnRightClick ()
 
- Public Member Functions inherited from Layer
virtual string GetTextHeader (Window window)
 
virtual bool HeaderIsListOf (int id)
 
virtual void Init ()
 
virtual void OnInit ()
 
virtual void OnAfterInit ()
 
virtual void ApplySkin ()
 
void ShowScreenLock (string id)
 
void UpdateInput ()
 
virtual void OnUpdateInput ()
 
virtual void OnRightClick ()
 
virtual bool OnBack ()
 
virtual void OnChangeLayer ()
 
virtual void OnCreate ()
 
void _AddLayer (string id)
 
Layer AddLayer (string id)
 
AddLayer< T > ()
 
AddLayer< T > (string id)
 
AddLayerDontCloseOthers< T > ()
 
Layer AddLayerDontCloseOthers (Layer l)
 
GetOrAddLayer< T > ()
 
virtual void OnBeforeAddLayer ()
 
virtual void OnAfterAddLayer ()
 
Layer AddLayer (Layer l)
 
void ToggleLayer (string id)
 
ToggleLayer< T > (string id=null)
 
void WaitAndClose ()
 
void OnClickClose ()
 
virtual void Close ()
 
void CloseLayers ()
 
void RemoveLayers (bool removeImportant=false)
 
bool RemoveLayer< T > ()
 
void RemoveLayer (Layer l)
 
virtual void OnKill ()
 
Layer SetOnKill (Action action)
 
void DisableClose ()
 
void Delay (float duration=0.05f)
 
Layer SetDelay (float d)
 
Layer GetLayer (string id)
 
GetLayer< T > (bool fromTop=false)
 
Layer GetTopLayer ()
 
void SwitchContent (int idWindow, int i)
 
virtual void OnSwitchContent (Window window)
 
Layer SetTitles (string langList, string idHeaderRow=null)
 
bool IsBlockWidgetClick ()
 
bool IsHideHud ()
 
bool IsAllowGeneralInput ()
 
bool IsUseBlur ()
 
bool IsPointerOnLayer ()
 
void ApplySkin ()
 

Static Public Member Functions

static Chara Draw (string id="citizen")
 
- Static Public Member Functions inherited from ELayer
static int rnd (int a)
 
- Static Public Member Functions inherited from Layer
static T Create< T > ()
 
static T Create< T > (string path)
 
static Layer Create (string path)
 

Public Attributes

ItemGachaResult moldItem
 
LayoutGroup layout
 
UIButton buttonGetAll
 
UIButton buttonDumpAll
 
Mode mode
 
List< ItemGachaResultitems = new List<ItemGachaResult>()
 
- Public Attributes inherited from Layer
Option option
 
UnityEvent onKill
 
Anime animeIn
 
Anime animeOut
 
bool closeOthers
 
bool defaultActionMode = true
 
Button screenLock
 
Layer parent
 
string idLayer
 
List< Layerlayers = new List<Layer>()
 
Vector2 lastParentPos
 
List< Windowwindows = new List<Window>()
 
string langHint
 

Additional Inherited Members

- Static Public Attributes inherited from Layer
static int skipInput
 
static bool closeOnRightClick
 
static bool rightClicked
 
static bool cancelKeyDown
 
static bool ignoreSounds
 
static Transform blurStopInstance
 
static string[] searchPath = new string[3] { "Layer", "Layer/Dialog", "Layer/LayerHome" }
 
- Protected Member Functions inherited from ELayer
sealed override void _Close ()
 
sealed override void Kill ()
 
- Protected Member Functions inherited from Layer
virtual void Awake ()
 
virtual void _Close ()
 
virtual void Kill ()
 
- Protected Attributes inherited from Layer
RectTransform _rect
 
bool isDestroyed
 
- Properties inherited from ELayer
static Core core [get]
 
static Game game [get]
 
static bool AdvMode [get]
 
static Player player [get]
 
static Chara pc [get]
 
static FactionBranch Branch [get]
 
static Faction Home [get]
 
static UI ui [get]
 
static Map _map [get]
 
static Zone _zone [get]
 
static Scene scene [get]
 
static BaseGameScreen screen [get]
 
static CoreConfig config [get]
 
static GameSetting setting [get]
 
static ColorProfile Colors [get]
 
static SourceManager sources [get]
 
static World world [get]
 
static SoundManager Sound [get]
 
static CoreDebug debug [get]
 
bool IsFloat [get]
 
virtual string IdHelp [get]
 
- Properties inherited from Layer
Layer TopLayer [get]
 
string uid [get]
 
virtual RectTransform rectLayers [get]
 
virtual bool blockWidgetClick [get]
 

Detailed Description

Definition at line 4 of file LayerGachaResult.cs.

Member Enumeration Documentation

◆ Mode

Enumerator
Chara 

Definition at line 6 of file LayerGachaResult.cs.

7 {
9 }
Definition: Chara.cs:10

Member Function Documentation

◆ Draw()

static Chara LayerGachaResult.Draw ( string  id = "citizen")
inlinestatic

Definition at line 62 of file LayerGachaResult.cs.

63 {
64 List<Data> list = new List<Data>();
65 int num = 0;
66 foreach (SourceChara.Row row in ELayer.sources.charas.rows)
67 {
68 switch (id)
69 {
70 case "citizen":
71 if (!row.gachaFilter.Contains("resident"))
72 {
73 continue;
74 }
75 break;
76 case "livestock":
77 if (!row.gachaFilter.Contains("livestock"))
78 {
79 continue;
80 }
81 break;
82 case "unique":
83 if (!row.gachaFilter.Contains("resident") || row.quality != 4)
84 {
85 continue;
86 }
87 break;
88 default:
89 if (!row.gachaFilter.Contains("resident") && !row.gachaFilter.Contains("livestock"))
90 {
91 continue;
92 }
93 break;
94 }
95 int num2 = ((row.chance <= 0) ? 1 : row.chance);
96 if (row.LV < 10)
97 {
98 num2 = num2 * 300 / 100;
99 }
100 else if (row.LV < 20)
101 {
102 num2 = num2 * 250 / 100;
103 }
104 else if (row.LV < 30)
105 {
106 num2 = num2 * 200 / 100;
107 }
108 else if (row.LV < 50)
109 {
110 num2 = num2 * 150 / 100;
111 }
112 list.Add(new Data
113 {
114 row = row,
115 weight = num2
116 });
117 num += num2;
118 }
119 int num3 = ELayer.rnd(num);
120 int num4 = 0;
121 Data data = list[0];
122 foreach (Data item in list)
123 {
124 num4 += item.weight;
125 if (num3 < num4)
126 {
127 data = item;
128 break;
129 }
130 }
131 return CharaGen.Create(data.row.id);
132 }
static Chara Create(string id, int lv=-1)
Definition: CharaGen.cs:17
Definition: ELayer.cs:4
static SourceManager sources
Definition: ELayer.cs:37
static int rnd(int a)
Definition: ELayer.cs:49
SourceChara charas

References SourceManager.charas, CharaGen.Create(), item, ELayer.rnd(), and ELayer.sources.

◆ PlayGacha()

void LayerGachaResult.PlayGacha ( int  n,
string  id 
)
inline

Definition at line 30 of file LayerGachaResult.cs.

31 {
32 layout.DestroyChildren();
33 items.Clear();
34 for (int j = 0; j < n; j++)
35 {
36 Chara c = Draw(id.Split('_').LastItem());
38 itemGachaResult.SetChara(c, this);
39 items.Add(itemGachaResult);
40 }
42 Msg.Say("playedGacha", n.ToString() ?? "");
43 buttonGetAll.onClick.AddListener(delegate
44 {
45 ELayer.Sound.Play("good");
46 items.ForeachReverse(delegate(ItemGachaResult i)
47 {
48 i.Confirm(add: true);
49 });
50 });
51 buttonDumpAll.onClick.AddListener(delegate
52 {
53 ELayer.Sound.Play("pay");
54 items.ForeachReverse(delegate(ItemGachaResult i)
55 {
56 i.Confirm(add: false);
57 });
58 });
59 Refresh();
60 }
ThingContainer things
Definition: Card.cs:34
static Chara pc
Definition: ELayer.cs:15
static SoundManager Sound
Definition: ELayer.cs:41
void SetChara(Chara c, LayerGachaResult _layer)
void Confirm(bool add)
LayoutGroup layout
List< ItemGachaResult > items
ItemGachaResult moldItem
Definition: Msg.cs:5
static string Say(string idLang, string ref1, string ref2=null, string ref3=null, string ref4=null)
Definition: Msg.cs:58
void AddCurrency(Card owner, string id, int a, SourceMaterial.Row mat=null)
Definition: Util.cs:10
static Transform Instantiate(string path, Component parent=null)
Definition: Util.cs:67

References ThingContainer.AddCurrency(), buttonDumpAll, buttonGetAll, ItemGachaResult.Confirm(), Draw, items, layout, moldItem, ELayer.pc, Refresh(), Msg.Say(), ItemGachaResult.SetChara(), ELayer.Sound, Card.things, and Util.

◆ Refresh()

void LayerGachaResult.Refresh ( )
inline

Definition at line 134 of file LayerGachaResult.cs.

135 {
136 int num = 0;
137 foreach (ItemGachaResult item in items)
138 {
139 num += item.GetMedal();
140 }
141 buttonDumpAll.mainText.text = "dumpAll".lang(num.ToString() ?? "");
142 }

References item, and items.

Referenced by PlayGacha().

Member Data Documentation

◆ buttonDumpAll

UIButton LayerGachaResult.buttonDumpAll

Definition at line 24 of file LayerGachaResult.cs.

Referenced by PlayGacha().

◆ buttonGetAll

UIButton LayerGachaResult.buttonGetAll

Definition at line 22 of file LayerGachaResult.cs.

Referenced by PlayGacha().

◆ items

List<ItemGachaResult> LayerGachaResult.items = new List<ItemGachaResult>()

Definition at line 28 of file LayerGachaResult.cs.

Referenced by ItemGachaResult.Confirm(), PlayGacha(), and Refresh().

◆ layout

LayoutGroup LayerGachaResult.layout

Definition at line 20 of file LayerGachaResult.cs.

Referenced by PlayGacha().

◆ mode

Mode LayerGachaResult.mode

Definition at line 26 of file LayerGachaResult.cs.

◆ moldItem

ItemGachaResult LayerGachaResult.moldItem

Definition at line 18 of file LayerGachaResult.cs.

Referenced by PlayGacha().


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