assign_taiping_states = { c:TPG = { create_military_formation = { type = army hq_region = scope:heavenly_kingdom_spawn.region #Because the Heavenly Kingdom is not always in South China. combat_unit = { type = unit_type:combat_unit_type_irregular_infantry state_region = scope:heavenly_kingdom_spawn.state_region count = 10 } combat_unit = { type = unit_type:combat_unit_type_cannon_artillery state_region = scope:heavenly_kingdom_spawn.state_region count = 5 } } } if = { limit = { any_scope_state = { has_variable = cult_center } } every_scope_state = { limit = { has_variable = cult_center } save_scope_as = tpg_defector_state custom_tooltip = { text = taiping_state_defection set_state_owner = c:TPG set_state_type = incorporated add_culture_standard_of_living_modifier = { culture = cu:manchu months = long_modifier_time multiplier = -5 } } } every_scope_state = { limit = { is_capital = no NOT = { has_variable = cult_center state_region = { is_homeland = cu:manchu } } any_neighbouring_state = { has_variable = cult_center } turmoil >= 0.1 } if = { limit = { this = { state_region = { OR = { is_homeland = cu:han is_homeland = cu:hakka } } } } save_scope_as = tpg_defector_state custom_tooltip = { text = taiping_state_defection set_state_owner = c:TPG set_state_type = incorporated add_culture_standard_of_living_modifier = { culture = cu:manchu months = long_modifier_time multiplier = -5 } c:TPG = { create_military_formation = { type = army hq_region = scope:tpg_defector_state.region combat_unit = { type = unit_type:combat_unit_type_irregular_infantry state_region = scope:tpg_defector_state.state_region count = 5 } } } } } else_if = { random_list = { 50 = { save_scope_as = tpg_defector_state custom_tooltip = { text = taiping_state_defection set_state_owner = c:TPG set_state_type = incorporated add_culture_standard_of_living_modifier = { culture = cu:manchu months = long_modifier_time multiplier = -5 } c:TPG = { create_military_formation = { type = army hq_region = scope:tpg_defector_state.region combat_unit = { type = unit_type:combat_unit_type_irregular_infantry state_region = scope:tpg_defector_state.state_region count = 5 } } } } } 50 = { add_radicals_in_state = { value = very_large_radicals religion = rel:protestant } this.state_region = { add_claim = c:TPG } } } } } } hidden_effect = { every_state = { limit = { owner = c:TPG } this.state_region = { add_claim = c:CHI } } } hidden_effect = { every_state = { limit = { owner = c:TPG } add_modifier = { name = modifier_taiping_hiring_bonus months = 6 } } } } create_taiping_characters = { if = { limit = { game_date < 1880.1.1 NOT = { #If you exiled Hong and he got recruited somewhere else, he doesn't get to be here. any_country = { NOT = { this = c:CHI } any_scope_character = { has_variable = hong_var } } } } create_character = { first_name = Hong last_name = Xiuquan birth_date = 1814.1.1 culture = cu:hakka religion = rel:protestant interest_group = ig_devout ruler = yes historical = yes ideology = ideology_theocrat traits = { inspirational_orator persistent psychological_affliction } on_created = { set_variable = hong_var add_modifier = { name = modifier_brother_of_christ months = long_modifier_time } } } if = { limit = { game_date > 1847.1.1 } create_character = { first_name = Hong last_name = Tianguifu birth_date = 1846.6.6 culture = cu:hakka historical = yes religion = rel:protestant interest_group = ig_devout heir = yes ideology = ideology_moderate traits = { reserved } } } } else = { #Fallback chars if Hong is unavailable. create_character = { religion = rel:protestant interest_group = ig_devout ideology = ideology_theocrat ruler = yes traits = { inspirational_orator persistent psychological_affliction } on_created = { add_modifier = { name = modifier_brother_of_christ months = long_modifier_time } } } create_character = { religion = rel:protestant interest_group = ig_devout heir = yes ideology = ideology_moderate } } if = { limit = { game_date > 1841.1.1 game_date < 1880.1.1 } create_character = { first_name = Yang last_name = Xiuqing birth_date = 1821.9.23 culture = cu:han religion = rel:protestant is_general = yes ig_leader = yes historical = yes interest_group = ig_armed_forces hq = region_south_china ideology = ideology_theocrat commander_rank = commander_rank_3 traits = { grifter expert_political_operator ambitious demagogue } } } if = { limit = { game_date > 1840.1.1 game_date < 1880.1.1 } create_character = { first_name = Xiao last_name = Chaogui birth_date = 1820.1.1 culture = cu:hakka religion = rel:protestant is_general = yes ig_leader = yes historical = yes interest_group = ig_devout hq = region_south_china ideology = ideology_theocrat commander_rank = commander_rank_1 traits = { reckless charismatic demagogue } } } if = { limit = { game_date > 1842.1.1 game_date < 1880.1.1 } create_character = { first_name = Hong last_name = Rengan birth_date = 1822.2.18 culture = cu:han religion = rel:protestant ig_leader = yes historical = yes interest_group = ig_intelligentsia ideology = ideology_market_liberal traits = { innovative persistent basic_diplomat } } } } # Vicky and the Expedition Machine ai_expedition_simulator_start = { random_scope_character = { limit = { is_ruler = no OR = { has_role = general has_role = admiral } } set_variable = expedition_leader_var set_character_busy_and_immortal = yes } set_variable = on_expedition add_modifier = { name = modifier_large_expedition_cost multiplier = money_amount_multiplier_medium } trigger_event = { id = ai_expedition_simulator.1 days = 365 } } ai_expedition_simulator_end = { remove_variable = on_expedition remove_modifier = modifier_large_expedition_cost remove_modifier = expedition_extra_expenses_modifier remove_variable = AI_EXPEDITION_ANTARCTICA remove_variable = AI_EXPEDITION_NILE remove_variable = AI_EXPEDITION_CONGO remove_variable = AI_EXPEDITION_NIGER remove_variable = AI_EXPEDITION_WAMERICA remove_expedition_events_effect = yes random_scope_character = { limit = { has_variable = expedition_leader_var } remove_variable = expedition_leader_var } } voyage_of_potemkin = { while = { limit = { any_state = { has_variable = potemkin_destination_state OR = { owner = ROOT owner = { is_subject_of = ROOT } } } } random_state = { limit = { has_variable = potemkin_destination_state } remove_variable = potemkin_destination_state random_neighbouring_state = { limit = { is_coastal = yes } set_variable = potemkin_destination_state } debug_log_scopes = yes } } random_state = { limit = { has_variable = potemkin_destination_state } remove_variable = potemkin_destination_state owner = { save_scope_as = potemkin_final_destination } } } adopt_random_antigovernment_ideology = { custom_tooltip = { text = adopt_random_antigovernment_ideology_tt random_list = { 50 = { trigger = { owner = { has_technology_researched = socialism NOT = { ruler = { has_ideology = ideology:ideology_social_democrat } } } } modifier = { if = { limit = { owner = { has_law = law_type:law_council_republic } } add = 50 } } set_ideology = ideology:ideology_social_democrat } 100 = { trigger = { owner = { has_technology_researched = socialism NOT = { ruler = { has_ideology = ideology:ideology_communist } } NOT = { has_law = law_type:law_council_republic } } } modifier = { if = { limit = { owner = { has_law = law_type:law_monarchy } } add = 25 } if = { limit = { owner = { has_law = law_type:law_autocracy } } add = 25 } if = { limit = { this.interest_group = { is_interest_group_type = ig_trade_unions } } add = 100 } if = { limit = { owner.ruler = { OR = { has_ideology = ideology:ideology_fascist has_ideology = ideology:ideology_integralist has_ideology = ideology:ideology_ethno_nationalist has_ideology = ideology:ideology_traditionalist } } } add = 100 } } set_ideology = ideology:ideology_communist } 100 = { trigger = { owner = { has_technology_researched = political_agitation NOT = { ruler = { has_ideology = ideology:ideology_vanguardist } } NOT = { has_law = law_type:law_council_republic } } } modifier = { if = { limit = { owner = { has_law = law_type:law_monarchy } } add = 25 } if = { limit = { owner = { has_law = law_type:law_autocracy } } add = 25 } if = { limit = { this.interest_group = { is_interest_group_type = ig_trade_unions } } add = 100 } if = { limit = { owner.ruler = { OR = { has_ideology = ideology:ideology_fascist has_ideology = ideology:ideology_integralist has_ideology = ideology:ideology_ethno_nationalist has_ideology = ideology:ideology_traditionalist } } } add = 100 } } set_ideology = ideology:ideology_vanguardist } 100 = { trigger = { owner = { has_technology_researched = anarchism NOT = { ruler = { has_ideology = ideology:ideology_anarchist } } } } modifier = { if = { limit = { owner = { has_law = law_type:law_monarchy } } add = 25 } if = { limit = { owner = { has_law = law_type:law_autocracy } } add = 50 } if = { limit = { this.interest_group = { OR = { is_interest_group_type = ig_trade_unions is_interest_group_type = ig_rural_folk } } } add = 100 } if = { limit = { owner.ruler = { OR = { has_ideology = ideology:ideology_fascist has_ideology = ideology:ideology_integralist has_ideology = ideology:ideology_ethno_nationalist has_ideology = ideology:ideology_traditionalist } } } add = 100 } } set_ideology = ideology:ideology_anarchist } 100 = { trigger = { owner = { has_technology_researched = political_agitation NOT = { ruler = { has_ideology = ideology:ideology_ethno_nationalist } } } } modifier = { if = { limit = { owner.ruler = { OR = { has_ideology = ideology:ideology_radical has_ideology = ideology:ideology_feminist has_ideology = ideology:ideology_humanitarian has_ideology = ideology:ideology_humanitarian_royalist has_ideology = ideology:ideology_social_democrat } } } add = 50 } if = { limit = { owner.ruler = { OR = { has_ideology = ideology:ideology_communist has_ideology = ideology:ideology_anarchist has_ideology = ideology:ideology_vanguardist } } } add = 100 } if = { limit = { owner.ruler = { OR = { has_ideology = ideology:ideology_fascist has_ideology = ideology:ideology_integralist has_ideology = ideology:ideology_ethno_nationalist has_ideology = ideology:ideology_traditionalist } } } multiply = { value = 0.25 } } if = { limit = { owner = { has_law = law_type:law_no_migration_controls } } add = 100 } if = { limit = { owner = { has_law = law_type:law_multicultural } } multiply = { value = 3 } } if = { limit = { owner = { has_law = law_type:law_cultural_exclusion } } multiply = { value = 2 } } if = { limit = { owner = { has_law = law_type:law_council_republic } } multiply = { value = 1.5 } } } set_ideology = ideology:ideology_ethno_nationalist } 50 = { trigger = { owner = { has_technology_researched = realism has_law = law_type:law_state_religion NOT = { ruler = { has_ideology = ideology:ideology_atheist } } } } modifier = { if = { limit = { owner = { has_law = law_type:law_monarchy } } add = 50 } if = { limit = { owner = { has_law = law_type:law_state_religion } } add = 100 } if = { limit = { owner = { has_law = law_type:law_theocracy } } add = 200 } } set_ideology = ideology:ideology_atheist } 50 = { trigger = { owner = { has_technology_researched = egalitarianism NOT = { ruler = { has_ideology = ideology:ideology_radical } } } } modifier = { if = { limit = { owner = { has_law = law_type:law_monarchy } } add = 100 } if = { limit = { owner = { has_law = law_type:law_autocracy } } add = 100 } if = { limit = { owner = { has_law = law_type:law_oligarchy } } add = 50 } if = { limit = { owner = { has_law = law_type:law_landed_voting } } add = 25 } } set_ideology = ideology:ideology_radical } 100 = { trigger = { owner = { has_technology_researched = mass_propaganda NOT = { ruler = { has_ideology = ideology:ideology_fascist has_ideology = ideology:ideology_integralist } } } } modifier = { if = { limit = { owner.ruler = { OR = { has_ideology = ideology:ideology_radical has_ideology = ideology:ideology_feminist has_ideology = ideology:ideology_humanitarian has_ideology = ideology:ideology_humanitarian_royalist has_ideology = ideology:ideology_social_democrat } } } add = 50 } if = { limit = { owner.ruler = { OR = { has_ideology = ideology:ideology_communist has_ideology = ideology:ideology_anarchist has_ideology = ideology:ideology_vanguardist } } } add = 100 } if = { limit = { owner.ruler = { OR = { has_ideology = ideology:ideology_fascist has_ideology = ideology:ideology_integralist has_ideology = ideology:ideology_ethno_nationalist has_ideology = ideology:ideology_traditionalist } } } multiply = { value = 0.25 } } if = { limit = { owner = { has_law = law_type:law_council_republic } } multiply = { value = 2 } } } set_ideology = ideology:ideology_fascist } 50 = { trigger = { owner = { has_technology_researched = stock_exchange NOT = { ruler = { has_ideology = ideology:ideology_market_liberal } } } } modifier = { if = { limit = { owner = { has_law = law_type:law_command_economy } } add = 50 } if = { limit = { owner = { has_law = law_type:law_traditionalism } } add = 50 } if = { limit = { owner = { has_law = law_type:law_isolationism } } add = 50 } if = { limit = { owner.ruler = { OR = { has_ideology = ideology:ideology_communist has_ideology = ideology:ideology_anarchist has_ideology = ideology:ideology_vanguardist } } } add = 100 } } set_ideology = ideology:ideology_market_liberal } 50 = { trigger = { owner = { has_technology_researched = romanticism OR = { has_law = law_type:law_command_economy has_law = law_type:law_laissez_faire has_law = law_type:law_interventionism } NOT = { ruler = { has_ideology = ideology:ideology_luddite } } } } modifier = { if = { limit = { owner = { any_scope_state = { any_scope_building = { is_building_group = bg_heavy_industry level >= 5 } state_unemployment_rate > 0.1 } } } add = 25 } if = { limit = { owner = { any_scope_building = { is_building_group = bg_heavy_industry level >= 5 } } } add = 25 } if = { limit = { OR = { is_interest_group_type = ig_rural_folk is_interest_group_type = ig_devout } } add = 50 } if = { limit = { NOR = { is_interest_group_type = ig_rural_folk is_interest_group_type = ig_devout } } add = -50 } if = { limit = { owner = { has_ruling_interest_group = ig_industrialists } } multiply = { value = 2 } } if = { limit = { owner = { has_ruling_interest_group = ig_rural_folk } } multiply = { value = 0.25 } } } set_ideology = ideology:ideology_luddite } 50 = { trigger = { owner = { has_technology_researched = feminism NOT = { ruler = { has_ideology = ideology:ideology_feminist } } } } modifier = { if = { limit = { owner = { has_law = law_type:law_monarchy } } add = 25 } } set_ideology = ideology:ideology_feminist } 50 = { trigger = { owner = { has_technology_researched = feminism NOT = { ruler = { OR = { has_ideology = ideology:ideology_humanitarian has_ideology = ideology:ideology_humanitarian_royalist } } } } } modifier = { if = { limit = { owner = { has_law = law_type:law_monarchy } } add = 25 } } set_ideology = ideology:ideology_humanitarian } 50 = { trigger = { NOT = { owner.ruler = { has_ideology = ideology:ideology_traditionalist } } } modifier = { if = { limit = { this.interest_group = { OR = { is_interest_group_type = ig_landowners is_interest_group_type = ig_devout } } } multiply = { value = 2 } } if = { limit = { owner.ruler = { OR = { has_ideology = ideology:ideology_radical has_ideology = ideology:ideology_feminist has_ideology = ideology:ideology_humanitarian has_ideology = ideology:ideology_humanitarian_royalist has_ideology = ideology:ideology_social_democrat } } } add = 50 } if = { limit = { owner.ruler = { OR = { has_ideology = ideology:ideology_communist has_ideology = ideology:ideology_anarchist has_ideology = ideology:ideology_vanguardist } } } add = 100 } if = { limit = { owner.ruler = { OR = { has_ideology = ideology:ideology_fascist has_ideology = ideology:ideology_integralist has_ideology = ideology:ideology_ethno_nationalist has_ideology = ideology:ideology_traditionalist } } } multiply = { value = 0.25 } } if = { limit = { this.interest_group = { OR = { is_interest_group_type = ig_intelligentsia is_interest_group_type = ig_industrialists is_interest_group_type = ig_trade_unions } } } multiply = { value = 0.2 } } } set_ideology = ideology:ideology_traditionalist } 50 = { trigger = { NOT = { owner.ruler = { has_ideology = ideology:ideology_republican_leader } } owner = { has_law = law_type:law_monarchy } } modifier = { if = { limit = { owner = { has_law = law_type:law_monarchy } } multiply = { value = 2 } } if = { limit = { owner = { has_law = law_type:law_autocracy } } multiply = { value = 2 } } if = { limit = { owner = { has_law = law_type:law_oligarchy } } add = 25 } if = { limit = { owner = { has_law = law_type:law_landed_voting } } add = 25 } if = { limit = { this.interest_group = { is_interest_group_type = ig_landowners } } multiply = { value = 0.10 } } } set_ideology = ideology:ideology_republican_leader } 50 = { trigger = { owner = { NOT = { ruler = { has_ideology = ideology:ideology_abolitionist } } OR = { has_law = law_type:law_serfdom NOT = { has_law = law_type:law_slavery_banned } } } } modifier = { if = { limit = { owner = { has_law = law_type:law_serfdom } } add = 25 } if = { limit = { owner = { NOT = { has_law = law_type:law_slavery_banned } } } add = 25 } if = { limit = { owner = { has_law = law_type:law_slave_trade } } add = 50 } if = { limit = { this.interest_group = { is_interest_group_type = ig_landowners } } multiply = { value = 0.05 } } } set_ideology = ideology:ideology_abolitionist } } } } save_agitator_election_scopes = { if = { limit = { has_variable = preset_ideology } scope:agitator_scope = { this.interest_group = { save_scope_as = agitator_ig_scope } } } else = { random_scope_character = { limit = { has_role = agitator NOT = { has_variable = agitator_election_participation } } save_scope_as = agitator_scope this.interest_group = { save_scope_as = agitator_ig_scope } } } #Attach to party if = { limit = { any_political_movement = { any_supporting_character = { this = scope:agitator_scope } } } random_political_movement = { limit = { any_supporting_character = { this = scope:agitator_scope } } save_scope_as = agitator_movement_scope } } if = { limit = { scope:agitator_scope.interest_group = { has_party = yes } } scope:agitator_scope.interest_group.party = { save_scope_as = agitator_party_scope } } else = { if = { limit = { scope:agitator_scope = { has_socialist_ideology = yes } any_active_party = { any_member = { leader = { has_socialist_ideology = yes } } } } random_active_party = { limit = { any_member = { leader = { has_socialist_ideology = yes } } } save_scope_as = agitator_party_scope } } else_if = { limit = { scope:agitator_scope = { has_progressive_ideology = yes } any_active_party = { any_member = { leader = { has_progressive_ideology = yes } } } } random_active_party = { limit = { any_member = { leader = { has_progressive_ideology = yes } } } save_scope_as = agitator_party_scope } } else_if = { limit = { scope:agitator_scope = { has_liberal_ideology = yes } any_active_party = { any_member = { leader = { has_liberal_ideology = yes } } } } random_active_party = { limit = { any_member = { leader = { has_liberal_ideology = yes } } } save_scope_as = agitator_party_scope } } else_if = { limit = { scope:agitator_scope = { has_reactionary_ideology = yes } any_active_party = { any_member = { leader = { has_reactionary_ideology = yes } } } } random_active_party = { limit = { any_member = { leader = { has_reactionary_ideology = yes } } } save_scope_as = agitator_party_scope } } else_if = { limit = { scope:agitator_scope = { has_conservative_ideology = yes } any_active_party = { any_member = { leader = { has_conservative_ideology = yes } } } } random_active_party = { limit = { any_member = { leader = { has_conservative_ideology = yes } } } save_scope_as = agitator_party_scope } } else = { random_active_party = { #Chaos reigns save_scope_as = agitator_party_scope } } } remove_variable = preset_ideology } clear_legal_single_party = { remove_variable = only_valid_party } communist_agitator_election_scope_effect = { random_active_party = { limit = { is_party_type = communist_party } save_scope_as = agitator_party_scope } random_scope_character = { limit = { OR = { has_ideology = ideology:ideology_communist has_ideology = ideology:ideology_vanguardist has_ideology = ideology:ideology_anarchist AND = { this.interest_group = { is_member_of_party = owner.py:communist_party } NOT = { law_stance = { law = law_type:law_council_republic value < neutral } } } } has_role = agitator NOT = { has_variable = agitator_election_participation } } save_scope_as = agitator_scope this.interest_group = { save_scope_as = agitator_ig_scope } this.political_movement ?= { save_scope_as = agitator_movement_scope } } } fascist_agitator_election_scope_effect = { random_active_party = { limit = { is_party_type = fascist_party } save_scope_as = agitator_party_scope } random_scope_character = { limit = { OR = { has_ideology = ideology:ideology_fascist has_ideology = ideology:ideology_integralist has_ideology = ideology:ideology_ethno_nationalist AND = { this.interest_group = { is_member_of_party = owner.py:fascist_party } NOT = { law_stance = { law = law_type:law_ethnostate value < neutral } } } } has_role = agitator } save_scope_as = agitator_scope this.interest_group = { save_scope_as = agitator_ig_scope } this.political_movement ?= { save_scope_as = agitator_movement_scope } } } agrarian_agitator_election_scope_effect = { random_active_party = { limit = { is_party_type = agrarian_party } save_scope_as = agitator_party_scope } random_scope_character = { limit = { OR = { has_ideology = ideology:ideology_agrarian this.interest_group = { is_member_of_party = owner.py:agrarian_party } } has_role = agitator NOT = { has_variable = agitator_election_participation } } save_scope_as = agitator_scope this.interest_group = { save_scope_as = agitator_ig_scope } this.political_movement ?= { save_scope_as = agitator_movement_scope } } } socdem_agitator_election_scope_effect = { random_active_party = { limit = { is_party_type = social_democrat_party } save_scope_as = agitator_party_scope } random_scope_character = { limit = { OR = { has_ideology = ideology:ideology_social_democrat this.interest_group = { is_member_of_party = owner.py:social_democrat_party } } has_role = agitator NOT = { has_variable = agitator_election_participation } } save_scope_as = agitator_scope this.interest_group = { save_scope_as = agitator_ig_scope } this.political_movement ?= { save_scope_as = agitator_movement_scope } } } liberal_agitator_election_scope_effect = { random_active_party = { limit = { is_party_type = liberal_party } save_scope_as = agitator_party_scope } random_scope_character = { limit = { OR = { has_ideology = ideology:ideology_reformer has_ideology = ideology:ideology_humanitarian has_ideology = ideology:ideology_humanitarian_royalist has_ideology = ideology:ideology_market_liberal this.interest_group = { is_member_of_party = owner.py:liberal_party } } has_role = agitator NOT = { has_variable = agitator_election_participation } } save_scope_as = agitator_scope this.interest_group = { save_scope_as = agitator_ig_scope } this.political_movement ?= { save_scope_as = agitator_movement_scope } } } conservative_agitator_election_scope_effect = { random_active_party = { limit = { is_party_type = conservative_party } save_scope_as = agitator_party_scope } random_scope_character = { limit = { OR = { has_ideology = ideology:ideology_traditionalist has_ideology = ideology:ideology_slaver this.interest_group = { is_member_of_party = owner.py:conservative_party } } has_role = agitator NOT = { has_variable = agitator_election_participation } } save_scope_as = agitator_scope this.interest_group = { save_scope_as = agitator_ig_scope } this.political_movement ?= { save_scope_as = agitator_movement_scope } } } radical_agitator_election_scope_effect = { random_active_party = { limit = { is_party_type = radical_party } save_scope_as = agitator_party_scope } random_scope_character = { limit = { OR = { has_ideology = ideology:ideology_radical this.interest_group = { is_member_of_party = owner.py:radical_party } } has_role = agitator NOT = { has_variable = agitator_election_participation } } save_scope_as = agitator_scope this.interest_group = { save_scope_as = agitator_ig_scope } this.political_movement ?= { save_scope_as = agitator_movement_scope } } } free_trade_agitator_election_scope_effect = { random_active_party = { limit = { is_party_type = free_trade_party } save_scope_as = agitator_party_scope } random_scope_character = { limit = { OR = { has_ideology = ideology:ideology_market_liberal this.interest_group = { is_member_of_party = owner.py:free_trade_party } } has_role = agitator NOT = { has_variable = agitator_election_participation } } save_scope_as = agitator_scope save_scope_as = exile_scope this.interest_group = { save_scope_as = agitator_ig_scope } this.political_movement ?= { save_scope_as = agitator_movement_scope } } } gen_ruler_party = { ruler.interest_group = { save_scope_as = ruler_ig } if = { limit = { has_technology_researched = socialism OR = { ruler = { has_socialist_ideology = yes } ruler.interest_group.leader = { has_socialist_ideology = yes } } } random_potential_party = { limit = { is_party_type = communist_party } save_scope_as = only_legit_party_scope add_ig_to_party = scope:ruler_ig } set_variable = { name = only_valid_party value = scope:only_legit_party_scope } } else_if = { limit = { has_technology_researched = political_agitation OR = { ruler = { OR = { has_ideology = ideology:ideology_fascist has_ideology = ideology:ideology_integralist has_ideology = ideology:ideology_ethno_nationalist } } ruler.interest_group.leader = { OR = { has_ideology = ideology:ideology_fascist has_ideology = ideology:ideology_integralist has_ideology = ideology:ideology_ethno_nationalist } } } } random_potential_party = { limit = { is_party_type = fascist_party } save_scope_as = only_legit_party_scope add_ig_to_party = scope:ruler_ig } set_variable = { name = only_valid_party value = scope:only_legit_party_scope } } else_if = { limit = { has_technology_researched = anarchism OR = { ruler = { has_ideology = ideology:ideology_anarchist } ruler.interest_group.leader = { has_ideology = ideology:ideology_anarchist } } } random_potential_party = { limit = { is_party_type = anarchist_party } save_scope_as = only_legit_party_scope add_ig_to_party = scope:ruler_ig } set_variable = { name = only_valid_party value = scope:only_legit_party_scope } } else_if = { limit = { has_technology_researched = labor_movement OR = { ruler = { OR = { has_ideology = ideology:ideology_social_democrat has_ideology = ideology:ideology_feminist has_ideology = ideology:ideology_humanitarian has_ideology = ideology:ideology_humanitarian_royalist } } ruler.interest_group.leader = { OR = { has_ideology = ideology:ideology_social_democrat has_ideology = ideology:ideology_feminist has_ideology = ideology:ideology_humanitarian has_ideology = ideology:ideology_humanitarian_royalist } } ruler = { is_interest_group_type = ig_trade_unions } } } random_potential_party = { limit = { is_party_type = social_democrat_party } save_scope_as = only_legit_party_scope add_ig_to_party = scope:ruler_ig } set_variable = { name = only_valid_party value = scope:only_legit_party_scope } } else_if = { limit = { has_technology_researched = egalitarianism OR = { ruler = { has_progressive_ideology = yes } ruler.interest_group.leader = { has_progressive_ideology = yes } } } random_potential_party = { limit = { is_party_type = radical_party } save_scope_as = only_legit_party_scope add_ig_to_party = scope:ruler_ig } set_variable = { name = only_valid_party value = scope:only_legit_party_scope } } else_if = { limit = { has_technology_researched = empiricism OR = { ruler = { has_liberal_ideology = yes } ruler.interest_group.leader = { has_liberal_ideology = yes } ruler = { is_interest_group_type = ig_intelligentsia } } } random_potential_party = { limit = { is_party_type = liberal_party } save_scope_as = only_legit_party_scope add_ig_to_party = scope:ruler_ig } set_variable = { name = only_valid_party value = scope:only_legit_party_scope } } else_if = { limit = { OR = { ruler = { has_ideology = ideology:ideology_jingoist_leader } ruler.interest_group.leader = { has_ideology = ideology:ideology_jingoist_leader } ruler = { is_interest_group_type = ig_armed_forces } } } random_potential_party = { limit = { is_party_type = military_party } save_scope_as = only_legit_party_scope add_ig_to_party = scope:ruler_ig } set_variable = { name = only_valid_party value = scope:only_legit_party_scope } } else_if = { limit = { has_technology_researched = stock_exchange OR = { ruler = { has_ideology = ideology:ideology_market_liberal } ruler.interest_group.leader = { has_ideology = ideology:ideology_market_liberal } ruler = { is_interest_group_type = ig_industrialists } } } random_potential_party = { limit = { is_party_type = free_trade_party } save_scope_as = only_legit_party_scope add_ig_to_party = scope:ruler_ig } set_variable = { name = only_valid_party value = scope:only_legit_party_scope } } else_if = { limit = { OR = { ruler = { has_ideology = ideology:ideology_pacifist } ruler.interest_group.leader = { has_ideology = ideology:ideology_pacifist } ruler = { is_interest_group_type = ig_rural_folk } } } random_potential_party = { limit = { is_party_type = agrarian_party } save_scope_as = only_legit_party_scope add_ig_to_party = scope:ruler_ig } set_variable = { name = only_valid_party value = scope:only_legit_party_scope } } else = { random_potential_party = { limit = { is_party_type = conservative_party } save_scope_as = only_legit_party_scope add_ig_to_party = scope:ruler_ig } set_variable = { name = only_valid_party value = scope:only_legit_party_scope } } } create_paris_commune_characters = { if = { limit = { game_date > 1866.1.1 game_date < 1900.1.1 } if = { limit = { NOR = { any_character = { has_template = rus_jaroslaw_dabrowski_character_template } any_character_in_exile_pool = { has_template = rus_jaroslaw_dabrowski_character_template } } } create_character = { template = rus_jaroslaw_dabrowski_character_template on_created = { add_character_role = general add_commander_rank = 1 set_variable = dabrowski_var set_global_variable = dabrowski_spawn } } } else_if = { limit = { any_character = { owner = c:FRA has_template = rus_jaroslaw_dabrowski_character_template } } random_character = { limit = { owner = c:FRA has_template = rus_jaroslaw_dabrowski_character_template } transfer_character = c:PRC add_character_role = general add_commander_rank = 1 } } else_if = { limit = { any_character_in_exile_pool = { has_template = rus_jaroslaw_dabrowski_character_template } } random_character_in_exile_pool = { limit = { has_template = rus_jaroslaw_dabrowski_character_template } transfer_character = c:PRC add_character_role = general add_commander_rank = 1 } } } if = { limit = { game_date < 1890.1.1 } if = { limit = { NOR = { any_character = { has_template = fra_delescluze_character_template } any_character_in_exile_pool = { has_template = fra_delescluze_character_template } } } create_character = { template = fra_delescluze_character_template on_created = { add_character_role = politician remove_character_role = agitator set_as_interest_group_leader = yes set_variable = delescluze_var set_global_variable = delescluze_spawn } } } else_if = { limit = { any_character = { owner = c:FRA has_template = fra_delescluze_character_template } } random_character = { limit = { owner = c:FRA has_template = fra_delescluze_character_template } transfer_character = c:PRC add_character_role = politician remove_character_role = agitator set_as_interest_group_leader = yes } } else_if = { limit = { any_character_in_exile_pool = { has_template = fra_delescluze_character_template } } random_character_in_exile_pool = { limit = { has_template = fra_delescluze_character_template } transfer_character = c:PRC add_character_role = politician remove_character_role = agitator set_as_interest_group_leader = yes } } } if = { limit = { game_date > 1860.1.1 game_date < 1900.1.1 } if = { limit = { NOR = { any_character = { has_template = agitator_louise_michel } any_character_in_exile_pool = { has_template = agitator_louise_michel } } } create_character = { template = agitator_louise_michel } } else_if = { limit = { any_character = { owner = c:FRA has_template = agitator_louise_michel } } random_character = { limit = { owner = c:FRA has_template = agitator_louise_michel } transfer_character = c:PRC } } else_if = { limit = { any_character_in_exile_pool = { has_template = agitator_louise_michel } } random_character_in_exile_pool = { limit = { has_template = agitator_louise_michel } transfer_character = c:PRC } } } if = { limit = { game_date > 1860.1.1 game_date < 1900.1.1 } create_character = { first_name = Gustave last_name = Cluseret birth_date = 1823.6.13 culture = cu:french ig_leader = yes is_general = yes interest_group = ig_armed_forces ideology = ideology_radical hq = region_france commander_rank = commander_rank_2 traits = { grifter reckless explorer } } } if = { limit = { game_date > 1865.1.1 game_date < 1910.1.1 } create_character = { first_name = Eugene last_name = Varlin birth_date = 1839.10.5 culture = cu:french ig_leader = yes interest_group = ig_trade_unions ideology = ideology_anarchist traits = { persistent brave charismatic } } } } enact_preferred_governance_principle = { random_interest_group = { limit = { is_in_government = yes is_strongest_ig_in_government = yes } save_scope_as = ruling_ig } if = { limit = { scope:ruling_ig ?= { law_stance = { law = law_type:law_council_republic value = strongly_approve } } } activate_law = law_type:law_council_republic } else_if = { limit = { scope:ruling_ig ?= { law_stance = { law = law_type:law_monarchy value = strongly_approve } } } activate_law = law_type:law_monarchy } else_if = { limit = { scope:ruling_ig ?= { law_stance = { law = law_type:law_parliamentary_republic value = strongly_approve } } } activate_law = law_type:law_parliamentary_republic } else_if = { limit = { scope:ruling_ig ?= { law_stance = { law = law_type:law_presidential_republic value = strongly_approve } } } activate_law = law_type:law_presidential_republic } else_if = { limit = { scope:ruling_ig ?= { law_stance = { law = law_type:law_theocracy value = strongly_approve } } } activate_law = law_type:law_theocracy } else_if = { limit = { scope:ruling_ig ?= { law_stance = { law = law_type:law_council_republic value = approve } } } activate_law = law_type:law_council_republic } else_if = { limit = { scope:ruling_ig ?= { law_stance = { law = law_type:law_monarchy value = approve } } } activate_law = law_type:law_monarchy } else_if = { limit = { scope:ruling_ig ?= { law_stance = { law = law_type:law_parliamentary_republic value = approve } } } activate_law = law_type:law_parliamentary_republic } else_if = { limit = { scope:ruling_ig ?= { law_stance = { law = law_type:law_presidential_republic value = approve } } } activate_law = law_type:law_presidential_republic } else_if = { limit = { scope:ruling_ig ?= { law_stance = { law = law_type:law_theocracy value = approve } } } activate_law = law_type:law_theocracy } else = { activate_law = law_type:law_presidential_republic if = { limit = { civil_war_origin_country ?= { has_law = law_type:law_monarchy } } set_variable = prov_gov_monarchy } else_if = { limit = { civil_war_origin_country ?= { has_law = law_type:law_theocracy } } set_variable = prov_gov_theocracy } else_if = { limit = { civil_war_origin_country ?= { has_law = law_type:law_council_republic } } set_variable = prov_gov_council_republic } set_variable = revolutionary_prov_gov_var } } enact_preferred_governance_principle_new = { random_interest_group = { limit = { is_in_government = yes is_strongest_ig_in_government = yes } save_scope_as = ruling_ig } random_law = { limit = { OR = { type = law_type:law_chiefdom type = law_type:law_monarchy type = law_type:law_presidential_republic type = law_type:law_parliamentary_republic type = law_type:law_theocracy type = law_type:law_council_republic } type = { save_temporary_scope_as = enacted_gov_pric } scope:ruling_ig = { law_stance = { law = scope:enacted_gov_pric value = strongly_approve } } } save_scope_as = preferred_gov_principles } if = { limit = { NOT = { exists = scope:preferred_gov_principles } } random_law = { limit = { OR = { type = law_type:law_chiefdom type = law_type:law_monarchy type = law_type:law_presidential_republic type = law_type:law_parliamentary_republic type = law_type:law_theocracy type = law_type:law_council_republic } type = { save_temporary_scope_as = enacted_gov_pric } scope:ruling_ig = { law_stance = { law = scope:enacted_gov_pric value = approve } } } save_scope_as = preferred_gov_principles } } if = { limit = { NOT = { exists = scope:preferred_gov_principles } } random_law = { limit = { OR = { type = law_type:law_chiefdom type = law_type:law_monarchy type = law_type:law_presidential_republic type = law_type:law_parliamentary_republic type = law_type:law_theocracy type = law_type:law_council_republic } type = { save_temporary_scope_as = enacted_gov_pric } scope:ruling_ig = { law_stance = { law = scope:enacted_gov_pric value = neutral } } } save_scope_as = preferred_gov_principles } } activate_law = scope:preferred_gov_principles } exile_character_with_martyrdom = { save_scope_as = martyred_exile_scope if = { limit = { NOT = { has_modifier = modifier_political_martyr } } add_modifier = modifier_political_martyr } if = { limit = { owner = { NOT = { any_primary_culture = { this = scope:martyred_exile_scope.culture } } } } if = { limit = { any_country = { NOT = { this = scope:martyred_exile_scope.owner } any_primary_culture = { this = scope:martyred_exile_scope.culture } } } ordered_country = { limit = { NOT = { this = scope:martyred_exile_scope.owner } any_primary_culture = { this = scope:martyred_exile_scope.culture } } order_by = country_rank create_diplomatic_catalyst = { type = catalyst_exiled_culture_member target = scope:martyred_exile_scope.owner } } } } clean_up_exile_character_roles = yes exile_character = yes } # Divided Monarchists # Made by Victoria/Pacifica/AcresOfAsteraceae # Refer to comments here and in 02_french_monarchism to get an idea as to how this works. fra_set_divided_monarchist_variables = { #Bonapartist Variables set_variable = { name = bonapartist_progress_from_characters value = 0 } #Progress-from-character component. This updates with the combined popularities of every Bonapartist character later on, and is used to calculate monthly progress in the progress bar. set_variable = { name = bonapartist_progress_from_igs value = 0 } #Progress-from-IG component. This updates with the combined clout of every Bonapartist IG later on, and is used to calculate monthly progress in the progress bar. set_variable = { name = bonapartist_progress_from_military value = 0 } #Progress-from-military-building component. This updates with the sum of military building levels in France later on, and is used to calculate monthly progress in the progress bar. set_variable = { name = bonapartist_progress_from_legitimacy value = 0 } #Progress-from-legitimacy component. This updates with the current government legitimacy, and is also used to calculate monthly progress in the progress bar. set_variable = { name = bonapartist_progress_from_effects value = 0 } #Final element in the progress bar. This is defined by various effects, and is based solely on scripted effects. This is how designers can manually grant ticking bonuses or maluses to this mechanic. #Orleanist Variables set_variable = { name = orleanist_progress_from_characters value = 0 } set_variable = { name = orleanist_progress_from_igs value = 0 } set_variable = { name = orleanist_progress_from_factories value = 0 } #These variables use the same scheme as the Bonapartist ones, with the exception that Orleanists derive from the sum of light/heavy industry building levels in France. set_variable = { name = orleanist_progress_from_legitimacy value = 0 } set_variable = { name = orleanist_progress_from_effects value = 0 } #Legitimist Variables set_variable = { name = legitimist_progress_from_characters value = 0 } set_variable = { name = legitimist_progress_from_igs value = 0 } set_variable = { name = legitimist_progress_from_farms value = 0 } #These variables use the same scheme as the Bonapartist ones, with the exception that Legitimists derive from the sum of agricultural building levels in France. set_variable = { name = legitimist_progress_from_legitimacy value = 0 } set_variable = { name = legitimist_progress_from_effects value = 0 } set_variable = { name = ig_weight value = 0 } #This variable is used solely for mathematical purposes, and is set as equivalent to the clout of a given interest group. It exists so that IGs can be weighted higher or lower depending on whether they're in-government or not. } fra_weekly_pulse_bonapartist_progress = { #Effects like these are run three times, one for each house. All of them function essentially the same way. set_variable = { name = bonapartist_progress_from_characters value = 0 } #All of these variables are ephemeral and should never be manually set to anything. set_variable = { name = bonapartist_progress_from_igs value = 0 } set_variable = { name = bonapartist_progress_from_military value = 0 } set_variable = { name = bonapartist_progress_from_legitimacy value = root.government_legitimacy } #Government legitimacy is a single constant, and so this variable is set immediately rather than needing a calculation. #From Characters every_scope_character = { limit = { has_ideology = ideology:ideology_bonapartist } ROOT = { change_variable = { name = bonapartist_progress_from_characters add = prev.popularity } #for_each loop. For each character of ideology_bonapartist, add that character's popularity to bonapartist_progress_from_characters. } } change_variable = { name = bonapartist_progress_from_characters divide = 100 } #Character popularities are -100/100, rather than our desired -1/1, so divide by 100. # From Interest Groups every_interest_group = { limit = { leader = { has_ideology = ideology:ideology_bonapartist } } ROOT = { #for_each loop. For each interest group of ideology_bonapartist, perform the following steps in sequence. set_variable = { name = ig_weight value = prev.ig_clout } #1. Set ig_weight as equal to the interest group's clout. } if = { limit = { is_in_government = yes } ROOT = { change_variable = { name = ig_weight multiply = 3 } #2. If that IG is in government, multiply ig_weight by a given value. } } ROOT = { change_variable = { name = bonapartist_progress_from_igs add = var:ig_weight } #3. Add ig_weight to the central bonapartist_progress_from_igs variable. This will run until there are no more Bonapartist IGs. } } # From Buildings every_scope_building = { limit = { is_building_group = bg_military # Derives from barracks and naval bases. occupancy >= 0.5 } ROOT = { change_variable = { name = bonapartist_progress_from_military add = prev.level } #for_each loop, uses similar context to the character component. Iterates through every building in the country matching the filter, gets that building's level, and adds it to the central bonapartist_progress_from_military variable. } } change_variable = { name = bonapartist_progress_from_military divide = 100 } #Building levels are converted to decimal. This usually equals something between 1 and 3, with 0.01 = one building level. # From Legitimacy change_variable = { name = bonapartist_progress_from_legitimacy divide = 100 } #Legitimacy divided by 100, to make it minimum 0 and maximum 1. change_variable = { name = bonapartist_progress_from_legitimacy subtract = 0.5 } #Legitimacy subtracted by 0.5, to make it minimum -0.5 and maximum 0.5. Balanced scale of negative to absolute value. if = { limit = { NOT = { ruler_is_bonapartist = yes #If the ruler is Bonapartist, then the Bonapartists benefit from high legitimacy and suffer from low legitimacy. } } change_variable = { name = bonapartist_progress_from_legitimacy multiply = -0.5 } #If the ruler is not Bonapartist, they benefit from low legitimacy and suffer from high legitimacy. } } fra_weekly_pulse_orleanist_progress = { #See Bonapartist progress to see how this works. set_variable = { name = orleanist_progress_from_characters value = 0 } set_variable = { name = orleanist_progress_from_igs value = 0 } set_variable = { name = orleanist_progress_from_factories value = 0 } set_variable = { name = orleanist_progress_from_legitimacy value = root.government_legitimacy } #From Characters every_scope_character = { limit = { has_ideology = ideology:ideology_orleanist } ROOT = { change_variable = { name = orleanist_progress_from_characters add = prev.popularity } } } change_variable = { name = orleanist_progress_from_characters divide = 100 } # From Interest Groups every_interest_group = { limit = { leader = { has_ideology = ideology:ideology_orleanist } } ROOT = { set_variable = { name = ig_weight value = prev.ig_clout } } if = { limit = { is_in_government = yes } ROOT = { change_variable = { name = ig_weight multiply = 3 } } } ROOT = { change_variable = { name = orleanist_progress_from_igs add = var:ig_weight } } } # From Buildings every_scope_building = { limit = { is_building_group = bg_manufacturing weekly_profit > 0 } ROOT = { change_variable = { name = orleanist_progress_from_factories add = prev.level } } } change_variable = { name = orleanist_progress_from_factories divide = 100 } # From Legitimacy change_variable = { name = orleanist_progress_from_legitimacy divide = 100 } change_variable = { name = orleanist_progress_from_legitimacy subtract = 0.5 } if = { limit = { NOT = { ruler_is_orleanist = yes } } change_variable = { name = orleanist_progress_from_legitimacy multiply = -0.5 } } } fra_weekly_pulse_legitimist_progress = { #See Legitimist progress to see how this works. set_variable = { name = legitimist_progress_from_characters value = 0 } set_variable = { name = legitimist_progress_from_igs value = 0 } set_variable = { name = legitimist_progress_from_farms value = 0 } set_variable = { name = legitimist_progress_from_legitimacy value = root.government_legitimacy } #From Characters every_scope_character = { limit = { has_ideology = ideology:ideology_legitimist } ROOT = { change_variable = { name = legitimist_progress_from_characters add = prev.popularity } } } change_variable = { name = legitimist_progress_from_characters divide = 100 } # From Interest Groups every_interest_group = { limit = { leader = { has_ideology = ideology:ideology_legitimist } } ROOT = { set_variable = { name = ig_weight value = prev.ig_clout } } if = { limit = { is_in_government = yes } ROOT = { change_variable = { name = ig_weight multiply = 3 } } } ROOT = { change_variable = { name = legitimist_progress_from_igs add = var:ig_weight } } } # From Buildings every_scope_building = { limit = { is_building_group = bg_agriculture NOT = { is_building_group = bg_subsistence_agriculture } weekly_profit > 0 } ROOT = { change_variable = { name = legitimist_progress_from_farms add = prev.level } } } change_variable = { name = legitimist_progress_from_farms divide = 100 } # From Legitimacy change_variable = { name = legitimist_progress_from_legitimacy divide = 100 } change_variable = { name = legitimist_progress_from_legitimacy subtract = 0.5 } if = { limit = { NOT = { ruler_is_legitimist = yes } } change_variable = { name = legitimist_progress_from_legitimacy multiply = -0.5 } } } fra_clear_divided_monarchist_variables = { #Clears all variables, to save memory/performance. Should be executed by anything that makes Divided Monarchists irrelevant. remove_variable = bonapartist_progress_from_characters remove_variable = bonapartist_progress_from_igs remove_variable = bonapartist_progress_from_military remove_variable = bonapartist_progress_from_legitimacy remove_variable = bonapartist_progress_from_effects remove_variable = orleanist_progress_from_characters remove_variable = orleanist_progress_from_igs remove_variable = orleanist_progress_from_factories remove_variable = orleanist_progress_from_legitimacy remove_variable = orleanist_progress_from_effects remove_variable = legitimist_progress_from_characters remove_variable = legitimist_progress_from_igs remove_variable = legitimist_progress_from_farms remove_variable = legitimist_progress_from_legitimacy remove_variable = legitimist_progress_from_effects remove_variable = ig_weight } fra_freeze_divided_monarchist_progress = { #Used upon initiation of cement_the_rightful_dynasty, to prevent the bars from excessively accumulating. set_variable = fra_divided_monarchists_freeze } # Used in IG scope fra_disfavor_leader_ig_dynasty = { if = { limit = { leader = { has_ideology = ideology:ideology_bonapartist } } owner = { custom_tooltip = { text = bonapartist_progress_decrease_10_tt je:je_divided_monarchists = { add_progress = { value = -10 name = divided_monarchists_bonapartist_progress_bar } } } } } else_if = { limit = { leader = { has_ideology = ideology:ideology_orleanist } } owner = { custom_tooltip = { text = orleanist_progress_decrease_10_tt je:je_divided_monarchists = { add_progress = { value = -10 name = divided_monarchists_orleanist_progress_bar } } } } } else_if = { limit = { leader = { has_ideology = ideology:ideology_legitimist } } owner = { custom_tooltip = { text = legitimist_progress_decrease_10_tt je:je_divided_monarchists = { add_progress = { value = -10 name = divided_monarchists_legitimist_progress_bar } } } } } } # Used in IG scope fra_favor_leader_ig_dynasty = { if = { limit = { leader = { has_ideology = ideology:ideology_bonapartist } } owner = { custom_tooltip = { text = bonapartist_progress_increase_10_tt je:je_divided_monarchists = { add_progress = { value = 10 name = divided_monarchists_bonapartist_progress_bar } } } } } else_if = { limit = { leader = { has_ideology = ideology:ideology_orleanist } } owner = { custom_tooltip = { text = orleanist_progress_increase_10_tt je:je_divided_monarchists = { add_progress = { value = 10 name = divided_monarchists_orleanist_progress_bar } } } } } else_if = { limit = { leader = { has_ideology = ideology:ideology_legitimist } } owner = { custom_tooltip = { text = legitimist_progress_increase_10_tt je:je_divided_monarchists = { add_progress = { value = 10 name = divided_monarchists_legitimist_progress_bar } } } } } } # Country scope fra_favor_ruler_dynasty = { if = { limit = { ruler_is_bonapartist = yes } custom_tooltip = { text = bonapartist_progress_increase_10_tt je:je_divided_monarchists = { add_progress = { value = 10 name = divided_monarchists_bonapartist_progress_bar } } } } else_if = { limit = { ruler_is_orleanist = yes } custom_tooltip = { text = orleanist_progress_increase_10_tt je:je_divided_monarchists = { add_progress = { value = 10 name = divided_monarchists_orleanist_progress_bar } } } } else_if = { limit = { ruler_is_legitimist = yes } custom_tooltip = { text = legitimist_progress_increase_10_tt je:je_divided_monarchists = { add_progress = { value = 10 name = divided_monarchists_legitimist_progress_bar } } } } } # Country scope fra_disfavor_ruler_dynasty = { if = { limit = { ruler_is_bonapartist = yes } custom_tooltip = { text = bonapartist_progress_decrease_10_tt je:je_divided_monarchists = { add_progress = { value = -10 name = divided_monarchists_bonapartist_progress_bar } } } } else_if = { limit = { ruler_is_orleanist = yes } custom_tooltip = { text = orleanist_progress_decrease_10_tt je:je_divided_monarchists = { add_progress = { value = -10 name = divided_monarchists_orleanist_progress_bar } } } } else_if = { limit = { ruler_is_legitimist = yes } custom_tooltip = { text = legitimist_progress_decrease_10_tt je:je_divided_monarchists = { add_progress = { value = -10 name = divided_monarchists_legitimist_progress_bar } } } } } fra_handle_republic_monarch_assignment = { #Used specifically in the case of a Republican France that enacts monarchy, and is now determining its monarch. if = { limit = { #If the ruler is a Bonapartist, but is not a Bonapartist ruler - eg. a general with the Bonapartist ideology, the monarch is automatically set to the first available Bonaparte. ruler = { has_ideology = ideology:ideology_bonapartist } } if = { limit = { has_variable = orleanist_restoration_var #Misc. variable cleanup, just in case there's anything left in the way. } remove_variable = orleanist_restoration_var } if = { limit = { has_variable = legitimist_restoration_var } remove_variable = legitimist_restoration_var } if = { limit = { has_variable = supporting_orleanist_var } remove_variable = supporting_orleanist_var } if = { limit = { has_variable = supporting_legitimist_var } remove_variable = supporting_legitimist_var } set_variable = bonapartist_restoration_var #Bonapartist restoration activated, for the purpose of je_divided_monarchists and other things it tracks. if = { limit = { has_journal_entry = je_divided_monarchists } je:je_divided_monarchists = { add_progress = { value = 10 name = divided_monarchists_bonapartist_progress_bar } } } set_variable = supporting_bonapartist_var #For the character interaction. The player can change this with the buttons whenever they wish. hidden_effect = { generate_french_monarch = yes } #Standard generate_french_monarch effect. } else_if = { limit = { ruler = { has_ideology = ideology:ideology_orleanist } } if = { limit = { has_variable = legitimist_restoration_var } remove_variable = legitimist_restoration_var } if = { limit = { has_variable = bonapartist_restoration_var } remove_variable = bonapartist_restoration_var } if = { limit = { has_variable = supporting_bonapartist_var } remove_variable = supporting_bonapartist_var } if = { limit = { has_variable = supporting_legitimist_var } remove_variable = supporting_legitimist_var } set_variable = orleanist_restoration_var if = { limit = { has_journal_entry = je_divided_monarchists } je:je_divided_monarchists = { add_progress = { value = 10 name = divided_monarchists_orleanist_progress_bar } } } set_variable = supporting_orleanist_var hidden_effect = { generate_french_monarch = yes } } else_if = { limit = { ruler = { has_ideology = ideology:ideology_legitimist } } if = { limit = { has_variable = orleanist_restoration_var } remove_variable = orleanist_restoration_var } if = { limit = { has_variable = bonapartist_restoration_var } remove_variable = bonapartist_restoration_var } if = { limit = { has_variable = supporting_bonapartist_var } remove_variable = supporting_bonapartist_var } if = { limit = { has_variable = supporting_orleanist_var } remove_variable = supporting_orleanist_var } set_variable = legitimist_restoration_var if = { limit = { has_journal_entry = je_divided_monarchists } je:je_divided_monarchists = { add_progress = { value = 10 name = divided_monarchists_legitimist_progress_bar } } } set_variable = supporting_legitimist_var hidden_effect = { generate_french_monarch = yes } } else = { trigger_event = { id = french_pretenders.7 popup = yes } #If the ruler is neither a Bonapartist, Legitimist, or Orleanist claimant, then it fires this event, which allows either restoring a dynasty of your choice, or making the previous President King. The latter option will cancel out of Divided Monarchists, and add a bunch of radicals. } } ### Vargas calculate_populism_progress = { # From Laws set_variable = { name = populism_progress_from_laws value = 0 } # Cops set_variable = { name = temp_policing_var_contribution value = institution:institution_police.investment } if = { limit = { has_law = law_type:law_no_police } change_variable = { name = temp_policing_var_contribution add = 0.3 } } else_if = { limit = { has_law = law_type:law_local_police } change_variable = { name = temp_policing_var_contribution multiply = -0.1 } } else_if = { limit = { has_law = law_type:law_dedicated_police } change_variable = { name = temp_policing_var_contribution multiply = -0.3 } } else_if = { limit = { has_law = law_type:law_militarized_police } change_variable = { name = temp_policing_var_contribution multiply = -0.5 } } # Internal Affairs set_variable = { name = temp_ha_var_contribution value = institution:institution_home_affairs.investment } if = { limit = { has_law = law_type:law_no_home_affairs } change_variable = { name = temp_ha_var_contribution add = 0.3 } } else_if = { limit = { has_law = law_type:law_guaranteed_liberties } change_variable = { name = temp_ha_var_contribution multiply = -0.1 } } else_if = { limit = { has_law = law_type:law_national_guard } change_variable = { name = temp_ha_var_contribution multiply = -0.3 } } else_if = { limit = { has_law = law_type:law_secret_police } change_variable = { name = temp_ha_var_contribution multiply = -0.5 } } change_variable = { name = populism_progress_from_laws add = var:temp_policing_var_contribution } change_variable = { name = populism_progress_from_laws add = var:temp_ha_var_contribution } remove_variable = temp_policing_var_contribution remove_variable = temp_ha_var_contribution } set_populism_vars = { set_variable = { name = populism_progress_from_laws value = 0 } set_variable = { name = populism_progress_var_add value = 0 } } clear_populism_vars = { remove_variable = populism_progress_from_laws remove_variable = populism_progress_var_add } do_risorgimento_math = { set_variable = { name = italian_states_pop_total value = 0 } set_variable = { name = italian_states_radicals_total value = 0 } every_scope_state = { limit = { state_region = { OR = { is_homeland = cu:north_italian is_homeland = cu:south_italian } } } set_variable = { name = italian_state_pop_radicals value = this.turmoil } change_variable = { name = italian_state_pop_radicals multiply = this.state_population } ROOT = { change_variable = { name = italian_states_pop_total add = prev.state_population } change_variable = { name = italian_states_radicals_total add = prev.var:italian_state_pop_radicals } } } set_variable = { name = italian_states_radicals_total_bar value = var:italian_states_radicals_total } change_variable = { name = italian_states_radicals_total_bar divide = var:italian_states_pop_total } change_variable = { name = italian_states_radicals_total_bar multiply = 100 } } ### Communism calculate_communism_progress = { #From Poverty set_variable = { name = communism_progress_from_poverty value = 0 } every_scope_state = { limit = { is_incorporated = yes } set_variable = { name = temp_sol value = this.population_below_expected_sol } change_variable = { name = temp_sol multiply = this.state_population } change_variable = { name = temp_sol divide = root.total_population } change_variable = { name = temp_sol multiply = 10 } # This variable equals the percentage of pops in incorporated states below expected SoL times ten. If 25% of your pops in incorporated states are below expected SoL, this will equal 2.5. ROOT = { change_variable = { name = communism_progress_from_poverty add = prev.var:temp_sol } } } # From Laws set_variable = { name = communism_progress_from_laws value = 0 } # Cops set_variable = { name = temp_policing_var_contribution value = institution:institution_police.investment } if = { limit = { has_law = law_type:law_no_police } change_variable = { name = temp_policing_var_contribution add = 0.3 } } else_if = { limit = { has_law = law_type:law_local_police } change_variable = { name = temp_policing_var_contribution multiply = -0.1 } } else_if = { limit = { has_law = law_type:law_dedicated_police } change_variable = { name = temp_policing_var_contribution multiply = -0.3 } } else_if = { limit = { has_law = law_type:law_militarized_police } change_variable = { name = temp_policing_var_contribution multiply = -0.5 } } # Internal Affairs set_variable = { name = temp_ha_var_contribution value = institution:institution_home_affairs.investment } if = { limit = { has_law = law_type:law_no_home_affairs } change_variable = { name = temp_ha_var_contribution add = 0.3 } } else_if = { limit = { has_law = law_type:law_guaranteed_liberties } change_variable = { name = temp_ha_var_contribution multiply = -0.1 } } else_if = { limit = { has_law = law_type:law_national_guard } change_variable = { name = temp_ha_var_contribution multiply = -0.3 } } else_if = { limit = { has_law = law_type:law_secret_police } change_variable = { name = temp_ha_var_contribution multiply = -0.5 } } if = { limit = { has_variable = temp_policing_var_contribution } change_variable = { name = communism_progress_from_laws add = var:temp_policing_var_contribution } remove_variable = temp_policing_var_contribution } if = { limit = { has_variable = temp_ha_var_contribution } change_variable = { name = communism_progress_from_laws add = var:temp_ha_var_contribution } remove_variable = temp_ha_var_contribution } } set_communism_vars = { set_variable = { name = communism_progress_from_poverty value = 0 } set_variable = { name = communism_progress_from_laws value = 0 } set_variable = { name = communism_progress_var_add value = 0 } } clear_communism_vars = { remove_variable = communism_progress_from_poverty remove_variable = communism_progress_from_laws remove_variable = communism_progress_var_add } restore_peruvian_constitution = { # Made by Hansi # the Constitution of 1834 was largely a hotfix of the Constitution of 1828 and was also swept aside with the Peru-Bolivian Confederation if = { limit = { NOT = { has_law = law_type:law_presidential_republic } } activate_law = law_type:law_presidential_republic } if = { limit = { NOT = { has_law = law_type:law_state_religion } } activate_law = law_type:law_state_religion # Article 2 of the 1834 consitution: "[Peru's] Religion is Catholic, Apostolic, Roman, The Nation protects it by all means [...] and does not allow the exercise of any other." } if = { limit = { NOT = { has_law = law_type:law_census_voting } } activate_law = law_type:law_census_voting # Political rights for citizens had no land ownership requirement } if = { limit = { NOT = { has_law = law_type:law_racial_segregation } } activate_law = law_type:law_racial_segregation } if = { limit = { NOT = { has_law = law_type:law_mercantilism } } activate_law = law_type:law_mercantilism } if = { limit = { NOT = { has_law = law_type:law_interventionism } } activate_law = law_type:law_interventionism } if = { limit = { NOT = { has_law = law_type:law_right_of_assembly } } activate_law = law_type:law_right_of_assembly # Article 147 of the 1834 constitution: "Everyone can communicate their thoughts [...] or publish them through the printing press without prior censorship; but under the responsibility determined by law." } if = { limit = { NOR = { has_law = law_type:law_legacy_slavery has_law = law_type:law_slavery_banned } } activate_law = law_type:law_legacy_slavery # Slavery was legal, but the slave trade was restricted } if = { limit = { NOT = { has_law = law_type:law_per_capita_based_taxation } } activate_law = law_type:law_per_capita_based_taxation } } # National Identity calculate_national_identity_progress = { set_variable = { name = national_identity_progress_var_next value = 0 } set_variable = { name = national_identity_progress_from_igs value = 0 } # From Interest Groups every_interest_group = { limit = { OR = { has_ideology = ideology:ideology_patriotic has_ideology = ideology:ideology_liberal has_ideology = ideology:ideology_liberal_modern } } ROOT = { set_variable = { name = ig_weight value = prev.ig_clout } } if = { limit = { is_in_government = yes } ROOT = { change_variable = { name = ig_weight multiply = 3 } } } ROOT = { change_variable = { name = national_identity_progress_from_igs add = var:ig_weight } } } #Wars set_variable = { name = national_identity_progress_from_wars value = 0 } every_scope_war = { limit = { has_war_support = { target = root value > 50 } } ROOT = { change_variable = { name = national_identity_progress_from_wars add = 0.50 } } } every_scope_war = { limit = { has_war_support = { target = root value <= 50 } has_war_support = { target = root value > 25 } } ROOT = { change_variable = { name = national_identity_progress_from_wars add = 0.25 } } } every_scope_war = { limit = { has_war_support = { target = root value <= 25 } has_war_support = { target = root value > 0 } } ROOT = { change_variable = { name = national_identity_progress_from_wars add = 0.10 } } } #Buildings set_variable = { name = national_identity_progress_from_universities value = 0 } every_scope_building = { limit = { OR = { is_building_type = building_arts_academy is_building_type = building_university is_building_type = building_government_administration } occupancy >= 0.75 } ROOT = { change_variable = { name = national_identity_progress_from_universities add = prev.level } } } change_variable = { name = national_identity_progress_from_universities divide = 25 } set_variable = { name = national_identity_progress_from_prestige value = 0 } #Prestige ROOT = { change_variable = { name = national_identity_progress_from_prestige add = root.prestige } } change_variable = { name = national_identity_progress_from_prestige divide = 100 } set_variable = { name = national_identity_progress_from_homelands value = 0 } #Homelands every_scope_state = { limit = { NOT = { is_homeland_of_country_cultures = ROOT } } ROOT = { change_variable = { name = national_identity_progress_from_homelands subtract = 0.25 } } } change_variable = { name = national_identity_progress_var_next add = var:national_identity_progress_from_igs } change_variable = { name = national_identity_progress_var_next add = var:national_identity_progress_from_wars } change_variable = { name = national_identity_progress_var_next add = var:national_identity_progress_from_universities } change_variable = { name = national_identity_progress_var_next add = var:national_identity_progress_from_prestige } change_variable = { name = national_identity_progress_var_next add = var:national_identity_progress_from_homelands } change_variable = { name = national_identity_progress_var_next add = var:national_identity_progress_var_add } } add_national_identity_progress = { change_variable = { name = national_identity_progress_var add = var:national_identity_progress_var_next } clamp_variable = { name = national_identity_progress_var max = 100 min = 0 } } set_national_identity_vars = { set_variable = { name = national_identity_progress_from_igs value = 0 } set_variable = { name = national_identity_progress_from_wars value = 0 } set_variable = { name = national_identity_progress_from_universities value = 0 } set_variable = { name = national_identity_progress_from_prestige value = 0 } set_variable = { name = national_identity_progress_from_homelands value = 0 } set_variable = { name = national_identity_progress_var_add value = 0 } set_variable = { name = ig_weight value = 0 } } clear_national_identity_vars = { remove_variable = national_identity_progress_from_igs remove_variable = national_identity_progress_from_wars remove_variable = national_identity_progress_from_universities remove_variable = national_identity_progress_from_prestige remove_variable = national_identity_progress_from_homelands remove_variable = national_identity_progress_var_add } remove_pedropoint_effect = { custom_tooltip = { text = remove_pedropoint change_variable = { name = pedropoints add = -1 } } } add_pedropoint_effect = { custom_tooltip = { text = add_pedropoint change_variable = { name = pedropoints add = 1 } } } add_pedropoint_effect_3 = { custom_tooltip = { text = add_3_pedropoint change_variable = { name = pedropoints add = 3 } } } replicate_laws_from_root = { every_law = { limit = { ROOT = { has_law = PREV.type } PREV = { NOT = { has_law = PREV.type } } } PREV = { activate_law = PREV.type } } } replicate_laws_from_prev = { every_law = { limit = { PREV = { has_law = PREV.type } ROOT = { NOT = { has_law = PREV.type } } } ROOT = { activate_law = PREV.type } } } paris_commune_update_tick = { set_global_variable = { name = paris_commune_drift_final_var value = 0 } change_global_variable = { name = paris_commune_drift_final_var add = global_var:paris_commune_progress_drift } change_global_variable = { name = paris_commune_drift_final_var add = var:PRC_recognition_level } } capitulate_to_revolution = { scope:ongoing_revolution_movement = { #Can't trigger if they want governance reforms anyway. this.desired_law = { save_scope_as = revolutionaries_law } } every_interest_group = { limit = { is_insurrectionary = yes } set_variable = { name = revolutionary_ig days = 7 } } ordered_interest_group = { limit = { is_insurrectionary = yes } order_by = ig_clout save_scope_as = revolution_leader_ig } if = { # Never activate Governance Principles twice. limit = { NOR = { scope:revolutionaries_law = law_type:law_presidential_republic scope:revolutionaries_law = law_type:law_parliamentary_republic scope:revolutionaries_law = law_type:law_monarchy scope:revolutionaries_law = law_type:law_council_republic scope:revolutionaries_law = law_type:law_theocracy } } if = { limit = { scope:revolution_leader_ig = { law_stance = { law = law_type:law_council_republic value = strongly_approve } } NOT = { has_law = law_type:law_council_republic } } activate_law = law_type:law_council_republic } else_if = { limit = { scope:revolution_leader_ig = { law_stance = { law = law_type:law_monarchy value = strongly_approve } } NOT = { has_law = law_type:law_monarchy } } activate_law = law_type:law_monarchy } else_if = { limit = { scope:revolution_leader_ig = { law_stance = { law = law_type:law_parliamentary_republic value = strongly_approve } } NOT = { has_law = law_type:law_parliamentary_republic } } activate_law = law_type:law_parliamentary_republic } else_if = { limit = { scope:revolution_leader_ig = { law_stance = { law = law_type:law_presidential_republic value = strongly_approve } } NOT = { has_law = law_type:law_presidential_republic } } activate_law = law_type:law_presidential_republic } else_if = { limit = { scope:revolution_leader_ig = { law_stance = { law = law_type:law_theocracy value = strongly_approve } } NOT = { has_law = law_type:law_theocracy } } activate_law = law_type:law_theocracy } else_if = { limit = { scope:revolution_leader_ig = { law_stance = { law = law_type:law_council_republic value = approve } } NOT = { has_law = law_type:law_council_republic } } activate_law = law_type:law_council_republic } else_if = { limit = { scope:revolution_leader_ig = { law_stance = { law = law_type:law_monarchy value = approve } } NOT = { has_law = law_type:law_monarchy } } activate_law = law_type:law_monarchy } else_if = { limit = { scope:revolution_leader_ig = { law_stance = { law = law_type:law_parliamentary_republic value = approve } } NOT = { has_law = law_type:law_parliamentary_republic } } activate_law = law_type:law_parliamentary_republic } else_if = { limit = { scope:revolution_leader_ig = { law_stance = { law = law_type:law_presidential_republic value = approve } } NOT = { has_law = law_type:law_presidential_republic } } activate_law = law_type:law_presidential_republic } else_if = { limit = { scope:revolution_leader_ig = { law_stance = { law = law_type:law_theocracy value = approve } } NOT = { has_law = law_type:law_theocracy } } activate_law = law_type:law_theocracy } } if = { limit = { scope:ongoing_revolution_movement = { is_political_movement_type = movement_to_preserve } } cancel_enactment = yes } else = { activate_law = scope:revolutionaries_law } add_loyalists = { value = 0.25 } every_interest_group = { limit = { has_variable = revolutionary_ig } owner = { add_loyalists = { value = 0.8 interest_group = PREV } } } if = { limit = { country_has_voting_franchise = yes } call_election = { months = 6 } } if = { limit = { NOT = { has_law = law_type:law_monarchy } } hidden_effect = { scope:revolution_leader_ig = { leader = { set_character_as_ruler = yes } } } } every_interest_group = { limit = { is_in_government = yes } remove_ruling_interest_group = yes add_modifier = { name = modifier_revolution_defeated_light months = normal_modifier_time is_decaying = yes } } every_interest_group = { limit = { has_variable = revolutionary_ig } hidden_effect = { abandon_revolution = yes } add_modifier = { name = modifier_revolution_victorious_light months = normal_modifier_time is_decaying = yes } if = { limit = { is_insurrectionary = no } add_ruling_interest_group = yes } } } calculate_caudillo_progress = { set_variable = { name = caudillo_next value = 0 } if = { limit = { ig:ig_armed_forces = { is_powerful = yes } } change_variable = { name = caudillo_next add = 1 } } if = { limit = { ig:ig_armed_forces = { is_in_government = yes } } change_variable = { name = caudillo_next add = 1 } } if = { limit = { OR = { has_law = law_type:law_autocracy has_law = law_type:law_technocracy has_law = law_type:law_oligarchy has_law = law_type:law_single_party_state } } change_variable = { name = caudillo_next add = 1 } } if = { limit = { ig:ig_armed_forces = { is_marginal = yes } } change_variable = { name = caudillo_next add = -1 } } if = { limit = { ig:ig_armed_forces = { is_in_government = no } } change_variable = { name = caudillo_next add = -1 } } if = { limit = { any_scope_character = { OR = { has_role = general has_role = admiral } popularity >= 50 # Loved } } change_variable = { name = caudillo_next add = 1 } } if = { limit = { any_scope_character = { has_role = politician NOT = { has_role = general } popularity >= 50 # Loved interest_group = { is_powerful = yes AND = { law_stance = { law = law_type:law_autocracy value <= neutral } law_stance = { law = law_type:law_technocracy value >= neutral } law_stance = { law = law_type:law_oligarchy value >= neutral } law_stance = { law = law_type:law_single_party_state value >= neutral } } } } NOT = { any_scope_character = { has_role = general popularity >= 50 # Loved } } } change_variable = { name = caudillo_next add = -1 } } if = { limit = { any_scope_character = { is_ruler = yes has_ideology = ideology:ideology_authoritarian } } change_variable = { name = caudillo_next add = 1 } } if = { limit = { OR = { has_law = law_type:law_census_voting has_law = law_type:law_universal_suffrage } } change_variable = { name = caudillo_next add = -1 } } } chi_add_1_fragile_unity = { custom_tooltip = chi_add_1_fragile_unity_tt post_notification = warlord_china_explosion_point_add change_variable = { name = china_warlord_explosion add = 1 } } chi_remove_1_fragile_unity = { custom_tooltip = chi_remove_1_fragile_unity_tt post_notification = warlord_china_explosion_point_remove change_variable = { name = china_warlord_explosion subtract = 1 } } reset_afghan_treaty = { custom_tooltip = { text = reset_afghan_treaty_tt if = { limit = { has_variable = proposed_durand_line } remove_variable = proposed_durand_line } if = { limit = { has_variable = proposed_indus_line } remove_variable = proposed_indus_line } if = { limit = { has_variable = proposed_status_quo } remove_variable = proposed_status_quo } if = { limit = { has_variable = proposed_torkestan_line } remove_variable = proposed_torkestan_line } if = { limit = { has_variable = proposed_amu_darya_line } remove_variable = proposed_amu_darya_line } if = { limit = { has_variable = proposed_status_quo_north } remove_variable = proposed_status_quo_north } if = { limit = { has_variable = proposed_compensation_for_afghanistan } remove_variable = proposed_compensation_for_afghanistan } if = { limit = { has_variable = proposed_reprisals_for_afghanistan } remove_variable = proposed_reprisals_for_afghanistan } remove_variable = afghanistan_delimitation_treaty_approved } } handle_revolutionary_sps = { hidden_effect = { random_active_party = { disband_party = yes } scripted_effect_parties_disappearence = yes clear_legal_single_party = yes if = { limit = { ROOT = { ruler.interest_group = { has_party = yes } } } ROOT = { set_variable = { name = only_valid_party value = ruler.interest_group.party } } } else_if = { limit = { NOT = { any_active_party = { exists = this } } } root = { gen_ruler_party = yes } } } hidden_effect = { #Clears all currently active parties deactivate_parties = yes } update_party_support = yes #Reactivates precisely one legal party custom_tooltip = { text = sps_government_reshuffle_tt every_interest_group = { limit = { is_in_government = yes NOT = { #Removes all IGs from government that aren't in your party has_party = yes } } remove_ruling_interest_group = yes } every_interest_group = { limit = { #Adds all IGs that are in your party to the government is_in_government = no has_party = yes } add_ruling_interest_group = yes } } } great_game_britain_progress_10 = { custom_tooltip = { text = great_game_points_britain_increases_10_tt every_country = { limit = { has_journal_entry = je_great_game_control } je:je_great_game_control = { add_progress = { value = -10 name = great_game_core_progress_bar } } update_gg_progressbar_tooltips = yes } } } great_game_britain_progress_15 = { custom_tooltip = { text = great_game_points_britain_increases_15_tt every_country = { limit = { has_journal_entry = je_great_game_control } je:je_great_game_control = { add_progress = { value = -15 name = great_game_core_progress_bar } } update_gg_progressbar_tooltips = yes } } } great_game_britain_progress_25 = { custom_tooltip = { text = great_game_points_britain_increases_25_tt every_country = { limit = { has_journal_entry = je_great_game_control } je:je_great_game_control = { add_progress = { value = -25 name = great_game_core_progress_bar } } update_gg_progressbar_tooltips = yes } } } great_game_britain_progress_50 = { custom_tooltip = { text = great_game_points_britain_increases_50_tt every_country = { limit = { has_journal_entry = je_great_game_control } je:je_great_game_control = { add_progress = { value = -50 name = great_game_core_progress_bar } } update_gg_progressbar_tooltips = yes } } } great_game_russia_progress_10 = { custom_tooltip = { text = great_game_points_russia_increases_10_tt every_country = { limit = { has_journal_entry = je_great_game_control } je:je_great_game_control = { add_progress = { value = 10 name = great_game_core_progress_bar } } update_gg_progressbar_tooltips = yes } } } great_game_russia_progress_15 = { custom_tooltip = { text = great_game_points_russia_increases_15_tt every_country = { limit = { has_journal_entry = je_great_game_control } je:je_great_game_control = { add_progress = { value = 15 name = great_game_core_progress_bar } } update_gg_progressbar_tooltips = yes } } } great_game_russia_progress_25 = { custom_tooltip = { text = great_game_points_russia_increases_25_tt every_country = { limit = { has_journal_entry = je_great_game_control } je:je_great_game_control = { add_progress = { value = 25 name = great_game_core_progress_bar } } update_gg_progressbar_tooltips = yes } } } complete_great_game_effect = { set_global_variable = persia_conflict_started set_global_variable = afghanistan_conflict_started set_global_variable = korean_protectorate_started set_global_variable = central_asia_consolidation_happened set_global_variable = kazakhstan_revolt_happened set_global_variable = caucasian_war_happened random_list = { 50 = { set_global_variable = caucasus_consolidated_var } 50 = { set_global_variable = caucasus_failure_var } } random_list = { 50 = { set_global_variable = kazakhstan_victory_var } 50 = { set_global_variable = kazakhstan_defeat_var } } set_global_variable = khanates_russia_victory_var random_list = { 50 = { set_global_variable = korean_protectorate_success } 50 = { set_global_variable = korean_protectorate_failure } } random_list = { 50 = { set_global_variable = afghanistan_russia_victory_var } 50 = { set_global_variable = afghanistan_britain_victory_var } 50 = { set_global_variable = afghanistan_afghan_victory_var } } random_list = { 50 = { set_global_variable = persia_russia_victory_var } 50 = { set_global_variable = persia_britain_victory_var } 50 = { set_global_variable = persia_persian_victory_var } } set_global_variable = china_border_codified_variable set_global_variable = manchurian_railway_variable set_global_variable = trans_siberian_done set_global_variable = consolidated_british_india_variable set_global_variable = contained_russian_pacific_variable } generate_pro_lobby_diplomatic_pact_opportunity = { random_list = { 20 = { trigger = { can_create_diplomatic_pact = { target = scope:relevant_country type = trade_agreement } NOT = { has_diplomatic_pact = { who = scope:relevant_country type = trade_agreement } } } set_variable = pro_lobby_proposal_trade_agreement } 20 = { trigger = { can_create_diplomatic_pact = { target = scope:relevant_country type = defensive_pact } NOT = { has_diplomatic_pact = { who = scope:relevant_country type = defensive_pact } } } set_variable = pro_lobby_proposal_defensive_pact } 20 = { trigger = { can_create_diplomatic_pact = { target = scope:relevant_country type = alliance } NOT = { has_diplomatic_pact = { who = scope:relevant_country type = alliance } } } set_variable = pro_lobby_proposal_alliance } 20 = { trigger = { OR = { can_create_diplomatic_pact = { target = scope:relevant_country type = foreign_investment_agreement } can_create_diplomatic_pact = { target = scope:relevant_country type = foreign_investment_rights } } NOR = { has_diplomatic_pact = { who = scope:relevant_country type = foreign_investment_rights } has_diplomatic_pact = { who = scope:relevant_country type = foreign_investment_agreement } } } set_variable = pro_lobby_proposal_investment_agreement } 20 = { trigger = { scope:relevant_country = { is_power_bloc_leader = yes } can_create_diplomatic_pact = { target = scope:relevant_country type = join_power_bloc } NOT = { is_in_same_power_bloc = scope:relevant_country } } set_variable = pro_lobby_proposal_power_bloc } 20 = { trigger = { is_power_bloc_leader = yes can_create_diplomatic_pact = { target = scope:relevant_country type = invite_to_power_bloc } NOT = { is_in_same_power_bloc = scope:relevant_country } } set_variable = pro_lobby_proposal_power_bloc_invite } } } generate_pro_lobby_diplomatic_pact_proposal = { random_list = { 20 = { # Break an alliance trigger = { can_break_diplomatic_pact = { target = scope:third_party_country type = alliance } } set_variable = pro_lobby_proposal_break_alliance } 20 = { # Break a trade agreement trigger = { can_break_diplomatic_pact = { target = scope:third_party_country type = trade_agreement } } set_variable = pro_lobby_proposal_break_trade_agreement } 20 = { # Break a defensive pact trigger = { can_break_diplomatic_pact = { target = scope:third_party_country type = defensive_pact } } set_variable = pro_lobby_proposal_break_defensive_pact } 20 = { # Do a rivalry trigger = { can_create_diplomatic_pact = { target = scope:third_party_country type = rivalry } } set_variable = pro_lobby_proposal_rivalry } 20 = { # Do an embargo trigger = { can_create_diplomatic_pact = { target = scope:third_party_country type = embargo } } set_variable = pro_lobby_proposal_embargo } 20 = { # Do a war trigger = { pro_lobby_war_valid_check = yes } set_variable = pro_lobby_proposal_war } 20 = { # Leave Power Bloc trigger = { pro_lobby_leave_power_bloc_valid_check = yes } set_variable = pro_lobby_proposal_leave_power_bloc } } } generate_anti_lobby_diplomatic_pact_opportunity = { random_list = { 20 = { trigger = { can_create_diplomatic_pact = { target = scope:third_party_country type = trade_agreement } NOT = { has_diplomatic_pact = { who = scope:third_party_country type = trade_agreement } } } set_variable = anti_lobby_proposal_trade_agreement } 20 = { trigger = { can_create_diplomatic_pact = { target = scope:third_party_country type = defensive_pact } NOT = { has_diplomatic_pact = { who = scope:third_party_country type = defensive_pact } } } set_variable = anti_lobby_proposal_defensive_pact } 20 = { trigger = { can_create_diplomatic_pact = { target = scope:third_party_country type = alliance } NOT = { has_diplomatic_pact = { who = scope:third_party_country type = alliance } } } set_variable = anti_lobby_proposal_alliance } 20 = { trigger = { OR = { can_create_diplomatic_pact = { target = scope:relevant_country type = foreign_investment_agreement } can_create_diplomatic_pact = { target = scope:relevant_country type = foreign_investment_rights } } NOR = { has_diplomatic_pact = { who = scope:third_party_country type = foreign_investment_rights } has_diplomatic_pact = { who = scope:third_party_country type = foreign_investment_agreement } } } set_variable = anti_lobby_proposal_investment_agreement } 20 = { trigger = { scope:third_party_country = { is_power_bloc_leader = yes } can_create_diplomatic_pact = { target = scope:third_party_country type = join_power_bloc } NOT = { is_in_same_power_bloc = scope:third_party_country } } set_variable = anti_lobby_proposal_power_bloc } 20 = { trigger = { is_power_bloc_leader = yes can_create_diplomatic_pact = { target = scope:third_party_country type = invite_to_power_bloc } NOT = { is_in_same_power_bloc = scope:third_party_country } } set_variable = anti_lobby_proposal_power_bloc_invite } } } generate_anti_lobby_diplomatic_pact_proposal = { random_list = { 20 = { # Break an alliance trigger = { can_break_diplomatic_pact = { target = scope:relevant_country type = alliance } } set_variable = anti_lobby_proposal_break_alliance } 20 = { # Break a trade agreement trigger = { can_break_diplomatic_pact = { target = scope:relevant_country type = trade_agreement } } set_variable = anti_lobby_proposal_break_trade_agreement } 20 = { # Break a defensive pact trigger = { can_break_diplomatic_pact = { target = scope:relevant_country type = defensive_pact } } set_variable = anti_lobby_proposal_break_defensive_pact } 20 = { # Do a rivalry trigger = { can_create_diplomatic_pact = { target = scope:relevant_country type = rivalry } } set_variable = anti_lobby_proposal_rivalry } 20 = { # Do an embargo trigger = { can_create_diplomatic_pact = { target = scope:relevant_country type = embargo } } set_variable = anti_lobby_proposal_embargo } 20 = { # Do a war trigger = { anti_lobby_war_valid_check = yes } set_variable = anti_lobby_proposal_war } 20 = { # Leave Power Bloc trigger = { anti_lobby_leave_power_bloc_valid_check = yes } set_variable = anti_lobby_proposal_leave_power_bloc } } } clear_anti_lobby_vars = { remove_variable = anti_lobby_proposal_break_alliance remove_variable = anti_lobby_proposal_break_trade_agreement remove_variable = anti_lobby_proposal_break_defensive_pact remove_variable = anti_lobby_proposal_rivalry remove_variable = anti_lobby_proposal_embargo remove_variable = anti_lobby_proposal_war remove_variable = anti_lobby_proposal_leave_power_bloc remove_variable = anti_lobby_proposal_defensive_pact remove_variable = anti_lobby_proposal_alliance remove_variable = anti_lobby_proposal_trade_agreement remove_variable = anti_lobby_proposal_power_bloc remove_variable = anti_lobby_proposal_power_bloc_invite remove_variable = anti_lobby_proposal_investment_agreement remove_variable = anti_lobby_opportunity_target remove_variable = anti_lobby_demand_target } clear_pro_lobby_vars = { remove_variable = pro_lobby_proposal_defensive_pact remove_variable = pro_lobby_proposal_alliance remove_variable = pro_lobby_proposal_trade_agreement remove_variable = pro_lobby_proposal_power_bloc remove_variable = pro_lobby_proposal_power_bloc_invite remove_variable = pro_lobby_proposal_investment_agreement remove_variable = pro_lobby_proposal_break_alliance remove_variable = pro_lobby_proposal_break_trade_agreement remove_variable = pro_lobby_proposal_break_defensive_pact remove_variable = pro_lobby_proposal_rivalry remove_variable = pro_lobby_proposal_embargo remove_variable = pro_lobby_proposal_war remove_variable = pro_lobby_proposal_leave_power_bloc remove_variable = pro_lobby_demand_target remove_variable = pro_lobby_opportunity_target } update_gg_progressbar_tooltips = { je:je_great_game_control = { if = { limit = { "scripted_bar_progress(great_game_core_progress_bar)" < 0 } set_bar_progress = { value = 0 name = great_game_core_progress_bar } } if = { limit = { "scripted_bar_progress(great_game_core_progress_bar)" > 200 } set_bar_progress = { value = 200 name = great_game_core_progress_bar } } set_global_variable = { name = great_game_gbr_progress value = "scripted_bar_progress(great_game_core_progress_bar)" } set_global_variable = { name = great_game_rus_progress value = 200 } change_global_variable = { name = great_game_rus_progress subtract = global_var:great_game_gbr_progress } } } clear_great_game_variables = { remove_global_variable = great_game_gbr_progress remove_global_variable = great_game_rus_progress remove_global_variable = great_game_russian_economy_var remove_global_variable = great_game_british_economy_var remove_global_variable = great_game_economy_balance_var }