Skip to content

Commit 9b306b3

Browse files
committed
PLI - investment je buttons for corruption
1 parent 848641e commit 9b306b3

29 files changed

+530
-99
lines changed

Populist Legal Innovation/common/journal_entries/MoG_PLI_investment_je.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@
66
weight = 9000
77
is_shown_when_inactive = { NOT = { is_country_type = decentralized } }
88
possible = { is_revolutionary = no }
9+
10+
scripted_button = mog_pli_fight_corruption_button
11+
scripted_button = mog_pli_curry_favour_button
912

1013
scripted_progress_bar = mog_pli_investment_tracking_bar
1114
scripted_progress_bar = mog_pli_corruption_tracking_bar

Populist Legal Innovation/common/script_values/MoG_PLI_bar_drift_values.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,7 @@ mog_pli_corruption_tracking_bar_weekly_drift = {
124124
add = var:mog_pli_corruption_current_value
125125
divide = 100
126126
}
127+
format = DECIMAL_SCRIPT_VALUE_FORMAT_INVERT
127128
}
128129

129130
mog_pli_innovation_tracking_bar_weekly_drift = {

Populist Legal Innovation/common/script_values/MoG_PLI_investment_values.txt

Lines changed: 63 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -56,27 +56,31 @@ mog_pli_investment_increment = {
5656
multiply = investment
5757
}
5858
desc = PLI_POLICE_INSTITUTION # Max = 0.5
59+
format = PLI_2DECIMAL_SCRIPT_VALUE_FORMAT
5960
}
6061
add = {
6162
owner.institution:institution_schools ?= {
6263
add = 0.04
6364
multiply = investment
6465
}
6566
desc = PLI_SCHOOL_INSTITUTION # Max = 0.2
67+
format = PLI_2DECIMAL_SCRIPT_VALUE_FORMAT
6668
}
6769
add = {
6870
owner.institution:institution_health_system ?= {
6971
add = 0.04
7072
multiply = investment
7173
}
7274
desc = PLI_HEALTH_INSTITUTION # Max = 0.2
75+
format = PLI_2DECIMAL_SCRIPT_VALUE_FORMAT
7376
}
7477
add = {
7578
owner.institution:institution_social_security ?= {
7679
add = 0.1
7780
multiply = investment
7881
}
7982
desc = PLI_SOCSEC_INSTITUTION # Max = 0.5
83+
format = PLI_2DECIMAL_SCRIPT_VALUE_FORMAT
8084
}
8185
# Decelerators
8286
add = { # New Investment has higher overheads
@@ -85,13 +89,15 @@ mog_pli_investment_increment = {
8589
multiply = investment
8690
}
8791
desc = PLI_OHS_INSTITUTION # Max = -0.5
92+
format = PLI_2DECIMAL_SCRIPT_VALUE_FORMAT
8893
}
8994
add = { # New Investment has either sovereign risk or more noise to filter
9095
owner.institution:institution_home_affairs ?= {
9196
add = -0.04
9297
multiply = investment
9398
}
9499
desc = PLI_HAFFAIRS_INSTITUTION # Max = -0.2
100+
format = PLI_2DECIMAL_SCRIPT_VALUE_FORMAT
95101
}
96102
min = 0.1
97103
}
@@ -433,35 +439,69 @@ mog_pli_corruption_target_loc_value = {
433439

434440
mog_pli_corruption_increment = {
435441
value = 0
436-
# Accelerators/Decelerators
437-
add = {
438-
owner.institution:institution_police ?= {
439-
add = 0.01
440-
multiply = investment
442+
if = {
443+
limit = { mog_pli_corruption_target > var:mog_pli_corruption_current_value } # Target below current state.
444+
add = {
445+
add = 0.275
446+
multiply = {
447+
add = var:mog_pli_corruption_current_value
448+
divide = mog_pli_corruption_target
449+
}
450+
desc = PLI_BASE_CORRUPTION
451+
format = PLI_3DECIMAL_SCRIPT_VALUE_INVERT_FORMAT
441452
}
442-
desc = PLI_POLICE_INSTITUTION # Max = 0.05
443453
}
444454
add = {
445-
owner.institution:institution_schools ?= {
446-
add = 0.01
447-
multiply = investment
455+
# Accelerators/Decelerators
456+
add = {
457+
owner.institution:institution_police ?= {
458+
add = 0.01
459+
multiply = investment
460+
}
461+
if = {
462+
limit = { mog_pli_corruption_target > var:mog_pli_corruption_current_value }
463+
multiply = -1 # Slow the rise instead of speeding the decline.
464+
}
465+
desc = PLI_POLICE_INSTITUTION # Max = 0.05
466+
format = PLI_3DECIMAL_SCRIPT_VALUE_INVERT_FORMAT
448467
}
449-
desc = PLI_SCHOOL_INSTITUTION # Max = 0.05
450-
}
451-
add = {
452-
owner.institution:institution_workplace_safety ?= {
453-
add = 0.01
454-
multiply = investment
468+
add = {
469+
owner.institution:institution_schools ?= {
470+
add = 0.01
471+
multiply = investment
472+
}
473+
if = {
474+
limit = { mog_pli_corruption_target > var:mog_pli_corruption_current_value }
475+
multiply = -1 # Slow the rise instead of speeding the decline.
476+
}
477+
desc = PLI_SCHOOL_INSTITUTION # Max = 0.05
478+
format = PLI_3DECIMAL_SCRIPT_VALUE_INVERT_FORMAT
455479
}
456-
desc = PLI_OHS_INSTITUTION # Max = 0.05
457-
}
458-
add = { # Depends on the nature of the institution
459-
owner.institution:institution_home_affairs ?= {
460-
add = owner.mog_pli_cor_internal_security
461-
divide = 400 # 10 becomes 0.025
462-
multiply = investment
480+
add = {
481+
owner.institution:institution_workplace_safety ?= {
482+
add = 0.01
483+
multiply = investment
484+
}
485+
if = {
486+
limit = { mog_pli_corruption_target > var:mog_pli_corruption_current_value }
487+
multiply = -1 # Slow the rise instead of speeding the decline.
488+
}
489+
desc = PLI_OHS_INSTITUTION # Max = 0.05
490+
format = PLI_3DECIMAL_SCRIPT_VALUE_INVERT_FORMAT
491+
}
492+
add = { # Depends on the nature of the institution
493+
owner.institution:institution_home_affairs ?= {
494+
add = owner.mog_pli_cor_internal_security
495+
divide = 400 # 10 becomes 0.025
496+
multiply = investment
497+
}
498+
if = {
499+
limit = { mog_pli_corruption_target > var:mog_pli_corruption_current_value }
500+
multiply = -1 # Slow the rise instead of speeding the decline.
501+
}
502+
desc = PLI_HAFFAIRS_INSTITUTION # Max = 0.125
503+
format = PLI_3DECIMAL_SCRIPT_VALUE_INVERT_FORMAT
463504
}
464-
desc = PLI_HAFFAIRS_INSTITUTION # Max = 0.125
465505
}
466506
}
467507

Populist Legal Innovation/common/script_values/MoG_PLI_temp_math_values.txt

Lines changed: 70 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
## Calculation values used exclusively in maths for effect setting.
22

3+
####################
4+
#### INVESTMENT ####
5+
####################
36
# Investment je modifier multipliers
47
mog_pli_dummy_contribution_multiplier = {
58
value = {
@@ -171,40 +174,42 @@ je_mog_pli_reaction_multiplier = { # Value of 1 will result in 100%
171174
}
172175
}
173176

174-
# Innovation je modifier multipliers
175-
mog_pli_innovation_multiplier = {
176-
value = {
177-
add = { # We need to multiply by inverse of the investment % from the JE.
178-
add = 100 # innovation_current_value is actually the limiting proportion
179-
subtract = var:mog_pli_innovation_current_value # 100-current gets the proportion for the negative penalty
180-
divide = 100 # Convert to %
181-
}
177+
# Investment je button vals
178+
mog_pli_fought_corruption_val = {
179+
add = root.var:mog_pli_corruption_current_value
180+
add = {
181+
value = root.var:mog_pli_corruption_current_value
182+
divide = 80 # Divide by 80, not 100, so that mid-range corruption doesn't feel so bad to fight
183+
multiply = -20 # Remove up to 20 corruption scaled based on current corruption
182184
}
185+
min = 0
183186
}
184187

185-
mog_pli_proliferation_multiplier = {
186-
value = {
187-
add = { # This one does not need inverting.
188-
add = var:mog_pli_proliferation_current_value # gets the proliferation value for the bonus
189-
divide = 100 # Convert to %
190-
}
188+
mog_pli_fought_corruption_tt_val = { # Mimic the calc above
189+
add = {
190+
value = var:mog_pli_corruption_current_value
191+
divide = 80
192+
multiply = -20
191193
}
192194
}
193195

194-
mog_pli_proliferation_multiplier_loc = {
195-
value = {
196-
add = mog_pli_proliferation_multiplier
197-
multiply = 4 # From the default value for je_mog_pli_proliferation_modifier
196+
mog_pli_curried_favour_val = {
197+
add = root.var:mog_pli_corruption_current_value
198+
add = {
199+
value = 100
200+
subtract = root.var:mog_pli_corruption_current_value
201+
divide = 80 # Divide by 80, not 100, so there are diminishing impacts at the top end
202+
multiply = 20 # Add up to 20 corruption inversely scaled based on current corruption
198203
}
204+
max = 100
199205
}
200206

201-
mog_pli_max_innovation_base_sv = {
202-
value = { # Calculate what the default modifier value would be right now -
203-
add = { # - i.e. the total unadjusted modifier based on previous month:
204-
add = var:mog_pli_max_innovation_adjustment # Cross multiply [ investment_current_prev/100 = adjustment/total ]
205-
multiply = 100 # Solve for total -> [ = (adjustment*100)/investment_current_prev ]
206-
divide = var:mog_pli_innovation_current_prev
207-
}
207+
mog_pli_curried_favour_tt_val = { # Mimic the calc above
208+
add = {
209+
value = 100
210+
subtract = var:mog_pli_corruption_current_value
211+
divide = 80
212+
multiply = 20
208213
}
209214
}
210215

@@ -241,3 +246,43 @@ mog_pli_war_confidence_target_hit_val = {
241246
}
242247
}
243248
}
249+
250+
####################
251+
#### INNOVATION ####
252+
####################
253+
# Innovation je modifier multipliers
254+
mog_pli_innovation_multiplier = {
255+
value = {
256+
add = { # We need to multiply by inverse of the investment % from the JE.
257+
add = 100 # innovation_current_value is actually the limiting proportion
258+
subtract = var:mog_pli_innovation_current_value # 100-current gets the proportion for the negative penalty
259+
divide = 100 # Convert to %
260+
}
261+
}
262+
}
263+
264+
mog_pli_proliferation_multiplier = {
265+
value = {
266+
add = { # This one does not need inverting.
267+
add = var:mog_pli_proliferation_current_value # gets the proliferation value for the bonus
268+
divide = 100 # Convert to %
269+
}
270+
}
271+
}
272+
273+
mog_pli_proliferation_multiplier_loc = {
274+
value = {
275+
add = mog_pli_proliferation_multiplier
276+
multiply = 4 # From the default value for je_mog_pli_proliferation_modifier
277+
}
278+
}
279+
280+
mog_pli_max_innovation_base_sv = {
281+
value = { # Calculate what the default modifier value would be right now -
282+
add = { # - i.e. the total unadjusted modifier based on previous month:
283+
add = var:mog_pli_max_innovation_adjustment # Cross multiply [ investment_current_prev/100 = adjustment/total ]
284+
multiply = 100 # Solve for total -> [ = (adjustment*100)/investment_current_prev ]
285+
divide = var:mog_pli_innovation_current_prev
286+
}
287+
}
288+
}

0 commit comments

Comments
 (0)