namespace = dvg_granada

# War of Independence
dvg_granada.1 = {
	type = country_event
	placement = ROOT

	title = dvg_granada.1.t
	desc = dvg_granada.1.d
	flavor = dvg_granada.1.f
	
	event_image = {
		video = "gfx/event_pictures/southamerica_war_civilians.bk2"
	}

	on_created_soundeffect = "event:/SFX/UI/Alerts/event_appear"
	on_opened_soundeffect = "event:/SFX/Events/southamerica/war_civilians"

	icon = "gfx/interface/icons/event_icons/event_fire.dds"

	duration = 3

	trigger = {
	}
	
	
	# For Spain!
	option = {
		name = dvg_granada.1.a
		default_option = yes
		add_journal_entry = {
			type = je_caladeran_war_of_independence_granada
		}
		add_loyalists = {
			value = 0.1
			culture = cu:granadan
		}
		ai_chance = {
			base = 1
		}
	}
}

# War of Independence Succeeds! Granada
dvg_granada.2 = {
	type = country_event
	placement = ROOT

	title = dvg_granada.2.t
	desc = dvg_granada.2.d
	flavor = dvg_granada.2.f
	
	event_image = {
		video = "gfx/event_pictures/southamerica_aristocrats.bk2"
	}

	on_created_soundeffect = "event:/SFX/UI/Alerts/event_appear"
	on_opened_soundeffect = "event:/SFX/Events/southamerica/aristocrats"

	icon = "gfx/interface/icons/event_icons/event_fire.dds"

	duration = 3

	trigger = {
	}
	
	
	# Independence!
	option = {
		name = dvg_granada.2.a
		default_option = yes
		add_loyalists = {
			value = 0.1
		}
		ig:ig_rural_folk = {
				add_ruling_interest_group = yes
				add_modifier = {
                    name = dvg_approval_buff
                    days = 730
                    is_decaying = yes
				}
		}		
		c:SPA = {
			remove_diplomatic_pact = {
				country = c:GRA
				type = puppet
			}
		}
		change_relations = {
			country = c:SPA
			value = -50
		}
		hidden_effect = {
			if = {
				limit = {
					has_law = law_type:law_monarchy
				}
				activate_law = law_type:law_presidential_republic
			}
		}
		ai_chance = {
			base = 1
		}
	}

	#We shall stick with spain!
	option = {
		name = dvg_granada.2.b
		add_radicals = {
			value = 0.1
		}
		hidden_effect = {
			c:SPA = {
				remove_diplomatic_pact = {
					country = c:GRA
					type = puppet
				}
			}
		}
		c:SPA = {
			create_diplomatic_pact = {
				country = c:GRA
				type = dominion
			}
		}
		ai_chance = {
			base = 0
		}
	}
}

# War of Independence Fails! Granada
dvg_granada.3 = {
	type = country_event
	placement = ROOT

	title = dvg_granada.3.t
	desc = dvg_granada.3.d
	flavor = dvg_granada.3.f
	
	event_image = {
		video = "gfx/event_pictures/southamerica_aristocrats.bk2"
	}

	on_created_soundeffect = "event:/SFX/UI/Alerts/event_appear"
	on_opened_soundeffect = "event:/SFX/Events/southamerica/aristocrats"

	icon = "gfx/interface/icons/event_icons/event_fire.dds"

	duration = 3

	trigger = {
	}
	

	#We shall stick with spain!
	option = {
		name = dvg_granada.3.a
		add_loyalists = {
			value = 0.1
		}
		hidden_effect = {
			c:SPA = {
				remove_diplomatic_pact = {
					country = c:GRA
					type = puppet
				}
			}
		}
		c:SPA = {
			create_diplomatic_pact = {
				country = c:GRA
				type = dominion
			}
		}
		ai_chance = {
			base = 0
		}
	}
}