/
population.macros
275 lines (248 loc) · 9.96 KB
/
population.macros
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
GROWTH_RATE_FACTOR
'''
0.005 *
(1 - (Statistic If condition = And [Target EmpireHasAdoptedPolicy name = "PLC_NO_GROWTH"])) * // no growth with no-growth policy
(1 + 0.5*(Statistic If condition = And [Target EmpireHasAdoptedPolicy name = "PLC_POPULATION"])) * // +50% growth with population policy
(1 + (Statistic If condition = And [Target EmpireHasAdoptedPolicy name = "PLC_AUGMENTATION"]) * // slower growth with augmentation on low-infrastructure planets
min(1.2, max(0.5, Target.Construction / (NamedRealLookup name = "AUGMENTATION_FULL_GROWTH_INFRASTRUCTURE_REQUIREMENT"))))
'''
BASIC_POPULATION
'''
[[HOMEWORLD_BONUS_POPULATION]]
[[ENVIRONMENT_MODIFIER]]
[[SELF_SUSTAINING_BONUS]]
[[PHOTOTROPHIC_BONUS]]
[[GASEOUS_BONUS]]
[[HOMEWORLD_GROWTH_FOCUS_BOOST]]
// population growth or decay towards to target population
EffectsGroup
scope = Source
activation = And [
Planet
(LocalCandidate.LastTurnConquered < CurrentTurn)
]
priority = [[POPULATION_FIRST_PRIORITY]]
effects = SetPopulation value =
(Statistic If condition = (Value < Target.TargetPopulation) *
min(Target.TargetPopulation, Value + Value*[[GROWTH_RATE_FACTOR]]*
(Target.TargetPopulation + 1 - Value)))
+ (Statistic If condition = (Value >= Target.TargetPopulation) *
max(Target.TargetPopulation, Value - 0.1*(Value - Target.TargetPopulation)))
// Since all species have the same advanced focus effects and
// infrastructure, the macros are stashed here were they don't
// need to be manually included in each species macros.
[[FOCUS_CHANGE_PENALTY]]
[[ADVANCED_FOCUS_EFFECTS]]
[[STANDARD_CONSTRUCTION]]
[[STANDARD_METER_GROWTH]]
'''
AVERAGE_POPULATION
''' [[BASIC_POPULATION]]
'''
BAD_POPULATION
''' [[BASIC_POPULATION]]
EffectsGroup
description = "BAD_POPULATION_DESC"
scope = Source
activation = Planet
priority = [[TARGET_POPULATION_SCALING_PRIORITY]]
effects = SetTargetPopulation value = Value -0.25*abs(Value) accountinglabel = "BAD_POPULATION_LABEL"
'''
GOOD_POPULATION
''' [[BASIC_POPULATION]]
EffectsGroup
description = "GOOD_POPULATION_DESC"
scope = Source
activation = Planet
priority = [[TARGET_POPULATION_SCALING_PRIORITY]]
effects = SetTargetPopulation value = Value +0.25*abs(Value) accountinglabel = "GOOD_POPULATION_LABEL"
'''
/*
* Implements environmental modifiers from Growth techs.
* Changes to the growth tree should take this into account.
*/
ENVIRONMENT_MODIFIER
''' EffectsGroup
scope = Source
activation = And [
Planet
Planet environment = Uninhabitable
]
priority = [[TARGET_POPULATION_OVERRIDE_PRIORITY]]
effects = SetTargetPopulation value = -999 accountinglabel = "UNINHABTIABLE_ENVIRONMENT_LABEL"
EffectsGroup
scope = Source
activation = And [
Planet
Planet environment = Hostile
]
priority = [[TARGET_POPULATION_BEFORE_SCALING_PRIORITY]]
effects = SetTargetPopulation value = Value - 4 * Source.HabitableSize accountinglabel = "HOSTILE_ENVIRONMENT_LABEL"
EffectsGroup
scope = Source
activation = And [
Planet
Planet environment = Poor
]
priority = [[TARGET_POPULATION_BEFORE_SCALING_PRIORITY]]
effects = SetTargetPopulation value = Value - 2 * Source.HabitableSize accountinglabel = "POOR_ENVIRONMENT_LABEL"
/* EffectsGroup
scope = Source
activation = And [
Planet
Planet environment = Adequate
]
priority = [[TARGET_POPULATION_BEFORE_SCALING_PRIORITY]]
effects = SetTargetPopulation value = Value + 0 * Source.HabitableSize accountinglabel = "ADEQUATE_ENVIRONMENT_LABEL"
*/
EffectsGroup
scope = Source
activation = Planet environment = Good
priority = [[TARGET_POPULATION_BEFORE_SCALING_PRIORITY]]
effects = SetTargetPopulation value = Value + 3 * Target.HabitableSize accountinglabel = "GOOD_ENVIRONMENT_LABEL"
'''
HOMEWORLD_BONUS_POPULATION
''' EffectsGroup
scope = And [
Source
Homeworld name = Source.Species
]
activation = Planet
stackinggroup = "HOMEWORLD_STACK"
priority = [[TARGET_POPULATION_AFTER_SCALING_PRIORITY]]
effects = SetTargetPopulation value = Value + 2 * Target.HabitableSize accountinglabel = "HOMEWORLD_BONUS"
'''
HOMEWORLD_GROWTH_FOCUS_BOOST
''' EffectsGroup
scope = And [
Planet
OwnedBy empire = Source.Owner
Species name = Source.Species
Not Homeworld name = Source.Species
ResourceSupplyConnected empire = Source.Owner condition = Source
]
activation = And [
Planet
Focus type = "FOCUS_GROWTH"
Homeworld
]
stackinggroup = "HOMEWORLD_STACK"
priority = [[TARGET_POPULATION_AFTER_SCALING_PRIORITY]]
effects = SetTargetPopulation value = Value + 1 * Target.HabitableSize accountinglabel = "HOMEWORLD_SUPPLY"
'''
// This is dependent on current placement in population effects calc,
// just after Homeworld and Environment
SELF_SUSTAINING_BONUS
''' EffectsGroup
scope = Source
activation = And [
Planet environment = Good
HasTag name = "SELF_SUSTAINING"
]
accountinglabel = "SELF_SUSTAINING_LABEL"
priority = [[TARGET_POPULATION_AFTER_SCALING_PRIORITY]]
effects = SetTargetPopulation value = Value + 3 * Target.HabitableSize // Gets the same bonus as three growth specials
'''
PHOTOTROPHIC_BONUS
''' EffectsGroup
scope = Contains Source
activation = And [
Planet
Or [
OwnedBy affiliation = AnyEmpire
Star type = [BlackHole NoStar] // Natives are allowed to have bright or dim stars
]
HasTag name = "PHOTOTROPHIC"
Turn high = 0
Not Star type = [Orange]
]
effects = SetStarType type = Yellow // start with a normal star to be balanced
EffectsGroup
scope = Source
activation = And [
Planet
HasTag name = "PHOTOTROPHIC"
Star type = [Blue]
TargetPopulation low = 0
]
accountinglabel = "VERY_BRIGHT_STAR"
priority = [[TARGET_POPULATION_LAST_BEFORE_OVERRIDE_PRIORITY]]
effects = SetTargetPopulation value = Value + 3 * Source.HabitableSize
EffectsGroup
scope = Source
activation = And [
Planet
HasTag name = "PHOTOTROPHIC"
Star type = [White]
TargetPopulation low = 0
]
accountinglabel = "BRIGHT_STAR"
priority = [[TARGET_POPULATION_LAST_BEFORE_OVERRIDE_PRIORITY]]
effects = SetTargetPopulation value = Value + 1.5 * Source.HabitableSize
EffectsGroup
scope = Source
activation = And [
Planet
HasTag name = "PHOTOTROPHIC"
Star type = [Red Neutron]
]
accountinglabel = "DIM_STAR"
priority = [[TARGET_POPULATION_LAST_BEFORE_OVERRIDE_PRIORITY]]
effects = SetTargetPopulation value = Value - 1 * Source.HabitableSize
EffectsGroup
scope = Source
activation = And [
Planet
HasTag name = "PHOTOTROPHIC"
Star type = [BlackHole NoStar]
]
accountinglabel = "NO_STAR"
priority = [[TARGET_POPULATION_LAST_BEFORE_OVERRIDE_PRIORITY]]
effects = SetTargetPopulation value = Value - 10 * Source.HabitableSize
'''
GASEOUS_BONUS
''' EffectsGroup
scope = Source
activation = And [
Planet type = GasGiant
HasTag name = "GASEOUS"
]
accountinglabel = "GASEOUS_LABEL"
priority = [[TARGET_POPULATION_SCALING_PRIORITY]]
effects = SetTargetPopulation value = Value - 0.5*abs(Value)
'''
// @1@ Species key
LIFECYCLE_MANIP_POPULATION_EFFECTS
'''
EffectsGroup
scope = And [
Object id = Source.PlanetID
Planet
]
activation = And [
Not OwnerHasTech name = "GRO_LIFECYCLE_MAN"
Turn low = LocalCandidate.CreationTurn + 1 high = LocalCandidate.CreationTurn + 1
]
priority = [[POPULATION_DEFAULT_PRIORITY]]
effects = [
SetSpecies name = @1@
SetPopulation value = 1
]
EffectsGroup
scope = And [
Object id = Source.PlanetID
Planet
]
activation = And [
OwnerHasTech name = "GRO_LIFECYCLE_MAN"
Turn low = LocalCandidate.CreationTurn + 1 high = LocalCandidate.CreationTurn + 1
]
priority = [[POPULATION_DEFAULT_PRIORITY]]
effects = [
SetSpecies name = @1@
SetPopulation value = [[MIN_RECOLONIZING_SIZE]]
]
'''
#include "/scripting/species/common/advanced_focus.macros"
#include "/scripting/species/common/focus.macros"
#include "/scripting/species/common/general.macros"