add_namespace = brazil
add_namespace = brazil.amazon_colonization
add_namespace = brazil.foreign

country_event = {
	id = brazil.1
	title = brazil.1.t
	desc = brazil.1.d
	picture = GFX_report_event_british_parliament
	is_triggered_only = yes
	
	option = {
		name = brazil.1.a
		add_political_power = -200
		activate_advisor = BRA_francisco_pereira_jugde
		activate_advisor = BRA_viscount_of_maranguape_foreign
		activate_advisor = BRA_viscount_of_sousa_franco_finance
		activate_advisor = BRA_jeronimo_coelho_army_chief
		activate_advisor = BRA_jose_antonio_saraiva_navy_chief
		set_country_flag = brazil_conciliatory
		hidden_effect = { 
			country_event = { id = brazil.204 days = 1 }
			complete_national_focus = BRA_1857_conciliatory_cabinet
		}
	}
	
	option = {
		name = brazil.1.b
		add_political_power = 50
		BRA = { country_event = brazil.2 }
	}
}

country_event = {
	id = brazil.2
	title = brazil.2.t
	desc = brazil.2.d
	picture = GFX_gfx_report_event_general_post_office
	is_triggered_only = yes
	
	option = { #  Empire
		name = brazil.2.a
		add_political_power = -50
	}
}


country_event = {
	id = brazil.3
	title = brazil.3.t
	desc = brazil.3.d
	picture = GFX_report_event_nap_france_tuilleries

	is_triggered_only = yes

	option = {
		name = brazil.3.a
		BRA = { add_timed_idea = {	idea = BRA_franco_brazilian_economic_treaty	days = 100 } }
	}
	option = {
		name = brazil.3.b
		add_political_power = 50
		BRA = { country_event = brazil.4 }
	}
}

country_event = {
	id = brazil.4
	title = brazil.4.t
	desc = brazil.4.d
	picture = GFX_report_event_nap_france_switzerland

	is_triggered_only = yes

	option = { #  Empire
		name = brazil.4.a
		add_political_power = -50
	}
}

news_event = {
	id = brazil.14
	title = brazil.14.t
	desc = brazil.14.d
	picture = GFX_news_event_brazil_ambition

	major = yes
	is_triggered_only = yes

	option = { #  Empire
		name = brazil.14.a
		trigger = { original_tag = BRA }
		add_political_power = 10
	}
	option = { #  Empire
		name = brazil.14.b
		trigger = { NOT = { original_tag = BRA } }
	}
 }

country_event = {
	id = brazil.15
	title = brazil.15.t
	desc = brazil.15.d
	picture = gfx_report_event_sepoy2
	is_triggered_only = yes
	
	option = { #  Empire
		name = brazil.15.a
	}
}

country_event = {
	id = brazil.16
	title = brazil.16.t
	desc = brazil.16.d
	picture = gfx_report_event_sepoy2

	is_triggered_only = yes

	option = { #  Empire
		name = brazil.16.a
	}
 }


 country_event = {
	id = brazil.17
	title = brazil.17.t
	desc = brazil.17.d
	picture = gfx_report_event_sepoy2

	is_triggered_only = yes

	option = { #  Empire
		name = brazil.17.a
	}
 }

country_event = {
	id = brazil.19
	title = brazil.19.t
	desc = brazil.19.d
	picture = gfx_report_event_sepoy2

	is_triggered_only = yes

	option = {
		name = brazil.19.a
		trigger = {	original_tag = FRA	}
		BRA = { transfer_state = 310 }
	}

	option = {
		name = brazil.19.b
		trigger = {	original_tag = FRA	}
		BRA = { country_event = brazil.20 }
	}
 }

country_event = {
	id = brazil.20
	title = brazil.20.t
	desc = brazil.20.d
	is_triggered_only = yes

	option = { #  Empire
		name = brazil.20.a
		create_wargoal = {
			type = take_claimed_state
			target = FRA
		}
		hidden_effect = {
			set_country_flag = BRA_guyana_war_1857
			FRA = { set_country_flag = BRA_guyana_war_1857 }
		}
	}
 }

country_event = {
	id = brazil.21
	title = brazil.21.t
	desc = brazil.21.d
	fire_only_once = yes
	is_triggered_only = yes

	trigger = {
		AND = {
			has_country_flag = BRA_guyana_war_1857
			tag = BRA
			controls_state = 310
		}
	}

	option = { #  Empire
		name = brazil.21.a
		310 = { set_state_name = "Caiena" }
		set_province_name = {
			id = 12885
			name = "Caiena"
		}
		white_peace	 =  FRA
		transfer_state = 310
		hidden_effect = {
			FRA = { clr_country_flag = BRA_guyana_war_1857 }
			BRA = { clr_country_flag = BRA_guyana_war_1857 }
		}
	}
 }

country_event = {
	id = brazil.22
	title = brazil.22.t
	desc = brazil.22.d

	fire_only_once = yes
	is_triggered_only = yes
	
	trigger = {
		AND = {
			has_country_flag = BRA_guyana_war_1857
			tag = FRA
			controls_state = 1323
		}
	}

	option = { #  Empire
		name = brazil.22.a
		1323 = { set_state_name = "French Para" }
		white_peace = BRA
		transfer_state = 1323
		hidden_effect = {
			FRA = { clr_country_flag = BRA_guyana_war_1857 }
			BRA = { clr_country_flag = BRA_guyana_war_1857 }
		}
	}
}

country_event = {
	id = brazil.24
	title = brazil.24.t
	desc = brazil.24.d

	is_triggered_only = yes

	option = { #  Empire
		name = brazil.24.a
			add_political_power = 35
			add_popularity = {
				ideology = social_egalitarianism
				popularity = 0.05
			}
			add_war_support = 0.05
		}
 }

country_event = {
    id = brazil.25
    title = brazil.25.t
    desc = {
        trigger = { BRA = { has_completed_focus = BRA_direct_intervention } }
        text = brazil.25.d
    }
    desc = {
        trigger = { BRA = { has_completed_focus = BRA_the_second_cisplatine_war } }
        text = brazil.25.d_b
    }
    picture = GFX_report_event_amazonas
    is_triggered_only = yes

    # Empire historical
    option = {
        name = brazil.25.a
        trigger = { 
            original_tag = BRA 
            NOT = { has_completed_focus = BRA_the_second_cisplatine_war }
        }
        BRA = {
            add_political_power = 35
            load_oob = "BRA_volunteers2"
            add_equipment_to_stockpile = {
                type = cavalry_equipment
                amount = 1000
                producer = BRA
            }
        }
        declare_war_on = {
            target = URG
            type = annex_everything
        }
    }

    option = {#Empire traditionalist
        name = brazil.25.a2
        trigger = {
            original_tag = BRA
            has_completed_focus = BRA_the_second_cisplatine_war
        }
        add_political_power = 35
        add_manpower = -18000
        
        # Create URC first if it doesn't exist
        if = {
            limit = { NOT = { country_exists = URC } }
            URG = {
                URC = {
                    transfer_state = 1094
                    inherit_technology = URG
                    load_oob = "URC_1857-alt"
                    every_state = {
                        limit = {
                            is_core_of = URG
                        }
                        add_core_of = URC
                    }
                }
            }
        }
        
        # Now declare wars after ensuring URC exists
        declare_war_on = {
            target = URG
            type = annex_everything
        }
        declare_war_on = {
            target = URC
            type = annex_everything
        }
    }

    ##  Uruguay conflict starts 
    option = { 
        name = brazil.25.b
        trigger = { 
            original_tag = URG 
            BRA = { NOT = { has_completed_focus = BRA_the_second_cisplatine_war } }
        }
        add_political_power = -25
        add_stability = -0.5
        remove_ideas = { URG_colorado_blanco_war }
        URC = { ## add BRA desire volunters
            transfer_state = 1097
            transfer_state = 1094
            load_oob = "URC_1857"
            inherit_technology = URG
            every_state = {
                limit = {
                    is_core_of = URG
                }
                add_core_of = URC
            }
        }
        declare_war_on = {
            target = URC
            type = civil_war
        }
        add_civil_war_target = URC
    }

    option = {
        trigger = {
            original_tag = URG
            BRA = { has_completed_focus = BRA_the_second_cisplatine_war }
        }
        remove_ideas = { URG_colorado_blanco_war }
        URC = {
            transfer_state = 1094
            inherit_technology = URG
            load_oob = "URC_1857-alt"
            every_state = {
                limit = {
                    is_core_of = URG
                }
                add_core_of = URC
            }
        }
        URG = {
            declare_war_on = {
                target = URC
                type = civil_war
            }
            add_civil_war_target = URC
        }
    }

    option = { #  everyone else
        name = brazil.25.c
        trigger = {
            NOT = { original_tag = URG }
            NOT = { original_tag = BRA }
            NOT = { original_tag = ARG }
        }
    }

    option = { #  Argentinan assistance
        name = brazil.25.d1
        trigger = { original_tag = ARG }
        add_manpower = -2000
        URC = { add_manpower = 2000 }
    }

    option = {
        name = brazil.25.d2
        trigger = {
            original_tag = ARG
            BRA = { has_completed_focus = BRA_the_second_cisplatine_war }
        }
        ARG = {
            add_manpower = -2000
        }
        URC = {
            add_manpower = 2000
            load_oob = "URC_army_rebels"
            add_equipment_to_stockpile = {
                type = infantry_equipment
                amount = 1000
                producer = ARG
            }
        }
    }
}

country_event = {
	id = brazil.27
	title = brazil.27.t
	desc = brazil.27.d
	picture = GFX_report_event_obras_publicas
	is_triggered_only = yes

	option = {
		name = brazil.27.a
		add_political_power = 10
		1044 = {
			add_building_construction = {
				type = cotton_farm
				level = 1
				instant_build = yes
			}
		}
	}

	option = {
		name = brazil.27.b
		add_political_power = -20
		1044 = {
			add_building_construction = {
				type = industrial_complex
				level = 1
				instant_build = yes
			}
		}
	}
}

country_event = {
	id = brazil.28
	title = brazil.28.t
	desc = brazil.28.d
	picture = GFX_report_event_caixa_corte

	is_triggered_only = yes

	option = {
		name = brazil.28.a
		add_political_power = 15
		set_country_flag = bra_create_caixa
	}
}


country_event = {
	id = brazil.29
	title = brazil.29.t
	desc = brazil.29.d
	is_triggered_only = yes

	option = {
		name = brazil.29.a
		add_political_power = 5
	}
}

country_event = {
	id = brazil.30
	title = brazil.30.t
	desc = brazil.30.d
	
	is_triggered_only = yes

	option = {
		name = brazil.30.a
		add_political_power = -5
	}
}

	country_event = {
		id = brazil.31
		title = brazil.31.t
		desc = brazil.31.d

		picture = GFX_report_event_hms_prince_wales

		fire_only_once = yes

		trigger = {  
			AND = {
				tag = BRA
				date > 1861.4.4
				NOT = {
					has_country_flag = BRA_christie_crisis1
				}
			}
		}  

		option = {
			name = brazil.31.a
				trigger = {
					tag = BRA
				}
			add_political_power = -5
			remove_ideas = BRA_golden_prosperity
			hidden_effect = {
				BRA = {
					set_country_flag = BRA_christie_crisis1
				}
			}
		}
	}

	country_event = {
		id = brazil.32
		title = brazil.32.t
		desc = brazil.32.d

		fire_only_once = yes

		picture = GFX_report_event_nap_france_legislative_elections


		trigger = {
			tag = BRA
			has_country_flag = BRA_christie_crisis1
			date > 1861.7.10
		}


		option = {
			name = brazil.32.a

			add_political_power = 5
			hidden_effect = {
				ENG = {
					set_country_flag = ENG_christie_crisis1
				}
			}
		}


	}

	country_event = {
		id = brazil.33
		title = brazil.33.t
		desc = brazil.33.d

		fire_only_once = yes

		picture = GFX_news_event_brasiliana


		trigger = {
			tag = ENG
			has_country_flag = ENG_christie_crisis1
			date > 1857.6.10
		}


		option = {
			name = brazil.33.a

			add_political_power = 3
			hidden_effect = {
				ENG = {
					set_country_flag = ENG_christie_crisis1
				}
			}
		}


	}

	country_event = {
		id = brazil.34
		title = brazil.34.t
		desc = brazil.34.d

		fire_only_once = yes

		picture = GFX_report_event_forte


		trigger = {
			tag = BRA
			tag = ENG
			date > 1862.7.17
		}


		option = {
			name = brazil.34.a
				trigger = {
					original_tag = BRA
				}
			add_political_power = 5
			hidden_effect = {
				BRA = {
					set_country_flag = BRA_christie_crisis2
				}
			}
		}

		option = {
			name = brazil.34.b
				trigger = {
					original_tag = ENG
				}

			add_political_power = -5
		}

	}



	country_event = {
		id = brazil.35
		title = brazil.35.t
		desc = brazil.35.d

		fire_only_once = yes


		trigger = {
			tag = BRA
			has_country_flag = BRA_christie_crisis2
			date > 1862.7.19
		}


		option = {
			name = brazil.35.a
				trigger = {
					original_tag = BRA
				}
			add_political_power = 5
			hidden_effect = {
				ENG = {
					set_country_flag = ENG_christie_crisis2
				}
			}
		}


	}

	country_event = {
		id = brazil.36
		title = brazil.36.t
		desc = brazil.36.d

		fire_only_once = yes

		picture = GFX_report_event_forte

		trigger = {
			tag = ENG
			has_country_flag = ENG_christie_crisis2
			date > 1862.8.19
		}


		option = {
			name = brazil.36.a

			add_political_power = -2
			add_war_support = 0.01
			hidden_effect = {
				BRA = {
					set_country_flag = BRA_christie_crisis3
				}
			}
			ai_chance = {
				factor = 80
			}
		}

		option = {
			name = brazil.36.b

			add_political_power = 2
			hidden_effect = {
				BRA = {
					set_country_flag = BRA_christie_crisis4
				}
			}
			ai_chance = {
				factor = 20
			}
		}


	}

	country_event = {
		id = brazil.37
		title = brazil.37.t
		desc = brazil.37.d

		fire_only_once = yes

		picture = GFX_report_event_forte

		trigger = {
			tag = BRA
			has_country_flag = BRA_christie_crisis3
			date > 1862.9.19
		}


		option = {
			name = brazil.37.a

			add_war_support = 0.05
			add_ideas = BRA_christie_question
			hidden_effect = {
				ENG = {
					set_country_flag = ENG_christie_crisis3
				}
			}
		}
	}

	country_event = {
		id = brazil.38
		title = brazil.38.t
		desc = brazil.38.d

		fire_only_once = yes

		trigger = {
			tag = BRA
			has_country_flag = BRA_christie_crisis4
			date > 1862.9.19
		}


		option = {
			name = brazil.38.a

			add_political_power = 10
			add_stability = 0.01
			remove_ideas = BRA_christie_question

		}
	}

	country_event = {
		id = brazil.39
		title = brazil.39.t
		desc = brazil.39.d

		fire_only_once = yes

		picture = GFX_report_event_royal_petropolis

		trigger = {
			tag = ENG
			has_country_flag = ENG_christie_crisis3
			date > 1862.10.19
		}

		option = {
			name = brazil.39.a

			add_political_power = -10
			add_war_support = 0.01

			hidden_effect = {
				BRA = {
					set_country_flag = BRA_christie_crisis5
				}
			}

		}


	}

	country_event = {
		id = brazil.40
		title = brazil.40.t
		desc = brazil.40.d

		fire_only_once = yes

		picture = GFX_report_event_royal_blockade

		trigger = {
			tag = BRA
			has_country_flag = BRA_christie_crisis5
			date > 1862.11.3
		}


		option = {
			name = brazil.40.a

			add_war_support = 0.025
			add_stability = -0.02
			BRA = {
				add_opinion_modifier = {
					target = ENG
					modifier = protest_action
				}
			}


			hidden_effect = {
				ENG = {
					set_country_flag = ENG_christie_crisis4
				}
			}
			ai_chance = {
				factor = 90
			}
		}

		option = {
			name = brazil.40.b

			add_political_power = -5
			remove_ideas = BRA_christie_question
			add_timed_idea = {
				idea = BRA_reparations_being_paid
				days = 100
			}

			hidden_effect = {
				ENG = {
					set_country_flag = ENG_christie_crisis5
				}
			}
			ai_chance = {
				factor = 10
			}

		}


	}

	country_event = {
		id = brazil.41
		title = brazil.41.t
		desc = brazil.41.d

		fire_only_once = yes

		picture = GFX_report_event_royal_blockade

		trigger = {
			tag = BRA
			has_country_flag = BRA_christie_crisis5
			date > 1863.5.25
		}


		option = {
			name = brazil.41.a

			add_stability = 0.015
			add_political_power = 10

			news_event = brazil_news.1

			hidden_effect = {
				BRA = {
					set_country_flag = BRA_christie_question1
				}
			}

			ai_chance = {
				factor = 90
			}
		}

		option = {
			name = brazil.41.b

			add_political_power = -50
			add_war_support = 0.02

			declare_war_on = {
				target = BRA
				type = puppet_wargoal_focus
			}

			news_event = brazil_news.2

			hidden_effect = {
				ENG = {
					set_country_flag = ENG_christie_war
				}
				BRA = {
					set_country_flag = BRA_christie_war
					remove_ideas = BRA_christie_question
				}
			}

			ai_chance = {
				factor = 10
			}

		}


	}

	country_event = {
		id = brazil.42
		title = brazil.42.t
		desc = brazil.42.d

		fire_only_once = yes

		picture = GFX_report_event_forte

		trigger = {
			tag = BRA
			has_country_flag = BRA_christie_question1
			date > 1863.6.2
		}


		option = {
			name = brazil.42.a

			add_political_power = 15

			hidden_effect = {
				ENG = {
					set_country_flag = ENG_christie_question1
				}
			}
		}


	}

	country_event = {
		id = brazil.43
		title = brazil.43.t
		desc = brazil.43.d

		fire_only_once = yes

		picture = GFX_report_event_forte

		trigger = {
			tag = ENG
			has_country_flag = ENG_christie_question1
			date > 1863.6.10
		}


		option = {
			name = brazil.43.a

			add_political_power = 5

			hidden_effect = {
				BEL = {
					set_country_flag = BEL_christie_question1
				}
			}
		}


	}

	country_event = {
		id = brazil.44
		title = brazil.44.t
		desc = brazil.44.d

		fire_only_once = yes

		picture = GFX_report_event_belgian_parliament

		trigger = {
			tag = BEL
			has_country_flag = BEL_christie_question1
			date > 1863.6.18
		}


		option = {
			name = brazil.44.a

			add_political_power = 20

			BRA = {
				add_opinion_modifier = {
					target = BEL
					modifier = offered_support
				}
				country_event = brazil.45
			}

			ENG = {
				add_opinion_modifier = {
					target = BEL
					modifier = protest_action_light
				}
				country_event = brazil.45
			}


		}

		option = {
			name = brazil.44.b

			add_political_power = 5

			ENG = {
				add_opinion_modifier = {
					target = BEL
					modifier = offered_support
				}
				country_event = brazil.46
			}

			BRA = {
				add_opinion_modifier = {
					target = BEL
					modifier = protest_action_light
				}
				country_event = brazil.46
			}


		}

	}

	country_event = {
		id = brazil.45
		title = brazil.45.t
		desc = brazil.45.d

		is_triggered_only = yes

		picture = GFX_report_event_belgian_parliament

		option = {
			name = brazil.45.a

			trigger = {
				original_tag = ENG
			}

			add_political_power = -10

			hidden_effect = {
				BRA = {
				set_country_flag = BRA_christie_question2
				}
			}


		}

		option = {
			name = brazil.45.b

			trigger = {
				original_tag = BRA
			}

			add_political_power = 10

			remove_ideas = BRA_christie_question
		}

	}

	country_event = {
		id = brazil.46
		title = brazil.46.t
		desc = brazil.46.d

		is_triggered_only = yes

		picture = GFX_report_event_belgian_parliament

		option = {
			name = brazil.46.a

			trigger = {
				original_tag = ENG
			}

			add_political_power = 10

			hidden_effect = {
				BRA = {
				set_country_flag = BRA_christie_question3
				}
			}


		}

		option = {
			name = brazil.46.b

			trigger = {
				original_tag = BRA
			}

			add_political_power = -10

			remove_ideas = BRA_christie_question
		}

	}

	country_event = {
		id = brazil.47
		title = brazil.47.t
		desc = brazil.47.d

		fire_only_once = yes

		trigger = {
			tag = BRA
			has_country_flag = BRA_christie_question2
			date > 1864.2.1
		}

		option = {
			name = brazil.47.a

			trigger = {
				original_tag = ENG
			}

			add_political_power = 5

			hidden_effect = {
				ENG = {
				set_country_flag = ENG_christie_question2
				}
			}
		}

	}

	country_event = {
		id = brazil.48
		title = brazil.48.t
		desc = brazil.48.d

		fire_only_once = yes

		trigger = {
			tag = BRA
			has_country_flag = BRA_christie_question3
			date > 1864.2.1
		}

		option = {
			name = brazil.48.a

			add_political_power = 5

			hidden_effect = {
				ENG = {
				set_country_flag = ENG_christie_question3
				}
			}
		}

	}

	country_event = {
		id = brazil.49
		title = brazil.49.t
		desc = brazil.49.d

		fire_only_once = yes

		picture = GFX_report_event_british_parliament

		trigger = {
			tag = ENG
			has_country_flag = ENG_christie_question2
			date > 1864.10.1
		}

		option = {
			name = brazil.49.a

			add_political_power = 5

			hidden_effect = {
				BRA = {
					set_country_flag = BRA_christie_question4
				}
			}
		}

	}

	country_event = {
		id = brazil.50
		title = brazil.50.t
		desc = brazil.50.d

		fire_only_once = yes

		picture = GFX_report_event_praieira

		trigger = {
			tag = ENG
			has_country_flag = ENG_christie_question3
			date > 1864.10.1
		}

		option = {
			name = brazil.50.a

			add_political_power = 5

			hidden_effect = {
				BRA = {
				set_country_flag = BRA_christie_question5
				}
			}
		}

	}

	country_event = {
		id = brazil.51
		title = brazil.51.t
		desc = brazil.51.d

		fire_only_once = yes

		picture = GFX_report_event_praieira

		trigger = {
			tag = BRA
			has_country_flag = BRA_christie_question4
			date > 1865.4.30
		}

		option = {
			name = brazil.51.a


			add_political_power = 10

			add_stability = 0.025

			add_timed_idea = {
				idea = BRA_small_reparations
				days = 50
			}

			ENG = {
				add_opinion_modifier = {
					target = BRA
					modifier = offered_support
				}
			}

			hidden_effect = {
				ENG = {
				set_country_flag = ENG_christie_question4
				}
			}
		}

	}

	country_event = {
		id = brazil.52
		title = brazil.52.t
		desc = brazil.52.d

		fire_only_once = yes

		picture = GFX_report_event_praieira

		trigger = {
			tag = BRA
			has_country_flag = BRA_christie_question5
			date > 1865.4.30
		}

		option = {
			name = brazil.52.a

			ENG = {
				add_opinion_modifier = {
					target = BRA
					modifier = offered_support
				}
			}

			add_political_power = -10

			add_stability = 0.01

			add_timed_idea = {
				idea = BRA_small_reparations
				days = 80
			}
		}

	}

	country_event = {
		id = brazil.53
		title = brazil.53.t
		desc = brazil.53.d

		fire_only_once = yes

		picture = GFX_report_event_british_parliament

		trigger = {
			tag = ENG
			has_country_flag = ENG_christie_question4
			date > 1865.8.20
		}

		option = {
			name = brazil.53.a

			add_political_power = -5
			add_stability = 0.015

			hidden_effect = {
				BRA = {
					set_country_flag = BRA_christie_question6
				}

		}

	}
	}

	country_event = {
		id = brazil.54
		title = brazil.54.t
		desc = brazil.54.d

		fire_only_once = yes

		picture = GFX_report_event_victorian_cross

		trigger = {
			tag = BRA
			has_country_flag = BRA_christie_question6
			date > 1865.9.23
		}

		option = {
			name = brazil.54.a

			add_stability = 0.015

			BRA = {
				add_opinion_modifier = {
					target = ENG
					modifier = offered_support
				}
			}

		}

	}

	country_event = {
		id = brazil.55
		title = brazil.55.t
		desc = brazil.55.d

		fire_only_once = yes

		trigger = {
			tag = BRA
			has_country_flag = BRA_christie_war
		}


		mean_time_to_happen = {
			days = 90
		}


		option = {
			name = brazil.55.a

		}

	}

	country_event = {
		id = brazil.56
		title = brazil.56.t
		desc = brazil.56.d

		fire_only_once = yes

		trigger = {
			AND = {
				tag = BRA
				has_country_flag = BRA_christie_war
				controls_state = 687
				controls_state = 703
				controls_state = 704
			}
		}

		hidden = yes


		mean_time_to_happen = {
			days = 1
		}


		option = {
			name = brazil.56.a
			687 = {
				set_demilitarized_zone = yes
			}
			news_event = brazil_news.3
			white_peace	 =  ENG
			white_peace = BCO
			white_peace	 =  KIN
		}

	}

	country_event = {
		id = brazil.57
		title = brazil.57.t
		desc = brazil.57.d

		fire_only_once = yes

		trigger = {
			AND  = {
				tag = ENG
				has_country_flag = ENG_christie_war
				BRA = {
					surrender_progress > 0.24
				}
			}
		}

		hidden = yes
		
		mean_time_to_happen = {
			days = 2
		}


		option = {
			name = brazil.57.a
			BRA = {
				white_peace	 =  ENG
				white_peace = BCO
				white_peace	 =  KIN
			}
			news_event = brazil_news.4
		}

	}

	country_event = {
		id = brazil.58
		title = brazil.58.t
		desc = brazil.58.d

		fire_only_once = yes

		trigger = {
			tag = ENG
			687 = {
				is_demilitarized_zone = yes
			}
		}

		hidden = yes


		mean_time_to_happen = {
			days = 700
		}


		option = {
			name = brazil.58.a
			687 = {
				set_demilitarized_zone = no
			}
		}

	}

	country_event = {
		id = brazil.59
		title = brazil.59.t
		desc = brazil.59.d
		picture = GFX_news_event_brasiliana
		fire_only_once = yes
		is_triggered_only = yes
		trigger = {
			tag = BRA
			#date > 1867.3.27
			NOT = {
				has_war_with = BOL
			}
		}
		option = {
			name = brazil.59.a
			BOL = { country_event = bolivia.6 }
			add_equipment_to_stockpile = {
				type = cavalry_equipment
				amount = -1
			}
		}
		option = {
			name = brazil.59.b
			hidden_effect = {
				BOL = {
					add_opinion_modifier = {
						target = BRA
						modifier = protest_action_strong
					}
				}
				PAR = { country_event = { id = par.19 days = 10 } }
			}
		}
	}

	country_event = {
		id = brazil.60
		title = brazil.60.t
		desc = brazil.60.d

		fire_only_once = yes
		is_triggered_only = yes

		trigger = {
			tag = BRA
			#date > 1870.7.12
			OR = {
				has_idea = BRA_post_war_complications
				has_idea = BRA_chaotic_outcome
			}
		}

		option = {
			name = brazil.60.a
			add_political_power = 15
		}

		option = {
			name = brazil.60.b
			add_stability = 0.01
			add_manpower = 10000
			add_political_power = -20
		}

	}

	country_event = {
		id = brazil.61
		title = brazil.61.t
		desc = brazil.61.d

		picture = GFX_report_event_a_republica

		fire_only_once = yes
		is_triggered_only = yes

		trigger = {
			tag = BRA
			#date > 1870.12.3
		}

		option = {
			name = brazil.61.a
			add_political_power = 15
			add_popularity = {
				ideology = centrism
				popularity = 0.05
			}
			add_popularity = {
				ideology = traditional_conservatism
				popularity = 0.05
			}
		}

	}


	country_event = {
		id = brazil.62
		title = brazil.62.t
		desc = brazil.62.d

		picture = GFX_report_event_o_guarany

		fire_only_once = yes
		is_triggered_only = yes

		trigger = {
			tag = BRA
			#date > 1857.06.01
		}

		option = { #  Empire
			name = brazil.62.a
			trigger = {
				original_tag = BRA
			}
			add_political_power = 50
		}
	}

# Hidden event to 'age' Pedro after 1870
country_event = {
	id = brazil.63

	trigger = {
		tag = BRA
		has_country_leader = {
			character = BRA_Pedro_II
			ruling_only = yes
		}
		date > 1870.1.1
	}

	mean_time_to_happen = {
		days = 2
	}

	fire_only_once = yes

	hidden = yes

	immediate = {
		hidden_effect = {
			BRA_Pedro_II = {
				add_corps_commander_role = {
					  skill = 4
					  attack_skill = 2
					  defense_skill = 3
					  planning_skill = 3
					  logistics_skill = 5
					}
				set_leader_portrait = "GFX_Portrait_BRA_Pedro_II"
				remove_unit_leader_role = yes
			}
		}
	}
}

country_event = {
	id = brazil.65
	title = brazil.65.t
	desc = brazil.65.d
	is_triggered_only = yes
	option = {
		name = brazil.65.a
		BRA = { set_country_flag = brazil_papelist }
		ai_chance = {
			base = 1
			modifier = {
				is_historical_focus_on = yes
				factor = 100
			}
		}
	}
	option = {
		name = brazil.65.b
		BRA = { set_country_flag = brazil_metalist }
		ai_chance = {
			base = 1
			modifier = {
				is_historical_focus_on = yes
				factor = 0
			}
		}
	}
}

country_event = {
	id = brazil.66
	title = brazil.66.t
	desc = brazil.66.d
	picture = GFX_report_event_ibicaba_farm_2
	is_triggered_only = yes
	option = {
		name = brazil.66.a
		BRA = { complete_national_focus = BRA_ignore_ibicaba_revolt	}
	}
	option = {
		name = brazil.66.b
		BRA = { complete_national_focus = BRA_accept_demands_ibicaba_revolt	}
	}
}

country_event = {
	id = brazil.67
	title = brazil.67.t
	desc = brazil.67.d
	picture = GFX_report_event_ibicaba_immigrant_workers
	is_triggered_only = yes
	option = {
		name = brazil.67.a
		BRA = { complete_national_focus = BRA_good_relations_with_europeans	}
	}
}

country_event = {
	id = brazil.68
	title = brazil.68.t
	desc = brazil.68.d
	picture = GFX_report_event_ibicaba_immigrant_workers_2
	is_triggered_only = yes
	option = {
		name = brazil.68.a
		BRA = { complete_national_focus = BRA_bad_relations_with_europeans }
	}
}

country_event = {
	id = brazil.69
	title = brazil.69.t
	desc = brazil.69.d
	picture = GFX_report_event_generic_parliament
	is_triggered_only = yes
	option = {
		name = brazil.69.a
		add_political_power = 50
	}
}

country_event = {
	id = brazil.70
	title = brazil.70.t
	desc = brazil.70.d
	picture = GFX_report_event_brazilian_imperial_flag
	is_triggered_only = yes
	option = {
		name = brazil.70.a
		country_event = { id = brazil.71 }
	}
}

country_event = {
	id = brazil.71
	title = brazil.71.t
	desc = brazil.71.d
	picture = GFX_report_event_pedro_II_adult
	is_triggered_only = yes
	option = {
		name = brazil.71.a
	}
}

############################# Brazil Foreign Events ##########################

country_event = {
	id = brazil.300
	title = brazil.300.t
	desc = brazil.300.d
	picture = GFX_report_event_generic_sign_treaty1
	is_triggered_only = yes
	option = {
		name = brazil.300.a
		add_opinion_modifier = { target = URG modifier = BRA_trade_treaty }
		URG = {
			add_opinion_modifier = { target = BRA modifier = BRA_trade_treaty }
			country_event = { id = brazil.301 }
		}
	}
}

country_event = {
	id = brazil.301
	title = brazil.301.t
	desc = brazil.301.d
	picture = GFX_report_event_generic_sign_treaty1
	is_triggered_only = yes
	option = {
		name = brazil.301.a
	}
}

country_event = {
	id = brazil.302
	title = brazil.302.t
	desc = brazil.302.d
	picture = GFX_report_event_generic_sign_treaty2
	is_triggered_only = yes
	option = {
		name = brazil.302.a
		add_opinion_modifier = { 
			target = OTO
			modifier = BRA_trade_treaty
		}
		add_opinion_modifier = { 
			target = OTO
			modifier = BRA_friendship_treaty
		}
		OTO = {
			country_event = { id = brazil.303 }
			add_opinion_modifier = { 
				target = BRA
				modifier = BRA_trade_treaty
			}
			add_opinion_modifier = { 
				target = BRA
				modifier = BRA_friendship_treaty
			}
		}
	}
}

country_event = {
	id = brazil.303
	title = brazil.303.t
	desc = brazil.303.d
	picture = GFX_report_event_generic_sign_treaty2
	is_triggered_only = yes
	option = {
		name = brazil.303.a
	}
}

country_event = {
	id = brazil.304
	title = brazil.304.t
	desc = brazil.304.d
	picture = GFX_report_event_generic_sign_treaty2
	is_triggered_only = yes
	option = {
		name = brazil.304.a
		add_opinion_modifier = { 
			target = PAR
			modifier = BRA_trade_treaty
		}
		add_opinion_modifier = { 
			target = PAR
			modifier = BRA_friendship_treaty
		}
		PAR = {
			country_event = { id = brazil.305 }
			add_opinion_modifier = {
				target = BRA
				modifier = BRA_trade_treaty
			}
			add_opinion_modifier = { 
				target = BRA
				modifier = BRA_friendship_treaty
			}
			add_opinion_modifier = {
				target = BRA
				modifier = BRA_boundary_treaty
			}
		}
		BRA = {
			country_event = { id = brazil.305 days = 0}
		}
	}
	option = {
		trigger = {
			tag = PAR
		}

		ai_chance = {
			base = 0
			modifier = {
				is_historical_focus_on = no
				add = 50
			}
		}

		name = brazil.304.b
		BRA = {
			country_event = { id = brazil.318 days = 0}
		}
	}
}

country_event = {
	id = brazil.305
	title = brazil.305.t
	desc = brazil.305.d
	picture = GFX_report_event_generic_sign_treaty1
	is_triggered_only = yes
	option = {
		name = brazil.305.a
	}
}

country_event = {
	id = brazil.306
	title = brazil.306.t
	desc = brazil.306.d
	picture = GFX_report_event_generic_sign_treaty2
	is_triggered_only = yes
	option = {
		name = brazil.306.a
		add_opinion_modifier = { 
			target = ARG
			modifier = BRA_trade_treaty
		}
		add_opinion_modifier = { 
			target = ARG
			modifier = BRA_friendship_treaty
		}
		ARG = {
			country_event = { id = brazil.305 }
			add_opinion_modifier = { 
				target = BRA
				modifier = BRA_trade_treaty
			}
			add_opinion_modifier = { 
				target = BRA
				modifier = BRA_friendship_treaty
			}
			add_opinion_modifier = {
				target = BRA
				modifier = BRA_boundary_treaty
			}
		}
		BRA = {
			country_event = { id = brazil.307 days = 0}
		}
	}
	option = {
		trigger = {
			tag = ARG
		}
		ai_chance = {
			base = 0
			modifier = {
				is_historical_focus_on = no
				add = 50
			}
		}

		name = brazil.306.b
		BRA = {
			country_event = { id = brazil.317 days = 0}
		}
	}
}

country_event = {
	id = brazil.307
	title = brazil.307.t
	desc = brazil.307.d
	picture = GFX_report_event_generic_sign_treaty2
	is_triggered_only = yes
	option = {
		name = brazil.307.a
	}
}

country_event = {
	id = brazil.308
	title = brazil.308.t
	desc = brazil.308.d
	picture = GFX_report_event_generic_sign_treaty1
	is_triggered_only = yes
	option = {
		name = brazil.308.a
		add_opinion_modifier = {
			target = ENG
			modifier = eoanb_minor_opinion_boost
		}
		ENG = {
			country_event = { id = brazil.309 }
			add_opinion_modifier = {
				target = BRA
				modifier = eoanb_minor_opinion_boost
			}
		}
	}
}

country_event = {
	id = brazil.309
	title = brazil.309.t
	desc = brazil.309.d
	picture = GFX_report_event_generic_sign_treaty1
	is_triggered_only = yes
	option = {
		name = brazil.309.a
	}
}

country_event = {
	id = brazil.310
	title = brazil.310.t
	desc = brazil.310.d
	fire_only_once = yes
	is_triggered_only = yes
	option = {
		name = brazil.310.a
		add_opinion_modifier = {
			target = ENG
			modifier = BRA_accepts_ENG_currency
		}
		ENG = {
			add_opinion_modifier = {
				target = BRA
				modifier = BRA_accepts_ENG_currency
			}
			country_event = { id = brazil.311 }
		}
	}
}

country_event = {
	id = brazil.311
	title = brazil.311.t
	desc = brazil.311.d
	is_triggered_only = yes
	fire_only_once = yes
	option = {
		name = brazil.311.a
	}
}

country_event = {
	id = brazil.312
	title = brazil.312.t
	desc = brazil.312.d
	picture = GFX_report_event_generic_sign_treaty1
	is_triggered_only = yes
	option = {
		name = brazil.312.a
		URG = { country_event = { id = brazil.313 } }
	}
}

country_event = {
	id = brazil.313
	title = brazil.313.t
	desc = brazil.313.d
	picture = GFX_report_event_generic_sign_treaty1
	is_triggered_only = yes
	option = {
		name = brazil.313.a
		ai_chance = { base = 25 }
		set_country_flag = brazil_big_investments
		add_opinion_modifier = {
			target = BRA
			modifier = URG_accepts_BRA_investment
		}
		add_ideas = URG_brazilian_investors_1
		country_event = { id = brazil.314 days = 90 }
		BRA = {
			country_event = { id = brazil.315 }
			add_opinion_modifier = {
				target = URG
				modifier = URG_accepts_BRA_investment
			}
		}
	}
	option = {
		name = brazil.313.b
		ai_chance = { base = 25 }
		set_country_flag = brazil_small_investments
		add_opinion_modifier = {
			target = BRA
			modifier = URG_accepts_BRA_investment
		}
		add_ideas = URG_brazilian_investors_2
		country_event = { id = brazil.314 days = 90 }
		BRA = {
			country_event = { id = brazil.315}
			add_opinion_modifier = {
				target = URG
				modifier = URG_accepts_BRA_investment
			}
		}
	}
	option = {
		name = brazil.313.c
		ai_chance = { base = 25 }
		set_country_flag = brazil_commerce_investments
		add_opinion_modifier = {
			target = BRA
			modifier = URG_accepts_BRA_investment
		}
		BRA =  {
			add_opinion_modifier = {
				target = URG
				modifier = URG_accepts_BRA_investment
			}
			country_event = { id = brazil.315 } 
		}
	}
	option = {
		name = brazil.313.e
		ai_chance = { base = 25 }
		BRA = { country_event = { id = brazil.315 } }
	}
}

country_event = {
	id = brazil.314
	title = brazil.314.t
	desc = brazil.314.d
	picture = GFX_report_event_generic_sign_treaty2
	is_triggered_only = yes
	option = {
		name = brazil.314.a
		ai_chance = { base = 100 }
		if = {
			limit = {
				set_temp_variable = { loan_size_to_check = 10 }
				has_less_than_specific_loan_size = no
				has_country_flag = brazil_big_investments
			}
			 
			every_owned_state={
				limit = { is_in_home_area = yes }
				add_extra_state_shared_building_slots = 1

		 		add_building_construction = {
					type = farm
					level = 1
					instant_build = yes
				}
				add_resource = {
					type = cotton
					amount = 2
				}
				add_resource = {
					type = fabric
					amount = 1
				}
			}
			hidden_effect = { clr_country_flag = brazil_big_investments }
		}
		else_if = {
			limit = {
				NOT = {	
					set_temp_variable = { loan_size_to_check = 10 }
					has_less_than_specific_loan_size = no	
				}
				has_country_flag = brazil_big_investments
			}
			every_owned_state={
				limit = { is_in_home_area = yes }
				add_extra_state_shared_building_slots = 1

		 		add_building_construction = {
					type = farm
					level = 1
					instant_build = yes
				}
				add_resource = {
					type = cotton
					amount = 2
				}
				add_resource = {
					type = fabric
					amount = 1
				}
			}
			hidden_effect = {
				clr_country_flag = brazil_big_investments
				add_ideas = URG_maua_trade_routes
			}
		}
		else_if = {
			limit = {
				set_temp_variable = { loan_size_to_check = 10 }
				has_less_than_specific_loan_size = no
				has_country_flag = brazil_small_investments
			}
			every_owned_state={
				limit = { is_in_home_area = yes }

				add_extra_state_shared_building_slots = 1
			}
			hidden_effect = { clr_country_flag = brazil_small_investments }
		}
		else_if = {
			limit = {
				NOT = { 
					set_temp_variable = { loan_size_to_check = 10 }
					has_less_than_specific_loan_size = no
				}
				has_country_flag = brazil_small_investments
			}
			every_owned_state={
				limit = { is_in_home_area = yes }

				add_extra_state_shared_building_slots = 1
			}
			hidden_effect = { clr_country_flag = brazil_small_investments }
		}
	}
}

country_event = {
	id = brazil.315
	title = brazil.315.t
	desc = brazil.315.d
	picture = GFX_report_event_generic_sign_treaty2
	is_triggered_only = yes
	option = {
		name = brazil.315.a
		trigger = { URG = { has_country_flag = brazil_big_investments } }
	}
	option = {
		name = brazil.315.b
		trigger = { URG = { has_country_flag = brazil_small_investments } }
	}
	option = {
		name = brazil.315.c
		trigger = { URG = { has_country_flag = brazil_commerce_investments } }
	}
	option = {
		name = brazil.315.e
		trigger = { 
			NOT = {
				URG = { has_country_flag = brazil_big_investments }
				URG = { has_country_flag = brazil_small_investments }
				URG = { has_country_flag = brazil_commerce_investments }
			}
		}
	}
}

country_event = {
	id = brazil.316
	title = brazil.316.t
	desc = brazil.316.d
	picture = GFX_report_event_generic_sign_treaty2
	is_triggered_only = yes

	option = {
		name = brazil.316.a
		add_opinion_modifier = {
			target = BUE
			modifier = eoanb_minor_opinion_boost
		}
		set_country_flag = BRA_supported_buenos_aires
	}

	option = {
		name = brazil.316.b
		add_opinion_modifier = {
			target = ARG
			modifier = eoanb_minor_opinion_boost
		}
		set_country_flag = BRA_supported_confederation
	}
}

country_event = {
	id = brazil.317
	title = brazil.317.t
	desc = brazil.317.d
	picture = GFX_report_event_generic_sign_treaty2
	is_triggered_only = yes
	option = {
		name = brazil.317.a
	}
}

country_event = {
	id = brazil.318
	title = brazil.318.t
	desc = brazil.318.d
	picture = GFX_report_event_generic_sign_treaty2
	is_triggered_only = yes
	option = {
		name = brazil.318.a
	}
}

country_event = {
	id = brazil.501
	title = brazil.501.t
	is_triggered_only = yes
	desc = brazil.501.d
	option = {
		name = brazil.501.a
	}
}

country_event = {
	id = brazil.502
	title = brazil.502.t
	is_triggered_only = yes
	desc = brazil.502.d
	option = {
		name = brazil.502.a
	}
}

country_event = {
	id = brazil.503
	title = brazil.503.t
	is_triggered_only = yes
	desc = brazil.503.d
	option = {
		name = brazil.503.a
	}
}

country_event = {
	id = brazil.504
	title = brazil.504.t
	is_triggered_only = yes
	desc = brazil.504.d
	option = {
		name = brazil.504.a
	}
}

#Italian workers in São Paulo
country_event = {
	id = brazil.505
	title = brazil.505.t
	desc = brazil.505.d
	is_triggered_only = yes
	#Do nothing
	option = {
		name = brazil.505.a
		ai_chance = { base = 25 }
		add_political_power = 20
		501 = { add_extra_state_shared_building_slots = 1 }
	}
	#Capture the 'fugitive' italians
	option = {
		name = brazil.505.b
		ai_chance = { base = 25    }
		add_political_power = -20
		add_timed_idea = { idea = BRA_italian_farmers days = 35 }
		hidden_effect = {
			set_country_flag = BRA_italian_workers_farm_flag
			country_event = { id = brazil.506 days = 35 }
		}
	}
	#Invest in small businees
	option = {
		name = brazil.505.c
		ai_chance = { base = 25    }
		add_political_power = -20
		random_list = {
			25 = {#cotton farms
				add_timed_idea = { idea = BRA_italian_farmers days = 70 }
				hidden_effect = {
					set_country_flag = BRA_italian_workers_cotton_farm_flag
					country_event = { id = brazil.506 days = 70 }
	        	}
			}
			25 = {#coal mine
				add_timed_idea = { idea = BRA_italian_bourgeois days = 105 }
				hidden_effect = {
					set_country_flag = BRA_italian_workers_coal_mine_flag
					country_event = { id = brazil.506 days = 105 }
		        }
			}
			25 = {#logging camp
				add_timed_idea = { idea = BRA_italian_bourgeois days = 120 }
				hidden_effect = {
					set_country_flag = BRA_italian_workers_logging_camp_flag
					country_event = { id = brazil.506 days = 120 }
	        	}
			}
			25 = {#fabric weavery
				add_timed_idea = { idea = BRA_italian_bourgeois days = 240 }
				hidden_effect = {
					set_country_flag = BRA_italian_workers_fabric_weavery_flag
					country_event = { id = brazil.506 days = 240 }
		        }
			}
		}
	}
	#Invest in civ factory
	option = {
		name = brazil.505.e
		ai_chance = { base = 25    }
		add_political_power = -40
		add_timed_idea = { idea = BRA_italian_factory_workers days = 360 }
		hidden_effect = {
			set_country_flag = BRA_italian_workers_factory_flag
			country_event = { id = brazil.506 days = 360 }
		}
	}
}

#Italian Worker in São Paulo Finished
country_event = {
	id = brazil.506
	title = brazil.506.t
	desc = brazil.506.d
	is_triggered_only = yes
	option = {
        name = brazil.506.a
		ai_chance = { base = 100 }
		if = {
			limit = { has_country_flag = BRA_italian_workers_farm_flag }
			501 = {
				add_building_construction = {
					type = farm
					level = 1
					instant_build = yes
				}
			}
			hidden_effect = { clr_country_flag = BRA_italian_workers_farm_flag }
		}
		else_if = {
			limit = { has_country_flag = BRA_italian_workers_cotton_farm_flag }
			501 = {
				add_building_construction = {
					type = cotton_farm
					level = 1
					instant_build = yes
				}
			}
			hidden_effect = { clr_country_flag = BRA_italian_workers_cotton_farm_flag }
		}
		else_if = {
			limit = { has_country_flag = BRA_italian_workers_coal_mine_flag }
			501 = {
				add_building_construction = {
					type = coal_mine
					level = 1
					instant_build = yes
				}
			}
			hidden_effect = { clr_country_flag = BRA_italian_workers_coal_mine_flag }
		}
		else_if = {
			limit = { has_country_flag = BRA_italian_workers_logging_camp_flag }
			501 = {
					add_building_construction = {
					type = logging_camp
					level = 1
					instant_build = yes
				}
			}
			hidden_effect = { clr_country_flag = BRA_italian_workers_logging_camp_flag }
		}
		else_if = {
			limit = { has_country_flag = BRA_italian_workers_fabric_weavery_flag }
			501 = {
				add_building_construction = {
					type = fabric_weavery
					level = 1
					instant_build = yes
				}
			}
			hidden_effect = { clr_country_flag = BRA_italian_workers_fabric_weavery_flag }
		}
		else_if = {
			limit = { has_country_flag = BRA_italian_workers_factory_flag }
			501 = {
				add_building_construction = {
					type = industrial_complex
					level = 1
					instant_build = yes
				}
			}
			hidden_effect = { clr_country_flag = BRA_italian_workers_factory_flag }
		}
	}
}

country_event = {
	id = brazil.507
	title = brazil.507.t
	desc = brazil.507.d
	is_triggered_only = yes
	option = {
		name = brazil.507.a
		ai_chance = { base = 25 }
		add_political_power = -10
		add_timed_idea = { idea = BRA_southern_infrastructure_investment_1 days = 180 }
		hidden_effect = {
			set_country_flag = brazil_southern_develop_1_flag
			country_event = { id = brazil.508 days = 180 }
		}
	}
	option = {
		name = brazil.507.b
		ai_chance = { base = 25 }
		add_political_power = -20
		add_timed_idea = { idea = BRA_southern_infrastructure_investment_2 days = 240 }
		hidden_effect = {
			set_country_flag = brazil_southern_develop_2_flag
			country_event = { id = brazil.508 days = 240 }
		}
	}
	option = {
		name = brazil.507.c
		ai_chance = { base = 25 }
		add_political_power = -30
		add_timed_idea = { idea = BRA_southern_infrastructure_investment_3 days = 300 }
		hidden_effect = {
			set_country_flag = brazil_southern_develop_3_flag
			country_event = { id = brazil.508 days = 300 }
		}
	}
	option = {
		name = brazil.507.e
		ai_chance = { base = 25 }
		add_political_power = -40
		add_timed_idea = { idea = BRA_southern_infrastructure_investment_4 days = 360 }
		hidden_effect = {
			set_country_flag = brazil_southern_develop_4_flag
			country_event = { id = brazil.508 days = 360 }
		}
	}
}

country_event = {
	id = brazil.508
	title = brazil.508.t
	desc = brazil.508.d
	is_triggered_only = yes
	option = {
        name = brazil.508.a
		ai_chance = { base = 100 }
		if = {
			limit = { has_country_flag = brazil_southern_develop_1_flag }
			502 = {
				add_building_construction = {
					type = infrastructure
					level = 1
					instant_build = yes
				}
			}
			503 = {
				add_building_construction = {
					type = infrastructure
					level = 1
					instant_build = yes
				}
			}
			1036 = {
				add_building_construction = {
					type = infrastructure
					level = 1
					instant_build = yes
				}
			}
			hidden_effect = { clr_country_flag = brazil_southern_develop_1_flag }
		}
		else_if = {
			limit = { has_country_flag = brazil_southern_develop_2_flag }
			502 = {
				add_building_construction = {
					type = infrastructure
					level = 1
					instant_build = yes
				}
				add_building_construction = {
					type = naval_base
					level = 1
					province = 10447
					instant_build = yes
				}
			}
			503 = {
				add_building_construction = {
					type = infrastructure
					level = 1
					instant_build = yes
				}
				add_building_construction = { 
					type = naval_base
					level = 1 
					province = 10405
					instant_build = yes
				}
			}
			1036 = {
				add_building_construction = {
					type = infrastructure
					level = 1
					instant_build = yes
				}
				add_building_construction = { 
					type = naval_base 
					level = 1
					province = 14024
					instant_build = yes
				}
			}
			hidden_effect = { clr_country_flag = brazil_southern_develop_2_flag }
		}
		else_if = {
			limit = { has_country_flag = brazil_southern_develop_3_flag }
			502 = {
				add_building_construction = {
					type = infrastructure
					level = 1
					instant_build = yes
				}
			}
			503 = {
				add_building_construction = {
					type = infrastructure
					level = 1
					instant_build = yes
				}
			}
			1036 = {
				add_building_construction = {
					type = infrastructure
					level = 1
					instant_build = yes
				}
			}
			301 = {
				add_building_construction = {
					type = infrastructure
					level = 1
					instant_build = yes
				}
			}
			1064 = {
				add_building_construction = {
					type = infrastructure
					level = 1
					instant_build = yes
				}
			}
			hidden_effect = { clr_country_flag = brazil_southern_develop_3_flag }
		}
		else_if = {
			limit = { has_country_flag = brazil_southern_develop_4_flag }
			502 = {
				add_building_construction = {
					type = infrastructure
					level = 1
					instant_build = yes
				}
				add_building_construction = {
					type = naval_base
					level = 1
					province = 10447
					instant_build = yes
				}
			}
			503 = {
				add_building_construction = {
					type = infrastructure
					level = 1
					instant_build = yes
				}
				add_building_construction = { 
					type = naval_base
					level = 1 
					province = 10405
					instant_build = yes
				}
			}
			1036 = {
				add_building_construction = {
					type = infrastructure
					level = 1
					instant_build = yes
				}
				add_building_construction = { 
					type = naval_base 
					level = 1
					province = 14024
					instant_build = yes
				}
			}
			301 = {
				add_building_construction = {
					type = infrastructure
					level = 1
					instant_build = yes
				}
			}
			1064 = {
				add_building_construction = {
					type = infrastructure
					level = 1
					instant_build = yes
				}
			}
			hidden_effect = { clr_country_flag = brazil_southern_develop_4_flag }
		}
	}
}

country_event = {
	id = brazil.509
	title = brazil.509.t
	desc = brazil.509.d
	is_triggered_only = yes
	option = {
		name = brazil.509.a
		ai_chance = { base = 25 }
		add_political_power = -40
		add_timed_idea = { idea = BRA_southern_civilian_industry days = 360 }
		hidden_effect = {
			set_country_flag = BRA_southern_civil_industry_flag
			country_event = { id = brazil.510 days = 360 }
		}
	}
	option = {
		name = brazil.509.b
		ai_chance = { base = 25 }
		add_political_power = -80
		add_timed_idea = { idea = BRA_southern_civilian_industry days = 720 }
		hidden_effect = {
			set_country_flag = BRA_southern_civil_industries_flag
			country_event = { id = brazil.510 days = 720 }
		}
	}
	option = {
		name = brazil.509.c
		ai_chance = { base = 25 }
		add_political_power = -60
		add_timed_idea = { idea = BRA_southern_military_factory days = 750 }
		hidden_effect = {
			set_country_flag = BRA_southern_military_industry_flag
			country_event = { id = brazil.510 days = 750 }
		}
	}
	option = {
		name = brazil.509.e
		ai_chance = { base = 25 }
		add_political_power = -100
		add_timed_idea = { idea = BRA_southern_civilian_military_complex days = 1050 }
		hidden_effect = {
			set_country_flag = BRA_southern_civil_and_military_industry_flag
			country_event = { id = brazil.510 days = 1050 }
		}
	}
}

country_event = {
	id = brazil.510
	title = brazil.510.t
	desc = brazil.510.d
	is_triggered_only = yes
	option = {
        name = brazil.510.a
		ai_chance = { base = 100 }
		if = {
			limit = { has_country_flag = BRA_southern_civil_industry_flag }
			random_list = {
				50 = {
					501 = {
						add_building_construction = {
							type = industrial_complex
							level = 1
							instant_build = yes
						}
					}
				}
				50 = {
					502 = {
						add_building_construction = {
							type = industrial_complex
							level = 1
							instant_build = yes
						}
					}
				}
			}
			hidden_effect = { clr_country_flag = BRA_southern_civil_industry_flag }
		}
		else_if = {
			limit = { has_country_flag = BRA_southern_civil_industries_flag }
			501 = {
				add_building_construction = {
					type = industrial_complex
					level = 1
					instant_build = yes
				}
			}
			502 = {
				add_building_construction = {
					type = industrial_complex
					level = 1
					instant_build = yes
				}
			}
			hidden_effect = { clr_country_flag = BRA_southern_civil_industries_flag }
		}
		else_if = {
			limit = { has_country_flag = BRA_southern_military_industry_flag }
			502 = {
				add_building_construction = {
					type = arms_factory
					level = 1
					instant_build = yes
				}
			}
			hidden_effect = { clr_country_flag = BRA_southern_military_industry_flag }
		}
		else_if = {
			limit = { has_country_flag = BRA_southern_civil_and_military_industry_flag }
			501 = {
				add_building_construction = {
					type = industrial_complex
					level = 1
					instant_build = yes
				}
			}
			502 = {
				add_building_construction = {
					type = arms_factory
					level = 1
					instant_build = yes
				}
			}
			hidden_effect = { clr_country_flag = BRA_southern_civil_and_military_industry_flag }
		}
	}
}

# The Recife and São Francisco Railway
country_event = {
	id = brazil.511
	title = brazil.511.t
	desc = brazil.511.d
	is_triggered_only = yes
	option = {
		name = brazil.511.a
		ai_chance = { base = 25 }
		add_political_power = -10
		add_timed_idea = { idea = BRA_the_recife_and_sao_francisco_railway_1 days = 200 }
		hidden_effect = {
			set_country_flag = brazil_the_recife_and_sao_francisco_railway_1_flag
			1040 = {

				add_dynamic_modifier = {
					modifier = dynmod_BRA_railways_by_slaves
					days = 200
				}
			}
			1044 = {

				add_dynamic_modifier = {
					modifier = dynmod_BRA_railways_by_slaves
					days = 200
				}
			}
			country_event = { id = brazil.513 days = 200 }
		}
	}
	option = {
		name = brazil.511.b
		ai_chance = { base = 25 }
		add_political_power = -20
		add_timed_idea = { idea = BRA_the_recife_and_sao_francisco_railway_2 days = 180 }
		hidden_effect = {
			set_country_flag = brazil_the_recife_and_sao_francisco_railway_2_flag
			1040 = {
				add_dynamic_modifier = {
					modifier = dynmod_BRA_railways_by_free_workers 
					days = 180
				}
			}
			1044 = {
				add_dynamic_modifier = {
					modifier = dynmod_BRA_railways_by_free_workers
					days = 180
				}
			}
			country_event = { id = brazil.513 days = 180 }
		}
	}
	option = {
		name = brazil.511.c
		ai_chance = { base = 25 }
		add_political_power = -30
		add_timed_idea = { idea = BRA_the_recife_and_sao_francisco_railway_3 days = 150 }
		hidden_effect = {
			set_country_flag = brazil_the_recife_and_sao_francisco_railway_3_flag
			1040 = {
				add_dynamic_modifier = {
					modifier = dynmod_BRA_railways_by_companies
					days = 140
				}
			}
			1044 = {
				add_dynamic_modifier = {
					modifier = dynmod_BRA_railways_by_companies
					days = 140
				} 
			}
			country_event = { id = brazil.513 days = 150 }
		}
	}
	option = {
		name = brazil.511.e
		ai_chance = { base = 25 }
		country_event = { id = brazil.512 }
	}
}

country_event = {
	id = brazil.512
	title = brazil.512.t
	desc = brazil.512.d
	is_triggered_only = yes
	option = {
		name = brazil.512.a
		ai_chance = { base = 25 }
		add_political_power = -10
		add_timed_idea = { idea = BRA_the_recife_and_sao_francisco_railway_4 days = 200 }
		hidden_effect = {
			set_country_flag = brazil_the_recife_and_sao_francisco_railway_4_flag
			1040 = {

				add_dynamic_modifier = {
					modifier = dynmod_BRA_railways_by_slaves
					days = 200
				}
			}
			1044 = {

				add_dynamic_modifier = {
					modifier = dynmod_BRA_railways_by_slaves
					days = 200
				}
			}
			country_event = { id = brazil.513 days = 200 }
		}
	}
	option = {
		name = brazil.512.b
		ai_chance = { base = 25 }
		add_political_power = -20
		add_timed_idea = { idea = BRA_the_recife_and_sao_francisco_railway_5 days = 180 }
		hidden_effect = {
			set_country_flag = brazil_the_recife_and_sao_francisco_railway_5_flag
			1040 = {
				add_dynamic_modifier = {
					modifier = dynmod_BRA_railways_by_free_workers 
					days = 180
				}
			}
			1044 = {
				add_dynamic_modifier = {
					modifier = dynmod_BRA_railways_by_free_workers
					days = 180
				}
			}
			country_event = { id = brazil.513 days = 180 }
		}
	}
	option = {
		name = brazil.512.c
		ai_chance = { base = 25 }
		add_political_power = -30
		add_timed_idea = { idea = BRA_the_recife_and_sao_francisco_railway_6 days = 140 }
		hidden_effect = {
			set_country_flag = brazil_the_recife_and_sao_francisco_railway_6_flag
			1040 = {
				add_dynamic_modifier = {
					modifier = dynmod_BRA_railways_by_companies
					days = 140
				}
			}
			1044 = {
				add_dynamic_modifier = {
					modifier = dynmod_BRA_railways_by_companies
					days = 140
				} 
			}
			country_event = { id = brazil.513 days = 150 }
		}
	}
	option = {
		name = brazil.512.e
		ai_chance = { base = 25 }
		country_event = { id = brazil.511 }
	}
}

country_event = {
	id = brazil.513
	title = brazil.513.t
	desc = brazil.513.d
	picture = GFX_report_event_generic_railway_opening
	is_triggered_only = yes
	option = {
        name = brazil.513.a
		ai_chance = { base = 100 }
		if = {
			limit = { has_country_flag = brazil_the_recife_and_sao_francisco_railway_1_flag }
			build_railway = {
				level = 1
				path = { 5168 5182 12961 10345 8227 }
			}
			build_railway = {
				level = 1
				path = { 8143 14031 }
			}
			EOANBSYS_institutions_innovative_add_one = yes
			set_temp_variable = { eoanb_prestige_change = 1 }
			eoanb_change_prestige_score = yes
			add_tech_bonus = { bonus = 0.5 uses = 1 category = humanities_tech }
			hidden_effect = { 
				clr_country_flag = brazil_the_recife_and_sao_francisco_railway_1_flag
			}
		}
		else_if = {
			limit = { has_country_flag = brazil_the_recife_and_sao_francisco_railway_2_flag }
			build_railway = {
				level = 1
				path = { 5168 5182 12961 10345 8227 }
			}
			build_railway = {
				level = 1
				path = { 8143 14031 }
			}
			EOANBSYS_institutions_innovative_add_one = yes
			set_temp_variable = { eoanb_prestige_change = 1 }
			eoanb_change_prestige_score = yes
			add_tech_bonus = { bonus = 0.5 uses = 1 category = humanities_tech }
			hidden_effect = { 
				clr_country_flag = brazil_the_recife_and_sao_francisco_railway_2_flag
			}
		}
		else_if = {
			limit = { has_country_flag = brazil_the_recife_and_sao_francisco_railway_3_flag }
			build_railway = {
				level = 1
				path = { 5168 5182 12961 10345 8227 }
			}
			build_railway = {
				level = 1
				path = { 8143 14031 }
			}
			EOANBSYS_institutions_innovative_add_one = yes
			set_temp_variable = { eoanb_prestige_change = 1 }
			eoanb_change_prestige_score = yes
			add_tech_bonus = { bonus = 0.5 uses = 1 category = humanities_tech }
			hidden_effect = { 
				clr_country_flag = brazil_the_recife_and_sao_francisco_railway_3_flag
			}
		}
		else_if = {
			limit = { has_country_flag = brazil_the_recife_and_sao_francisco_railway_4_flag }
			build_railway = {
				level = 2
				path = { 5168 5182 12961 10345 8227 }
			}
			build_railway = {
				level = 2
				path = { 8143 14031 }
			}
			EOANBSYS_institutions_innovative_add_two = yes
			set_temp_variable = { eoanb_prestige_change = 2 }
			eoanb_change_prestige_score = yes
			add_tech_bonus = { bonus = 0.5 uses = 2 category = humanities_tech }
			hidden_effect = { 
				clr_country_flag = brazil_the_recife_and_sao_francisco_railway_4_flag
			}
		}
		else_if = {
			limit = { has_country_flag = brazil_the_recife_and_sao_francisco_railway_5_flag }
			build_railway = {
				level = 2
				path = { 5168 5182 12961 10345 8227 }
			}
			build_railway = {
				level = 2
				path = { 8143 14031 }
			}
			EOANBSYS_institutions_innovative_add_two = yes
			set_temp_variable = { eoanb_prestige_change = 2 }
			eoanb_change_prestige_score = yes
			add_tech_bonus = { bonus = 0.5 uses = 2 category = humanities_tech }
			hidden_effect = { 
				clr_country_flag = brazil_the_recife_and_sao_francisco_railway_5_flag
			}
		}
		else_if = {
			limit = { has_country_flag = brazil_the_recife_and_sao_francisco_railway_6_flag }
			build_railway = {
				level = 2
				path = { 5168 5182 12961 10345 8227 }
			}
			build_railway = {
				level = 2
				path = { 8143 14031 }
			}
			EOANBSYS_institutions_innovative_add_two = yes
			set_temp_variable = { eoanb_prestige_change = 2 }
			eoanb_change_prestige_score = yes
			add_tech_bonus = { bonus = 0.5 uses = 2 category = humanities_tech }
			hidden_effect = { 
				clr_country_flag = brazil_the_recife_and_sao_francisco_railway_6_flag
			}
		}
	}
}

# The Dom Pedro II Railway
country_event = {
	id = brazil.514
	title = brazil.514.t
	desc = brazil.514.d
	is_triggered_only = yes
	option = {
		name = brazil.514.a
		ai_chance = { base = 25 }
		add_political_power = -10
		add_timed_idea = { idea = BRA_the_dom_pedro_II_railway_1 days = 180 }
		hidden_effect = {
			set_country_flag = brazil_the_dom_pedro_II_railway_1_flag
			1037 = {

				add_dynamic_modifier = {
					modifier = dynmod_BRA_railways_by_slaves
					days = 180
				}
			}
			500 = {

				add_dynamic_modifier = {
					modifier = dynmod_BRA_railways_by_slaves
					days = 180
				}
			}
			country_event = { id = brazil.516 days = 180 }
		}
	}
	option = {
		name = brazil.514.b
		ai_chance = { base = 25 }
		add_political_power = -20
		add_timed_idea = { idea = BRA_the_dom_pedro_II_railway_2 days = 150 }
		hidden_effect = {
			set_country_flag = brazil_the_dom_pedro_II_railway_2_flag
			1037 = {
				add_dynamic_modifier = {
					modifier = dynmod_BRA_railways_by_free_workers 
					days = 150
				}
			}
			500 = {
				add_dynamic_modifier = {
					modifier = dynmod_BRA_railways_by_free_workers
					days = 150
				}
			}
			country_event = { id = brazil.516 days = 150 }
		}
	}
	option = {
		name = brazil.514.c
		ai_chance = { base = 25 }
		add_political_power = -30
		add_timed_idea = { idea = BRA_the_dom_pedro_II_railway_3 days = 120 }
		hidden_effect = {
			set_country_flag = brazil_the_dom_pedro_II_railway_3_flag
			1037 = {
				add_dynamic_modifier = {
					modifier = dynmod_BRA_railways_by_companies
					days = 120
				}
			}
			500 = {
				add_dynamic_modifier = {
					modifier = dynmod_BRA_railways_by_companies
					days = 120
				} 
			}
			country_event = { id = brazil.516 days = 150 }
		}
	}
	option = {
		name = brazil.514.e
		ai_chance = { base = 25 }
		country_event = { id = brazil.515 }
	}
}

country_event = {
	id = brazil.515
	title = brazil.515.t
	desc = brazil.515.d
	is_triggered_only = yes
	option = {
		name = brazil.515.a
		ai_chance = { base = 25 }
		add_political_power = -10
		add_timed_idea = { idea = BRA_the_dom_pedro_II_railway_4 days = 180 }
		hidden_effect = {
			set_country_flag = brazil_the_dom_pedro_II_railway_4_flag
			1037 = {

				add_dynamic_modifier = {
					modifier = dynmod_BRA_railways_by_slaves
					days = 180
				}
			}
			500 = {

				add_dynamic_modifier = {
					modifier = dynmod_BRA_railways_by_slaves
					days = 180
				}
			}
			country_event = { id = brazil.516 days = 180 }
		}
	}
	option = {
		name = brazil.515.b
		ai_chance = { base = 25 }
		add_political_power = -20
		add_timed_idea = { idea = BRA_the_dom_pedro_II_railway_5 days = 150 }
		hidden_effect = {
			set_country_flag = brazil_the_dom_pedro_II_railway_5_flag
			1037 = {
				add_dynamic_modifier = {
					modifier = dynmod_BRA_railways_by_free_workers 
					days = 150
				}
			}
			500 = {
				add_dynamic_modifier = {
					modifier = dynmod_BRA_railways_by_free_workers
					days = 150
				}
			}
			country_event = { id = brazil.516 days = 150 }
		}
	}
	option = {
		name = brazil.515.c
		ai_chance = { base = 25 }
		add_political_power = -30
		add_timed_idea = { idea = BRA_the_dom_pedro_II_railway_6 days = 120 }
		hidden_effect = {
			set_country_flag = brazil_the_dom_pedro_II_railway_6_flag
			1037 = {
				add_dynamic_modifier = {
					modifier = dynmod_BRA_railways_by_companies
					days = 120
				}
			}
			500 = {
				add_dynamic_modifier = {
					modifier = dynmod_BRA_railways_by_companies
					days = 120
				} 
			}
			country_event = { id = brazil.516 days = 120 }
		}
	}
	option = {
		name = brazil.515.e
		ai_chance = { base = 25 }
		country_event = { id = brazil.514 }
	}
}

country_event = {
	id = brazil.516
	title = brazil.516.t
	desc = brazil.516.d
	picture = GFX_report_event_generic_railway_opening
	is_triggered_only = yes
	option = {
        name = brazil.516.a
		ai_chance = { base = 100 }
		if = {
			limit = { has_country_flag = brazil_the_dom_pedro_II_railway_1_flag }
			build_railway = {
				level = 1
				path = { 12466 14019 5172 13964 }
			}
			EOANBSYS_institutions_innovative_add_one = yes
			set_temp_variable = { eoanb_prestige_change = 1 }
			eoanb_change_prestige_score = yes
			add_tech_bonus = { bonus = 0.5 uses = 1 category = humanities_tech }
			add_tech_bonus = { bonus = 0.5 uses = 1 category = trains_tech }
			add_tech_bonus = { bonus = 0.5 uses = 1 category = transport_tech }
			hidden_effect = { 
				clr_country_flag = brazil_the_dom_pedro_II_railway_1_flag
			}
		}
		else_if = {
			limit = { has_country_flag = brazil_the_dom_pedro_II_railway_2_flag }
			build_railway = {
				level = 1
				path = { 12466 14019 5172 13964 }
			}
			EOANBSYS_institutions_innovative_add_one = yes
			set_temp_variable = { eoanb_prestige_change = 1 }
			eoanb_change_prestige_score = yes
			add_tech_bonus = { bonus = 0.5 uses = 1 category = humanities_tech }
			add_tech_bonus = { bonus = 0.5 uses = 1 category = trains_tech }
			add_tech_bonus = { bonus = 0.5 uses = 1 category = transport_tech }
			hidden_effect = { 
				clr_country_flag = brazil_the_dom_pedro_II_railway_2_flag
			}
		}
		else_if = {
			limit = { has_country_flag = brazil_the_dom_pedro_II_railway_3_flag }
			build_railway = {
				level = 1
				path = { 12466 14019 5172 13964 }
			}
			EOANBSYS_institutions_innovative_add_one = yes
			set_temp_variable = { eoanb_prestige_change = 1 }
			eoanb_change_prestige_score = yes
			add_tech_bonus = { bonus = 0.5 uses = 1 category = humanities_tech }
			add_tech_bonus = { bonus = 0.5 uses = 1 category = trains_tech }
			add_tech_bonus = { bonus = 0.5 uses = 1 category = transport_tech }
			hidden_effect = { 
				clr_country_flag = brazil_the_dom_pedro_II_railway_3_flag
			}
		}
		else_if = {
			limit = { has_country_flag = brazil_the_dom_pedro_II_railway_4_flag }
			build_railway = {
				level = 2
				path = { 12466 14019 5172 13964 }
			}
			EOANBSYS_institutions_innovative_add_two = yes
			set_temp_variable = { eoanb_prestige_change = 2 }
			eoanb_change_prestige_score = yes
			add_tech_bonus = { bonus = 0.5 uses = 2 category = humanities_tech }
			add_tech_bonus = { bonus = 0.5 uses = 2 category = trains_tech }
			add_tech_bonus = { bonus = 0.5 uses = 2 category = transport_tech }
			hidden_effect = { 
				clr_country_flag = brazil_the_dom_pedro_II_railway_4_flag
			}
		}
		else_if = {
			limit = { has_country_flag = brazil_the_dom_pedro_II_railway_5_flag }
			build_railway = {
				level = 2
				path = { 12466 14019 5172 13964 }
			}
			EOANBSYS_institutions_innovative_add_two = yes
			set_temp_variable = { eoanb_prestige_change = 2 }
			eoanb_change_prestige_score = yes
			add_tech_bonus = { bonus = 0.5 uses = 2 category = humanities_tech }
			add_tech_bonus = { bonus = 0.5 uses = 2 category = trains_tech }
			add_tech_bonus = { bonus = 0.5 uses = 2 category = transport_tech }
			hidden_effect = { 
				clr_country_flag = brazil_the_dom_pedro_II_railway_5_flag
			}
		}
		else_if = {
			limit = { has_country_flag = brazil_the_dom_pedro_II_railway_6_flag }
			build_railway = {
				level = 2
				path = { 12466 14019 5172 13964 }
			}
			EOANBSYS_institutions_innovative_add_two = yes
			set_temp_variable = { eoanb_prestige_change = 2 }
			eoanb_change_prestige_score = yes
			add_tech_bonus = { bonus = 0.5 uses = 2 category = humanities_tech }
			add_tech_bonus = { bonus = 0.5 uses = 2 category = trains_tech }
			add_tech_bonus = { bonus = 0.5 uses = 2 category = transport_tech }
			hidden_effect = { 
				clr_country_flag = brazil_the_dom_pedro_II_railway_6_flag
			}
		}
	}
}

# The Porto Alegre and New Hamburgo Railway
country_event = {
	id = brazil.517
	title = brazil.517.t
	desc = brazil.517.d
	is_triggered_only = yes
	option = {
		name = brazil.517.a
		ai_chance = { base = 25 }
		add_political_power = -10
		add_timed_idea = { idea = BRA_the_porto_alegre_and_new_hamburgo_railway_1 days = 280 }
		hidden_effect = {
			set_country_flag = brazil_the_porto_alegre_and_new_hamburgo_railway_1_flag
			502 = {

				add_dynamic_modifier = {
					modifier = dynmod_BRA_railways_by_slaves
					days = 280
				}
			}
			country_event = { id = brazil.519 days = 280 }
		}
	}
	option = {
		name = brazil.517.b
		ai_chance = { base = 25 }
		add_political_power = -20
		add_timed_idea = { idea = BRA_the_porto_alegre_and_new_hamburgo_railway_2 days = 240 }
		hidden_effect = {
			set_country_flag = brazil_the_porto_alegre_and_new_hamburgo_railway_2_flag
			502 = {
				add_dynamic_modifier = {
					modifier = dynmod_BRA_railways_by_free_workers
					days = 240
				}
			}
			country_event = { id = brazil.519 days = 240 }
		}
	}
	option = {
		name = brazil.517.c
		ai_chance = { base = 25 }
		add_political_power = -30
		add_timed_idea = { idea = BRA_the_porto_alegre_and_new_hamburgo_railway_3 days = 200 }
		hidden_effect = {
			set_country_flag = brazil_the_porto_alegre_and_new_hamburgo_railway_3_flag
			502 = {
				add_dynamic_modifier = {
					modifier = dynmod_BRA_railways_by_companies
					days = 200
				} 
			}
			country_event = { id = brazil.519 days = 200 }
		}
	}
	option = {
		name = brazil.517.e
		ai_chance = { base = 25 }
		country_event = { id = brazil.518 }
	}
}

country_event = {
	id = brazil.518
	title = brazil.518.t
	desc = brazil.518.d
	is_triggered_only = yes
	option = {
		name = brazil.518.a
		ai_chance = { base = 25 }
		add_political_power = -10
		add_timed_idea = { idea = BRA_the_porto_alegre_and_new_hamburgo_railway_4 days = 280 }
		hidden_effect = {
			set_country_flag = brazil_the_porto_alegre_and_new_hamburgo_railway_4_flag
			502 = {

				add_dynamic_modifier = {
					modifier = dynmod_BRA_railways_by_slaves
					days = 280
				}
			}
			country_event = { id = brazil.519 days = 280 }
		}
	}
	option = {
		name = brazil.518.b
		ai_chance = { base = 25 }
		add_political_power = -20
		add_timed_idea = { idea = BRA_the_porto_alegre_and_new_hamburgo_railway_5 days = 240 }
		hidden_effect = {
			set_country_flag = brazil_the_porto_alegre_and_new_hamburgo_railway_5_flag
			502 = {
				add_dynamic_modifier = {
					modifier = dynmod_BRA_railways_by_free_workers
					days = 240
				}
			}
			country_event = { id = brazil.519 days = 240 }
		}
	}
	option = {
		name = brazil.518.c
		ai_chance = { base = 25 }
		add_political_power = -30
		add_timed_idea = { idea = BRA_the_porto_alegre_and_new_hamburgo_railway_6 days = 200 }
		hidden_effect = {
			set_country_flag = brazil_the_porto_alegre_and_new_hamburgo_railway_6_flag
			502 = {
				add_dynamic_modifier = {
					modifier = dynmod_BRA_railways_by_companies
					days = 200
				} 
			}
			country_event = { id = brazil.519 days = 200 }
		}
	}
	option = {
		name = brazil.518.e
		ai_chance = { base = 25 }
		country_event = { id = brazil.517 }
	}
}

country_event = {
	id = brazil.519
	title = brazil.519.t
	desc = brazil.519.d
	picture = GFX_report_event_generic_railway_opening
	is_triggered_only = yes
	option = {
        name = brazil.519.a
		ai_chance = { base = 100 }
		if = {
			limit = { has_country_flag = brazil_the_porto_alegre_and_new_hamburgo_railway_1_flag }
			build_railway = {
				level = 1
				path = { 10447 12396 14014 }
			}
			build_railway = {
				level = 1
				path = { 10447 4436 7594 14051 1598 14050 }
			}
			build_railway = {
				level = 1
				path = { 14050 4575 1585 }
			}
			build_railway = {
				level = 1
				path = { 1598 7581 5110 1542 }
			}
			build_railway = {
				level = 1
				path = { 4436 7638 4604 }
			}
			#build_railway = {
			#	level = 1
			#	path = { 7638 14025 }
			#}
			EOANBSYS_institutions_innovative_add_one = yes
			set_temp_variable = { eoanb_prestige_change = 1 }
			eoanb_change_prestige_score = yes
			add_tech_bonus = { bonus = 0.5 uses = 1 category = humanities_tech }
			add_tech_bonus = { bonus = 0.5 uses = 1 category = trains_tech }
			add_tech_bonus = { bonus = 0.5 uses = 1 category = transport_tech }
			hidden_effect = { 
				clr_country_flag = brazil_the_porto_alegre_and_new_hamburgo_railway_1_flag
			}
		}
		else_if = {
			limit = { has_country_flag = brazil_the_porto_alegre_and_new_hamburgo_railway_2_flag }
			build_railway = {
				level = 1
				path = { 10447 12396 14014 }
			}
			build_railway = {
				level = 1
				path = { 10447 4436 7594 14051 1598 14050 }
			}
			build_railway = {
				level = 1
				path = { 14050 4575 1585 }
			}
			build_railway = {
				level = 1
				path = { 1598 7581 5110 1542 }
			}
			build_railway = {
				level = 1
				path = { 4436 7638 4604 }
			}
			#build_railway = {
			#	level = 1
			#	path = { 7638 14025 }
			#}
			EOANBSYS_institutions_innovative_add_one = yes
			set_temp_variable = { eoanb_prestige_change = 1 }
			eoanb_change_prestige_score = yes
			add_tech_bonus = { bonus = 0.5 uses = 1 category = humanities_tech }
			add_tech_bonus = { bonus = 0.5 uses = 1 category = trains_tech }
			add_tech_bonus = { bonus = 0.5 uses = 1 category = transport_tech }
			hidden_effect = { 
				clr_country_flag = brazil_the_porto_alegre_and_new_hamburgo_railway_2_flag
			}
		}
		else_if = {
			limit = { has_country_flag = brazil_the_porto_alegre_and_new_hamburgo_railway_3_flag }
			build_railway = {
				level = 1
				path = { 10447 12396 14014 }
			}
			build_railway = {
				level = 1
				path = { 10447 4436 7594 14051 1598 14050 }
			}
			build_railway = {
				level = 1
				path = { 14050 4575 1585 }
			}
			build_railway = {
				level = 1
				path = { 1598 7581 5110 1542 }
			}
			build_railway = {
				level = 1
				path = { 4436 7638 4604 }
			}
			#build_railway = {
			#	level = 1
			#	path = { 7638 14025 }
			#}
			EOANBSYS_institutions_innovative_add_one = yes
			set_temp_variable = { eoanb_prestige_change = 1 }
			eoanb_change_prestige_score = yes
			add_tech_bonus = { bonus = 0.5 uses = 1 category = humanities_tech }
			add_tech_bonus = { bonus = 0.5 uses = 1 category = trains_tech }
			add_tech_bonus = { bonus = 0.5 uses = 1 category = transport_tech }
			hidden_effect = { 
				clr_country_flag = brazil_the_porto_alegre_and_new_hamburgo_railway_3_flag
			}
		}
		else_if = {
			limit = { has_country_flag = brazil_the_porto_alegre_and_new_hamburgo_railway_4_flag }
			build_railway = {
				level = 2
				path = { 10447 12396 14014 }
			}
			build_railway = {
				level = 2
				path = { 10447 4436 7594 14051 1598 14050 }
			}
			build_railway = {
				level = 2
				path = { 14050 4575 1585 }
			}
			build_railway = {
				level = 2
				path = { 1598 7581 5110 1542 }
			}
			build_railway = {
				level = 2
				path = { 4436 7638 4604 }
			}
			#build_railway = {
			#	level = 2
			#	path = { 7638 14025 }
			#}
			EOANBSYS_institutions_innovative_add_two = yes
			set_temp_variable = { eoanb_prestige_change = 2 }
			eoanb_change_prestige_score = yes
			add_tech_bonus = { bonus = 0.5 uses = 2 category = humanities_tech }
			add_tech_bonus = { bonus = 0.5 uses = 2 category = trains_tech }
			add_tech_bonus = { bonus = 0.5 uses = 2 category = transport_tech }
			hidden_effect = { 
				clr_country_flag = brazil_the_porto_alegre_and_new_hamburgo_railway_4_flag
			}
		}
		else_if = {
			limit = { has_country_flag = brazil_the_porto_alegre_and_new_hamburgo_railway_5_flag }
			build_railway = {
				level = 2
				path = { 10447 12396 14014 }
			}
			build_railway = {
				level = 2
				path = { 10447 4436 7594 14051 1598 14050 }
			}
			build_railway = {
				level = 2
				path = { 14050 4575 1585 }
			}
			build_railway = {
				level = 2
				path = { 1598 7581 5110 1542 }
			}
			build_railway = {
				level = 2
				path = { 4436 7638 4604 }
			}
			#build_railway = {
			#	level = 2
			#	path = { 7638 14025 }
			#}
			EOANBSYS_institutions_innovative_add_two = yes
			set_temp_variable = { eoanb_prestige_change = 2 }
			eoanb_change_prestige_score = yes
			add_tech_bonus = { bonus = 0.5 uses = 2 category = humanities_tech }
			add_tech_bonus = { bonus = 0.5 uses = 2 category = trains_tech }
			add_tech_bonus = { bonus = 0.5 uses = 2 category = transport_tech }
			hidden_effect = { 
				clr_country_flag = brazil_the_porto_alegre_and_new_hamburgo_railway_5_flag
			}
		}
		else_if = {
			limit = { has_country_flag = brazil_the_porto_alegre_and_new_hamburgo_railway_6_flag }
			build_railway = {
				level = 2
				path = { 10447 12396 14014 }
			}
			build_railway = {
				level = 2
				path = { 10447 4436 7594 14051 1598 14050 }
			}
			build_railway = {
				level = 2
				path = { 14050 4575 1585 }
			}
			build_railway = {
				level = 2
				path = { 1598 7581 5110 1542 }
			}
			build_railway = {
				level = 2
				path = { 4436 7638 4604 }
			}
			#build_railway = {
			#	level = 2
			#	path = { 7638 14025 }
			#}
			EOANBSYS_institutions_innovative_add_two = yes
			set_temp_variable = { eoanb_prestige_change = 2 }
			eoanb_change_prestige_score = yes
			add_tech_bonus = { bonus = 0.5 uses = 2 category = humanities_tech }
			add_tech_bonus = { bonus = 0.5 uses = 2 category = trains_tech }
			add_tech_bonus = { bonus = 0.5 uses = 2 category = transport_tech }
			hidden_effect = { 
				clr_country_flag = brazil_the_porto_alegre_and_new_hamburgo_railway_6_flag
			}
		}
	}
}

# The Niteroi Tramsway
country_event = {
	id = brazil.520
	title = brazil.520.t
	desc = brazil.520.d
	is_triggered_only = yes
	option = {
		name = brazil.520.a
		ai_chance = { base = 25 }
		add_political_power = -10
		add_timed_idea = { idea = BRA_the_niteroi_tramsway_1 days = 280 }
		hidden_effect = {
			set_country_flag = brazil_the_niteroi_tramsway_1_flag
			500 = {

			}
			country_event = { id = brazil.521 days = 280 }
		}
	}
	option = {
		name = brazil.520.b
		ai_chance = { base = 25 }
		add_political_power = -20
		add_timed_idea = { idea = BRA_the_niteroi_tramsway_2 days = 240 }
		hidden_effect = {
			set_country_flag = brazil_the_niteroi_tramsway_2_flag
			country_event = { id = brazil.521 days = 240 }
		}
	}
	option = {
		name = brazil.520.c
		ai_chance = { base = 25 }
		add_political_power = -30
		add_timed_idea = { idea = BRA_the_niteroi_tramsway_3 days = 200 }
		hidden_effect = {
			set_country_flag = brazil_the_niteroi_tramsway_3_flag
			country_event = { id = brazil.521 days = 200 }
		}
	}
}

country_event = {
	id = brazil.521
	title = brazil.521.t
	desc = brazil.521.d
	picture = GFX_report_event_generic_railway_opening
	is_triggered_only = yes
	option = {
        name = brazil.521.a
		ai_chance = { base = 100 }
		if = {
			limit = { has_country_flag = brazil_the_niteroi_tramsway_1_flag }
			500 = {
				add_building_construction = { type = infrastructure	level = 1 instant_build = yes }
				add_extra_state_shared_building_slots = 1
			}
			add_tech_bonus = {  bonus = 0.5 uses = 1 category = transport_tech  }
			add_tech_bonus = {	bonus = 0.5 uses = 1 category = humanities_tech }
			hidden_effect = { clr_country_flag = brazil_the_niteroi_tramsway_1_flag }
		}
		else_if = {
			limit = { has_country_flag = brazil_the_niteroi_tramsway_2_flag }
			500 = {
				add_building_construction = { type = infrastructure	level = 1 instant_build = yes }
				add_extra_state_shared_building_slots = 1
			}
			add_tech_bonus = {	bonus = 0.75 uses = 1 category = humanities_tech }
			add_tech_bonus = {  bonus = 0.75 uses = 1 category = transport_tech }
			hidden_effect = { clr_country_flag = brazil_the_niteroi_tramsway_2_flag }
		}
		else_if = {
			limit = { has_country_flag = brazil_the_niteroi_tramsway_3_flag }
			500 = {
				add_building_construction = { type = infrastructure	level = 1 instant_build = yes }
				add_extra_state_shared_building_slots = 1
			}
			add_tech_bonus = { bonus = 1.0 uses = 1 category = humanities_tech }
			add_tech_bonus = { bonus = 1.0 uses = 1 category = transport_tech }
			hidden_effect = { clr_country_flag = brazil_the_niteroi_tramsway_3_flag }
		}
	}
}

# The Petropolis Road!
country_event = {
	id = brazil.522
	title = brazil.522.t
	desc = brazil.522.d
	is_triggered_only = yes
	option = {
		name = brazil.522.a
		ai_chance = { base = 25 }
		add_political_power = -10
		add_timed_idea = { idea = BRA_the_petropolis_road_1 days = 280 }
		hidden_effect = {
			set_country_flag = brazil_the_petropolis_road_1_flag
			500 = {

				add_dynamic_modifier = {
					modifier = dynmod_BRA_railways_by_slaves
					days = 280
				}
			}
			country_event = { id = brazil.524 days = 280 }
		}
	}
	option = {
		name = brazil.522.b
		ai_chance = { base = 25 }
		add_political_power = -20
		add_timed_idea = { idea = BRA_the_petropolis_road_2 days = 240 }
		hidden_effect = {
			set_country_flag = brazil_the_petropolis_road_2_flag
			500 = {
				add_dynamic_modifier = {
					modifier = dynmod_BRA_railways_by_free_workers
					days = 240
				}
			}
			country_event = { id = brazil.524 days = 240 }
		}
	}
	option = {
		name = brazil.522.c
		ai_chance = { base = 25 }
		add_political_power = -30
		add_timed_idea = { idea = BRA_the_petropolis_road_3 days = 200 }
		hidden_effect = {
			set_country_flag = brazil_the_petropolis_road_3_flag
			500 = {
				add_dynamic_modifier = {
					modifier = dynmod_BRA_railways_by_companies
					days = 200
				} 
			}
			country_event = { id = brazil.524 days = 200 }
		}
	}
	option = {
		name = brazil.522.e
		ai_chance = { base = 25 }
		country_event = { id = brazil.523 }
	}
}

country_event = {
	id = brazil.523
	title = brazil.523.t
	desc = brazil.523.d
	is_triggered_only = yes
	option = {
		name = brazil.523.a
		ai_chance = { base = 25 }
		add_political_power = -10
		add_timed_idea = { idea = BRA_the_petropolis_road_4 days = 280 }
		hidden_effect = {
			set_country_flag = brazil_the_petropolis_road_4_flag
			500 = {

				add_dynamic_modifier = {
					modifier = dynmod_BRA_railways_by_slaves
					days = 280
				}
			}
			country_event = { id = brazil.524 days = 280 }
		}
	}
	option = {
		name = brazil.523.b
		ai_chance = { base = 25 }
		add_political_power = -20
		add_timed_idea = { idea = BRA_the_petropolis_road_5 days = 240 }
		hidden_effect = {
			set_country_flag = brazil_the_petropolis_road_5_flag
			500 = {
				add_dynamic_modifier = {
					modifier = dynmod_BRA_railways_by_free_workers
					days = 240
				}
			}
			country_event = { id = brazil.524 days = 240 }
		}
	}
	option = {
		name = brazil.523.c
		ai_chance = { base = 25 }
		add_political_power = -30
		add_timed_idea = { idea = BRA_the_petropolis_road_6 days = 200 }
		hidden_effect = {
			set_country_flag = brazil_the_petropolis_road_6_flag
			500 = {
				add_dynamic_modifier = {
					modifier = dynmod_BRA_railways_by_companies
					days = 200
				} 
			}
			country_event = { id = brazil.524 days = 200 }
		}
	}
	option = {
		name = brazil.523.e
		ai_chance = { base = 25 }
		country_event = { id = brazil.522 }
	}
}

country_event = {
	id = brazil.524
	title = brazil.524.t
	desc = brazil.524.d
	picture = GFX_report_event_generic_railway_opening
	is_triggered_only = yes
	option = {
        name = brazil.524.a
		ai_chance = { base = 100 }
		if = {
			limit = { has_country_flag = brazil_the_petropolis_road_1_flag }
			build_railway = {
				level = 1
				path = { 12466 14019 10980 }
			}
			500 = {
				add_building_construction = { type = infrastructure	level = 1 instant_build = yes }
				add_extra_state_shared_building_slots = 1
			}
			EOANBSYS_institutions_innovative_add_one = yes
			set_temp_variable = { eoanb_prestige_change = 1 }
			eoanb_change_prestige_score = yes
			add_tech_bonus = { bonus = 0.5 uses = 1 category = humanities_tech }
			add_tech_bonus = { bonus = 0.5 uses = 1 category = transport_tech }
			add_tech_bonus = { bonus = 0.5 uses = 1 category = trains_tech }
			hidden_effect = { 
				clr_country_flag = brazil_the_petropolis_road_1_flag
			}
		}
		else_if = {
			limit = { has_country_flag = brazil_the_petropolis_road_2_flag }
			build_railway = {
				level = 1
				path = { 12466 14019 10980 }
			}
			500 = {
				add_building_construction = { type = infrastructure	level = 1 instant_build = yes }
				add_extra_state_shared_building_slots = 1
			}
			EOANBSYS_institutions_innovative_add_one = yes
			set_temp_variable = { eoanb_prestige_change = 1 }
			eoanb_change_prestige_score = yes
			add_tech_bonus = { bonus = 0.75 uses = 1 category = humanities_tech }
			add_tech_bonus = { bonus = 0.75 uses = 1 category = transport_tech }
			add_tech_bonus = { bonus = 0.75 uses = 1 category = trains_tech }
			hidden_effect = { 
				clr_country_flag = brazil_the_petropolis_road_2_flag
			}
		}
		else_if = {
			limit = { has_country_flag = brazil_the_petropolis_road_3_flag }
			build_railway = {
				level = 1
				path = { 12466 14019 10980 }
			}
			500 = {
				add_building_construction = { type = infrastructure	level = 1 instant_build = yes }
				add_extra_state_shared_building_slots = 1
			}
			EOANBSYS_institutions_innovative_add_one = yes
			set_temp_variable = { eoanb_prestige_change = 1 }
			eoanb_change_prestige_score = yes
			add_tech_bonus = { bonus = 1.0 uses = 1 category = humanities_tech }
			add_tech_bonus = { bonus = 1.0 uses = 1 category = transport_tech }
			add_tech_bonus = { bonus = 1.0 uses = 2 category = trains_tech }
			hidden_effect = { 
				clr_country_flag = brazil_the_petropolis_road_3_flag
			}
		}
		else_if = {
			limit = { has_country_flag = brazil_the_petropolis_road_4_flag }
			build_railway = {
				level = 2
				path = { 12466 14019 10980 }
			}
			500 = {
				add_building_construction = { type = infrastructure	level = 1 instant_build = yes }
				add_extra_state_shared_building_slots = 1
			}
			EOANBSYS_institutions_innovative_add_two = yes
			set_temp_variable = { eoanb_prestige_change = 2 }
			eoanb_change_prestige_score = yes
			add_tech_bonus = { bonus = 0.5 uses = 2 category = humanities_tech }
			add_tech_bonus = { bonus = 0.5 uses = 2 category = transport_tech }
			add_tech_bonus = { bonus = 0.5 uses = 2 category = trains_tech }
			hidden_effect = { 
				clr_country_flag = brazil_the_petropolis_road_4_flag
			}
		}
		else_if = {
			limit = { has_country_flag = brazil_the_petropolis_road_5_flag }
			build_railway = {
				level = 2
				path = { 10447 12396 14014 }
			}
			500 = {
				add_building_construction = { type = infrastructure	level = 1 instant_build = yes }
				add_extra_state_shared_building_slots = 1
			}
			EOANBSYS_institutions_innovative_add_two = yes
			set_temp_variable = { eoanb_prestige_change = 2 }
			eoanb_change_prestige_score = yes
			add_tech_bonus = { bonus = 0.75 uses = 2 category = humanities_tech }
			add_tech_bonus = { bonus = 0.75 uses = 2 category = transport_tech }
			add_tech_bonus = { bonus = 0.75 uses = 2 category = trains_tech }
			hidden_effect = { 
				clr_country_flag = brazil_the_petropolis_road_5_flag
			}
		}
		else_if = {
			limit = { has_country_flag = brazil_the_petropolis_road_6_flag }
			build_railway = {
				level = 2
				path = { 12466 14019 10980 }
			}
			500 = {
				add_building_construction = { type = infrastructure	level = 1 instant_build = yes }
				add_extra_state_shared_building_slots = 1
			}
			EOANBSYS_institutions_innovative_add_two = yes
			set_temp_variable = { eoanb_prestige_change = 2 }
			eoanb_change_prestige_score = yes
			add_tech_bonus = { bonus = 1.0 uses = 2 category = humanities_tech }
			add_tech_bonus = { bonus = 1.0 uses = 2 category = transport_tech }
			add_tech_bonus = { bonus = 1.0 uses = 2 category = trains_tech }
			hidden_effect = { 
				clr_country_flag = brazil_the_petropolis_road_6_flag
			}
		}
	}
}

# São Paulo Railway Company & Companhia União Sorocabana e Ituana!
country_event = {
	id = brazil.525
	title = brazil.525.t
	desc = brazil.525.d
	is_triggered_only = yes
	option = {
		name = brazil.525.a
		ai_chance = { base = 25 }
		add_political_power = -10
		add_timed_idea = { idea = BRA_the_sao_paulo_railway_1 days = 360 }
		hidden_effect = {
			set_country_flag = brazil_the_sao_paulo_railway_1_flag
			501 = {

				add_dynamic_modifier = {
					modifier = dynmod_BRA_railways_by_slaves
					days = 360
				}
			}
			country_event = { id = brazil.527 days = 360 }
		}
	}
	option = {
		name = brazil.525.b
		ai_chance = { base = 25 }
		add_political_power = -20
		add_timed_idea = { idea = BRA_the_sao_paulo_railway_2 days = 320 }
		hidden_effect = {
			set_country_flag = brazil_the_sao_paulo_railway_2_flag
			501 = {
				add_dynamic_modifier = {
					modifier = dynmod_BRA_railways_by_free_workers
					days = 320
				}
			}
			country_event = { id = brazil.527 days = 320 }
		}
	}
	option = {
		name = brazil.525.c
		ai_chance = { base = 25 }
		add_political_power = -30
		add_timed_idea = { idea = BRA_the_sao_paulo_railway_3 days = 280 }
		hidden_effect = {
			set_country_flag = brazil_the_sao_paulo_railway_3_flag
			501 = {
				add_dynamic_modifier = {
					modifier = dynmod_BRA_railways_by_companies
					days = 280
				} 
			}
			country_event = { id = brazil.527 days = 280 }
		}
	}
	option = {
		name = brazil.525.e
		ai_chance = { base = 25 }
		country_event = { id = brazil.526 }
	}
}

country_event = {
	id = brazil.526
	title = brazil.526.t
	desc = brazil.526.d
	is_triggered_only = yes
	option = {
		name = brazil.526.a
		ai_chance = { base = 25 }
		add_political_power = -10
		add_timed_idea = { idea = BRA_the_sao_paulo_railway_4 days = 360 }
		hidden_effect = {
			set_country_flag = brazil_the_sao_paulo_railway_4_flag
			501 = {

				add_dynamic_modifier = {
					modifier = dynmod_BRA_railways_by_slaves
					days = 360
				}
			}
			country_event = { id = brazil.527 days = 360 }
		}
	}
	option = {
		name = brazil.526.b
		ai_chance = { base = 25 }
		add_political_power = -20
		add_timed_idea = { idea = BRA_the_sao_paulo_railway_5 days = 320 }
		hidden_effect = {
			set_country_flag = brazil_the_sao_paulo_railway_5_flag
			501 = {
				add_dynamic_modifier = {
					modifier = dynmod_BRA_railways_by_free_workers
					days = 320
				}
			}
			country_event = { id = brazil.527 days = 320 }
		}
	}
	option = {
		name = brazil.526.c
		ai_chance = { base = 25 }
		add_political_power = -30
		add_timed_idea = { idea = BRA_the_sao_paulo_railway_6 days = 280 }
		hidden_effect = {
			set_country_flag = brazil_the_sao_paulo_railway_6_flag
			501 = {
				add_dynamic_modifier = {
					modifier = dynmod_BRA_railways_by_companies
					days = 280
				} 
			}
			country_event = { id = brazil.527 days = 280 }
		}
	}
	option = {
		name = brazil.526.e
		ai_chance = { base = 25 }
		country_event = { id = brazil.525 }
	}
}

country_event = {
	id = brazil.527
	title = brazil.527.t
	desc = brazil.527.d
	picture = GFX_report_event_generic_railway_opening
	is_triggered_only = yes
	option = {
        name = brazil.527.a
		ai_chance = { base = 100 }
		if = {
			limit = { has_country_flag = brazil_the_sao_paulo_railway_1_flag }
			build_railway = {
				level = 1
				path = { 5112 10513 14042 10947 11003 1583 }
			}
			build_railway = {
				level = 1
				path = { 10513 14041 10360 12972 11003 10994 }
			}
			build_railway = {
				level = 1
				path = { 10513 14042 14056 11008 }
			}
			EOANBSYS_institutions_innovative_add_one = yes
			set_temp_variable = { eoanb_prestige_change = 1 }
			eoanb_change_prestige_score = yes
			add_tech_bonus = { bonus = 0.5 uses = 1 category = humanities_tech }
			add_tech_bonus = { bonus = 0.5 uses = 1 category = trains_tech }
			hidden_effect = { 
				clr_country_flag = brazil_the_sao_paulo_railway_1_flag
			}
		}
		else_if = {
			limit = { has_country_flag = brazil_the_sao_paulo_railway_2_flag }
			build_railway = {
				level = 1
				path = { 5112 10513 14042 10947 11003 1583 }
			}
			build_railway = {
				level = 1
				path = { 10513 14041 10360 12972 11003 10994 }
			}
			build_railway = {
				level = 1
				path = { 10513 14042 14056 11008 }
			}
			EOANBSYS_institutions_innovative_add_one = yes
			set_temp_variable = { eoanb_prestige_change = 1 }
			eoanb_change_prestige_score = yes
			add_tech_bonus = { bonus = 0.5 uses = 1 category = humanities_tech }
			add_tech_bonus = { bonus = 0.5 uses = 1 category = trains_tech }
			hidden_effect = { 
				clr_country_flag = brazil_the_sao_paulo_railway_2_flag
			}
		}
		else_if = {
			limit = { has_country_flag = brazil_the_sao_paulo_railway_3_flag }
			build_railway = {
				level = 1
				path = { 5112 10513 14042 10947 11003 1583 }
			}
			build_railway = {
				level = 1
				path = { 10513 14041 10360 12972 11003 10994 }
			}
			build_railway = {
				level = 1
				path = { 10513 14042 14056 11008 }
			}
			EOANBSYS_institutions_innovative_add_one = yes
			set_temp_variable = { eoanb_prestige_change = 1 }
			eoanb_change_prestige_score = yes
			add_tech_bonus = { bonus = 0.5 uses = 1 category = humanities_tech }
			add_tech_bonus = { bonus = 0.5 uses = 1 category = trains_tech }
			hidden_effect = { 
				clr_country_flag = brazil_the_sao_paulo_railway_3_flag
			}
		}
		else_if = {
			limit = { has_country_flag = brazil_the_sao_paulo_railway_4_flag }
			build_railway = {
				level = 2
				path = { 5112 10513 14042 10947 11003 1583 }
			}
			build_railway = {
				level = 2
				path = { 10513 14041 10360 12972 11003 10994 }
			}
			build_railway = {
				level = 2
				path = { 10513 14042 14056 11008 }
			}
			EOANBSYS_institutions_innovative_add_two = yes
			set_temp_variable = { eoanb_prestige_change = 2 }
			eoanb_change_prestige_score = yes
			add_tech_bonus = { bonus = 0.5 uses = 2 category = humanities_tech }
			add_tech_bonus = { bonus = 0.5 uses = 2 category = trains_tech }
			hidden_effect = { 
				clr_country_flag = brazil_the_sao_paulo_railway_4_flag
			}
		}
		else_if = {
			limit = { has_country_flag = brazil_the_sao_paulo_railway_5_flag }
			build_railway = {
				level = 2
				path = { 5112 10513 14042 10947 11003 1583 }
			}
			build_railway = {
				level = 2
				path = { 10513 14041 10360 12972 11003 10994 }
			}
			build_railway = {
				level = 2
				path = { 10513 14042 14056 11008 }
			}
			EOANBSYS_institutions_innovative_add_two = yes
			set_temp_variable = { eoanb_prestige_change = 2 }
			eoanb_change_prestige_score = yes
			add_tech_bonus = { bonus = 0.5 uses = 2 category = humanities_tech }
			add_tech_bonus = { bonus = 0.5 uses = 2 category = trains_tech }
			hidden_effect = { 
				clr_country_flag = brazil_the_sao_paulo_railway_5_flag
			}
		}
		else_if = {
			limit = { has_country_flag = brazil_the_sao_paulo_railway_6_flag }
			build_railway = {
				level = 2
				path = { 5112 10513 14042 10947 11003 1583 }
			}
			build_railway = {
				level = 2
				path = { 10513 14041 10360 12972 11003 10994 }
			}
			build_railway = {
				level = 2
				path = { 10513 14042 14056 11008 }
			}
			EOANBSYS_institutions_innovative_add_two = yes
			set_temp_variable = { eoanb_prestige_change = 2 }
			eoanb_change_prestige_score = yes
			add_tech_bonus = { bonus = 0.5 uses = 2 category = humanities_tech }
			add_tech_bonus = { bonus = 0.5 uses = 2 category = trains_tech }
			hidden_effect = { 
				clr_country_flag = brazil_the_sao_paulo_railway_6_flag
			}
		}
	}
}

# Leopoldina Railway
country_event = {
	id = brazil.528
	title = brazil.528.t
	desc = brazil.528.d
	is_triggered_only = yes
	option = {
		name = brazil.528.a
		ai_chance = { base = 25 }
		add_political_power = -10
		add_timed_idea = { idea = BRA_the_leopoldina_railway_1 days = 360 }
		hidden_effect = {
			set_country_flag = brazil_the_leopoldina_railway_1_flag
			1038 = {

				add_dynamic_modifier = {
					modifier = dynmod_BRA_railways_by_slaves
					days = 360
				}
			}
			country_event = { id = brazil.530 days = 360 }
		}
	}
	option = {
		name = brazil.528.b
		ai_chance = { base = 25 }
		add_political_power = -20
		add_timed_idea = { idea = BRA_the_leopoldina_railway_2 days = 320 }
		hidden_effect = {
			set_country_flag = brazil_the_leopoldina_railway_2_flag
			1038 = {
				add_dynamic_modifier = {
					modifier = dynmod_BRA_railways_by_free_workers
					days = 320
				}
			}
			country_event = { id = brazil.530 days = 320 }
		}
	}
	option = {
		name = brazil.528.c
		ai_chance = { base = 25 }
		add_political_power = -30
		add_timed_idea = { idea = BRA_the_leopoldina_railway_3 days = 280 }
		hidden_effect = {
			set_country_flag = brazil_the_leopoldina_railway_3_flag
			1038 = {
				add_dynamic_modifier = {
					modifier = dynmod_BRA_railways_by_companies
					days = 280
				} 
			}
			country_event = { id = brazil.530 days = 280 }
		}
	}
	option = {
		name = brazil.528.e
		ai_chance = { base = 25 }
		country_event = { id = brazil.529 }
	}
}

country_event = {
	id = brazil.529
	title = brazil.529.t
	desc = brazil.529.d
	is_triggered_only = yes
	option = {
		name = brazil.529.a
		ai_chance = { base = 25 }
		add_political_power = -10
		add_timed_idea = { idea = BRA_the_leopoldina_railway_4 days = 360 }
		hidden_effect = {
			set_country_flag = brazil_the_leopoldina_railway_4_flag
			1038 = {

				add_dynamic_modifier = {
					modifier = dynmod_BRA_railways_by_slaves
					days = 360
				}
			}
			country_event = { id = brazil.530 days = 360 }
		}
	}
	option = {
		name = brazil.529.b
		ai_chance = { base = 25 }
		add_political_power = -20
		add_timed_idea = { idea = BRA_the_leopoldina_railway_5 days = 320 }
		hidden_effect = {
			set_country_flag = brazil_the_leopoldina_railway_5_flag
			1038 = {
				add_dynamic_modifier = {
					modifier = dynmod_BRA_railways_by_free_workers
					days = 320
				}
			}
			country_event = { id = brazil.530 days = 320 }
		}
	}
	option = {
		name = brazil.529.c
		ai_chance = { base = 25 }
		add_political_power = -30
		add_timed_idea = { idea = BRA_the_leopoldina_railway_6 days = 280 }
		hidden_effect = {
			set_country_flag = brazil_the_leopoldina_railway_6_flag
			1038 = {
				add_dynamic_modifier = {
					modifier = dynmod_BRA_railways_by_companies
					days = 280
				} 
			}
			country_event = { id = brazil.530 days = 280 }
		}
	}
	option = {
		name = brazil.529.e
		ai_chance = { base = 25 }
		country_event = { id = brazil.528 }
	}
}

country_event = {
	id = brazil.530
	title = brazil.530.t
	desc = brazil.530.d
	picture = GFX_report_event_generic_railway_opening
	is_triggered_only = yes
	option = {
        name = brazil.530.a
		ai_chance = { base = 100 }
		if = {
			limit = { has_country_flag = brazil_the_leopoldina_railway_1_flag }
			build_railway = {
				level = 1
				path = { 12334  8226 7589 4570 }
			}
			build_railway = {
				level = 1
				path = { 12334 12996 }
			}
			build_railway = {
				level = 1
				path = { 12996 13965 2153 4570 }
			}
			EOANBSYS_institutions_innovative_add_one = yes
			set_temp_variable = { eoanb_prestige_change = 1 }
			eoanb_change_prestige_score = yes
			add_tech_bonus = { bonus = 0.5 uses = 1 category = humanities_tech }
			add_tech_bonus = { bonus = 0.5 uses = 1 category = trains_tech }
			add_tech_bonus = { bonus = 0.5 uses = 1 category = transport_tech }
			hidden_effect = { 
				clr_country_flag = brazil_the_leopoldina_railway_1_flag
			}
		}
		else_if = {
			limit = { has_country_flag = brazil_the_leopoldina_railway_2_flag }
			build_railway = {
				level = 1
				path = { 12334  8226 7589 4570 }
			}
			build_railway = {
				level = 1
				path = { 12334 12996 }
			}
			build_railway = {
				level = 1
				path = { 12996 13965 2153 4570 }
			}
			EOANBSYS_institutions_innovative_add_one = yes
			set_temp_variable = { eoanb_prestige_change = 1 }
			eoanb_change_prestige_score = yes
			add_tech_bonus = { bonus = 0.5 uses = 1 category = humanities_tech }
			add_tech_bonus = { bonus = 0.5 uses = 1 category = trains_tech }
			add_tech_bonus = { bonus = 0.5 uses = 1 category = transport_tech }
			hidden_effect = { 
				clr_country_flag = brazil_the_leopoldina_railway_2_flag
			}
		}
		else_if = {
			limit = { has_country_flag = brazil_the_leopoldina_railway_3_flag }
			build_railway = {
				level = 1
				path = { 12334  8226 7589 4570 }
			}
			build_railway = {
				level = 1
				path = { 12334 12996 }
			}
			build_railway = {
				level = 1
				path = { 12996 13965 2153 4570 }
			}
			EOANBSYS_institutions_innovative_add_one = yes
			set_temp_variable = { eoanb_prestige_change = 1 }
			eoanb_change_prestige_score = yes
			add_tech_bonus = { bonus = 0.5 uses = 1 category = humanities_tech }
			add_tech_bonus = { bonus = 0.5 uses = 1 category = trains_tech }
			add_tech_bonus = { bonus = 0.5 uses = 1 category = transport_tech }
			hidden_effect = { 
				clr_country_flag = brazil_the_leopoldina_railway_3_flag
			}
		}
		else_if = {
			limit = { has_country_flag = brazil_the_leopoldina_railway_4_flag }
			build_railway = {
				level = 2
				path = { 12334  8226 7589 4570 }
			}
			build_railway = {
				level = 2
				path = { 12334 12996 }
			}
			build_railway = {
				level = 2
				path = { 12996 13965 2153 4570 }
			}
			EOANBSYS_institutions_innovative_add_two = yes
			set_temp_variable = { eoanb_prestige_change = 2 }
			eoanb_change_prestige_score = yes
			add_tech_bonus = { bonus = 0.5 uses = 2 category = humanities_tech }
			add_tech_bonus = { bonus = 0.5 uses = 2 category = trains_tech }
			add_tech_bonus = { bonus = 0.5 uses = 2 category = transport_tech }
			hidden_effect = { 
				clr_country_flag = brazil_the_leopoldina_railway_4_flag
			}
		}
		else_if = {
			limit = { has_country_flag = brazil_the_leopoldina_railway_5_flag }
			build_railway = {
				level = 2
				path = { 12334  8226 7589 4570 }
			}
			build_railway = {
				level = 2
				path = { 12334 12996 }
			}
			build_railway = {
				level = 2
				path = { 12996 13965 2153 4570 }
			}
			EOANBSYS_institutions_innovative_add_two = yes
			set_temp_variable = { eoanb_prestige_change = 2 }
			eoanb_change_prestige_score = yes
			add_tech_bonus = { bonus = 0.5 uses = 2 category = humanities_tech }
			add_tech_bonus = { bonus = 0.5 uses = 2 category = trains_tech }
			add_tech_bonus = { bonus = 0.5 uses = 2 category = transport_tech }
			hidden_effect = { 
				clr_country_flag = brazil_the_leopoldina_railway_5_flag
			}
		}
		else_if = {
			limit = { has_country_flag = brazil_the_leopoldina_railway_6_flag }
			build_railway = {
				level = 2
				path = { 12334  8226 7589 4570 }
			}
			build_railway = {
				level = 2
				path = { 12334 12996 }
			}
			build_railway = {
				level = 2
				path = { 12996 13965 2153 4570 }
			}
			EOANBSYS_institutions_innovative_add_two = yes
			set_temp_variable = { eoanb_prestige_change = 2 }
			eoanb_change_prestige_score = yes
			add_tech_bonus = { bonus = 0.5 uses = 2 category = humanities_tech }
			add_tech_bonus = { bonus = 0.5 uses = 2 category = trains_tech }
			add_tech_bonus = { bonus = 0.5 uses = 2 category = transport_tech }
			hidden_effect = { 
				clr_country_flag = brazil_the_leopoldina_railway_6_flag
			}
		}
	}
}

# The Recife Tramsway
country_event = {
	id = brazil.531
	title = brazil.531.t
	desc = brazil.531.d
	is_triggered_only = yes
	option = {
		name = brazil.531.a
		ai_chance = { base = 25 }
		add_political_power = -10
		add_timed_idea = { idea = BRA_the_recife_tramsway_1 days = 280 }
		hidden_effect = {
			set_country_flag = brazil_the_recife_tramsway_1_flag
			1044 = {

			}
			country_event = { id = brazil.532 days = 280 }
		}
	}
	option = {
		name = brazil.531.b
		ai_chance = { base = 25 }
		add_political_power = -20
		add_timed_idea = { idea = BRA_the_recife_tramsway_2 days = 240 }
		hidden_effect = {
			set_country_flag = brazil_the_recife_tramsway_2_flag
			country_event = { id = brazil.532 days = 240 }
		}
	}
	option = {
		name = brazil.531.c
		ai_chance = { base = 25 }
		add_political_power = -30
		add_timed_idea = { idea = BRA_the_recife_tramsway_3 days = 200 }
		hidden_effect = {
			set_country_flag = brazil_the_recife_tramsway_3_flag
			country_event = { id = brazil.532 days = 200 }
		}
	}
}

country_event = {
	id = brazil.532
	title = brazil.532.t
	desc = brazil.532.d
	picture = GFX_report_event_generic_railway_opening
	is_triggered_only = yes
	option = {
        name = brazil.532.a
		ai_chance = { base = 100 }
		if = {
			limit = { has_country_flag = brazil_the_recife_tramsway_1_flag }
			1044 = {
				add_building_construction = { type = infrastructure	level = 1 instant_build = yes }
				add_extra_state_shared_building_slots = 1
			}
			add_tech_bonus = {  bonus = 0.5 uses = 1 category = transport_tech  }
			add_tech_bonus = {	bonus = 0.5 uses = 1 category = humanities_tech }
			hidden_effect = { clr_country_flag = brazil_the_recife_tramsway_1_flag }
		}
		else_if = {
			limit = { has_country_flag = brazil_the_recife_tramsway_2_flag }
			1044 = {
				add_building_construction = { type = infrastructure	level = 1 instant_build = yes }
				add_extra_state_shared_building_slots = 1
			}
			add_tech_bonus = {	bonus = 0.75 uses = 1 category = humanities_tech }
			add_tech_bonus = {  bonus = 0.75 uses = 1 category = transport_tech }
			hidden_effect = { clr_country_flag = brazil_the_recife_tramsway_2_flag }
		}
		else_if = {
			limit = { has_country_flag = brazil_the_recife_tramsway_3_flag }
			1044 = {
				add_building_construction = { type = infrastructure	level = 1 instant_build = yes }
				add_extra_state_shared_building_slots = 1
			}
			add_tech_bonus = { bonus = 1.0 uses = 1 category = humanities_tech }
			add_tech_bonus = { bonus = 1.0 uses = 1 category = transport_tech }
			hidden_effect = { clr_country_flag = brazil_the_recife_tramsway_3_flag }
		}
	}
}

# Campos Tramsway
country_event = {
	id = brazil.533
	title = brazil.533.t
	desc = brazil.533.d
	is_triggered_only = yes
	option = {
		name = brazil.533.a
		ai_chance = { base = 25 }
		add_political_power = -10
		add_timed_idea = { idea = BRA_the_campos_tramsway_1 days = 280}
		hidden_effect = {
			set_country_flag = brazil_the_campos_tramsway_1_flag
			500 = {

				add_dynamic_modifier = {
					modifier = dynmod_BRA_railways_by_slaves
					days = 280
				}
			}
			country_event = { id = brazil.534 days = 280 }
		}
	}
	option = {
		name = brazil.533.b
		ai_chance = { base = 25 }
		add_political_power = -20
		add_timed_idea = { idea = BRA_the_campos_tramsway_2 days = 240 }
		hidden_effect = {
			set_country_flag = brazil_the_campos_tramsway_2_flag
			500 = {
				add_dynamic_modifier = {
					modifier = dynmod_BRA_railways_by_free_workers
					days = 240
				}
			}
			country_event = { id = brazil.534 days = 240 }
		}
	}
	option = {
		name = brazil.533.c
		ai_chance = { base = 25 }
		add_political_power = -30
		add_timed_idea = { idea = BRA_the_campos_tramsway_3 days = 200 }
		hidden_effect = {
			set_country_flag = brazil_the_campos_tramsway_3_flag
			500 = {
				add_dynamic_modifier = {
					modifier = dynmod_BRA_railways_by_companies
					days = 200
				} 
			}
			country_event = { id = brazil.534 days = 200 }
		}
	}
}

country_event = {
	id = brazil.534
	title = brazil.534.t
	desc = brazil.534.d
	picture = GFX_report_event_generic_railway_opening
	is_triggered_only = yes
	option = {
        name = brazil.534.a
		ai_chance = { base = 100 }
		if = {
			limit = { has_country_flag = brazil_the_campos_tramsway_1_flag }
			500 = {
				add_building_construction = { type = infrastructure	level = 1 instant_build = yes }
				add_extra_state_shared_building_slots = 1
			}
			add_tech_bonus = {  bonus = 0.5 uses = 1 category = transport_tech  }
			add_tech_bonus = {	bonus = 0.5 uses = 1 category = humanities_tech }
			hidden_effect = { clr_country_flag = brazil_the_campos_tramsway_1_flag }
		}
		else_if = {
			limit = { has_country_flag = brazil_the_campos_tramsway_2_flag }
			500 = {
				add_building_construction = { type = infrastructure	level = 1 instant_build = yes }
				add_extra_state_shared_building_slots = 1
			}
			add_tech_bonus = {	bonus = 0.75 uses = 1 category = humanities_tech }
			add_tech_bonus = {  bonus = 0.75 uses = 1 category = transport_tech }
			hidden_effect = { clr_country_flag = brazil_the_campos_tramsway_2_flag }
		}
		else_if = {
			limit = { has_country_flag = brazil_the_campos_tramsway_3_flag }
			500 = {
				add_building_construction = { type = infrastructure	level = 1 instant_build = yes }
				add_extra_state_shared_building_slots = 1
			}
			add_tech_bonus = { bonus = 1.0 uses = 1 category = humanities_tech }
			add_tech_bonus = { bonus = 1.0 uses = 1 category = transport_tech }
			hidden_effect = { clr_country_flag = brazil_the_campos_tramsway_3_flag }
		}
	}
}

# The Rio Grande do Sul Tramsway
country_event = {
	id = brazil.535
	title = brazil.535.t
	desc = brazil.535.d
	is_triggered_only = yes
	option = {
		name = brazil.535.a
		ai_chance = { base = 25 }
		add_political_power = -10
		add_timed_idea = { idea = BRA_the_rio_grande_do_sul_tramsway_1 days = 280}
		hidden_effect = {
			set_country_flag = brazil_the_rio_grande_do_sul_tramsway_1_flag
			502 = {

				add_dynamic_modifier = {
					modifier = dynmod_BRA_railways_by_slaves
					days = 280
				}
			}
			country_event = { id = brazil.536 days = 280 }
		}
	}
	option = {
		name = brazil.535.b
		ai_chance = { base = 25 }
		add_political_power = -20
		add_timed_idea = { idea = BRA_the_rio_grande_do_sul_tramsway_2 days = 240 }
		hidden_effect = {
			set_country_flag = brazil_the_rio_grande_do_sul_tramsway_2_flag
			502 = {
				add_dynamic_modifier = {
					modifier = dynmod_BRA_railways_by_free_workers
					days = 240
				}
			}
			country_event = { id = brazil.536 days = 240 }
		}
	}
	option = {
		name = brazil.535.c
		ai_chance = { base = 25 }
		add_political_power = -30
		add_timed_idea = { idea = BRA_the_rio_grande_do_sul_tramsway_3 days = 200 }
		hidden_effect = {
			set_country_flag = brazil_the_rio_grande_do_sul_tramsway_3_flag
			502 = {
				add_dynamic_modifier = {
					modifier = dynmod_BRA_railways_by_companies
					days = 200
				} 
			}
			country_event = { id = brazil.536 days = 200 }
		}
	}
}

country_event = {
	id = brazil.536
	title = brazil.536.t
	desc = brazil.536.d
	picture = GFX_report_event_generic_railway_opening
	is_triggered_only = yes
	option = {
        name = brazil.536.a
		ai_chance = { base = 100 }
		if = {
			limit = { has_country_flag = brazil_the_rio_grande_do_sul_tramsway_1_flag }
			502 = {
				add_building_construction = { type = infrastructure	level = 1 instant_build = yes }
				add_extra_state_shared_building_slots = 1
			}
			add_tech_bonus = {  bonus = 0.5 uses = 1 category = transport_tech  }
			add_tech_bonus = {	bonus = 0.5 uses = 1 category = humanities_tech }
			hidden_effect = { clr_country_flag = brazil_the_rio_grande_do_sul_tramsway_1_flag }
		}
		else_if = {
			limit = { has_country_flag = brazil_the_rio_grande_do_sul_tramsway_2_flag }
			502 = {
				add_building_construction = { type = infrastructure	level = 1 instant_build = yes }
				add_extra_state_shared_building_slots = 1
			}
			add_tech_bonus = {	bonus = 0.75 uses = 1 category = humanities_tech }
			add_tech_bonus = {  bonus = 0.75 uses = 1 category = transport_tech }
			hidden_effect = { clr_country_flag = brazil_the_rio_grande_do_sul_tramsway_2_flag }
		}
		else_if = {
			limit = { has_country_flag = brazil_the_rio_grande_do_sul_tramsway_3_flag }
			502 = {
				add_building_construction = { type = infrastructure	level = 1 instant_build = yes }
				add_extra_state_shared_building_slots = 1
			}
			add_tech_bonus = { bonus = 1.0 uses = 1 category = humanities_tech }
			add_tech_bonus = { bonus = 1.0 uses = 1 category = transport_tech }
			hidden_effect = { clr_country_flag = brazil_the_rio_grande_do_sul_tramsway_3_flag }
		}
	}
}

#The Tijuca Railway
country_event = {
	id = brazil.537
	title = brazil.537.t
	desc = brazil.537.d
	is_triggered_only = yes
	option = {
		name = brazil.537.a
		ai_chance = { base = 25 }
		add_political_power = -10
		add_timed_idea = { idea = BRA_the_tijuca_railway_1 days = 280 }
		hidden_effect = {
			set_country_flag = brazil_the_tijuca_railway_1_flag
			500 = {

				add_dynamic_modifier = {
					modifier = dynmod_BRA_railways_by_slaves
					days = 280
				}
			}
			country_event = { id = brazil.539 days = 280 }
		}
	}
	option = {
		name = brazil.537.b
		ai_chance = { base = 25 }
		add_political_power = -20
		add_timed_idea = { idea = BRA_the_tijuca_railway_2 days = 240 }
		hidden_effect = {
			set_country_flag = brazil_the_tijuca_railway_2_flag
			500 = {
				add_dynamic_modifier = {
					modifier = dynmod_BRA_railways_by_free_workers
					days = 240
				}
			}
			country_event = { id = brazil.539 days = 240 }
		}
	}
	option = {
		name = brazil.537.c
		ai_chance = { base = 25 }
		add_political_power = -30
		add_timed_idea = { idea = BRA_the_tijuca_railway_3 days = 200 }
		hidden_effect = {
			set_country_flag = brazil_the_tijuca_railway_3_flag
			500 = {
				add_dynamic_modifier = {
					modifier = dynmod_BRA_railways_by_companies
					days = 200
				} 
			}
			country_event = { id = brazil.539 days = 200 }
		}
	}
	option = {
		name = brazil.537.e
		ai_chance = { base = 25 }
		country_event = { id = brazil.538 }
	}
}

country_event = {
	id = brazil.538
	title = brazil.538.t
	desc = brazil.538.d
	is_triggered_only = yes
	option = {
		name = brazil.538.a
		ai_chance = { base = 25 }
		add_political_power = -10
		add_timed_idea = { idea = BRA_the_tijuca_railway_4 days = 280 }
		hidden_effect = {
			set_country_flag = brazil_the_tijuca_railway_4_flag
			500 = {

				add_dynamic_modifier = {
					modifier = dynmod_BRA_railways_by_slaves
					days = 280
				}
			}
			country_event = { id = brazil.539 days = 280 }
		}
	}
	option = {
		name = brazil.538.b
		ai_chance = { base = 25 }
		add_political_power = -20
		add_timed_idea = { idea = BRA_the_tijuca_railway_5 days = 240 }
		hidden_effect = {
			set_country_flag = brazil_the_tijuca_railway_5_flag
			500 = {
				add_dynamic_modifier = {
					modifier = dynmod_BRA_railways_by_free_workers
					days = 240
				}
			}
			country_event = { id = brazil.539 days = 240 }
		}
	}
	option = {
		name = brazil.538.c
		ai_chance = { base = 25 }
		add_political_power = -30
		add_timed_idea = { idea = BRA_the_tijuca_railway_6 days = 200 }
		hidden_effect = {
			set_country_flag = brazil_the_tijuca_railway_6_flag
			500 = {
				add_dynamic_modifier = {
					modifier = dynmod_BRA_railways_by_companies
					days = 200
				} 
			}
			country_event = { id = brazil.539 days = 200 }
		}
	}
	option = {
		name = brazil.538.e
		ai_chance = { base = 25 }
		country_event = { id = brazil.537 }
	}
}

country_event = {
	id = brazil.539
	title = brazil.539.t
	desc = brazil.539.d
	picture = GFX_report_event_generic_railway_opening
	is_triggered_only = yes
	option = {
        name = brazil.539.a
		ai_chance = { base = 100 }
		if = {
			limit = { has_country_flag = brazil_the_tijuca_railway_1_flag }
			build_railway = {
				level = 1
				path = { 12466 14019 }
			}
			EOANBSYS_institutions_innovative_add_one = yes
			set_temp_variable = { eoanb_prestige_change = 1 }
			eoanb_change_prestige_score = yes
			add_tech_bonus = { bonus = 0.5 uses = 1 category = humanities_tech }
			add_tech_bonus = { bonus = 0.5 uses = 1 category = trains_tech }
			add_tech_bonus = { bonus = 0.5 uses = 1 category = transport_tech }
			hidden_effect = { 
				clr_country_flag = brazil_the_tijuca_railway_1_flag
			}
		}
		else_if = {
			limit = { has_country_flag = brazil_the_tijuca_railway_2_flag }
			build_railway = {
				level = 1
				path = { 12466 14019 }
			}
			EOANBSYS_institutions_innovative_add_one = yes
			set_temp_variable = { eoanb_prestige_change = 1 }
			eoanb_change_prestige_score = yes
			add_tech_bonus = { bonus = 0.5 uses = 1 category = humanities_tech }
			add_tech_bonus = { bonus = 0.5 uses = 1 category = trains_tech }
			add_tech_bonus = { bonus = 0.5 uses = 1 category = transport_tech }
			hidden_effect = { 
				clr_country_flag = brazil_the_tijuca_railway_2_flag
			}
		}
		else_if = {
			limit = { has_country_flag = brazil_the_tijuca_railway_3_flag }
			build_railway = {
				level = 1
				path = { 12466 14019 }
			}
			EOANBSYS_institutions_innovative_add_one = yes
			set_temp_variable = { eoanb_prestige_change = 1 }
			eoanb_change_prestige_score = yes
			add_tech_bonus = { bonus = 0.5 uses = 1 category = humanities_tech }
			add_tech_bonus = { bonus = 0.5 uses = 1 category = trains_tech }
			add_tech_bonus = { bonus = 0.5 uses = 1 category = transport_tech }
			hidden_effect = { 
				clr_country_flag = brazil_the_tijuca_railway_3_flag
			}
		}
		else_if = {
			limit = { has_country_flag = brazil_the_tijuca_railway_4_flag }
			build_railway = {
				level = 2
				path = { 12466 14019 }
			}
			EOANBSYS_institutions_innovative_add_two = yes
			set_temp_variable = { eoanb_prestige_change = 2 }
			eoanb_change_prestige_score = yes
			add_tech_bonus = { bonus = 0.5 uses = 2 category = humanities_tech }
			add_tech_bonus = { bonus = 0.5 uses = 2 category = trains_tech }
			add_tech_bonus = { bonus = 0.5 uses = 2 category = transport_tech }
			hidden_effect = { 
				clr_country_flag = brazil_the_tijuca_railway_4_flag
			}
		}
		else_if = {
			limit = { has_country_flag = brazil_the_tijuca_railway_5_flag }
			build_railway = {
				level = 2
				path = { 12466 14019 }
			}
			EOANBSYS_institutions_innovative_add_two = yes
			set_temp_variable = { eoanb_prestige_change = 2 }
			eoanb_change_prestige_score = yes
			add_tech_bonus = { bonus = 0.5 uses = 2 category = humanities_tech }
			add_tech_bonus = { bonus = 0.5 uses = 2 category = trains_tech }
			add_tech_bonus = { bonus = 0.5 uses = 2 category = transport_tech }
			hidden_effect = { 
				clr_country_flag = brazil_the_tijuca_railway_5_flag
			}
		}
		else_if = {
			limit = { has_country_flag = brazil_the_tijuca_railway_6_flag }
			build_railway = {
				level = 2
				path = { 12466 14019 }
			}
			EOANBSYS_institutions_innovative_add_two = yes
			set_temp_variable = { eoanb_prestige_change = 2 }
			eoanb_change_prestige_score = yes
			add_tech_bonus = { bonus = 0.5 uses = 2 category = humanities_tech }
			add_tech_bonus = { bonus = 0.5 uses = 2 category = trains_tech }
			add_tech_bonus = { bonus = 0.5 uses = 2 category = transport_tech }
			hidden_effect = { 
				clr_country_flag = brazil_the_tijuca_railway_6_flag
			}
		}
	}
}

#The North Railway
country_event = {
	id = brazil.540
	title = brazil.540.t
	desc = brazil.540.d
	is_triggered_only = yes
	option = {
		name = brazil.540.a
		ai_chance = { base = 25 }
		add_political_power = -10
		add_timed_idea = { idea = BRA_the_north_railway_1 days = 280 }
		hidden_effect = {
			set_country_flag = brazil_the_north_railway_1_flag
			501 = {

				add_dynamic_modifier = {
					modifier = dynmod_BRA_railways_by_slaves
					days = 280
				}
			}
			country_event = { id = brazil.542 days = 280 }
		}
	}
	option = {
		name = brazil.540.b
		ai_chance = { base = 25 }
		add_political_power = -20
		add_timed_idea = { idea = BRA_the_north_railway_2 days = 240 }
		hidden_effect = {
			set_country_flag = brazil_the_north_railway_2_flag
			501 = {
				add_dynamic_modifier = {
					modifier = dynmod_BRA_railways_by_free_workers
					days = 240
				}
			}
			country_event = { id = brazil.542 days = 240 }
		}
	}
	option = {
		name = brazil.540.c
		ai_chance = { base = 25 }
		add_political_power = -30
		add_timed_idea = { idea = BRA_the_north_railway_3 days = 200 }
		hidden_effect = {
			set_country_flag = brazil_the_north_railway_3_flag
			501 = {
				add_dynamic_modifier = {
					modifier = dynmod_BRA_railways_by_companies
					days = 200
				} 
			}
			country_event = { id = brazil.542 days = 200 }
		}
	}
	option = {
		name = brazil.540.e
		ai_chance = { base = 25 }
		country_event = { id = brazil.541 }
	}
}

country_event = {
	id = brazil.541
	title = brazil.541.t
	desc = brazil.541.d
	is_triggered_only = yes
	option = {
		name = brazil.541.a
		ai_chance = { base = 25 }
		add_political_power = -10
		add_timed_idea = { idea = BRA_the_north_railway_4 days = 280 }
		hidden_effect = {
			set_country_flag = brazil_the_north_railway_4_flag
			501 = {

				add_dynamic_modifier = {
					modifier = dynmod_BRA_railways_by_slaves
					days = 280
				}
			}
			country_event = { id = brazil.542 days = 280 }
		}
	}
	option = {
		name = brazil.541.b
		ai_chance = { base = 25 }
		add_political_power = -20
		add_timed_idea = { idea = BRA_the_north_railway_5 days = 240 }
		hidden_effect = {
			set_country_flag = brazil_the_north_railway_5_flag
			501 = {
				add_dynamic_modifier = {
					modifier = dynmod_BRA_railways_by_free_workers
					days = 240
				}
			}
			country_event = { id = brazil.542 days = 240 }
		}
	}
	option = {
		name = brazil.541.c
		ai_chance = { base = 25 }
		add_political_power = -30
		add_timed_idea = { idea = BRA_the_north_railway_6 days = 200 }
		hidden_effect = {
			set_country_flag = brazil_the_north_railway_6_flag
			501 = {
				add_dynamic_modifier = {
					modifier = dynmod_BRA_railways_by_companies
					days = 200
				} 
			}
			country_event = { id = brazil.542 days = 200 }
		}
	}
	option = {
		name = brazil.541.e
		ai_chance = { base = 25 }
		country_event = { id = brazil.540 }
	}
}

country_event = {
	id = brazil.542
	title = brazil.542.t
	desc = brazil.542.d
	picture = GFX_report_event_generic_railway_opening
	is_triggered_only = yes
	option = {
        name = brazil.542.a
		ai_chance = { base = 100 }
		if = {
			limit = { has_country_flag = brazil_the_north_railway_1_flag }
			build_railway = {
				level = 1
				path = { 14017 14016 14018 }
			}
			EOANBSYS_institutions_innovative_add_one = yes
			set_temp_variable = { eoanb_prestige_change = 1 }
			eoanb_change_prestige_score = yes
			add_tech_bonus = { bonus = 0.5 uses = 1 category = humanities_tech }
			add_tech_bonus = { bonus = 0.5 uses = 1 category = trains_tech }
			add_tech_bonus = { bonus = 0.5 uses = 1 category = transport_tech }
			hidden_effect = { 
				clr_country_flag = brazil_the_north_railway_1_flag
			}
		}
		else_if = {
			limit = { has_country_flag = brazil_the_north_railway_2_flag }
			build_railway = {
				level = 1
				path = { 14017 14016 14018 }
			}
			EOANBSYS_institutions_innovative_add_one = yes
			set_temp_variable = { eoanb_prestige_change = 1 }
			eoanb_change_prestige_score = yes
			add_tech_bonus = { bonus = 0.5 uses = 1 category = humanities_tech }
			add_tech_bonus = { bonus = 0.5 uses = 1 category = trains_tech }
			add_tech_bonus = { bonus = 0.5 uses = 1 category = transport_tech }
			hidden_effect = { 
				clr_country_flag = brazil_the_north_railway_2_flag
			}
		}
		else_if = {
			limit = { has_country_flag = brazil_the_north_railway_3_flag }
			build_railway = {
				level = 1
				path = { 14017 14016 14018 }
			}
			EOANBSYS_institutions_innovative_add_one = yes
			set_temp_variable = { eoanb_prestige_change = 1 }
			eoanb_change_prestige_score = yes
			add_tech_bonus = { bonus = 0.5 uses = 1 category = humanities_tech }
			add_tech_bonus = { bonus = 0.5 uses = 1 category = trains_tech }
			add_tech_bonus = { bonus = 0.5 uses = 1 category = transport_tech }
			hidden_effect = { 
				clr_country_flag = brazil_the_north_railway_3_flag
			}
		}
		else_if = {
			limit = { has_country_flag = brazil_the_north_railway_4_flag }
			build_railway = {
				level = 2
				path = { 14017 14016 14018 }
			}
			EOANBSYS_institutions_innovative_add_two = yes
			set_temp_variable = { eoanb_prestige_change = 2 }
			eoanb_change_prestige_score = yes
			add_tech_bonus = { bonus = 0.5 uses = 2 category = humanities_tech }
			add_tech_bonus = { bonus = 0.5 uses = 2 category = trains_tech }
			add_tech_bonus = { bonus = 0.5 uses = 2 category = transport_tech }
			hidden_effect = { 
				clr_country_flag = brazil_the_north_railway_4_flag
			}
		}
		else_if = {
			limit = { has_country_flag = brazil_the_north_railway_5_flag }
			build_railway = {
				level = 2
				path = { 14017 14016 14018 }
			}
			EOANBSYS_institutions_innovative_add_two = yes
			set_temp_variable = { eoanb_prestige_change = 2 }
			eoanb_change_prestige_score = yes
			add_tech_bonus = { bonus = 0.5 uses = 2 category = humanities_tech }
			add_tech_bonus = { bonus = 0.5 uses = 2 category = trains_tech }
			add_tech_bonus = { bonus = 0.5 uses = 2 category = transport_tech }
			hidden_effect = { 
				clr_country_flag = brazil_the_north_railway_5_flag
			}
		}
		else_if = {
			limit = { has_country_flag = brazil_the_north_railway_6_flag }
			build_railway = {
				level = 2
				path = { 14017 14016 14018 }
			}
			EOANBSYS_institutions_innovative_add_two = yes
			set_temp_variable = { eoanb_prestige_change = 2 }
			eoanb_change_prestige_score = yes
			add_tech_bonus = { bonus = 0.5 uses = 2 category = humanities_tech }
			add_tech_bonus = { bonus = 0.5 uses = 2 category = trains_tech }
			add_tech_bonus = { bonus = 0.5 uses = 2 category = transport_tech }
			hidden_effect = { 
				clr_country_flag = brazil_the_north_railway_6_flag
			}
		}
	}
}

#The Mauá Railway
country_event = {
	id = brazil.543
	title = brazil.543.t
	desc = brazil.543.d
	is_triggered_only = yes
	option = {
		name = brazil.543.a
		ai_chance = { base = 25 }
		add_political_power = -10
		add_timed_idea = { idea = BRA_the_maua_railway_1 days = 280 }
		hidden_effect = {
			set_country_flag = brazil_the_maua_railway_1_flag
			500 = {

				add_dynamic_modifier = {
					modifier = dynmod_BRA_railways_by_slaves
					days = 280
				}
			}
			country_event = { id = brazil.545 days = 280 }
		}
	}
	option = {
		name = brazil.543.b
		ai_chance = { base = 25 }
		add_political_power = -20
		add_timed_idea = { idea = BRA_the_maua_railway_2 days = 240 }
		hidden_effect = {
			set_country_flag = brazil_the_maua_railway_2_flag
			500 = {
				add_dynamic_modifier = {
					modifier = dynmod_BRA_railways_by_free_workers
					days = 240
				}
			}
			country_event = { id = brazil.545 days = 240 }
		}
	}
	option = {
		name = brazil.543.c
		ai_chance = { base = 25 }
		add_political_power = -30
		add_timed_idea = { idea = BRA_the_maua_railway_3 days = 200 }
		hidden_effect = {
			set_country_flag = brazil_the_maua_railway_3_flag
			500 = {
				add_dynamic_modifier = {
					modifier = dynmod_BRA_railways_by_companies
					days = 200
				} 
			}
			country_event = { id = brazil.545 days = 200 }
		}
	}
	option = {
		name = brazil.543.e
		ai_chance = { base = 25 }
		country_event = { id = brazil.544 }
	}
}

country_event = {
	id = brazil.544
	title = brazil.544.t
	desc = brazil.544.d
	is_triggered_only = yes
	option = {
		name = brazil.544.a
		ai_chance = { base = 25 }
		add_political_power = -10
		add_timed_idea = { idea = BRA_the_maua_railway_4 days = 280 }
		hidden_effect = {
			set_country_flag = brazil_the_maua_railway_4_flag
			500 = {

				add_dynamic_modifier = {
					modifier = dynmod_BRA_railways_by_slaves
					days = 280
				}
			}
			country_event = { id = brazil.545 days = 280 }
		}
	}
	option = {
		name = brazil.544.b
		ai_chance = { base = 25 }
		add_political_power = -20
		add_timed_idea = { idea = BRA_the_maua_railway_5 days = 240 }
		hidden_effect = {
			set_country_flag = brazil_the_maua_railway_5_flag
			500 = {
				add_dynamic_modifier = {
					modifier = dynmod_BRA_railways_by_free_workers
					days = 240
				}
			}
			country_event = { id = brazil.545 days = 240 }
		}
	}
	option = {
		name = brazil.544.c
		ai_chance = { base = 25 }
		add_political_power = -30
		add_timed_idea = { idea = BRA_the_maua_railway_6 days = 200 }
		hidden_effect = {
			set_country_flag = brazil_the_maua_railway_6_flag
			500 = {
				add_dynamic_modifier = {
					modifier = dynmod_BRA_railways_by_companies
					days = 200
				} 
			}
			country_event = { id = brazil.545 days = 200 }
		}
	}
	option = {
		name = brazil.544.e
		ai_chance = { base = 25 }
		country_event = { id = brazil.543 }
	}
}

country_event = {
	id = brazil.545
	title = brazil.545.t
	desc = brazil.545.d
	picture = GFX_report_event_generic_railway_opening
	is_triggered_only = yes
	option = {
        name = brazil.545.a
		ai_chance = { base = 100 }
		if = {
			limit = { has_country_flag = brazil_the_maua_railway_1_flag }
			build_railway = {
				level = 1
				path = { 12466 14019 10980 13983 5172 13964 }
			}
			build_railway = {
				level = 1
				path = { 13964 12334 }
			}
			EOANBSYS_institutions_innovative_add_one = yes
			set_temp_variable = { eoanb_prestige_change = 1 }
			eoanb_change_prestige_score = yes
			add_tech_bonus = { bonus = 0.5 uses = 1 category = humanities_tech }
			add_tech_bonus = { bonus = 0.5 uses = 1 category = trains_tech }
			add_tech_bonus = { bonus = 0.5 uses = 1 category = transport_tech }
			hidden_effect = { 
				clr_country_flag = brazil_the_maua_railway_1_flag
			}
		}
		else_if = {
			limit = { has_country_flag = brazil_the_maua_railway_2_flag }
			build_railway = {
				level = 1
				path = { 12466 14019 10980 13983 5172 13964 }
			}
			build_railway = {
				level = 1
				path = { 13964 12334 }
			}
			EOANBSYS_institutions_innovative_add_one = yes
			set_temp_variable = { eoanb_prestige_change = 1 }
			eoanb_change_prestige_score = yes
			add_tech_bonus = { bonus = 0.5 uses = 1 category = humanities_tech }
			add_tech_bonus = { bonus = 0.5 uses = 1 category = trains_tech }
			add_tech_bonus = { bonus = 0.5 uses = 1 category = transport_tech }
			hidden_effect = { 
				clr_country_flag = brazil_the_maua_railway_2_flag
			}
		}
		else_if = {
			limit = { has_country_flag = brazil_the_maua_railway_3_flag }
			build_railway = {
				level = 1
				path = { 12466 14019 10980 13983 5172 13964 }
			}
			build_railway = {
				level = 1
				path = { 13964 12334 }
			}
			EOANBSYS_institutions_innovative_add_one = yes
			set_temp_variable = { eoanb_prestige_change = 1 }
			eoanb_change_prestige_score = yes
			add_tech_bonus = { bonus = 0.5 uses = 1 category = humanities_tech }
			add_tech_bonus = { bonus = 0.5 uses = 1 category = trains_tech }
			add_tech_bonus = { bonus = 0.5 uses = 1 category = transport_tech }
			hidden_effect = { 
				clr_country_flag = brazil_the_maua_railway_3_flag
			}
		}
		else_if = {
			limit = { has_country_flag = brazil_the_maua_railway_4_flag }
			build_railway = {
				level = 2
				path = { 12466 14019 10980 13983 5172 13964 }
			}
			build_railway = {
				level = 2
				path = { 13964 12334 }
			}
			EOANBSYS_institutions_innovative_add_two = yes
			set_temp_variable = { eoanb_prestige_change = 2 }
			eoanb_change_prestige_score = yes
			add_tech_bonus = { bonus = 0.5 uses = 2 category = humanities_tech }
			add_tech_bonus = { bonus = 0.5 uses = 2 category = trains_tech }
			add_tech_bonus = { bonus = 0.5 uses = 2 category = transport_tech }
			hidden_effect = { 
				clr_country_flag = brazil_the_maua_railway_4_flag
			}
		}
		else_if = {
			limit = { has_country_flag = brazil_the_maua_railway_5_flag }
			build_railway = {
				level = 2
				path = { 12466 14019 10980 13983 5172 13964 }
			}
			build_railway = {
				level = 2
				path = { 13964 12334 }
			}
			EOANBSYS_institutions_innovative_add_two = yes
			set_temp_variable = { eoanb_prestige_change = 2 }
			eoanb_change_prestige_score = yes
			add_tech_bonus = { bonus = 0.5 uses = 2 category = humanities_tech }
			add_tech_bonus = { bonus = 0.5 uses = 2 category = trains_tech }
			add_tech_bonus = { bonus = 0.5 uses = 2 category = transport_tech }
			hidden_effect = { 
				clr_country_flag = brazil_the_maua_railway_5_flag
			}
		}
		else_if = {
			limit = { has_country_flag = brazil_the_maua_railway_6_flag }
			build_railway = {
				level = 2
				path = { 12466 14019 10980 13983 5172 13964 }
			}
			build_railway = {
				level = 2
				path = { 13964 12334 }
			}
			EOANBSYS_institutions_innovative_add_two = yes
			set_temp_variable = { eoanb_prestige_change = 2 }
			eoanb_change_prestige_score = yes
			add_tech_bonus = { bonus = 0.5 uses = 2 category = humanities_tech }
			add_tech_bonus = { bonus = 0.5 uses = 2 category = trains_tech }
			add_tech_bonus = { bonus = 0.5 uses = 2 category = transport_tech }
			hidden_effect = { 
				clr_country_flag = brazil_the_maua_railway_6_flag
			}
		}
	}
}

#The Paranaguá Curitiba Railway
country_event = {
	id = brazil.546
	title = brazil.546.t
	desc = brazil.546.d
	is_triggered_only = yes
	option = {
		name = brazil.546.a
		ai_chance = { base = 25 }
		add_political_power = -10
		add_timed_idea = { idea = BRA_the_paranagua_curitiba_railway_1 days = 280 }
		hidden_effect = {
			set_country_flag = brazil_the_paranagua_curitiba_railway_1_flag
			1036 = {

				add_dynamic_modifier = {
					modifier = dynmod_BRA_railways_by_slaves
					days = 280
				}
			}
			country_event = { id = brazil.548 days = 280 }
		}
	}
	option = {
		name = brazil.546.b
		ai_chance = { base = 25 }
		add_political_power = -20
		add_timed_idea = { idea = BRA_the_paranagua_curitiba_railway_2 days = 240 }
		hidden_effect = {
			set_country_flag = brazil_the_paranagua_curitiba_railway_2_flag
			1036 = {
				add_dynamic_modifier = {
					modifier = dynmod_BRA_railways_by_free_workers
					days = 240
				}
			}
			country_event = { id = brazil.548 days = 240 }
		}
	}
	option = {
		name = brazil.546.c
		ai_chance = { base = 25 }
		add_political_power = -30
		add_timed_idea = { idea = BRA_the_paranagua_curitiba_railway_3 days = 200 }
		hidden_effect = {
			set_country_flag = brazil_the_paranagua_curitiba_railway_3_flag
			1036 = {
				add_dynamic_modifier = {
					modifier = dynmod_BRA_railways_by_companies
					days = 200
				} 
			}
			country_event = { id = brazil.548 days = 200 }
		}
	}
	option = {
		name = brazil.546.e
		ai_chance = { base = 25 }
		country_event = { id = brazil.547 }
	}
}

country_event = {
	id = brazil.547
	title = brazil.547.t
	desc = brazil.547.d
	is_triggered_only = yes
	option = {
		name = brazil.547.a
		ai_chance = { base = 25 }
		add_political_power = -10
		add_timed_idea = { idea = BRA_the_paranagua_curitiba_railway_4 days = 280 }
		hidden_effect = {
			set_country_flag = brazil_the_paranagua_curitiba_railway_4_flag
			1036 = {

				add_dynamic_modifier = {
					modifier = dynmod_BRA_railways_by_slaves
					days = 280
				}
			}
			country_event = { id = brazil.548 days = 280 }
		}
	}
	option = {
		name = brazil.547.b
		ai_chance = { base = 25 }
		add_political_power = -20
		add_timed_idea = { idea = BRA_the_paranagua_curitiba_railway_5 days = 240 }
		hidden_effect = {
			set_country_flag = brazil_the_paranagua_curitiba_railway_5_flag
			1036 = {
				add_dynamic_modifier = {
					modifier = dynmod_BRA_railways_by_free_workers
					days = 240
				}
			}
			country_event = { id = brazil.548 days = 240 }
		}
	}
	option = {
		name = brazil.547.c
		ai_chance = { base = 25 }
		add_political_power = -30
		add_timed_idea = { idea = BRA_the_paranagua_curitiba_railway_6 days = 200 }
		hidden_effect = {
			set_country_flag = brazil_the_paranagua_curitiba_railway_6_flag
			1036 = {
				add_dynamic_modifier = {
					modifier = dynmod_BRA_railways_by_companies
					days = 200
				} 
			}
			country_event = { id = brazil.548 days = 200 }
		}
	}
	option = {
		name = brazil.547.e
		ai_chance = { base = 25 }
		country_event = { id = brazil.546 }
	}
}

country_event = {
	id = brazil.548
	title = brazil.548.t
	desc = brazil.548.d
	picture = GFX_report_event_generic_railway_opening
	is_triggered_only = yes
	option = {
        name = brazil.548.a
		ai_chance = { base = 100 }
		if = {
			limit = { has_country_flag = brazil_the_paranagua_curitiba_railway_1_flag }
			build_railway = {
				level = 1
				path = { 14024 8181 14055 }
			}
			build_railway = {
				level = 1
				path = { 8181 8239 }
			}
			build_railway = {
				level = 1
				path = { 8181 5156 }
			}
			EOANBSYS_institutions_innovative_add_one = yes
			set_temp_variable = { eoanb_prestige_change = 1 }
			eoanb_change_prestige_score = yes
			add_tech_bonus = { bonus = 0.5 uses = 1 category = humanities_tech }
			add_tech_bonus = { bonus = 0.5 uses = 1 category = trains_tech }
			add_tech_bonus = { bonus = 0.5 uses = 1 category = transport_tech }
			hidden_effect = { 
				clr_country_flag = brazil_the_paranagua_curitiba_railway_1_flag
			}
		}
		else_if = {
			limit = { has_country_flag = brazil_the_paranagua_curitiba_railway_2_flag }
			build_railway = {
				level = 1
				path = { 14024 8181 14055 }
			}
			build_railway = {
				level = 1
				path = { 8181 8239 }
			}
			build_railway = {
				level = 1
				path = { 8181 5156 }
			}
			EOANBSYS_institutions_innovative_add_one = yes
			set_temp_variable = { eoanb_prestige_change = 1 }
			eoanb_change_prestige_score = yes
			add_tech_bonus = { bonus = 0.5 uses = 1 category = humanities_tech }
			add_tech_bonus = { bonus = 0.5 uses = 1 category = trains_tech }
			add_tech_bonus = { bonus = 0.5 uses = 1 category = transport_tech }
			hidden_effect = { 
				clr_country_flag = brazil_the_paranagua_curitiba_railway_2_flag
			}
		}
		else_if = {
			limit = { has_country_flag = brazil_the_paranagua_curitiba_railway_3_flag }
			build_railway = {
				level = 1
				path = { 14024 8181 14055 }
			}
			build_railway = {
				level = 1
				path = { 8181 8239 }
			}
			build_railway = {
				level = 1
				path = { 8181 5156 }
			}
			EOANBSYS_institutions_innovative_add_one = yes
			set_temp_variable = { eoanb_prestige_change = 1 }
			eoanb_change_prestige_score = yes
			add_tech_bonus = { bonus = 0.5 uses = 1 category = humanities_tech }
			add_tech_bonus = { bonus = 0.5 uses = 1 category = trains_tech }
			add_tech_bonus = { bonus = 0.5 uses = 1 category = transport_tech }
			hidden_effect = { 
				clr_country_flag = brazil_the_paranagua_curitiba_railway_3_flag
			}
		}
		else_if = {
			limit = { has_country_flag = brazil_the_paranagua_curitiba_railway_4_flag }
			build_railway = {
				level = 2
				path = { 14024 8181 14055 }
			}
			build_railway = {
				level = 2
				path = { 8181 8239 }
			}
			build_railway = {
				level = 2
				path = { 8181 5156 }
			}
			EOANBSYS_institutions_innovative_add_two = yes
			set_temp_variable = { eoanb_prestige_change = 2 }
			eoanb_change_prestige_score = yes
			add_tech_bonus = { bonus = 0.5 uses = 2 category = humanities_tech }
			add_tech_bonus = { bonus = 0.5 uses = 2 category = trains_tech }
			add_tech_bonus = { bonus = 0.5 uses = 2 category = transport_tech }
			hidden_effect = { 
				clr_country_flag = brazil_the_paranagua_curitiba_railway_4_flag
			}
		}
		else_if = {
			limit = { has_country_flag = brazil_the_paranagua_curitiba_railway_5_flag }
			build_railway = {
				level = 2
				path = { 14024 8181 14055 }
			}
			build_railway = {
				level = 2
				path = { 8181 8239 }
			}
			build_railway = {
				level = 2
				path = { 8181 5156 }
			}
			EOANBSYS_institutions_innovative_add_two = yes
			set_temp_variable = { eoanb_prestige_change = 2 }
			eoanb_change_prestige_score = yes
			add_tech_bonus = { bonus = 0.5 uses = 2 category = humanities_tech }
			add_tech_bonus = { bonus = 0.5 uses = 2 category = trains_tech }
			add_tech_bonus = { bonus = 0.5 uses = 2 category = transport_tech }
			hidden_effect = { 
				clr_country_flag = brazil_the_paranagua_curitiba_railway_5_flag
			}
		}
		else_if = {
			limit = { has_country_flag = brazil_the_paranagua_curitiba_railway_6_flag }
			build_railway = {
				level = 2
				path = { 14024 8181 14055 }
			}
			build_railway = {
				level = 2
				path = { 8181 8239 }
			}
			build_railway = {
				level = 2
				path = { 8181 5156 }
			}
			EOANBSYS_institutions_innovative_add_two = yes
			set_temp_variable = { eoanb_prestige_change = 2 }
			eoanb_change_prestige_score = yes
			add_tech_bonus = { bonus = 0.5 uses = 2 category = humanities_tech }
			add_tech_bonus = { bonus = 0.5 uses = 2 category = trains_tech }
			add_tech_bonus = { bonus = 0.5 uses = 2 category = transport_tech }
			hidden_effect = { 
				clr_country_flag = brazil_the_paranagua_curitiba_railway_6_flag
			}
		}
	}
}

#The Bahia and São Francisco Railway
country_event = {
	id = brazil.549
	title = brazil.549.t
	desc = brazil.549.d
	is_triggered_only = yes
	option = {
		name = brazil.549.a
		ai_chance = { base = 25 }
		add_political_power = -10
		add_timed_idea = { idea = BRA_the_bahia_and_sao_francisco_railway_1 days = 360 }
		hidden_effect = {
			set_country_flag = brazil_the_bahia_and_sao_francisco_railway_1_flag
			499 = {

				add_dynamic_modifier = {
					modifier = dynmod_BRA_railways_by_slaves
					days = 360
				}
			}
			country_event = { id = brazil.551 days = 360 }
		}
	}
	option = {
		name = brazil.549.b
		ai_chance = { base = 25 }
		add_political_power = -20
		add_timed_idea = { idea = BRA_the_bahia_and_sao_francisco_railway_2 days = 320 }
		hidden_effect = {
			set_country_flag = brazil_the_bahia_and_sao_francisco_railway_2_flag
			499 = {
				add_dynamic_modifier = {
					modifier = dynmod_BRA_railways_by_free_workers
					days = 320
				}
			}
			country_event = { id = brazil.551 days = 320 }
		}
	}
	option = {
		name = brazil.549.c
		ai_chance = { base = 25 }
		add_political_power = -30
		add_timed_idea = { idea = BRA_the_bahia_and_sao_francisco_railway_3 days = 280 }
		hidden_effect = {
			set_country_flag = brazil_the_bahia_and_sao_francisco_railway_3_flag
			499 = {
				add_dynamic_modifier = {
					modifier = dynmod_BRA_railways_by_companies
					days = 280
				} 
			}
			country_event = { id = brazil.551 days = 280 }
		}
	}
	option = {
		name = brazil.549.e
		ai_chance = { base = 25 }
		country_event = { id = brazil.550 }
	}
}

country_event = {
	id = brazil.550
	title = brazil.550.t
	desc = brazil.550.d
	is_triggered_only = yes
	option = {
		name = brazil.550.a
		ai_chance = { base = 25 }
		add_political_power = -10
		add_timed_idea = { idea = BRA_the_bahia_and_sao_francisco_railway_4 days = 360 }
		hidden_effect = {
			set_country_flag = brazil_the_bahia_and_sao_francisco_railway_4_flag
			499 = {

				add_dynamic_modifier = {
					modifier = dynmod_BRA_railways_by_slaves
					days = 360
				}
			}
			country_event = { id = brazil.551 days = 360 }
		}
	}
	option = {
		name = brazil.550.b
		ai_chance = { base = 25 }
		add_political_power = -20
		add_timed_idea = { idea = BRA_the_bahia_and_sao_francisco_railway_5 days = 320 }
		hidden_effect = {
			set_country_flag = brazil_the_bahia_and_sao_francisco_railway_5_flag
			499 = {
				add_dynamic_modifier = {
					modifier = dynmod_BRA_railways_by_free_workers
					days = 320
				}
			}
			country_event = { id = brazil.551 days = 320 }
		}
	}
	option = {
		name = brazil.550.c
		ai_chance = { base = 25 }
		add_political_power = -30
		add_timed_idea = { idea = BRA_the_bahia_and_sao_francisco_railway_6 days = 280 }
		hidden_effect = {
			set_country_flag = brazil_the_bahia_and_sao_francisco_railway_6_flag
			499 = {
				add_dynamic_modifier = {
					modifier = dynmod_BRA_railways_by_companies
					days = 280
				} 
			}
			country_event = { id = brazil.551 days = 280 }
		}
	}
	option = {
		name = brazil.550.e
		ai_chance = { base = 25 }
		country_event = { id = brazil.549 }
	}
}

country_event = {
	id = brazil.551
	title = brazil.551.t
	desc = brazil.551.d
	picture = GFX_report_event_generic_railway_opening
	is_triggered_only = yes
	option = {
        name = brazil.551.a
		ai_chance = { base = 100 }
		if = {
			limit = { has_country_flag = brazil_the_bahia_and_sao_francisco_railway_1_flag }
			build_railway = {
				level = 1
				path = { 10946 14027 14028 1430 4617 8242 }
			}
			build_railway = {
				level = 1
				path = { 10946 14029 14031 }
			}
			EOANBSYS_institutions_innovative_add_one = yes
			set_temp_variable = { eoanb_prestige_change = 1 }
			eoanb_change_prestige_score = yes
			add_tech_bonus = { bonus = 0.5 uses = 1 category = humanities_tech }
			add_tech_bonus = { bonus = 0.5 uses = 1 category = trains_tech }
			add_tech_bonus = { bonus = 0.5 uses = 1 category = transport_tech }
			hidden_effect = { 
				clr_country_flag = brazil_the_bahia_and_sao_francisco_railway_1_flag
			}
		}
		else_if = {
			limit = { has_country_flag = brazil_the_bahia_and_sao_francisco_railway_2_flag }
			build_railway = {
				level = 1
				path = { 10946 14027 14028 1430 4617 8242 }
			}
			build_railway = {
				level = 1
				path = { 10946 14029 14031 }
			}
			EOANBSYS_institutions_innovative_add_one = yes
			set_temp_variable = { eoanb_prestige_change = 1 }
			eoanb_change_prestige_score = yes
			add_tech_bonus = { bonus = 0.5 uses = 1 category = humanities_tech }
			add_tech_bonus = { bonus = 0.5 uses = 1 category = trains_tech }
			add_tech_bonus = { bonus = 0.5 uses = 1 category = transport_tech }
			hidden_effect = { 
				clr_country_flag = brazil_the_bahia_and_sao_francisco_railway_2_flag
			}
		}
		else_if = {
			limit = { has_country_flag = brazil_the_bahia_and_sao_francisco_railway_3_flag }
			build_railway = {
				level = 1
				path = { 10946 14027 14028 1430 4617 8242 }
			}
			build_railway = {
				level = 1
				path = { 10946 14029 14031 }
			}
			EOANBSYS_institutions_innovative_add_one = yes
			set_temp_variable = { eoanb_prestige_change = 1 }
			eoanb_change_prestige_score = yes
			add_tech_bonus = { bonus = 0.5 uses = 1 category = humanities_tech }
			add_tech_bonus = { bonus = 0.5 uses = 1 category = trains_tech }
			add_tech_bonus = { bonus = 0.5 uses = 1 category = transport_tech }
			hidden_effect = { 
				clr_country_flag = brazil_the_bahia_and_sao_francisco_railway_3_flag
			}
		}
		else_if = {
			limit = { has_country_flag = brazil_the_bahia_and_sao_francisco_railway_4_flag }
			build_railway = {
				level = 2
				path = { 10946 14027 14028 1430 4617 8242 }
			}
			build_railway = {
				level = 2
				path = { 10946 14029 14031 }
			}
			EOANBSYS_institutions_innovative_add_two = yes
			set_temp_variable = { eoanb_prestige_change = 2 }
			eoanb_change_prestige_score = yes
			add_tech_bonus = { bonus = 0.5 uses = 2 category = humanities_tech }
			add_tech_bonus = { bonus = 0.5 uses = 2 category = trains_tech }
			add_tech_bonus = { bonus = 0.5 uses = 2 category = transport_tech }
			hidden_effect = { 
				clr_country_flag = brazil_the_bahia_and_sao_francisco_railway_4_flag
			}
		}
		else_if = {
			limit = { has_country_flag = brazil_the_bahia_and_sao_francisco_railway_5_flag }
			build_railway = {
				level = 2
				path = { 10946 14027 14028 1430 4617 8242 }
			}
			build_railway = {
				level = 2
				path = { 10946 14029 14031 }
			}
			EOANBSYS_institutions_innovative_add_two = yes
			set_temp_variable = { eoanb_prestige_change = 2 }
			eoanb_change_prestige_score = yes
			add_tech_bonus = { bonus = 0.5 uses = 2 category = humanities_tech }
			add_tech_bonus = { bonus = 0.5 uses = 2 category = trains_tech }
			add_tech_bonus = { bonus = 0.5 uses = 2 category = transport_tech }
			hidden_effect = { 
				clr_country_flag = brazil_the_bahia_and_sao_francisco_railway_5_flag
			}
		}
		else_if = {
			limit = { has_country_flag = brazil_the_bahia_and_sao_francisco_railway_6_flag }
			build_railway = {
				level = 2
				path = { 10946 14027 14028 1430 4617 8242 }
			}
			build_railway = {
				level = 2
				path = { 10946 14029 14031 }
			}
			EOANBSYS_institutions_innovative_add_two = yes
			set_temp_variable = { eoanb_prestige_change = 2 }
			eoanb_change_prestige_score = yes
			add_tech_bonus = { bonus = 0.5 uses = 2 category = humanities_tech }
			add_tech_bonus = { bonus = 0.5 uses = 2 category = trains_tech }
			add_tech_bonus = { bonus = 0.5 uses = 2 category = transport_tech }
			hidden_effect = { 
				clr_country_flag = brazil_the_bahia_and_sao_francisco_railway_6_flag
			}
		}
	}
}

#The Botanical Garden Tramsway
country_event = {
	id = brazil.552
	title = brazil.552.t
	desc = brazil.552.d
	is_triggered_only = yes
	option = {
		name = brazil.552.a
		ai_chance = { base = 25 }
		add_political_power = -10
		add_timed_idea = { idea = BRA_the_botanical_garden_tramsway_1 days = 280 }
		hidden_effect = {
			set_country_flag = brazil_the_botanical_garden_tramsway_1_flag
			500 = {

			}
			country_event = { id = brazil.553 days = 280 }
		}
	}
	option = {
		name = brazil.552.b
		ai_chance = { base = 25 }
		add_political_power = -20
		add_timed_idea = { idea = BRA_the_botanical_garden_tramsway_2 days = 240 }
		hidden_effect = {
			set_country_flag = brazil_the_botanical_garden_tramsway_2_flag
			country_event = { id = brazil.553 days = 240 }
		}
	}
	option = {
		name = brazil.552.c
		ai_chance = { base = 25 }
		add_political_power = -30
		add_timed_idea = { idea = BRA_the_botanical_garden_tramsway_3 days = 200 }
		hidden_effect = {
			set_country_flag = brazil_the_botanical_garden_tramsway_3_flag
			country_event = { id = brazil.553 days = 200 }
		}
	}
}

country_event = {
	id = brazil.553
	title = brazil.553.t
	desc = brazil.553.d
	picture = GFX_report_event_generic_railway_opening
	is_triggered_only = yes
	option = {
        name = brazil.553.a
		ai_chance = { base = 100 }
		if = {
			limit = { has_country_flag = brazil_the_botanical_garden_tramsway_1_flag }
			500 = {
				add_building_construction = { type = infrastructure	level = 1 instant_build = yes }
				add_extra_state_shared_building_slots = 1
			}
			add_tech_bonus = {  bonus = 0.5 uses = 1 category = transport_tech  }
			add_tech_bonus = {	bonus = 0.5 uses = 1 category = humanities_tech }
			hidden_effect = { clr_country_flag = brazil_the_botanical_garden_tramsway_1_flag }
		}
		else_if = {
			limit = { has_country_flag = brazil_the_botanical_garden_tramsway_2_flag }
			500 = {
				add_building_construction = { type = infrastructure	level = 1 instant_build = yes }
				add_extra_state_shared_building_slots = 1
			}
			add_tech_bonus = {	bonus = 0.75 uses = 1 category = humanities_tech }
			add_tech_bonus = {  bonus = 0.75 uses = 1 category = transport_tech }
			hidden_effect = { clr_country_flag = brazil_the_botanical_garden_tramsway_2_flag }
		}
		else_if = {
			limit = { has_country_flag = brazil_the_botanical_garden_tramsway_3_flag }
			500 = {
				add_building_construction = { type = infrastructure	level = 1 instant_build = yes }
				add_extra_state_shared_building_slots = 1
			}
			add_tech_bonus = { bonus = 1.0 uses = 1 category = humanities_tech }
			add_tech_bonus = { bonus = 1.0 uses = 1 category = transport_tech }
			hidden_effect = { clr_country_flag = brazil_the_botanical_garden_tramsway_3_flag }
		}
	}
}

#The Paulista Railway
country_event = {
	id = brazil.554
	title = brazil.554.t
	desc = brazil.554.d
	is_triggered_only = yes
	option = {
		name = brazil.554.a
		ai_chance = { base = 25 }
		add_political_power = -10
		add_timed_idea = { idea = BRA_the_paulista_railway_1 days = 360 }
		hidden_effect = {
			set_country_flag = brazil_the_paulista_railway_1_flag
			501 = {

				add_dynamic_modifier = {
					modifier = dynmod_BRA_railways_by_slaves
					days = 360
				}
			}
			country_event = { id = brazil.556 days = 360 }
		}
	}
	option = {
		name = brazil.554.b
		ai_chance = { base = 25 }
		add_political_power = -20
		add_timed_idea = { idea = BRA_the_paulista_railway_2 days = 320 }
		hidden_effect = {
			set_country_flag = brazil_the_paulista_railway_2_flag
			501 = {
				add_dynamic_modifier = {
					modifier = dynmod_BRA_railways_by_free_workers
					days = 320
				}
			}
			country_event = { id = brazil.556 days = 320 }
		}
	}
	option = {
		name = brazil.554.c
		ai_chance = { base = 25 }
		add_political_power = -30
		add_timed_idea = { idea = BRA_the_paulista_railway_3 days = 280 }
		hidden_effect = {
			set_country_flag = brazil_the_paulista_railway_3_flag
			501 = {
				add_dynamic_modifier = {
					modifier = dynmod_BRA_railways_by_companies
					days = 280
				} 
			}
			country_event = { id = brazil.556 days = 280 }
		}
	}
	option = {
		name = brazil.554.e
		ai_chance = { base = 25 }
		country_event = { id = brazil.555 }
	}
}

country_event = {
	id = brazil.555
	title = brazil.555.t
	desc = brazil.555.d
	is_triggered_only = yes
	option = {
		name = brazil.555.a
		ai_chance = { base = 25 }
		add_political_power = -10
		add_timed_idea = { idea = BRA_the_paulista_railway_4 days = 360 }
		hidden_effect = {
			set_country_flag = brazil_the_paulista_railway_4_flag
			501 = {

				add_dynamic_modifier = {
					modifier = dynmod_BRA_railways_by_slaves
					days = 360
				}
			}
			country_event = { id = brazil.556 days = 360 }
		}
	}
	option = {
		name = brazil.555.b
		ai_chance = { base = 25 }
		add_political_power = -20
		add_timed_idea = { idea = BRA_the_paulista_railway_5 days = 320 }
		hidden_effect = {
			set_country_flag = brazil_the_paulista_railway_5_flag
			501 = {
				add_dynamic_modifier = {
					modifier = dynmod_BRA_railways_by_free_workers
					days = 320
				}
			}
			country_event = { id = brazil.556 days = 320 }
		}
	}
	option = {
		name = brazil.555.c
		ai_chance = { base = 25 }
		add_political_power = -30
		add_timed_idea = { idea = BRA_the_paulista_railway_6 days = 280 }
		hidden_effect = {
			set_country_flag = brazil_the_paulista_railway_6_flag
			501 = {
				add_dynamic_modifier = {
					modifier = dynmod_BRA_railways_by_companies
					days = 280
				} 
			}
			country_event = { id = brazil.556 days = 280 }
		}
	}
	option = {
		name = brazil.555.e
		ai_chance = { base = 25 }
		country_event = { id = brazil.554 }
	}
}

country_event = {
	id = brazil.556
	title = brazil.556.t
	desc = brazil.556.d
	picture = GFX_report_event_generic_railway_opening
	is_triggered_only = yes
	option = {
        name = brazil.556.a
		ai_chance = { base = 100 }
		if = {
			limit = { has_country_flag = brazil_the_paulista_railway_1_flag }
			build_railway = {
				level = 1
				path = { 10513 14041 10360 14040 12438 }
			}
			EOANBSYS_institutions_innovative_add_one = yes
			set_temp_variable = { eoanb_prestige_change = 1 }
			eoanb_change_prestige_score = yes
			add_tech_bonus = { bonus = 0.5 uses = 1 category = humanities_tech }
			add_tech_bonus = { bonus = 0.5 uses = 1 category = trains_tech }
			add_tech_bonus = { bonus = 0.5 uses = 1 category = transport_tech }
			hidden_effect = { 
				clr_country_flag = brazil_the_paulista_railway_1_flag
			}
		}
		else_if = {
			limit = { has_country_flag = brazil_the_paulista_railway_2_flag }
			build_railway = {
				level = 1
				path = { 10513 14041 10360 14040 12438 }
			}
			EOANBSYS_institutions_innovative_add_one = yes
			set_temp_variable = { eoanb_prestige_change = 1 }
			eoanb_change_prestige_score = yes
			add_tech_bonus = { bonus = 0.5 uses = 1 category = humanities_tech }
			add_tech_bonus = { bonus = 0.5 uses = 1 category = trains_tech }
			add_tech_bonus = { bonus = 0.5 uses = 1 category = transport_tech }
			hidden_effect = { 
				clr_country_flag = brazil_the_paulista_railway_2_flag
			}
		}
		else_if = {
			limit = { has_country_flag = brazil_the_paulista_railway_3_flag }
			build_railway = {
				level = 1
				path = { 10513 14041 10360 14040 12438 }
			}
			EOANBSYS_institutions_innovative_add_one = yes
			set_temp_variable = { eoanb_prestige_change = 1 }
			eoanb_change_prestige_score = yes
			add_tech_bonus = { bonus = 0.5 uses = 1 category = humanities_tech }
			add_tech_bonus = { bonus = 0.5 uses = 1 category = trains_tech }
			add_tech_bonus = { bonus = 0.5 uses = 1 category = transport_tech }
			hidden_effect = { 
				clr_country_flag = brazil_the_paulista_railway_3_flag
			}
		}
		else_if = {
			limit = { has_country_flag = brazil_the_paulista_railway_4_flag }
			build_railway = {
				level = 2
				path = { 10513 14041 10360 14040 12438 }
			}
			EOANBSYS_institutions_innovative_add_two = yes
			set_temp_variable = { eoanb_prestige_change = 2 }
			eoanb_change_prestige_score = yes
			add_tech_bonus = { bonus = 0.5 uses = 2 category = humanities_tech }
			add_tech_bonus = { bonus = 0.5 uses = 2 category = trains_tech }
			add_tech_bonus = { bonus = 0.5 uses = 2 category = transport_tech }
			hidden_effect = { 
				clr_country_flag = brazil_the_paulista_railway_4_flag
			}
		}
		else_if = {
			limit = { has_country_flag = brazil_the_paulista_railway_5_flag }
			build_railway = {
				level = 2
				path = { 10513 14041 10360 14040 12438 }
			}
			EOANBSYS_institutions_innovative_add_two = yes
			set_temp_variable = { eoanb_prestige_change = 2 }
			eoanb_change_prestige_score = yes
			add_tech_bonus = { bonus = 0.5 uses = 2 category = humanities_tech }
			add_tech_bonus = { bonus = 0.5 uses = 2 category = trains_tech }
			add_tech_bonus = { bonus = 0.5 uses = 2 category = transport_tech }
			hidden_effect = { 
				clr_country_flag = brazil_the_paulista_railway_5_flag
			}
		}
		else_if = {
			limit = { has_country_flag = brazil_the_paulista_railway_6_flag }
			build_railway = {
				level = 1
				path = { 10513 14041 10360 14040 12438 }
			}
			EOANBSYS_institutions_innovative_add_two = yes
			set_temp_variable = { eoanb_prestige_change = 2 }
			eoanb_change_prestige_score = yes
			add_tech_bonus = { bonus = 0.5 uses = 2 category = humanities_tech }
			add_tech_bonus = { bonus = 0.5 uses = 2 category = trains_tech }
			add_tech_bonus = { bonus = 0.5 uses = 2 category = transport_tech }
			hidden_effect = { 
				clr_country_flag = brazil_the_paulista_railway_6_flag
			}
		}
	}
}

#The Sobral Railway
country_event = {
	id = brazil.557
	title = brazil.557.t
	desc = brazil.557.d
	is_triggered_only = yes
	option = {
		name = brazil.557.a
		ai_chance = { base = 25 }
		add_political_power = -10
		add_timed_idea = { idea = BRA_the_sobral_railway_1 days = 360 }
		hidden_effect = {
			set_country_flag = brazil_the_sobral_railway_1_flag
			1041 = {

				add_dynamic_modifier = {
					modifier = dynmod_BRA_railways_by_slaves
					days = 360
				}
			}
			country_event = { id = brazil.559 days = 360 }
		}
	}
	option = {
		name = brazil.557.b
		ai_chance = { base = 25 }
		add_political_power = -20
		add_timed_idea = { idea = BRA_the_sobral_railway_2 days = 320 }
		hidden_effect = {
			set_country_flag = brazil_the_sobral_railway_2_flag
			1041 = {
				add_dynamic_modifier = {
					modifier = dynmod_BRA_railways_by_free_workers
					days = 320
				}
			}
			country_event = { id = brazil.559 days = 320 }
		}
	}
	option = {
		name = brazil.557.c
		ai_chance = { base = 25 }
		add_political_power = -30
		add_timed_idea = { idea = BRA_the_sobral_railway_3 days = 280 }
		hidden_effect = {
			set_country_flag = brazil_the_sobral_railway_3_flag
			1041 = {
				add_dynamic_modifier = {
					modifier = dynmod_BRA_railways_by_companies
					days = 280
				} 
			}
			country_event = { id = brazil.559 days = 280 }
		}
	}
	option = {
		name = brazil.557.e
		ai_chance = { base = 25 }
		country_event = { id = brazil.558 }
	}
}

country_event = {
	id = brazil.558
	title = brazil.558.t
	desc = brazil.558.d
	is_triggered_only = yes
	option = {
		name = brazil.558.a
		ai_chance = { base = 25 }
		add_political_power = -10
		add_timed_idea = { idea = BRA_the_sobral_railway_4 days = 360 }
		hidden_effect = {
			set_country_flag = brazil_the_sobral_railway_4_flag
			1041 = {

				add_dynamic_modifier = {
					modifier = dynmod_BRA_railways_by_slaves
					days = 360
				}
			}
			country_event = { id = brazil.559 days = 360 }
		}
	}
	option = {
		name = brazil.558.b
		ai_chance = { base = 25 }
		add_political_power = -20
		add_timed_idea = { idea = BRA_the_sobral_railway_5 days = 320 }
		hidden_effect = {
			set_country_flag = brazil_the_sobral_railway_5_flag
			1041 = {
				add_dynamic_modifier = {
					modifier = dynmod_BRA_railways_by_free_workers
					days = 320
				}
			}
			country_event = { id = brazil.559 days = 320 }
		}
	}
	option = {
		name = brazil.558.c
		ai_chance = { base = 25 }
		add_political_power = -30
		add_timed_idea = { idea = BRA_the_sobral_railway_6 days = 280 }
		hidden_effect = {
			set_country_flag = brazil_the_sobral_railway_6_flag
			1041 = {
				add_dynamic_modifier = {
					modifier = dynmod_BRA_railways_by_companies
					days = 280
				} 
			}
			country_event = { id = brazil.559 days = 280 }
		}
	}
	option = {
		name = brazil.558.e
		ai_chance = { base = 25 }
		country_event = { id = brazil.557 }
	}
}

country_event = {
	id = brazil.559
	title = brazil.559.t
	desc = brazil.559.d
	picture = GFX_report_event_generic_railway_opening
	is_triggered_only = yes
	option = {
        name = brazil.559.a
		ai_chance = { base = 100 }
		if = {
			limit = { has_country_flag = brazil_the_sobral_railway_1_flag }
			build_railway = {
				level = 1
				path = { 5107 8179 2164 }
			}
			build_railway = {
				level = 1
				path = { 2132 2178 5153 }
			}
			EOANBSYS_institutions_innovative_add_one = yes
			set_temp_variable = { eoanb_prestige_change = 1 }
			eoanb_change_prestige_score = yes
			add_tech_bonus = { bonus = 0.5 uses = 1 category = humanities_tech }
			add_tech_bonus = { bonus = 0.5 uses = 1 category = trains_tech }
			add_tech_bonus = { bonus = 0.5 uses = 1 category = transport_tech }
			hidden_effect = { 
				clr_country_flag = brazil_the_sobral_railway_1_flag
			}
		}
		else_if = {
			limit = { has_country_flag = brazil_the_sobral_railway_2_flag }
			build_railway = {
				level = 1
				path = { 5107 8179 2164 }
			}
			build_railway = {
				level = 1
				path = { 2132 2178 5153 }
			}
			EOANBSYS_institutions_innovative_add_one = yes
			set_temp_variable = { eoanb_prestige_change = 1 }
			eoanb_change_prestige_score = yes
			add_tech_bonus = { bonus = 0.5 uses = 1 category = humanities_tech }
			add_tech_bonus = { bonus = 0.5 uses = 1 category = trains_tech }
			add_tech_bonus = { bonus = 0.5 uses = 1 category = transport_tech }
			hidden_effect = { 
				clr_country_flag = brazil_the_sobral_railway_2_flag
			}
		}
		else_if = {
			limit = { has_country_flag = brazil_the_sobral_railway_3_flag }
			build_railway = {
				level = 1
				path = { 5107 8179 2164 }
			}
			build_railway = {
				level = 1
				path = { 2132 2178 5153 }
			}
			EOANBSYS_institutions_innovative_add_one = yes
			set_temp_variable = { eoanb_prestige_change = 1 }
			eoanb_change_prestige_score = yes
			add_tech_bonus = { bonus = 0.5 uses = 1 category = humanities_tech }
			add_tech_bonus = { bonus = 0.5 uses = 1 category = trains_tech }
			add_tech_bonus = { bonus = 0.5 uses = 1 category = transport_tech }
			hidden_effect = { 
				clr_country_flag = brazil_the_sobral_railway_3_flag
			}
		}
		else_if = {
			limit = { has_country_flag = brazil_the_sobral_railway_4_flag }
			build_railway = {
				level = 2
				path = { 5107 8179 2164 }
			}
			build_railway = {
				level = 2
				path = { 2132 2178 5153 }
			}
			EOANBSYS_institutions_innovative_add_two = yes
			set_temp_variable = { eoanb_prestige_change = 2 }
			eoanb_change_prestige_score = yes
			add_tech_bonus = { bonus = 0.5 uses = 2 category = humanities_tech }
			add_tech_bonus = { bonus = 0.5 uses = 2 category = trains_tech }
			add_tech_bonus = { bonus = 0.5 uses = 2 category = transport_tech }
			hidden_effect = { 
				clr_country_flag = brazil_the_sobral_railway_4_flag
			}
		}
		else_if = {
			limit = { has_country_flag = brazil_the_sobral_railway_5_flag }
			build_railway = {
				level = 2
				path = { 5107 8179 2164 }
			}
			build_railway = {
				level = 2
				path = { 2132 2178 5153 }
			}
			EOANBSYS_institutions_innovative_add_two = yes
			set_temp_variable = { eoanb_prestige_change = 2 }
			eoanb_change_prestige_score = yes
			add_tech_bonus = { bonus = 0.5 uses = 2 category = humanities_tech }
			add_tech_bonus = { bonus = 0.5 uses = 2 category = trains_tech }
			add_tech_bonus = { bonus = 0.5 uses = 2 category = transport_tech }
			hidden_effect = { 
				clr_country_flag = brazil_the_sobral_railway_5_flag
			}
		}
		else_if = {
			limit = { has_country_flag = brazil_the_sobral_railway_6_flag }
			build_railway = {
				level = 2
				path = { 5107 8179 2164 }
			}
			build_railway = {
				level = 2
				path = { 2132 2178 5153 }
			}
			EOANBSYS_institutions_innovative_add_two = yes
			set_temp_variable = { eoanb_prestige_change = 2 }
			eoanb_change_prestige_score = yes
			add_tech_bonus = { bonus = 0.5 uses = 2 category = humanities_tech }
			add_tech_bonus = { bonus = 0.5 uses = 2 category = trains_tech }
			add_tech_bonus = { bonus = 0.5 uses = 2 category = transport_tech }
			hidden_effect = { 
				clr_country_flag = brazil_the_sobral_railway_6_flag
			}
		}
	}
}

#The Salvador Tramsway
country_event = {
	id = brazil.560
	title = brazil.560.t
	desc = brazil.560.d
	is_triggered_only = yes
	option = {
		name = brazil.560.a
		ai_chance = { base = 25 }
		add_political_power = -10
		add_timed_idea = { idea = BRA_the_salvador_tramsway_1 days = 280 }
		hidden_effect = {
			set_country_flag = brazil_the_salvador_tramsway_1_flag
			499 = {

			}
			country_event = { id = brazil.561 days = 280 }
		}
	}
	option = {
		name = brazil.560.b
		ai_chance = { base = 25 }
		add_political_power = -20
		add_timed_idea = { idea = BRA_the_salvador_tramsway_2 days = 240 }
		hidden_effect = {
			set_country_flag = brazil_the_salvador_tramsway_2_flag
			country_event = { id = brazil.561 days = 240 }
		}
	}
	option = {
		name = brazil.560.c
		ai_chance = { base = 25 }
		add_political_power = -30
		add_timed_idea = { idea = BRA_the_salvador_tramsway_3 days = 200 }
		hidden_effect = {
			set_country_flag = brazil_the_salvador_tramsway_3_flag
			country_event = { id = brazil.561 days = 200 }
		}
	}
}

country_event = {
	id = brazil.561
	title = brazil.561.t
	desc = brazil.561.d
	picture = GFX_report_event_generic_railway_opening
	is_triggered_only = yes
	option = {
        name = brazil.561.a
		ai_chance = { base = 100 }
		if = {
			limit = { has_country_flag = brazil_the_salvador_tramsway_1_flag }
			499 = {
				add_building_construction = { type = infrastructure	level = 1 instant_build = yes }
				add_extra_state_shared_building_slots = 1
			}
			add_tech_bonus = {  bonus = 0.5 uses = 1 category = transport_tech  }
			add_tech_bonus = {	bonus = 0.5 uses = 1 category = humanities_tech }
			hidden_effect = { clr_country_flag = brazil_the_salvador_tramsway_1_flag }
		}
		else_if = {
			limit = { has_country_flag = brazil_the_salvador_tramsway_2_flag }
			499 = {
				add_building_construction = { type = infrastructure	level = 1 instant_build = yes }
				add_extra_state_shared_building_slots = 1
			}
			add_tech_bonus = {	bonus = 0.75 uses = 1 category = humanities_tech }
			add_tech_bonus = {  bonus = 0.75 uses = 1 category = transport_tech }
			hidden_effect = { clr_country_flag = brazil_the_salvador_tramsway_2_flag }
		}
		else_if = {
			limit = { has_country_flag = brazil_the_salvador_tramsway_3_flag }
			499 = {
				add_building_construction = { type = infrastructure	level = 1 instant_build = yes }
				add_extra_state_shared_building_slots = 1
			}
			add_tech_bonus = { bonus = 1.0 uses = 1 category = humanities_tech }
			add_tech_bonus = { bonus = 1.0 uses = 1 category = transport_tech }
			hidden_effect = { clr_country_flag = brazil_the_salvador_tramsway_3_flag }
		}
	}
}

#The São Paulo Tramsway
country_event = {
	id = brazil.562
	title = brazil.562.t
	desc = brazil.562.d
	is_triggered_only = yes
	option = {
		name = brazil.562.a
		ai_chance = { base = 25 }
		add_political_power = -10
		add_timed_idea = { idea = BRA_the_sao_paulo_tramsway_1 days = 280 }
		hidden_effect = {
			set_country_flag = brazil_the_sao_paulo_tramsway_1_flag
			501 = {

			}
			country_event = { id = brazil.563 days = 280 }
		}
	}
	option = {
		name = brazil.562.b
		ai_chance = { base = 25 }
		add_political_power = -20
		add_timed_idea = { idea = BRA_the_sao_paulo_tramsway_2 days = 240 }
		hidden_effect = {
			set_country_flag = brazil_the_sao_paulo_tramsway_2_flag
			country_event = { id = brazil.563 days = 240 }
		}
	}
	option = {
		name = brazil.562.c
		ai_chance = { base = 25 }
		add_political_power = -30
		add_timed_idea = { idea = BRA_the_sao_paulo_tramsway_3 days = 200 }
		hidden_effect = {
			set_country_flag = brazil_the_sao_paulo_tramsway_3_flag
			country_event = { id = brazil.563 days = 200 }
		}
	}
}

country_event = {
	id = brazil.563
	title = brazil.563.t
	desc = brazil.563.d
	picture = GFX_report_event_generic_railway_opening
	is_triggered_only = yes
	option = {
        name = brazil.563.a
		ai_chance = { base = 100 }
		if = {
			limit = { has_country_flag = brazil_the_sao_paulo_tramsway_1_flag }
			501 = {
				add_building_construction = { type = infrastructure	level = 1 instant_build = yes }
				add_extra_state_shared_building_slots = 1
			}
			add_tech_bonus = {  bonus = 0.5 uses = 1 category = transport_tech  }
			add_tech_bonus = {	bonus = 0.5 uses = 1 category = humanities_tech }
			hidden_effect = { clr_country_flag = brazil_the_sao_paulo_tramsway_1_flag }
		}
		else_if = {
			limit = { has_country_flag = brazil_the_sao_paulo_tramsway_2_flag }
			501 = {
				add_building_construction = { type = infrastructure	level = 1 instant_build = yes }
				add_extra_state_shared_building_slots = 1
			}
			add_tech_bonus = {	bonus = 0.75 uses = 1 category = humanities_tech }
			add_tech_bonus = {  bonus = 0.75 uses = 1 category = transport_tech }
			hidden_effect = { clr_country_flag = brazil_the_sao_paulo_tramsway_2_flag }
		}
		else_if = {
			limit = { has_country_flag = brazil_the_sao_paulo_tramsway_3_flag }
			501 = {
				add_building_construction = { type = infrastructure	level = 1 instant_build = yes }
				add_extra_state_shared_building_slots = 1
			}
			add_tech_bonus = { bonus = 1.0 uses = 1 category = humanities_tech }
			add_tech_bonus = { bonus = 1.0 uses = 1 category = transport_tech }
			hidden_effect = { clr_country_flag = brazil_the_sao_paulo_tramsway_3_flag }
		}
	}
}


country_event = {
	id = brazil.900
	title = brazil.900.t
	desc = brazil.900.d
	picture = GFX_report_event_general_strikes_in_bahia
	is_triggered_only = yes
	option = {
		name = brazil.900.a
		add_timed_idea = { idea = BRA_tax_carriers days = 360 }
		499 = {
			add_dynamic_modifier = { modifier = BRA_african_workers_strikes }
		}
		decrease_ps_by_one = yes
		hidden_effect = { 
			country_event = { id = brazil.901 days = 7 }
			activate_mission = BRA_mission_Afro_Brazilian_Carriers_Strikes_in_Bahia
		}
	}
}

country_event = {
	id = brazil.901
	title = brazil.901.t
	desc = brazil.901.d
	picture = GFX_report_event_general_strikes_in_bahia
	is_triggered_only = yes
	option = {
		name = brazil.901.a
		ai_chance = {
			base = 34
			modifier = {
				is_historical_focus_on = yes
				add = 66
			}
		}
		hidden_effect = { country_event = { id = brazil.902 days = 1 } }
	}
	option = {
		name = brazil.901.b
		ai_chance = {
			base = 33
			modifier = {
				is_historical_focus_on = yes
				factor = 0
			}
			modifier = {
				is_historical_focus_on = no
				factor = 1
			}
		}
		add_political_power = -25
		hidden_effect = {
			random_list = {
				50 = { country_event = { id = brazil.903 days = 1 } }
				50 = { country_event = { id = brazil.904 days = 1 } }
			}
		}
	}
	option = {
		name = brazil.901.c
		ai_chance = {
			base = 33
			modifier = {
				is_historical_focus_on = yes
				factor = 0
			}
			modifier = {
				is_historical_focus_on = no
				factor = 1
			}
		}
		add_command_power = -10
		hidden_effect = {
			random_list = {
				50 = { country_event = { id = brazil.905 days = 1 } }
				50 = { country_event = { id = brazil.906 days = 1 } }
			}
		}
	}
}

country_event = {
	id = brazil.902
	title = brazil.902.t
	desc = brazil.902.d
	picture = GFX_report_event_repealing_the_law
	is_triggered_only = yes
	option = {
		name = brazil.902.a
		add_political_power = -50
		add_stability = 0.05
		499 ={ remove_dynamic_modifier = { modifier = BRA_african_workers_strikes } }
		set_temp_variable = { political_legitimacy_change = 0.10 }
		eoanb_political_legitimacy_change = yes
		increase_ps_by_one = yes
		set_temp_variable = { eoanb_prestige_change = 1 }
		eoanb_change_prestige_score = yes
		remove_ideas = BRA_tax_carriers
	}
}

country_event = {
	id = brazil.903
	title = brazil.903.t
	desc = brazil.903.d
	picture = GFX_report_event_generic_negotiations_with_strikers
	is_triggered_only = yes
	option = {
		name = brazil.903.a
		499 = { remove_dynamic_modifier = { modifier = BRA_african_workers_strikes } }
		remove_ideas = BRA_tax_carriers
		#modify_timed_idea = { idea = BRA_tax_carriers days = -180 }
		increase_ps_by_one = yes
		set_temp_variable = { political_legitimacy_change = 0.05 }
		eoanb_political_legitimacy_change = yes
		add_political_power = 25
		add_stability = 0.01
	}
}

country_event = {
	id = brazil.904
	title = brazil.904.t
	desc = brazil.904.d
	is_triggered_only = yes
	picture = GFX_report_event_generic_negotiations_with_strikers
	option = {
		name = brazil.904.a
		499 = {
			damage_building = { type = infrastructure damage = 1 }
			damage_building = { type = naval_base damage = 1 province = 10946 }
			remove_dynamic_modifier = { modifier = BRA_african_workers_strikes }
		}
		remove_ideas = BRA_tax_carriers
		decrease_ps_by_one = yes
		add_stability = -0.01
		set_temp_variable = { political_legitimacy_change = -0.05 }
		eoanb_political_legitimacy_change = yes
	}
}

country_event = {
	id = brazil.905
	title = brazil.905.t
	desc = brazil.905.d
	picture = GFX_report_event_generic_military_supression
	is_triggered_only = yes
	option = {
		name = brazil.905.a
		499 = {
			#remove_dynamic_modifier = { modifier = BRA_african_workers_strikes }
			damage_building = { type = infrastructure damage = 1 }
			damage_building = { type = naval_base damage = 1 province = 10946 }
		}
		decrease_ps_by_one = yes
		add_stability = -0.05
		set_temp_variable = { political_legitimacy_change = -0.05 }
		eoanb_political_legitimacy_change = yes
		army_experience = 5
		add_manpower = -100
	}
}

country_event = {
	id = brazil.906
	title = brazil.906.t
	desc = brazil.906.d
	is_triggered_only = yes
	picture = GFX_report_event_generic_military_supression
	option = {
		name = brazil.905.a
		499 ={
			#remove_dynamic_modifier = { modifier = BRA_african_workers_strikes } 
			damage_building = { type = infrastructure damage = 1 }
			damage_building = { type = naval_base damage = 1 province = 10946 }
			damage_building = { type = dockyard damage = 1 }
			damage_building = { type = industrial_complex damage = 1 }
			add_manpower = -500
		}
		decrease_ps_by_one = yes
		add_stability = -0.1
		set_temp_variable = { political_legitimacy_change = -0.08 }
		eoanb_political_legitimacy_change = yes
		set_temp_variable = { eoanb_prestige_change = -1 }
		eoanb_change_prestige_score = yes
		army_experience = 10
	}
}

country_event = {
	id = brazil.907
	title = brazil.907.t
	desc = brazil.907.d
	picture = GFX_report_event_generic_military_supression
	is_triggered_only = yes
	option = {
		name = brazil.907.a
		499 = {
			set_temp_variable = { type_temp = global.afro-brazilian }
			set_temp_variable = { percentage_temp = 0.01 }
			pops_decrease_culture = yes
			set_temp_variable = { type_temp = global.brazilian }
			set_temp_variable = { percentage_temp = 0.01 }
			pops_increase_culture = yes
			set_temp_variable = { percentage_temp = -0.01 }
			set_temp_variable = { manpower_temp = state_population_k }
			multiply_temp_variable = { manpower_temp = percentage_temp }
			add_manpower = var:manpower_temp
			set_temp_variable = { eoanb_prestige_change = -1 }
			eoanb_change_prestige_score = yes
		}
		BRA = {
			add_stability = -0.05
			hidden_effect = {
				country_event = { id = bahia.1 days = 15 random_days = 1 }
			}
		}
	}
}

country_event = {
	id = brazil.908
	title = brazil.31.t
	desc = brazil.31.d
	picture = GFX_report_event_hms_prince_wales

	fire_only_once = yes

	trigger = {  
		AND  = {
			tag = ENG
			date > 1857.4.4
			NOT = {
				has_country_flag = ENG_christie_crisis1
			}
		}
	}

	option = {
		name = brazil.31.b
			trigger = {
				tag = ENG
			}
		add_war_support = 0.012
		ENG = {
			add_opinion_modifier = {
				target = BRA
				modifier = protest_action_light
			}
		}
	}
}

country_event = {
	id = brazil.909
	title = brazil.909.t
	desc = brazil.909.d
	is_triggered_only = yes
	picture = GFX_report_event_typographer_strike
	option = {
		name = brazil.909.a
		add_political_power = -25
		add_ideas = BRA_typographer_strikes
		decrease_ps_by_one = yes
		hidden_effect = { country_event = { id = brazil.910 days = 7 } }
	}
}

country_event = {
	id = brazil.910
	title = brazil.910.t
	desc = brazil.910.d
	is_triggered_only = yes
	picture = GFX_report_event_typographer_strike
	option = {
		name = brazil.910.a
		add_political_power = -25
		hidden_effect = {
			random_list = {
				50 = {
					modifier = {
						add = 50
						is_historical_focus_on = yes
					}
					country_event = { id = brazil.911 days = 1 }
				}
				50 = {
					modifier = {
						add = -50
						is_historical_focus_on = yes
					}
					country_event = { id = brazil.912 days = 1 }
				}
			}
		}
	}
	option = {
		name = brazil.910.b
		add_command_power = -10
		hidden_effect = { country_event = { id = brazil.913 days = 1 } }
	}
	option = {
		name = brazil.910.c
		hidden_effect = { country_event = { id = brazil.914 days = 23 } }
	}
}



country_event = {
	id = brazil.911
	title = brazil.911.t
	desc = brazil.911.d
	picture = GFX_report_event_typographer_strike
	is_triggered_only = yes
	option = {
		name = brazil.911.a
		remove_ideas = BRA_typographer_strikes
		increase_ps_by_one = yes
		add_stability = 0.05
		set_temp_variable = { political_legitimacy_change = 0.05 }
		eoanb_political_legitimacy_change = yes
	}
}

country_event = {
	id = brazil.912
	title = brazil.912.t
	desc = brazil.912.d
	picture = GFX_report_event_typographer_strike
	is_triggered_only = yes
	option = {
		name = brazil.912.a
		remove_ideas = BRA_typographer_strikes
		increase_ps_by_one = yes
		set_temp_variable = { political_legitimacy_change = -0.05 }
		eoanb_political_legitimacy_change = yes
	}
}

country_event = {
	id = brazil.913
	title = brazil.913.t
	desc = brazil.913.d
	picture = GFX_report_event_typographer_strike
	is_triggered_only = yes
	option = {
		name = brazil.913.a
		remove_ideas = BRA_typographer_strikes
		add_stability = -0.05
		decrease_ps_by_one = yes
		set_temp_variable = { political_legitimacy_change = -0.05 }
		eoanb_political_legitimacy_change = yes
	}
}

country_event = {
	id = brazil.914
	title = brazil.914.t
	desc = brazil.914.d
	picture = GFX_report_event_typographer_strike
	is_triggered_only = yes
	option = {
		name = brazil.914.a
		remove_ideas = BRA_typographer_strikes
		add_stability = 0.05
		increase_ps_by_one = yes
	}
}

#USA relations
#CSA relations
#colonization of Amazon basin
#African american immigrants
#North of Brazil

##New United States Minister in Brazil
country_event = {
	id = brazil.foreign.1
	title = brazil.foreign.1.t

	desc = {
		text = brazil.foreign.1.d
		trigger = {
			tag = BRA
		}
	}
	desc = {
		text = brazil.foreign.1.d_USA
		trigger = {
			tag = USA
		}
	}

  fire_only_once = yes
  is_triggered_only = yes
	trigger = {
		OR = {
			tag = BRA
			#tag = USA
		}
		#year.month.day
		#date > 1861.10.01
		NOT = {
			BRA = { has_war_with = USA }
		}
	}

	option = {
		name = brazil.foreign.1.a
		trigger = {
			tag = BRA
		}
		country_event = { id = brazil.foreign.2 days = 1}
		set_country_flag = USA_minister_BRA
    USA = {
      set_country_flag = USA_minister_BRA
    }
	}

	option = {
		name = brazil.foreign.1.b
		trigger = {
			tag = USA
		}
		set_country_flag = USA_minister_BRA
	}
}

##Presentation by James Webb to the Ministry of State for Foreign Affairs
country_event = {
	id = brazil.foreign.2
	title = brazil.foreign.2.t
	desc = brazil.foreign.2.d

	is_triggered_only = yes
	trigger =  {
		tag = BRA
		#date > 1861.10.02
		has_country_flag = USA_minister_BRA
	}

	option = {
		name = brazil.foreign.2.a
		add_political_power = -10
		BRA = { country_event = { id = brazil.foreign.3 days = 2 } }
	}
	option = {
		name = brazil.foreign.2.b
		add_political_power = 20
		BRA = { country_event = { id = brazil.foreign.4 days = 2 } }
	}
}

##Choice *Yes* event brazil.foreign.2
##Minister James Webb constraints Brazilian Imperial Court
country_event = {
	id = brazil.foreign.3
	title = brazil.foreign.3.t
	desc = {
		text = brazil.foreign.3.d
		trigger = {
			tag = BRA
		}
	}
	desc = {
		text = brazil.foreign.3.d_USA
		trigger = {
			tag = USA
		}
	}
	is_triggered_only = yes
	trigger = {
		OR = {
			tag = BRA
			tag = USA
		}
		#date > 1861.10.03
		has_country_flag = USA_minister_BRA
	}

	option = {
		name = brazil.foreign.3.a
		trigger = {
			tag = BRA
		}
		add_opinion_modifier = {
			target = CSA
			modifier = usa_improved_relations
		}
		add_opinion_modifier = {
			target = USA
			modifier = usa_bad_relations
		}
		country_event = { id = brazil.foreign.5 days = 1 }
	}
	option = {
		name = brazil.foreign.3.b
		trigger = {
			tag = USA
		}
	}
}

##Choice *No* event brazil.foreign.2
##Minister James Web's speech is vetoed.
country_event = {
	id = brazil.foreign.4
	title = brazil.foreign.4.t
	desc = {
		text = brazil.foreign.4.d
		trigger = {
			tag = BRA
		}
	}
	desc = {
	text = brazil.foreign.4.d_USA
		trigger = {
			tag = USA
		}
	}
	is_triggered_only = yes
	trigger = {
		OR = {
			tag = BRA
			tag = USA
		}
		#date > 1861.10.03
		has_country_flag = USA_minister_BRA
	}

	option = {
		name = brazil.foreign.4.a
		trigger = {
			tag = BRA
		}
		#country_event = { id = brazil.foreign.6 days = 163 }
		add_political_power = 10
	}
	option = {
		name = brazil.foreign.4.b
		trigger = {
			tag = USA
		}
		add_political_power = -10
	}
}

##Political consequences of Webb's speech
country_event = {
	id = brazil.foreign.5
	title = brazil.foreign.5.t
	desc = brazil.foreign.5.d

	is_triggered_only = yes
	trigger =  {
		tag = BRA
		#date > 1861.10.03
		has_country_flag = USA_minister_BRA
	}
	immediate  = {
		add_stability = -0.05
		add_political_power = -50
		add_popularity = {
			ideology = centrism
			popularity = 0.02
		}
		add_popularity = {
			ideology = traditional_conservatism
			popularity = 0.02
		}
		add_popularity = {
			ideology = social_egalitarianism
			popularity = 0.01
		}
	}
	option = {
		name = brazil.foreign.5.a
		if = {
			limit = { has_completed_focus = BRA_honor_our_alliance }
			country_event = { id = brazil.foreign.9 days = 149 }
		}
    else_if = {
			limit = { has_completed_focus = BRA_recognize_csa }
			country_event = { id = brazil.foreign.10 days = 163}
		}
    else_if = {
      limit = {
        tag = BRA
        NOT = { has_completed_focus = BRA_honor_our_alliance }
        NOT = { has_completed_focus = BRA_recognize_csa }
      }
      country_event = { id = brazil.foreign.8 days = 163}
    }
	}
}

###James Webb tries to publish full version of his speech in the USA
country_event = {
	id = brazil.foreign.7
	title = brazil.foreign.7.t
	desc = {
		text = brazil.foreign.7.d
		trigger = {
			tag = BRA
		}
	}
	desc = {
		text = brazil.foreign.8.d_USA
		trigger = {
			tag = USA
		}
	}
	is_triggered_only = yes
	trigger = {
		OR = {
			tag = BRA
			tag = USA
		}
		#date > 1861.10.24
		has_country_flag = USA_minister_BRA
	}

	option = {
		name = brazil.foreign.7.a
		trigger = {
			tag = BRA
		}
		if = {
			limit = { has_completed_focus = BRA_honor_our_alliance }
			country_event = { id = brazil.foreign.9 days = 142}
    }
		else_if = {
			limit = { has_completed_focus = BRA_recognize_csa }
				country_event = { id = brazil.foreign.10 days = 142}
		}
    else_if = {
      limit = {
    		tag = BRA
    		NOT = { has_completed_focus = BRA_honor_our_alliance }
    		NOT = { has_completed_focus = BRA_recognize_csa }
    	}
			country_event = { id = brazil.foreign.8 days = 142 }
		}
	}
	option = {
		name = brazil.foreign.7.b
		trigger = {
			tag = USA
		}
		add_political_power = -10
	}
}

###Minister James Webb protests Brazil's neutrality
country_event = {
	id = brazil.foreign.8
	title = brazil.foreign.8.t
	desc = {
		text = brazil.foreign.8.d
		trigger = {
			tag = BRA
		}
	}
	desc = {
		text = brazil.foreign.8.d_USA
		trigger = {
			tag = USA
		}
	}
	is_triggered_only = yes
	trigger = {
		OR = {
			tag = BRA
			tag = USA
		}
		#date > 1862.03.15
		has_country_flag = USA_minister_BRA
	}
	option = {
		name = brazil.foreign.8.a
		trigger = {
			tag = BRA
		}
	}
	option = {
		name = brazil.foreign.8.b
		trigger = {
			tag = USA
		}
	}
}

###Ministro James Webb parabeniza apoio aos EUA
country_event = {
	id = brazil.foreign.9
	title = brazil.foreign.9.t
	desc = {
		text = brazil.foreign.9.d
		trigger = {
			tag = BRA
		}
	}
	desc = {
		text = brazil.foreign.9.d_USA
		trigger = {
			tag = USA
		}
	}
	is_triggered_only = yes
	trigger = {
		OR = {
			tag = BRA
			tag = USA
		}
		#date > 1862.03.15
		has_country_flag = USA_minister_BRA
	}
	option = {
		name = brazil.foreign.9.a
		trigger = {
			tag = BRA
		}
	}
	option = {
		name = brazil.foreign.9.b
		trigger = {
			tag = USA
		}
	}
}

###Ministro James Webb condena apoio do Brasil aos CSA
country_event = {
	id = brazil.foreign.10
	title = brazil.foreign.10.t
	desc = {
		text = brazil.foreign.10.d
		trigger = {
			tag = BRA
		}
	}
	desc = {
		text = brazil.foreign.10.d_USA
		trigger = {
			tag = USA
		}
	}
	desc = {
		text = brazil.foreign.10.d_CSA
		trigger = {
			tag = CSA
		}
	}
	is_triggered_only = yes
	trigger = {
		OR = {
			tag = BRA
			tag = USA
			tag = CSA
		}
		#date > 1862.03.15
		has_country_flag = USA_minister_BRA
	}
	option = {
		name = brazil.foreign.10.a
		trigger = {
			tag = BRA
		}
		country_event = { id = brazil.foreign.11 days = 56}
	}
	option = {
		name = brazil.foreign.10.b
		trigger = {
			tag = USA
		}
	}
	option = {
		name = brazil.foreign.10.c
		trigger = {
			tag = CSA
		}
	}
}

###Presentation of the project for colonization of the Amazon basin by free African Americans.
country_event = {
	id = brazil.foreign.11
	title = brazil.foreign.11.t
	desc = {
		text = brazil.foreign.11.d
		trigger = {
			tag = BRA
		}
	}
	desc = {
		text = brazil.foreign.11.d_USA
		trigger = {
			tag = USA
		}
	}
	is_triggered_only = yes
	trigger = {
		OR = {
			tag = BRA
			tag = USA
		}
		#date > 1862.05.10
		has_country_flag = USA_minister_BRA
	}
	option = {
		name = brazil.foreign.11.a
		trigger = {
			tag = BRA
		}
		country_event = { id = brazil.foreign.12 days = 1}
	}
	option = {
		name = brazil.foreign.11.b
		trigger = {
			tag = USA
		}
	}
}

###11.05.1862 - Analysis of the proposal for colonization of the Amazon Basin.
country_event = {
	id = brazil.foreign.12
	title = brazil.foreign.12.t
	desc = brazil.foreign.12.d

	is_triggered_only = yes
	trigger = {
		tag = BRA
		#date > 1862.05.11
		has_country_flag = USA_minister_BRA
	}
	option = {
		name = brazil.foreign.12.a
		country_event = { id = brazil.foreign.13 days = 31}
	}
}

###11.06.1862 - Complete analysis of the proposal for colonization of the Amazon basin by free African Americans
country_event = {
	id = brazil.foreign.13
	title = brazil.foreign.13.t
	desc = {
		text = brazil.foreign.13.d
		trigger = {
			tag = BRA
		}
	}
	is_triggered_only = yes
	trigger = {
		tag = BRA
		#date > 1862.06.11
		has_country_flag = USA_minister_BRA
	}
	option = {
		name = brazil.foreign.13.a
		country_event = { id = brazil.foreign.14 hours = 8}
	}
	option = {
		name = brazil.foreign.13.b
		country_event = { id = brazil.foreign.15 hours = 8}
	}
}

#YES! Foundation of the Company for Colonization of the Amazon Basin
country_event = {
	id = brazil.foreign.14
	title = brazil.foreign.14.t
	desc = {
		text = brazil.foreign.14.d
		trigger = {
			tag = BRA
		}
	}
	desc = {
		text = brazil.foreign.14.d_USA
		trigger = {
			tag = USA
		}
	}
	is_triggered_only = yes
	trigger = {
		OR = {
			tag = USA
			tag = BRA
		}
		#date > 1862.06.11
		has_country_flag = USA_minister_BRA
	}
	option = {
		name = brazil.foreign.14.a
		trigger = {
			tag = BRA
		}
		add_timed_idea = {
			idea = BRA_amazon_colonization
			days = 7305
		}
		add_political_power = -200
		add_popularity = {
			ideology = centrism
			popularity = 0.05
		}
		add_popularity = {
			ideology = social_egalitarianism
			popularity = 0.03
		}
		add_popularity = {
			ideology = traditional_conservatism
			popularity = 0.03
		}
		country_event = { id = brazil.amazon_colonization.1 days = 30}
	}
	option = {
		name = brazil.foreign.14.b
		trigger = {
			tag = USA
		}
		add_stability = 0.10
		#add_ideas = emigration_african_american
		#country_event = { id = brazil.amazon_colonization.1 days = 30}
	}
}

#No! Denied the foundation of the Company of colonization of the Amazon basin by African-Americans.
country_event = {
	id = brazil.foreign.15
	title = brazil.foreign.15.t
	desc = brazil.foreign.15.d

	is_triggered_only = yes
  fire_only_once = yes

	trigger = {
		tag = BRA
		#date > 1862.06.11
		has_country_flag = USA_minister_BRA
	}

	option = {
		name = brazil.foreign.15.a
		add_stability = 0.07
		add_political_power = 300
		#proteção contra atividades estrangeiras
    USA = { country_event = { id = brazil.foreign.16 } }
	}
}

country_event = {
  id = brazil.foreign.16
  title = brazil.foreign.15.t
  desc = brazil.foreign.15.d_USA

  is_triggered_only = yes
  fire_only_once = yes

  option = {
		name = brazil.foreign.15.b
	}
}

#1863.4.19
country_event = {
	id = brazil.foreign.17
	title = brazil.foreign.17.t
	desc = brazil.foreign.17.d
	is_triggered_only = yes
	option = {
		name = brazil.foreign.17.b
		trigger = {
			tag = BRA
		}
		BRA = {
			complete_national_focus = BRA_uruguayan_intervention
		}
		news_event = {id = brazil.foreign.news.1 days = 0}
		URG = {
			1094={
				set_demilitarized_zone = yes	
			}
			1097={
				set_demilitarized_zone = yes
			}
			add_ideas = URG_colorado_blanco_war
		}
	}
	option = {
		name= brazil.foreign.17.c
		trigger = {
			tag = ARG
		}
	}
}

#1864.05.06
country_event = {
	id = brazil.foreign.18
	title = brazil.foreign.18.t
	desc = brazil.foreign.18.d
	is_triggered_only = yes
	option = {
		name = brazil.foreign.18.b
		trigger = {
			tag = BRA
		}
		BRA = { 
			complete_national_focus = BRA_support_brazilians_living_in_uruguay
		}
		news_event = { id = brazil.foreign.news.2 }
	}
	option = {
		name = brazil.foreign.18.c
		trigger = {
			tag = ARG
		}
	}
}

#1864.05.12
country_event = {
	id = brazil.foreign.19
	title = brazil.foreign.19.t
	desc = brazil.foreign.19.d
	is_triggered_only = yes
	option = {
		name = brazil.foreign.19.b
		trigger = {
			tag = BRA
		}
		BRA = { 
			complete_national_focus = BRA_condemn_the_uruguayan_paraguayan_alliance
		}
		news_event = { id = brazil.foreign.news.3 }
	}
	option = {
		name = brazil.foreign.19.c
		trigger = {
			tag = ARG
		}
	}
}

#1864.05.18
country_event = {
	id = brazil.foreign.20
	title = brazil.foreign.20.t
	desc = brazil.foreign.20.d
	is_triggered_only = yes
	option = {
		name = brazil.foreign.20.b
		trigger = {
			tag = BRA
		}
		BRA = { 
			complete_national_focus = BRA_support_brazilian_lords_in_uruguay
		}
		news_event = { id = brazil.foreign.news.4 }
	}
	option = {
		name = brazil.foreign.20.c
		trigger = {
			tag = ARG
		}
	}
}

#we'd have to do some editing Im not sure if news events can handle multiple options though since I have not used them prior to this

#1864.07.01
country_event = {
	id = brazil.foreign.21
	title = brazil.foreign.21.t
	desc = brazil.foreign.21.d
	is_triggered_only = yes
	option = {
		name = brazil.foreign.21.b
		trigger = {
			tag = BRA
		}
		BRA = { 
			complete_national_focus = BRA_challenge_the_blanco_government
		}
		news_event = { id = brazil.foreign.news.5 }
	}
	option = {
		name = brazil.foreign.21.c
		trigger = {
			tag = ARG
		}
	}
}

#1864.07.30
country_event = {
	id = brazil.foreign.22
	title = brazil.foreign.22.t
	desc = {
		text = brazil.foreign.22.d
	}
	is_triggered_only = yes
	option = {
		name = brazil.foreign.22.b
		trigger = {
			tag = BRA
		}
		BRA = { 
			complete_national_focus = BRA_support_the_colorado_party
		}
		news_event = { id = brazil.foreign.news.6 }
	}
	option = {
		name = brazil.foreign.22.c
		trigger = {
			tag = BRA
		}
		BRA = { 
			complete_national_focus = BRA_reclaim_the_cisplatine_province
		}
		news_event = { id = brazil.foreign.news.6 }
	}
	option = {
		name = brazil.foreign.22.e
		trigger = {
			tag = ARG
		}
	}
}

#1864.08.03
country_event = {
	id = brazil.foreign.23
	title = brazil.foreign.23.t
	desc = {
		text = brazil.foreign.23.d
		trigger = {
			BRA = {
				has_completed_focus = BRA_support_the_colorado_party
			}
		}
	}
	desc = {
		text = brazil.foreign.23.d1
		trigger = {
			BRA = {
				has_completed_focus = BRA_reclaim_the_cisplatine_province
			}
		}
	}
	is_triggered_only = yes
	
	option = {
		name = brazil.foreign.23.b
		trigger = {
			tag = BRA
			BRA = {
				has_completed_focus = BRA_support_the_colorado_party
			}
		}
		BRA = { 
			complete_national_focus = BRA_justify_our_interests_in_the_platine_region
		}
		news_event = { id = brazil.foreign.news.7 }
	}
	option = {
		name = brazil.foreign.23.c
		trigger ={
			tag = BRA
			BRA = {
				has_completed_focus = BRA_reclaim_the_cisplatine_province
			}
		}
		BRA = {
			complete_national_focus = BRA_artigas_border_crisis
		}
		news_event = { id = brazil.foreign.news.7 } 
	}
	option = {
		name = brazil.foreign.23.e
		trigger = {
			tag = ARG
		}
	}
}

#1864.08.10
country_event = {
	id = brazil.foreign.24
	is_triggered_only = yes
	hidden = yes
	title = brazil.foreign.24.t
	desc = brazil.foreign.24.d
	option = {
		name = brazil.foreign.24.a
		if = {
			limit = {
				BRA = {
					has_completed_focus = BRA_justify_our_interests_in_the_platine_region
				}
			}
			BRA = { 
				complete_national_focus = BRA_direct_intervention
				country_event = {id = brazil.25 days = 0}
			}
			URG = {
				country_event = {id = brazil.25 days = 0}
			}
			news_event = { id = brazil.foreign.news.8 }
		}
		else_if = {
			limit = {
				BRA = {
					has_completed_focus = BRA_artigas_border_crisis
				}
			}
			BRA = {
				complete_national_focus = BRA_the_second_cisplatine_war
				country_event = {id = brazil.25 days = 0}
			}
			URG = {
				country_event = {id = brazil.25 days = 0}
			}
			news_event = { id = brazil.foreign.news.8 }
		}
	}
}

add_namespace = brazil.foreign.news

news_event = {
	id = brazil.foreign.news.1
	title = brazil.foreign.news.1.t
	desc = brazil.foreign.news.1.d
	major = yes
	is_triggered_only = yes
	trigger = {
		OR = {
			TAG = PAR
			TAG = BOL
			TAG = URG
			TAG = URC
			TAG = ARG
			TAG = CHL
			TAG = PRU
			TAG = COL
			TAG = VEN
		}
	}
	
	option = {
		name = brazil.foreign.news.1.a
		trigger = {
			OR = {
				tag = URG
				tag = PAR
			}
		}
	}
	option = {
		name = brazil.foreign.news.1.b
		trigger = {
			OR = {
				tag = BRA
				tag = ARG
			}
		}
	}
	option = {
		name = brazil.foreign.news.1.c
		trigger = {
			NOT = {
				OR = {
					tag = BRA
					tag = ARG
					tag = PAR
					tag = URG
				}
			}
		}
	}
}

news_event = {
	id = brazil.foreign.news.2
	title = brazil.foreign.news.2.t
	desc = brazil.foreign.news.2.d
	major = yes
	is_triggered_only = yes
	trigger = {
		OR = {
			TAG = PAR
			TAG = BOL
			TAG = URG
			TAG = URC
			TAG = ARG
			TAG = CHL
			TAG = PRU
			TAG = COL
			TAG = VEN
		}
	}
	option = {
		name = brazil.foreign.news.2.a
		trigger = {
			OR = {
				tag = URG
				tag = PAR
			}
		}
	}
	option = {
		name = brazil.foreign.news.2.b
		trigger = {
			OR = {
				tag = BRA
				tag = ARG
			}
		}
	}
	option = {
		name = brazil.foreign.news.2.c
		trigger = {
			NOT = {
				OR = {
					tag = BRA
					tag = ARG
					tag = PAR
					tag = URG
				}
			}
		}
	}
}

news_event = {
	id = brazil.foreign.news.3
	title = brazil.foreign.news.3.t
	desc = brazil.foreign.news.3.d
	major = yes
	is_triggered_only = yes
	trigger = {
		OR = {
			TAG = PAR
			TAG = BOL
			TAG = URG
			TAG = URC
			TAG = ARG
			TAG = CHL
			TAG = PRU
			TAG = COL
			TAG = VEN
		}
	}
	option = {
		name = brazil.foreign.news.3.a
		trigger = {
			OR = {
				tag = URG
				tag = PAR
			}
		}
	}
	option = {
		name = brazil.foreign.news.3.b
		trigger = {
			OR = {
				tag = BRA
				tag = ARG
			}
		}
	}
	option = {
		name = brazil.foreign.news.3.c
		trigger = {
			NOT = {
				OR = {
					tag = BRA
					tag = ARG
					tag = PAR
					tag = URG
				}
			}
		}
	}
}

news_event = {
	id = brazil.foreign.news.4
	title = brazil.foreign.news.4.t
	desc = brazil.foreign.news.4.d
	major = yes
	is_triggered_only = yes
	trigger = {
		OR = {
			TAG = PAR
			TAG = BOL
			TAG = URG
			TAG = URC
			TAG = ARG
			TAG = CHL
			TAG = PRU
			TAG = COL
			TAG = VEN
		}
	}
	option = {
		name = brazil.foreign.news.4.a
		trigger = {
			OR = {
				tag = URG
				tag = PAR
			}
		}
	}
	option = {
		name = brazil.foreign.news.4.b
		trigger = {
			OR = {
				tag = BRA
				tag = ARG
			}
		}
	}
	option = {
		name = brazil.foreign.news.4.c
		trigger = {
			NOT = {
				OR = {
					tag = BRA
					tag = ARG
					tag = PAR
					tag = URG
				}
			}
		}
	}
}

news_event = {
	id = brazil.foreign.news.5
	title = brazil.foreign.news.5.t
	desc = brazil.foreign.news.5.d
	major = yes
	is_triggered_only = yes
	trigger = {
		OR = {
			TAG = PAR
			TAG = BOL
			TAG = URG
			TAG = URC
			TAG = ARG
			TAG = CHL
			TAG = PRU
			TAG = COL
			TAG = VEN
		}
	}
	option = {
		name = brazil.foreign.news.5.a
		trigger = {
			OR = {
				tag = URG
				tag = PAR
			}
		}
	}
	option = {
		name = brazil.foreign.news.5.b
		trigger = {
			OR = {
				tag = BRA
				tag = ARG
			}
		}
	}
	option = {
		name = brazil.foreign.news.5.c
		trigger = {
			NOT = {
				OR = {
					tag = BRA
					tag = ARG
					tag = PAR
					tag = URG
				}
			}
		}
	}
}

news_event = {
	
	id = brazil.foreign.news.6
	title = brazil.foreign.news.6.t
	desc = {
		text = brazil.foreign.news.6.d
		trigger = {
			BRA = {
				has_completed_focus = BRA_support_the_colorado_party
			}
		}
	}
	desc = {
		text = brazil.foreign.news.6.d1
		trigger = {
			BRA = { has_completed_focus = BRA_reclaim_the_cisplatine_province }
		}
	}
	major = yes
	is_triggered_only = yes
	trigger = {
		OR = {
			TAG = PAR
			TAG = BOL
			TAG = URG
			TAG = URC
			TAG = ARG
			TAG = CHL
			TAG = PRU
			TAG = COL
			TAG = VEN
		}
	}

	option = {
		name = brazil.foreign.news.6.a
		trigger = {
			OR = {
				tag = URG
				tag = PAR
			}
		}
	}
	option = {
		name = brazil.foreign.news.6.b
		trigger = {
			OR = {
				tag = ARG
			}
		}
	}
	option = {
		name = brazil.foreign.news.6.c
		trigger = {
			NOT = {
				tag = BRA
				tag = ARG
				tag = PAR
				tag = URG
			}
		}
	}
	option = {
		name = brazil.foreign.news.6.e
		trigger = {
			tag = BRA
		}
	}
}

news_event = {
	id = brazil.foreign.news.7
	title = {
		text = brazil.foreign.news.7.t
		trigger = {
			BRA = {
				OR = {
					has_completed_focus = BRA_artigas_border_crisis
					has_completed_focus = BRA_justify_our_interests_in_the_platine_region
				}
			}
		}
	}
	title = {
		text = brazil.foreign.news.7.t1
		trigger = {
			BRA = { has_completed_focus = BRA_artigas_border_crisis }
		}
	}	
	desc = {
		text = brazil.foreign.news.7.d
		trigger = {
			BRA = {
				has_completed_focus = BRA_justify_our_interests_in_the_platine_region
			}
		}
	}
	desc = {
		text = brazil.foreign.news.7.d1
		trigger = {
			BRA = { has_completed_focus = BRA_artigas_border_crisis }
		}
	}
	major = yes
	is_triggered_only = yes
	trigger = {
		OR = {
			TAG = PAR
			TAG = BOL
			TAG = URG
			TAG = URC
			TAG = ARG
			TAG = CHL
			TAG = PRU
			TAG = COL
			TAG = VEN
		}
	}
	option = {
		name = brazil.foreign.news.7.a
		trigger = {
			OR = {
				tag = URG
				tag = PAR
			}
		}
	}
	option = {
		name = brazil.foreign.news.7.b
		trigger = {
			tag = BRA
			BRA = {
				has_completed_focus = BRA_justify_our_interests_in_the_platine_region
			}
		}
	}
	option = {
		name = brazil.foreign.news.7.c
		trigger = {
			tag = BRA
			BRA = { has_completed_focus = BRA_artigas_border_crisis }
		}
	}
	option = {
		name = brazil.foreign.news.7.e
		trigger = {
			NOT = {
				tag = BRA
				tag = PAR
				tag = URG
			}
		}
	}
}

news_event = {
	id = brazil.foreign.news.8
	title = brazil.foreign.news.8.t
	desc = {
		text = brazil.foreign.news.8.d
	}
	major = yes
	is_triggered_only = yes
	trigger = {
		OR = {
			TAG = PAR
			TAG = BOL
			TAG = URG
			TAG = URC
			TAG = ARG
			TAG = CHL
			TAG = PRU
			TAG = COL
			TAG = VEN
		}
	}
	option = {
		name = brazil.foreign.news.8.a
		trigger = {
			OR = {
				tag = URG
				tag = PAR
			}
		}
	}
	option = {
		name = brazil.foreign.news.8.b
		trigger = {
			tag = BRA
			BRA = {
				has_completed_focus = BRA_direct_intervention
			}
		}
	}
	option = {
		name = brazil.foreign.news.8.c
		trigger = {
			tag = BRA
			BRA = { has_completed_focus = BRA_the_second_cisplatine_war }
		}
	}
	option = {
		name = brazil.foreign.news.8.e
		trigger = {
			NOT = {
				tag = BRA
				tag = PAR
				tag = URG
			}
		}
	}
}

#Amazon
country_event = {
	id = brazil.amazon_colonization.1
	title = brazil.amazon_colonization.t
	desc = {
        text = brazil.amazon_colonization.1.d
		trigger = { tag = BRA }
	}
	desc = {
        text = brazil.amazon_colonization.1.d_USA
		trigger = {	tag = USA }
	}

	is_triggered_only = yes
	trigger = {
		#date > 1862.07.11
		OR = {
			tag = BRA
			tag = USA
		}
		BRA = { has_idea = BRA_amazon_colonization }
	}

	option = {
		name = brazil.amazon_colonization.1.a
        hidden_effect = {
            if = {
                limit = {
                    495 = { is_controlled_by = ROOT }
                    496 = { is_controlled_by = ROOT }
                    280 = { is_controlled_by = ROOT }
                    1323 = { is_controlled_by = ROOT }
                }
                randomize_temp_variable = {
                    var = africanamericanimmigrants1
                    distribution = uniform
                    min = 10000
                    max = 50000
                }
                set_temp_variable = {
                    africanamericanimmigrants2 = africanamericanimmigrants1
                }
                divide_temp_variable = {
                    africanamericanimmigrants2 = 4
                }
                multiply_temp_variable = { africanamericanimmigrants1 = -1 }
                USA = {
                    add_manpower = var:africanamericanimmigrants1
                }
                495 = {
                    add_manpower = africanamericanimmigrants2
                }
                496 = {
                    add_manpower = africanamericanimmigrants2
                }
                280 = {
                    add_manpower = africanamericanimmigrants2
                }
                1323 = {
                    add_manpower = africanamericanimmigrants2
                }
            }
            BRA = { country_event = { id = brazil.amazon_colonization.1 days = 365 } }
            USA = { country_event = { id = brazil.amazon_colonization.1 days = 365 } }
        }
	}
}

add_namespace = brazil_news

news_event = {
  id = brazil_news.1
  title = brazil_news.1.t
  desc = brazil_news.1.d
  picture = GFX_news_event_christie_question

  major = yes
  is_triggered_only = yes

  option = {
    trigger = {
      NOT = { TAG = ENG }
      NOT = { TAG = BRA }
    }
    name = brazil_news.1.a
  }
  option = {
    trigger = { TAG = BRA }
    name = brazil_news.1.b
  }
  option = {
    trigger = { TAG = ENG }
    name = brazil_news.1.c
  }
}

news_event = {
  id = brazil_news.2
  title = brazil_news.2.t
  desc = brazil_news.2.d
  picture = GFX_news_event_christie_war

  major = yes
  is_triggered_only = yes

  option = {
    trigger = {
      NOT = { TAG = ENG }
      NOT = { TAG = BRA }
    }
    name = brazil_news.2.a
  }
  option = {
    trigger = {
      TAG = BRA
    }
    name = brazil_news.2.b
  }
  option = {
    trigger = {
      TAG = ENG
    }
    name = brazil_news.2.c
  }
  option = {
    trigger = { TAG = FRA }
    name = brazil_news.2.e
	  BRA = {
		  add_opinion_modifier = {
			  target = FRA
			  modifier = offered_support
		  }
      hidden_effect = {
        add_manpower = -3000
        load_oob = FRA_AID_CHRISTIE
      }
	  }
	}
}

news_event = {
  id = brazil_news.3
  title = brazil_news.3.t
  desc = brazil_news.3.d

  picture = GFX_news_event_christie_brazil

  major = yes

  is_triggered_only = yes

  option = {
    trigger = {
      NOT = { TAG = ENG }
      NOT = { TAG = BRA }
    }
      name = brazil_news.3.a
  }
  option = {
    trigger = {
      TAG = BRA
    }
    name = brazil_news.3.b
  	add_stability = 0.1
  	add_war_support = 0.10
  	add_political_power = 35
  }
  option = {
    trigger = {
      TAG = ENG
    }
    name = brazil_news.3.c
	   add_timed_idea = {
  		idea = ENG_reparations_brazil
  		days = 80
  	}
  	add_stability = -0.15
  	add_political_power = -50
  }
}


news_event = {
  id = brazil_news.4
  title = brazil_news.4.t
  desc = brazil_news.4.d

  picture = GFX_news_event_christie_britain

  major = yes

  is_triggered_only = yes

  option = {
    trigger = {
      NOT = { TAG = ENG }
      NOT = { TAG = BRA }
    }
    name = brazil_news.4.a
  }
  option = {
    trigger = {
      TAG = BRA
    }
    name = brazil_news.4.b
  	add_stability = 0.1
  	add_war_support = 0.10
  	add_political_power = 35
  	add_timed_idea = {
		  idea = BRA_reparations_being_paid
		  days = 100
	  }
  }
  option = {
    trigger = {
      TAG = ENG
    }
    name = brazil_news.4.c
    add_stability = 0.1
    add_war_support = 0.15
    add_political_power = 20
  }
}

news_event = {
  id = brazil_news.5
  title = brazil_news.5.t
  desc = brazil_news.5.d

  picture = GFX_news_event_ayacucho_treaty

  major = no

  is_triggered_only = yes

  option = {
    trigger = {
		TAG = BRA
    }
    name = brazil_news.5.a
	  add_political_power = 15
	  BOL = {
  		add_opinion_modifier = {
  			target = BRA
  			modifier = improved_relations
  	    }
	  }
   }
}

news_event = {
  id = brazil_news.6
  title = brazil_news.6.t
  desc = brazil_news.6.d

  picture = GFX_news_event_ayacucho_treaty

  major = no

  is_triggered_only = yes

  option = {
	trigger = {tag = BRA}
	name = brazil_news.6.a

	add_political_power = -10
  }
}

add_namespace = brazil.minister.actions

country_event = {
	id = brazil.minister.actions.0
	title = brazil.minister.actions.0.t
	desc = brazil.minister.actions.0.d
	is_triggered_only = yes
	picture = GFX_report_event_marques_de_olinda
	option = {
		name = brazil.minister.actions.0.a
		add_trait = {
			character = BRA_Marquis_of_Olinda
			ideology = conserv
			trait = BRA_trait_president_of_council_of_ministers
		}
		add_trait = {
			character = BRA_Marquis_of_Olinda
			ideology = conserv
			trait = BRA_trait_minister_of_empire
		}
		#set_power_balance = {
		#	id = BRA_BOP_1857_Marquiz_of_Olinda_mid
		#}
		
		#set_power_balance = {
		#	id = BRA_balance_to_power
		#	set_default = yes
		#}
	}
}

country_event = {
	id = brazil.minister.actions.1
	title = brazil.minister.actions.1.t
	desc = brazil.minister.actions.1.d
	is_triggered_only = yes
	option = {
		name = brazil.minister.actions.1.a
		add_political_power = -200
		activate_advisor = BRA_francisco_pereira_jugde
		activate_advisor = BRA_viscount_of_maranguape_foreign
		activate_advisor = BRA_viscount_of_sousa_franco_finance
		activate_advisor = BRA_jeronimo_coelho_army_chief
		activate_advisor = BRA_jose_antonio_saraiva_navy_chief
		set_country_flag = brazil_conciliatory
		hidden_effect = { country_event = { id = brazil.minister.actions.6 days = 1 } }
	}
}

country_event = {
	id = brazil.minister.actions.2
	title = brazil.minister.actions.2.t
	desc = brazil.minister.actions.2.d
	is_triggered_only = yes
	option = {
		name = brazil.minister.actions.2.a
		deactivate_advisor = BRA_jeronimo_coelho_army_chief
		add_advisor_role = {
			character = BRA_jose_antonio_saraiva
			advisor = {
				slot = army_chief
				idea_token = BRA_jose_antonio_saraiva_army_chief
				traits = {
					BRA_trait_minister_of_war
					army_chief_organizational_1
				}
			}
		}
		activate_advisor = BRA_jose_antonio_saraiva_army_chief
	}
}

country_event = {
    id = brazil.minister.actions.3
    is_triggered_only = yes
    hidden = yes
    immediate = {
        if = { limit = { BRA = { has_idea = BRA_Marquis_of_Olinda_adm } }
            remove_trait = { character = BRA_Marquis_of_Olinda ideology = conserv trait = BRA_trait_president_of_council_of_ministers }
            remove_country_leader_role = { ideology = conserv } }
        if = { limit = { BRA = { has_government = traditional_conservatism } }
            remove_country_leader_role = { ideology = conserv } }
        if = { limit = { BRA = { has_idea = BRA_francisco_pereira_jugde } }
            deactivate_advisor = BRA_francisco_pereira_jugde }
        if = { limit = { BRA = { has_idea = BRA_viscount_of_maranguape_foreign } }
            deactivate_advisor = BRA_viscount_of_maranguape_foreign }
        if = { limit = { BRA = { has_idea = BRA_viscount_of_sousa_franco_finance } }
            deactivate_advisor = BRA_viscount_of_sousa_franco_finance }
        if = { limit = { BRA = { has_idea = BRA_jeronimo_coelho_army_chief } }
            deactivate_advisor = BRA_jeronimo_coelho_army_chief }
        if = { limit = { BRA = { has_idea = BRA_jose_antonio_saraiva_navy_chief } }
            deactivate_advisor = BRA_jose_antonio_saraiva_navy_chief }
        #if = {   These don't seem to be entered as characters
		#	limit =  {
		#		BRA = { has_idea = BRA_jose_antonio_saraiva_army_chief }
		#	}
		#	deactivate_advisor = BRA_jose_antonio_saraiva_army_chief
		#}
		if = { limit = { BRA = { has_idea = BRA_eusebio_de_queiros_jugde } }
            deactivate_advisor = BRA_eusebio_de_queiros_jugde }
        if = { limit = { BRA = { has_idea = BRA_viscount_of_uruguay_foreign } }
            deactivate_advisor = BRA_viscount_of_uruguay_foreign }
        if = { limit = { BRA = { has_idea = BRA_viscount_of_itaborai_finance } }
            deactivate_advisor = BRA_viscount_of_itaborai_finance }
        if = { limit = { BRA = { has_idea = BRA_viscount_of_rio_branco_army_chief } }
            deactivate_advisor = BRA_viscount_of_rio_branco_army_chief }
        if = { limit = { BRA = { has_idea = BRA_viscount_of_abaete_navy_chief } }
            deactivate_advisor = BRA_viscount_of_abaete_navy_chief }
    }
}

#Ministers Appointed - 1858.12
country_event = {
	id = brazil.202
	title = brazil.202.t
	desc =  brazil.202.d
	picture = GFX_report_event_election_vote
	is_triggered_only = yes
	immediate = {
		BRA = {
			complete_national_focus = BRA_1858_president_of_council_of_ministers
			#country_event = { id = brazil.201 }
			if = { limit= { has_country_flag = brazil_conciliatory }
				remove_country_leader_role = { ideology = conserv }
				clr_country_flag = brazil_conciliatory
				deactivate_advisor = BRA_francisco_pereira_jugde
				deactivate_advisor = BRA_viscount_of_maranguape_foreign
				deactivate_advisor = BRA_viscount_of_sousa_franco_finance
				deactivate_advisor = BRA_jeronimo_coelho_army_chief
				deactivate_advisor = BRA_jose_antonio_saraiva_navy_chief
			}
		}
	}
	option = {#Visconde de Abaeté
		name = brazil.202.a
		add_country_leader_role = {
			character = BRA_viscount_of_abaete
			promote_leader = yes
			country_leader = {
				desc = "POLITICS_VISCOUNT_OF_ABAETE_DESC"
				ideology = federal
				expire = "1883.9.14.1"
				traits = {
					BRA_trait_president_of_council_of_ministers
					BRA_trait_minister_of_the_navy
				}
			}
		}
		set_country_flag = brazil_conciliatory
		add_popularity = { ideology = traditional_conservatism popularity = 0.005 }
		add_popularity = { ideology = centrism popularity = 0.005 }
		complete_national_focus = BRA_1858_conciliatory_cabinet
	}
	option = {#Eusébio de Queirós
		name = brazil.202.b
		set_politics = { ruling_party = radical_democracy }
		add_trait = {
			character = BRA_eusebio_de_queiros
			ideology = plutocracy
			trait =	BRA_trait_president_of_council_of_ministers
		}
		add_trait = {
			character = BRA_eusebio_de_queiros
			ideology = plutocracy
			trait = BRA_trait_minister_of_justice
		}
		set_country_flag = brazil_ultraconservative
		add_popularity = { ideology = radical_democracy popularity = 0.01 }
		complete_national_focus = BRA_1858_ultra_conservative_cabinet
	}
	option = {#Viscount of Uruguai
		name = brazil.202.c
		add_country_leader_role = {
			character = BRA_viscount_of_uruguay
			promote_leader = yes
			country_leader = {
				DESC = "POLITICS_VISCOUNT_OF_URUGUAY_DESC"
				ideology = natconserv
				expire = 1866.6.15.1
				traits = {
					BRA_trait_president_of_council_of_ministers
					BRA_trait_foreign_minister
					eoanb_trait_experienced_diplomat
				}
			}
		}
		set_country_flag = brazil_conservative
		add_popularity = { ideology = traditional_conservatism popularity = 0.01}
		complete_national_focus = BRA_1858_conservative_cabinet
	}
	option = {#Francisco Furtado
		name = brazil.202.e
        set_politics = { ruling_party = centrism }
		add_trait = {
			character = BRA_Francisco_Jose_Furtado
			ideology = conserv_liberal
			trait = BRA_trait_president_of_council_of_ministers
		}
		add_trait = {
			character = BRA_Francisco_Jose_Furtado
			ideology = conserv_liberal
			trait = BRA_trait_minister_of_justice
		}
		set_country_flag = brazil_liberal
		add_popularity = { ideology = centrism popularity = 0.01 }
		complete_national_focus = BRA_1858_liberal_cabinet
	}
}

#Appointed Prime-Minister 1859.08
country_event = {
	id = brazil.203
	title = brazil.202.t
	desc =  brazil.202.d
	picture = GFX_report_event_election_vote
	is_triggered_only = yes
	immediate = {
		if = { 
		limit = { has_country_flag = brazil_conciliatory }
			deactivate_advisor = BRA_viscount_of_rio_branco_army_chief
			deactivate_advisor = BRA_sergio_teixeira_macedo_adm
			deactivate_advisor = BRA_Jose_Tomas_Nabuco_de_Araujo_Filho_judge
			deactivate_advisor = BRA_viscount_of_inhomirim_finance
			deactivate_advisor = BRA_viscount_of_rio_branco_army_chief
			deactivate_advisor = BRA_viscount_of_rio_branco_foreign
			clr_country_flag = brazil_conciliatory
			remove_country_leader_role = { ideology = federal }
		}
		if = {
		limit = { has_country_flag = brazil_conservative }
			deactivate_advisor = BRA_sergio_teixeira_macedo_adm
			deactivate_advisor = BRA_marquis_of_muritiba_judge
			deactivate_advisor = BRA_viscount_of_rio_branco_finance
			deactivate_advisor = BRA_Luis_Alves_de_Lima_e_Silva_army_chief
			deactivate_advisor = BRA_Joaquim_Marques_Lisboa_navy_chief
        	remove_country_leader_role = { ideology = natconserv }
			clr_country_flag = brazil_conservative
        }
		if = { 
			limit = { has_country_flag = brazil_ultraconservative }
			deactivate_advisor = BRA_viscount_of_niteroi_adm
			deactivate_advisor = BRA_viscount_of_uruguay_foreign
			deactivate_advisor = BRA_viscount_of_itaborai_finance
			deactivate_advisor = BRA_manuel_felizardo_de_sousa_e_melo_army_chief
			deactivate_advisor = BRA_marquis_of_muritiba_navy_chief
			remove_country_leader_role = { ideology = plutocracy }
			clr_country_flag = brazil_ultraconservative
		}
		if = { 
		limit = { has_country_flag = brazil_liberal }
			deactivate_advisor = BRA_jose_liberato_barroso_adm
			deactivate_advisor = BRA_viscount_of_caravelas_finance
			deactivate_advisor = BRA_joao_pedro_dias_vieira_foreign
			deactivate_advisor = BRA_baron_of_pinto_lima_navy_chief
			deactivate_advisor = BRA_Henrique_de_Beaurepaire_Rohan_army_chief
    		remove_country_leader_role = { ideology = conserv_liberal }
			clr_country_flag = brazil_liberal
		}
		BRA = {
			complete_national_focus = BRA_1859_president_of_council_of_ministers
		}
	}

	option = {#uruguaiana
		name = brazil.203.a
		add_country_leader_role = {
			character = BRA_Angelo_Muniz_de_Silva_Ferraz
			promote_leader = yes
			country_leader = {
				ideology = paleoconserv
				expire = "1867.1.18.1"
				desc = "POLITICS_BARON_OF_URUGUAIANA_DESC"
				traits = {
					BRA_trait_president_of_council_of_ministers
					BRA_trait_finance_minister
					BRA_trait_minister_of_empire
				}
			}
		}
		set_country_flag = brazil_conservative
		set_politics = { ruling_party = traditional_conservatism }
		add_popularity = { ideology = traditional_conservatism popularity = 0.01 }
	}
	option = {#zacarias
		name = brazil.203.b
		add_country_leader_role = {
			character = BRA_Zacarias_de_Gois_e_Vasconcelos
			country_leader = { 
				ideology = market_liberal
				desc = "POLITICS_ZACARIAS_DESC"
			}
			promote_leader = yes
		}
		add_trait = {
			character = BRA_Viscount_of_Sinimbu
			trait = BRA_trait_minister_of_empire
		}
		add_trait = {
			character = BRA_Viscount_of_Sinimbu
			trait = BRA_trait_president_of_council_of_ministers
		}
		set_politics = { ruling_party = centrism }
		set_country_flag = brazil_liberal
		add_popularity = { ideology = centrism popularity = 0.01 }
	}
}

country_event = {
	id = brazil.minister.actions.5
	title = brazil.minister.actions.5.t
	desc = brazil.minister.actions.5.d
	is_triggered_only = yes
	option = {
		name = brazil.minister.actions.5.a
		trigger = {
			BRA = { has_country_flag =  brazil_conciliatory }
		}
		add_political_power = -200
		activate_advisor = BRA_sergio_teixeira_macedo_adm
		activate_advisor = BRA_Jose_Tomas_Nabuco_de_Araujo_Filho_judge
		activate_advisor = BRA_viscount_of_inhomirim_finance
		activate_advisor = BRA_viscount_of_rio_branco_army_chief
		add_advisor_role = {
			character = BRA_viscount_of_rio_branco
			advisor = {
				name = "José Maria da Silva Paranhos"
				slot = political_advisor
				idea_token = BRA_viscount_of_rio_branco_foreign
				traits = {
					eoanb_trait_experienced_diplomat
					BRA_trait_foreign_minister
				}
			}
		}
		activate_advisor = BRA_viscount_of_rio_branco_foreign
		add_popularity = {
			ideology = traditional_conservatism
			popularity = 0.01
		}
	}
	option = {
		name = brazil.minister.actions.5.b
		trigger = {
			BRA = { has_country_flag =  brazil_ultraconservative }
		}
		add_political_power = -200
		activate_advisor = BRA_viscount_of_niteroi_adm
		activate_advisor = BRA_viscount_of_uruguay_foreign
		activate_advisor = BRA_viscount_of_itaborai_finance
		activate_advisor = BRA_manuel_felizardo_de_sousa_e_melo_army_chief
		activate_advisor = BRA_marquis_of_muritiba_navy_chief
		add_trait = {
			character = BRA_marquis_of_muritiba_navy_chief
			slot = navy_chief
			trait = BRA_trait_minister_of_the_navy
		}
	}
	option = {
		name = brazil.minister.actions.5.c
		trigger = {
			BRA = { has_country_flag =  brazil_liberal }
		}
		activate_advisor = BRA_jose_liberato_barroso_adm
		activate_advisor = BRA_viscount_of_caravelas_finance
		activate_advisor = BRA_joao_pedro_dias_vieira_foreign
		activate_advisor = BRA_baron_of_pinto_lima_navy_chief
		activate_advisor = BRA_henrique_de_beaurepaire_rohan_high_command
	}
	option = {
		name = brazil.minister.actions.5.e
		trigger = {
			BRA = { has_country_flag =  brazil_conservative }
		}
		activate_advisor = BRA_sergio_teixeira_macedo_adm
		activate_advisor = BRA_marquis_of_muritiba_judge
		add_advisor_role = {
			character = BRA_viscount_of_rio_branco
			advisor = {
				name = "José Maria da Silva Paranhos"
				slot = political_advisor
				idea_token = BRA_viscount_of_rio_branco_finance
				traits = {
					eoanb_trait_experienced_diplomat
					BRA_trait_finance_minister
				}
			}
		}
		activate_advisor = BRA_viscount_of_rio_branco_finance
		add_advisor_role = {
			character = BRA_Luis_Alves_de_Lima_e_Silva
			advisor = {
				name = "Luís Alves de Lima e Silva"
				slot = political_advisor
				idea_token = BRA_Luis_Alves_de_Lima_e_Silva_army_chief
				traits = {
					army_chief_reform_3
				}
			}
		}
		activate_advisor = BRA_Luis_Alves_de_Lima_e_Silva_army_chief
		add_advisor_role = {
			character = BRA_Joaquim_Marques_Lisboa
			advisor = {
				name = "Joaquim Marques Lisboa"
				slot = political_advisor
				idea_token = BRA_Joaquim_Marques_Lisboa_navy_chief
				traits = {
					navy_chief_reform_3
				}
			}
		}
		activate_advisor = BRA_Joaquim_Marques_Lisboa_navy_chief
	}
}

country_event = {
	id = brazil.minister.actions.6
	title = brazil.minister.actions.6.t
	desc = brazil.minister.actions.6.d
	is_triggered_only = yes
	option = {
		name = brazil.minister.actions.6.a
		add_popularity = {
			ideology = radical_democracy
			popularity = 0.1
		}
		add_popularity = {
			ideology = traditional_conservatism
			popularity = -0.1
		}
		add_political_power = -50
		add_power_balance_value = {
			id = BRA_Balance_of_Power_1857
			value = -0.12
			tooltip_side = BRA_BOP_government
		}
		add_rad_dem_to_opposition = yes
	}
}

#country_event = {
#	id = brazil.minister.actions.6
#	title = brazil.minister.actions.6.t
#	desc = brazil.minister.actions.6.d
#	is_triggered_only = yes
#	option = {
#		name = brazil.minister.actions.6.a
#		#retire_character = BRA_Jose_Tomas_Nabuco_de_Araujo_Filho_judge
#		#remove_advisor_role = {
#		#	character = BRA_Jose_Maria_da_Silva_Paranhos
#		#	slot = army_chief
#		#}
#		add_advisor_role = {
#			character = BRA_marquis_of_muritiba
#			advisor = {
#				slot = political_advisor
#				idea_token = BRA_marquis_of_muritiba_judge
#				traits = { eoanb_trait_effective_judge }
#			}
#			activate = yes
#		}
#	}
#}

#country_event = {
#	id = brazil.minister.actions.5
#	title = brazil.minister.actions.5.t
#	desc = brazil.minister.actions.5.d
#	is_triggered_only = yes
#	option = {
#		name = brazil.minister.actions.5.a
#		deactivate_advisor = BRA_viscount_of_rio_branco_army_chief
#		activate_advisor = BRA_manuel_felizardo_de_sousa_e_melo_army_chief
#	}
#}

country_event = {
	id = brazil.minister.actions.8
	title = brazil.minister.actions.8.t
	desc = brazil.minister.actions.8.d
	is_triggered_only = yes
	option = {
		name = brazil.minister.actions.8.a
		trigger = {
			BRA = { has_country_flag =  brazil_conservative }
		}
		add_advisor_role = {
			character = BRA_Joao_Lustosa_da_Cunha_Paranagua
			advisor = {
				slot = political_advisor
				idea_token = BRA_Joao_Lustosa_da_Cunha_Paranagua_jugde
				traits = { BRA_trait_minister_of_justice }
			}
			activate = yes
		}
		add_advisor_role = {
			character = BRA_Viscount_of_Sinimbu
			advisor = {
				slot = political_advisor
				idea_token = BRA_Viscount_of_Sinimbu_foreign
				traits = { eoanb_trait_foreign_secretary }
			}
			activate = yes
		}
		remove_trait = {
			character = BRA_Viscount_of_Sinimbu
			slot = political_advisor
			trait = BRA_trait_minister_of_empire
		}
		
		add_advisor_role = {
			character = BRA_francisco_xavier_paes_barreto
			advisor = {
				slot = navy_chief
				idea_token = BRA_francisco_xavier_paes_barreto_navy
				traits = {
					navy_chief_old_guard
					BRA_trait_minister_of_the_navy
				}
			}
			activate = yes
		}
		add_advisor_role = {
			character = BRA_sebastiao_do_rego_barros
			advisor = {
				slot = army_chief
				idea_token = BRA_sebastiao_do_rego_barros_army
				traits = {
					army_chief_old_guard
					BRA_trait_minister_of_war
				}
			}
			activate = yes
		}
	}
	option = {
		name = brazil.minister.actions.8.c
		trigger = {
			BRA = { has_country_flag =  brazil_ultraconservative}
		}
		activate_advisor = BRA_Eusebio_de_Queiros_judge
		activate_advisor = BRA_viscount_of_uruguay_foreign
		activate_advisor = BRA_viscount_of_itaborai_finance
		activate_advisor = BRA_manuel_felizardo_de_sousa_e_melo
		activate_advisor = BRA_marquis_of_muritiba_navy_chief
		
	}
		option = {
		name = brazil.minister.actions.8.b
		trigger = {
			BRA = { has_country_flag =  brazil_conciliatory }
		}
		activate_advisor = BRA_Francisco_Jose_Furtado_judge
		add_advisor_role = {
			character = BRA_viscount_of_caravelas
			advisor = {
				slot = political_advisor
				idea_token = BRA_viscount_of_caravelas_foreign
				traits = { BRA_trait_foreign_minister }
			}
			activate = yes
		}
		add_advisor_role = {
			character = BRA_jose_dias_de_carvalho
			advisor = {
				slot = political_advisor
				idea_token = BRA_jose_dias_de_carvalho_finance
				traits = { BRA_trait_finance_minister }
			}
			activate = yes
		}
		add_advisor_role = {
			character = BRA_Manuel_Marques_de_Sousa
			advisor = {
				slot = army_chief
				idea_token = BRA_Manuel_Marques_de_Sousa_army_chief
				traits = {
					BRA_trait_minister_of_war
				}
			}
			activate = yes
		}
		add_advisor_role = {
			character = BRA_jose_bonifacio
			advisor = {
				slot = army_chief
				idea_token = BRA_jose_bonifacio_navy_chief
				traits = {
					BRA_trait_minister_of_the_navy
				}
			}
			activate = yes
		}
	}
}

#country_event = {
#	id = brazil.minister.actions.9
#	title = brazil.minister.actions.9.t
#	desc = brazil.minister.actions.9.d
#	is_triggered_only = yes
#	option = {
#		name = brazil.minister.actions.9.a
#		retire_character = BRA_Angelo_Muniz_de_Silva_Ferraz_adm
#		#remove_advisor_role = {
#		#	character = BRA_Jose_Maria_da_Silva_Paranhos
#		#	slot = army_chief
#		#}
#		add_advisor_role = {
#			character = BRA_joao_de_almeida_pereira_filho
#			advisor = {
#				slot = political_advisor
#				idea_token = BRA_joao_de_almeida_pereira_filho_adm
#				traits = { efficient_administrator }
#			}
#			activate = yes
#		}
#	}
#}

add_namespace = brazil_votes
add_namespace = brazil_votes_results

country_event = { # Brazil Votes 1857_1
	id = brazil_votes.1
	title = brazil_votes.1.t
	desc = brazil_votes.1.d
	picture = GFX_report_event_generic_parliament

	is_triggered_only = yes

	immediate = {
		set_variable = { # Don't change
			var = current_reform_id
			value = -1									# This allows the system to detect a custom vote in progress
		}

		reset_approval_arrays = yes						# Resets all of the approvals
		#set_1_approval_highly_disagree = yes			# For those ideologies who have a 1 for this type of legislation will highly disagree with this bill
		#set_2_approval_disagree = yes					# For those ideologies who have a 2 for this type of legislation will disagree with this bill
		#set_3_approval_neutral = yes					# For those ideologies who have a 3 for this type of legislation will be neutral about this bill
		#set_4_approval_highly_agree = yes				# For those ideologies who have a 4 for this type of legislation will highly agree with this bill

		set_4_approval_highly_agree = yes				# Change for planned economy
		set_3_approval_highly_agree = yes				# Change for autocracy approvals
		set_2_approval_neutral = yes					# Change for conservative approvals
		set_1_approval_neutral = yes					# Change for con lib approvals
		set_vote_eco = yes								# Determines what type of legislation this is, and what values of the ideologies' wishlist will be considered (cul, eco, dem, war, bud)
		compute_voting_approval = yes					# Calculates the approvals

		compute_number_seats_tot = yes					# Calculates the total number of seats in the current Parliament
		compute_number_seats_approve_est = yes			# Estimates the number of seats that will vote yes for the vote
	}

	option = { # Let's vote in a month
		name = brazil_votes.1.a
		country_event = {
			id = brazil_votes_results.1				# Sets the custom result event for your custom law
			days = 35									# Usually, a vote takes 30 days. You can go lower, but the timed mission won't be able to show the right amount of time. It's not a big deal because this fires the event by itself, and because the decision does nothing in the case of a custom vote.
		}
	}

	option = { # Abandon the idea
		name = brazil_votes.1.b
		set_variable = { 
			var = current_reform_id
			value = 0
		}
	}
	
	option = { # Let's vote in a month
		name = brazil_votes.1.c
		country_event = {
			id = brazil_votes_results.1				# Sets the custom result event for your custom law
			days = 1									# Usually, a vote takes 30 days. You can go lower, but the timed mission won't be able to show the right amount of time. It's not a big deal because this fires the event by itself, and because the decision does nothing in the case of a custom vote.
		}
	}
}

country_event = { # Brazil Votes results 1_1857
	id = brazil_votes_results.1
	title = brazil_votes_results.1.t
	desc = brazil_votes_results.1.d
	picture = GFX_report_event_generic_parliament

	is_triggered_only = yes

	immediate = {
		hidden_effect = {
			calculate_vote_result = yes								# Do all the calculations for the vote, and outputs a country flag (eoanb_reform_vote_success, eoanb_reform_vote_failure, eoanb_reform_vote_tie)
		}
	}

	option = { # It's a success!
		name = brazil_votes_results.1.a
		trigger = {
			has_country_flag = eoanb_reform_vote_success
		}
		clr_country_flag = eoanb_reform_vote_success

			# Put here if the result is a victory
		enact_voted_reform = yes
		set_variable = { 
			var = current_reform_id
			value = 0
		}
		add_timed_idea = { idea = BRA_medical_school_reform days = 2920 }
		if = {
			limit = { has_government = traditional_conservatism }
			add_political_power = 50
			add_popularity = { ideology = traditional_conservatism popularity = -0.01 }
			add_popularity = { ideology = centrism popularity = 0.01 }
		}
		if = {
			limit = { has_government = centrism }
			add_political_power = 50
			add_popularity = { ideology = traditional_conservatism popularity = 0.01 }
			add_popularity = { ideology = centrism popularity = -0.01 }
		}
		if = {
			limit = { has_country_flag = brazil_conservative }
			add_political_power = 50
			add_popularity = { ideology = traditional_conservatism popularity = 0.01 }
			
		}
		if = {
			limit = { has_country_flag = brazil_liberal }
			add_political_power = 50
			add_popularity = { ideology = centrism popularity = 0.01 }
			
		}
		if = {
			limit = { has_country_flag = brazil_conciliatory }
			add_political_power = 50
			add_popularity = { ideology = traditional_conservatism popularity = 0.005 }
			add_popularity = { ideology = centrism popularity = 0.005 }
			
		}
		if = {
			limit = { has_country_flag = brazil_ultraconservative }
			add_political_power = 50
			add_popularity = { ideology = radical_democracy popularity = 0.01 }
			
		}
	}

	option = { # It's a failure...
		name = brazil_votes_results.1.b
		trigger = {
			has_country_flag = eoanb_reform_vote_failure
		}
		clr_country_flag = eoanb_reform_vote_failure

			# Put here if the result is a failure

		set_variable = { 
			var = current_reform_id
			value = 0
		}
	}

	option = { # It's a tie.
		name = brazil_votes_results.1.c
		trigger = {
			has_country_flag = eoanb_reform_vote_tie
		}
		clr_country_flag = eoanb_reform_vote_tie

			# Put here if the result is a tie

		set_variable = { 
			var = current_reform_id
			value = 0
		}
	}
}

country_event = { # Brazil Votes 1857_2
	id = brazil_votes.2
	title = brazil_votes.2.t
	desc = brazil_votes.2.d
	picture = GFX_report_event_generic_parliament

	is_triggered_only = yes

	immediate = {
		set_variable = { # Don't change
			var = current_reform_id
			value = -1									# This allows the system to detect a custom vote in progress
		}

		reset_approval_arrays = yes						# Resets all of the approvals
		#set_1_approval_highly_disagree = yes			# For those ideologies who have a 1 for this type of legislation will highly disagree with this bill
		#set_2_approval_disagree = yes					# For those ideologies who have a 2 for this type of legislation will disagree with this bill
		#set_3_approval_neutral = yes					# For those ideologies who have a 3 for this type of legislation will be neutral about this bill
		#set_4_approval_highly_agree = yes				# For those ideologies who have a 4 for this type of legislation will highly agree with this bill
		set_4_approval_disagree = yes					# Change for planned economy
		set_3_approval_highly_agree = yes				# Change for autocracy approvals
		set_2_approval_neutral = yes					# Change for conservative approvals
		set_1_approval_highly_agree = yes				# Change for con lib approvals
		set_vote_eco = yes								# Determines what type of legislation this is, and what values of the ideologies' wishlist will be considered (cul, eco, dem, war, bud)
		compute_voting_approval = yes					# Calculates the approvals

		compute_number_seats_tot = yes					# Calculates the total number of seats in the current Parliament
		compute_number_seats_approve_est = yes			# Estimates the number of seats that will vote yes for the vote
	}

	option = { # Let's vote in a month
		name = brazil_votes.2.a

		country_event = {
			id = brazil_votes_results.2				# Sets the custom result event for your custom law
			days = 35									# Usually, a vote takes 30 days. You can go lower, but the timed mission won't be able to show the right amount of time. It's not a big deal because this fires the event by itself, and because the decision does nothing in the case of a custom vote.
		}
	}

	option = { # Abandon the idea
		name = brazil_votes.2.b

		set_variable = { 
			var = current_reform_id
			value = 0
		}
	}
	option = { # Let's vote in a month
		name = brazil_votes.2.c
		country_event = {
			id = brazil_votes_results.2				# Sets the custom result event for your custom law
			days = 1									# Usually, a vote takes 30 days. You can go lower, but the timed mission won't be able to show the right amount of time. It's not a big deal because this fires the event by itself, and because the decision does nothing in the case of a custom vote.
		}
	}
}

country_event = { # Brazil Votes results 2_1857
	id = brazil_votes_results.2
	title = brazil_votes_results.2.t
	desc = brazil_votes_results.2.d
	picture = GFX_report_event_generic_parliament

	is_triggered_only = yes

	immediate = {
		hidden_effect = {
			calculate_vote_result = yes								# Do all the calculations for the vote, and outputs a country flag (eoanb_reform_vote_success, eoanb_reform_vote_failure, eoanb_reform_vote_tie)
		}
	}

	option = { # It's a success!
		name = brazil_votes_results.2.a
		trigger = {
			has_country_flag = eoanb_reform_vote_success
		}
		clr_country_flag = eoanb_reform_vote_success

			# Put here if the result is a victory
			if = {
				limit = { has_country_flag = brazil_conciliatory }
				add_political_power = 50
				add_popularity = { ideology = traditional_conservatism popularity = -0.02 }
				add_popularity = { ideology = centrism popularity = 0.02 }
				add_power_balance_value = {
					id = BRA_Balance_of_Power_1857
					value = -0.12
					tooltip_side = BRA_BOP_government
				}
			}
			country_event = { id = brazil.310 }
			
			
		enact_voted_reform = yes

		set_variable = { 
			var = current_reform_id
			value = 0
		}
		#BRA = {
		#	reverse_add_opinion_modifier = {
		#		target = ENG 
		#		modifier = eoanb_om_ENG_trade_treaty
		#	}
		#}
	}

	option = { # It's a failure...
		name = brazil_votes_results.2.b
		trigger = {
			has_country_flag = eoanb_reform_vote_failure
		}
		clr_country_flag = eoanb_reform_vote_failure

			# Put here if the result is a failure
			if = {
				limit = { has_country_flag = brazil_conciliatory }
				add_political_power = 50
				add_popularity = { ideology = traditional_conservatism popularity = -0.02 }
				add_popularity = { ideology = radical_democracy popularity = 0.02 }
				add_power_balance_value = {
					id = BRA_Balance_of_Power_1857
					value = 0.12
					tooltip_side = BRA_BOP_opposition
				}
			}

		set_variable = { 
			var = current_reform_id
			value = 0
		}
	}

	option = { # It's a tie.
		name = brazil_votes_results.2.c
		trigger = {
			has_country_flag = eoanb_reform_vote_tie
		}
		clr_country_flag = eoanb_reform_vote_tie

			# Put here if the result is a tie

		set_variable = { 
			var = current_reform_id
			value = 0
		}
	}
}

country_event = { # Brazil Votes 1857_3
	id = brazil_votes.3
	title = brazil_votes.3.t
	desc = brazil_votes.3.d
	picture = GFX_report_event_generic_parliament

	is_triggered_only = yes

	immediate = {
		set_variable = { # Don't change
			var = current_reform_id
			value = -1									# This allows the system to detect a custom vote in progress
		}

		reset_approval_arrays = yes						# Resets all of the approvals
		#set_1_approval_highly_disagree = yes			# For those ideologies who have a 1 for this type of legislation will highly disagree with this bill
		#set_2_approval_disagree = yes					# For those ideologies who have a 2 for this type of legislation will disagree with this bill
		#set_3_approval_neutral = yes					# For those ideologies who have a 3 for this type of legislation will be neutral about this bill
		#set_4_approval_highly_agree = yes				# For those ideologies who have a 4 for this type of legislation will highly agree with this bill
		set_4_approval_disagree = yes					# Change for planned economy
		set_3_approval_highly_agree = yes				# Change for autocracy approvals
		set_2_approval_neutral = yes					# Change for conservative approvals
		set_1_approval_highly_agree = yes				# Change for con lib approvals
		set_vote_eco = yes								# Determines what type of legislation this is, and what values of the ideologies' wishlist will be considered (cul, eco, dem, war, bud)
		compute_voting_approval = yes					# Calculates the approvals

		compute_number_seats_tot = yes					# Calculates the total number of seats in the current Parliament
		compute_number_seats_approve_est = yes			# Estimates the number of seats that will vote yes for the vote
	}

	option = { # Let's vote in a month
		name = brazil_votes.3.a

		country_event = {
			id = brazil_votes_results.3				# Sets the custom result event for your custom law
			days = 35									# Usually, a vote takes 30 days. You can go lower, but the timed mission won't be able to show the right amount of time. It's not a big deal because this fires the event by itself, and because the decision does nothing in the case of a custom vote.
		}
	}

	option = { # Abandon the idea
		name = brazil_votes.3.b

		set_variable = { 
			var = current_reform_id
			value = 0
		}
	}
	
	option = { # Let's vote in a month
		name = brazil_votes.3.c
		country_event = {
			id = brazil_votes_results.3				# Sets the custom result event for your custom law
			days = 1									# Usually, a vote takes 30 days. You can go lower, but the timed mission won't be able to show the right amount of time. It's not a big deal because this fires the event by itself, and because the decision does nothing in the case of a custom vote.
		}
	}
}

country_event = { # Brazil votes results 3_1857
	id = brazil_votes_results.3
	title = brazil_votes_results.3.t
	desc = brazil_votes_results.3.d
	picture = GFX_report_event_generic_parliament

	is_triggered_only = yes

	immediate = {
		hidden_effect = {
			calculate_vote_result = yes								# Do all the calculations for the vote, and outputs a country flag (eoanb_reform_vote_success, eoanb_reform_vote_failure, eoanb_reform_vote_tie)
		}
	}

	option = { # It's a success!
		name = brazil_votes_results.3.a
		trigger = {
			has_country_flag = eoanb_reform_vote_success
		}
		clr_country_flag = eoanb_reform_vote_success

			# Put here if the result is a victory
		enact_voted_reform = yes

		set_variable = { 
			var = current_reform_id
			value = 0
		}
		add_timed_idea = {
			idea = BRA_livestock_regulation
			days = 720
		}
		if = {
			limit = { has_government = traditional_conservatism }
			add_political_power = 50
			add_popularity = { ideology = traditional_conservatism popularity = -0.01 }
			add_popularity = { ideology = centrism popularity = 0.01 }
		}
		if = {
			limit = { has_government = centrism }
			add_popularity = { ideology = traditional_conservatism popularity = 0.01 }
			add_popularity = { ideology = centrism popularity = -0.01 }
		}
				if = {
			limit = { has_country_flag = brazil_conservative }
			add_political_power = 50
			add_popularity = { ideology = traditional_conservatism popularity = 0.01 }
			
		}
		if = {
			limit = { has_country_flag = brazil_liberal }
			add_political_power = 50
			add_popularity = { ideology = centrism popularity = 0.01 }
			
		}
		if = {
			limit = { has_country_flag = brazil_conciliatory }
			add_political_power = 50
			add_popularity = { ideology = traditional_conservatism popularity = 0.005 }
			add_popularity = { ideology = centrism popularity = 0.005 }
			
		}
		if = {
			limit = { has_country_flag = brazil_ultraconservative }
			add_political_power = 50
			add_popularity = { ideology = radical_democracy popularity = 0.01 }
			
		}
	}

	option = { # It's a failure...
		name = brazil_votes_results.3.b
		trigger = {
			has_country_flag = eoanb_reform_vote_failure
		}
		clr_country_flag = eoanb_reform_vote_failure

			# Put here if the result is a failure

		set_variable = { 
			var = current_reform_id
			value = 0
		}
	}

	option = { # It's a tie.
		name = brazil_votes_results.3.c
		trigger = {
			has_country_flag = eoanb_reform_vote_tie
		}
		clr_country_flag = eoanb_reform_vote_tie

			# Put here if the result is a tie

		set_variable = { 
			var = current_reform_id
			value = 0
		}
	}
}

country_event = { # Brazil Votes 4_1857
	id = brazil_votes.4
	title = brazil_votes.4.t
	desc = brazil_votes.4.d
	picture = GFX_report_event_generic_parliament

	is_triggered_only = yes

	immediate = {
		set_variable = { # Don't change
			var = current_reform_id
			value = -1									# This allows the system to detect a custom vote in progress
		}

		reset_approval_arrays = yes						# Resets all of the approvals
		set_1_approval_disagree = yes			# For those ideologies who have a 1 for this type of legislation will highly disagree with this bill
		set_2_approval_highly_agree = yes					# For those ideologies who have a 2 for this type of legislation will disagree with this bill
		set_3_approval_highly_agree	= yes					# For those ideologies who have a 3 for this type of legislation will be neutral about this bill
		set_4_approval_highly_disagree = yes				# For those ideologies who have a 4 for this type of legislation will highly agree with this bill
		set_vote_eco = yes								# Determines what type of legislation this is, and what values of the ideologies' wishlist will be considered (cul, eco, dem, war, bud)
		compute_voting_approval = yes					# Calculates the approvals

		compute_number_seats_tot = yes					# Calculates the total number of seats in the current Parliament
		compute_number_seats_approve_est = yes			# Estimates the number of seats that will vote yes for the vote
	}

	option = { # Let's vote in a month
		name = brazil_votes.4.a

		country_event = {
			id = brazil_votes_results.4				# Sets the custom result event for your custom law
			days = 35									# Usually, a vote takes 30 days. You can go lower, but the timed mission won't be able to show the right amount of time. It's not a big deal because this fires the event by itself, and because the decision does nothing in the case of a custom vote.
		}
	}

	option = { # Abandon the idea
		name = brazil_votes.4.b

		set_variable = { 
			var = current_reform_id
			value = 0
		}
	}
	
	option = { # Let's vote in a month
		name = brazil_votes.4.c
		country_event = {
			id = brazil_votes_results.4				# Sets the custom result event for your custom law
			days = 1									# Usually, a vote takes 30 days. You can go lower, but the timed mission won't be able to show the right amount of time. It's not a big deal because this fires the event by itself, and because the decision does nothing in the case of a custom vote.
		}
	}
}

country_event = { # Brazil votes results 4_1857
	id = brazil_votes_results.4
	title = brazil_votes_results.4.t
	desc = brazil_votes_results.4.d
	picture = GFX_report_event_generic_parliament

	is_triggered_only = yes

	immediate = {
		hidden_effect = {
			calculate_vote_result = yes								# Do all the calculations for the vote, and outputs a country flag (eoanb_reform_vote_success, eoanb_reform_vote_failure, eoanb_reform_vote_tie)
		}
	}

	option = { # It's a success!
		name = brazil_votes_results.4.a
		trigger = {
			has_country_flag = eoanb_reform_vote_success
		}
		clr_country_flag = eoanb_reform_vote_success

			# Put here if the result is a victory
		enact_voted_reform = yes

		set_variable = { 
			var = current_reform_id
			value = 0
		}
		add_timed_idea = { idea = BRA_court_police_corps days = 1825 }
		if = {
			limit = { has_government = traditional_conservatism }
			add_political_power = 50
			add_popularity = { ideology = traditional_conservatism popularity = -0.01 }
			add_popularity = { ideology = centrism popularity = 0.01 }
		}
		if = {
			limit = { has_government = centrism }
			add_popularity = { ideology = traditional_conservatism popularity = 0.01 }
			add_popularity = { ideology = centrism popularity = -0.01 }
		}
		if = {
			limit = { has_country_flag = brazil_conservative }
			add_political_power = 50
			add_popularity = { ideology = traditional_conservatism popularity = 0.01 }
			
		}
		if = {
			limit = { has_country_flag = brazil_liberal }
			add_political_power = 50
			add_popularity = { ideology = centrism popularity = 0.01 }
			
		}
		if = {
			limit = { has_country_flag = brazil_conciliatory }
			add_political_power = 50
			add_popularity = { ideology = traditional_conservatism popularity = 0.005 }
			add_popularity = { ideology = centrism popularity = 0.005 }
			
		}
		if = {
			limit = { has_country_flag = brazil_ultraconservative }
			add_political_power = 50
			add_popularity = { ideology = radical_democracy popularity = 0.01 }
			
		}
	}

	option = { # It's a failure...
		name = brazil_votes_results.4.b
		trigger = {
			has_country_flag = eoanb_reform_vote_failure
		}
		clr_country_flag = eoanb_reform_vote_failure

			# Put here if the result is a failure

		set_variable = { 
			var = current_reform_id
			value = 0
		}
	}

	option = { # It's a tie.
		name = brazil_votes_results.4.c
		trigger = {
			has_country_flag = eoanb_reform_vote_tie
		}
		clr_country_flag = eoanb_reform_vote_tie

			# Put here if the result is a tie

		set_variable = { 
			var = current_reform_id
			value = 0
		}
	}
}

country_event = { # Brazil Votes 1857_5
	id = brazil_votes.5
	title = brazil_votes.5.t
	desc = brazil_votes.5.d
	picture = GFX_report_event_generic_parliament

	is_triggered_only = yes

	immediate = {
		set_variable = { # Don't change
			var = current_reform_id
			value = -1									# This allows the system to detect a custom vote in progress
		}

		reset_approval_arrays = yes						# Resets all of the approvals
		#set_1_approval_highly_disagree = yes			# For those ideologies who have a 1 for this type of legislation will highly disagree with this bill
		#set_2_approval_disagree = yes					# For those ideologies who have a 2 for this type of legislation will disagree with this bill
		#set_3_approval_neutral = yes					# For those ideologies who have a 3 for this type of legislation will be neutral about this bill
		#set_4_approval_highly_agree = yes				# For those ideologies who have a 4 for this type of legislation will highly agree with this bill
		set_4_approval_disagree = yes					# Change for planned economy
		set_3_approval_highly_agree = yes				# Change for autocracy approvals
		set_2_approval_neutral = yes					# Change for conservative approvals
		set_1_approval_highly_agree = yes				# Change for con lib approvals
		set_vote_eco = yes								# Determines what type of legislation this is, and what values of the ideologies' wishlist will be considered (cul, eco, dem, war, bud)
		compute_voting_approval = yes					# Calculates the approvals

		compute_number_seats_tot = yes					# Calculates the total number of seats in the current Parliament
		compute_number_seats_approve_est = yes			# Estimates the number of seats that will vote yes for the vote
	}

	option = { # Let's vote in a month
		name = brazil_votes.5.a

		country_event = {
			id = brazil_votes_results.5				# Sets the custom result event for your custom law
			days = 35									# Usually, a vote takes 30 days. You can go lower, but the timed mission won't be able to show the right amount of time. It's not a big deal because this fires the event by itself, and because the decision does nothing in the case of a custom vote.
		}
	}

	option = { # Abandon the idea
		name = brazil_votes.5.b

		set_variable = { 
			var = current_reform_id
			value = 0
		}
	}
	
	option = { # Let's vote in a month
		name = brazil_votes.5.c
		country_event = {
			id = brazil_votes_results.5				# Sets the custom result event for your custom law
			days = 1									# Usually, a vote takes 30 days. You can go lower, but the timed mission won't be able to show the right amount of time. It's not a big deal because this fires the event by itself, and because the decision does nothing in the case of a custom vote.
		}
	}
}

country_event = { # Brazil Votes Result 1857_5
	id = brazil_votes_results.5
	title = brazil_votes_results.5.t
	desc = brazil_votes_results.5.d
	picture = GFX_report_event_generic_parliament

	is_triggered_only = yes

	immediate = {
		hidden_effect = {
			calculate_vote_result = yes								# Do all the calculations for the vote, and outputs a country flag (eoanb_reform_vote_success, eoanb_reform_vote_failure, eoanb_reform_vote_tie)
		}
	}

	option = { # It's a success!
		name = brazil_votes_results.5.a
		trigger = {
			has_country_flag = eoanb_reform_vote_success
		}
		clr_country_flag = eoanb_reform_vote_success

			# Put here if the result is a victory
		enact_voted_reform = yes

		set_variable = { 
			var = current_reform_id
			value = 0
		}
		country_event = { id = brazil.302 }
		set_country_flag = ottoman_friendship_treaty
		if = {
			limit = { has_government = traditional_conservatism }
			add_political_power = 50
			add_popularity = { ideology = traditional_conservatism popularity = -0.01 }
			add_popularity = { ideology = centrism popularity = 0.01 }
		}
		if = {
			limit = { has_government = centrism }
			add_popularity = { ideology = traditional_conservatism popularity = 0.01 }
			add_popularity = { ideology = centrism popularity = -0.01 }
		}
		if = {
			limit = { has_country_flag = brazil_conservative }
			add_political_power = 50
			add_popularity = { ideology = traditional_conservatism popularity = 0.01 }
			
		}
		if = {
			limit = { has_country_flag = brazil_liberal }
			add_political_power = 50
			add_popularity = { ideology = centrism popularity = 0.01 }
			
		}
		if = {
			limit = { has_country_flag = brazil_conciliatory }
			add_political_power = 50
			add_popularity = { ideology = traditional_conservatism popularity = 0.005 }
			add_popularity = { ideology = centrism popularity = 0.005 }
			
		}
		if = {
			limit = { has_country_flag = brazil_ultraconservative }
			add_political_power = 50
			add_popularity = { ideology = radical_democracy popularity = 0.01 }
			
		}
	}

	option = { # It's a failure...
		name = brazil_votes_results.5.b
		trigger = {
			has_country_flag = eoanb_reform_vote_failure
		}
		clr_country_flag = eoanb_reform_vote_failure

			# Put here if the result is a failure

		set_variable = { 
			var = current_reform_id
			value = 0
		}
	}

	option = { # It's a tie.
		name = brazil_votes_results.5.c
		trigger = {
			has_country_flag = eoanb_reform_vote_tie
		}
		clr_country_flag = eoanb_reform_vote_tie

			# Put here if the result is a tie

		set_variable = { 
			var = current_reform_id
			value = 0
		}
	}
}

country_event = { # Brazil Votes 1857_6
	id = brazil_votes.6
	title = brazil_votes.6.t
	desc = brazil_votes.6.d
	picture = GFX_report_event_generic_parliament

	is_triggered_only = yes

	immediate = {
		set_variable = { # Don't change
			var = current_reform_id
			value = -1									# This allows the system to detect a custom vote in progress
		}

		reset_approval_arrays = yes						# Resets all of the approvals
		#set_1_approval_highly_disagree = yes			# For those ideologies who have a 1 for this type of legislation will highly disagree with this bill
		#set_2_approval_disagree = yes					# For those ideologies who have a 2 for this type of legislation will disagree with this bill
		#set_3_approval_neutral = yes					# For those ideologies who have a 3 for this type of legislation will be neutral about this bill
		#set_4_approval_highly_agree = yes				# For those ideologies who have a 4 for this type of legislation will highly agree with this bill
		set_4_approval_highly_disagree = yes			# Change for planned economy
		set_3_approval_highly_disagree = yes			# Change for radical democracy
		set_2_approval_highly_agree = yes				# Change for conservative approvals
		set_1_approval_highly_agree = yes				# Change for con lib approvals
		set_vote_eco = yes								# Determines what type of legislation this is, and what values of the ideologies' wishlist will be considered (cul, eco, dem, war, bud)
		compute_voting_approval = yes					# Calculates the approvals

		compute_number_seats_tot = yes					# Calculates the total number of seats in the current Parliament
		compute_number_seats_approve_est = yes			# Estimates the number of seats that will vote yes for the vote
	}

	option = { # Let's vote in a month
		name = brazil_votes.6.a

		country_event = {
			id = brazil_votes_results.6				# Sets the custom result event for your custom law
			days = 35									# Usually, a vote takes 30 days. You can go lower, but the timed mission won't be able to show the right amount of time. It's not a big deal because this fires the event by itself, and because the decision does nothing in the case of a custom vote.
		}
	}

	option = { # Abandon the idea
		name = brazil_votes.6.b

		set_variable = { 
			var = current_reform_id
			value = 0
		}
	}
	option = { # Let's vote in a month
		name = brazil_votes.6.c
		country_event = {
			id = brazil_votes_results.6				# Sets the custom result event for your custom law
			days = 1									# Usually, a vote takes 30 days. You can go lower, but the timed mission won't be able to show the right amount of time. It's not a big deal because this fires the event by itself, and because the decision does nothing in the case of a custom vote.
		}
	}
}

country_event = { # Brazil votes result 1857_6
	id = brazil_votes_results.6
	title = brazil_votes_results.6.t
	desc = brazil_votes_results.6.d
	picture = GFX_report_event_generic_parliament

	is_triggered_only = yes

	immediate = {
		hidden_effect = {
			calculate_vote_result = yes								# Do all the calculations for the vote, and outputs a country flag (eoanb_reform_vote_success, eoanb_reform_vote_failure, eoanb_reform_vote_tie)
		}
	}

	option = { # It's a success!
		name = brazil_votes_results.6.a
		trigger = {
			has_country_flag = eoanb_reform_vote_success
		}
		clr_country_flag = eoanb_reform_vote_success
		set_country_flag = uruguay_friendship_treaty
		# Put here if the result is a victory
		
		BRA = {
			add_opinion_modifier = {
				target = URG 
				modifier = eoanb_om_ENG_trade_treaty
			}
		}
		URG = {
			add_opinion_modifier = {
				target = BRA
				modifier = eoanb_om_ENG_trade_treaty
			}
		}
		if = {
			limit = { has_country_flag = brazil_conciliatory }
			add_political_power = 50
			add_popularity = { ideology = traditional_conservatism popularity = -0.02 }
			add_popularity = { ideology = centrism popularity = 0.02 }
			add_power_balance_value = {
				id = BRA_Balance_of_Power_1857
				value = -0.12
				tooltip_side = BRA_BOP_government
			}
		}
		
		enact_voted_reform = yes

		set_variable = { 
			var = current_reform_id
			value = 0
		}
		
	}

	option = { # It's a failure...
		name = brazil_votes_results.6.b
		trigger = {
			has_country_flag = eoanb_reform_vote_failure
		}
		clr_country_flag = eoanb_reform_vote_failure

			# Put here if the result is a failure
		if = {
			limit = { has_country_flag = brazil_conciliatory }
			add_popularity = { ideology = traditional_conservatism popularity = -0.02 }
			add_popularity = { ideology = radical_democracy popularity = 0.02 }
			add_power_balance_value = {
				id = BRA_Balance_of_Power_1857
				value = 0.12
				tooltip_side = BRA_BOP_opposition
			}
		}
		
		set_variable = { 
			var = current_reform_id
			value = 0
		}
	}

	option = { # It's a tie.
		name = brazil_votes_results.6.c
		trigger = {
			has_country_flag = eoanb_reform_vote_tie
		}
		clr_country_flag = eoanb_reform_vote_tie

			# Put here if the result is a tie

		set_variable = { 
			var = current_reform_id
			value = 0
		}
	}
}

country_event = { # Brazil Votes 1857_7
	id = brazil_votes.7
	title = brazil_votes.7.t
	desc = brazil_votes.7.d
	picture = GFX_report_event_generic_parliament

	is_triggered_only = yes

	immediate = {
		set_variable = { # Don't change
			var = current_reform_id
			value = -1									# This allows the system to detect a custom vote in progress
		}

		reset_approval_arrays = yes						# Resets all of the approvals
		#set_1_approval_highly_disagree = yes			# For those ideologies who have a 1 for this type of legislation will highly disagree with this bill
		#set_2_approval_disagree = yes					# For those ideologies who have a 2 for this type of legislation will disagree with this bill
		#set_3_approval_neutral = yes					# For those ideologies who have a 3 for this type of legislation will be neutral about this bill
		#set_4_approval_highly_agree = yes				# For those ideologies who have a 4 for this type of legislation will highly agree with this bill
		set_4_approval_disagree = yes					# Change for planned economy
		set_3_approval_highly_agree = yes				# Change for autocracy approvals
		set_2_approval_neutral = yes					# Change for conservative approvals
		set_1_approval_highly_agree = yes				# Change for con lib approvals
		set_vote_eco = yes								# Determines what type of legislation this is, and what values of the ideologies' wishlist will be considered (cul, eco, dem, war, bud)
		compute_voting_approval = yes					# Calculates the approvals

		compute_number_seats_tot = yes					# Calculates the total number of seats in the current Parliament
		compute_number_seats_approve_est = yes			# Estimates the number of seats that will vote yes for the vote
	}

	option = { # Let's vote in a month
		name = brazil_votes.7.a

		country_event = {
			id = brazil_votes_results.7				# Sets the custom result event for your custom law
			days = 35									# Usually, a vote takes 30 days. You can go lower, but the timed mission won't be able to show the right amount of time. It's not a big deal because this fires the event by itself, and because the decision does nothing in the case of a custom vote.
		}
	}

	option = { # Abandon the idea
		name = brazil_votes.7.b

		set_variable = { 
			var = current_reform_id
			value = 0
		}
	}
	option = { # Let's vote in a month
		name = brazil_votes.7.c
		country_event = {
			id = brazil_votes_results.7				# Sets the custom result event for your custom law
			days = 1									# Usually, a vote takes 30 days. You can go lower, but the timed mission won't be able to show the right amount of time. It's not a big deal because this fires the event by itself, and because the decision does nothing in the case of a custom vote.
		}
	}
}

country_event = { # Brazil Votes results 7_1857
	id = brazil_votes_results.7
	title = brazil_votes_results.7.t
	desc = brazil_votes_results.7.d
	picture = GFX_report_event_generic_parliament

	is_triggered_only = yes

	immediate = {
		hidden_effect = {
			calculate_vote_result = yes								# Do all the calculations for the vote, and outputs a country flag (eoanb_reform_vote_success, eoanb_reform_vote_failure, eoanb_reform_vote_tie)
		}
	}

	option = { # It's a success!
		name = brazil_votes_results.7.a
		trigger = {
			has_country_flag = eoanb_reform_vote_success
		}
		clr_country_flag = eoanb_reform_vote_success

			# Put here if the result is a victory
		enact_voted_reform = yes

		set_variable = { 
			var = current_reform_id
			value = 0
		}
		set_country_flag = britain_friendship_treaty
		country_event = { id = brazil.308 }
		if = {
			limit = { has_government = traditional_conservatism }
			add_political_power = 50
			add_popularity = { ideology = traditional_conservatism popularity = -0.01 }
			add_popularity = { ideology = centrism popularity = 0.01 }
		}
		if = {
			limit = { has_government = centrism }
			add_popularity = { ideology = traditional_conservatism popularity = 0.01 }
			add_popularity = { ideology = centrism popularity = -0.01 }
		}
		if = {
			limit = { has_country_flag = brazil_conservative }
			add_political_power = 50
			add_popularity = { ideology = traditional_conservatism popularity = 0.01 }
			
		}
		if = {
			limit = { has_country_flag = brazil_liberal }
			add_political_power = 50
			add_popularity = { ideology = centrism popularity = 0.01 }
			
		}
		if = {
			limit = { has_country_flag = brazil_conciliatory }
			add_political_power = 50
			add_popularity = { ideology = traditional_conservatism popularity = 0.005 }
			add_popularity = { ideology = centrism popularity = 0.005 }
			
		}
		if = {
			limit = { has_country_flag = brazil_ultraconservative }
			add_political_power = 50
			add_popularity = { ideology = radical_democracy popularity = 0.01 }
			
		}
	}

	option = { # It's a failure...
		name = brazil_votes_results.7.b
		trigger = {
			has_country_flag = eoanb_reform_vote_failure
		}
		clr_country_flag = eoanb_reform_vote_failure

			# Put here if the result is a failure

		set_variable = { 
			var = current_reform_id
			value = 0
		}
	}

	option = { # It's a tie.
		name = brazil_votes_results.7.c
		trigger = {
			has_country_flag = eoanb_reform_vote_tie
		}
		clr_country_flag = eoanb_reform_vote_tie

			# Put here if the result is a tie

		set_variable = { 
			var = current_reform_id
			value = 0
		}
	}
}
	
	#increase immigration
country_event = { # Brazil Votes 1857_8
	id = brazil_votes.8
	title = brazil_votes.8.t
	desc = brazil_votes.8.d
	picture = GFX_report_event_generic_parliament

	is_triggered_only = yes

	immediate = {
		set_variable = { # Don't change
			var = current_reform_id
			value = -1									# This allows the system to detect a custom vote in progress
		}

		reset_approval_arrays = yes						# Resets all of the approvals
		#set_1_approval_highly_disagree = yes			# For those ideologies who have a 1 for this type of legislation will highly disagree with this bill
		#set_2_approval_disagree = yes					# For those ideologies who have a 2 for this type of legislation will disagree with this bill
		#set_3_approval_neutral = yes					# For those ideologies who have a 3 for this type of legislation will be neutral about this bill
		#set_4_approval_highly_agree = yes				# For those ideologies who have a 4 for this type of legislation will highly agree with this bill
		set_1_approval_neutral = yes					# Change for Aristocratic approvals
		set_2_approval_neutral = yes					# Change for Elitist approvals
		set_3_approval_highly_agree = yes				# Change for Favoritist approvals
		set_4_approval_highly_agree = yes				# Change for Egalitarian
		
		set_vote_dem = yes								# Determines what type of legislation this is, and what values of the ideologies' wishlist will be considered (cul, eco, dem, war, bud)
		compute_voting_approval = yes					# Calculates the approvals

		compute_number_seats_tot = yes					# Calculates the total number of seats in the current Parliament
		compute_number_seats_approve_est = yes			# Estimates the number of seats that will vote yes for the vote
	}

	option = { # Let's vote in a month
		name = brazil_votes.8.a

		country_event = {
			id = brazil_votes_results.8				# Sets the custom result event for your custom law
			days = 35									# Usually, a vote takes 30 days. You can go lower, but the timed mission won't be able to show the right amount of time. It's not a big deal because this fires the event by itself, and because the decision does nothing in the case of a custom vote.
		}
	}

	option = { # Abandon the idea
		name = brazil_votes.8.b

		set_variable = { 
			var = current_reform_id
			value = 0
		}
	}
	option = { # Let's vote in a month
		name = brazil_votes.8.c
		country_event = {
			id = brazil_votes_results.8				# Sets the custom result event for your custom law
			days = 1									# Usually, a vote takes 30 days. You can go lower, but the timed mission won't be able to show the right amount of time. It's not a big deal because this fires the event by itself, and because the decision does nothing in the case of a custom vote.
		}
	}
}

country_event = { # Brazil Votes results 8_1857
	id = brazil_votes_results.8
	title = brazil_votes_results.8.t
	desc = brazil_votes_results.8.d
	picture = GFX_report_event_generic_parliament

	is_triggered_only = yes

	immediate = {
		hidden_effect = {
			calculate_vote_result = yes								# Do all the calculations for the vote, and outputs a country flag (eoanb_reform_vote_success, eoanb_reform_vote_failure, eoanb_reform_vote_tie)
		}
	}

	option = { # It's a success!
		name = brazil_votes_results.8.a
		trigger = {
			has_country_flag = eoanb_reform_vote_success
		}
		clr_country_flag = eoanb_reform_vote_success

			# Put here if the result is a victory
		enact_voted_reform = yes

		set_variable = { 
			var = current_reform_id
			value = 0
		}

		custom_effect_tooltip = dynmod_BRA_New_World_Immigrants_effect_tt
		add_to_variable = { BRA_New_World_Immigrants_mp = 0.2 tooltip = monthly_population_tooltip}
		add_to_variable = { BRA_New_World_Immigrants_cgev = 0.03 tooltip = consumer_goods_expected_value_tooltip}
		set_country_flag = BRA_passed_immigration_bill_1857
		if = {
			limit = { has_country_flag = brazil_conservative }
			add_political_power = 50
			add_popularity = { ideology = traditional_conservatism popularity = 0.01 }
		}
		if = {
			limit = { has_country_flag = brazil_liberal }
			add_political_power = 50
			add_popularity = { ideology = centrism popularity = 0.01 }
		}
		if = {
			limit = { has_country_flag = brazil_conciliatory }
			add_political_power = 50
			add_popularity = { ideology = traditional_conservatism popularity = 0.005 }
			add_popularity = { ideology = centrism popularity = 0.005 }
		}
		if = {
			limit = { has_country_flag = brazil_ultraconservative }
			add_political_power = 50
			add_popularity = { ideology = radical_democracy popularity = 0.01 }
		}
	}

	option = { # It's a failure...
		name = brazil_votes_results.8.b
		trigger = {
			has_country_flag = eoanb_reform_vote_failure
		}
		clr_country_flag = eoanb_reform_vote_failure

			# Put here if the result is a failure

		set_variable = { 
			var = current_reform_id
			value = 0
		}
	}

	option = { # It's a tie.
		name = brazil_votes_results.8.c
		trigger = {
			has_country_flag = eoanb_reform_vote_tie
		}
		clr_country_flag = eoanb_reform_vote_tie

			# Put here if the result is a tie

		set_variable = { 
			var = current_reform_id
			value = 0
		}
	}
}

#reform mortgage land
	country_event = { # Brazil Votes 1857_9
	id = brazil_votes.9
	title = brazil_votes.9.t
	desc = brazil_votes.9.d
	picture = GFX_report_event_generic_parliament

	is_triggered_only = yes

	immediate = {
		set_variable = { # Don't change
			var = current_reform_id
			value = -1									# This allows the system to detect a custom vote in progress
		}

		reset_approval_arrays = yes						# Resets all of the approvals
		#set_1_approval_highly_disagree = yes			# For those ideologies who have a 1 for this type of legislation will highly disagree with this bill
		#set_2_approval_disagree = yes					# For those ideologies who have a 2 for this type of legislation will disagree with this bill
		#set_3_approval_neutral = yes					# For those ideologies who have a 3 for this type of legislation will be neutral about this bill
		#set_4_approval_highly_agree = yes				# For those ideologies who have a 4 for this type of legislation will highly agree with this bill
		set_1_approval_highly_disagree = yes			# Change for Aristocratic approvals
		set_2_approval_disagree = yes					# Change for Elitist approvals
		set_3_approval_highly_agree = yes				# Change for Favoritist approvals
		set_4_approval_highly_agree = yes				# Change for Egalitarian
		
		set_vote_dem = yes								# Determines what type of legislation this is, and what values of the ideologies' wishlist will be considered (cul, eco, dem, war, bud)
		compute_voting_approval = yes					# Calculates the approvals

		compute_number_seats_tot = yes					# Calculates the total number of seats in the current Parliament
		compute_number_seats_approve_est = yes			# Estimates the number of seats that will vote yes for the vote
	}

	option = { # Let's vote in a month
		name = brazil_votes.9.a

		country_event = {
			id = brazil_votes_results.9				# Sets the custom result event for your custom law
			days = 35									# Usually, a vote takes 30 days. You can go lower, but the timed mission won't be able to show the right amount of time. It's not a big deal because this fires the event by itself, and because the decision does nothing in the case of a custom vote.
		}
	}

	option = { # Abandon the idea
		name = brazil_votes.9.b

		set_variable = { 
			var = current_reform_id
			value = 0
		}
	}
	
	option = { # Let's vote in a month
		name = brazil_votes.9.c
		country_event = {
			id = brazil_votes_results.9				# Sets the custom result event for your custom law
			days = 1									# Usually, a vote takes 30 days. You can go lower, but the timed mission won't be able to show the right amount of time. It's not a big deal because this fires the event by itself, and because the decision does nothing in the case of a custom vote.
		}
	}
}

country_event = { # Brazil Votes results 9_1857
	id = brazil_votes_results.9
	title = brazil_votes_results.9.t
	desc = brazil_votes_results.9.d
	picture = GFX_report_event_generic_parliament

	is_triggered_only = yes

	immediate = {
		hidden_effect = {
			calculate_vote_result = yes								# Do all the calculations for the vote, and outputs a country flag (eoanb_reform_vote_success, eoanb_reform_vote_failure, eoanb_reform_vote_tie)
		}
	}

	option = { # It's a success!
		custom_effect_tooltip = dynmod_BRA_New_World_Immigrants_effect_tt
		add_to_variable = { BRA_New_World_Immigrants_cgev = 0.015  tooltip = consumer_goods_expected_value_tooltip}
		add_to_variable = { BRA_New_World_Immigrants_mp = 0.05  tooltip = monthly_population_tooltip}

		custom_effect_tooltip = dynmod_BRA_Agriculture_effect_tt
		add_to_variable = { BRA_Agriculture_Country_sf = 0.03 tooltip = stability_factor_tooltip }
		add_to_variable = { BRA_Agriculture_Country_psif = 0.05 tooltip = production_speed_infrastructure_factor_tooltip }
		add_to_variable = { BRA_Agriculture_Country_psicf = 0.025 tooltip = production_speed_industrial_complex_factor_tooltip }
		add_to_variable = { BRA_Agriculture_Country_psff = 0.3 tooltip = production_speed_farm_factor_tooltip }
		add_to_variable = { BRA_Agriculture_Country_pslcf = 0.3}
		add_to_variable = { BRA_Agriculture_Country_pscff = 0.3 tooltip = production_speed_cotton_farm_factor_tooltip}
		
		name = brazil_votes_results.9.a
		trigger = {
			has_country_flag = eoanb_reform_vote_success
		}
		clr_country_flag = eoanb_reform_vote_success

			# Put here if the result is a victory
		set_country_flag = BRA_reform_mortgage_land_act
		if = {
			limit = { has_country_flag = brazil_conciliatory }
			add_political_power = 50
			add_popularity = { ideology = traditional_conservatism popularity = -0.02 }
			add_popularity = { ideology = centrism popularity = 0.02 }
			add_power_balance_value = {
				id = BRA_Balance_of_Power_1857
				value = -0.12
				tooltip_side = BRA_BOP_government
			}
		}
			
		enact_voted_reform = yes

		set_variable = { 
			var = current_reform_id
			value = 0
		}
		
	}

	option = { # It's a failure...
		name = brazil_votes_results.9.b
		trigger = {
			has_country_flag = eoanb_reform_vote_failure
		}
		clr_country_flag = eoanb_reform_vote_failure

			# Put here if the result is a failure
		if = {
			limit = { has_country_flag = brazil_conciliatory }
			add_popularity = { ideology = traditional_conservatism popularity = -0.02 }
			add_popularity = { ideology = radical_democracy popularity = 0.02 }
			add_power_balance_value = {
				id = BRA_Balance_of_Power_1857
				value = 0.12
				tooltip_side = BRA_BOP_opposition
			}
		}

		set_variable = { 
			var = current_reform_id
			value = 0
		}
	}

	option = { # It's a tie.
		name = brazil_votes_results.9.c
		trigger = {
			has_country_flag = eoanb_reform_vote_tie
		}
		clr_country_flag = eoanb_reform_vote_tie

			# Put here if the result is a tie

		set_variable = { 
			var = current_reform_id
			value = 0
		}
	}
}

#INCRIEASE CONSCRIPTION
	country_event = { # Brazil Votes 1857_10
	id = brazil_votes.10
	title = brazil_votes.10.t
	desc = brazil_votes.10.d
	picture = GFX_report_event_generic_parliament

	is_triggered_only = yes

	immediate = {
		set_variable = { # Don't change
			var = current_reform_id
			value = -1									# This allows the system to detect a custom vote in progress
		}

		reset_approval_arrays = yes						# Resets all of the approvals
		#set_1_approval_highly_disagree = yes			# For those ideologies who have a 1 for this type of legislation will highly disagree with this bill
		#set_2_approval_disagree = yes					# For those ideologies who have a 2 for this type of legislation will disagree with this bill
		#set_3_approval_neutral = yes					# For those ideologies who have a 3 for this type of legislation will be neutral about this bill
		#set_4_approval_highly_agree = yes				# For those ideologies who have a 4 for this type of legislation will highly agree with this bill
		set_1_approval_neutral = yes					# Change for Aristocratic approvals
		set_2_approval_neutral = yes					# Change for Elitist approvals
		set_3_approval_highly_agree = yes				# Change for Favoritist approvals
		set_4_approval_highly_agree = yes				# Change for Egalitarian
		
		set_vote_dem = yes								# Determines what type of legislation this is, and what values of the ideologies' wishlist will be considered (cul, eco, dem, war, bud)
		compute_voting_approval = yes					# Calculates the approvals

		compute_number_seats_tot = yes					# Calculates the total number of seats in the current Parliament
		compute_number_seats_approve_est = yes			# Estimates the number of seats that will vote yes for the vote
	}

	option = { # Let's vote in a month
		name = brazil_votes.10.a

		country_event = {
			id = brazil_votes_results.10				# Sets the custom result event for your custom law
			days = 35									# Usually, a vote takes 30 days. You can go lower, but the timed mission won't be able to show the right amount of time. It's not a big deal because this fires the event by itself, and because the decision does nothing in the case of a custom vote.
		}
	}

	option = { # Abandon the idea
		name = brazil_votes.10.b

		set_variable = { 
			var = current_reform_id
			value = 0
		}
	}
	
	option = { # Let's vote in a month
		name = brazil_votes.10.c
		country_event = {
			id = brazil_votes_results.10				# Sets the custom result event for your custom law
			days = 1									# Usually, a vote takes 30 days. You can go lower, but the timed mission won't be able to show the right amount of time. It's not a big deal because this fires the event by itself, and because the decision does nothing in the case of a custom vote.
		}
	}
}

country_event = { # Brazil Votes results 10_1857
	id = brazil_votes_results.10
	title = brazil_votes_results.10.t
	desc = brazil_votes_results.10.d
	picture = GFX_report_event_generic_parliament

	is_triggered_only = yes

	immediate = {
		hidden_effect = {
			calculate_vote_result = yes								# Do all the calculations for the vote, and outputs a country flag (eoanb_reform_vote_success, eoanb_reform_vote_failure, eoanb_reform_vote_tie)
		}
	}

	option = { # It's a success!
		name = brazil_votes_results.10.a
		trigger = {
			has_country_flag = eoanb_reform_vote_success
		}
		clr_country_flag = eoanb_reform_vote_success

			# Put here if the result is a victory
		enact_voted_reform = yes

		set_variable = { 
			var = current_reform_id
			value = 0
		}
		custom_effect_tooltip = BRA_imperial_army_effect_tt
		add_to_variable = { BRA_army_c = 0.010 tooltip = conscription_factor_tooltip }
		add_to_variable = { BRA_army_ms = 0.025 tooltip = mobilization_speed_tooltip }
		set_country_flag = BRA_reformed_conscription
		
		if = {
			limit = { has_government = traditional_conservatism }
			add_political_power = 50
			add_popularity = { ideology = traditional_conservatism popularity = -0.01 }
			add_popularity = { ideology = centrism popularity = 0.01 }
		}
		if = {
			limit = { has_government = centrism }
			add_popularity = { ideology = traditional_conservatism popularity = 0.01 }
			add_popularity = { ideology = centrism popularity = -0.01 }
		}
		if = {
			limit = { has_country_flag = brazil_conservative }
			add_political_power = 50
			add_popularity = { ideology = traditional_conservatism popularity = 0.01 }
			
		}
		if = {
			limit = { has_country_flag = brazil_liberal }
			add_political_power = 50
			add_popularity = { ideology = centrism popularity = 0.01 }
			
		}
		if = {
			limit = { has_country_flag = brazil_conciliatory }
			add_political_power = 50
			add_popularity = { ideology = traditional_conservatism popularity = 0.005 }
			add_popularity = { ideology = centrism popularity = 0.005 }
			
		}
		if = {
			limit = { has_country_flag = brazil_ultraconservative }
			add_political_power = 50
			add_popularity = { ideology = radical_democracy popularity = 0.01 }
			
		}
	}

	option = { # It's a failure...
		name = brazil_votes_results.10.b
		trigger = {
			has_country_flag = eoanb_reform_vote_failure
		}
		clr_country_flag = eoanb_reform_vote_failure

			# Put here if the result is a failure

		set_variable = { 
			var = current_reform_id
			value = 0
		}
	}

	option = { # It's a tie.
		name = brazil_votes_results.10.c
		trigger = {
			has_country_flag = eoanb_reform_vote_tie
		}
		clr_country_flag = eoanb_reform_vote_tie

			# Put here if the result is a tie

		set_variable = { 
			var = current_reform_id
			value = 0
		}
	}
}

#navy officer promotion
	country_event = { # Brazil Votes 1857_11
	id = brazil_votes.11
	title = brazil_votes.11.t
	desc = brazil_votes.11.d
	picture = GFX_report_event_generic_parliament

	is_triggered_only = yes

	immediate = {
		set_variable = { # Don't change
			var = current_reform_id
			value = -1									# This allows the system to detect a custom vote in progress
		}

		reset_approval_arrays = yes						# Resets all of the approvals
		#set_1_approval_highly_disagree = yes			# For those ideologies who have a 1 for this type of legislation will highly disagree with this bill
		#set_2_approval_disagree = yes					# For those ideologies who have a 2 for this type of legislation will disagree with this bill
		#set_3_approval_neutral = yes					# For those ideologies who have a 3 for this type of legislation will be neutral about this bill
		#set_4_approval_highly_agree = yes				# For those ideologies who have a 4 for this type of legislation will highly agree with this bill
		set_1_approval_highly_agree = yes					# Change for Jingoist approvals
		set_2_approval_highly_agree = yes					# Change for Pro-Militarist approvals
		set_3_approval_disagree = yes						# Change for Anti-Militarist approvals
		set_4_approval_highly_disagree = yes				# Change for Pacifist
		
		set_vote_war = yes								# Determines what type of legislation this is, and what values of the ideologies' wishlist will be considered (cul, eco, dem, war, bud)
		compute_voting_approval = yes					# Calculates the approvals

		compute_number_seats_tot = yes					# Calculates the total number of seats in the current Parliament
		compute_number_seats_approve_est = yes			# Estimates the number of seats that will vote yes for the vote
	}

	option = { # Let's vote in a month
		name = brazil_votes.11.a

		country_event = {
			id = brazil_votes_results.11				# Sets the custom result event for your custom law
			days = 35									# Usually, a vote takes 30 days. You can go lower, but the timed mission won't be able to show the right amount of time. It's not a big deal because this fires the event by itself, and because the decision does nothing in the case of a custom vote.
		}
	}

	option = { # Abandon the idea
		name = brazil_votes.11.b

		set_variable = { 
			var = current_reform_id
			value = 0
		}
	}
	option = { # Let's vote in a month
		name = brazil_votes.11.c
		country_event = {
			id = brazil_votes_results.11				# Sets the custom result event for your custom law
			days = 1									# Usually, a vote takes 30 days. You can go lower, but the timed mission won't be able to show the right amount of time. It's not a big deal because this fires the event by itself, and because the decision does nothing in the case of a custom vote.
		}
	}
}

country_event = { # Brazil Votes results 11_1857
	id = brazil_votes_results.11
	title = brazil_votes_results.11.t
	desc = brazil_votes_results.11.d
	picture = GFX_report_event_generic_parliament

	is_triggered_only = yes

	immediate = {
		hidden_effect = {
			calculate_vote_result = yes								# Do all the calculations for the vote, and outputs a country flag (eoanb_reform_vote_success, eoanb_reform_vote_failure, eoanb_reform_vote_tie)
		}
	}

	option = { # It's a success!
		name = brazil_votes_results.11.a
		trigger = {
			has_country_flag = eoanb_reform_vote_success
		}
		clr_country_flag = eoanb_reform_vote_success

			# Put here if the result is a victory
		enact_voted_reform = yes

		custom_effect_tooltip = BRA_imperial_navy_effect_tt
		add_to_variable = { BRA_imperial_navy_nlcf = -0.33 tooltip = navy_leader_cost_factor_tooltip }
		add_to_variable = {	BRA_imperial_navy_nlsl = 1 }
		set_country_flag = BRA_navy_leader_promotion

		set_variable = { 
			var = current_reform_id
			value = 0
		}
		if = {
			limit = { has_government = traditional_conservatism }
			add_political_power = 50
			add_popularity = { ideology = traditional_conservatism popularity = -0.01 }
			add_popularity = { ideology = centrism popularity = 0.01 }
		}
		if = {
			limit = { has_government = centrism }
			add_popularity = { ideology = traditional_conservatism popularity = 0.01 }
			add_popularity = { ideology = centrism popularity = -0.01 }
		}
		if = {
			limit = { has_country_flag = brazil_conservative }
			add_political_power = 50
			add_popularity = { ideology = traditional_conservatism popularity = 0.01 }
			
		}
		if = {
			limit = { has_country_flag = brazil_liberal }
			add_political_power = 50
			add_popularity = { ideology = centrism popularity = 0.01 }
			
		}
		if = {
			limit = { has_country_flag = brazil_conciliatory }
			add_political_power = 50
			add_popularity = { ideology = traditional_conservatism popularity = 0.005 }
			add_popularity = { ideology = centrism popularity = 0.005 }
			
		}
		if = {
			limit = { has_country_flag = brazil_ultraconservative }
			add_political_power = 50
			add_popularity = { ideology = radical_democracy popularity = 0.01 }
			
		}
	}

	option = { # It's a failure...
		name = brazil_votes_results.11.b
		trigger = {
			has_country_flag = eoanb_reform_vote_failure
		}
		clr_country_flag = eoanb_reform_vote_failure

			# Put here if the result is a failure

		set_variable = { 
			var = current_reform_id
			value = 0
		}
	}

	option = { # It's a tie.
		name = brazil_votes_results.11.c
		trigger = {
			has_country_flag = eoanb_reform_vote_tie
		}
		clr_country_flag = eoanb_reform_vote_tie

			# Put here if the result is a tie

		set_variable = { 
			var = current_reform_id
			value = 0
		}
	}
}

#army discipline
country_event = { # Brazil Votes 1857_12
	id = brazil_votes.12
	title = brazil_votes.12.t
	desc = brazil_votes.12.d
	picture = GFX_report_event_generic_parliament

	is_triggered_only = yes

	immediate = {
		set_variable = { # Don't change
			var = current_reform_id
			value = -1									# This allows the system to detect a custom vote in progress
		}

		reset_approval_arrays = yes						# Resets all of the approvals
		#set_1_approval_highly_disagree = yes			# For those ideologies who have a 1 for this type of legislation will highly disagree with this bill
		#set_2_approval_disagree = yes					# For those ideologies who have a 2 for this type of legislation will disagree with this bill
		#set_3_approval_neutral = yes					# For those ideologies who have a 3 for this type of legislation will be neutral about this bill
		#set_4_approval_highly_agree = yes				# For those ideologies who have a 4 for this type of legislation will highly agree with this bill
		set_1_approval_highly_agree = yes					# Change for Jingoist approvals
		set_2_approval_highly_agree = yes					# Change for Pro-Militarist approvals
		set_3_approval_disagree = yes						# Change for Anti-Militarist approvals
		set_4_approval_highly_disagree = yes				# Change for Pacifist
		
		set_vote_war = yes								# Determines what type of legislation this is, and what values of the ideologies' wishlist will be considered (cul, eco, dem, war, bud)
		compute_voting_approval = yes					# Calculates the approvals

		compute_number_seats_tot = yes					# Calculates the total number of seats in the current Parliament
		compute_number_seats_approve_est = yes			# Estimates the number of seats that will vote yes for the vote
	}

	option = { # Let's vote in a month
		name = brazil_votes.12.a

		country_event = {
			id = brazil_votes_results.12				# Sets the custom result event for your custom law
			days = 35									# Usually, a vote takes 30 days. You can go lower, but the timed mission won't be able to show the right amount of time. It's not a big deal because this fires the event by itself, and because the decision does nothing in the case of a custom vote.
		}
	}

	option = { # Abandon the idea
		name = brazil_votes.12.b

		set_variable = { 
			var = current_reform_id
			value = 0
		}
	}
	
	option = { # Let's vote in a month
		name = brazil_votes.12.c
		country_event = {
			id = brazil_votes_results.12				# Sets the custom result event for your custom law
			days = 1									# Usually, a vote takes 30 days. You can go lower, but the timed mission won't be able to show the right amount of time. It's not a big deal because this fires the event by itself, and because the decision does nothing in the case of a custom vote.
		}
	}
}

country_event = { # Brazil Votes results 12_1857
	id = brazil_votes_results.12
	title = brazil_votes_results.12.t
	desc = brazil_votes_results.12.d
	picture = GFX_report_event_generic_parliament

	is_triggered_only = yes

	immediate = {
		hidden_effect = {
			calculate_vote_result = yes								# Do all the calculations for the vote, and outputs a country flag (eoanb_reform_vote_success, eoanb_reform_vote_failure, eoanb_reform_vote_tie)
		}
	}

	option = { # It's a success!
		name = brazil_votes_results.12.a
		trigger = {
			has_country_flag = eoanb_reform_vote_success
		}
		clr_country_flag = eoanb_reform_vote_success

			# Put here if the result is a victory
		enact_voted_reform = yes

		set_variable = { 
			var = current_reform_id
			value = 0
		}

		set_country_flag = BRA_reformed_conscription

		custom_effect_tooltip = BRA_imperial_army_effect_tt
		add_to_variable = { BRA_army_aof = 0.01 tooltip = army_org_factor_tooltip }
		add_to_variable = { BRA_army_aor = 0.03 tooltip = army_org_regain_tooltip }
		custom_effect_tooltip = BRA_imperial_navy_effect_tt
		add_to_variable = { BRA_imperial_navy_nof = 0.02 tooltip = navy_org_factor_tooltip }
		
		if = {
			limit = { has_government = traditional_conservatism }
			add_political_power = 50
			add_popularity = { ideology = traditional_conservatism popularity = -0.01 }
			add_popularity = { ideology = centrism popularity = 0.01 }
		}
		if = {
			limit = { has_government = centrism }
			add_popularity = { ideology = traditional_conservatism popularity = 0.01 }
			add_popularity = { ideology = centrism popularity = -0.01 }
		}
		if = {
			limit = { has_country_flag = brazil_conservative }
			add_political_power = 50
			add_popularity = { ideology = traditional_conservatism popularity = 0.01 }
			
		}
		if = {
			limit = { has_country_flag = brazil_liberal }
			add_political_power = 50
			add_popularity = { ideology = centrism popularity = 0.01 }
			
		}
		if = {
			limit = { has_country_flag = brazil_conciliatory }
			add_political_power = 50
			add_popularity = { ideology = traditional_conservatism popularity = 0.005 }
			add_popularity = { ideology = centrism popularity = 0.005 }
			
		}
		if = {
			limit = { has_country_flag = brazil_ultraconservative }
			add_political_power = 50
			add_popularity = { ideology = radical_democracy popularity = 0.01 }
			
		}
	}

	option = { # It's a failure...
		name = brazil_votes_results.12.b
		trigger = {
			has_country_flag = eoanb_reform_vote_failure
		}
		clr_country_flag = eoanb_reform_vote_failure

			# Put here if the result is a failure

		set_variable = { 
			var = current_reform_id
			value = 0
		}
	}

	option = { # It's a tie.
		name = brazil_votes_results.12.c
		trigger = {
			has_country_flag = eoanb_reform_vote_tie
		}
		clr_country_flag = eoanb_reform_vote_tie

			# Put here if the result is a tie

		set_variable = { 
			var = current_reform_id
			value = 0
		}
	}
}

country_event = { # Brazil Votes 1857_13
	id = brazil_votes.13
	title = brazil_votes.13.t
	desc = brazil_votes.13.d
	picture = GFX_report_event_generic_parliament

	is_triggered_only = yes

	immediate = {
		set_variable = { # Don't change
			var = current_reform_id
			value = -1									# This allows the system to detect a custom vote in progress
		}

		reset_approval_arrays = yes						# Resets all of the approvals
		#set_1_approval_highly_disagree = yes			# For those ideologies who have a 1 for this type of legislation will highly disagree with this bill
		#set_2_approval_disagree = yes					# For those ideologies who have a 2 for this type of legislation will disagree with this bill
		#set_3_approval_neutral = yes					# For those ideologies who have a 3 for this type of legislation will be neutral about this bill
		#set_4_approval_highly_agree = yes				# For those ideologies who have a 4 for this type of legislation will highly agree with this bill
		set_1_approval_neutral = yes					# Change for Reactionary approvals
		set_2_approval_highly_agree = yes				# Change for Conservative approvals
		set_3_approval_highly_agree = yes				# Change for Liberal approvals
		set_4_approval_highly_agree = yes				# Change for Progressist approvals
		
		set_vote_cul = yes								# Determines what type of legislation this is, and what values of the ideologies' wishlist will be considered (cul, eco, dem, war, bud)
		compute_voting_approval = yes					# Calculates the approvals

		compute_number_seats_tot = yes					# Calculates the total number of seats in the current Parliament
		compute_number_seats_approve_est = yes			# Estimates the number of seats that will vote yes for the vote
	}

	option = { # Let's vote in a month
		name = brazil_votes.13.a

		country_event = {
			id = brazil_votes_results.13				# Sets the custom result event for your custom law
			days = 35									# Usually, a vote takes 30 days. You can go lower, but the timed mission won't be able to show the right amount of time. It's not a big deal because this fires the event by itself, and because the decision does nothing in the case of a custom vote.
		}
	}

	option = { # Abandon the idea
		name = brazil_votes.13.b

		set_variable = { 
			var = current_reform_id
			value = 0
		}
	}
	
	option = { # Let's vote in a month
		name = brazil_votes.13.c
		country_event = {
			id = brazil_votes_results.13				# Sets the custom result event for your custom law
			days = 1									# Usually, a vote takes 30 days. You can go lower, but the timed mission won't be able to show the right amount of time. It's not a big deal because this fires the event by itself, and because the decision does nothing in the case of a custom vote.
		}
	}
}

country_event = { # Brazil Votes results 13_1857
	id = brazil_votes_results.13
	title = brazil_votes_results.13.t
	desc = brazil_votes_results.13.d
	picture = GFX_report_event_generic_parliament

	is_triggered_only = yes

	immediate = {
		hidden_effect = {
			calculate_vote_result = yes								# Do all the calculations for the vote, and outputs a country flag (eoanb_reform_vote_success, eoanb_reform_vote_failure, eoanb_reform_vote_tie)
		}
	}

	option = { # It's a success!
		name = brazil_votes_results.13.a
		trigger = {
			has_country_flag = eoanb_reform_vote_success
		}
		clr_country_flag = eoanb_reform_vote_success

			# Put here if the result is a victory
		enact_voted_reform = yes

		set_variable = { 
			var = current_reform_id
			value = 0
		}
		add_timed_idea = { idea = BRA_improve_criminal_laws days = 1825 }
		if = {
			limit = { has_government = traditional_conservatism }
			add_political_power = 50
			add_popularity = { ideology = traditional_conservatism popularity = -0.01 }
			add_popularity = { ideology = centrism popularity = 0.01 }
		}
		if = {
			limit = { has_government = centrism }
			add_popularity = { ideology = traditional_conservatism popularity = 0.01 }
			add_popularity = { ideology = centrism popularity = -0.01 }
		}
		if = {
			limit = { has_country_flag = brazil_conservative }
			add_political_power = 50
			add_popularity = { ideology = traditional_conservatism popularity = 0.01 }
			
		}
		if = {
			limit = { has_country_flag = brazil_liberal }
			add_political_power = 50
			add_popularity = { ideology = centrism popularity = 0.01 }
			
		}
		if = {
			limit = { has_country_flag = brazil_conciliatory }
			add_political_power = 50
			add_popularity = { ideology = traditional_conservatism popularity = 0.005 }
			add_popularity = { ideology = centrism popularity = 0.005 }
			
		}
		if = {
			limit = { has_country_flag = brazil_ultraconservative }
			add_political_power = 50
			add_popularity = { ideology = radical_democracy popularity = 0.01 }
			
		}
	}

	option = { # It's a failure...
		name = brazil_votes_results.13.b
		trigger = {
			has_country_flag = eoanb_reform_vote_failure
		}
		clr_country_flag = eoanb_reform_vote_failure

			# Put here if the result is a failure

		set_variable = { 
			var = current_reform_id
			value = 0
		}
	}

	option = { # It's a tie.
		name = brazil_votes_results.13.c
		trigger = {
			has_country_flag = eoanb_reform_vote_tie
		}
		clr_country_flag = eoanb_reform_vote_tie

			# Put here if the result is a tie

		set_variable = { 
			var = current_reform_id
			value = 0
		}
	}
}

country_event = { # Brazil Votes 1857_14
	id = brazil_votes.14
	title = brazil_votes.14.t
	desc = brazil_votes.14.d
	picture = GFX_report_event_generic_parliament

	is_triggered_only = yes

	immediate = {
		set_variable = { # Don't change
			var = current_reform_id
			value = -1									# This allows the system to detect a custom vote in progress
		}

		reset_approval_arrays = yes						# Resets all of the approvals
		#set_1_approval_highly_disagree = yes			# For those ideologies who have a 1 for this type of legislation will highly disagree with this bill
		#set_2_approval_disagree = yes					# For those ideologies who have a 2 for this type of legislation will disagree with this bill
		#set_3_approval_neutral = yes					# For those ideologies who have a 3 for this type of legislation will be neutral about this bill
		#set_4_approval_highly_agree = yes				# For those ideologies who have a 4 for this type of legislation will highly agree with this bill
		set_1_approval_highly_agree = yes				# Change for Laissez-faire approvals
		set_2_approval_highly_agree = yes				# Change for Interventionistapprovals
		set_3_approval_disagree = yes					# Change for State capitalist approvals
		set_4_approval_highly_disagree = yes			# Change for Planned economy approvals
		
		set_vote_eco = yes								# Determines what type of legislation this is, and what values of the ideologies' wishlist will be considered (cul, eco, dem, war, bud)
		compute_voting_approval = yes					# Calculates the approvals

		compute_number_seats_tot = yes					# Calculates the total number of seats in the current Parliament
		compute_number_seats_approve_est = yes			# Estimates the number of seats that will vote yes for the vote
	}

	option = { # Let's vote in a month
		name = brazil_votes.14.a

		country_event = {
			id = brazil_votes_results.14				# Sets the custom result event for your custom law
			days = 35									# Usually, a vote takes 30 days. You can go lower, but the timed mission won't be able to show the right amount of time. It's not a big deal because this fires the event by itself, and because the decision does nothing in the case of a custom vote.
		}
	}

	option = { # Abandon the idea
		name = brazil_votes.14.b

		set_variable = { 
			var = current_reform_id
			value = 0
		}
	}
	
	option = { # Let's vote in a month
		name = brazil_votes.14.c
		country_event = {
			id = brazil_votes_results.14				# Sets the custom result event for your custom law
			days = 1									# Usually, a vote takes 30 days. You can go lower, but the timed mission won't be able to show the right amount of time. It's not a big deal because this fires the event by itself, and because the decision does nothing in the case of a custom vote.
		}
	}
}

country_event = { # Brazil Votes results 14_1857
	id = brazil_votes_results.14
	title = brazil_votes_results.14.t
	desc = brazil_votes_results.14.d
	picture = GFX_report_event_generic_parliament

	is_triggered_only = yes

	immediate = {
		hidden_effect = {
			calculate_vote_result = yes								# Do all the calculations for the vote, and outputs a country flag (eoanb_reform_vote_success, eoanb_reform_vote_failure, eoanb_reform_vote_tie)
		}
	}

	option = { # It's a success!
		name = brazil_votes_results.14.a
		trigger = {
			has_country_flag = eoanb_reform_vote_success
		}
		clr_country_flag = eoanb_reform_vote_success

			# Put here if the result is a victory
		enact_voted_reform = yes

		set_variable = { 
			var = current_reform_id
			value = 0
		}
		custom_effect_tooltip = dynmod_BRA_New_World_Immigrants_effect_tt
		add_to_variable = { BRA_New_World_Immigrants_mp = 0.025 tooltip = monthly_population_tooltip}
		add_to_variable = { BRA_New_World_Immigrants_cgev = 0.01 tooltip = consumer_goods_expected_value_tooltip}
			
		add_timed_idea = {
			idea = BRA_1857_taxes_act
			days = 2555
		}
		if = {
			limit = { has_country_flag = brazil_conciliatory }
			add_political_power = 50
			add_popularity = { ideology = traditional_conservatism popularity = -0.02 }
			add_popularity = { ideology = centrism popularity = 0.02 }
			add_power_balance_value = {
				id = BRA_Balance_of_Power_1857
				value = -0.12
				tooltip_side = BRA_BOP_government
			}
		}
	}

	option = { # It's a failure...
		name = brazil_votes_results.14.b
		trigger = {
			has_country_flag = eoanb_reform_vote_failure
		}
		clr_country_flag = eoanb_reform_vote_failure
			# Put here if the result is a failure
			if = {
				limit = { has_country_flag = brazil_conciliatory }
				add_popularity = { ideology = traditional_conservatism popularity = -0.02 }
				add_popularity = { ideology = radical_democracy popularity = 0.02 }
				add_power_balance_value = {
					id = BRA_Balance_of_Power_1857
					value = 0.12
					tooltip_side = BRA_BOP_opposition
				}
			}
		set_variable = { 
			var = current_reform_id
			value = 0
		}
	}

	option = { # It's a tie.
		name = brazil_votes_results.14.c
		trigger = {
			has_country_flag = eoanb_reform_vote_tie
		}
		clr_country_flag = eoanb_reform_vote_tie

			# Put here if the result is a tie

		set_variable = { 
			var = current_reform_id
			value = 0
		}
	}
}

country_event = { # Brazil Votes 1857_15
	id = brazil_votes.15
	title = brazil_votes.15.t
	desc = brazil_votes.15.d
	picture = GFX_report_event_generic_parliament

	is_triggered_only = yes

	immediate = {
		set_variable = { # Don't change
			var = current_reform_id
			value = -1									# This allows the system to detect a custom vote in progress
		}

		reset_approval_arrays = yes						# Resets all of the approvals
		#set_1_approval_highly_disagree = yes			# For those ideologies who have a 1 for this type of legislation will highly disagree with this bill
		#set_2_approval_disagree = yes					# For those ideologies who have a 2 for this type of legislation will disagree with this bill
		#set_3_approval_neutral = yes					# For those ideologies who have a 3 for this type of legislation will be neutral about this bill
		#set_4_approval_highly_agree = yes				# For those ideologies who have a 4 for this type of legislation will highly agree with this bill
		set_4_approval_highly_agree = yes				# Change for planned economy
		set_3_approval_highly_agree = yes				# Change for autocracy approvals
		set_2_approval_highly_agree = yes				# Change for conservative approvals
		set_1_approval_highly_disagree = yes			# Change for con lib approvals
		set_vote_eco = yes								# Determines what type of legislation this is, and what values of the ideologies' wishlist will be considered (cul, eco, dem, war, bud)
		compute_voting_approval = yes					# Calculates the approvals

		compute_number_seats_tot = yes					# Calculates the total number of seats in the current Parliament
		compute_number_seats_approve_est = yes			# Estimates the number of seats that will vote yes for the vote
	}

	option = { # Let's vote in a month
		name = brazil_votes.15.a

		country_event = {
			id = brazil_votes_results.15				# Sets the custom result event for your custom law
			days = 30									# Usually, a vote takes 30 days. You can go lower, but the timed mission won't be able to show the right amount of time. It's not a big deal because this fires the event by itself, and because the decision does nothing in the case of a custom vote.
		}
	}

	option = { # Abandon the idea
		name = brazil_votes.15.b

		set_variable = { 
			var = current_reform_id
			value = 0
		}
	}
	
	option = { # Let's vote in a month
		name = brazil_votes.15.c
		country_event = {
			id = brazil_votes_results.15				# Sets the custom result event for your custom law
			days = 1									# Usually, a vote takes 30 days. You can go lower, but the timed mission won't be able to show the right amount of time. It's not a big deal because this fires the event by itself, and because the decision does nothing in the case of a custom vote.
		}
	}
}

country_event = { # Brazil Votes results 15_1857
	id = brazil_votes_results.15
	title = brazil_votes_results.15.t
	desc = brazil_votes_results.15.d
	picture = GFX_report_event_generic_parliament

	is_triggered_only = yes

	immediate = {
		hidden_effect = {
			calculate_vote_result = yes								# Do all the calculations for the vote, and outputs a country flag (eoanb_reform_vote_success, eoanb_reform_vote_failure, eoanb_reform_vote_tie)
		}
	}

	option = { # It's a success!
		name = brazil_votes_results.15.a
		trigger = {
			has_country_flag = eoanb_reform_vote_success
		}
		clr_country_flag = eoanb_reform_vote_success

			# Put here if the result is a victory
		enact_voted_reform = yes
		unlock_decision_tooltip = BRA_decision_acquire_gold_from_mines
		set_variable = { 
			var = current_reform_id
			value = 0
		}
		if = {
			limit = { has_government = traditional_conservatism }
			add_political_power = 50
			add_popularity = { ideology = traditional_conservatism popularity = -0.01 }
			add_popularity = { ideology = centrism popularity = 0.01 }
		}
		if = {
			limit = { has_government = centrism }
			add_popularity = { ideology = traditional_conservatism popularity = 0.01 }
			add_popularity = { ideology = centrism popularity = -0.01 }
		}
		if = {
			limit = { has_country_flag = brazil_conservative }
			add_political_power = 50
			add_popularity = { ideology = traditional_conservatism popularity = 0.01 }
			
		}
		if = {
			limit = { has_country_flag = brazil_liberal }
			add_political_power = 50
			add_popularity = { ideology = centrism popularity = 0.01 }
			
		}
		if = {
			limit = { has_country_flag = brazil_conciliatory }
			add_political_power = 50
			add_popularity = { ideology = traditional_conservatism popularity = 0.005 }
			add_popularity = { ideology = centrism popularity = 0.005 }
			
		}
		if = {
			limit = { has_country_flag = brazil_ultraconservative }
			add_political_power = 50
			add_popularity = { ideology = radical_democracy popularity = 0.01 }
			
		}
	}

	option = { # It's a failure...
		name = brazil_votes_results.15.b
		trigger = {
			has_country_flag = eoanb_reform_vote_failure
		}
		clr_country_flag = eoanb_reform_vote_failure

			# Put here if the result is a failure

		set_variable = { 
			var = current_reform_id
			value = 0
		}
	}

	option = { # It's a tie.
		name = brazil_votes_results.15.c
		trigger = {
			has_country_flag = eoanb_reform_vote_tie
		}
		clr_country_flag = eoanb_reform_vote_tie

			# Put here if the result is a tie

		set_variable = { 
			var = current_reform_id
			value = 0
		}
	}
}

country_event = { # Brazil Votes 1857_16
	id = brazil_votes.16
	title = brazil_votes.16.t
	desc = brazil_votes.16.d
	picture = GFX_report_event_generic_parliament

	is_triggered_only = yes

	immediate = {
		set_variable = { # Don't change
			var = current_reform_id
			value = -1									# This allows the system to detect a custom vote in progress
		}

		reset_approval_arrays = yes						# Resets all of the approvals
		#set_1_approval_highly_disagree = yes			# For those ideologies who have a 1 for this type of legislation will highly disagree with this bill
		#set_2_approval_disagree = yes					# For those ideologies who have a 2 for this type of legislation will disagree with this bill
		#set_3_approval_neutral = yes					# For those ideologies who have a 3 for this type of legislation will be neutral about this bill
		#set_4_approval_highly_agree = yes				# For those ideologies who have a 4 for this type of legislation will highly agree with this bill
		set_4_approval_highly_agree = yes				# Change for planned economy
		set_3_approval_highly_agree = yes				# Change for autocracy approvals
		set_2_approval_highly_agree = yes				# Change for conservative approvals
		set_1_approval_highly_disagree = yes			# Change for con lib approvals
		set_vote_eco = yes								# Determines what type of legislation this is, and what values of the ideologies' wishlist will be considered (cul, eco, dem, war, bud)
		compute_voting_approval = yes					# Calculates the approvals

		compute_number_seats_tot = yes					# Calculates the total number of seats in the current Parliament
		compute_number_seats_approve_est = yes			# Estimates the number of seats that will vote yes for the vote
	}

	option = { # Let's vote in a month
		name = brazil_votes.16.a

		country_event = {
			id = brazil_votes_results.16				# Sets the custom result event for your custom law
			days = 30									# Usually, a vote takes 30 days. You can go lower, but the timed mission won't be able to show the right amount of time. It's not a big deal because this fires the event by itself, and because the decision does nothing in the case of a custom vote.
		}
	}

	option = { # Abandon the idea
		name = brazil_votes.16.b

		set_variable = { 
			var = current_reform_id
			value = 0
		}
	}
	
	option = { # Let's vote in a month
		name = brazil_votes.16.c
		country_event = {
			id = brazil_votes_results.16				# Sets the custom result event for your custom law
			days = 1									# Usually, a vote takes 30 days. You can go lower, but the timed mission won't be able to show the right amount of time. It's not a big deal because this fires the event by itself, and because the decision does nothing in the case of a custom vote.
		}
	}
}

country_event = { # Brazil Votes results 16_1857
	id = brazil_votes_results.16
	title = brazil_votes_results.16.t
	desc = brazil_votes_results.16.d
	picture = GFX_report_event_generic_parliament

	is_triggered_only = yes

	immediate = {
		hidden_effect = {
			calculate_vote_result = yes								# Do all the calculations for the vote, and outputs a country flag (eoanb_reform_vote_success, eoanb_reform_vote_failure, eoanb_reform_vote_tie)
		}
	}

	option = { # It's a success!
		name = brazil_votes_results.16.a
		trigger = {
			has_country_flag = eoanb_reform_vote_success
		}
		clr_country_flag = eoanb_reform_vote_success

			# Put here if the result is a victory
		enact_voted_reform = yes

		set_variable = { 
			var = current_reform_id
			value = 0
		}
		add_ideas = BRA_1858_monopoly_on_issuing_money
		if = {
			limit = { has_government = traditional_conservatism }
			add_political_power = 50
			add_popularity = { ideology = traditional_conservatism popularity = -0.01 }
			add_popularity = { ideology = centrism popularity = 0.01 }
		}
		if = {
			limit = { has_government = centrism }
			add_popularity = { ideology = traditional_conservatism popularity = 0.01 }
			add_popularity = { ideology = centrism popularity = -0.01 }
		}
		if = {
			limit = { has_country_flag = brazil_conservative }
			add_political_power = 50
			add_popularity = { ideology = traditional_conservatism popularity = 0.01 }
			
		}
		if = {
			limit = { has_country_flag = brazil_liberal }
			add_political_power = 50
			add_popularity = { ideology = centrism popularity = 0.01 }
			
		}
		if = {
			limit = { has_country_flag = brazil_conciliatory }
			add_political_power = 50
			add_popularity = { ideology = traditional_conservatism popularity = 0.005 }
			add_popularity = { ideology = centrism popularity = 0.005 }
			
		}
		if = {
			limit = { has_country_flag = brazil_ultraconservative }
			add_political_power = 50
			add_popularity = { ideology = radical_democracy popularity = 0.01 }
			
		}
	}

	option = { # It's a failure...
		name = brazil_votes_results.16.b
		trigger = {
			has_country_flag = eoanb_reform_vote_failure
		}
		clr_country_flag = eoanb_reform_vote_failure

			# Put here if the result is a failure

		set_variable = { 
			var = current_reform_id
			value = 0
		}
	}

	option = { # It's a tie.
		name = brazil_votes_results.16.c
		trigger = {
			has_country_flag = eoanb_reform_vote_tie
		}
		clr_country_flag = eoanb_reform_vote_tie

			# Put here if the result is a tie

		set_variable = { 
			var = current_reform_id
			value = 0
		}
	}
}

#increase immigration
country_event = { # Brazil Votes 1857_17
	id = brazil_votes.17
	title = brazil_votes.17.t
	desc = brazil_votes.17.d
	picture = GFX_report_event_generic_parliament

	is_triggered_only = yes

	immediate = {
		set_variable = { # Don't change
			var = current_reform_id
			value = -1									# This allows the system to detect a custom vote in progress
		}

		reset_approval_arrays = yes						# Resets all of the approvals
		#set_1_approval_highly_disagree = yes			# For those ideologies who have a 1 for this type of legislation will highly disagree with this bill
		#set_2_approval_disagree = yes					# For those ideologies who have a 2 for this type of legislation will disagree with this bill
		#set_3_approval_neutral = yes					# For those ideologies who have a 3 for this type of legislation will be neutral about this bill
		#set_4_approval_highly_agree = yes				# For those ideologies who have a 4 for this type of legislation will highly agree with this bill
		set_1_approval_highly_agree = yes				# Change for Aristocratic approvals
		set_2_approval_highly_agree = yes				# Change for Elitist approvals
		set_3_approval_highly_agree = yes				# Change for Favoritist approvals
		set_4_approval_highly_agree = yes				# Change for Egalitarian
		
		set_vote_dem = yes								# Determines what type of legislation this is, and what values of the ideologies' wishlist will be considered (cul, eco, dem, war, bud)
		compute_voting_approval = yes					# Calculates the approvals

		compute_number_seats_tot = yes					# Calculates the total number of seats in the current Parliament
		compute_number_seats_approve_est = yes			# Estimates the number of seats that will vote yes for the vote
	}

	option = { # Let's vote in a month
		name = brazil_votes.17.a

		country_event = {
			id = brazil_votes_results.17				# Sets the custom result event for your custom law
			days = 35									# Usually, a vote takes 30 days. You can go lower, but the timed mission won't be able to show the right amount of time. It's not a big deal because this fires the event by itself, and because the decision does nothing in the case of a custom vote.
		}
	}

	option = { # Abandon the idea
		name = brazil_votes.17.b

		set_variable = { 
			var = current_reform_id
			value = 0
		}
	}
	option = { # Let's vote in a month
		name = brazil_votes.17.c
		country_event = {
			id = brazil_votes_results.17				# Sets the custom result event for your custom law
			days = 1									# Usually, a vote takes 30 days. You can go lower, but the timed mission won't be able to show the right amount of time. It's not a big deal because this fires the event by itself, and because the decision does nothing in the case of a custom vote.
		}
	}
}

country_event = { # Brazil Votes results 17_1857
	id = brazil_votes_results.17
	title = brazil_votes_results.17.t
	desc = brazil_votes_results.17.d
	picture = GFX_report_event_generic_parliament

	is_triggered_only = yes

	immediate = {
		hidden_effect = {
			calculate_vote_result = yes								# Do all the calculations for the vote, and outputs a country flag (eoanb_reform_vote_success, eoanb_reform_vote_failure, eoanb_reform_vote_tie)
		}
	}

	option = { # It's a success!
		name = brazil_votes_results.17.a
		trigger = {
			has_country_flag = eoanb_reform_vote_success
		}
		clr_country_flag = eoanb_reform_vote_success

			# Put here if the result is a victory
		enact_voted_reform = yes

		set_variable = { 
			var = current_reform_id
			value = 0
		}
		add_ideas = BRA_1858_eusebio_de_queiros_law
		if = {
			limit = { has_government = traditional_conservatism }
			add_political_power = 50
			add_popularity = { ideology = traditional_conservatism popularity = -0.01 }
			add_popularity = { ideology = centrism popularity = 0.01 }
		}
		if = {
			limit = { has_government = centrism }
			add_popularity = { ideology = traditional_conservatism popularity = 0.01 }
			add_popularity = { ideology = centrism popularity = -0.01 }
		}
		if = {
			limit = { has_country_flag = brazil_conservative }
			add_political_power = 50
			add_popularity = { ideology = traditional_conservatism popularity = 0.01 }
			
		}
		if = {
			limit = { has_country_flag = brazil_liberal }
			add_political_power = 50
			add_popularity = { ideology = centrism popularity = 0.01 }
			
		}
		if = {
			limit = { has_country_flag = brazil_conciliatory }
			add_political_power = 50
			add_popularity = { ideology = traditional_conservatism popularity = 0.005 }
			add_popularity = { ideology = centrism popularity = 0.005 }
			
		}
		if = {
			limit = { has_country_flag = brazil_ultraconservative }
			add_political_power = 50
			add_popularity = { ideology = radical_democracy popularity = 0.01 }
			
		}
	}

	option = { # It's a failure...
		name = brazil_votes_results.17.b
		trigger = {
			has_country_flag = eoanb_reform_vote_failure
		}
		clr_country_flag = eoanb_reform_vote_failure

			# Put here if the result is a failure

		set_variable = { 
			var = current_reform_id
			value = 0
		}
	}

	option = { # It's a tie.
		name = brazil_votes_results.17.c
		trigger = {
			has_country_flag = eoanb_reform_vote_tie
		}
		clr_country_flag = eoanb_reform_vote_tie

			# Put here if the result is a tie

		set_variable = { 
			var = current_reform_id
			value = 0
		}
	}
}

country_event = { # Brazil Votes 1857_18
	id = brazil_votes.18
	title = brazil_votes.18.t
	desc = brazil_votes.18.d
	picture = GFX_report_event_generic_parliament

	is_triggered_only = yes

	immediate = {
		set_variable = { # Don't change
			var = current_reform_id
			value = -1									# This allows the system to detect a custom vote in progress
		}

		reset_approval_arrays = yes						# Resets all of the approvals
		#set_1_approval_highly_disagree = yes			# For those ideologies who have a 1 for this type of legislation will highly disagree with this bill
		#set_2_approval_disagree = yes					# For those ideologies who have a 2 for this type of legislation will disagree with this bill
		#set_3_approval_neutral = yes					# For those ideologies who have a 3 for this type of legislation will be neutral about this bill
		#set_4_approval_highly_agree = yes				# For those ideologies who have a 4 for this type of legislation will highly agree with this bill
		set_4_approval_highly_agree = yes				# Change for planned economy
		set_3_approval_highly_agree = yes				# Change for autocracy approvals
		set_2_approval_neutral = yes					# Change for conservative approvals
		set_1_approval_neutral = yes					# Change for con lib approvals
		set_vote_eco = yes								# Determines what type of legislation this is, and what values of the ideologies' wishlist will be considered (cul, eco, dem, war, bud)
		compute_voting_approval = yes					# Calculates the approvals

		compute_number_seats_tot = yes					# Calculates the total number of seats in the current Parliament
		compute_number_seats_approve_est = yes			# Estimates the number of seats that will vote yes for the vote
	}

	option = { # Let's vote in a month
		name = brazil_votes.18.a

		country_event = {
			id = brazil_votes_results.18				# Sets the custom result event for your custom law
			days = 35									# Usually, a vote takes 30 days. You can go lower, but the timed mission won't be able to show the right amount of time. It's not a big deal because this fires the event by itself, and because the decision does nothing in the case of a custom vote.
		}
	}

	option = { # Abandon the idea
		name = brazil_votes.18.b

		set_variable = { 
			var = current_reform_id
			value = 0
		}
	}
	
	option = { # Let's vote in a month
		name = brazil_votes.18.c
		country_event = {
			id = brazil_votes_results.18				# Sets the custom result event for your custom law
			days = 1									# Usually, a vote takes 30 days. You can go lower, but the timed mission won't be able to show the right amount of time. It's not a big deal because this fires the event by itself, and because the decision does nothing in the case of a custom vote.
		}
	}
}


country_event = { # Brazil Votes results 18_1857
	id = brazil_votes_results.18
	title = brazil_votes_results.18.t
	desc = brazil_votes_results.18.d
	picture = GFX_report_event_generic_parliament

	is_triggered_only = yes

	immediate = {
		hidden_effect = {
			calculate_vote_result = yes								# Do all the calculations for the vote, and outputs a country flag (eoanb_reform_vote_success, eoanb_reform_vote_failure, eoanb_reform_vote_tie)
		}
	}

	option = { # It's a success!
		name = brazil_votes_results.18.a
		trigger = {
			has_country_flag = eoanb_reform_vote_success
		}
		clr_country_flag = eoanb_reform_vote_success

			# Put here if the result is a victory
		enact_voted_reform = yes

		set_variable = { 
			var = current_reform_id
			value = 0
		}
		add_ideas = BRA_1858_commerce_code_law
		if = {
			limit = { has_government = traditional_conservatism }
			add_political_power = 50
			add_popularity = { ideology = traditional_conservatism popularity = -0.01 }
			add_popularity = { ideology = centrism popularity = 0.01 }
		}
		if = {
			limit = { has_government = centrism }
			add_popularity = { ideology = traditional_conservatism popularity = 0.01 }
			add_popularity = { ideology = centrism popularity = -0.01 }
		}
		if = {
			limit = { has_country_flag = brazil_conservative }
			add_political_power = 50
			add_popularity = { ideology = traditional_conservatism popularity = 0.01 }
			
		}
		if = {
			limit = { has_country_flag = brazil_liberal }
			add_political_power = 50
			add_popularity = { ideology = centrism popularity = 0.01 }
			
		}
		if = {
			limit = { has_country_flag = brazil_conciliatory }
			add_political_power = 50
			add_popularity = { ideology = traditional_conservatism popularity = 0.005 }
			add_popularity = { ideology = centrism popularity = 0.005 }
			
		}
		if = {
			limit = { has_country_flag = brazil_ultraconservative }
			add_political_power = 50
			add_popularity = { ideology = radical_democracy popularity = 0.01 }
			
		}
	}

	option = { # It's a failure...
		name = brazil_votes_results.18.b
		trigger = {
			has_country_flag = eoanb_reform_vote_failure
		}
		clr_country_flag = eoanb_reform_vote_failure

			# Put here if the result is a failure

		set_variable = { 
			var = current_reform_id
			value = 0
		}
	}

	option = { # It's a tie.
		name = brazil_votes_results.18.c
		trigger = {
			has_country_flag = eoanb_reform_vote_tie
		}
		clr_country_flag = eoanb_reform_vote_tie

			# Put here if the result is a tie

		set_variable = { 
			var = current_reform_id
			value = 0
		}
	}
}

country_event = { # Brazil Votes 1857_19
	id = brazil_votes.19
	title = brazil_votes.19.t
	desc = brazil_votes.19.d
	picture = GFX_report_event_generic_parliament

	is_triggered_only = yes

	immediate = {
		set_variable = { # Don't change
			var = current_reform_id
			value = -1									# This allows the system to detect a custom vote in progress
		}

		reset_approval_arrays = yes						# Resets all of the approvals
		#set_1_approval_highly_disagree = yes			# For those ideologies who have a 1 for this type of legislation will highly disagree with this bill
		#set_2_approval_disagree = yes					# For those ideologies who have a 2 for this type of legislation will disagree with this bill
		#set_3_approval_neutral = yes					# For those ideologies who have a 3 for this type of legislation will be neutral about this bill
		#set_4_approval_highly_agree = yes				# For those ideologies who have a 4 for this type of legislation will highly agree with this bill
		set_4_approval_highly_agree = yes				# Change for planned economy
		set_3_approval_highly_agree = yes				# Change for autocracy approvals
		set_2_approval_neutral = yes					# Change for conservative approvals
		set_1_approval_neutral = yes					# Change for con lib approvals
		set_vote_eco = yes								# Determines what type of legislation this is, and what values of the ideologies' wishlist will be considered (cul, eco, dem, war, bud)
		compute_voting_approval = yes					# Calculates the approvals

		compute_number_seats_tot = yes					# Calculates the total number of seats in the current Parliament
		compute_number_seats_approve_est = yes			# Estimates the number of seats that will vote yes for the vote
	}

	option = { # Let's vote in a month
		name = brazil_votes.19.a

		country_event = {
			id = brazil_votes_results.19				# Sets the custom result event for your custom law
			days = 35									# Usually, a vote takes 30 days. You can go lower, but the timed mission won't be able to show the right amount of time. It's not a big deal because this fires the event by itself, and because the decision does nothing in the case of a custom vote.
		}
	}

	option = { # Abandon the idea
		name = brazil_votes.19.b

		set_variable = { 
			var = current_reform_id
			value = 0
		}
	}
	
	option = { # Let's vote in a month
		name = brazil_votes.19.c
		country_event = {
			id = brazil_votes_results.19				# Sets the custom result event for your custom law
			days = 1									# Usually, a vote takes 30 days. You can go lower, but the timed mission won't be able to show the right amount of time. It's not a big deal because this fires the event by itself, and because the decision does nothing in the case of a custom vote.
		}
	}
}

country_event = { # Brazil Votes results 19_1857
	id = brazil_votes_results.19
	title = brazil_votes_results.19.t
	desc = brazil_votes_results.19.d
	picture = GFX_report_event_generic_parliament

	is_triggered_only = yes

	immediate = {
		hidden_effect = {
			calculate_vote_result = yes								# Do all the calculations for the vote, and outputs a country flag (eoanb_reform_vote_success, eoanb_reform_vote_failure, eoanb_reform_vote_tie)
		}
	}

	option = { # It's a success!
		name = brazil_votes_results.19.a
		trigger = {
			has_country_flag = eoanb_reform_vote_success
		}
		clr_country_flag = eoanb_reform_vote_success

			# Put here if the result is a victory
		enact_voted_reform = yes

		set_variable = { 
			var = current_reform_id
			value = 0
		}
		add_ideas = BRA_1858_alves_branco_law
		if = {
			limit = { has_government = traditional_conservatism }
			add_political_power = 50
			add_popularity = { ideology = traditional_conservatism popularity = -0.01 }
			add_popularity = { ideology = centrism popularity = 0.01 }
		}
		if = {
			limit = { has_government = centrism }
			add_popularity = { ideology = traditional_conservatism popularity = 0.01 }
			add_popularity = { ideology = centrism popularity = -0.01 }
		}
		if = {
			limit = { has_country_flag = brazil_conservative }
			add_political_power = 50
			add_popularity = { ideology = traditional_conservatism popularity = 0.01 }
			
		}
		if = {
			limit = { has_country_flag = brazil_liberal }
			add_political_power = 50
			add_popularity = { ideology = centrism popularity = 0.01 }
			
		}
		if = {
			limit = { has_country_flag = brazil_conciliatory }
			add_political_power = 50
			add_popularity = { ideology = traditional_conservatism popularity = 0.005 }
			add_popularity = { ideology = centrism popularity = 0.005 }
			
		}
		if = {
			limit = { has_country_flag = brazil_ultraconservative }
			add_political_power = 50
			add_popularity = { ideology = radical_democracy popularity = 0.01 }
			
		}
	}

	option = { # It's a failure...
		name = brazil_votes_results.19.b
		trigger = {
			has_country_flag = eoanb_reform_vote_failure
		}
		clr_country_flag = eoanb_reform_vote_failure

			# Put here if the result is a failure

		set_variable = { 
			var = current_reform_id
			value = 0
		}
	}

	option = { # It's a tie.
		name = brazil_votes_results.19.c
		trigger = {
			has_country_flag = eoanb_reform_vote_tie
		}
		clr_country_flag = eoanb_reform_vote_tie

			# Put here if the result is a tie

		set_variable = { 
			var = current_reform_id
			value = 0
		}
	}
}

#increase immigration
country_event = { # Brazil Votes 1857_20
	id = brazil_votes.20
	title = brazil_votes.20.t
	desc = brazil_votes.20.d
	picture = GFX_report_event_generic_parliament

	is_triggered_only = yes

	immediate = {
		set_variable = { # Don't change
			var = current_reform_id
			value = -1									# This allows the system to detect a custom vote in progress
		}

		reset_approval_arrays = yes						# Resets all of the approvals
		#set_1_approval_highly_disagree = yes			# For those ideologies who have a 1 for this type of legislation will highly disagree with this bill
		#set_2_approval_disagree = yes					# For those ideologies who have a 2 for this type of legislation will disagree with this bill
		#set_3_approval_neutral = yes					# For those ideologies who have a 3 for this type of legislation will be neutral about this bill
		#set_4_approval_highly_agree = yes				# For those ideologies who have a 4 for this type of legislation will highly agree with this bill
		set_1_approval_neutral = yes					# Change for Aristocratic approvals
		set_2_approval_highly_agree = yes				# Change for Elitist approvals
		set_3_approval_highly_agree = yes				# Change for Favoritist approvals
		set_4_approval_highly_agree = yes				# Change for Egalitarian
		
		set_vote_dem = yes								# Determines what type of legislation this is, and what values of the ideologies' wishlist will be considered (cul, eco, dem, war, bud)
		compute_voting_approval = yes					# Calculates the approvals

		compute_number_seats_tot = yes					# Calculates the total number of seats in the current Parliament
		compute_number_seats_approve_est = yes			# Estimates the number of seats that will vote yes for the vote
	}

	option = { # Let's vote in a month
		name = brazil_votes.20.a

		country_event = {
			id = brazil_votes_results.20				# Sets the custom result event for your custom law
			days = 35									# Usually, a vote takes 30 days. You can go lower, but the timed mission won't be able to show the right amount of time. It's not a big deal because this fires the event by itself, and because the decision does nothing in the case of a custom vote.
		}
	}

	option = { # Abandon the idea
		name = brazil_votes.20.b

		set_variable = { 
			var = current_reform_id
			value = 0
		}
	}
	option = { # Let's vote in a month
		name = brazil_votes.20.c
		country_event = {
			id = brazil_votes_results.20				# Sets the custom result event for your custom law
			days = 1									# Usually, a vote takes 30 days. You can go lower, but the timed mission won't be able to show the right amount of time. It's not a big deal because this fires the event by itself, and because the decision does nothing in the case of a custom vote.
		}
	}
}

country_event = { # Brazil Votes results 20_1857
	id = brazil_votes_results.20
	title = brazil_votes_results.20.t
	desc = brazil_votes_results.20.d
	picture = GFX_report_event_generic_parliament

	is_triggered_only = yes

	immediate = {
		hidden_effect = {
			calculate_vote_result = yes								# Do all the calculations for the vote, and outputs a country flag (eoanb_reform_vote_success, eoanb_reform_vote_failure, eoanb_reform_vote_tie)
		}
	}

	option = { # It's a success!
		name = brazil_votes_results.20.a
		trigger = {
			has_country_flag = eoanb_reform_vote_success
		}
		clr_country_flag = eoanb_reform_vote_success

			# Put here if the result is a victory
		enact_voted_reform = yes

		set_variable = { 
			var = current_reform_id
			value = 0
		}
		add_ideas = BRA_1858_land_law
		if = {
			limit = { has_government = traditional_conservatism }
			add_political_power = 50
			add_popularity = { ideology = traditional_conservatism popularity = -0.01 }
			add_popularity = { ideology = centrism popularity = 0.01 }
		}
		if = {
			limit = { has_government = centrism }
			add_popularity = { ideology = traditional_conservatism popularity = 0.01 }
			add_popularity = { ideology = centrism popularity = -0.01 }
		}
		if = {
			limit = { has_country_flag = brazil_conservative }
			add_political_power = 50
			add_popularity = { ideology = traditional_conservatism popularity = 0.01 }
			
		}
		if = {
			limit = { has_country_flag = brazil_liberal }
			add_political_power = 50
			add_popularity = { ideology = centrism popularity = 0.01 }
			
		}
		if = {
			limit = { has_country_flag = brazil_conciliatory }
			add_political_power = 50
			add_popularity = { ideology = traditional_conservatism popularity = 0.005 }
			add_popularity = { ideology = centrism popularity = 0.005 }
			
		}
		if = {
			limit = { has_country_flag = brazil_ultraconservative }
			add_political_power = 50
			add_popularity = { ideology = radical_democracy popularity = 0.01 }
			
		}
	}

	option = { # It's a failure...
		name = brazil_votes_results.20.b
		trigger = {
			has_country_flag = eoanb_reform_vote_failure
		}
		clr_country_flag = eoanb_reform_vote_failure

			# Put here if the result is a failure

		set_variable = { 
			var = current_reform_id
			value = 0
		}
	}

	option = { # It's a tie.
		name = brazil_votes_results.20.c
		trigger = {
			has_country_flag = eoanb_reform_vote_tie
		}
		clr_country_flag = eoanb_reform_vote_tie

			# Put here if the result is a tie

		set_variable = { 
			var = current_reform_id
			value = 0
		}
	}
}

#navy officer promotion
	country_event = { # Brazil Votes 1857_11
	id = brazil_votes.21
	title = brazil_votes.21.t
	desc = brazil_votes.21.d
	picture = GFX_report_event_generic_parliament

	is_triggered_only = yes

	immediate = {
		set_variable = { # Don't change
			var = current_reform_id
			value = -1									# This allows the system to detect a custom vote in progress
		}

		reset_approval_arrays = yes						# Resets all of the approvals
		#set_1_approval_highly_disagree = yes			# For those ideologies who have a 1 for this type of legislation will highly disagree with this bill
		#set_2_approval_disagree = yes					# For those ideologies who have a 2 for this type of legislation will disagree with this bill
		#set_3_approval_neutral = yes					# For those ideologies who have a 3 for this type of legislation will be neutral about this bill
		#set_4_approval_highly_agree = yes				# For those ideologies who have a 4 for this type of legislation will highly agree with this bill
		set_1_approval_highly_agree = yes					# Change for Jingoist approvals
		set_2_approval_highly_agree = yes					# Change for Pro-Militarist approvals
		set_3_approval_disagree = yes						# Change for Anti-Militarist approvals
		set_4_approval_highly_disagree = yes				# Change for Pacifist
		
		set_vote_war = yes								# Determines what type of legislation this is, and what values of the ideologies' wishlist will be considered (cul, eco, dem, war, bud)
		compute_voting_approval = yes					# Calculates the approvals

		compute_number_seats_tot = yes					# Calculates the total number of seats in the current Parliament
		compute_number_seats_approve_est = yes			# Estimates the number of seats that will vote yes for the vote
	}

	option = { # Let's vote in a month
		name = brazil_votes.21.a

		country_event = {
			id = brazil_votes_results.21				# Sets the custom result event for your custom law
			days = 35									# Usually, a vote takes 30 days. You can go lower, but the timed mission won't be able to show the right amount of time. It's not a big deal because this fires the event by itself, and because the decision does nothing in the case of a custom vote.
		}
	}

	option = { # Abandon the idea
		name = brazil_votes.21.b

		set_variable = { 
			var = current_reform_id
			value = 0
		}
	}
	option = { # Let's vote in a month
		name = brazil_votes.21.c
		country_event = {
			id = brazil_votes_results.21				# Sets the custom result event for your custom law
			days = 1									# Usually, a vote takes 30 days. You can go lower, but the timed mission won't be able to show the right amount of time. It's not a big deal because this fires the event by itself, and because the decision does nothing in the case of a custom vote.
		}
	}
}

country_event = { # Brazil Votes results 11_1857
	id = brazil_votes_results.21
	title = brazil_votes_results.21.t
	desc = brazil_votes_results.21.d
	picture = GFX_report_event_generic_parliament

	is_triggered_only = yes

	immediate = {
		hidden_effect = {
			calculate_vote_result = yes								# Do all the calculations for the vote, and outputs a country flag (eoanb_reform_vote_success, eoanb_reform_vote_failure, eoanb_reform_vote_tie)
		}
	}

	option = { # It's a success!
		name = brazil_votes_results.21.a
		trigger = {
			has_country_flag = eoanb_reform_vote_success
		}
		clr_country_flag = eoanb_reform_vote_success

			# Put here if the result is a victory
		enact_voted_reform = yes

		set_variable = { 
			var = current_reform_id
			value = 0
		}
		add_ideas = BRA_1858_navy_officer_promotion
		custom_effect_tooltip = BRA_imperial_navy_effect_tt
		add_to_variable = { BRA_imperial_navy_nlcf = -0.33 tooltip = military_leader_cost_factor_tooltip }
		add_to_variable = { BRA_imperial_navy_nlsl = 1 tooltip = navy_leader_start_level_tooltip }
		add_to_variable = { BRA_imperial_navy_egnf = 0.001 tooltip = experience_gain_navy_tooltip }
		if = {
			limit = { has_country_flag = brazil_conservative }
			add_political_power = 50
			add_popularity = { ideology = traditional_conservatism popularity = 0.01 }
		}
		if = {
			limit = { has_country_flag = brazil_liberal }
			add_political_power = 50
			add_popularity = { ideology = centrism popularity = 0.01 }
		}
		if = {
			limit = { has_country_flag = brazil_conciliatory }
			add_political_power = 50
			add_popularity = { ideology = traditional_conservatism popularity = 0.005 }
			add_popularity = { ideology = centrism popularity = 0.005 }
		}
		if = {
			limit = { has_country_flag = brazil_ultraconservative }
			add_political_power = 50
			add_popularity = { ideology = radical_democracy popularity = 0.01 }

		}
	}

	option = { # It's a failure...
		name = brazil_votes_results.21.b
		trigger = {
			has_country_flag = eoanb_reform_vote_failure
		}
		clr_country_flag = eoanb_reform_vote_failure

			# Put here if the result is a failure

		set_variable = { 
			var = current_reform_id
			value = 0
		}
	}

	option = { # It's a tie.
		name = brazil_votes_results.21.c
		trigger = {
			has_country_flag = eoanb_reform_vote_tie
		}
		clr_country_flag = eoanb_reform_vote_tie

			# Put here if the result is a tie

		set_variable = { 
			var = current_reform_id
			value = 0
		}
	}
}

#army discipline
country_event = { # Brazil Votes 1857_22
	id = brazil_votes.22
	title = brazil_votes.22.t
	desc = brazil_votes.22.d
	picture = GFX_report_event_generic_parliament

	is_triggered_only = yes

	immediate = {
		set_variable = { # Don't change
			var = current_reform_id
			value = -1									# This allows the system to detect a custom vote in progress
		}

		reset_approval_arrays = yes						# Resets all of the approvals
		#set_1_approval_highly_disagree = yes			# For those ideologies who have a 1 for this type of legislation will highly disagree with this bill
		#set_2_approval_disagree = yes					# For those ideologies who have a 2 for this type of legislation will disagree with this bill
		#set_3_approval_neutral = yes					# For those ideologies who have a 3 for this type of legislation will be neutral about this bill
		#set_4_approval_highly_agree = yes				# For those ideologies who have a 4 for this type of legislation will highly agree with this bill
		set_1_approval_highly_agree = yes					# Change for Jingoist approvals
		set_2_approval_highly_agree = yes					# Change for Pro-Militarist approvals
		set_3_approval_disagree = yes						# Change for Anti-Militarist approvals
		set_4_approval_highly_disagree = yes				# Change for Pacifist
		
		set_vote_war = yes								# Determines what type of legislation this is, and what values of the ideologies' wishlist will be considered (cul, eco, dem, war, bud)
		compute_voting_approval = yes					# Calculates the approvals

		compute_number_seats_tot = yes					# Calculates the total number of seats in the current Parliament
		compute_number_seats_approve_est = yes			# Estimates the number of seats that will vote yes for the vote
	}

	option = { # Let's vote in a month
		name = brazil_votes.22.a

		country_event = {
			id = brazil_votes_results.22				# Sets the custom result event for your custom law
			days = 35									# Usually, a vote takes 30 days. You can go lower, but the timed mission won't be able to show the right amount of time. It's not a big deal because this fires the event by itself, and because the decision does nothing in the case of a custom vote.
		}
	}

	option = { # Abandon the idea
		name = brazil_votes.22.b

		set_variable = { 
			var = current_reform_id
			value = 0
		}
	}
	
	option = { # Let's vote in a month
		name = brazil_votes.22.c
		country_event = {
			id = brazil_votes_results.22				# Sets the custom result event for your custom law
			days = 1									# Usually, a vote takes 30 days. You can go lower, but the timed mission won't be able to show the right amount of time. It's not a big deal because this fires the event by itself, and because the decision does nothing in the case of a custom vote.
		}
	}
}

country_event = { # Brazil Votes results 22_1857
	id = brazil_votes_results.22
	title = brazil_votes_results.22.t
	desc = brazil_votes_results.22.d
	picture = GFX_report_event_generic_parliament

	is_triggered_only = yes

	immediate = {
		hidden_effect = {
			calculate_vote_result = yes								# Do all the calculations for the vote, and outputs a country flag (eoanb_reform_vote_success, eoanb_reform_vote_failure, eoanb_reform_vote_tie)
		}
	}

	option = { # It's a success!
		name = brazil_votes_results.22.a
		trigger = {
			has_country_flag = eoanb_reform_vote_success
		}
		clr_country_flag = eoanb_reform_vote_success

			# Put here if the result is a victory
		enact_voted_reform = yes

		set_variable = { 
			var = current_reform_id
			value = 0
		}
		add_ideas = BRA_1858_army_reform
		if = {
			limit = { has_government = traditional_conservatism }
			add_political_power = 50
			add_popularity = { ideology = traditional_conservatism popularity = -0.01 }
			add_popularity = { ideology = centrism popularity = 0.01 }
		}
		if = {
			limit = { has_government = centrism }
			add_popularity = { ideology = traditional_conservatism popularity = 0.01 }
			add_popularity = { ideology = centrism popularity = -0.01 }
		}
		if = {
			limit = { has_country_flag = brazil_conservative }
			add_political_power = 50
			add_popularity = { ideology = traditional_conservatism popularity = 0.01 }
			
		}
		if = {
			limit = { has_country_flag = brazil_liberal }
			add_political_power = 50
			add_popularity = { ideology = centrism popularity = 0.01 }
			
		}
		if = {
			limit = { has_country_flag = brazil_conciliatory }
			add_political_power = 50
			add_popularity = { ideology = traditional_conservatism popularity = 0.005 }
			add_popularity = { ideology = centrism popularity = 0.005 }
			
		}
		if = {
			limit = { has_country_flag = brazil_ultraconservative }
			add_political_power = 50
			add_popularity = { ideology = radical_democracy popularity = 0.01 }
			
		}
	}

	option = { # It's a failure...
		name = brazil_votes_results.22.b
		trigger = {
			has_country_flag = eoanb_reform_vote_failure
		}
		clr_country_flag = eoanb_reform_vote_failure

			# Put here if the result is a failure

		set_variable = { 
			var = current_reform_id
			value = 0
		}
	}

	option = { # It's a tie.
		name = brazil_votes_results.22.c
		trigger = {
			has_country_flag = eoanb_reform_vote_tie
		}
		clr_country_flag = eoanb_reform_vote_tie

			# Put here if the result is a tie

		set_variable = { 
			var = current_reform_id
			value = 0
		}
	}
}

country_event = { # Brazil Votes 1857_5
	id = brazil_votes.23
	title = brazil_votes.23.t
	desc = brazil_votes.23.d
	picture = GFX_report_event_generic_parliament

	is_triggered_only = yes

	immediate = {
		set_variable = { # Don't change
			var = current_reform_id
			value = -1									# This allows the system to detect a custom vote in progress
		}

		reset_approval_arrays = yes						# Resets all of the approvals
		#set_1_approval_highly_disagree = yes			# For those ideologies who have a 1 for this type of legislation will highly disagree with this bill
		#set_2_approval_disagree = yes					# For those ideologies who have a 2 for this type of legislation will disagree with this bill
		#set_3_approval_neutral = yes					# For those ideologies who have a 3 for this type of legislation will be neutral about this bill
		#set_4_approval_highly_agree = yes				# For those ideologies who have a 4 for this type of legislation will highly agree with this bill
		set_4_approval_disagree = yes					# Change for planned economy
		set_3_approval_highly_agree = yes				# Change for autocracy approvals
		set_2_approval_neutral = yes					# Change for conservative approvals
		set_1_approval_highly_agree = yes				# Change for con lib approvals
		set_vote_eco = yes								# Determines what type of legislation this is, and what values of the ideologies' wishlist will be considered (cul, eco, dem, war, bud)
		compute_voting_approval = yes					# Calculates the approvals

		compute_number_seats_tot = yes					# Calculates the total number of seats in the current Parliament
		compute_number_seats_approve_est = yes			# Estimates the number of seats that will vote yes for the vote
	}

	option = { # Let's vote in a month
		name = brazil_votes.23.a

		country_event = {
			id = brazil_votes_results.5				# Sets the custom result event for your custom law
			days = 35									# Usually, a vote takes 30 days. You can go lower, but the timed mission won't be able to show the right amount of time. It's not a big deal because this fires the event by itself, and because the decision does nothing in the case of a custom vote.
		}
	}

	option = { # Abandon the idea
		name = brazil_votes.23.b

		set_variable = { 
			var = current_reform_id
			value = 0
		}
	}
	
	option = { # Let's vote in a month
		name = brazil_votes.23.c
		country_event = {
			id = brazil_votes_results.23				# Sets the custom result event for your custom law
			days = 1									# Usually, a vote takes 30 days. You can go lower, but the timed mission won't be able to show the right amount of time. It's not a big deal because this fires the event by itself, and because the decision does nothing in the case of a custom vote.
		}
	}
}

country_event = { # Brazil Votes Result 1857_5
	id = brazil_votes_results.23
	title = brazil_votes_results.23.t
	desc = brazil_votes_results.23.d
	picture = GFX_report_event_generic_parliament

	is_triggered_only = yes

	immediate = {
		hidden_effect = {
			calculate_vote_result = yes								# Do all the calculations for the vote, and outputs a country flag (eoanb_reform_vote_success, eoanb_reform_vote_failure, eoanb_reform_vote_tie)
		}
	}

	option = { # It's a success!
		name = brazil_votes_results.23.a
		trigger = {
			has_country_flag = eoanb_reform_vote_success
		}
		clr_country_flag = eoanb_reform_vote_success

		# Put here if the result is a victory
		enact_voted_reform = yes

		set_variable = { 
			var = current_reform_id
			value = 0
		}
		ARG = {
			country_event = { id = brazil.306 }
		}
		if = {
			limit = { has_government = traditional_conservatism }
			add_political_power = 50
			add_popularity = { ideology = traditional_conservatism popularity = -0.01 }
			add_popularity = { ideology = centrism popularity = 0.01 }
		}
		if = {
			limit = { has_government = centrism }
			add_popularity = { ideology = traditional_conservatism popularity = 0.01 }
			add_popularity = { ideology = centrism popularity = -0.01 }
		}
		if = {
			limit = { has_country_flag = brazil_conservative }
			add_political_power = 50
			add_popularity = { ideology = traditional_conservatism popularity = 0.01 }
			
		}
		if = {
			limit = { has_country_flag = brazil_liberal }
			add_political_power = 50
			add_popularity = { ideology = centrism popularity = 0.01 }
			
		}
		if = {
			limit = { has_country_flag = brazil_conciliatory }
			add_political_power = 50
			add_popularity = { ideology = traditional_conservatism popularity = 0.005 }
			add_popularity = { ideology = centrism popularity = 0.005 }
			
		}
		if = {
			limit = { has_country_flag = brazil_ultraconservative }
			add_political_power = 50
			add_popularity = { ideology = radical_democracy popularity = 0.01 }
			
		}
	}

	option = { # It's a failure...
		name = brazil_votes_results.23.b
		trigger = {
			has_country_flag = eoanb_reform_vote_failure
		}
		clr_country_flag = eoanb_reform_vote_failure

			# Put here if the result is a failure

		set_variable = { 
			var = current_reform_id
			value = 0
		}
	}

	option = { # It's a tie.
		name = brazil_votes_results.23.c
		trigger = {
			has_country_flag = eoanb_reform_vote_tie
		}
		clr_country_flag = eoanb_reform_vote_tie

			# Put here if the result is a tie

		set_variable = { 
			var = current_reform_id
			value = 0
		}
	}
}

add_namespace = bahia

country_event = {
	id = bahia.1
	title = bahia.1.t
	desc = bahia.1.d
	picture = GFX_report_event_males_revolution

	#fire_only_once = yes
	is_triggered_only = yes
	
	option = {
		name = bahia.1.a
		ai_chance = { factor = 100 }

		hidden_effect = {
			499 = { add_core_of = BHA }
			1044 = { add_claim_by = BHA }
			1040 = { add_claim_by = BHA }
			498 = { add_claim_by = BHA }

			BHA = {
				activate_mission = BHA_mission_recruit_in_Bahia
				transfer_state = 499
				#set_province_controller = 10946
				load_oob = BHA_uprising
				if = { 
					limit = { 10946 = { is_capital = no } }
					set_capital = { state = 10946 }
				}

				activate_mission = Second_Males_Revolt_Peace_Treaty_Mission
			}

			BRA = {
				set_country_flag = bahia_revolution
		
				activate_mission = Second_Males_Revolt_Peace_Treaty_Mission
				declare_war_on = {
					target = BHA
					type = annex_everything
				}
				499 = {
					teleport_armies = {
						limit = { has_country_flag = bahia_revolution }
						to_province  = 4617
					}
				}
				set_province_controller = 4617
				set_province_controller = 5174
				set_province_controller = 5194
				set_province_controller = 5218
				set_province_controller = 8129
				set_province_controller = 8177
				set_province_controller = 8184
				set_province_controller = 8197
				set_province_controller = 8242
				set_province_controller = 10392
				set_province_controller = 10419
				set_province_controller = 10926
				set_province_controller = 11002
				set_province_controller = 12422
				set_province_controller = 14026
				set_province_controller = 14027
				set_province_controller = 14028
				set_province_controller = 14029
				set_province_controller = 14030
			}
		}
	}
}

country_event = {
	id = bahia.2
	title = bahia.2.t
	desc = bahia.2.d
	picture = GFX_report_event_males_revolt_recruitment

	#fire_only_once = yes
	is_triggered_only = yes
	
	option = {
		name = bahia.2.a
		ai_chance = { factor = 100 }
		BHA = {
			499 = {
				create_unit = {
					division = "name = \"2nd Cavalaria de Rebeldes Malês\" division_template = \"Companhia Fixa de Cavalaria Leve\" start_experience_factor = 0.1 start_equipment_factor = 0.85"
					owner = BHA
					prioritize_location = 14029
				}
				create_unit = {
					division = "name = \"2nd Infantaria de Rebeldes Malês\" division_template = \"Companhia Fixa de Caçadores\" start_experience_factor = 0.1 start_equipment_factor = 0.85"
					owner = BHA
					prioritize_location = 14027
				}
				create_unit = {
					division = "name = \"4th Infantaria de Rebeldes Malês\" division_template = \"Companhia Fixa de Caçadores\" start_experience_factor = 0.1 start_equipment_factor = 0.85"
					owner = BHA
					prioritize_location = 14026
				}
				create_unit = {
					division = "name = \"3rd Infantaria de Rebeldes Malês\" division_template = \"Companhia Fixa de Caçadores\" start_experience_factor = 0.1 start_equipment_factor = 0.85"
					owner = BHA
					prioritize_location = 14028
				}
			}
		}
	}
}

country_event = {
	id = bahia.3
	title = bahia.3.t
	desc = bahia.3.d
	picture = GFX_report_event_males_crushed
	is_triggered_only = yes

	immediate = {
		hidden_effect = {
			BRA = {
				remove_mission = Second_Males_Revolt_Peace_Treaty_Mission
				annex_country = {
					target = BHA
				}
			}
		}
	}
	option = {
		name = bahia.3.a
		add_stability = 0.05
		increase_ps_by_two = yes
		set_temp_variable = { political_legitimacy_change = 0.05 }
		eoanb_political_legitimacy_change = yes
		add_political_power = -20
		499 ={ remove_dynamic_modifier = { modifier = BRA_african_workers_strikes } }
	}
}

country_event = {
	id = bahia.4
	title = bahia.4.t
	desc = bahia.4.d
	picture = GFX_report_event_males_victory
	is_triggered_only = yes
	immediate = {
		hidden_effect = {
			BRA = {
				remove_mission = Second_Males_Revolt_Peace_Treaty_Mission
				annex_country = {
					target = BHA
					transfer_troops = yes
				}
			}
		}
	}
	option = {
		name = bahia.4.a
		add_stability = -0.05
		increase_ps_by_one = yes
		set_temp_variable = { political_legitimacy_change = -0.05 }
		eoanb_political_legitimacy_change = yes
		add_political_power = -100
		499 ={ remove_dynamic_modifier = { modifier = BRA_african_workers_strikes } }
		add_timed_idea = {
			idea = BRA_male_revolt_reparation
			days = 730
		}
	}
}

country_event = {
	id = bahia.5
	title = bahia.5.t
	desc = bahia.5.d
	picture = GFX_report_event_males_stalemate
	is_triggered_only = yes
	immediate = {
		hidden_effect = {
			BRA = {
				remove_mission = Second_Males_Revolt_Peace_Treaty_Mission
				annex_country = {
					target = BHA
					transfer_troops = yes
				}
			}
		}
	}
	option = {
		name = bahia.5.a
		increase_ps_by_one = yes
		add_political_power = -50
		499 ={ remove_dynamic_modifier = { modifier = BRA_african_workers_strikes } }
	}
}
