###########################
# Romanian Events
###########################

add_namespace = romania

# Soviet Union demands Bessarabia
country_event = {
	id = romania.1
	title = romania.1.t
	desc = romania.1.d
	picture = GFX_report_event_generic_read_write
	
	is_triggered_only = yes
	
	option = { # Accept demands
		name = romania.1.a
		ai_chance = {
			factor = 90
			modifier = { # Don't accept if in a faction that can protect them
				factor = 0
				has_war_with = FROM
				NOT = { is_in_faction_with = FROM }
				OR = {
					any_other_country = {
						is_major = yes
						NOT = { tag = SOV }
						OR = {
							is_in_faction_with = ROM
							has_guaranteed = ROM
						}
					}
					has_idea = anti_soviet_pact
				}
			}
			modifier = {
				factor = 0.1
				is_historical_focus_on = no #Romania will still cede on historical
			}
		}
		FROM = {
			country_event = { days = 1 id = soviet.4 }
		}
		set_country_flag = bessarabia_ceded
	}

	option = { # Refuse
		name = romania.1.b
		ai_chance = {
			base = 0
			modifier = {
				add = 10
				is_in_faction = yes
				NOT = { is_in_faction_with = FROM }
			}

			modifier = {
				add = 100
				has_war_with = FROM
			}
			modifier = {
				is_historical_focus_on = yes
				NOT = {has_war_with = FROM}
				factor = 0
			}
			modifier = {
				factor = 0
				is_in_faction_with = FROM
			}
		}
		FROM = {
			country_event = { days = 1 id = soviet.5 }
			effect_tooltip = {
				create_wargoal = {
					type = take_state
					target = ROOT
					generator = { 78 1291 1092 80 766 }
				}
			}
		}
	}
}

# Second Vienna Award - Northern Transylvania
country_event = {
	id = romania.2
	title = romania.2.t
	desc = romania.2.d
	picture = GFX_report_event_second_vienna_award_pact
	
	is_triggered_only = yes
	
	option = { # Accept demands
		name = romania.2.a
		ai_chance = {
			factor = 80
			modifier = { # Don't accept if in a faction that can protect them
				factor = 0
				OR = {
					is_in_faction_with = ENG
					is_in_faction_with = FRA
					is_in_faction_with = SOV
				}
			}
		}
		HUN = {
			country_event = { 
				days = 1 
				id = hungary.2 
			}
		}
		set_country_flag = second_vienna_accepted_north
	}
	option = { # Refuse
		name = romania.2.b
		ai_chance = { 
			factor = 20 
			modifier = {
				factor = 0
				is_historical_focus_on = yes
			}
		}
		HUN = {
			country_event = { days = 1 id = hungary.4 }
			effect_tooltip = { 
				add_state_claim = 76
				add_state_claim = 1309
				add_state_claim = 1310
				add_state_claim = 1039 
			}
		}
		GER = {
			country_event = { days = 1 id = germany.21 }
			effect_tooltip = {
				create_wargoal = {
					type = take_state
					target = ROM
					generator = { 76 1309 1310 1039 }
				}
			}
		}
	}
}

# Second Vienna Award - All of Transylvania
country_event = {
	id = romania.3
	title = romania.2.t
	desc = romania.3.d
	picture = GFX_report_event_second_vienna_award_pact
	
	is_triggered_only = yes
	
	option = { # Accept demands
		name = romania.2.a
		ai_chance = {
			factor = 50
			modifier = { # Don't accept if in a faction that can protect them
				factor = 0
				OR = {
					is_in_faction_with = ENG
					is_in_faction_with = FRA
					is_in_faction_with = SOV
				}
			}
		}
		HUN = {
			country_event = { days = 1 id = hungary.3 }
		}
		set_country_flag = second_vienna_accepted_all
	}
	option = { # Refuse
		name = romania.2.b
		ai_chance = { factor = 50 }
		HUN = {
			country_event = { days = 1 id = hungary.5 }
			effect_tooltip = {
				add_state_claim = 76
				add_state_claim = 1309
				add_state_claim = 1310
				add_state_claim = 1039
				add_state_claim = 83
				add_state_claim = 1479
				add_state_claim = 1480
				add_state_claim = 84
				add_state_claim = 1387
			}
		}
		GER = {
			country_event = { days = 1 id = germany.21 }
			effect_tooltip = {
				create_wargoal = {
					type = take_state
					target = ROM
					generator = { 76 1309 1310 1039 83 1479 1480 84 1387 }
				}
			}
		}
	}
}

# Second Vienna Award - No Concessions
country_event = {
	id = romania.4
	title = romania.4.t
	desc = romania.4.d
	picture = GFX_report_event_germany_politician_handshake
	
	is_triggered_only = yes
	
	option = {
		name = romania.4.a
	}
}

# Treaty of Craiova - Bulgaria Demands Territory
country_event = {
	id = romania.5
	title = romania.5.t
	desc = romania.5.d
	picture = [GetHitlerCroatianHandshakeEventPicture]
	
	is_triggered_only = yes
	
	option = { # Accept
		name = romania.5.a
		ai_chance = { factor = 90 }
		effect_tooltip = {
			BUL = { transfer_state = 77 }
		}
		BUL = {
			country_event = { days = 1 id = bulgaria.1 }
		}
	}
	option = { # Refuse
		name = romania.5.b
		ai_chance = { 
			factor = 10
			modifier = {
				factor = 0
				is_historical_focus_on = yes
			} 
		}
		BUL = {
			country_event = { days = 1 id = bulgaria.2 }
		}
	}
}

# Seek an alliance - Since everyone is out to get us
country_event = {
	id = romania.6
	title = romania.6.t
	desc = romania.6.d
	picture = GFX_report_event_generic_croatia_handshake
	
	trigger = {
		has_country_flag = bessarabia_ceded
		is_in_faction = no
		NOT = { GER = { is_in_faction_with = SOV } }
		NOT = { has_war_with = GER }
		NOT = { has_war_with = SOV }
		NOT = { has_dlc = "Death or Dishonor" }
	}
	
	mean_time_to_happen = { days = 7 }

	fire_only_once = yes

	option = { # Seek german alliance
		name = romania.6.a
		set_politics = {
			ruling_party = fascism
			elections_allowed = no
		}
		add_popularity = {
			ideology = fascism
			popularity = 0.35
		}
		add_opinion_modifier = { target = GER modifier = ROM_seek_alliance_GER }
		add_ideas = ROM_revenge_against_soviet
		ai_chance = { 
			base = 2
			modifier = {
				factor = 0
				has_war_with = GER
			}
		}
	}
	option = { # Seek soviet alliance
		name = romania.6.b
		set_politics = {
			ruling_party = communism
			elections_allowed = no
		}
		add_popularity = {
		ideology = communism
			popularity = 0.5
		}
		add_opinion_modifier = { target = SOV modifier = ROM_seek_alliance_SOV }
		add_ideas = ROM_revenge_against_germany
		ai_chance = {
			base = 1
			modifier = {
				factor = 0
				NOT = { has_war_with = GER }
				has_war_with = SOV
			}
			modifier = {
				factor = 0
				is_historical_focus_on = yes
				NOT = { has_war_with = GER }
			}
		}
	}
	option = { # Dear democracy... NEVER GONNA GIVE YOU UP!
		name = romania.6.c
		ai_chance = {
			base = 0
		}
		
	}
}