#Blame PDX for not allowing the usage of FROM, ROOT and PREV scopes in some effects xd

send_OLE_guns_EQS = {

	if = {
		limit = { OLE = { has_government = democratic }}
		send_equipment = { target = OLE type = infantry_equipment amount = 500 }
		#add_opinion_modifier = { target = OLE modifier = OLE_civil_war_support }
		hidden_effect = {
			 add_ai_strategy = {
				 type = support
				 id = "OLE"
				 value = 200
			 }
		}
		reverse_add_opinion_modifier = { target = OLE modifier = OLE_civil_war_support }
		break = yes
	}
	if = {
		limit = { D01 = { original_tag = OLE has_government = democratic }}
		send_equipment = { target = D01 type = infantry_equipment amount = 500 }
		#add_opinion_modifier = { target = D01 modifier = OLE_civil_war_support }
		hidden_effect = {
			 add_ai_strategy = {
				 type = support
				 id = "D01"
				 value = 200
			 }
		}
		reverse_add_opinion_modifier = { target = D01 modifier = OLE_civil_war_support }
		break = yes
	}
	if = {
		limit = { D02 = { original_tag = OLE has_government = democratic }}
		send_equipment = { target = D02 type = infantry_equipment amount = 500 }
		#add_opinion_modifier = { target = D02 modifier = OLE_civil_war_support }
		hidden_effect = {
			 add_ai_strategy = {
				 type = support
				 id = "D02"
				 value = 200
			 }
		}
		reverse_add_opinion_modifier = { target = D02 modifier = OLE_civil_war_support }
		break = yes
	}
	if = {
		limit = { D03 = { original_tag = OLE has_government = democratic }}
		send_equipment = { target = D03 type = infantry_equipment amount = 500 }
		#add_opinion_modifier = { target = D03 modifier = OLE_civil_war_support }
		hidden_effect = {
			 add_ai_strategy = {
				 type = support
				 id = "D03"
				 value = 200
			 }
		}
		reverse_add_opinion_modifier = { target = D03 modifier = OLE_civil_war_support }
		break = yes
	}
	if = {
		limit = { D04 = { original_tag = OLE has_government = democratic }}
		send_equipment = { target = D04 type = infantry_equipment amount = 500 }
		#add_opinion_modifier = { target = D04 modifier = OLE_civil_war_support }
		hidden_effect = {
			 add_ai_strategy = {
				 type = support
				 id = "D04"
				 value = 200
			 }
		}
		reverse_add_opinion_modifier = { target = D04 modifier = OLE_civil_war_support }
		break = yes
	}
	if = {
		limit = { D05 = { original_tag = OLE has_government = democratic }}
		send_equipment = { target = D05 type = infantry_equipment amount = 500 }
		#add_opinion_modifier = { target = D05 modifier = OLE_civil_war_support }
		hidden_effect = {
			 add_ai_strategy = {
				 type = support
				 id = "D05"
				 value = 200
			 }
		}
		reverse_add_opinion_modifier = { target = D05 modifier = OLE_civil_war_support }
		break = yes
	}
	if = {
		limit = { D06 = { original_tag = OLE has_government = democratic }}
		send_equipment = { target = D06 type = infantry_equipment amount = 500 }
		#add_opinion_modifier = { target = D06 modifier = OLE_civil_war_support }
		hidden_effect = {
			 add_ai_strategy = {
				 type = support
				 id = "D06"
				 value = 200
			 }
		}
		reverse_add_opinion_modifier = { target = D06 modifier = OLE_civil_war_support }
		break = yes
	}
	if = {
		limit = { D07 = { original_tag = OLE has_government = democratic }}
		send_equipment = { target = D07 type = infantry_equipment amount = 500 }
		#add_opinion_modifier = { target = D07 modifier = OLE_civil_war_support }
		hidden_effect = {
			 add_ai_strategy = {
				 type = support
				 id = "D07"
				 value = 200
			 }
		}
		reverse_add_opinion_modifier = { target = D07 modifier = OLE_civil_war_support }
		break = yes
	}
}

send_OLE_guns_STG = {

	if = {
		limit = { OLE = { has_government = communism }}
		send_equipment = { target = OLE type = infantry_equipment amount = 500 }
		#add_opinion_modifier = { target = OLE modifier = OLE_civil_war_support }
		hidden_effect = {
			 add_ai_strategy = {
				 type = support
				 id = "OLE"
				 value = 200
			 }
		}
		reverse_add_opinion_modifier = { target = OLE modifier = OLE_civil_war_support }
		break = yes
	}
	if = {
		limit = { D01 = { original_tag = OLE has_government = communism }}
		send_equipment = { target = D01 type = infantry_equipment amount = 500 }
		#add_opinion_modifier = { target = D01 modifier = OLE_civil_war_support }
		hidden_effect = {
			 add_ai_strategy = {
				 type = support
				 id = "D01"
				 value = 200
			 }
		}
		reverse_add_opinion_modifier = { target = D01 modifier = OLE_civil_war_support }
		break = yes
	}
	if = {
		limit = { D02 = { original_tag = OLE has_government = communism }}
		send_equipment = { target = D02 type = infantry_equipment amount = 500 }
		#add_opinion_modifier = { target = D02 modifier = OLE_civil_war_support }
		hidden_effect = {
			 add_ai_strategy = {
				 type = support
				 id = "D02"
				 value = 200
			 }
		}
		reverse_add_opinion_modifier = { target = D02 modifier = OLE_civil_war_support }
		break = yes
	}
	if = {
		limit = { D03 = { original_tag = OLE has_government = communism }}
		send_equipment = { target = D03 type = infantry_equipment amount = 500 }
		#add_opinion_modifier = { target = D03 modifier = OLE_civil_war_support }
		hidden_effect = {
			 add_ai_strategy = {
				 type = support
				 id = "D03"
				 value = 200
			 }
		}
		reverse_add_opinion_modifier = { target = D03 modifier = OLE_civil_war_support }
		break = yes
	}
	if = {
		limit = { D04 = { original_tag = OLE has_government = communism }}
		send_equipment = { target = D04 type = infantry_equipment amount = 500 }
		#add_opinion_modifier = { target = D04 modifier = OLE_civil_war_support }
		hidden_effect = {
			 add_ai_strategy = {
				 type = support
				 id = "D04"
				 value = 200
			 }
		}
		reverse_add_opinion_modifier = { target = D04 modifier = OLE_civil_war_support }
		break = yes
	}
	if = {
		limit = { D05 = { original_tag = OLE has_government = communism }}
		send_equipment = { target = D05 type = infantry_equipment amount = 500 }
		#add_opinion_modifier = { target = D05 modifier = OLE_civil_war_support }
		hidden_effect = {
			 add_ai_strategy = {
				 type = support
				 id = "D05"
				 value = 200
			 }
		}
		reverse_add_opinion_modifier = { target = D05 modifier = OLE_civil_war_support }
		break = yes
	}
	if = {
		limit = { D06 = { original_tag = OLE has_government = communism }}
		send_equipment = { target = D06 type = infantry_equipment amount = 500 }
		#add_opinion_modifier = { target = D06 modifier = OLE_civil_war_support }
		hidden_effect = {
			 add_ai_strategy = {
				 type = support
				 id = "D06"
				 value = 200
			 }
		}
		reverse_add_opinion_modifier = { target = D06 modifier = OLE_civil_war_support }
		break = yes
	}
	if = {
		limit = { D07 = { original_tag = OLE has_government = communism }}
		send_equipment = { target = D07 type = infantry_equipment amount = 500 }
		#add_opinion_modifier = { target = D07 modifier = OLE_civil_war_support }
		hidden_effect = {
			 add_ai_strategy = {
				 type = support
				 id = "D07"
				 value = 200
			 }
		}
		reverse_add_opinion_modifier = { target = D07 modifier = OLE_civil_war_support }
		break = yes
	}
}

send_OLE_guns_CHN = {

	if = {
		limit = { OLE = { has_government = neutrality }}
		send_equipment = { target = OLE type = infantry_equipment amount = 500 }
		#add_opinion_modifier = { target = OLE modifier = OLE_civil_war_support }
		hidden_effect = {
			 add_ai_strategy = {
				 type = support
				 id = "OLE"
				 value = 200
			 }
		}
		reverse_add_opinion_modifier = { target = OLE modifier = OLE_civil_war_support }
		break = yes
	}
	if = {
		limit = { D01 = { original_tag = OLE has_government = neutrality }}
		send_equipment = { target = D01 type = infantry_equipment amount = 500 }
		#add_opinion_modifier = { target = D01 modifier = OLE_civil_war_support }
		hidden_effect = {
			 add_ai_strategy = {
				 type = support
				 id = "D01"
				 value = 200
			 }
		}
		reverse_add_opinion_modifier = { target = D01 modifier = OLE_civil_war_support }
		break = yes
	}
	if = {
		limit = { D02 = { original_tag = OLE has_government = neutrality }}
		send_equipment = { target = D02 type = infantry_equipment amount = 500 }
		#add_opinion_modifier = { target = D02 modifier = OLE_civil_war_support }
		hidden_effect = {
			 add_ai_strategy = {
				 type = support
				 id = "D02"
				 value = 200
			 }
		}
		reverse_add_opinion_modifier = { target = D02 modifier = OLE_civil_war_support }
		break = yes
	}
	if = {
		limit = { D03 = { original_tag = OLE has_government = neutrality }}
		send_equipment = { target = D03 type = infantry_equipment amount = 500 }
		#add_opinion_modifier = { target = D03 modifier = OLE_civil_war_support }
		hidden_effect = {
			 add_ai_strategy = {
				 type = support
				 id = "D03"
				 value = 200
			 }
		}
		reverse_add_opinion_modifier = { target = D03 modifier = OLE_civil_war_support }
		break = yes
	}
	if = {
		limit = { D04 = { original_tag = OLE has_government = neutrality }}
		send_equipment = { target = D04 type = infantry_equipment amount = 500 }
		#add_opinion_modifier = { target = D04 modifier = OLE_civil_war_support }
		hidden_effect = {
			 add_ai_strategy = {
				 type = support
				 id = "D04"
				 value = 200
			 }
		}
		reverse_add_opinion_modifier = { target = D04 modifier = OLE_civil_war_support }
		break = yes
	}
	if = {
		limit = { D05 = { original_tag = OLE has_government = neutrality }}
		send_equipment = { target = D05 type = infantry_equipment amount = 500 }
		#add_opinion_modifier = { target = D05 modifier = OLE_civil_war_support }
		hidden_effect = {
			 add_ai_strategy = {
				 type = support
				 id = "D05"
				 value = 200
			 }
		}
		reverse_add_opinion_modifier = { target = D05 modifier = OLE_civil_war_support }
		break = yes
	}
	if = {
		limit = { D06 = { original_tag = OLE has_government = neutrality }}
		send_equipment = { target = D06 type = infantry_equipment amount = 500 }
		#add_opinion_modifier = { target = D06 modifier = OLE_civil_war_support }
		hidden_effect = {
			 add_ai_strategy = {
				 type = support
				 id = "D06"
				 value = 200
			 }
		}
		reverse_add_opinion_modifier = { target = D06 modifier = OLE_civil_war_support }
		break = yes
	}
	if = {
		limit = { D07 = { original_tag = OLE has_government = neutrality }}
		send_equipment = { target = D07 type = infantry_equipment amount = 500 }
		#add_opinion_modifier = { target = D07 modifier = OLE_civil_war_support }
		hidden_effect = {
			 add_ai_strategy = {
				 type = support
				 id = "D07"
				 value = 200
			 }
		}
		reverse_add_opinion_modifier = { target = D07 modifier = OLE_civil_war_support }
		break = yes
	}
}

#Scope is OLE
OLE_CHN_intervention = {
	OLE = {
		if = {
			limit = { NOT = { has_government = neutrality } }
			CHN = { declare_war_on = { target = OLE type = annex_everything } }
			break = yes
		}
	}
	D01 = {
		if = {
			limit = { original_tag = OLE NOT = { has_government = neutrality } }
			CHN = { declare_war_on = { target = D01 type = annex_everything } }
			break = yes
		}
	}
	D02 = {
		if = {
			limit = { original_tag = OLE NOT = { has_government = neutrality } }
			CHN = { declare_war_on = { target = D02 type = annex_everything } }
			break = yes
		}
	}
	D03 = {
		if = {
			limit = { original_tag = OLE NOT = { has_government = neutrality } }
			CHN = { declare_war_on = { target = D03 type = annex_everything } }
			break = yes
		}
	}
	D04 = {
		if = {
			limit = { original_tag = OLE NOT = { has_government = neutrality } }
			CHN = { declare_war_on = { target = D04 type = annex_everything } }
			break = yes
		}
	}
	D05 = {
		if = {
			limit = { original_tag = OLE NOT = { has_government = neutrality } }
			CHN = { declare_war_on = { target = D05 type = annex_everything } }
			break = yes
		}
	}
	D06 = {
		if = {
			limit = { original_tag = OLE NOT = { has_government = neutrality } }
			CHN = { declare_war_on = { target = D06 type = annex_everything } }
			break = yes
		}
	}
	D07 = {
		if = {
			limit = { original_tag = OLE NOT = { has_government = neutrality } }
			CHN = { declare_war_on = { target = D07 type = annex_everything } }
			break = yes
		}
	}
}

#Scope is CHN
OLE_CHN_intervention_step2 = {
	if = {
		limit = {
			OLE = { is_subject_of = CHN }
			D01 = { original_tag = OLE NOT = { is_subject_of = CHN } } }
			OLE = { add_to_war = { targeted_alliance = CHN enemy = D01 } }
			break = yes
		}
	if = {
		limit = {
			OLE = { NOT = { is_subject_of = CHN } }
			D01 = { original_tag = OLE is_subject_of = CHN } }
			D01 = { add_to_war = { targeted_alliance = CHN enemy = OLE } }
			break = yes
		}
	if = {
		limit = {
			OLE = { NOT = { is_subject_of = CHN } }
			D02 = { original_tag = OLE is_subject_of = CHN } }
			D02 = { add_to_war = { targeted_alliance = D02 enemy = OLE } }
			break = yes
		}
	if = {
		limit = {
			OLE = { NOT = { is_subject_of = CHN } }
			D03 = { original_tag = OLE is_subject_of = CHN } }
			D03 = { add_to_war = { targeted_alliance = D03 enemy = OLE } }
			break = yes
		}
	if = {
		limit = {
			OLE = { NOT = { is_subject_of = CHN } }
			D04 = { original_tag = OLE is_subject_of = CHN } }
			D04 = { add_to_war = { targeted_alliance = D04 enemy = OLE } }
			break = yes
		}
	if = {
		limit = {
			OLE = { NOT = { is_subject_of = CHN } }
			D05 = { original_tag = OLE is_subject_of = CHN } }
			D05 = { add_to_war = { targeted_alliance = D05 enemy = OLE } }
			break = yes
		}
	if = {
		limit = {
			OLE = { NOT = { is_subject_of = CHN } }
			D06 = { original_tag = OLE is_subject_of = CHN } }
			D06 = { add_to_war = { targeted_alliance = D06 enemy = OLE } }
			break = yes
		}
	if = {
		limit = {
			OLE = { NOT = { is_subject_of = CHN } }
			D07 = { original_tag = OLE is_subject_of = CHN } }
			D07 = { add_to_war = { targeted_alliance = D07 enemy = OLE } }
			break = yes
		}
}


#Scope is EQS
OLE_EQS_intervention = {
	if = {
		limit = {
			OLE = { has_government = democratic }
			D01 = { original_tag = OLE NOT = { has_government = democratic} } }
			add_to_faction = OLE
			add_to_war = { targeted_alliance = OLE enemy = D01 }
			break = yes
		}
	if = {
		limit = {
			OLE = { NOT = { has_government = democratic } }
			D01 = { original_tag = OLE has_government = democratic } }
			add_to_faction = D01
			add_to_war = { targeted_alliance = D01 enemy = OLE }
			break = yes
		}
	if = {
		limit = {
			OLE = { NOT = { has_government = democratic } }
			D02 = { original_tag = OLE has_government = democratic } }
			add_to_faction = D02
			add_to_war = { targeted_alliance = D02 enemy = OLE }
			break = yes
		}
	if = {
		limit = {
			OLE = { NOT = { has_government = democratic } }
			D03 = { original_tag = OLE has_government = democratic } }
			add_to_faction = D03
			add_to_war = { targeted_alliance = D03 enemy = OLE }
			break = yes
		}
	if = {
		limit = {
			OLE = { NOT = { has_government = democratic } }
			D04 = { original_tag = OLE has_government = democratic } }
			add_to_faction = D04
			add_to_war = { targeted_alliance = D04 enemy = OLE }
			break = yes
		}
	if = {
		limit = {
			OLE = { NOT = { has_government = democratic } }
			D05 = { original_tag = OLE has_government = democratic } }
			add_to_faction = D05
			add_to_war = { targeted_alliance = D05 enemy = OLE }
			break = yes
		}
	if = {
		limit = {
			OLE = { NOT = { has_government = democratic } }
			D06 = { original_tag = OLE has_government = democratic } }
			add_to_faction = D06
			add_to_war = { targeted_alliance = D06 enemy = OLE }
			break = yes
		}
	if = {
		limit = {
			OLE = { NOT = { has_government = democratic } }
			D07 = { original_tag = OLE has_government = democratic } }
			add_to_faction = D07
			add_to_war = { targeted_alliance = D07 enemy = OLE }
			break = yes
		}
}

Evil_unicorn_magic = {
if = {
	limit = {
		PREV = {
			has_tech = tech_unicorn_th
		}
	}
	if = {
		limit = {
			has_government = fascism
		}
		set_technology = {
			tech_unicorn_ms = 1
		}
		else = {
			set_technology = {
				tech_unicorn_th = 1
			}
		}
	}
}

if = {
	limit = {
		PREV = {
			has_tech = tech_unicorn_th2
		}
	}
	if = {
		limit = {
			has_government = fascism
		}
		set_technology = {
			tech_unicorn_ms2 = 1
		}
		else = {
			set_technology = {
				tech_unicorn_th2 = 1
			}
		}
	}
}

if = {
	limit = {
		PREV = {
			has_tech = tech_unicorn_th3
		}
	}
	if = {
		limit = {
			has_government = fascism
		}
		set_technology = {
			tech_unicorn_ms3 = 1
		}
		else = {
			set_technology = {
				tech_unicorn_th3 = 1
			}
		}
	}
}

if = {
	limit = {
		PREV = {
			has_tech = tech_unicorn_th4
		}
	}
	if = {
		limit = {
			has_government = fascism
		}
		set_technology = {
			tech_unicorn_ms4 = 1
		}
		else = {
			set_technology = {
				tech_unicorn_th4 = 1
			}
		}
	}
}

if = {
	limit = {
		PREV = {
			has_tech = tech_unicorn_th5
		}
	}
	if = {
		limit = {
			has_government = fascism
		}
		set_technology = {
			tech_unicorn_ms5 = 1
		}
		else = {
			set_technology = {
				tech_unicorn_th5 = 1
			}
		}
	}
}
}
