####################
# Portugal Decisions
####################
POR_colonial_matters = {

POR_our_own_maf = {
		icon = generic_form_nation
		fire_only_once = yes
		allowed = { tag = POR }
		available = {
			has_completed_focus = POR_pinko
			539 = { is_controlled_by_ROOT_or_ally = yes }
			1183 = { is_controlled_by_ROOT_or_ally = yes }
			965 = { is_controlled_by_ROOT_or_ally = yes }
			925 = { is_controlled_by_ROOT_or_ally = yes }
			660 = { is_controlled_by_ROOT_or_ally = yes }
			927 = { is_controlled_by_ROOT_or_ally = yes }
			558 = { is_controlled_by_ROOT_or_ally = yes }
			881 = { is_controlled_by_ROOT_or_ally = yes }
			MAF = {
			exists = no
			}
			COG = {
			NOT = {
			exists = yes
			is_subject_of = POR
				}
			}
		}
		visible = {
			tag = POR
			has_completed_focus = POR_pinko
			COG = {
			NOT = {
			exists = yes
			is_subject_of = POR
				}
			}
		}
		
		cost = 100
		days_remove = 0
		fire_only_once = yes
		
		cancel_if_not_visible = yes
		cancel_effect = {
			log = "[GetDateText]: [Root.GetName]: Decision cancelled POR_our_own_maf target: [From.GetName]"
		}

		complete_effect = {
			log = "[GetDateText]: [Root.GetName]: Decision POR_our_own_maf target: [From.GetName]"
		}
		
		remove_effect = {
			log = "[GetDateText]: [Root.GetName]: Decision remove POR_our_own_maf target: [From.GetName]"
			set_country_flag = POR_formed_maf
			release_puppet = COG
			set_autonomy = {
				target = COG
				autonomous_state = kx_colored_puppet
			}
			COG = {
			create_country_leader = {
				name = "António Lopes Mateus"
				picture = "gfx/leaders/POR/Portrait_POR_Antonio_Lopes_Mateus.png"
				expire = "1.1.1"
				ideology = autocratic_colonial_govt_subtype
			}
			create_country_leader = {
				name = "António Lopes Mateus"
				picture = "gfx/leaders/POR/Portrait_POR_Antonio_Lopes_Mateus.png"
				expire = "1.1.1"
				ideology = natpop_colonial_govt_subtype
			}
				set_party_name = {
				ideology = paternal_autocrat
				long_name = "Administração Colonial"
				name = "Administração Colonial"
			}
				set_party_name = {
				ideology = national_populist
				long_name = "Administração Colonial"
				name = "Administração Colonial"
			}
			every_state = {
			limit = { has_state_flag = MAF_claim }
			COG = {
				add_state_core = PREV
				}
			}
			hidden_effect = {
			925 = { add_core_of = COG }
			}
			every_core_state = {
			limit = {
			OR = {
				is_owned_by = POR
				is_owned_by = COG
				}
			}
			set_state_owner_to = COG
			}
			every_core_state = {
			limit = {
				is_claimed_by = POR
				}
			set_state_owner_to = POR
			}
			set_cosmetic_tag = POR_MITTEL
			}
		}
	}
POR_expand_COG = {
		icon = generic_form_nation
		fire_only_once = yes
		allowed = { tag = POR }
		visible = {
			has_global_flag = MAF_collapse
			NOT = {
			has_country_flag = POR_formed_maf
			}
			COG = {
			is_subject_of = POR
			has_cosmetic_tag = POR_MITTEL
			}
		}
		available = {
			COG = {
			is_subject_of = POR
			has_cosmetic_tag = POR_MITTEL
			}
		}
		cost = 100
		ai_will_do = {
			factor = 0
		}
		remove_effect = {
		set_country_flag = MAG_claim_maf
		custom_effect_tooltip = KIK_gain_wargoals_tt
		every_country = {
			limit = { is_in_array = { global.MAF_collapse_tags = THIS } }
			ROOT = {
				create_wargoal = {
					type = annex_everything target = PREV
				}
			}
		}
		COG = {
		every_state = {
			limit = { has_state_flag = MAF_claim }
			COG = {
				add_state_core = PREV
				}
			}
		hidden_effect = {
		925 = { add_core_of = COG }
			}
		}
		log = "[GetDateText]: [Root.GetName]: Decision POR_expand_COG"
		}
	}
POR_expand_KOG = {
		icon = generic_form_nation
		fire_only_once = yes
		allowed = { tag = POR }
		visible = {
			has_global_flag = MAF_collapse
			KOG = {
			is_subject_of = POR
			has_cosmetic_tag = KOG_KON
			}
			COG = {
			NOT = {
			is_subject_of = POR
				}
			}
		}
		available = {
			KOG = {
			is_subject_of = POR
			}
			COG = {
			NOT = {
			is_subject_of = POR
				}
			}
		}
		cost = 100
		ai_will_do = {
			factor = 0
		}
		remove_effect = {
		create_wargoal = {
			type = annex_everything
			target = COG
		}
		create_wargoal = {
			type = annex_everything
			target = LPD
		}
		create_wargoal = {
			type = annex_everything
			target = MSF
		}
		create_wargoal = {
			type = annex_everything
			target = UMN
		}
		create_wargoal = {
			type = annex_everything
			target = KIV
		}
		KOG = {
		add_state_core = 881
		add_state_core = 295
		add_state_core = 538
		add_state_core = 1025
		add_state_core = 1180
		add_state_core = 718
		add_state_core = 1026
		add_state_core = 977
		add_state_core = 1181
		add_state_core = 949
		add_state_core = 1182
		add_state_core = 1185
		add_state_core = 1184
		add_state_core = 976
		}
		log = "[GetDateText]: [Root.GetName]: Decision POR_expand_KOG"
		}
	}
}
POR_coring = {
	POR_integrate_olivenca = {# core olivenca
		icon = generic_prepare_civil_war
		visible = { 
			owns_state = 1316
			1316 = {
			is_claimed_by = POR
			NOT = { is_core_of = POR } 
			}
		}
		cancel_if_not_visible = yes
		
		fire_only_once = yes
		cost = 30
		days_remove = 30
		
		modifier = {
			production_factory_max_efficiency_factor = -0.015
			industrial_capacity_factory = -0.015
			local_resources_factor = -0.015
			consumer_goods_factor = 0.015
		}

		complete_effect = {
			log = "[GetDateText]: [Root.GetName]: Decision POR_integrate_olivenca"
		}
		remove_effect = {
			log = "[GetDateText]: [Root.GetName]: Decision remove POR_integrate_olivenca"
			set_province_name = { id = 13632 name = "Olivença"}
			1316 = { 
				set_state_name = "Olivença" 
			}
			add_state_core = 1316
		}
	}
	POR_integrate_galiza = {# core galiza
		icon = generic_prepare_civil_war
		visible = { 
			owns_state = 171
			171 = {
			is_claimed_by = POR
			NOT = { is_core_of = POR } 
			}
		}
		cancel_if_not_visible = yes
		
		fire_only_once = yes
		cost = 75
		days_remove = 75
		
		modifier = {
			production_factory_max_efficiency_factor = -0.050
			industrial_capacity_factory = -0.050
			local_resources_factor = -0.050
			consumer_goods_factor = 0.050
		}

		complete_effect = {
			log = "[GetDateText]: [Root.GetName]: Decision POR_integrate_galiza"
		}
		remove_effect = {
			log = "[GetDateText]: [Root.GetName]: Decision remove POR_integrate_galiza"
			set_province_name = { id = 758 name = "Corunha"}
			171 = { 
				set_state_name = "Galiza" 
			}
			add_state_core = 171
		}
	}
}