political_actions = {

	IRQ_nationalise_the_oil = {

		icon = generic_prepare_civil_war

		allowed = {
			original_tag = IRQ
			NOT = { has_dlc = "Graveyard of Empires" }
		}

		visible = {
			
		}

		available = {
			controls_state = 676
			controls_state = 291
			controls_state = 1011
		}
		
		cost = 50

		fire_only_once = yes

		ai_will_do = {
			factor = 0
			modifier = {
				add = 9999
				is_historical_focus_on = yes
				any_country = {
					is_allied_ai = yes
					is_ai = no
				}
				NOT = {
					any_country = {
						is_axis_ai = yes
						is_ai = no
					}
				}
			}
		}

		complete_effect = {

			add_war_support = 0.1

			ENG = { 
				remove_resource_rights = 676
				remove_resource_rights = 291
				remove_resource_rights = 1010
			}

		}
	}

}	

IRQ_arab_free_legion_cat = {
	IRQ_recruit_arab_free_legion = {
		icon = GFX_decision_generic_prepare_civil_war
	
		allowed = {
			original_tag = IRQ
		}
		
		visible = {
			hidden_trigger = { #Otherwise this will show up in the cancel trigger tooltip
				has_completed_focus = IRQ_arab_free_legion
				OR = {
					has_government = fascism
					has_government = neutrality
				}
			}
			NOT = { 
				FROM = { has_state_flag = IRQ_recruited_arab_legion_here }
				has_war_with = FROM.owner
			}

		}
		available = {
			FROM = {
				NOT = {
					has_state_flag = IRQ_recruited_arab_legion_here
				}
			}
			NOT = { has_country_flag = IRQ_recruiting_arab_legion }
			
		}

		target_root_trigger = {
			original_tag = IRQ
		}

		state_target = yes
		targets = { 292 455 454 677 553 907 448 458 459 461 293 294	658 765 656 }

	    target_trigger = {   
	    }

	    on_map_mode = map_and_decisions_view 

		custom_cost_trigger = {
			command_power > 24.9
			has_equipment = { infantry_equipment > 1999 }
		}

		custom_cost_text = decision_cost_cp_25_ie_2000
		
		fire_only_once = yes
		days_remove = 30
		cancel_if_not_visible = yes
		complete_effect = {
			add_command_power = -25
			add_equipment_to_stockpile = {
				type = infantry_equipment
				amount = -2000
			}
			hidden_effect = {
				set_country_flag = IRQ_recruiting_arab_legion
			}
		}
		remove_effect = {
			hidden_effect = {
				clr_country_flag = IRQ_recruiting_arab_legion
				FROM = {
					set_state_flag = IRQ_recruited_arab_legion_here
				}
			}
			capital_scope = {
				IRQ_create_arab_free_legion_div = yes
			}
		}

		cancel_effect = {
			hidden_effect = {
				clr_country_flag = IRQ_recruiting_arab_legion
			}
		}
	}
}

greater_iraq_decision_cat = {
	IRQ_core_state = {
		icon = GFX_decision_infiltrate_state
	
		allowed = {
			original_tag = IRQ
		}
		
		visible = {
			has_completed_focus = IRQ_greater_iraq
		}
		available = {
			NOT = { has_country_flag = IRQ_coring_state_in_progress }
		}

		target_root_trigger = { original_tag = IRQ }

		state_target = any_controlled_state
	    
	    target_trigger = {
	        FROM = {
	        	NOT = { is_core_of = ROOT }
	        	is_fully_controlled_by = ROOT
	        	OR = {
	        		is_core_of = KUW
	        		is_core_of = SYR
	        		is_core_of = LEB
	        		is_core_of = PAL
	        		is_core_of = JOR
	        		state = 413
	        	}
	        }
	    }
	    on_map_mode = map_and_decisions_view 
	    cost = 50		
		fire_only_once = yes
		days_remove = 14 
		complete_effect = {
			hidden_effect = {
				set_country_flag = { flag = IRQ_coring_state_in_progress value = 1 days = 31 }
			}
		}
		remove_effect = {
			hidden_effect = {
				clr_country_flag = IRQ_coring_state_in_progress
			}
			FROM = {
				add_core_of = ROOT
			}
		}

		cancel_trigger = {
			FROM = {
				NOT = { is_fully_controlled_by = ROOT }
			}
		}

		cancel_effect = {
			hidden_effect = {
				clr_country_flag = IRQ_coring_state_in_progress
			}
		}
	}
}

united_arab_republic_cat = {
	united_arab_rep_core_state = {
		icon = GFX_decision_infiltrate_state
	
		allowed = {
			original_tag = IRQ
		}
		
		visible = {
			has_completed_focus = IRQ_proclaim_united_arab_republic
		}
		available = {
			NOT = { has_country_flag = IRQ_coring_state_in_progress }
		}
		state_target = any_owned_state
	    target_trigger = {
	        FROM = {
	        	NOT = { is_core_of = ROOT }
	        	is_owned_and_controlled_by = ROOT
	        	OR = {
	        		#Middle East:
	        		region = 28
	        		region = 232
	        		region = 196
	        		region = 236
	        		region = 237
	        		region = 238
	        		#And North Africa:
	        		region = 225
	        		region = 126
	        		region = 182
	        		region = 128
	        	}
	        }
	    }
	    on_map_mode = map_and_decisions_view 
	    cost = 50		
		fire_only_once = yes
		days_remove = 30
		complete_effect = {
			hidden_effect = {
				set_country_flag = { flag = IRQ_coring_state_in_progress value = 1 days = 31 }
			}
		}
		remove_effect = {
			hidden_effect = {
				clr_country_flag = IRQ_coring_state_in_progress
			}
			FROM = {
				add_core_of = ROOT
			}
		}

		cancel_trigger = {
			NOT = {
				FROM = {
					is_fully_controlled_by = ROOT
				}
			} 
		}

		cancel_effect = {
			hidden_effect = {
				clr_country_flag = IRQ_coring_state_in_progress
			}
		}
	}
}


hashemite_federation_cat = {
	IRQ_invite_to_federation = {
		icon = GFX_decision_infiltrate_state
	
		allowed = {
			original_tag = IRQ
		}
		
		visible = {
			has_completed_focus = IRQ_expand_membership
			OR = {
				has_government = democratic
				has_government = neutrality
			}
			FROM = {
				exists = yes
				NOT = {
					has_war_with = ROOT
				}
				is_subject = no
			}
		}

		available = {
			NOT = { has_country_flag = IRQ_inviting_to_federation_in_progress }
			FROM = {
				NOT = {
					has_country_flag = IRQ_has_permanently_rejected_fed
				}
			}
		}

		target_trigger = {
			FROM = {
				NOT = {
					original_tag = ROOT
				}
				capital_scope = {
					OR = {
						region = 28
						region = 232
						region = 237
						region = 196
						region = 236
						region = 238
						region = 240
					}
				}
			}
		}

		on_map_mode = map_and_decisions_view

		highlight_states = {
			highlight_states_trigger = {
				is_owned_and_controlled_by = FROM
			}
		}

	    cost = 25
		fire_only_once = yes

		days_remove = 30

		complete_effect = {
			set_country_flag = { flag = IRQ_inviting_to_federation_in_progress value = 1 days = 31 }
			FROM = {
				set_country_flag = is_the_current_invitation_target_of_IRQ_hashemite_flag
			}
		}

		remove_effect = {
			hidden_effect = {
				clr_country_flag = IRQ_inviting_to_federation_in_progress
				every_country = {
					limit = {
						has_country_flag = is_the_current_invitation_target_of_IRQ_hashemite_flag
					}
					clr_country_flag = is_the_current_invitation_target_of_IRQ_hashemite_flag
				}
			}
			
			FROM = {
				country_event = {
					id = IRQ_political_events.26
					hours = 1
				}
			}
			custom_effect_tooltip = generic_higher_opinion_tt
		}

		cancel_trigger = {

			any_country = {
				has_country_flag = is_the_current_invitation_target_of_IRQ_hashemite_flag
				OR = {
					exists = no
					is_subject = yes
					has_war_with = ROOT
				}
			}

		}

		cancel_effect = {
			hidden_effect = {
				clr_country_flag = IRQ_inviting_to_federation_in_progress
				every_country = {
					limit = {
						has_country_flag = is_the_current_invitation_target_of_IRQ_hashemite_flag
					}
					clr_country_flag = is_the_current_invitation_target_of_IRQ_hashemite_flag
				}
			}
		}
	}

	IRQ_invite_to_federation_africa = {
		icon = GFX_decision_infiltrate_state
	
		allowed = {
			original_tag = IRQ
		}
		
		visible = {
			has_completed_focus = IRQ_expand_membership
			OR = {
				has_government = democratic
				has_government = neutrality
			}
			FROM = {
				exists = yes
				NOT = {
					has_war_with = ROOT
				}
				is_subject = no
			}
		}

		available = {
			NOT = { has_country_flag = IRQ_inviting_to_federation_in_progress }
			FROM = {
				NOT = {
					has_country_flag = IRQ_has_permanently_rejected_fed
				}
			}
		}

		target_trigger = {
			FROM = {
				NOT = {
					original_tag = ROOT
				}
				capital_scope = {
					OR = {
						region = 128
						region = 225
						region = 126
						region = 182
					}
				}
			}
		}

		on_map_mode = map_and_decisions_view

		highlight_states = {
			highlight_states_trigger = {
				is_owned_and_controlled_by = FROM
			}
		}

		cost = 25
		fire_only_once = yes
		days_remove = 30

		complete_effect = {
			set_country_flag = { flag = IRQ_inviting_to_federation_in_progress value = 1 days = 31 }
			FROM = {
				set_country_flag = is_the_current_invitation_target_of_IRQ_hashemite_flag
			}
		}

		remove_effect = {
			hidden_effect = {
				clr_country_flag = IRQ_inviting_to_federation_in_progress
				every_country = {
					limit = {
						has_country_flag = is_the_current_invitation_target_of_IRQ_hashemite_flag
					}
					clr_country_flag = is_the_current_invitation_target_of_IRQ_hashemite_flag
				}
			}
			
			FROM = {
				country_event = {
					id = IRQ_political_events.26
					hours = 1
				}
			}
			custom_effect_tooltip = generic_higher_opinion_tt
		}

		cancel_trigger = {

			any_country = {
				has_country_flag = is_the_current_invitation_target_of_IRQ_hashemite_flag
				OR = {
					exists = no
					is_subject = yes
					has_war_with = ROOT
				}
			}

		}

		cancel_effect = {
			hidden_effect = {
				clr_country_flag = IRQ_inviting_to_federation_in_progress
				every_country = {
					limit = {
						has_country_flag = is_the_current_invitation_target_of_IRQ_hashemite_flag
					}
					clr_country_flag = is_the_current_invitation_target_of_IRQ_hashemite_flag
				}
			}
		}
	}
}

IRQ_flood_the_plains_cat = {
	
	IRQ_flood_the_plains = {

		icon = hol_inundate_water_lines

		allowed = {
			original_tag = IRQ
		}

		available = {
			has_war = yes
			ROOT = {
				controls_province = 2097 #Just Baghdad
			}
		}

		cost = 50

		fire_only_once = yes

		days_remove = 120

		highlight_states = {
			highlight_state_targets = { state = 291 state = 1011 }
			highlight_provinces = {
				12839
				3795
				12046
				7994
				10876
				2097
				###
				2089
				8001
				2004
				12726
				7977
			}
			highlight_only_provinces = yes
		}

		modifier = {
		}

		visible = {
			IRQ = { has_completed_focus = IRQ_construct_the_kut_barrage }
		}
		
		complete_effect = {
			291 = {
				add_province_modifier = {
					static_modifiers = { flooded }
					province = {
						id = 12839
						id = 3795
						id = 12046
						id = 7994
						id = 10876
						id = 2097
					}
				}
				damage_building = {
					type = infrastructure
					damage = 2
				}
				damage_building = {
					type = industrial_complex
					damage = 0.5
				}
				damage_building = {
					type = arms_factory
					damage = 0.5
				}
			}
			1011 = {
				add_province_modifier = {
					static_modifiers = { flooded }
					province = {
						id = 2089
						id = 8001
						id = 2004
						id = 12726
						id = 7977
					}
				}
				damage_building = {
					type = infrastructure
					damage = 2
				}
				damage_building = {
					type = industrial_complex
					damage = 0.5
				}
				damage_building = {
					type = arms_factory
					damage = 0.5
				}
			}
		}
		
		remove_effect = {
			custom_effect_tooltip = remove_flooding_tt
			hidden_effect = {
				291 = {
					remove_province_modifier = {
						static_modifiers = { flooded }
						province = {
							id = 12839
							id = 3795
							id = 12046
							id = 7994
							id = 10876
							id = 2097
						}
					}
				}
				1011 = {
					remove_province_modifier = {
						static_modifiers = { flooded }
						province = {
							id = 2089
							id = 8001
							id = 2004
							id = 12726
							id = 7977
						}
					}
				}
			}
		}
		
		ai_will_do = {
			modifier = {
				add = 50
				surrender_progress > 0.15 #Should kick in if Basrah/Najaf are occupied
			}
		}

	}
}

KUR_syrian_border_skrimish_cat = {
	
	KUR_syrian_border_skrimish_decision = {
		icon = border_war

		allowed = {
			original_tag = IRQ
		}

		visible = {
			has_completed_focus = IRQ_kurdish_reject_ankara_treaty
			676 = {
				is_controlled_by = IRQ
			}
		}

		available = {
			680 = {
				owner = {
					NOT = {
						has_war_with = IRQ
						is_in_faction_with = IRQ
						has_non_aggression_pact_with = IRQ
						is_puppet_of = IRQ
					}
				}
			}
		}

		

		highlight_states = {
	 		highlight_state_targets = {
				state = 676
				state = 680
			} 
		}
		
		fire_only_once = yes

		cost = 50 

		complete_effect = {

			activate_mission = IRQ_march_on_syrian_kurdistan_mission

			custom_effect_tooltip = generic_skip_one_line_tt

			start_border_war = {
				change_state_after_war = no #overrides the transfer of state at the end of war
				combat_width = 180 #combat width for border war
				minimum_duration_in_days = 40 #minimum duration for combat
				attacker = {
					on_win = IRQ_political_events.77
					on_lose = IRQ_political_events.78
					on_cancel = IRQ_political_events.78
					state = 676 # state to start border war
					num_provinces = 2 #number of provinces we want border war to be
					
					leader_score = { # Optional score for selecting a leader 
						base = 1
						modifier = {
						    skill > 2
						    factor = 5
						}
						modifier = {
						    skill > 3
						    factor = 10
						}
					}
					
					dig_in_factor = 0 #dig in modifier factor (default value: 1.0)
					terrain_factor = 0 #terrain modifier factor(default value: 1.0)
				}
				
				defender = {
					state = 680 # state to start border war
					num_provinces = 2 #number of provinces we want border war to be
					on_lose = IRQ_political_events.77
					on_win = IRQ_political_events.78
					on_cancel = IRQ_political_events.78
				}
			}
	
		}
	}

	IRQ_march_on_syrian_kurdistan_mission = {
		icon = border_war
		
		allowed = { always = no }

		available = {
			hidden_trigger = { always = no }
		}

		highlight_states = {
			highlight_state_targets = {
				state = 676
				state = 680
			}
		}

		days_mission_timeout = 120

		cancel_trigger = {
			680 = {	
				is_fully_controlled_by = ROOT
			}
		}

		cancel_effect = {
			effect_tooltip = {
				country_event = { id = IRQ_political_events.77 }
				transfer_state = 680
			}
		}

		timeout_effect = { #Fails
			cancel_border_war = {
				attacker = 676
				defender = 680
			}
		}
	}

}