add_namespace = arg
country_event = { # Confederation wins
		id = arg.1
		title = arg.1.t
		desc = arg.1.d
		picture = GFX_report_event_usa_election_generic
		
		fire_only_once = yes
		is_triggered_only = yes
		
		trigger = {
			tag = ARG
			BUE = {
				OR={
					exists = no 
					is_subject_of = ARG
				}
			}
			NOT = { has_global_flag = BUE_won_arg_civwar }
		}
		
		option = {
			name = arg.1.b
			set_global_flag = ARG_won_arg_civwar
			remove_ideas = ARG_civil_war_war
			remove_ideas = ARG_raging_civil_war
			load_focus_tree = argentina_vic_ft
			hidden_effect = { 
				news_event = { id = arg.21 }
			509 = {
				remove_core_of = BUE
			}
			278 = {
				remove_core_of = BUE
			}
			1105 = { 
				remove_core_of = BUE
			}
			1058 = { 
				remove_core_of = BUE
			}
			1062 = { 
				remove_core_of = BUE
			}
			508 = { 
				remove_core_of = BUE
			}
			510 = { 
				remove_core_of = BUE
			}
			511 = { 
				remove_core_of = BUE
			}
			512 = {
				remove_claim_by = BUE
			}
			1098 = { 
				remove_core_of = BUE
			}
			1101 = { 
				remove_core_of = BUE
			}
			1102 = { 
				remove_core_of = BUE
			}
			1103 = { 
				remove_claim_by = BUE
			}
			1104 = { 
				remove_claim_by = BUE
			}
			1083 = { 
				remove_claim_by = BUE
			}
			1066 = { 
				remove_core_of = BUE
			}
		}
	}
}
country_event = { # BUE wins  #note player switsches tags and becomes ARG
		id = arg.2
		title = arg.2.t
		desc = arg.2.d
		picture = GFX_report_event_usa_election_generic
		
		fire_only_once = yes
		is_triggered_only = yes
		
		trigger = {
			tag = BUE
			ARG = { 
				OR={
					exists = no 
					is_subject_of = BUE
					surrender_progress > 0.75
				}
			}
			NOT = { has_global_flag = ARG_won_arg_civwar }
		}
		
		option = {
			name = arg.2.a
			set_global_flag = BUE_won_arg_civwar
			ai_chance = {
				factor = 100
			}
			remove_ideas = ARG_civil_war_war
			remove_ideas = ARG_raging_civil_war
				ARG = {
            		change_tag_from = ROOT
			    }
			ARG = {
				drop_cosmetic_tag = yes
				annex_country = {
					target = BUE
					transfer_troops = yes
				}
				hidden_effect = { 
					load_oob = ARG_END_CIVIL_WAR
					load_focus_tree = argentina_vic_ft
				}
				remove_ideas = ARG_civil_war_war
				remove_ideas = ARG_raging_civil_war
				remove_ideas = ARG_decentral_military_2
				remove_ideas = ARG_decentral_military_1
				remove_ideas = ARG_decentral_government
				inherit_technology = BUE
				set_capital = { state = 509 }
				BUE={
					BUE_Bartolome_Mitre = {
						add_corps_commander_role = {
						  skill = 1
						  attack_skill = 1
						  defense_skill = 1
						  planning_skill = 1
						  logistics_skill = 1
						}
						set_nationality = ARG
					}
				}
				BUE_Bartolome_Mitre={
					add_country_leader_role = {
						Promote_leader = yes
						Country_leader = {
							ideology = conserv_liberal
							expire = "1953.3.1"
						}
					}
					promote_character = {
						Ideology = conserv_liberal
					}
					remove_unit_leader_role = yes
				}
				retire_character = ARG_Justo_Jose_de_Urquiza
				set_politics = {
			      	ruling_party = centrism
				}

                set_popularities = {
                    centrism = 40
                    traditional_conservatism = 60
                }
				ARG_Angel_Vicente_Penaloza={
					add_unit_leader_trait = gone_rogue
				}
			}
			508={
				set_demilitarized_zone = yes
			}
			509 = {
				remove_core_of = BUE
			}
			278 = {
				remove_core_of = BUE
			}
			1105 = { 
				remove_core_of = BUE
			}
			1058 = { 
				remove_core_of = BUE
			}
			1062 = { 
				remove_core_of = BUE
			}
			508 = { 
				remove_core_of = BUE
			}
			510 = { 
				remove_core_of = BUE
			}
			511 = { 
				remove_core_of = BUE
			}
			512 = {
				remove_claim_by = BUE
			}
			1098 = { 
				remove_core_of = BUE
			}
			1101 = { 
				remove_core_of = BUE
			}
			1102 = { 
				remove_core_of = BUE
			}
			1103 = { 
				remove_claim_by = BUE
			}
			1104 = { 
				remove_claim_by = BUE
			}
			1083 = { 
				remove_claim_by = BUE
			}
			1066 = { 
				remove_core_of = BUE
			}
			hidden_effect = { news_event = { id = arg.21 } }
	}
}

country_event = { #Capital debate  #Confederation can keep capital or make buenos aires capital again
		id = arg.3
		title = arg.3.t
		desc = arg.3.d
		picture = GFX_report_event_usa_election_generic
		
		fire_only_once = yes
		is_triggered_only = yes
		
		trigger = {
			tag = ARG
			owns_state = 509
			509 = { is_capital = no }
		}
		
		option = { # Make Buenos Capital again
			name = arg.3.a
			set_capital = { state = 509 }
		}
		option = { # Dont change
			name = arg.3.b
			
		}
}
country_event = {
    id = arg.4
    title = arg.4.t
    desc = arg.4.d
    picture = GFX_report_event_usa_election_generic
    
    fire_only_once = yes
    is_triggered_only = yes
    
    option = {
        name = arg.4.a
        if = {
            limit = { NOT = { has_war_with = ARG } }
            declare_war_on = {
                target = ARG
                type = argentine_civil_war_wargoal
            }
        }
        swap_ideas = {
            remove_idea = ARG_raging_civil_war
            add_idea = ARG_civil_war_war
        }
        add_ideas = ARG_buenos_unitario_volunteers
        hidden_effect = { load_oob = BUE_army_rebels }
        hidden_effect = { news_event = { id = arg.22 } }
    }
}
country_event = { # Argentina demands land in patagonia
		id = arg.5
		title = arg.5.t
		desc = arg.5.d
		picture = GFX_report_event_usa_election_generic
		
		is_triggered_only = yes
		
		option = { # give them the land
			name = arg.5.a
			ai_chance = {
				factor = 40
				modifier = {
					factor = 100
					is_historical_focus_on = yes
				}
			}
			ARG = { transfer_state = 1098 }
			ARG = { transfer_state = 1100 }
			custom_effect_tooltip = historical_option
		}
		option = { # nuh uh this is our land
			name = arg.5.b
			ai_chance = {
				factor = 60
				modifier = {
					factor = 0
					is_historical_focus_on = yes
				}
			}
			ARG = { country_event = { id = arg.6 } }
		}
}
country_event = { # they refuse to give the land
		id = arg.6
		title = arg.6.t
		desc = arg.6.d
		picture = GFX_report_event_usa_election_generic
		
		is_triggered_only = yes
		
		option = { # war it is
			name = arg.6.a
			declare_war_on = {
				target = FROM
				type = take_core_state
			}
			ai_chance = {
				factor = 100
			}
		}
		option = { # they can keept it
			name = arg.6.b
			add_political_power = -100
		}
}
#Conquest of the Desert#
#Negotiation
country_event = { # Argentina wants to Negotiate
		id = arg.7
		title = arg.7.t
		desc = arg.7.d
		picture = GFX_report_event_usa_election_generic
		
		is_triggered_only = yes
		
		option = {
			name = arg.7.a #agree to negotiate
			ai_chance = {
				factor = 90
				modifier = {
					factor = 100
					is_historical_focus_on = yes
				}
			}
			ARG = { country_event = { id = arg.8 hours = 6 } }
		}
		option = {
			name = arg.7.b #no negotation of borders
			ai_chance = {
				factor = 10
				modifier = {
					factor = 0
					is_historical_focus_on = yes
				}
			}
			ARG = { country_event = { id = arg.15 } }
		}
}
#Immediate Southern Territories
country_event = {
		id = arg.8
		title = arg.8.t
		desc = arg.8.d
		picture = GFX_report_event_usa_election_generic
		
		is_triggered_only = yes
		
		option = {
			name = arg.8.a #Modern Borders
			ai_chance = {
				factor = 75
				modifier = {
					factor = 100
					is_historical_focus_on = yes
				}
			}
			CHL = { country_event = { id = arg.9 } }
			custom_effect_tooltip = historical_option
		}
		option = {
			name = arg.8.b #Argentina gets most
			ai_chance = {
				factor = 15
				modifier = {
					factor = 0
					is_historical_focus_on = yes
				}
			}
			CHL = { country_event = { id = arg.9 } }
			CHL = { set_country_flag = Negotiate_Argentina_All }
		}
		option = {
			name = arg.8.c #Chile gets most
			ai_chance = {
				factor = 10
				modifier = {
					factor = 0
					is_historical_focus_on = yes
				}
			}
			CHL = { country_event = { id = arg.9 } }
			CHL = { set_country_flag = Negotiate_Chile_All }
			add_stability = -0.1
		}
}
#Chile Responds
country_event = {
		id = arg.9
		title = arg.9.t
		desc = {
			text = arg.9.d_normal
			trigger = {
				NOT = {
					has_country_flag = Negotiate_Chile_All
					has_country_flag = Negotiate_Argentina_All
				}
			}
		}
		desc = {
			text = arg.9.d_chile
			trigger = {
				has_country_flag = Negotiate_Chile_All
			}
		}
		desc = {
			text = arg.9.d_arg
			trigger = {
				has_country_flag = Negotiate_Arg_All
			}
		}
		picture = GFX_report_event_usa_election_generic
		
		is_triggered_only = yes
		
		option = {
			name = arg.9.a
			ai_chance = {
				factor = 75
				modifier = {
					factor = 100
					is_historical_focus_on = yes
				}
			}
			trigger = {
				NOT = {
					has_country_flag = Negotiate_Chile_All
					has_country_flag = Negotiate_Argentina_All
				}
			}
			ARG = {
				set_country_flag = Conquest_Negotiation_Normal_Accept
				country_event = { id = arg.10 }
			}
		}
		option = {
			name = arg.9.b
			ai_chance = {
				factor = 25
				modifier = {
					factor = 0
					is_historical_focus_on = yes
				}
			}
			ARG = {
				set_country_flag = Conquest_Negotiation_Normal_Decline
				country_event = { id = arg.10 }
			}
		}
		option = {
			name = arg.9.c
			trigger = {
				has_country_flag = Negotiate_Argentina_All
			}
			ai_chance = {
				factor = 25
			}
			ARG = {
				set_country_flag = Conquest_Negotiation_ArgAll_Accept
				country_event = { id = arg.10 }
			}
		}
		option = {
			name = arg.9.e
			trigger = {
				has_country_flag = Negotiate_Chile_All
			}
			ai_chance = {
				factor = 100
			}
			ARG = {
				set_country_flag = Conquest_Negotiation_ChileAll_Accept
				country_event = { id = arg.10 }
			}
		}
}
#Argentina gets response
country_event = {
		id = arg.10
		title = arg.10.t
		desc = {
			text = arg.10.d_normal
			trigger = {
				has_country_flag = Conquest_Negotiation_Normal_Accept
			}
		}
		desc = {
			text = arg.10.d_decline
			trigger = {
				has_country_flag = Conquest_Negotiation_Normal_Decline
			}
		}
		desc = {
			text = arg.10.d_arg
			trigger = {
				has_country_flag = Conquest_Negotiation_Normal_ArgAll
			}
		}
		desc = {
			text = arg.10.d_chile
			trigger = {
				has_country_flag = Conquest_Negotiation_Normal_ChileAll
			}
		}
		picture = GFX_report_event_usa_election_generic
		
		is_triggered_only = yes
		
		option = {
			name = arg.10.a
			trigger = {
				has_country_flag = Conquest_Negotiation_Normal_Accept
			}
			CHL = {
				remove_state_claim = 1103
				remove_state_claim = 1089
				remove_state_claim = 507
				add_state_core = 1089
				add_state_core = 1090
				add_state_core = 507
			}
			ARG = {
				remove_state_claim = 1103
				remove_state_claim = 1104
				add_state_core = 1103
				add_state_core = 1104
				add_state_core = 1105
				add_state_core = 512
			}
			clr_country_flag = Conquest_Negotiation_Normal_Accept
			hidden_effect = { country_event = { id = arg.11 hours = 6 } }
		}
		option = {
			name = arg.10.b
			trigger = {
				has_country_flag = Conquest_Negotiation_Normal_Decline
			}
			CHL = {
				remove_state_claim = 1089
				remove_state_claim = 507
				add_state_core = 1089
				add_state_core = 1090
				add_state_core = 507
				add_state_claim = 1104
				add_state_claim = 512
			}
			ARG = {
				add_state_core = 1103
				add_state_core = 1104
				add_state_core = 1105
				add_state_core = 512
				add_state_claim = 1089
				add_state_claim = 1090
				add_state_claim = 507
			}
			clr_country_flag = Conquest_Negotiation_Normal_Decline
			hidden_effect = { country_event = { id = arg.11 hours = 6 } }
		}
		option = {
			name = arg.10.c
			trigger = {
				has_country_flag = Conquest_Negotiation_ArgAll_Accept
			}
			CHL = {
				remove_state_claim = 1103
				remove_state_claim = 1089
				remove_state_claim = 507
			}
			ARG = {
				remove_state_claim = 1103
				remove_state_claim = 1104
				transfer_state = 1090
				add_state_core = 1089
				add_state_core = 1090
				add_state_core = 507
				add_state_core = 1103
				add_state_core = 1104
				add_state_core = 1105
				add_state_core = 512
			}
			clr_country_flag = Conquest_Negotiation_ArgAll_Accept
			hidden_effect = { country_event = { id = arg.11 hours = 6 } }
		}
		option = {
			name = arg.10.e
			trigger = {
				has_country_flag = Conquest_Negotiation_ChileAll_Accept
			}
			CHL = {
				remove_state_claim = 1103
				remove_state_claim = 1089
				remove_state_claim = 507
				add_state_core = 1089
				add_state_core = 1090
				add_state_core = 507
				add_state_core = 1103
				add_state_core = 1104
				add_state_core = 512
			}
			ARG = {
				remove_state_claim = 1103
				remove_state_claim = 1104
				add_state_core = 1105
			}
			clr_country_flag = Conquest_Negotiation_ArgAll_Accept
			hidden_effect = { country_event = { id = arg.11 hours = 6 } }
		}
}
#Southern Tip
country_event = {
		id = arg.11
		title = arg.11.t
		desc = arg.11.d
		picture = GFX_report_event_usa_election_generic
		
		is_triggered_only = yes
		
		option = {
			name = arg.11.a #Split Island
			ai_chance = {
				factor = 75
				modifier = {
					factor = 100
					is_historical_focus_on = yes
				}
			}
			CHL = { country_event = { id = arg.12 } }
		}
		option = {
			name = arg.11.b #Argentina gets most
			ai_chance = {
				factor = 15
				modifier = {
					factor = 0
					is_historical_focus_on = yes
				}
			}
			CHL = {
				set_country_flag = Conquest_Negotiation_Island_Arg
				country_event = { id = arg.12 }
			}
		}
		option = {
			name = arg.11.c #Chile gets most
			ai_chance = {
				factor = 10
				modifier = {
					factor = 0
					is_historical_focus_on = yes
				}
			}
			CHL = {
				set_country_flag = Conquest_Negotiation_Island_Chile
				country_event = { id = arg.12 }
			}
		}
}
#Chile Responds Southern Tip
country_event = {
		id = arg.12
		title = arg.12.t
		desc = arg.12.d
		picture = GFX_report_event_usa_election_generic
		
		is_triggered_only = yes
		
		option = {
			name = arg.12.a
			trigger = {
				NOT = {
					has_country_flag = Conquest_Negotiation_Island_Chile
					has_country_flag = Conquest_Negotiation_Island_Arg
				}
			}
			ai_chance = {
				factor = 75
				modifier = {
					factor = 100
					is_historical_focus_on = yes
				}
			}
			ARG = {
				set_country_flag = Conquest_Negotiation_Island_Accept
				country_event = { id = arg.13 }
			}
		}
		option = {
			name = arg.12.b
			ai_chance = {
				factor = 25
				modifier = {
					factor = 0
					is_historical_focus_on = yes
				}
			}
			ARG = {
				set_country_flag = Conquest_Negotiation_Island_Decline
				country_event = { id = arg.13 }
			}
		}
		option = {
			name = arg.12.c
			trigger = {
				has_country_flag = Negotiate_Argentina_All
			}
			ai_chance = {
				factor = 25
			}
			ARG = {
				set_country_flag = Conquest_Negotiation_Island_Arg_Accept
				country_event = { id = arg.13 }
			}
		}
		option = {
			name = arg.12.e
			trigger = {
				has_country_flag = Negotiate_Chile_All
			}
			ai_chance = {
				factor = 100
			}
			ARG = {
				set_country_flag = Conquest_Negotiation_Island_Chile_Accept
				country_event = { id = arg.13 }
			}
		}
}
#Argentina gets response
country_event = {
		id = arg.13
		title = arg.13.t
		desc = arg.13.d
		picture = GFX_report_event_usa_election_generic
		
		is_triggered_only = yes
		
		option = {
			name = arg.13.a
			trigger = {
				has_country_flag = Conquest_Negotiation_Island_Accept
			}
			CHL = {
				add_state_core = 1084
				remove_state_claim = 1083
			}
			ARG = {
				add_state_core = 1083
			}
			country_event = { id = arg.14 hours = 6 }
		}
		option = {
			name = arg.13.b
			trigger = {
				has_country_flag = Conquest_Negotiation_Island_Arg_Accept
			}
			ARG = {
				add_state_core = 1084
				add_state_core = 5201
			}
			clr_country_flag = Conquest_Negotiation_Island_Arg
			country_event = { id = arg.14 hours = 6 }
		}
		option = {
			name = arg.13.c
			trigger = {
				has_country_flag = Conquest_Negotiation_Island_Chile_Accept
			}
			CHL = {
				add_state_core = 1084
				add_state_core = 5201
			}
			clr_country_flag = Conquest_Negotiation_ArgAll_Accept
			country_event = { id = arg.14 hours = 6 }
		}
		option = {
			name = arg.13.e
			trigger = {
				has_country_flag = Conquest_Negotiation_Island_Decline
			}
			CHL = {
				add_state_core = 1084
				add_state_claim = 1083
			}
			ARG = {
				add_state_core = 1083
				add_state_claim = 1084
			}
			country_event = { id = arg.14 hours = 6 }
		}
}
#Negotiations have Finished
country_event = {
		id = arg.14
		title = arg.14.t
		desc = arg.14.d_negotiate
		picture = GFX_report_event_usa_election_generic
		
		is_triggered_only = yes
		
		option = {
			name = arg.14.a #agree to negotiate
			set_country_flag = Conquest_of_Desert_Negotiation
		}
}
#Chile refuses negotiation
country_event = {
		id = arg.15
		title = arg.15.t
		desc = arg.15.d
		picture = GFX_report_event_usa_election_generic
		
		is_triggered_only = yes
		
		option = {
			name = arg.15.a
			set_country_flag = Conquest_of_Desert_No_Negotiation
		}
}
#ENG- BUE asks for support
country_event = {
		id = arg.16
		title = arg.16.t
		desc = arg.16.d
		picture = GFX_report_event_usa_election_generic
		
		is_triggered_only = yes
		
		option = {#give them support
			name = arg.16.a
			send_equipment = {
				equipment = infantry_equipment
				amount = 300
				target = BUE
			}
			send_equipment = {
				equipment = uniform_equipment
				amount = 300
				target = BUE
			}
			BUE={country_event = {id = arg.17 days=7}}
		}
		option = {#ignore them
			name = arg.16.b
			BUE={country_event = {id = arg.18 days=7}}
		}
}
#BUE- ENG accepts
country_event = {
		id = arg.17
		title = arg.17.t
		desc = arg.17.d
		picture = GFX_report_event_usa_election_generic
		
		is_triggered_only = yes
		
		option = {#great
			name = arg.17.a
			add_political_power = 50
			set_country_flag = ENG_support
		}
}
#BUE- ENG Rejects
country_event = {
		id = arg.18
		title = arg.18.t
		desc = arg.18.d
		picture = GFX_report_event_usa_election_generic
		
		is_triggered_only = yes
		
		option = {#ok
			name = arg.18.a
			add_political_power = -50
		}
}
#BUE- 1858 election
country_event = {
		id = arg.19
		title = arg.19.t
		desc = arg.19.d
		picture = GFX_report_event_usa_election_generic
		
		is_triggered_only = yes
		
		option = {#ok
			name = arg.19.a
			
		}
}

#ARG- Invasion of La Rioja
country_event = {
		id = arg.20
		title = arg.20.t
		desc = arg.20.d
		picture = GFX_report_event_usa_election_generic
		
		is_triggered_only = yes
		
		option = {#ok
			name = arg.20.a
			ARG_Angel_Vicente_Penaloza={
				retire = yes
			}
			add_stability = 0.1
			508={
				set_demilitarized_zone = no
			}
		}
}

#argentine civil war over
news_event = {
		id = arg.21
		title = arg.21.t
		desc = {
			text = arg.21.d
			trigger = { has_global_flag = BUE_won_arg_civwar }
		}
		desc = {
			text = arg.21.d_confed
			trigger = { has_global_flag = ARG_won_arg_civwar }
		}

		picture = GFX_news_event_argentinian_civil_war

		major = yes

		is_triggered_only = yes

		option = {
			name = arg.21.a
			trigger = {
				NOT = { tag = ARG }
			}
		}
		option = {
			name = arg.21.b
			trigger = {
				tag = ARG
			}
		}
}
#argentine civil war started
news_event = {
    id = arg.22
    title = arg.22.t
    desc = arg.22.d
    picture = GFX_news_event_argentinian_civil_war
    major = yes
    is_triggered_only = yes
    
    option = {
        name = arg.22.a
        trigger = {
            NOT = { 
                OR = {
                    tag = ARG
                    tag = BUE
                }
            }
        }
    }
    
    option = {
        name = arg.22.b
        trigger = {
            OR = {
                tag = ARG
                tag = BUE
            }
        }
    }
}
