﻿
# Britain claims Portuguese colonies with a national focus

add_namespace = a_p_war

# Portugal gets notice that Britain claims her African colonies
	
country_event = {
	id = a_p_war.1
	title = a_p_war1title
	desc = a_p_war1desc
	picture = GFX_report_event_generic_read_write
	
	is_triggered_only = yes	
	
	option = {
		name = a_p_war1opt
	}
}

# Portugal offers peace after losing control of African colonies

country_event = {
	id = a_p_war.2
	title = a_p_war2title
	desc = a_p_war2desc
	picture = GFX_report_event_generic_read_write
	
	fire_only_once = yes
	
	trigger = {
		tag = POR
		has_war_with = ENG
		is_in_faction = no
		547 = { is_controlled_by = ENG } # Mombasa, Kenya
		547 = { is_owned_by = POR }
		545 = { is_controlled_by = ENG } # Salisbury, Rhodesia
		545 = { is_owned_by = POR }
		540 = { is_controlled_by = ENG } # Luanda, Angola
		540 = { is_owned_by = POR }
	}
	
	mean_time_to_happen = {
		days = 1
	}
	
	option = {
		name = a_p_war2opt
		ENG = { country_event = { id = a_p_war.3 } }
	}
	
}

# Britain gets the peace offer and can accept, or extend the CB

country_event = {
	id = a_p_war.3
	title = a_p_war3title
	desc = a_p_war3desc
	picture = GFX_report_event_generic_read_write
	
	is_triggered_only = yes	
	
	option = {
		name = a_p_war3opta
		
		white_peace = POR
		
		set_state_owner = 540
		set_state_owner = 545
		set_state_owner = 544
		set_state_owner = 546
		set_state_owner = 547
		set_state_owner = 548
		
		hidden_effect = {
			news_event = { days = 1 id = a_p_war.4 }
		}

		ai_chance = {
			factor = 1
			modifier = {
				factor = 10
				any_enemy_country = {
					is_major = yes
				}
			}
		}
	}
	
	option = {
		name = a_p_war3optb
		
		add_state_claim = 296
		
		set_global_flag = great_britain_rejects_portuguese_treaty
		
		hidden_effect = {
			news_event = { days = 1 id = a_p_war.5 }
		}
		
		ai_chance = {
			factor = 1
			modifier = {
				factor = 2
				296 = { is_controlled_by = ENG } # Portuguese West Africa
			}
			modifier = {
				factor = 2
				321 = { is_controlled_by = ENG } # Goa, India
			}
			modifier = {
				factor = 2
				321 = { is_controlled_by = RAJ } # Goa, India
			}
			modifier = {
				factor = 2
				425 = { is_controlled_by = ENG } # Mysore, India
			}
			modifier = {
				factor = 2
				425 = { is_controlled_by = RAJ } # Mysore, India
			}
			modifier = {
				factor = 2
				112 = { is_controlled_by = ENG } # Porto
			}
			modifier = {
				factor = 2
				180 = { is_controlled_by = ENG } # Lisbon
			}
		}
	}
}

# Britain accepted treaty with Portugal (Africa only)

news_event = {
	id = a_p_war.4
	title = a_p_war4title
	desc = a_p_war4desc
	
	picture = GFX_news_event_generic_sign_treaty1
	
	major = yes
	
	is_triggered_only = yes
	
	option = {
		name = a_p_war4opta
		trigger = {
			NOT = {
				TAG = POR
				TAG = ENG
			}
		}
	}
	option = {
		name = a_p_war4optb
		trigger = { TAG = ENG }
	}
	option = {
		name = a_p_war4optc
		trigger = { TAG = POR }
	}
}

# Britain rejected treaty with Portugal (Africa only)

news_event = {
	id = a_p_war.5
	title = a_p_war5title
	desc = a_p_war5desc
	
	picture = GFX_news_event_038
	
	major = yes
	
	is_triggered_only = yes
	
	option = {
		name = a_p_war5opta
		trigger = {
			NOT = {
				TAG = POR
				TAG = ENG
			}
		}
	}
	option = {
		name = a_p_war5optb
		trigger = { TAG = ENG }
	}
	option = {
		name = a_p_war5optc
		trigger = { TAG = POR }
	}
}

# Portugal loses West Africa and Goa as well

country_event = {
	id = a_p_war.6
	title = a_p_war6title
	desc = a_p_war6desc
	picture = GFX_report_event_generic_read_write
	
	fire_only_once = yes
	
	trigger = {
		tag = POR
		has_war_with = ENG
		has_global_flag = great_britain_rejects_portuguese_treaty
		is_in_faction = no
		547 = { is_controlled_by = ENG } # Mombasa, Kenya
		547 = { is_owned_by = POR }
		545 = { is_controlled_by = ENG } # Salisbury, Rhodesia
		545 = { is_owned_by = POR }
		540 = { is_controlled_by = ENG } # Luanda, Angola
		540 = { is_owned_by = POR }
		296 = { is_controlled_by = ENG } # Portuguese West Africa
		296 = { is_owned_by = POR }
		OR = {
			321 = { is_controlled_by = ENG } # Goa
			321 = { is_controlled_by = RAJ }
		}
		321 = { is_owned_by = NEP }
		OR = {
			425 = { is_controlled_by = ENG } # Mysore
			425 = { is_controlled_by = RAJ }
		}
		425 = { is_owned_by = NEP }
	}
	
	mean_time_to_happen = {
		days = 1
	}
	
	option = {
		name = a_p_war6opt
		ENG = { country_event = { id = a_p_war.7 } }
	}
	
}

# Britain can accept Goa and Africa or pursue a normal peace treaty within the game mechanics

country_event = {
	id = a_p_war.7
	title = a_p_war7title
	desc = a_p_war7desc
	picture = GFX_report_event_generic_read_write
	
	is_triggered_only = yes	
	
	option = {
		name = a_p_war7opta
		
		white_peace = POR
		
		set_state_owner = 540
		set_state_owner = 545
		set_state_owner = 544
		set_state_owner = 546
		set_state_owner = 547
		set_state_owner = 548
		set_state_owner = 296
				
		if = {
			limit = { NEP = { is_subject_of = POR } }
			RAJ ={
				annex_country = { target = NEP }
			}
		}
		
		hidden_effect = {
			news_event = { days = 1 id = a_p_war.8 }
		}

		ai_chance = {
			factor = 3
			modifier = {
				factor = 10
				any_enemy_country = {
					is_major = yes
				}
			}
		}
	}
	
	option = {
		name = a_p_war7optb
		
		create_wargoal = {
			type = puppet_wargoal_focus
			target = POR
		}
		
		if = {
			limit = {
				country_exists = NEP
				NEP = { is_subject_of = POR }
			}
			create_wargoal = {
				type = annex_everything
				target = NEP
			}
		}
		
		hidden_effect = {
			news_event = { days = 1 id = a_p_war.9 }
		}
		
		ai_chance = {
			factor = 1
			modifier = {
				factor = 5
				112 = { is_controlled_by = ENG } # Porto
			}
			modifier = {
				factor = 5
				180 = { is_controlled_by = ENG } # Lisbon
			}
		}
	}
}

# Britain accepted treaty with Portugal (Africa and India)

news_event = {
	id = a_p_war.8
	title = a_p_war8title
	desc = a_p_war8desc
	
	picture = GFX_news_event_generic_sign_treaty1
	
	major = yes
	
	is_triggered_only = yes
	
	option = {
		name = a_p_war8opta
		trigger = {
			NOT = {
				TAG = POR
				TAG = ENG
			}
		}
	}
	option = {
		name = a_p_war8optb
		trigger = { TAG = ENG }
	}
	option = {
		name = a_p_war8optc
		trigger = { TAG = POR }
	}
}

# Britain rejected treaty with Portugal (Africa and India)

news_event = {
	id = a_p_war.9
	title = a_p_war9title
	desc = a_p_war9desc
	
	picture = GFX_news_event_038
	
	major = yes
	
	is_triggered_only = yes
	
	option = {
		name = a_p_war9opta
		trigger = {
			NOT = {
				TAG = POR
				TAG = ENG
			}
		}
	}
	option = {
		name = a_p_war9optb
		trigger = { TAG = ENG }
	}
	option = {
		name = a_p_war9optc
		trigger = { TAG = POR }
	}
}

