Skip to content

Commit

Permalink
Merge pull request #224 from Cold-War-Project/pollution-mechanic-over…
Browse files Browse the repository at this point in the history
…haul

feat: pollution mechanic overhaul
  • Loading branch information
Arcadyi authored Apr 20, 2023
2 parents 48829a8 + 53d540e commit 9488ec9
Show file tree
Hide file tree
Showing 33 changed files with 514 additions and 318 deletions.
4 changes: 2 additions & 2 deletions common/defines/cwp_defines.txt
Original file line number Diff line number Diff line change
Expand Up @@ -102,12 +102,12 @@ NCharacters = {
}

NEconomy = {
POLLUTION_TARGET_DIVISOR_BASE = 1 # Base value to divide total pollution generation by for calculating state region pollution target level
POLLUTION_TARGET_DIVISOR_BASE = 1 # Base value to divide total pollution generation by for calculating state region pollution target level
POLLUTION_TARGET_DIVISOR_ARABLE_LAND_MULT = 1 # Amount per arable land to add to pollution divisor
POLLUTION_CHANGE_SPEED = 0.5 # Each day, pollution in state region changes by this amount towards target
POLLUTION_MAX = 255
POLLUTION_SPREAD_TO_NEIGHBOR = 0.25 # Adjacent state regions always have at least this much of their neighbor's pollution level

EMPLOYMENT_RESOURCE_DEPLETE_CHANCE = 0.0001 # Multiplied by number of fully employed levels of the building
BASE_RESOURCE_DISCOVER_CHANCE = 0.00001 # Per day (1.0 = 1%)
RESOURCE_DISCOVER_MIN_FRACTION = 0.01 # Min fraction of resources that will be discovered for each successful roll
Expand Down
34 changes: 25 additions & 9 deletions common/history/global/00_global.txt
Original file line number Diff line number Diff line change
Expand Up @@ -129,15 +129,31 @@ GLOBAL = {
}
set_variable = fighting_for_china
}
## Pollution Variables
set_global_variable = {
name = global_var_pollution
value = global_pollution_value
}
set_global_variable = {
name = global_var_temperature_celsius
value = global_temperature_value_celsius
}
## Habitability Setup
# Range (%):
# -1 < 0 < 1
every_country = {
every_scope_state = {
calc_starting_habitability = yes
set_habitability_effects = yes
}
}
#debug
# s:STATE_NEW_YORK = {
# set_variable = {
# name = habitability
# value = 1
# }
# habitability_effects = yes
# }
# s:STATE_KEYSTONE = {
# set_variable = {
# name = habitability
# value = -1
# }
# habitability_effects = yes
# }
#debug end
## Dynamic Peace deal State Setup
effect_china_states_scopes_setup = yes
## Bloc Setup
Expand Down
102 changes: 50 additions & 52 deletions common/history/states/00_states.txt
Original file line number Diff line number Diff line change
Expand Up @@ -671,13 +671,13 @@
x8001A0
x86E6F2
x89A2A9
"x8C6982"
"x8D1E12"
"xA0C020"
"xA9BD82"
"xCDEAE4"
"xD4C37D"
"xEF5730"
x8C6982
x8D1E12
xA0C020
xA9BD82
xCDEAE4
xD4C37D
xEF5730
}
}
add_homeland = north_german
Expand Down Expand Up @@ -1923,7 +1923,6 @@
add_homeland = salish
add_homeland = nez_perce
}

s:STATE_CANYON_STATES = {
create_state = {
country = c:USA
Expand Down Expand Up @@ -28586,11 +28585,11 @@
xE0D060
x136A0C
x0EC997
x605060 #West Bank
x605060 #West Bank
x365E8F
x60D060 #Gaza
x60D060 #Gaza
xE05060
xC9CBC0 #West Bank
xC9CBC0 #West Bank
}
}
add_homeland = mashriqi
Expand Down Expand Up @@ -28628,7 +28627,7 @@
x7A1679
x0F0BCB
xE09060
xE011E0 #Golan
xE011E0 #Golan
x3E0347
}
}
Expand Down Expand Up @@ -45501,11 +45500,11 @@
x999CEE
xB90BFF
xC02121
"xC32D8B"
"xE513C0"
"xF77289"
"xF962B2"
"xFCC7B7"
xC32D8B
xE513C0
xF77289
xF962B2
xFCC7B7
}
}
add_homeland = polish
Expand Down Expand Up @@ -45538,7 +45537,6 @@
create_state = {
country = c:DDR
owned_provinces = {

xA080E0
x12694A
x618061
Expand Down Expand Up @@ -45582,16 +45580,16 @@
x6E8875
x7A6061
x7CB839
"x7D6DC3"
"x80A0A0"
"x945000"
"x9FD037"
"xABC4AE"
"xAEA6D6"
"xBAF66D"
"xBF9F20"
"xC04521"
"xEEF586"
x7D6DC3
x80A0A0
x945000
x9FD037
xABC4AE
xAEA6D6
xBAF66D
xBF9F20
xC04521
xEEF586
}
}
add_homeland = polish
Expand Down Expand Up @@ -45645,7 +45643,7 @@
x732DC0
x7B2F62
x821F52
x88194B
x88194B
x90B12B
x94D624
xAF9F20
Expand Down Expand Up @@ -46004,14 +46002,14 @@
xA03316
x6000DF
x955F09
"xA7B86B"
"xAB3C62"
"xC02B8C"
"xC061A0"
"xC0E0A0"
"xD0A0E0"
"xDE06BA"
"xE165F5"
xA7B86B
xAB3C62
xC02B8C
xC061A0
xC0E0A0
xD0A0E0
xDE06BA
xE165F5
}
}
add_homeland = polish
Expand All @@ -46034,9 +46032,9 @@
xC7B7B8
xC8690C
xE0BB00
"xEB0783"
"xF73169"
"xFCC35F"
xEB0783
xF73169
xFCC35F
}
}
add_homeland = polish
Expand All @@ -46056,12 +46054,12 @@
x809F60
x9444C9
xA3A3A9
"xB491B1"
"xC06121"
"xC17590"
"xDC58D0"
"xDE551D"
"xF8C8F6"
xB491B1
xC06121
xC17590
xDC58D0
xDE551D
xF8C8F6
}
}
add_homeland = polish
Expand Down Expand Up @@ -46585,12 +46583,12 @@
x24CA48
x4545BE
x567452
"xA04121"
"xD8F441"
"xD9A469"
"xE041A0"
"xE080A0"
"xE1A03A"
xA04121
xD8F441
xD9A469
xE041A0
xE080A0
xE1A03A
}
}
##effect_high_devastation = yes
Expand Down
5 changes: 1 addition & 4 deletions common/journal_entries/CWP_the_fourth_republic.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,6 @@
this = c:SNG
}
immediate = {
set_variable = {
name = var_je_the_fourth_republic
value = yes
}
set_variable = var_je_the_fourth_republic
}
}
6 changes: 1 addition & 5 deletions common/modifiers/00_static_modifiers.txt
Original file line number Diff line number Diff line change
Expand Up @@ -430,10 +430,6 @@ infamy_pariah = {
# Scales with devastation level
state_region_devastation = {
icon = gfx/interface/icons/timed_modifier_icons/modifier_gear_negative.dds
state_infrastructure_mult = -1
state_mortality_mult = 2.0
state_migration_pull_mult = -2
state_construction_mult = -1
}

# Scales with deficiency in tax capacity
Expand Down Expand Up @@ -483,7 +479,7 @@ country_literacy_rate = {
# Scales with number of excess innovation points
excess_innovation = {
icon = gfx/interface/icons/timed_modifier_icons/modifier_lightbulb_positive.dds
country_tech_spread_add = 0.30
country_tech_spread_add = 0.3
}

# Scales with admiral convoy raiding strength
Expand Down
13 changes: 13 additions & 0 deletions common/modifiers/cwp_pollution_modifiers.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Other modifiers for states and their inhabitants created by habitability_effects in cwp_pollution_effects.txt
# While the modifier is initialized with baseline positive values, it can be set to negative values based on the sign of the multiplier in habitability_effects
# Baseline is at habitability of 0.01 or 1%
# scope: state
state_habitability_effect = {
icon = gfx/interface/icons/timed_modifier_icons/modifier_gear_negative.dds
state_mortality_mult = -0.01
state_expected_sol_mult = 0.01
state_standard_of_living_add = 0.01
state_migration_pull_mult = 0.01
state_infrastructure_mult = 0.01
state_construction_mult = 0.01
}
Binary file removed common/on_actions/.vs/slnx.sqlite
Binary file not shown.
Loading

0 comments on commit 9488ec9

Please sign in to comment.