Elin Decompiled Documentation EA 23.102 Nightly
Loading...
Searching...
No Matches
POLICY.cs
Go to the documentation of this file.
1using Newtonsoft.Json;
2using UnityEngine;
3
4public class POLICY
5{
6 public const int store_ripoff = 2816;
7
8 public const int livestock_priv = 2715;
9
10 public const int home_discount = 2800;
11
12 public const int open_business = 2810;
13
14 public const int tourist_safety = 2811;
15
16 public const int bed_quality = 2812;
17
18 public const int suite_room = 2813;
19
20 public const int mass_exhibition = 2814;
21
22 public const int platinum_ticket = 2815;
23
24 public const int store_premium = 2817;
25
26 public const int license_stolen = 2824;
27
28 public const int license_furniture = 2819;
29
30 public const int license_general = 2820;
31
32 public const int legendary_heirloom = 2821;
33
34 public const int celeb = 2822;
35
36 public const int legendary_exhibition = 2823;
37
38 public const int forcePanty = 2712;
39
40 public const int milk_fan = 2825;
41
42 public const int egg_fan = 2826;
43
44 public const int breed_season = 2827;
45
46 public const int license_slaver = 2828;
47
48 public const int license_food = 2818;
49
50 public const int incomeTransfer = 2711;
51
52 public const int nocturnal_life = 2508;
53
54 public const int noAnimal = 2709;
55
56 public const int wealth_tax = 2500;
57
58 public const int faith_tax = 2501;
59
60 public const int food_for_people = 2502;
61
62 public const int prohibition = 2503;
63
64 public const int noMother = 2710;
65
66 public const int legal_drug = 2505;
67
68 public const int human_right = 2506;
69
70 public const int inquisition = 2507;
71
72 public const int vaccination = 2509;
73
74 public const int ban_radio = 2510;
75
76 public const int self_sufficient = 2511;
77
78 public const int resident_tax = 2512;
79
80 public const int impressment = 2504;
81
82 public const int taxfree = 2514;
83
84 public const int noDM = 2708;
85
86 public const int resident_wanted = 2513;
87
88 public const int taxTransfer = 2705;
89
90 public const int weed_no = 2703;
91
92 public const int trash_no = 2702;
93
94 public const int demon_invocation = 2706;
95
96 public const int auto_farm = 2707;
97
98 public const int energy_conservation = 2700;
99
100 public const int speed_growth = 2516;
101
102 public const int stop_growth = 2515;
103
104 public const int trash_sort = 2701;
105
106 public const int border_watch = 2704;
107
108 public static readonly int[] IDS = new int[51]
109 {
110 2816, 2715, 2800, 2810, 2811, 2812, 2813, 2814, 2815, 2817,
111 2824, 2819, 2820, 2821, 2822, 2823, 2712, 2825, 2826, 2827,
112 2828, 2818, 2711, 2508, 2709, 2500, 2501, 2502, 2503, 2710,
113 2505, 2506, 2507, 2509, 2510, 2511, 2512, 2504, 2514, 2708,
114 2513, 2705, 2703, 2702, 2706, 2707, 2700, 2516, 2515, 2701,
115 2704
116 };
117}
118public class Policy : EClass
119{
120 [JsonProperty]
121 public int id;
122
123 [JsonProperty]
124 public int days;
125
126 [JsonProperty]
127 public bool active;
128
130
132
134
135 public string Name => source.GetName();
136
137 public Sprite Sprite => Resources.Load<Sprite>("Media/Graphics/Image/Policy/" + id);
138
139 public int Next => 100;
140
141 public int Cost => source.cost[0];
142
143 public void SetOwner(FactionBranch _branch)
144 {
145 branch = _branch;
146 }
147
148 public void OnAdvanceHour(VirtualDate date)
149 {
150 EClass._zone.elements.ModExp(id, 10);
151 }
152
153 public void RefreshEffect(UINote note = null)
154 {
155 switch (source.alias)
156 {
157 case "humanRight":
158 ModHappiness(20, FactionMemberType.Default, note);
159 ModHappiness(-10, FactionMemberType.Livestock, note);
160 break;
161 case "nocturnalLife":
162 ModHappiness(-20, FactionMemberType.Default, note);
163 break;
164 case "inquisition":
165 break;
166 case "legalDrug":
167 break;
168 case "prohibition":
169 break;
170 }
171 }
172
173 public void ModHappiness(int a, FactionMemberType type, UINote note)
174 {
175 if ((bool)note)
176 {
177 note.AddText("peHappiness".lang(("member" + type).lang(), a.ToString() ?? "").TagColorGoodBad(() => a >= 0));
178 }
179 else
180 {
181 branch.happiness.list[(int)type].modPolicy += a;
182 }
183 }
184
185 public void WriteNote(UINote n)
186 {
187 if (Ele == null)
188 {
189 Debug.Log(id);
190 return;
191 }
193 if (active)
194 {
195 n.Space();
196 n.AddText("activeFor".lang(days.ToString() ?? ""));
197 }
198 }
199
201 {
202 return 0;
203 }
204}
FactionMemberType
Definition: EClass.cs:5
static Zone _zone
Definition: EClass.cs:20
static SourceManager sources
Definition: EClass.cs:42
void ModExp(int ele, int a, bool chain=false)
Element GetElement(string alias)
void WriteNote(UINote n, ElementContainer owner=null, Action< UINote > onWriteNote=null)
Definition: ELEMENT.cs:574
HappinessManager happiness
ElementContainerZone elements
List< Happiness > list
Definition: POLICY.cs:5
const int resident_tax
Definition: POLICY.cs:78
const int legal_drug
Definition: POLICY.cs:66
const int border_watch
Definition: POLICY.cs:106
const int legendary_heirloom
Definition: POLICY.cs:32
const int bed_quality
Definition: POLICY.cs:16
const int nocturnal_life
Definition: POLICY.cs:52
const int store_ripoff
Definition: POLICY.cs:6
const int human_right
Definition: POLICY.cs:68
const int open_business
Definition: POLICY.cs:12
const int ban_radio
Definition: POLICY.cs:74
const int trash_sort
Definition: POLICY.cs:104
const int livestock_priv
Definition: POLICY.cs:8
const int faith_tax
Definition: POLICY.cs:58
const int license_slaver
Definition: POLICY.cs:46
const int noMother
Definition: POLICY.cs:64
const int resident_wanted
Definition: POLICY.cs:86
const int noDM
Definition: POLICY.cs:84
const int self_sufficient
Definition: POLICY.cs:76
const int incomeTransfer
Definition: POLICY.cs:50
const int license_furniture
Definition: POLICY.cs:28
const int auto_farm
Definition: POLICY.cs:96
const int wealth_tax
Definition: POLICY.cs:56
const int home_discount
Definition: POLICY.cs:10
const int platinum_ticket
Definition: POLICY.cs:22
const int vaccination
Definition: POLICY.cs:72
const int tourist_safety
Definition: POLICY.cs:14
const int legendary_exhibition
Definition: POLICY.cs:36
const int speed_growth
Definition: POLICY.cs:100
const int license_food
Definition: POLICY.cs:48
const int noAnimal
Definition: POLICY.cs:54
const int impressment
Definition: POLICY.cs:80
const int celeb
Definition: POLICY.cs:34
const int milk_fan
Definition: POLICY.cs:40
const int taxfree
Definition: POLICY.cs:82
const int license_general
Definition: POLICY.cs:30
const int egg_fan
Definition: POLICY.cs:42
const int store_premium
Definition: POLICY.cs:24
const int breed_season
Definition: POLICY.cs:44
const int inquisition
Definition: POLICY.cs:70
const int energy_conservation
Definition: POLICY.cs:98
const int weed_no
Definition: POLICY.cs:90
const int stop_growth
Definition: POLICY.cs:102
const int food_for_people
Definition: POLICY.cs:60
static readonly int[] IDS
Definition: POLICY.cs:108
const int suite_room
Definition: POLICY.cs:18
const int demon_invocation
Definition: POLICY.cs:94
const int trash_no
Definition: POLICY.cs:92
const int prohibition
Definition: POLICY.cs:62
const int mass_exhibition
Definition: POLICY.cs:20
const int license_stolen
Definition: POLICY.cs:26
const int forcePanty
Definition: POLICY.cs:38
const int taxTransfer
Definition: POLICY.cs:88
void ModHappiness(int a, FactionMemberType type, UINote note)
Definition: POLICY.cs:173
int Cost
Definition: POLICY.cs:141
string Name
Definition: POLICY.cs:135
void RefreshEffect(UINote note=null)
Definition: POLICY.cs:153
Element Ele
Definition: POLICY.cs:131
int id
Definition: POLICY.cs:121
int GetSortVal(UIList.SortMode m)
Definition: POLICY.cs:200
bool active
Definition: POLICY.cs:127
void WriteNote(UINote n)
Definition: POLICY.cs:185
void OnAdvanceHour(VirtualDate date)
Definition: POLICY.cs:148
SourceElement.Row source
Definition: POLICY.cs:133
FactionBranch branch
Definition: POLICY.cs:129
int Next
Definition: POLICY.cs:139
Sprite Sprite
Definition: POLICY.cs:137
int days
Definition: POLICY.cs:124
void SetOwner(FactionBranch _branch)
Definition: POLICY.cs:143
SourceElement elements
Definition: UIList.cs:9
SortMode
Definition: UIList.cs:27
Definition: UINote.cs:6
UIItem AddText(string text, FontColor color=FontColor.DontChange)
Definition: UINote.cs:113
void Space(int sizeY=0, int sizeX=1)
Definition: UINote.cs:62
ElementContainerZone elements
Definition: Zone.cs:43