Elin Decompiled Documentation EA 23.102 Nightly
Loading...
Searching...
No Matches
CodexCreature.cs
Go to the documentation of this file.
1using Newtonsoft.Json;
2using UnityEngine;
3using UnityEngine.UI;
4
5public class CodexCreature : EClass
6{
7 public string id;
8
9 [JsonProperty]
10 public int[] _ints = new int[5];
11
12 public string Name => source.GetName(null, full: true);
13
15
16 public int numCard
17 {
18 get
19 {
20 return _ints[0];
21 }
22 set
23 {
24 _ints[0] = value;
25 }
26 }
27
28 public int weakspot
29 {
30 get
31 {
32 return _ints[2];
33 }
34 set
35 {
36 _ints[2] = value;
37 }
38 }
39
40 public int kills
41 {
42 get
43 {
44 return _ints[3];
45 }
46 set
47 {
48 _ints[3] = value;
49 }
50 }
51
52 public int spawns
53 {
54 get
55 {
56 return _ints[4];
57 }
58 set
59 {
60 _ints[4] = value;
61 }
62 }
63
64 public int BonusDropLv
65 {
66 get
67 {
68 if (numCard > 1)
69 {
70 return (int)Mathf.Sqrt((float)numCard * 1.5f);
71 }
72 return 0;
73 }
74 }
75
76 public bool droppedCard
77 {
78 get
79 {
80 return (_ints[1] & 2) != 0;
81 }
82 set
83 {
84 _ints[1] = (value ? (_ints[1] | 2) : (_ints[1] & -3));
85 }
86 }
87
88 public void SetImage(Image image, int idSkin = 0, bool nativeSize = true)
89 {
90 source.SetImage(image, null, 0, nativeSize, 0, idSkin);
91 image.SetActive(enable: true);
92 }
93
94 public string GetTextBonus()
95 {
96 string result = "noItem".lang();
97 if (BonusDropLv > 0)
98 {
99 result = "codexBonus1".lang(BonusDropLv.ToString() ?? "");
100 }
101 return result;
102 }
103}
SourceChara.Row source
string GetTextBonus()
void SetImage(Image image, int idSkin=0, bool nativeSize=true)
Definition: EClass.cs:5
static SourceManager sources
Definition: EClass.cs:42
SourceChara charas