###########################
# Polish Events
###########################

add_namespace = russia2_romania

# Check if File is Loaded
country_event = {
	id = russia2_romania.2092066524

	hidden = yes

	is_triggered_only = yes

	immediate = {
		set_global_flag = russia_reworked_events_loaded_romanias
	}
}

# Soviet Union demands Bessarabia
country_event = {
	id = russia2_romania.1
	title = russia2_romania.1.t
	desc = russia2_romania.1.d
	picture = GFX_report_event_generic_read_write
	
	is_triggered_only = yes
	
	option = { # Accept demands
		name = russia2_romania.1.a
		ai_chance = {
			base = 90
			modifier = { # Don't accept if in a faction that can protect them
				factor = 0
				OR = {
					any_other_country = {
						is_major = yes
						NOT = { tag = SOV }
						OR = {
							is_in_faction_with = ROOT
							has_guaranteed = ROOT
						}
					}
					has_idea = anti_soviet_pact
				}
				is_historical_focus_on = no #Romania will still cede on historical
			}
		}
		SOV = {
			country_event = { days = 2 id = russia2_romania.2 }
		}
		hidden_effect = {
			news_event = { days = 3 id = newsrussia2.61 }
		}
		set_country_flag = bessarabia_ceded
		if = {
			limit = {
				any_country = {
					owns_state = 78
					NOT = {
						tag = ROOT
					}
				}
 			}
			custom_effect_tooltip = SOV_romania_is_subject_tt
		}
	}
	option = { # Refuse
		name = russia2_romania.1.b
		ai_chance = {
			base = 0
			modifier = {
				add = 10
				is_in_faction = yes
				NOT = { is_in_faction_with = SOV }
			}
			modifier = {
				is_historical_focus_on = yes
				factor = 0
			}
		}
		SOV = {
			country_event = { days = 2 id = russia2_romania.3 }
			effect_tooltip = {
				create_wargoal = {
					type = take_state
					target = ROOT
					generator = { 78 80 766 }
				}
			}
		}
		hidden_effect = {
			news_event = { days = 3 id = newsrussia2.62 }
		}
		if = {
			limit = {
				any_country = {
					owns_state = 78
					NOT = {
						tag = ROOT
					}
				}
 			}
			custom_effect_tooltip = SOV_romania_is_subject_tt
		}
	}
}

# Romania surrenders Bessarabia
country_event = {
	id = russia2_romania.2
	title = russia2_romania.2.t
	desc = russia2_romania.2.d
	picture = GFX_report_event_soviet_army_greeted
	
	is_triggered_only = yes
	
	option = {
		name = russia2_romania.2.a
		ai_chance = {
			base = 100
		}
		transfer_state = 78
		if = {
			limit = {
				OR = {
					FROM = {
						OR = {
							owns_state = 80
							controls_state = 80
						}
					}
					any_country = {
						is_subject_of = FROM
						OR = {
							owns_state = 80
							controls_state = 80
						}
					}
				}
			}
			transfer_state = 80
		}
		if = {
			limit = {
				OR = {
					FROM = {
						OR = {
							owns_state = 766
							controls_state = 766
						}
					}
					any_country = {
						is_subject_of = FROM
						OR = {
							owns_state = 766
							controls_state = 766
						}
					}
				}
			}
			transfer_state = 766
		}
	}
}

# Romania refuses to surrender Bessarabia
country_event = {
	id = russia2_romania.3
	title = russia2_romania.3.t
	desc = russia2_romania.3.d
	picture = GFX_report_event_stalin_02
	
	is_triggered_only = yes
	
	option = {
		name = russia2_romania.3.a
		ai_chance = {
			base = 100
		}
		if = {
			limit = {
				any_country = {
					is_subject_of = FROM
					OR = {
						owns_state = 78
						controls_state = 78
						owns_state = 766
						controls_state = 766
						owns_state = 79
						controls_state = 79
					}
				}
			}
			every_country = {
				limit = {
					is_subject_of = FROM
					OR = {
						owns_state = 78
						controls_state = 78
						owns_state = 766
						controls_state = 766
						owns_state = 79
						controls_state = 79
					}
				}
				ROOT = {
					create_wargoal = {
						type = take_state
						target = PREV
						generator = { 78 80 766 }
					}
				}
			}
		}
		create_wargoal = {
			type = take_state
			target = FROM
			generator = { 78 80 766 }
		}
	}
}

#SOV Demands Oil
country_event = {
	id = russia2_romania.4
	title = russia2_romania.4.t
	desc = russia2_romania.4.d
	picture = GFX_report_event_physics_lab_02
	
	is_triggered_only = yes
	
	#Ok ok
	option = {
		name = russia2_romania.4.a
		ai_chance = {
			base = 50
		}
		give_resource_rights = { receiver = SOV state = 46 }
		add_political_power = 50
		custom_effect_tooltip = may_cancel_sov_oil_but_danger
		SOV = {
			country_event = { id = russia2_romania.5 days = 1 }
		}
		set_country_flag = giving_46_rights_to_sov
	}

	#We refuse D:
	option = {
		name = russia2_romania.4.b
		ai_chance = {
			base = 50
		}
		SOV = {
			country_event = { id = russia2_romania.6 days = 1 }
		}
	}
}

#Romania Accepts
country_event = {
	id = russia2_romania.5
	title = russia2_romania.5.t
	desc = russia2_romania.5.d
	picture = GFX_report_event_rom_mistress
	
	is_triggered_only = yes
	
	#Good
	option = {
		name = russia2_romania.5.a
		ai_chance = {
			base = 100
		}
		custom_effect_tooltip = sov_get_resources_in_state_46
		give_guarantee = FROM
		set_country_flag = sov_receiving_46_rights
	}
}

#Romania Refuses
country_event = {
	id = russia2_romania.6
	title = russia2_romania.6.t
	desc = russia2_romania.6.d
	picture = GFX_report_event_soldiers_marching
	
	is_triggered_only = yes
	
	#Fine
	option = {
		name = russia2_romania.6.a
		ai_chance = {
			base = 60
		}
		add_political_power = 50
		FROM = {
			country_event = { id = russia2_romania.7 days = 1 }
		}
	}

	#War
	option = {
		name = russia2_romania.6.b
		ai_chance = {
			base = 40
		}
		create_wargoal = {
			type = take_state_focus
			target = FROM
			expire = 0
			generator = { 78 80 79 46 77 }
		}
		FROM = {
			country_event = { id = russia2_romania.8 days = 1 }
		}
	}

	#Ask overlord
	option = {
		name = russia2_romania.6.c
		ai_chance = {
			base = 100
		}
		trigger = {
			FROM = {
				is_subject = yes
			}
		}
		FROM = {
			OVERLORD = {
				country_event = { id = russia2_romania.9 days = 1 }
			}
		}
	}
}

#SOV Backs down
country_event = {
	id = russia2_romania.7
	title = russia2_romania.7.t
	desc = russia2_romania.7.d
	picture = GFX_report_event_royal_parade
	
	is_triggered_only = yes
	
	#Good
	option = {
		name = russia2_romania.7.a
		ai_chance = {
			base = 100
		}
		add_political_power = 50
	}
}

#SOV Mobilizes
country_event = {
	id = russia2_romania.8
	title = russia2_romania.8.t
	desc = russia2_romania.8.d
	picture = GFX_report_event_soldiers_marching
	
	is_triggered_only = yes
	
	#Oops
	option = {
		name = russia2_romania.8.a
		ai_chance = {
			base = 100
		}
	}
}

#SOV Asks for [STATE]46 Oil
country_event = {
	id = russia2_romania.9
	title = russia2_romania.9.t
	desc = russia2_romania.9.d
	picture = GFX_report_event_polish_tanks_01
	
	is_triggered_only = yes
	
	#It's just a puppet who cares
	option = {
		name = russia2_romania.9.a
		ai_chance = {
			base = 60
		}
		give_resource_rights = { receiver = SOV state = 46 }
		SOV = {
			country_event = { id = russia2_romania.10 days = 1 }
		}
		set_country_flag = giving_46_rights_to_sov
	}

	#Come and get it!
	option = {
		name = russia2_romania.9.a
		ai_chance = {
			base = 40
		}
		SOV = {
			country_event = { id = russia2_romania.11 days = 1 }
		}
	}
}

#FROM OVERLORD ACCEPTS
country_event = {
	id = russia2_romania.10
	title = russia2_romania.10.t
	desc = russia2_romania.10.d
	picture = GFX_report_event_por_salazar_military
	
	is_triggered_only = yes
	
	#Good
	option = {
		name = russia2_romania.10.a
		ai_chance = {
			base = 100
		}
		custom_effect_tooltip = sov_get_resources_in_state_46
		set_country_flag = sov_receiving_46_rights
	}
}

#FROM OVERLORD REFUSES
country_event = {
	id = russia2_romania.11
	title = russia2_romania.11.t
	desc = russia2_romania.11.d
	picture = GFX_report_event_soviet_tank_parade
	
	is_triggered_only = yes
	
	#Ok then
	option = {
		name = russia2_romania.11.a
		ai_chance = {
			base = 100
		}
		hidden_effect = {
			every_other_country = {
				limit = {
					OR = {
						owns_state = 46
						controls_state = 46
						is_subject_of = FROM
					}
				}
				ROOT = {
					create_wargoal = {
						type = take_state_focus
						target = PREV
						expire = 0
						generator = { 78 80 79 46 77 }
					}
				}
			}
		}
		create_wargoal = {
			type = puppet_wargoal_focus
			target = FROM
			expire = 0
		}
	}
}

#Romania cancels resource rights
country_event = {
	id = russia2_romania.12
	title = russia2_romania.12.t
	desc = russia2_romania.12.d
	picture = GFX_report_event_soviet_tanks
	
	is_triggered_only = yes
	
	#We don't have time for this
	option = {
		name = russia2_romania.12.a
		ai_chance = {
			base = 70
		}
		FROM = {
			country_event = { id = russia2_romania.13 days = 1 }
		}
	}

	#Ultimatum
	option = {
		name = russia2_romania.12.b
		ai_chance = {
			base = 30
		}
		custom_effect_tooltip = sov_might_lead_to_war_with_from
		FROM = {
			country_event = { id = russia2_romania.14 days = 1 }
		}
	}
}

#SOV doesn't care
country_event = {
	id = russia2_romania.13
	title = russia2_romania.13.t
	desc = russia2_romania.13.d
	picture = GFX_cavalry_parade_russia2
	
	is_triggered_only = yes
	
	#Good
	option = {
		name = russia2_romania.13.a
		ai_chance = {
			base = 100
		}
		add_political_power = 100
	}
}

#SOV sends ultimatum
country_event = {
	id = russia2_romania.14
	title = russia2_romania.14.t
	desc = russia2_romania.14.d
	picture = GFX_menacing_tanks_russia2
	
	is_triggered_only = yes
	
	#Accept
	option = {
		name = russia2_romania.14.a
		ai_chance = {
			base = 60
		}
		SOV = {
			country_event = { id = russia2_romania.15 days = 1 }
		}
		set_country_flag = giving_46_rights_to_sov_again
	}

	#Refuse
	option = {
		name = russia2_romania.14.b
		ai_chance = {
			base = 40
		}
		custom_effect_tooltip = sov_will_lead_to_war_with_from
		SOV = {
			country_event = { id = russia2_romania.16 days = 1 }
		}
	}
}

#Romania Accepts Ultimatum
country_event = {
	id = russia2_romania.15
	title = russia2_romania.15.t
	desc = russia2_romania.15.d
	picture = GFX_soldiers_handshaking_kolchak_russia2
	
	is_triggered_only = yes
	
	#Great
	option = {
		name = russia2_romania.15.a
		ai_chance = {
			base = 100
		}
		puppet = FROM
		hidden_effect = {
			FROM = {
				set_popularities = {
					democratic = 70
					neutrality = 10
					fascism = 10
					communism = 10
				}
			}
		}
		custom_effect_tooltip = sov_get_resources_in_state_46
		set_country_flag = sov_receiving_46_rights_again
	}
}

#Romania refuses ultimatum
country_event = {
	id = russia2_romania.16
	title = russia2_romania.16.t
	desc = russia2_romania.16.d
	picture = GFX_military_parade_russia2
	
	is_triggered_only = yes
	
	#Killing time
	option = {
		name = russia2_romania.16.a
		ai_chance = {
			base = 100
		}
		declare_war_on = {
			target = FROM
			type = puppet_wargoal_focus
		}
	}
}

# Ukraine demands Bessarabia
country_event = {
	id = russia2_romania.17
	title = russia2_romania.17.t
	desc = russia2_romania.17.d
	picture = GFX_report_event_generic_read_write
	
	is_triggered_only = yes
	
	option = { # Accept demands
		name = russia2_romania.17.a
		ai_chance = {
			base = 90
			modifier = {
				factor = 10
				any_other_country = {
					is_major = yes
					NOT = { tag = UKR }
					OR = {
						is_in_faction_with = ROOT
						has_guaranteed = ROOT
					}
				}
			}
		}
		UKR = {
			country_event = { days = 2 id = russia2_romania.18 }
		}
		if = {
			limit = {
				any_country = {
					owns_state = 78
					is_subject_of = ROOT
					NOT = {
						tag = ROOT
					}
				}
 			}
			custom_effect_tooltip = UKR_romania_is_subject_tt
		}
		else_if = {
			limit = {
				any_country = {
					owns_state = 766
					is_subject_of = ROOT
					NOT = {
						tag = ROOT
					}
				}
 			}
			custom_effect_tooltip = UKR_romania_is_subject_tt2
		}
		else_if = {
			limit = {
				any_country = {
					owns_state = 79
					is_subject_of = ROOT
					NOT = {
						tag = ROOT
					}
				}
 			}
			custom_effect_tooltip = UKR_romania_is_subject_tt3
		}
	}
	option = { # Refuse
		name = russia2_romania.17.b
		ai_chance = {
			base = 10
			modifier = {
				add = 80
				any_other_country = {
					is_major = yes
					NOT = { tag = UKR }
					OR = {
						is_in_faction_with = ROOT
						has_guaranteed = ROOT
					}
				}
			}
		}
		UKR = {
			country_event = { days = 2 id = russia2_romania.19 }
			effect_tooltip = {
				create_wargoal = {
					type = take_state
					target = ROOT
					generator = { 78 80 766 79 }
				}
			}
		}
		if = {
			limit = {
				UKR = {
					is_subject = yes
				}
			}
			UKR = {
				OVERLORD = {
					country_event = { days = 2 id = russia2_romania.20 }
					effect_tooltip = {
						create_wargoal = {
							type = take_state
							target = ROOT
							generator = { 78 80 766 79 }
						}
					}
				}
			}
		}
		if = {
			limit = {
				any_country = {
					owns_state = 78
					is_subject_of = ROOT
					NOT = {
						tag = ROOT
					}
				}
 			}
			custom_effect_tooltip = UKR_romania_is_subject_tt
		}
		else_if = {
			limit = {
				any_country = {
					owns_state = 766
					is_subject_of = ROOT
					NOT = {
						tag = ROOT
					}
				}
 			}
			custom_effect_tooltip = UKR_romania_is_subject_tt2
		}
		else_if = {
			limit = {
				any_country = {
					owns_state = 79
					is_subject_of = ROOT
					NOT = {
						tag = ROOT
					}
				}
 			}
			custom_effect_tooltip = UKR_romania_is_subject_tt3
		}
	}
}

# Romania surrenders Bessarabia
country_event = {
	id = russia2_romania.18
	title = russia2_romania.18.t
	desc = russia2_romania.18.d
	picture = GFX_report_event_soviet_army_greeted
	
	is_triggered_only = yes
	
	option = {
		name = russia2_romania.18.a
		ai_chance = {
			base = 100
		}
		if = {
			limit = {
				OR = {
					FROM = {
						OR = {
							owns_state = 78
							controls_state = 78
						}
					}
					any_country = {
						is_subject_of = FROM
						OR = {
							owns_state = 78
							controls_state = 78
						}
					}
				}
			}
			transfer_state = 78
		}
		if = {
			limit = {
				OR = {
					FROM = {
						OR = {
							owns_state = 80
							controls_state = 80
						}
					}
					any_country = {
						is_subject_of = FROM
						OR = {
							owns_state = 80
							controls_state = 80
						}
					}
				}
			}
			transfer_state = 80
		}
		if = {
			limit = {
				OR = {
					FROM = {
						OR = {
							owns_state = 766
							controls_state = 766
						}
					}
					any_country = {
						is_subject_of = FROM
						OR = {
							owns_state = 766
							controls_state = 766
						}
					}
				}
			}
			transfer_state = 766
		}
		if = {
			limit = {
				OR = {
					FROM = {
						OR = {
							owns_state = 79
							controls_state = 766
						}
					}
					any_country = {
						is_subject_of = FROM
						OR = {
							owns_state = 79
							controls_state = 79
						}
					}
				}
			}
			transfer_state = 79
		}
	}
}

# Romania refuses to surrender Bessarabia
country_event = {
	id = russia2_romania.19
	title = russia2_romania.19.t
	desc = russia2_romania.19.d
	picture = GFX_report_event_stalin_02
	
	is_triggered_only = yes
	
	option = {
		name = russia2_romania.19.a
		ai_chance = {
			base = 100
		}
		if = {
			limit = {
				any_country = {
					is_subject_of = FROM
					OR = {
						owns_state = 78
						controls_state = 78
						owns_state = 766
						controls_state = 766
						owns_state = 79
						controls_state = 79
					}
				}
			}
			every_country = {
				limit = {
					is_subject_of = FROM
					OR = {
						owns_state = 78
						controls_state = 78
						owns_state = 766
						controls_state = 766
						owns_state = 79
						controls_state = 79
					}
				}
				ROOT = {
					create_wargoal = {
						type = take_state
						target = PREV
						generator = { 78 80 766 79 }
					}
				}
			}
		}
		create_wargoal = {
			type = take_state
			target = FROM
			generator = { 78 80 766 79 }
		}
	}
}

# Romania refuses to surrender Bessarabia to Ukraine
country_event = {
	id = russia2_romania.20
	title = russia2_romania.20.t
	desc = russia2_romania.20.d
	picture = GFX_report_event_stalin_02
	
	is_triggered_only = yes
	
	# Kill em
	option = {
		name = russia2_romania.20.a
		ai_chance = {
			base = 50
			modifier = {
				add = 50
				strength_ratio = {
					tag = FROM
					ratio > 1
				}
			}
		}
		if = {
			limit = {
				UKR = {
					is_subject_of = ROOT
				}
			}
			if = {
				limit = {
					any_country = {
						is_subject_of = FROM
						OR = {
							owns_state = 78
							controls_state = 78
							owns_state = 766
							controls_state = 766
							owns_state = 79
							controls_state = 79
						}
					}
				}
				every_country = {
					limit = {
						is_subject_of = FROM
						OR = {
							owns_state = 78
							controls_state = 78
							owns_state = 766
							controls_state = 766
							owns_state = 79
							controls_state = 79
						}
					}
					ROOT = {
						create_wargoal = {
							type = take_core_state
							target = PREV
						}
					}
				}
			}
			create_wargoal = {
				type = take_core_state
				target = FROM
			}
			UKR = {
				country_event = russia2_romania.21
			}
		}
	}

	# Whatever
	option = {
		name = russia2_romania.20.a
		ai_chance = {
			base = 50
			modifier = {
				add = -50
				strength_ratio = {
					tag = FROM
					ratio > 1
				}
			}
		}
		if = {
			limit = {
				UKR = {
					is_subject_of = ROOT
				}
			}
			UKR = {
				country_event = russia2_romania.22
			}
		}
	}
}

# OVERLORD Supports our Claims
country_event = {
	id = russia2_romania.21
	title = russia2_romania.21.t
	desc = russia2_romania.21.d
	picture = GFX_report_event_stalin_02
	
	is_triggered_only = yes
	
	# Okay
	option = {
		name = russia2_romania.21.a
		ai_chance = {
			base = 100
		}
	}
}

# OVERLORD Doesn't Care
country_event = {
	id = russia2_romania.22
	title = russia2_romania.22.t
	desc = russia2_romania.22.d
	picture = GFX_report_event_stalin_02
	
	is_triggered_only = yes
	
	# Tf
	option = {
		name = russia2_romania.22.a
		ai_chance = {
			base = 100
		}
	}
}