#	Example:
# 
#	example_effect = {
#		add_political_power = 66
#		add_popularity = {
#			ideology = fascism
#			popularity = 0.33
#		}
#	}
#
#
#	In a script file:
#
#	effect = {
#		example_effect = yes
#	}
#

SAF_send_equipment_flag_counter = {
	if = {
		limit = {
			not = {
				has_country_flag = SAF_sent_equipment_1
			}
		}
		set_country_flag = SAF_sent_equipment_1
		
		else = {
			if = {
				limit = {
					not = {
						has_country_flag = SAF_sent_equipment_2
					}
				}
				set_country_flag = SAF_sent_equipment_2
				
				else = {
					if = {
						limit = {
							not = {
								has_country_flag = SAF_sent_equipment_3
							}
						}
						set_country_flag = SAF_sent_equipment_3
					}
				}
			}
		}
	}
}

SAF_german_coup_equipment_GER_fighters_20 = {
	if = {
		limit = { is_ai = yes }
		effect_tooltip = {
			send_equipment = {
				target = SAF
				type = fighter_equipment_1
				amount = 20
			}
			add_manpower = -300
			SAF = { add_manpower = 300 }
		}
		
		hidden_effect = {
			add_equipment_to_stockpile = {
				type = fighter_equipment_1
				amount = -20
			}
			add_manpower = -300
			
			SAF = {
				add_equipment_to_stockpile = {
					type = fighter_equipment_1
					amount = 20
					producer = GER
				}
				add_manpower = 300
			}
		}
		
		else = {
			send_equipment = {
				target = SAF
				type = fighter_equipment_1
				amount = 20
			}
			add_manpower = -300
			
			SAF = { add_manpower = 300 }
		}
	}
}

SAF_german_coup_equipment_GER_light_tank_20 = {
	if = { #TODO_GABRIEL: fix tanks for dlc/nondlc
		limit = { is_ai = yes }
		effect_tooltip = {
			send_equipment = {
				target = SAF
				type = light_tank_chassis_1
				amount = 20
			}
			add_manpower = -500
			SAF = { add_manpower = 500 }
		}
		
		hidden_effect = {
			add_equipment_to_stockpile = {
				type = light_tank_chassis_1
				amount = -20
			}
			add_manpower = -500

			SAF = {
				add_equipment_to_stockpile = {
					type = light_tank_chassis_1
					amount = 20
					producer = GER
				}
				add_manpower = 500
			}
		}
		
		else = {
			send_equipment = {
				target = SAF
				type = light_tank_chassis_1
				amount = 20
			}
			add_manpower = -500
			SAF = { add_manpower = 500 }
		}
	}
}

SAF_german_coup_inf_GER_equipment_200 = {
	if = {
		limit = { is_ai = yes }
		effect_tooltip = {
			send_equipment = {
				target = SAF
				type = infantry_equipment_1
				amount = 200
			}
			send_equipment = {
				target = SAF
				type = artillery_equipment_1
				amount = 10
			}
			if = {
				limit = {
					has_equipment = {
						support_equipment_1 > 19
					}
				}
				send_equipment = {
					target = SAF
					type = support_equipment_1
					amount = 20
				}
			}
			add_manpower = -1000
			SAF = { add_manpower = 1000 }
		}
		
		hidden_effect = {
			add_manpower = -1000
			add_equipment_to_stockpile = {
				type = infantry_equipment_1
				amount = -200
			}
			add_equipment_to_stockpile = {
				type = artillery_equipment_1
				amount = -10
				producer = GER
			}
			SAF = {
				add_manpower = 1000
				add_equipment_to_stockpile = {
					type = infantry_equipment_1
					amount = 200
					producer = GER
				}
				add_equipment_to_stockpile = {
					type = artillery_equipment_1
					amount = 10
					producer = GER
				}
			}
			if = {
				limit = {
					has_equipment = {
						support_equipment_1 > 19
					}
				}
				send_equipment = {
					target = SAF
					type = support_equipment_1
					amount = 20
				}
			}
		}
		
		else = {
			send_equipment = {
				target = SAF
				type = infantry_equipment_1
				amount = 200
			}
			send_equipment = {
				target = SAF
				type = artillery_equipment_1
				amount = 10
			}
			if = {
				limit = {
					has_equipment = {
						support_equipment_1 > 19
					}
				}
				send_equipment = {
					target = SAF
					type = support_equipment_1
					amount = 20
				}
			}
			add_manpower = -1000
			SAF = { add_manpower = 1000 }
		}
	}
}

SAF_german_coup_equipment_HOL_fighters_20 = {
	if = {
		limit = { is_ai = yes }
		effect_tooltip = {
			send_equipment = {
				target = SAF
				type = fighter_equipment_1
				amount = 20
			}
			add_manpower = -300
			SAF = { add_manpower = 300 }
		}
		
		hidden_effect = {
			add_equipment_to_stockpile = {
				type = fighter_equipment_1
				amount = -20
			}
			add_manpower = -300
			
			SAF = {
				add_equipment_to_stockpile = {
					type = fighter_equipment_1
					amount = 20
					producer = HOL
				}
				add_manpower = 300
			}
		}
		
		else = {
			send_equipment = {
				target = SAF
				type = fighter_equipment_1
				amount = 20
			}
			add_manpower = -300
			
			SAF = { add_manpower = 300 }
		}
	}
}

SAF_german_coup_equipment_HOL_light_tank_20 = {
	if = {
		limit = { is_ai = yes }
		effect_tooltip = {
			send_equipment = {
				target = SAF
				type = light_tank_equipment_1
				amount = 20
			}
			add_manpower = -500
			SAF = { add_manpower = 500 }
		}
		
		hidden_effect = {
			add_equipment_to_stockpile = {
				type = light_tank_equipment_1
				amount = -20
			}
			add_manpower = -500

			SAF = {
				add_equipment_to_stockpile = {
					type = light_tank_equipment_1
					amount = 20
					producer = HOL
				}
				add_manpower = 500
			}
		}
		
		else = {
			send_equipment = {
				target = SAF
				type = light_tank_equipment_1
				amount = 20
			}
			add_manpower = -500
			SAF = { add_manpower = 500 }
		}
	}
}

SAF_german_coup_inf_HOL_equipment_200 = {
	if = {
		limit = { is_ai = yes }
		effect_tooltip = {
			send_equipment = {
				target = SAF
				type = infantry_equipment_1
				amount = 200
			}
			send_equipment = {
				target = SAF
				type = artillery_equipment_1
				amount = 10
			}
			if = {
				limit = {
					has_equipment = {
						support_equipment_1 > 19
					}
				}
				send_equipment = {
					target = SAF
					type = support_equipment_1
					amount = 20
				}
			}
			add_manpower = -1000
			SAF = { add_manpower = 1000 }
		}
		
		hidden_effect = {
			add_manpower = -1000
			add_equipment_to_stockpile = {
				type = infantry_equipment_1
				amount = -200
			}
			add_equipment_to_stockpile = {
				type = artillery_equipment_1
				amount = -10
				producer = HOL
			}
			SAF = {
				add_manpower = 1000
				add_equipment_to_stockpile = {
					type = infantry_equipment_1
					amount = 200
					producer = HOL
				}
				add_equipment_to_stockpile = {
					type = artillery_equipment_1
					amount = 10
					producer = HOL
				}
			}
			if = {
				limit = {
					has_equipment = {
						support_equipment_1 > 19
					}
				}
				send_equipment = {
					target = SAF
					type = support_equipment_1
					amount = 20
				}
			}
		}
		
		else = {
			send_equipment = {
				target = SAF
				type = infantry_equipment_1
				amount = 200
			}
			send_equipment = {
				target = SAF
				type = artillery_equipment_1
				amount = 10
			}
			if = {
				limit = {
					has_equipment = {
						support_equipment_1 > 19
					}
				}
				send_equipment = {
					target = SAF
					type = support_equipment_1
					amount = 20
				}
			}
			add_manpower = -1000
			SAF = { add_manpower = 1000 }
		}
	}
}