#####################

###  ##  #  # # #  ## 
 #  #  # ## # # # #   
 #  #### # ## ##   #  
 #  #  # #  # # #   # 
 #  #  # #  # # # ## 

 #################### 



#####################

 ## #  # ### ###   ## 
#   #  #  #  #  # #   
 #  ####  #  ###   #  
  # #  #  #  #      # 
##  #  # ### #    ##  
 
#####################

SPR_secn_vanilla_organization = {
	include = generic_task_force_ship_organization
	icon = GFX_idea_generic_naval_manufacturer_3
	allowed = {	
		NOT = { has_dlc = "La Resistance" }
		tag = SPR
	}
}

SPR_secn_organization = {
	include = generic_battle_line_ship_organization
	icon = GFX_idea_SPR_sociedad_espanola_de_construccion_naval
	allowed = {	
		has_dlc = "La Resistance"
		tag = SPR
	}
}

SPR_euskalduna_organization = {
	include = generic_raider_ship_organization
	icon = GFX_idea_SPR_euskalduna
	allowed = {	
		has_dlc = "La Resistance"
		tag = SPR
	}
}

###########################

###  #    ##  #  # ###  ## 
#  # #   #  # ## # #   #   
###  #   #### # ## ##   #  
#    #   #  # #  # #     # 
#    ### #  # #  # ### ##  

###########################

SPR_casa_vanilla_organization = {
	include = generic_general_aircraft_organization
	icon = GFX_idea_generic_air_manufacturer_2
	allowed = {	
		NOT = { has_dlc = "La Resistance" }
		tag = SPR
	}
}

SPR_casa_organization = {
	include = generic_medium_aircraft_organization
	icon = GFX_idea_SPR_casa
	allowed = {	
		has_dlc = "La Resistance"
		tag = SPR
	}

	available = {
		OR = {
			custom_trigger_tooltip = {
				tooltip = SPR_scw_not_in_progress_tt
				NOT = { SPR_scw_in_progress = yes }
			}
			FROM = { controls_state = 167 }
		}
	}
}

SPR_hispano_aviacion_organization = {
	include = generic_light_aircraft_organization
	icon = GFX_idea_SPR_hispano_aviacion
	allowed = {
		OR = {
			AND = {
				has_dlc = "La Resistance"
				tag = SPR
			}					
			AND = {
				has_dlc = "By Blood Alone"
				tag = SWI
			}
		}
	}

	available = {
		# When in a Foreign MIO, countries need to be at peace with original country
		IF = {
			limit = {
				FROM = { NOT = { original_tag = SPR } }
			}
			FROM = { NOT = { has_war_with = SPR } }
		}

		if = {
			limit = {
				FROM = { tag = SWI }
			}
			custom_trigger_tooltip = {
				tooltip = SPR_scw_not_in_progress_tt
				NOT = { SPR_scw_in_progress = yes }
			}	
		}
		else = {
			FROM = { controls_state = 169 }
			custom_trigger_tooltip = {
				tooltip = SPR_scw_not_in_progress_tt
				NOT = { SPR_scw_in_progress = yes }
			}
		}
	}
}


################################### 

#   #  ##  ### ### ###  ### ### #   
## ## #  #  #  #   #  #  #  #   #   
# # # ####  #  ##  ###   #  ##  #   
#   # #  #  #  #   #  #  #  #   #   
#   # #  #  #  ### #  # ### ### ### 


###################################

SPR_star_bonifacio_echeverria_organization = {
	include = generic_infantry_equipment_organization
	icon = GFX_idea_SPR_star_bonifacio_echeverria
	allowed = {	
		has_dlc = "La Resistance"
		tag = SPR
	}

	available = {
		OR = {
			custom_trigger_tooltip = {
				tooltip = SPR_scw_not_in_progress_tt
				NOT = { SPR_scw_in_progress = yes }
			}
			FROM = { controls_state = 792 }
		}
	}
}

SPR_esperanza_y_cia_organization = {
	include = generic_artillery_organization
	icon = GFX_idea_SPR_esperanza_y_cia
	allowed = {	
		has_dlc = "La Resistance"
		tag = SPR
	}

	available = {
		OR = {
			custom_trigger_tooltip = {
				tooltip = SPR_scw_not_in_progress_tt
				NOT = { SPR_scw_in_progress = yes }
			}
			FROM = { controls_state = 792 }
		}
	}
}

SPR_llama_gabilondo_y_cia_organization = {
	include = generic_support_equipment_organization
	icon = GFX_idea_SPR_llama_gabilondo_y_cia_sa
	allowed = {	
		has_dlc = "La Resistance"
		tag = SPR
	}

	available = {
		OR = {
			custom_trigger_tooltip = {
				tooltip = SPR_scw_not_in_progress_tt
				NOT = { SPR_scw_in_progress = yes }
			}
			FROM = { controls_state = 792 }
		}
	}
}

SPR_hispano_suiza_organization = {
	include = generic_motorized_mechanized_organization
	icon = GFX_idea_SPR_hispano_suiza
	
	allowed = {
		OR = {
			AND = {
				has_dlc = "La Resistance"
				tag = SPR
			}					
			AND = {
				has_dlc = "By Blood Alone"
				tag = SWI
			}
		}
	}

	available = {
		# When in a Foreign MIO, countries need to be at peace with original country
		IF = {
			limit = {
				FROM = { NOT = { original_tag = SPR } }
			}
			FROM = { NOT = { has_war_with = SPR } }
		}
		
		if = {
			limit = {
				FROM = { tag = SWI }
			}
			custom_trigger_tooltip = {
				tooltip = SPR_scw_not_in_progress_tt
				NOT = { SPR_scw_in_progress = yes }
			}	
		}
		else = {
			FROM = { controls_state = 169 }
			custom_trigger_tooltip = {
				tooltip = SPR_scw_not_in_progress_tt
				NOT = { SPR_scw_in_progress = yes }
			}
		}
	}
	ai_will_do = {
		factor = 1
		modifier = {
			factor = 0
			FROM = { original_tag = SWI }
			NOT = { has_global_flag = scw_over } 
		}
	}
}