Skip to content

Commit

Permalink
Added population growth boosting policy.
Browse files Browse the repository at this point in the history
  • Loading branch information
geoffthemedio committed Jun 5, 2020
1 parent 1faeb26 commit 5c9b502
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 1 deletion.
9 changes: 9 additions & 0 deletions default/scripting/policies/POPULATION.focs.txt
@@ -0,0 +1,9 @@
Policy
name = "PLC_POPULATION"
description = "PLC_POPULATION_DESC"
short_description = "PLC_POPULATION_SHORT_DESC"
category = "SOCIAL_CATEGORY"
adoptioncost = 10
graphic = "icons/focus/growth.png"

#include "/scripting/common/priorities.macros"
11 changes: 10 additions & 1 deletion default/scripting/species/common/population.macros
@@ -1,3 +1,11 @@

GROWTH_RATE_FACTOR
'''
0.005 *
(1 - (Statistic If condition = EmpireHasAdoptedPolicy name = "PLC_NO_GROWTH")) * // no growth with no-growth policy
(1 + 0.5*(Statistic If condition = EmpireHasAdoptedPolicy name = "PLC_POPULATION")) // +50% growth with population policy
'''

BASIC_POPULATION
'''
[[HOMEWORLD_BONUS_POPULATION]]
Expand All @@ -18,7 +26,8 @@ BASIC_POPULATION
priority = [[EARLY_FIRST_NATURAL_POPULATION_PRIORITY]]
effects = SetPopulation value =
(Statistic If condition = (Value < Target.TargetPopulation) *
min(Target.TargetPopulation, Value + Value*0.01*(Target.TargetPopulation + 1 - Value)))
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)))

Expand Down
1 change: 1 addition & 0 deletions default/scripting/techs/growth/NANOTECH_MED.focs.txt
Expand Up @@ -10,6 +10,7 @@ Tech
"GRO_GENETIC_MED"
"PRO_NANOTECH_PROD"
]
unlock = Item type = Policy name = "PLC_POPULATION"
graphic = "icons/tech/nanotech_medicine.png"

#include "/scripting/common/base_prod.macros"
9 changes: 9 additions & 0 deletions default/stringtables/en.txt
Expand Up @@ -10891,6 +10891,15 @@ Prevents planets from increasing population from turn to turn.
PLC_NO_GROWTH_SHORT_DESC
Stops planet growth

PLC_POPULATION
Population

PLC_POPULATION_DESC
Increases Growth Rate

PLC_POPULATION_SHORT_DESC
Increases natural population growth rate by 50%.

PLC_NO_SUPPLY
No Supply

Expand Down

0 comments on commit 5c9b502

Please sign in to comment.