
on_actions = {

	#ROOT is new controller
	#FROM is old controller
	#FROM.FROM is state ID

	on_state_control_changed = {
		effect = {
			if = {
				limit = {
					has_war_with = DJI
					DJI = {
						has_cosmetic_tag = DJI_GERMAN
					}
					FROM.FROM = {
						is_owned_by = DJI
						NOT = { has_state_flag = state_has_fallen }
					}
				}
				# Collapse of Vestasien if Dschibouti taken by Somalia
				if = {
					limit = {
						FROM.FROM = { state = 268 }
						SOM = { controls_province = 8124 }
					}
					DJI_collapse = yes
				}
			}
		}
	}
	on_state_control_changed = {
		effect = {
			if = {
				limit = {
					has_war_with = DJI
					DJI = {
						has_cosmetic_tag = DJI_GERMAN
					}
					FROM.FROM = {
						is_owned_by = DJI
						NOT = { has_state_flag = state_has_fallen }
					}
				}
				# Collapse of Vestasien if Dschibouti taken by Ethiopia
				if = {
					limit = {
						FROM.FROM = { state = 268 }
						ETH = { controls_province = 8124 }
					}
					DJI_collapse = yes
				}
			}
		}
	}
	on_state_control_changed = {
		effect = {
			if = {
				limit = {
					has_war_with = DJI
					DJI = {
						has_cosmetic_tag = DJI_GERMAN
					}
					FROM.FROM = {
						is_owned_by = DJI
						NOT = { has_state_flag = state_has_fallen }
					}
				}
				# Collapse of Westasien if Dschibouti taken by hostile powers + Berbera and Aussa
				if = {
					limit = {
						FROM.FROM = { state = 268 }
						OR = {
							ERI = { controls_province = 8124 }
							ETH = { controls_province = 8124 }
							SOM = { controls_province = 8124 }
						}
						OR = {
							ERI = { controls_province = 1297 }
							ETH = { controls_province = 1297 }
							SOM = { controls_province = 1297 }
						}
						OR = {
							ERI = { controls_province = 921 }
							ETH = { controls_province = 921 }
							SOM = { controls_province = 921 }
						}
					}
					DJI_collapse = yes
				}
			}
		}
	}
	on_state_control_changed = {
		effect = {
			if = {
				limit = {
					has_war_with = FROM
					FROM.FROM = {
						is_owned_by = FROM
						NOT = { has_state_flag = state_has_fallen }
					}
				}
				# Dar
				if = {
					limit = {
						FROM.FROM = { state = 965 }
						ROOT = { controls_province = 2196 }
					}
					news_event = { id = sharedafrika.25 }
				}
			}
		}
	}
	on_state_control_changed = {
		effect = {
			if = {
				limit = {
					has_war_with = FROM
					FROM.FROM = {
						is_owned_by = FROM
						NOT = { has_state_flag = state_has_fallen }
					}
				}
				# Leopoldville
				if = {
					limit = {
						FROM.FROM = { state = 881 }
						ROOT = { controls_province = 13950 }
					}
					news_event = { id = sharedafrika.24 }
				}
			}
		}
	}
}
