From 65b7c0947e4fbd4b55b50f3e6b49e0b73aba8342 Mon Sep 17 00:00:00 2001 From: DZappala Date: Sun, 13 Aug 2023 13:41:29 -0400 Subject: [PATCH 1/2] chore: update runtime logic for dyn igs --- common/on_actions/00_code_on_actions.txt | 408 +++++++++++------- .../scripted_effects/cwp_political_setup.txt | 42 +- .../dynamic_ideology_events.txt | 27 ++ 3 files changed, 295 insertions(+), 182 deletions(-) diff --git a/common/on_actions/00_code_on_actions.txt b/common/on_actions/00_code_on_actions.txt index 8800e9bdc..d97d78d70 100644 --- a/common/on_actions/00_code_on_actions.txt +++ b/common/on_actions/00_code_on_actions.txt @@ -1277,26 +1277,18 @@ on_law_enactment_pass = { if = { limit = { root = { - or = { - and = { + and = { + # if the nation is currently enacting a prereq for the social ideology, and the laborists don't already have the social ideology, and the laborists aren't a part of an active political movement, then trigger the event to enable the social ideology + or = { currently_enacting_law.type = law_type:law_free_market - nor = { - has_law = law_type:law_interventionism - has_law = law_type:law_decentralization - } - } - and = { currently_enacting_law.type = law_type:law_interventionism - nor= { - has_law = law_type:law_free_market - has_law = law_type:law_decentralization - } - } - and = { currently_enacting_law.type = law_type:law_decentralization + currently_enacting_law.type = law_type:law_anti_industrialization + } + ig:ig_laborists = { nor = { - has_law = law_type:law_free_market - has_law = law_type:law_interventionism + has_ideology = ideology:ideology_social + interest_group_supports_political_movement = yes } } } @@ -1310,22 +1302,46 @@ on_law_enactment_pass = { if = { limit = { root = { - or = { + and = { and = { - currently_enacting_law.type = law_type:law_anocracy - not = { - has_law = law_type:law_oligarchy + # if the nation is enacting one of the following + or = { + currently_enacting_law.type = law_type:law_anocracy + currently_enacting_law.type = law_type:law_oligarchy + currently_enacting_law.type = law_type:law_autocracy + } + # and they already have one of the following + or = { + has_law = law_type:law_socialization + has_law = law_type:law_total_nationalization + has_law = law_type:law_heavy_industry_nationalization } } and = { - currently_enacting_law.type = law_type:law_oligarchy - not = { + # or if they are enacting one of the following + or = { + currently_enacting_law.type = law_type:law_socialization + currently_enacting_law.type = law_type:law_total_nationalization + currently_enacting_law.type = law_type:law_heavy_industry_nationalization + } + # and they already have one of the following + or = { has_law = law_type:law_anocracy + has_law = law_type:law_oligarchy + has_law = law_type:law_autocracy + } + } + # and the laborists don't have the vanguardist ideolgy, or ar in a political movement + ig:ig_laborists = { + nor = { + has_ideology = ideology:ideology_vanguardist + interest_group_supports_political_movement = yes } } } } } + # then trigger the event to enable the vanguardist ideology trigger_event = { id = dynamic_ideologies.3 } @@ -1334,82 +1350,68 @@ on_law_enactment_pass = { if = { limit = { root = { - or = { - and = { + and = { + # if we already have the socializationlaw + has_law = law_type:law_socialization + # and we're passing one of the following + or = { + currently_enacting_law.type = law_type:law_public_utility_companies currently_enacting_law.type = law_type:law_no_nationalization - not = { - has_law = law_type:law_public_utility_companies - } + currently_enacting_law.type = law_type:law_resource_extraction_nationalization + currently_enacting_law.type = law_type:law_military_industry_nationalization } - and = { - currently_enacting_law.type = law_type:law_public_utility_companies - not = { - has_law = law_type:law_no_nationalization + # and the laborists aren't already vanguardist or in a political movement + ig:ig_laborists = { + nor = { + has_ideology = ideology:ideology_vanguardist + interest_group_supports_political_movement = yes } } } } } + # trigger the event to enable vanguardist trigger_event = { id = dynamic_ideologies.4 } } ### Urbanists ### - #enable social + #enable socialist if = { limit = { root = { - or = { - and = { - currently_enacting_law.type = law_type:law_free_market - nor = { - has_law = law_type:law_interventionism - has_law = law_type:law_decentralization - } - } - and = { - currently_enacting_law.type = law_type:law_interventionism - nor = { - has_law = law_type:law_free_market - has_law = law_type:law_decentralization - } + and = { + or = { + currently_enacting_law.type = law_type:law_socialization + currently_enacting_law.type = law_type:law_total_nationalization } - and = { - currently_enacting_law.type = law_type:law_decentralization + ig:ig_urbanists = { nor = { - has_law = law_type:law_free_market - has_law = law_type:law_interventionism + has_ideology = ideology:ideology_socialist + interest_group_supports_political_movement = yes } } } } } trigger_event = { - id = dynamic_ideologies.5 + id = dynamic_ideologies.7 } } - #enable socialist - if = { + #enable social + else_if = { limit = { root = { - or = { - and = { - currently_enacting_law.type = law_type:law_no_nationalization - not = { - has_law = law_type:law_public_utility_companies - } - } - and = { - currently_enacting_law.type = law_type:law_public_utility_companies - not = { - has_law = law_type:law_no_nationalization - } + ig:ig_urbanists = { + nor = { + has_ideology = ideology:ideology_social + interest_group_supports_political_movement = yes } } } } trigger_event = { - id = dynamic_ideologies.7 + id = dynamic_ideologies.5 } } ### Moralists ### @@ -1417,7 +1419,13 @@ on_law_enactment_pass = { if = { limit = { root = { - currently_enacting_law.type = law_type:law_state_atheism + and = { + currently_enacting_law.type = law_type:law_state_atheism + nor = { + has_ideology = ideology:ideology_secular + interest_group_supports_political_movement = yes + } + } } } trigger_event = { @@ -1429,13 +1437,24 @@ on_law_enactment_pass = { limit = { root = { and = { + # if they have the state atheism law has_law = law_type:law_state_atheism + # if they are enacting one of the following or = { currently_enacting_law.type = law_type:law_church_disestablishment currently_enacting_law.type = law_type:law_religious_policies currently_enacting_law.type = law_type:law_religious_institutions currently_enacting_law.type = law_type:law_religious_nationalism } + ig:ig_moralists = { + # if they don't have an ideology other than secular or are in a political movement + nor = { + not = { + has_ideology = ideology:ideology_secular + } + interest_group_supports_political_movement = yes + } + } } } } @@ -1448,9 +1467,14 @@ on_law_enactment_pass = { if = { limit = { root = { - or = { + and = { currently_enacting_law.type = law_type:law_socialization - currently_enacting_law.type = law_type:law_total_nationalization + ig:ig_bureaucrats = { + nor = { + has_ideology = ideology:ideology_apparatus + interest_group_supports_political_movement = yes + } + } } } } @@ -1458,11 +1482,37 @@ on_law_enactment_pass = { id = dynamic_ideologies.10 } } + else_if = { + limit = { + root = { + ig:ig_bureaucrats = { + nor = { + not = { + has_ideology = ideology:ideology_apparatus + } + interest_group_supports_political_movement = yes + } + } + } + } + #remove apparatus + trigger_event = { + id = dynamic_ideologies.99 + } + } #enable politicized if = { limit = { root = { - currently_enacting_law.type = law_type:law_politicized_bureaucrats + and = { + currently_enacting_law.type = law_type:law_politicized_bureaucrats + ig:ig_bureaucrats = { + nor = { + has_ideology = ideology:ideology_politicized + interest_group_supports_political_movement = yes + } + } + } } } trigger_event = { @@ -1473,7 +1523,15 @@ on_law_enactment_pass = { if = { limit = { root = { - currently_enacting_law.type = law_type:law_appointed_bureaucrats + and = { + currently_enacting_law.type = law_type:law_appointed_bureaucrats + ig:ig_bureaucrats = { + nor = { + has_ideology = ideology:ideology_appointed + interest_group_supports_political_movement = yes + } + } + } } } trigger_event = { @@ -1484,7 +1542,15 @@ on_law_enactment_pass = { if = { limit = { root = { - currently_enacting_law.type = law_type:law_independent_bureaucrats + and = { + currently_enacting_law.type = law_type:law_independent_bureaucrats + ig:ig_bureaucrats = { + nor = { + has_ideology = ideology:ideology_independent + interest_group_supports_political_movement = yes + } + } + } } } trigger_event = { @@ -1495,7 +1561,15 @@ on_law_enactment_pass = { if = { limit = { root = { - currently_enacting_law.type = law_type:law_elected_bureaucrats + and = { + currently_enacting_law.type = law_type:law_elected_bureaucrats + ig:ig_bureaucrats = { + nor = { + has_ideology = ideology:ideology_elected + interest_group_supports_political_movement = yes + } + } + } } } trigger_event = { @@ -1506,7 +1580,15 @@ on_law_enactment_pass = { if = { limit = { root = { - currently_enacting_law.type = law_type:law_technocrats + and = { + currently_enacting_law.type = law_type:law_technocrats + ig:ig_bureaucrats = { + nor = { + has_ideology = ideology:ideology_technocratic + interest_group_supports_political_movement = yes + } + } + } } } trigger_event = { @@ -1518,7 +1600,19 @@ on_law_enactment_pass = { if = { limit = { root = { - currently_enacting_law.type = law_type:law_hereditary + and = { + or = { + currently_enacting_law.type = law_type:law_hereditary + currently_enacting_law.type = law_type:law_theocratic + currently_enacting_law.type = law_type:law_administrative + } + ig:ig_elites = { + nor = { + has_ideology = ideology:ideology_royalist + interest_group_supports_political_movement = yes + } + } + } } } trigger_event = { @@ -1529,7 +1623,19 @@ on_law_enactment_pass = { if = { limit = { root = { - currently_enacting_law.type = law_type:law_executive + and = { + or = { + currently_enacting_law.type = law_type:law_executive + currently_enacting_law.type = law_type:law_parliamentary + currently_enacting_law.type = law_type:law_council_elective + } + ig:ig_elites = { + nor = { + has_ideology = ideology:ideology_republican + interest_group_supports_political_movement = yes + } + } + } } } trigger_event = { @@ -1540,14 +1646,16 @@ on_law_enactment_pass = { if = { limit = { root = { - or = { - and = { + and = { + or = { currently_enacting_law.type = law_type:law_decentralization - has_law = law_type:law_informal_schooling + currently_enacting_law.type = law_type:law_anti_industrialization } - and = { - currently_enacting_law.type = law_type:law_informal_schooling - has_law = law_type:law_decentralization + ig:ig_elites = { + nor = { + has_ideology = ideology:ideology_traditionalist + interest_group_supports_political_movement = yes + } } } } @@ -1560,14 +1668,17 @@ on_law_enactment_pass = { if = { limit = { root = { - or = { - and = { + and = { + or = { currently_enacting_law.type = law_type:law_free_market - has_law = law_type:law_private_schools + currently_enacting_law.type = law_type:law_interventionism + currently_enacting_law.type = law_type:law_socialization } - and = { - currently_enacting_law.type = law_type:law_private_schools - has_law = law_type:law_free_market + ig:ig_elites = { + nor = { + has_ideology = ideology:ideology_materialistic + interest_group_supports_political_movement = yes + } } } } @@ -1577,40 +1688,20 @@ on_law_enactment_pass = { } } ### ENTREPRENEURS ### + #enable bigoted if = { limit = { root = { - or = { - and = { - currently_enacting_law.type = law_type:law_ethnonationalist - nor = { - has_law = law_type:law_supremacist - has_law = law_type:law_segregationist - has_law = law_type:law_integrationist - } - } - and = { - currently_enacting_law.type = law_type:law_supremacist - nor = { - has_law = law_type:law_ethnonationalist - has_law = law_type:law_segregationist - has_law = law_type:law_integrationist - } - } - and = { + and = { + or = { currently_enacting_law.type = law_type:law_segregationist - nor = { - has_law = law_type:law_ethnonationalist - has_law = law_type:law_supremacist - has_law = law_type:law_integrationist - } + currently_enacting_law.type = law_type:law_supremacist + currently_enacting_law.type = law_type:law_ethonationalist } - and = { - currently_enacting_law.type = law_type:law_integrationist + ig:ig_entrepreneurs = { nor = { - has_law = law_type:law_ethnonationalist - has_law = law_type:law_supremacist - has_law = law_type:law_segregationist + has_ideology = ideology:ideology_bigoted + interest_group_supports_political_movement = yes } } } @@ -1620,20 +1711,20 @@ on_law_enactment_pass = { id = dynamic_ideologies.20 } } + #enable assimilative if = { limit = { root = { - or = { - and = { + and = { + or = { + currently_enacting_law.type = law_type:law_syncretist currently_enacting_law.type = law_type:law_multiculturalist - not = { - has_law = law_type:law_syncretist - } + currently_enacting_law.type = law_type:law_integrationist } - and = { - currently_enacting_law.type = law_type:law_syncretist - not = { - has_law = law_type:law_multiculturalist + ig:ig_entrepreneurs = { + nor = { + has_ideology = ideology:ideology_assimilative + interest_group_supports_political_movement = yes } } } @@ -1644,20 +1735,21 @@ on_law_enactment_pass = { } } ### PATRIOTS ### + # enable chauvinistic if = { limit = { root = { - or = { - and = { + and = { + or = { currently_enacting_law.type = law_type:law_military_industry_nationalization - not = { - has_law = law_type:law_resource_extraction_nationalization - } - } - and = { currently_enacting_law.type = law_type:law_resource_extraction_nationalization - not = { - has_law = law_type:law_military_industry_nationalization + currently_enacting_law.type = law_type:law_public_utility_companies + currently_enacting_law.type = law_type:law_no_nationalization + } + ig:ig_patriots = { + nor = { + has_ideology = ideology:ideology_chauvinistic + interest_group_supports_political_movement = yes } } } @@ -1667,20 +1759,16 @@ on_law_enactment_pass = { id = dynamic_ideologies.22 } } + # enable corporatist if = { limit = { root = { - or = { - and = { - currently_enacting_law.type = law_type:law_total_nationalization - not = { - has_law = law_type:law_heavy_industry_nationalization - } - } - and = { - currently_enacting_law.type = law_type:law_heavy_industry_nationalization - not = { - has_law = law_type:law_total_nationalization + and = { + currently_enacting_law.type = law_type:law_total_nationalization + ig:ig_patriots = { + nor = { + has_ideology = ideology:ideology_corporatist + interest_group_supports_political_movement = yes } } } @@ -1694,17 +1782,15 @@ on_law_enactment_pass = { if = { limit = { root = { - or = { - and = { - currently_enacting_law.type = law_type:law_council_elective - not = { - has_law = law_type:law_executive - } + and = { + or = { + currently_enacting_law.type = law_type:law_socialization + currently_enacting_law.type = law_type:law_total_nationaliation } - and = { - currently_enacting_law.type = law_type:law_executive - not = { - has_law = law_type:law_council_elective + ig:ig_securocrats = { + nor = { + has_ideology = ideology:ideology_vanguardist + interest_group_supports_political_movement = yes } } } @@ -1717,11 +1803,13 @@ on_law_enactment_pass = { if = { limit = { root = { - or = { - currently_enacting_law.type = law_type:law_parliamentary - currently_enacting_law.type = law_type:law_theocratic - currently_enacting_law.type = law_type:law_hereditary - currently_enacting_law.type = law_type:law_administrative + ig:ig_securocrats = { + nor = { + not = { + has_ideology = ideology:ideology_vanguardist + } + interest_group_supports_political_movement = yes + } } } } diff --git a/common/scripted_effects/cwp_political_setup.txt b/common/scripted_effects/cwp_political_setup.txt index 713ae1d3a..0537d2770 100755 --- a/common/scripted_effects/cwp_political_setup.txt +++ b/common/scripted_effects/cwp_political_setup.txt @@ -50,19 +50,19 @@ setup_starting_ideologies = { if = { limit = { owner = { - and ={ - or = { - has_law = law_type:law_anocracy - has_law = law_type:law_oligarchy - has_law = law_type:law_autocracy - } - or = { - has_law = law_type:law_socialization - has_law = law_type:law_total_nationalization - has_law = law_type:law_heavy_industry_nationalization + and = { + or = { + has_law = law_type:law_anocracy + has_law = law_type:law_oligarchy + has_law = law_type:law_autocracy + } + or = { + has_law = law_type:law_socialization + has_law = law_type:law_total_nationalization + has_law = law_type:law_heavy_industry_nationalization + } } } - } } remove_ideology = ideology_social remove_ideology = ideology_socialist @@ -73,15 +73,15 @@ setup_starting_ideologies = { owner = { and = { has_law = law_type:law_socialization - or = { - has_law = law_type:law_public_utility_companies - has_law = law_type:law_no_nationalization - has_law = law_type:law_resource_extraction_nationalization - has_law = law_type:law_military_industry_nationalization + or = { + has_law = law_type:law_public_utility_companies + has_law = law_type:law_no_nationalization + has_law = law_type:law_resource_extraction_nationalization + has_law = law_type:law_military_industry_nationalization + } } } } - } remove_ideology = ideology_vanguardist remove_ideology = ideology_social add_ideology = ideology_socialist @@ -367,16 +367,14 @@ setup_starting_ideologies = { if = { limit = { owner = { - or = { - has_law = law_type:law_socialization - } + has_law = law_type:law_socialization } } add_ideology = ideology_apparatus } else = { - remove_ideology = ideology_apparatus - } + remove_ideology = ideology_apparatus + } if = { limit = { owner = { diff --git a/events/CWP_events/ideology_events/dynamic_ideology_events.txt b/events/CWP_events/ideology_events/dynamic_ideology_events.txt index 8a7ba4cf1..b4e1918fb 100644 --- a/events/CWP_events/ideology_events/dynamic_ideology_events.txt +++ b/events/CWP_events/ideology_events/dynamic_ideology_events.txt @@ -1048,3 +1048,30 @@ dynamic_ideologies.25 = { } } } + +dynamic_ideologies.99 = { + type = country_event + title = dynamic_ideologies.99.t + desc = dynamic_ideologies.99.d + icon = "gfx/interface/icons/event_icons/event_default.dds" + event_image = { + video = "gfx/event_pictures/middleeast_courtroom_upheaval.bk2" + #todo pic + } + on_created_soundeffect = "event:/SFX/UI/Alerts/event_appear" + on_opened_soundeffect = "event:/SFX/Events/middleeast/courtroom_upheaval" + duration = 3 + trigger = { + always = yes + } + option = { + name = dynamic_ideologies.99.a + default_option = yes + ig:ig_bureaucrats = { + remove_ideology = ideology_apparatus + } + ai_chance = { + base = 100 + } + } +} From 1b37cc5c7a94f9ee0d3632918286492508921161 Mon Sep 17 00:00:00 2001 From: DZappala Date: Wed, 23 Aug 2023 21:28:20 -0400 Subject: [PATCH 2/2] Fix event 99 dyn ideology loc --- .../english/CWP/CWP_dynamic_ideologies_l_english.yml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/localization/english/CWP/CWP_dynamic_ideologies_l_english.yml b/localization/english/CWP/CWP_dynamic_ideologies_l_english.yml index 507cfeed6..a2b730d6a 100644 --- a/localization/english/CWP/CWP_dynamic_ideologies_l_english.yml +++ b/localization/english/CWP/CWP_dynamic_ideologies_l_english.yml @@ -1,4 +1,4 @@ -l_english: +l_english: dynamic_ideologies.1.t: "A Shift in the Status Quo" dynamic_ideologies.1.d: "A subtle shift in the status quo has happened in [ROOT.GetCountry.GetName], the $ig_variant_laborists$ have become [concept_ideology_social]." dynamic_ideologies.1.a: "Understood." @@ -68,3 +68,8 @@ dynamic_ideologies.25.t: "A Shift in the Status Quo" dynamic_ideologies.25.d: "A subtle shift in the status quo has happened in [ROOT.GetCountry.GetName], the $ig_variant_securocrats$ are no longer [concept_ideology_vanguardist]." dynamic_ideologies.25.a: "Understood." + dynamic_ideologies.99.a: "Understood." + dynamic_ideologies.99.t: "A Shift in the Status Quo" + dynamic_ideologies.99.d: "A subtle shift in the status quo has happened in [ROOT.GetCountry.GetName], the $ig_variant_administratots$ are no longer [concept_ideology_apparatus]." + dynamic_ideologies.99.a: "Understood." +