Elin Modding Docs Doc
Loading...
Searching...
No Matches
Policy.2.cs
1using System;
2using Newtonsoft.Json;
3using UnityEngine;
4
5// Token: 0x02000077 RID: 119
6public class Policy : EClass
7{
8 // Token: 0x170000A1 RID: 161
9 // (get) Token: 0x0600036C RID: 876 RVA: 0x0001990C File Offset: 0x00017B0C
10 public Element Ele
11 {
12 get
13 {
14 return this.branch.elements.GetElement(this.id);
15 }
16 }
17
18 // Token: 0x170000A2 RID: 162
19 // (get) Token: 0x0600036D RID: 877 RVA: 0x00019924 File Offset: 0x00017B24
20 public SourceElement.Row source
21 {
22 get
23 {
24 return EClass.sources.elements.map[this.id];
25 }
26 }
27
28 // Token: 0x170000A3 RID: 163
29 // (get) Token: 0x0600036E RID: 878 RVA: 0x00019940 File Offset: 0x00017B40
30 public string Name
31 {
32 get
33 {
34 return this.source.GetName();
35 }
36 }
37
38 // Token: 0x170000A4 RID: 164
39 // (get) Token: 0x0600036F RID: 879 RVA: 0x0001994D File Offset: 0x00017B4D
40 public Sprite Sprite
41 {
42 get
43 {
44 return Resources.Load<Sprite>("Media/Graphics/Image/Policy/" + this.id.ToString());
45 }
46 }
47
48 // Token: 0x170000A5 RID: 165
49 // (get) Token: 0x06000370 RID: 880 RVA: 0x00019969 File Offset: 0x00017B69
50 public int Next
51 {
52 get
53 {
54 return 100;
55 }
56 }
57
58 // Token: 0x170000A6 RID: 166
59 // (get) Token: 0x06000371 RID: 881 RVA: 0x0001996D File Offset: 0x00017B6D
60 public int Cost
61 {
62 get
63 {
64 return this.source.cost[0];
65 }
66 }
67
68 // Token: 0x06000372 RID: 882 RVA: 0x0001997C File Offset: 0x00017B7C
69 public void SetOwner(FactionBranch _branch)
70 {
71 this.branch = _branch;
72 }
73
74 // Token: 0x06000373 RID: 883 RVA: 0x00019985 File Offset: 0x00017B85
75 public void OnAdvanceHour(VirtualDate date)
76 {
77 EClass._zone.elements.ModExp(this.id, 10, false);
78 }
79
80 // Token: 0x06000374 RID: 884 RVA: 0x000199A0 File Offset: 0x00017BA0
81 public void RefreshEffect(UINote note = null)
82 {
83 string alias = this.source.alias;
84 if (!(alias == "humanRight"))
85 {
86 if (!(alias == "inquisition") && !(alias == "legalDrug") && !(alias == "prohibition"))
87 {
88 if (!(alias == "nocturnalLife"))
89 {
90 return;
91 }
92 this.ModHappiness(-20, FactionMemberType.Default, note);
93 }
94 return;
95 }
96 this.ModHappiness(20, FactionMemberType.Default, note);
97 this.ModHappiness(-10, FactionMemberType.Livestock, note);
98 }
99
100 // Token: 0x06000375 RID: 885 RVA: 0x00019A1C File Offset: 0x00017C1C
101 public void ModHappiness(int a, FactionMemberType type, UINote note)
102 {
103 if (note)
104 {
105 note.AddText("peHappiness".lang(("member" + type.ToString()).lang(), a.ToString() ?? "", null, null, null).TagColorGoodBad(() => a >= 0, false), FontColor.DontChange);
106 return;
107 }
108 this.branch.happiness.list[(int)type].modPolicy += a;
109 }
110
111 // Token: 0x06000376 RID: 886 RVA: 0x00019AC0 File Offset: 0x00017CC0
112 public void WriteNote(UINote n)
113 {
114 if (this.Ele == null)
115 {
116 Debug.Log(this.id);
117 return;
118 }
119 this.Ele.WriteNote(n, EClass._zone.elements, null);
120 if (this.active)
121 {
122 n.Space(0, 1);
123 n.AddText("activeFor".lang(this.days.ToString() ?? "", null, null, null, null), FontColor.DontChange);
124 }
125 }
126
127 // Token: 0x06000377 RID: 887 RVA: 0x00019B37 File Offset: 0x00017D37
128 public int GetSortVal(UIList.SortMode m)
129 {
130 return 0;
131 }
132
133 // Token: 0x04000577 RID: 1399
134 [JsonProperty]
135 public int id;
136
137 // Token: 0x04000578 RID: 1400
138 [JsonProperty]
139 public int days;
140
141 // Token: 0x04000579 RID: 1401
142 [JsonProperty]
143 public bool active;
144
145 // Token: 0x0400057A RID: 1402
146 public FactionBranch branch;
147}