SPR_the_inevitable_civil_war = {

	SPA_military_plot_nationalists = {

		priority = 10

		icon = generic_ignite_civil_war

		available = {
			hidden_trigger = { always = no }
		}

		days_mission_timeout = 250

		fire_only_once = yes

		activation = {
			has_country_flag = SPR_spanish_elections_flag
			NOT = { has_global_flag = spanish_civil_war }
		}

		visible = {
			tag = SPR
			has_completed_focus = SPA_a_great_spain
			has_country_flag = SPR_spanish_elections_flag
			NOT = { has_global_flag = spanish_civil_war }
		}

		cancel_if_not_visible = yes

		is_good = yes

		timeout_effect = {
			country_event = lar_spain.2
			if = {
				limit = {
					has_idea = SPA_awaiting_the_rebellion
				}
				remove_ideas = SPA_awaiting_the_rebellion
			}
		}
	}

	SPR_military_plot_republicans = {

		priority = 10

		icon = generic_ignite_civil_war

		available = {
			hidden_trigger = { always = no }
		}

		days_mission_timeout = 250

		fire_only_once = yes

		activation = {
			has_country_flag = SPR_spanish_elections_flag
			NOT = { has_global_flag = spanish_civil_war }
		}

		visible = {
			tag = SPR
			has_completed_focus = SPR_the_popular_front
			has_country_flag = SPR_spanish_elections_flag
			NOT = { has_global_flag = spanish_civil_war }
		}

		cancel_if_not_visible = yes

		is_good = no

		timeout_effect = {
			country_event = lar_spain.2
		}
	}

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

	SPA_primo_de_rivera_speech = {

		icon = eng_propaganda_campaigns

		allowed = {
			tag = SPR
		}

		available = {
			NOT = {
				has_country_flag = SPA_primo_de_rivera_imprisoned
				has_country_flag = SPR_inevitable_civil_war_in_progress_flag
			}
		}

		cost = 30

		fire_only_once = no

		ai_will_do = {
			base = 200
		}

		days_remove = 37

		modifier = {
			
		}

		visible = {
			tag = SPR
			has_country_flag = SPR_spanish_elections_flag
			has_completed_focus = SPA_a_great_spain
			NOT = { has_global_flag = spanish_civil_war }
		}

		complete_effect = {
			set_country_flag = SPR_inevitable_civil_war_in_progress_flag
		}

		remove_effect = {
			add_popularity = {
			    ideology = fascism
			    popularity = 0.05
			}
			add_days_mission_timeout = {
				mission = SPA_military_plot_nationalists
				days = -36
			}
			clr_country_flag = SPR_inevitable_civil_war_in_progress_flag
			if = {
				limit = {
					NOT = { has_country_flag = SPR_primo_de_rivera_first_speech }
				}
				set_country_flag = SPR_primo_de_rivera_first_speech
			}
		}

	}

	SPR_imprison_primo_de_rivera = {

		icon = generic_arrest

		allowed = {
			tag = SPR
		}

		available = {
			has_country_flag = SPR_primo_de_rivera_first_speech
			NOT = {
				has_country_flag = SPA_primo_de_rivera_imprisoned
				has_country_flag = SPR_inevitable_civil_war_in_progress_flag
			}
		}

		cost = 15

		fire_only_once = yes

		ai_will_do = {
			base = 200
		}

		days_remove = 37

		modifier = {
			
		}

		visible = {
			tag = SPR
			has_country_flag = SPR_spanish_elections_flag
			has_completed_focus = SPR_the_popular_front
			NOT = { has_global_flag = spanish_civil_war }
		}

		complete_effect = {
			set_country_flag = SPR_inevitable_civil_war_in_progress_flag
		}

		remove_effect = {
			add_stability = 0.05
			add_political_power = 25
			add_days_mission_timeout = {
				mission = SPR_military_plot_republicans
				days = 37
			}
			clr_country_flag = SPR_inevitable_civil_war_in_progress_flag
			set_country_flag = SPA_primo_de_rivera_imprisoned
			custom_effect_tooltip = SPR_imprison_primo_de_rivera_tt
		}

	}

	SPA_political_assassination = {

		icon = generic_assassination

		allowed = {
			tag = SPR
		}

		available = {
			NOT = {
				has_country_flag = SPR_inevitable_civil_war_in_progress_flag
			}
		}

		cost = 30

		fire_only_once = no

		ai_will_do = {
			base = 200
		}

		days_remove = 37

		modifier = {
			
		}

		visible = {
			tag = SPR
			has_country_flag = SPR_spanish_elections_flag
			has_completed_focus = SPA_a_great_spain
			NOT = { has_global_flag = spanish_civil_war }
		}

		complete_effect = {
			set_country_flag = SPR_inevitable_civil_war_in_progress_flag
		}

		remove_effect = {
			add_stability = -0.05
			add_war_support = 0.1
			add_days_mission_timeout = {
				mission = SPA_military_plot_nationalists
				days = -36
			}
			clr_country_flag = SPR_inevitable_civil_war_in_progress_flag
			set_country_flag = SPA_political_assassination_flag
		}

	}

	SPR_political_arrest = {

		icon = generic_arrest

		allowed = {
			tag = SPR
		}

		available = {
			has_country_flag = SPA_political_assassination_flag
			NOT = {
				has_country_flag = SPR_inevitable_civil_war_in_progress_flag
			}
		}

		cost = 10

		fire_only_once = no

		ai_will_do = {
			base = 800
		}

		days_remove = 37

		modifier = {
			
		}

		visible = {
			tag = SPR
			has_country_flag = SPR_spanish_elections_flag
			has_completed_focus = SPR_the_popular_front
			NOT = { has_global_flag = spanish_civil_war }
		}

		complete_effect = {
			set_country_flag = SPR_inevitable_civil_war_in_progress_flag
		}

		remove_effect = {
			add_political_power = 25
			add_stability = 0.05
			add_days_mission_timeout = {
				mission = SPR_military_plot_republicans
				days = 37
			}
			clr_country_flag = SPR_inevitable_civil_war_in_progress_flag
			clr_country_flag = SPA_political_assassination_flag
		}

	}

	SPA_sway_leader_loyalty = {

		icon = generic_army_support

		allowed = {
			tag = SPR
		}

		available = {
			NOT = {
				has_country_flag = SPR_inevitable_civil_war_in_progress_flag
			}
		}

		cost = 30

		fire_only_once = no

		ai_will_do = {
			base = 200
		}

		days_remove = 37

		modifier = {
			
		}

		visible = {
			tag = SPR
			has_country_flag = SPR_spanish_elections_flag
			has_completed_focus = SPA_a_great_spain
			NOT = { has_global_flag = spanish_civil_war }
		}

		complete_effect = {
			set_country_flag = SPR_inevitable_civil_war_in_progress_flag
		}

		remove_effect = {
			add_days_mission_timeout = {
				mission = SPA_military_plot_nationalists
				days = -36
			}
			random_unit_leader = {
				limit = {
					NOT = { has_trait = trait_SPA_nationalist_sympathies }
					NOT = { has_id = 1108 }
				}
				add_unit_leader_trait = trait_SPA_nationalist_sympathies
				set_unit_leader_flag = SPA_swayed_leader_loyalty_flag
			}
			clr_country_flag = SPR_inevitable_civil_war_in_progress_flag
		}

	}

	SPR_secure_leader_loyalty = {

		icon = generic_military

		allowed = {
			tag = SPR
		}

		available = {
			NOT = {
				has_country_flag = SPR_inevitable_civil_war_in_progress_flag
			}
			any_army_leader = {
				has_unit_leader_flag = SPA_swayed_leader_loyalty_flag
			}
		}

		cost = 30

		fire_only_once = no

		ai_will_do = {
			base = 200
		}

		days_remove = 37

		modifier = {
			
		}

		visible = {
			tag = SPR
			has_country_flag = SPR_spanish_elections_flag
			has_completed_focus = SPR_the_popular_front
			NOT = { has_global_flag = spanish_civil_war }
		}

		complete_effect = {
			set_country_flag = SPR_inevitable_civil_war_in_progress_flag
		}

		remove_effect = {
			add_days_mission_timeout = {
				mission = SPR_military_plot_republicans
				days = 37
			}
			random_unit_leader = {
				limit = {
					has_trait = trait_SPA_nationalist_sympathies
					has_unit_leader_flag = SPA_swayed_leader_loyalty_flag
				}
				remove_unit_leader_trait = trait_SPA_nationalist_sympathies
				clr_unit_leader_flag = SPA_swayed_leader_loyalty_flag
			}
			clr_country_flag = SPR_inevitable_civil_war_in_progress_flag
		}

	}

	SPR_reassign_disloyal_leader = {

		icon = generic_army_support

		allowed = {
			tag = SPR
		}

		available = {
			NOT = {
				has_country_flag = SPR_inevitable_civil_war_in_progress_flag
			}
			any_army_leader = {
				has_trait = trait_SPA_nationalist_sympathies
			}
		}

		cost = 30

		fire_only_once = no

		ai_will_do = {
			base = 200
		}

		days_remove = 37

		modifier = {
			
		}

		visible = {
			tag = SPR
			has_country_flag = SPR_spanish_elections_flag
			has_completed_focus = SPR_the_popular_front
			NOT = { has_global_flag = spanish_civil_war }
		}

		complete_effect = {
			set_country_flag = SPR_inevitable_civil_war_in_progress_flag
		}

		remove_effect = {
			add_days_mission_timeout = {
				mission = SPR_military_plot_republicans
				days = 37
			}
			random_army_leader = {
				limit = {
					has_trait = trait_SPA_nationalist_sympathies
					NOT = {
						has_unit_leader_flag = SPA_swayed_leader_loyalty_flag
						has_unit_leader_flag = SPR_reassigned_flag
					}
				}
				custom_effect_tooltip = SPR_reassign_disloyal_leader_tt
				set_unit_leader_flag = SPR_reassigned_flag # Generates trait upon SCW start that makes them useless for 60 days.
			}
			clr_country_flag = SPR_inevitable_civil_war_in_progress_flag
		}

	}

	SPA_suppress_the_strikes = {

		icon = generic_police_action

		allowed = {
			tag = SPR
		}

		available = {
			NOT = {
				has_country_flag = SPR_inevitable_civil_war_in_progress_flag
			}
			NOT = {
				custom_trigger_tooltip = {
					tooltip = SPA_suppress_the_strikes_tt
					has_idea = SPR_national_strikes_1
				}
			}
		}

		cost = 30

		fire_only_once = no

		ai_will_do = {
			base = 200
		}

		days_remove = 37

		modifier = {
			
		}

		visible = {
			tag = SPR
			has_country_flag = SPR_spanish_elections_flag
			has_completed_focus = SPA_a_great_spain
			NOT = { has_global_flag = spanish_civil_war }
		}

		complete_effect = {
			set_country_flag = SPR_inevitable_civil_war_in_progress_flag
		}

		remove_effect = {
			add_days_mission_timeout = {
				mission = SPA_military_plot_nationalists
				days = -36
			}
			SPR_suppress_the_strikes_increase = yes
			clr_country_flag = SPR_inevitable_civil_war_in_progress_flag
		}

	}

	SPR_concessions_to_the_left = {

		icon = eng_trade_unions_support

		allowed = {
			tag = SPR
		}

		available = {
			NOT = {
				has_country_flag = SPR_inevitable_civil_war_in_progress_flag
			}
			NOT = {
				custom_trigger_tooltip = {
					tooltip = SPA_suppress_the_strikes_tt
					has_idea = SPR_national_strikes_9
				}
			}
		}

		cost = 30

		fire_only_once = no

		ai_will_do = {
			base = 500
		}

		days_remove = 37

		modifier = {
			
		}

		visible = {
			tag = SPR
			has_country_flag = SPR_spanish_elections_flag
			has_completed_focus = SPR_the_popular_front
			NOT = { has_global_flag = spanish_civil_war }
		}

		complete_effect = {
			set_country_flag = SPR_inevitable_civil_war_in_progress_flag
		}

		remove_effect = {
			add_days_mission_timeout = {
				mission = SPR_military_plot_republicans
				days = 37
			}
			SPR_concessions_to_the_left_increase = yes
			clr_country_flag = SPR_inevitable_civil_war_in_progress_flag
		}

	}

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


	SPA_expand_influence_in_the_galicia_garrison = {

		icon = {
			key = spa_garrison_control_none
			trigger = {
				has_completed_focus = SPA_a_great_spain
				171 = { check_variable = { var = SPA_garrison_control value = 1 compare = equals } }
			}
		}
		icon = {
			key = spa_garrison_control_weak
			trigger = {
				has_completed_focus = SPA_a_great_spain
				171 = {
					check_variable = { var = SPA_garrison_control value = 2 compare = equals }
					NOT = { has_state_flag = SPA_northern_garrisons_state_flag }
				}
			}
		}
		icon = {
			key = spa_garrison_control_weak2
			trigger = {
				has_completed_focus = SPA_a_great_spain
				171 = {
					check_variable = { var = SPA_garrison_control value = 2 compare = equals }
					has_state_flag = SPA_northern_garrisons_state_flag
				}
			}
		}
		icon = {
			key = spa_garrison_control_strong
			trigger = {
				has_completed_focus = SPA_a_great_spain
				171 = {
					check_variable = { var = SPA_garrison_control value = 3 compare = equals }
					NOT = { has_state_flag = SPA_northern_garrisons_state_flag }
				}
			}
		}
		icon = {
			key = spa_garrison_control_strong2
			trigger = {
				has_completed_focus = SPA_a_great_spain
				171 = {
					check_variable = { var = SPA_garrison_control value = 3 compare = equals }
					has_state_flag = SPA_northern_garrisons_state_flag
				}
			}
		}
		icon = {
			key = spa_garrison_control_total
			trigger = {
				has_completed_focus = SPA_a_great_spain
				171 = { check_variable = { var = SPA_garrison_control value = 4 compare = greater_than_or_equals } }
			}
		}
		icon = {
			key = spr_garrison_control_none
			trigger = {
				has_completed_focus = SPR_the_popular_front
				171 = { check_variable = { var = SPA_garrison_control value = 1 compare = equals } }
			}
		}
		icon = {
			key = spr_garrison_control_weak
			trigger = {
				has_completed_focus = SPR_the_popular_front
				171 = {
					check_variable = { var = SPA_garrison_control value = 2 compare = equals }
					NOT = { has_state_flag = SPA_northern_garrisons_state_flag }
				}
			}
		}
		icon = {
			key = spr_garrison_control_weak2
			trigger = {
				has_completed_focus = SPR_the_popular_front
				171 = {
					check_variable = { var = SPA_garrison_control value = 2 compare = equals }
					has_state_flag = SPA_northern_garrisons_state_flag
				}
			}
		}
		icon = {
			key = spr_garrison_control_strong
			trigger = {
				has_completed_focus = SPR_the_popular_front
				171 = {
					check_variable = { var = SPA_garrison_control value = 3 compare = equals }
					NOT = { has_state_flag = SPA_northern_garrisons_state_flag }
				}
			}
		}
		icon = {
			key = spr_garrison_control_strong2
			trigger = {
				has_completed_focus = SPR_the_popular_front
				171 = {
					check_variable = { var = SPA_garrison_control value = 3 compare = equals }
					has_state_flag = SPA_northern_garrisons_state_flag
				}
			}
		}
		icon = {
			key = spr_garrison_control_total
			trigger = {
				has_completed_focus = SPR_the_popular_front
				171 = { check_variable = { var = SPA_garrison_control value = 4 compare = greater_than_or_equals } }
			}
		}

		available = {
			has_full_control_of_state = 171
			if = {
				limit = {
					has_completed_focus = SPA_a_great_spain
				}
				custom_trigger_tooltip = {
					tooltip = SPA_expand_influence_nationalists_trigger_tt
					171 = { check_variable = { var = SPA_garrison_control value = 4 compare = less_than } }
				}
			}
			if = {
				limit = {
					has_completed_focus = SPR_the_popular_front
				}
				custom_trigger_tooltip = {
					tooltip = SPR_expand_influence_republicans_trigger_tt
					171 = { check_variable = { var = SPA_garrison_control value = 2 compare = greater_than_or_equals } }
				}
			}
			NOT = {
				has_country_flag = SPA_already_expanding_influence_flag
			}
		}

		highlight_states = {
			highlight_state_targets = {
				state = 171
			} 
		}

		on_map_mode = map_only

		cost = 171.SPA_garrison_control_cost?10

		fire_only_once = no

		days_remove = 14

		visible = {
			NOT = { has_global_flag = spanish_civil_war }
			has_country_flag = SPR_spanish_elections_flag
		}

		cancel_if_not_visible = yes

		complete_effect = {
			set_country_flag = SPA_already_expanding_influence_flag
		}

		remove_effect = {
			if = {
				limit = {
					has_completed_focus = SPA_a_great_spain
				}
				171 = {
					custom_effect_tooltip = SPA_expand_influence_nationalists_tt
					hidden_effect = {
						if = {
							limit = { check_variable = { SPA_garrison_control < 4 } }
							
							add_to_variable = { var = SPA_garrison_control value = 1 }
							SPR = { add_to_variable = { var = spa_civil_war_divisions_counter_var value = 1 } }
							SPR = { subtract_from_variable = { var = spr_civil_war_divisions_counter_var value = 1 } }
						}
					}
					SPA_garrison_control_tooltip = yes
					SPA_garrison_control_cost_calculation = yes
				}
			}
			if = {
				limit = {
					has_completed_focus = SPR_the_popular_front
				}
				171 = {
					custom_effect_tooltip = SPR_expand_influence_republicans_tt
					hidden_effect = {
						subtract_from_variable = { var = SPA_garrison_control value = 1 }
						SPR = { subtract_from_variable = { var = spa_civil_war_divisions_counter_var value = 1 } }
						SPR = { add_to_variable = { var = spr_civil_war_divisions_counter_var value = 1 } }
					}
					SPA_garrison_control_tooltip = yes
					SPR_garrison_control_cost_calculation = yes
				}
			}
			clr_country_flag = SPA_already_expanding_influence_flag
		}

		ai_will_do = {
			base = 110
			modifier = {
				171 = { has_state_flag = SPR_recently_expanded_influence_flag }
				factor = 10
			}
			modifier = {
				has_completed_focus = SPA_a_great_spain
				NOT = { has_completed_focus = SPA_secure_the_northern_garrisons }
				factor = 0
			}
			modifier = {
				has_completed_focus = SPA_a_great_spain
				171 = { check_variable = { var = SPA_garrison_control value = 2 compare = greater_than_or_equals } }
				factor = 5
			}
			modifier = {
				has_completed_focus = SPA_a_great_spain
				171 = { check_variable = { var = SPA_garrison_control value = 3 compare = greater_than_or_equals } }
				factor = 5
			}
			modifier = {
				has_completed_focus = SPA_a_great_spain
				is_historical_focus_on = yes
				factor = 10
			}
		}
	}

	SPA_expand_influence_in_the_asturias_garrison = {

		icon = {
			key = spa_garrison_control_none
			trigger = {
				has_completed_focus = SPA_a_great_spain
				790 = { check_variable = { var = SPA_garrison_control value = 1 compare = equals } }
			}
		}
		icon = {
			key = spa_garrison_control_weak
			trigger = {
				has_completed_focus = SPA_a_great_spain
				790 = { check_variable = { var = SPA_garrison_control value = 2 compare = equals } }
			}
		}
		icon = {
			key = spa_garrison_control_strong
			trigger = {
				has_completed_focus = SPA_a_great_spain
				790 = { check_variable = { var = SPA_garrison_control value = 3 compare = equals } }
			}
		}
		icon = {
			key = spa_garrison_control_total
			trigger = {
				has_completed_focus = SPA_a_great_spain
				790 = { check_variable = { var = SPA_garrison_control value = 4 compare = greater_than_or_equals } }
			}
		}
		icon = {
			key = spr_garrison_control_none
			trigger = {
				has_completed_focus = SPR_the_popular_front
				790 = { check_variable = { var = SPA_garrison_control value = 1 compare = equals } }
			}
		}
		icon = {
			key = spr_garrison_control_weak
			trigger = {
				has_completed_focus = SPR_the_popular_front
				790 = { check_variable = { var = SPA_garrison_control value = 2 compare = equals } }
			}
		}
		icon = {
			key = spr_garrison_control_strong
			trigger = {
				has_completed_focus = SPR_the_popular_front
				790 = { check_variable = { var = SPA_garrison_control value = 3 compare = equals } }
			}
		}
		icon = {
			key = spr_garrison_control_total
			trigger = {
				has_completed_focus = SPR_the_popular_front
				790 = { check_variable = { var = SPA_garrison_control value = 4 compare = greater_than_or_equals } }
			}
		}

		available = {
			has_full_control_of_state = 790
			if = {
				limit = {
					has_completed_focus = SPA_a_great_spain
				}
				custom_trigger_tooltip = {
					tooltip = SPA_expand_influence_nationalists_trigger_tt
					790 = { check_variable = { var = SPA_garrison_control value = 4 compare = less_than } }
				}
			}
			if = {
				limit = {
					has_completed_focus = SPR_the_popular_front
				}
				custom_trigger_tooltip = {
					tooltip = SPR_expand_influence_republicans_trigger_tt
					790 = { check_variable = { var = SPA_garrison_control value = 2 compare = greater_than_or_equals } }
				}
			}
			NOT = {
				has_country_flag = SPA_already_expanding_influence_flag
			}
		}

		highlight_states = {
			highlight_state_targets = {
				state = 790
			} 
		}

		on_map_mode = map_only

		cost = 790.SPA_garrison_control_cost?10

		fire_only_once = no

		days_remove = 14

		visible = {
			NOT = { has_global_flag = spanish_civil_war }
			has_country_flag = SPR_spanish_elections_flag
		}

		cancel_if_not_visible = yes

		complete_effect = {
			set_country_flag = SPA_already_expanding_influence_flag
		}

		remove_effect = {
			if = {
				limit = {
					has_completed_focus = SPA_a_great_spain
				}
				790 = {
					custom_effect_tooltip = SPA_expand_influence_nationalists_tt
					set_state_flag = { flag = SPR_recently_expanded_influence_flag value = 1 days = 15 }
					hidden_effect = {
						if = {
							limit = { check_variable = { SPA_garrison_control < 4 } }
							
							add_to_variable = { var = SPA_garrison_control value = 1 }
							SPR = { add_to_variable = { var = spa_civil_war_divisions_counter_var value = 1 } }
							SPR = { subtract_from_variable = { var = spr_civil_war_divisions_counter_var value = 1 } }
						}
					}
					SPA_garrison_control_tooltip = yes
					SPA_garrison_control_cost_calculation = yes
				}
			}
			if = {
				limit = {
					has_completed_focus = SPR_the_popular_front
				}
				790 = {
					custom_effect_tooltip = SPR_expand_influence_republicans_tt
					set_state_flag = { flag = SPR_recently_expanded_influence_flag value = 1 days = 15 }
					hidden_effect = {
						subtract_from_variable = { var = SPA_garrison_control value = 1 }
						SPR = { subtract_from_variable = { var = spa_civil_war_divisions_counter_var value = 1 } }
						SPR = { add_to_variable = { var = spr_civil_war_divisions_counter_var value = 1 } }
					}
					SPA_garrison_control_tooltip = yes
					SPR_garrison_control_cost_calculation = yes
				}
			}
			clr_country_flag = SPA_already_expanding_influence_flag
		}

		ai_will_do = {
			base = 110
			modifier = {
				790 = { has_state_flag = SPR_recently_expanded_influence_flag }
				factor = 10
			}
			modifier = {
				has_completed_focus = SPA_a_great_spain
				790 = { check_variable = { var = SPA_garrison_control value = 2 compare = greater_than_or_equals } }
				factor = 5
			}
			modifier = {
				has_completed_focus = SPA_a_great_spain
				790 = { check_variable = { var = SPA_garrison_control value = 3 compare = greater_than_or_equals } }
				factor = 5
			}
			modifier = {
				has_completed_focus = SPA_a_great_spain
				is_historical_focus_on = yes
				factor = 0
			}
		}
	}

	SPA_expand_influence_in_the_leon_garrison = {

		icon = {
			key = spa_garrison_control_none
			trigger = {
				has_completed_focus = SPA_a_great_spain
				174 = { check_variable = { var = SPA_garrison_control value = 1 compare = equals } }
			}
		}
		icon = {
			key = spa_garrison_control_weak
			trigger = {
				has_completed_focus = SPA_a_great_spain
				174 = {
					check_variable = { var = SPA_garrison_control value = 2 compare = equals }
					NOT = { has_state_flag = SPA_northern_garrisons_state_flag }
				}
			}
		}
		icon = {
			key = spa_garrison_control_weak2
			trigger = {
				has_completed_focus = SPA_a_great_spain
				174 = {
					check_variable = { var = SPA_garrison_control value = 2 compare = equals }
					has_state_flag = SPA_northern_garrisons_state_flag
				}
			}
		}
		icon = {
			key = spa_garrison_control_strong
			trigger = {
				has_completed_focus = SPA_a_great_spain
				174 = {
					check_variable = { var = SPA_garrison_control value = 3 compare = equals }
					NOT = { has_state_flag = SPA_northern_garrisons_state_flag }
				}
			}
		}
		icon = {
			key = spa_garrison_control_strong2
			trigger = {
				has_completed_focus = SPA_a_great_spain
				174 = {
					check_variable = { var = SPA_garrison_control value = 3 compare = equals }
					has_state_flag = SPA_northern_garrisons_state_flag
				}
			}
		}
		icon = {
			key = spa_garrison_control_total
			trigger = {
				has_completed_focus = SPA_a_great_spain
				174 = { check_variable = { var = SPA_garrison_control value = 4 compare = greater_than_or_equals } }
			}
		}
		icon = {
			key = spr_garrison_control_none
			trigger = {
				has_completed_focus = SPR_the_popular_front
				174 = { check_variable = { var = SPA_garrison_control value = 1 compare = equals } }
			}
		}
		icon = {
			key = spr_garrison_control_weak
			trigger = {
				has_completed_focus = SPR_the_popular_front
				174 = {
					check_variable = { var = SPA_garrison_control value = 2 compare = equals }
					NOT = { has_state_flag = SPA_northern_garrisons_state_flag }
				}
			}
		}
		icon = {
			key = spr_garrison_control_weak2
			trigger = {
				has_completed_focus = SPR_the_popular_front
				174 = {
					check_variable = { var = SPA_garrison_control value = 2 compare = equals }
					has_state_flag = SPA_northern_garrisons_state_flag
				}
			}
		}
		icon = {
			key = spr_garrison_control_strong
			trigger = {
				has_completed_focus = SPR_the_popular_front
				174 = {
					check_variable = { var = SPA_garrison_control value = 3 compare = equals }
					NOT = { has_state_flag = SPA_northern_garrisons_state_flag }
				}
			}
		}
		icon = {
			key = spr_garrison_control_strong2
			trigger = {
				has_completed_focus = SPR_the_popular_front
				174 = {
					check_variable = { var = SPA_garrison_control value = 3 compare = equals }
					has_state_flag = SPA_northern_garrisons_state_flag
				}
			}
		}
		icon = {
			key = spr_garrison_control_total
			trigger = {
				has_completed_focus = SPR_the_popular_front
				174 = { check_variable = { var = SPA_garrison_control value = 4 compare = greater_than_or_equals } }
			}
		}

		available = {
			has_full_control_of_state = 174
			if = {
				limit = {
					has_completed_focus = SPA_a_great_spain
				}
				custom_trigger_tooltip = {
					tooltip = SPA_expand_influence_nationalists_trigger_tt
					174 = { check_variable = { var = SPA_garrison_control value = 4 compare = less_than } }
				}
			}
			if = {
				limit = {
					has_completed_focus = SPR_the_popular_front
				}
				custom_trigger_tooltip = {
					tooltip = SPR_expand_influence_republicans_trigger_tt
					174 = { check_variable = { var = SPA_garrison_control value = 2 compare = greater_than_or_equals } }
				}
			}
			NOT = {
				has_country_flag = SPA_already_expanding_influence_flag
			}
		}

		highlight_states = {
			highlight_state_targets = {
				state = 174
			} 
		}

		on_map_mode = map_only

		cost = 174.SPA_garrison_control_cost?10

		fire_only_once = no

		days_remove = 14

		visible = {
			NOT = { has_global_flag = spanish_civil_war }
			has_country_flag = SPR_spanish_elections_flag
		}

		cancel_if_not_visible = yes

		complete_effect = {
			set_country_flag = SPA_already_expanding_influence_flag
		}

		remove_effect = {
			if = {
				limit = {
					has_completed_focus = SPA_a_great_spain
				}
				174 = {
					custom_effect_tooltip = SPA_expand_influence_nationalists_tt
					set_state_flag = { flag = SPR_recently_expanded_influence_flag value = 1 days = 15 }
					hidden_effect = {
						if = {
							limit = { check_variable = { SPA_garrison_control < 4 } }
							
							add_to_variable = { var = SPA_garrison_control value = 1 }
							SPR = { add_to_variable = { var = spa_civil_war_divisions_counter_var value = 1 } }
							SPR = { subtract_from_variable = { var = spr_civil_war_divisions_counter_var value = 1 } }
						}
					}
					SPA_garrison_control_tooltip = yes
					SPA_garrison_control_cost_calculation = yes
				}
			}
			if = {
				limit = {
					has_completed_focus = SPR_the_popular_front
				}
				174 = {
					custom_effect_tooltip = SPR_expand_influence_republicans_tt
					set_state_flag = { flag = SPR_recently_expanded_influence_flag value = 1 days = 15 }
					hidden_effect = {
						subtract_from_variable = { var = SPA_garrison_control value = 1 }
						SPR = { subtract_from_variable = { var = spa_civil_war_divisions_counter_var value = 1 } }
						SPR = { add_to_variable = { var = spr_civil_war_divisions_counter_var value = 1 } }
					}
					SPA_garrison_control_tooltip = yes
					SPR_garrison_control_cost_calculation = yes
				}
			}
			clr_country_flag = SPA_already_expanding_influence_flag
		}

		ai_will_do = {
			base = 110
			modifier = {
				174 = { has_state_flag = SPR_recently_expanded_influence_flag }
				factor = 10
			}
			modifier = {
				has_completed_focus = SPA_a_great_spain
				NOT = { has_completed_focus = SPA_secure_the_northern_garrisons }
				factor = 0
			}
			modifier = {
				has_completed_focus = SPA_a_great_spain
				174 = { check_variable = { var = SPA_garrison_control value = 2 compare = greater_than_or_equals } }
				factor = 5
			}
			modifier = {
				has_completed_focus = SPA_a_great_spain
				174 = { check_variable = { var = SPA_garrison_control value = 3 compare = greater_than_or_equals } }
				factor = 5
			}
			modifier = {
				has_completed_focus = SPA_a_great_spain
				is_historical_focus_on = yes
				factor = 10
			}
		}
	}

	SPA_expand_influence_in_the_valladolid_garrison = {

		icon = {
			key = spa_garrison_control_none
			trigger = {
				has_completed_focus = SPA_a_great_spain
				791 = { check_variable = { var = SPA_garrison_control value = 1 compare = equals } }
			}
		}
		icon = {
			key = spa_garrison_control_weak
			trigger = {
				has_completed_focus = SPA_a_great_spain
				791 = {
					check_variable = { var = SPA_garrison_control value = 2 compare = equals }
					NOT = { has_state_flag = SPA_northern_garrisons_state_flag }
				}
			}
		}
		icon = {
			key = spa_garrison_control_weak2
			trigger = {
				has_completed_focus = SPA_a_great_spain
				791 = {
					check_variable = { var = SPA_garrison_control value = 2 compare = equals }
					has_state_flag = SPA_northern_garrisons_state_flag
				}
			}
		}
		icon = {
			key = spa_garrison_control_strong
			trigger = {
				has_completed_focus = SPA_a_great_spain
				791 = {
					check_variable = { var = SPA_garrison_control value = 3 compare = equals }
					NOT = { has_state_flag = SPA_northern_garrisons_state_flag }
				}
			}
		}
		icon = {
			key = spa_garrison_control_strong2
			trigger = {
				has_completed_focus = SPA_a_great_spain
				791 = {
					check_variable = { var = SPA_garrison_control value = 3 compare = equals }
					has_state_flag = SPA_northern_garrisons_state_flag
				}
			}
		}
		icon = {
			key = spa_garrison_control_total
			trigger = {
				has_completed_focus = SPA_a_great_spain
				791 = { check_variable = { var = SPA_garrison_control value = 4 compare = greater_than_or_equals } }
			}
		}
		icon = {
			key = spr_garrison_control_none
			trigger = {
				has_completed_focus = SPR_the_popular_front
				791 = { check_variable = { var = SPA_garrison_control value = 1 compare = equals } }
			}
		}
		icon = {
			key = spr_garrison_control_weak
			trigger = {
				has_completed_focus = SPR_the_popular_front
				791 = {
					check_variable = { var = SPA_garrison_control value = 2 compare = equals }
					NOT = { has_state_flag = SPA_northern_garrisons_state_flag }
				}
			}
		}
		icon = {
			key = spr_garrison_control_weak2
			trigger = {
				has_completed_focus = SPR_the_popular_front
				791 = {
					check_variable = { var = SPA_garrison_control value = 2 compare = equals }
					has_state_flag = SPA_northern_garrisons_state_flag
				}
			}
		}
		icon = {
			key = spr_garrison_control_strong
			trigger = {
				has_completed_focus = SPR_the_popular_front
				791 = {
					check_variable = { var = SPA_garrison_control value = 3 compare = equals }
					NOT = { has_state_flag = SPA_northern_garrisons_state_flag }
				}
			}
		}
		icon = {
			key = spr_garrison_control_strong2
			trigger = {
				has_completed_focus = SPR_the_popular_front
				791 = {
					check_variable = { var = SPA_garrison_control value = 3 compare = equals }
					has_state_flag = SPA_northern_garrisons_state_flag
				}
			}
		}
		icon = {
			key = spr_garrison_control_total
			trigger = {
				has_completed_focus = SPR_the_popular_front
				791 = { check_variable = { var = SPA_garrison_control value = 4 compare = greater_than_or_equals } }
			}
		}

		available = {
			has_full_control_of_state = 791
			if = {
				limit = {
					has_completed_focus = SPA_a_great_spain
				}
				custom_trigger_tooltip = {
					tooltip = SPA_expand_influence_nationalists_trigger_tt
					791 = { check_variable = { var = SPA_garrison_control value = 4 compare = less_than } }
				}
			}
			if = {
				limit = {
					has_completed_focus = SPR_the_popular_front
				}
				custom_trigger_tooltip = {
					tooltip = SPR_expand_influence_republicans_trigger_tt
					791 = { check_variable = { var = SPA_garrison_control value = 2 compare = greater_than_or_equals } }
				}
			}
			NOT = {
				has_country_flag = SPA_already_expanding_influence_flag
			}
		}

		highlight_states = {
			highlight_state_targets = {
				state = 791
			} 
		}

		on_map_mode = map_only

		cost = 791.SPA_garrison_control_cost?10

		fire_only_once = no

		days_remove = 14

		visible = {
			NOT = { has_global_flag = spanish_civil_war }
			has_country_flag = SPR_spanish_elections_flag
		}

		cancel_if_not_visible = yes

		complete_effect = {
			set_country_flag = SPA_already_expanding_influence_flag
		}

		remove_effect = {
			if = {
				limit = {
					has_completed_focus = SPA_a_great_spain
				}
				791 = {
					custom_effect_tooltip = SPA_expand_influence_nationalists_tt
					set_state_flag = { flag = SPR_recently_expanded_influence_flag value = 1 days = 15 }
					hidden_effect = {
						if = {
							limit = { check_variable = { SPA_garrison_control < 4 } }
							
							add_to_variable = { var = SPA_garrison_control value = 1 }
							SPR = { add_to_variable = { var = spa_civil_war_divisions_counter_var value = 1 } }
							SPR = { subtract_from_variable = { var = spr_civil_war_divisions_counter_var value = 1 } }
						}
					}
					SPA_garrison_control_tooltip = yes
					SPA_garrison_control_cost_calculation = yes
				}
			}
			if = {
				limit = {
					has_completed_focus = SPR_the_popular_front
				}
				791 = {
					custom_effect_tooltip = SPR_expand_influence_republicans_tt
					set_state_flag = { flag = SPR_recently_expanded_influence_flag value = 1 days = 15 }
					hidden_effect = {
						subtract_from_variable = { var = SPA_garrison_control value = 1 }
						SPR = { subtract_from_variable = { var = spa_civil_war_divisions_counter_var value = 1 } }
						SPR = { add_to_variable = { var = spr_civil_war_divisions_counter_var value = 1 } }
					}
					SPA_garrison_control_tooltip = yes
					SPR_garrison_control_cost_calculation = yes
				}
			}
			clr_country_flag = SPA_already_expanding_influence_flag
		}

		ai_will_do = {
			base = 110
			modifier = {
				791 = { has_state_flag = SPR_recently_expanded_influence_flag }
				factor = 10
			}
			modifier = {
				has_completed_focus = SPA_a_great_spain
				NOT = { has_completed_focus = SPA_secure_the_northern_garrisons }
				factor = 0
			}
			modifier = {
				has_completed_focus = SPA_a_great_spain
				791 = { check_variable = { var = SPA_garrison_control value = 2 compare = greater_than_or_equals } }
				factor = 5
			}
			modifier = {
				has_completed_focus = SPA_a_great_spain
				791 = { check_variable = { var = SPA_garrison_control value = 3 compare = greater_than_or_equals } }
				factor = 5
			}
			modifier = {
				has_completed_focus = SPA_a_great_spain
				is_historical_focus_on = yes
				factor = 10
			}
		}
	}

	SPA_expand_influence_in_the_burgos_garrison = {

		icon = {
			key = spa_garrison_control_none
			trigger = {
				has_completed_focus = SPA_a_great_spain
				176 = { check_variable = { var = SPA_garrison_control value = 1 compare = equals } }
			}
		}
		icon = {
			key = spa_garrison_control_weak
			trigger = {
				has_completed_focus = SPA_a_great_spain
				176 = {
					check_variable = { var = SPA_garrison_control value = 2 compare = equals }
					NOT = { has_state_flag = SPA_northern_garrisons_state_flag }
				}
			}
		}
		icon = {
			key = spa_garrison_control_weak2
			trigger = {
				has_completed_focus = SPA_a_great_spain
				176 = {
					check_variable = { var = SPA_garrison_control value = 2 compare = equals }
					has_state_flag = SPA_northern_garrisons_state_flag
				}
			}
		}
		icon = {
			key = spa_garrison_control_strong
			trigger = {
				has_completed_focus = SPA_a_great_spain
				176 = {
					check_variable = { var = SPA_garrison_control value = 3 compare = equals }
					NOT = { has_state_flag = SPA_northern_garrisons_state_flag }
				}
			}
		}
		icon = {
			key = spa_garrison_control_strong2
			trigger = {
				has_completed_focus = SPA_a_great_spain
				176 = {
					check_variable = { var = SPA_garrison_control value = 3 compare = equals }
					has_state_flag = SPA_northern_garrisons_state_flag
				}
			}
		}
		icon = {
			key = spa_garrison_control_total
			trigger = {
				has_completed_focus = SPA_a_great_spain
				176 = { check_variable = { var = SPA_garrison_control value = 4 compare = greater_than_or_equals } }
			}
		}
		icon = {
			key = spr_garrison_control_none
			trigger = {
				has_completed_focus = SPR_the_popular_front
				176 = { check_variable = { var = SPA_garrison_control value = 1 compare = equals } }
			}
		}
		icon = {
			key = spr_garrison_control_weak
			trigger = {
				has_completed_focus = SPR_the_popular_front
				176 = {
					check_variable = { var = SPA_garrison_control value = 2 compare = equals }
					NOT = { has_state_flag = SPA_northern_garrisons_state_flag }
				}
			}
		}
		icon = {
			key = spr_garrison_control_weak2
			trigger = {
				has_completed_focus = SPR_the_popular_front
				176 = {
					check_variable = { var = SPA_garrison_control value = 2 compare = equals }
					has_state_flag = SPA_northern_garrisons_state_flag
				}
			}
		}
		icon = {
			key = spr_garrison_control_strong
			trigger = {
				has_completed_focus = SPR_the_popular_front
				176 = {
					check_variable = { var = SPA_garrison_control value = 3 compare = equals }
					NOT = { has_state_flag = SPA_northern_garrisons_state_flag }
				}
			}
		}
		icon = {
			key = spr_garrison_control_strong2
			trigger = {
				has_completed_focus = SPR_the_popular_front
				176 = {
					check_variable = { var = SPA_garrison_control value = 3 compare = equals }
					has_state_flag = SPA_northern_garrisons_state_flag
				}
			}
		}
		icon = {
			key = spr_garrison_control_total
			trigger = {
				has_completed_focus = SPR_the_popular_front
				176 = { check_variable = { var = SPA_garrison_control value = 4 compare = greater_than_or_equals } }
			}
		}

		available = {
			has_full_control_of_state = 176
			if = {
				limit = {
					has_completed_focus = SPA_a_great_spain
				}
				custom_trigger_tooltip = {
					tooltip = SPA_expand_influence_nationalists_trigger_tt
					176 = { check_variable = { var = SPA_garrison_control value = 4 compare = less_than } }
				}
			}
			if = {
				limit = {
					has_completed_focus = SPR_the_popular_front
				}
				custom_trigger_tooltip = {
					tooltip = SPR_expand_influence_republicans_trigger_tt
					176 = { check_variable = { var = SPA_garrison_control value = 2 compare = greater_than_or_equals } }
				}
			}
			NOT = {
				has_country_flag = SPA_already_expanding_influence_flag
			}
		}

		highlight_states = {
			highlight_state_targets = {
				state = 176
			} 
		}

		on_map_mode = map_only

		cost = 176.SPA_garrison_control_cost?10

		fire_only_once = no

		days_remove = 14

		visible = {
			NOT = { has_global_flag = spanish_civil_war }
			has_country_flag = SPR_spanish_elections_flag
		}

		cancel_if_not_visible = yes

		complete_effect = {
			set_country_flag = SPA_already_expanding_influence_flag
		}

		remove_effect = {
			if = {
				limit = {
					has_completed_focus = SPA_a_great_spain
				}
				176 = {
					custom_effect_tooltip = SPA_expand_influence_nationalists_tt
					set_state_flag = { flag = SPR_recently_expanded_influence_flag value = 1 days = 15 }
					hidden_effect = {
						if = {
							limit = { check_variable = { SPA_garrison_control < 4 } }
							
							add_to_variable = { var = SPA_garrison_control value = 1 }
							SPR = { add_to_variable = { var = spa_civil_war_divisions_counter_var value = 1 } }
							SPR = { subtract_from_variable = { var = spr_civil_war_divisions_counter_var value = 1 } }
						}
					}
					SPA_garrison_control_tooltip = yes
					SPA_garrison_control_cost_calculation = yes
				}
			}
			if = {
				limit = {
					has_completed_focus = SPR_the_popular_front
				}
				176 = {
					custom_effect_tooltip = SPR_expand_influence_republicans_tt
					set_state_flag = { flag = SPR_recently_expanded_influence_flag value = 1 days = 15 }
					hidden_effect = {
						subtract_from_variable = { var = SPA_garrison_control value = 1 }
						SPR = { subtract_from_variable = { var = spa_civil_war_divisions_counter_var value = 1 } }
						SPR = { add_to_variable = { var = spr_civil_war_divisions_counter_var value = 1 } }
					}
					SPA_garrison_control_tooltip = yes
					SPR_garrison_control_cost_calculation = yes
				}
			}
			clr_country_flag = SPA_already_expanding_influence_flag
		}

		ai_will_do = {
			base = 110
			modifier = {
				176 = { has_state_flag = SPR_recently_expanded_influence_flag }
				factor = 10
			}
			modifier = {
				has_completed_focus = SPA_a_great_spain
				NOT = { has_completed_focus = SPA_secure_the_northern_garrisons }
				factor = 0
			}
			modifier = {
				has_completed_focus = SPA_a_great_spain
				176 = { check_variable = { var = SPA_garrison_control value = 2 compare = greater_than_or_equals } }
				factor = 5
			}
			modifier = {
				has_completed_focus = SPA_a_great_spain
				176 = { check_variable = { var = SPA_garrison_control value = 3 compare = greater_than_or_equals } }
				factor = 5
			}
			modifier = {
				has_completed_focus = SPA_a_great_spain
				is_historical_focus_on = yes
				factor = 10
			}
		}
	}

	SPA_expand_influence_in_the_pais_vasco_garrison = {

		icon = {
			key = spa_garrison_control_none
			trigger = {
				has_completed_focus = SPA_a_great_spain
				792 = { check_variable = { var = SPA_garrison_control value = 1 compare = equals } }
			}
		}
		icon = {
			key = spa_garrison_control_weak
			trigger = {
				has_completed_focus = SPA_a_great_spain
				792 = { check_variable = { var = SPA_garrison_control value = 2 compare = equals } }
			}
		}
		icon = {
			key = spa_garrison_control_strong
			trigger = {
				has_completed_focus = SPA_a_great_spain
				792 = { check_variable = { var = SPA_garrison_control value = 3 compare = equals } }
			}
		}
		icon = {
			key = spa_garrison_control_total
			trigger = {
				has_completed_focus = SPA_a_great_spain
				792 = { check_variable = { var = SPA_garrison_control value = 4 compare = greater_than_or_equals } }
			}
		}
		icon = {
			key = spr_garrison_control_none
			trigger = {
				has_completed_focus = SPR_the_popular_front
				792 = { check_variable = { var = SPA_garrison_control value = 1 compare = equals } }
			}
		}
		icon = {
			key = spr_garrison_control_weak
			trigger = {
				has_completed_focus = SPR_the_popular_front
				792 = { check_variable = { var = SPA_garrison_control value = 2 compare = equals } }
			}
		}
		icon = {
			key = spr_garrison_control_strong
			trigger = {
				has_completed_focus = SPR_the_popular_front
				792 = { check_variable = { var = SPA_garrison_control value = 3 compare = equals } }
			}
		}
		icon = {
			key = spr_garrison_control_total
			trigger = {
				has_completed_focus = SPR_the_popular_front
				792 = { check_variable = { var = SPA_garrison_control value = 4 compare = greater_than_or_equals } }
			}
		}

		available = {
			has_full_control_of_state = 792
			if = {
				limit = {
					has_completed_focus = SPA_a_great_spain
				}
				custom_trigger_tooltip = {
					tooltip = SPA_expand_influence_nationalists_trigger_tt
					792 = { check_variable = { var = SPA_garrison_control value = 4 compare = less_than } }
				}
			}
			if = {
				limit = {
					has_completed_focus = SPR_the_popular_front
				}
				custom_trigger_tooltip = {
					tooltip = SPR_expand_influence_republicans_trigger_tt
					792 = { check_variable = { var = SPA_garrison_control value = 2 compare = greater_than_or_equals } }
				}
			}
			NOT = {
				has_country_flag = SPA_already_expanding_influence_flag
			}
		}

		highlight_states = {
			highlight_state_targets = {
				state = 792
			} 
		}

		on_map_mode = map_only

		cost = 792.SPA_garrison_control_cost?10

		fire_only_once = no

		days_remove = 14

		visible = {
			NOT = { has_global_flag = spanish_civil_war }
			has_country_flag = SPR_spanish_elections_flag
		}

		cancel_if_not_visible = yes

		complete_effect = {
			set_country_flag = SPA_already_expanding_influence_flag
		}

		remove_effect = {
			if = {
				limit = {
					has_completed_focus = SPA_a_great_spain
				}
				792 = {
					custom_effect_tooltip = SPA_expand_influence_nationalists_tt
					set_state_flag = { flag = SPR_recently_expanded_influence_flag value = 1 days = 15 }
					hidden_effect = {
						if = {
							limit = { check_variable = { SPA_garrison_control < 4 } }
							
							add_to_variable = { var = SPA_garrison_control value = 1 }
							SPR = { add_to_variable = { var = spa_civil_war_divisions_counter_var value = 1 } }
							SPR = { subtract_from_variable = { var = spr_civil_war_divisions_counter_var value = 1 } }
						}
					}
					SPA_garrison_control_tooltip = yes
					SPA_garrison_control_cost_calculation = yes
				}
			}
			if = {
				limit = {
					has_completed_focus = SPR_the_popular_front
				}
				792 = {
					custom_effect_tooltip = SPR_expand_influence_republicans_tt
					set_state_flag = { flag = SPR_recently_expanded_influence_flag value = 1 days = 15 }
					hidden_effect = {
						subtract_from_variable = { var = SPA_garrison_control value = 1 }
						SPR = { subtract_from_variable = { var = spa_civil_war_divisions_counter_var value = 1 } }
						SPR = { add_to_variable = { var = spr_civil_war_divisions_counter_var value = 1 } }
					}
					SPA_garrison_control_tooltip = yes
					SPR_garrison_control_cost_calculation = yes
				}
			}
			clr_country_flag = SPA_already_expanding_influence_flag
		}

		ai_will_do = {
			base = 110
			modifier = {
				792 = { has_state_flag = SPR_recently_expanded_influence_flag }
				factor = 10
			}
			modifier = {
				has_completed_focus = SPA_a_great_spain
				792 = { check_variable = { var = SPA_garrison_control value = 2 compare = greater_than_or_equals } }
				factor = 5
			}
			modifier = {
				has_completed_focus = SPA_a_great_spain
				792 = { check_variable = { var = SPA_garrison_control value = 3 compare = greater_than_or_equals } }
				factor = 5
			}
			modifier = {
				has_completed_focus = SPA_a_great_spain
				is_historical_focus_on = yes
				factor = 0
			}
		}
	}

	SPA_expand_influence_in_the_navarra_garrison = {

		icon = {
			key = spa_garrison_control_none
			trigger = {
				has_completed_focus = SPA_a_great_spain
				172 = { check_variable = { var = SPA_garrison_control value = 1 compare = equals } }
			}
		}
		icon = {
			key = spa_garrison_control_weak
			trigger = {
				has_completed_focus = SPA_a_great_spain
				172 = {
					check_variable = { var = SPA_garrison_control value = 2 compare = equals }
					NOT = { has_state_flag = SPA_northern_garrisons_state_flag }
				}
			}
		}
		icon = {
			key = spa_garrison_control_weak2
			trigger = {
				has_completed_focus = SPA_a_great_spain
				172 = {
					check_variable = { var = SPA_garrison_control value = 2 compare = equals }
					has_state_flag = SPA_northern_garrisons_state_flag
				}
			}
		}
		icon = {
			key = spa_garrison_control_strong
			trigger = {
				has_completed_focus = SPA_a_great_spain
				172 = {
					check_variable = { var = SPA_garrison_control value = 3 compare = equals }
					NOT = { has_state_flag = SPA_northern_garrisons_state_flag }
				}
			}
		}
		icon = {
			key = spa_garrison_control_strong2
			trigger = {
				has_completed_focus = SPA_a_great_spain
				172 = {
					check_variable = { var = SPA_garrison_control value = 3 compare = equals }
					has_state_flag = SPA_northern_garrisons_state_flag
				}
			}
		}
		icon = {
			key = spa_garrison_control_total
			trigger = {
				has_completed_focus = SPA_a_great_spain
				172 = { check_variable = { var = SPA_garrison_control value = 4 compare = greater_than_or_equals } }
			}
		}
		icon = {
			key = spr_garrison_control_none
			trigger = {
				has_completed_focus = SPR_the_popular_front
				172 = { check_variable = { var = SPA_garrison_control value = 1 compare = equals } }
			}
		}
		icon = {
			key = spr_garrison_control_weak
			trigger = {
				has_completed_focus = SPR_the_popular_front
				172 = {
					check_variable = { var = SPA_garrison_control value = 2 compare = equals }
					NOT = { has_state_flag = SPA_northern_garrisons_state_flag }
				}
			}
		}
		icon = {
			key = spr_garrison_control_weak2
			trigger = {
				has_completed_focus = SPR_the_popular_front
				172 = {
					check_variable = { var = SPA_garrison_control value = 2 compare = equals }
					has_state_flag = SPA_northern_garrisons_state_flag
				}
			}
		}
		icon = {
			key = spr_garrison_control_strong
			trigger = {
				has_completed_focus = SPR_the_popular_front
				172 = {
					check_variable = { var = SPA_garrison_control value = 3 compare = equals }
					NOT = { has_state_flag = SPA_northern_garrisons_state_flag }
				}
			}
		}
		icon = {
			key = spr_garrison_control_strong2
			trigger = {
				has_completed_focus = SPR_the_popular_front
				172 = {
					check_variable = { var = SPA_garrison_control value = 3 compare = equals }
					has_state_flag = SPA_northern_garrisons_state_flag
				}
			}
		}
		icon = {
			key = spr_garrison_control_total
			trigger = {
				has_completed_focus = SPR_the_popular_front
				172 = { check_variable = { var = SPA_garrison_control value = 4 compare = greater_than_or_equals } }
			}
		}

		available = {
			has_full_control_of_state = 172
			if = {
				limit = {
					has_completed_focus = SPA_a_great_spain
				}
				custom_trigger_tooltip = {
					tooltip = SPA_expand_influence_nationalists_trigger_tt
					172 = { check_variable = { var = SPA_garrison_control value = 4 compare = less_than } }
				}
			}
			if = {
				limit = {
					has_completed_focus = SPR_the_popular_front
				}
				custom_trigger_tooltip = {
					tooltip = SPR_expand_influence_republicans_trigger_tt
					172 = { check_variable = { var = SPA_garrison_control value = 2 compare = greater_than_or_equals } }
				}
			}
			NOT = {
				has_country_flag = SPA_already_expanding_influence_flag
			}
		}

		highlight_states = {
			highlight_state_targets = {
				state = 172
			} 
		}

		on_map_mode = map_only

		cost = 172.SPA_garrison_control_cost?10

		fire_only_once = no

		days_remove = 14

		visible = {
			NOT = { has_global_flag = spanish_civil_war }
			has_country_flag = SPR_spanish_elections_flag
		}

		cancel_if_not_visible = yes

		complete_effect = {
			set_country_flag = SPA_already_expanding_influence_flag
		}

		remove_effect = {
			if = {
				limit = {
					has_completed_focus = SPA_a_great_spain
				}
				172 = {
					custom_effect_tooltip = SPA_expand_influence_nationalists_tt
					set_state_flag = { flag = SPR_recently_expanded_influence_flag value = 1 days = 15 }
					hidden_effect = {
						if = {
							limit = { check_variable = { SPA_garrison_control < 4 } }
							
							add_to_variable = { var = SPA_garrison_control value = 1 }
							SPR = { add_to_variable = { var = spa_civil_war_divisions_counter_var value = 1 } }
							SPR = { subtract_from_variable = { var = spr_civil_war_divisions_counter_var value = 1 } }
						}
					}
					SPA_garrison_control_tooltip = yes
					SPA_garrison_control_cost_calculation = yes
				}
			}
			if = {
				limit = {
					has_completed_focus = SPR_the_popular_front
				}
				172 = {
					custom_effect_tooltip = SPR_expand_influence_republicans_tt
					set_state_flag = { flag = SPR_recently_expanded_influence_flag value = 1 days = 15 }
					hidden_effect = {
						subtract_from_variable = { var = SPA_garrison_control value = 1 }
						SPR = { subtract_from_variable = { var = spa_civil_war_divisions_counter_var value = 1 } }
						SPR = { add_to_variable = { var = spr_civil_war_divisions_counter_var value = 1 } }
					}
					SPA_garrison_control_tooltip = yes
					SPR_garrison_control_cost_calculation = yes
				}
			}
			clr_country_flag = SPA_already_expanding_influence_flag
		}

		ai_will_do = {
			base = 110
			modifier = {
				172 = { has_state_flag = SPR_recently_expanded_influence_flag }
				factor = 10
			}
			modifier = {
				has_completed_focus = SPA_a_great_spain
				NOT = { has_completed_focus = SPA_secure_the_northern_garrisons }
				factor = 0
			}
			modifier = {
				has_completed_focus = SPA_a_great_spain
				172 = { check_variable = { var = SPA_garrison_control value = 2 compare = greater_than_or_equals } }
				factor = 5
			}
			modifier = {
				has_completed_focus = SPA_a_great_spain
				172 = { check_variable = { var = SPA_garrison_control value = 3 compare = greater_than_or_equals } }
				factor = 5
			}
			modifier = {
				has_completed_focus = SPA_a_great_spain
				is_historical_focus_on = yes
				factor = 10
			}
		}
	}

	SPA_expand_influence_in_the_western_aragon_garrison = {

		icon = {
			key = spa_garrison_control_none
			trigger = {
				has_completed_focus = SPA_a_great_spain
				166 = { check_variable = { var = SPA_garrison_control value = 1 compare = equals } }
			}
		}
		icon = {
			key = spa_garrison_control_weak
			trigger = {
				has_completed_focus = SPA_a_great_spain
				166 = {
					check_variable = { var = SPA_garrison_control value = 2 compare = equals }
					NOT = { has_state_flag = SPA_northern_garrisons_state_flag }
				}
			}
		}
		icon = {
			key = spa_garrison_control_weak2
			trigger = {
				has_completed_focus = SPA_a_great_spain
				166 = {
					check_variable = { var = SPA_garrison_control value = 2 compare = equals }
					has_state_flag = SPA_northern_garrisons_state_flag
				}
			}
		}
		icon = {
			key = spa_garrison_control_strong
			trigger = {
				has_completed_focus = SPA_a_great_spain
				166 = {
					check_variable = { var = SPA_garrison_control value = 3 compare = equals }
					NOT = { has_state_flag = SPA_northern_garrisons_state_flag }
				}
			}
		}
		icon = {
			key = spa_garrison_control_strong2
			trigger = {
				has_completed_focus = SPA_a_great_spain
				166 = {
					check_variable = { var = SPA_garrison_control value = 3 compare = equals }
					has_state_flag = SPA_northern_garrisons_state_flag
				}
			}
		}
		icon = {
			key = spa_garrison_control_total
			trigger = {
				has_completed_focus = SPA_a_great_spain
				166 = { check_variable = { var = SPA_garrison_control value = 4 compare = greater_than_or_equals } }
			}
		}
		icon = {
			key = spr_garrison_control_none
			trigger = {
				has_completed_focus = SPR_the_popular_front
				166 = { check_variable = { var = SPA_garrison_control value = 1 compare = equals } }
			}
		}
		icon = {
			key = spr_garrison_control_weak
			trigger = {
				has_completed_focus = SPR_the_popular_front
				166 = {
					check_variable = { var = SPA_garrison_control value = 2 compare = equals }
					NOT = { has_state_flag = SPA_northern_garrisons_state_flag }
				}
			}
		}
		icon = {
			key = spr_garrison_control_weak2
			trigger = {
				has_completed_focus = SPR_the_popular_front
				166 = {
					check_variable = { var = SPA_garrison_control value = 2 compare = equals }
					has_state_flag = SPA_northern_garrisons_state_flag
				}
			}
		}
		icon = {
			key = spr_garrison_control_strong
			trigger = {
				has_completed_focus = SPR_the_popular_front
				166 = {
					check_variable = { var = SPA_garrison_control value = 3 compare = equals }
					NOT = { has_state_flag = SPA_northern_garrisons_state_flag }
				}
			}
		}
		icon = {
			key = spr_garrison_control_strong2
			trigger = {
				has_completed_focus = SPR_the_popular_front
				166 = {
					check_variable = { var = SPA_garrison_control value = 3 compare = equals }
					has_state_flag = SPA_northern_garrisons_state_flag
				}
			}
		}
		icon = {
			key = spr_garrison_control_total
			trigger = {
				has_completed_focus = SPR_the_popular_front
				166 = { check_variable = { var = SPA_garrison_control value = 4 compare = greater_than_or_equals } }
			}
		}

		available = {
			has_full_control_of_state = 166
			if = {
				limit = {
					has_completed_focus = SPA_a_great_spain
				}
				custom_trigger_tooltip = {
					tooltip = SPA_expand_influence_nationalists_trigger_tt
					166 = { check_variable = { var = SPA_garrison_control value = 4 compare = less_than } }
				}
			}
			if = {
				limit = {
					has_completed_focus = SPR_the_popular_front
				}
				custom_trigger_tooltip = {
					tooltip = SPR_expand_influence_republicans_trigger_tt
					166 = { check_variable = { var = SPA_garrison_control value = 2 compare = greater_than_or_equals } }
				}
			}
			NOT = {
				has_country_flag = SPA_already_expanding_influence_flag
			}
		}

		highlight_states = {
			highlight_state_targets = {
				state = 166
			} 
		}

		on_map_mode = map_only

		cost = 166.SPA_garrison_control_cost?10

		fire_only_once = no

		days_remove = 14

		visible = {
			NOT = { has_global_flag = spanish_civil_war }
			has_country_flag = SPR_spanish_elections_flag
		}

		cancel_if_not_visible = yes

		complete_effect = {
			set_country_flag = SPA_already_expanding_influence_flag
		}

		remove_effect = {
			if = {
				limit = {
					has_completed_focus = SPA_a_great_spain
				}
				166 = {
					custom_effect_tooltip = SPA_expand_influence_nationalists_tt
					set_state_flag = { flag = SPR_recently_expanded_influence_flag value = 1 days = 15 }
					hidden_effect = {
						if = {
							limit = { check_variable = { SPA_garrison_control < 4 } }
							
							add_to_variable = { var = SPA_garrison_control value = 1 }
							SPR = { add_to_variable = { var = spa_civil_war_divisions_counter_var value = 1 } }
							SPR = { subtract_from_variable = { var = spr_civil_war_divisions_counter_var value = 1 } }
						}
					}
					SPA_garrison_control_tooltip = yes
					SPA_garrison_control_cost_calculation = yes
				}
			}
			if = {
				limit = {
					has_completed_focus = SPR_the_popular_front
				}
				166 = {
					custom_effect_tooltip = SPR_expand_influence_republicans_tt
					set_state_flag = { flag = SPR_recently_expanded_influence_flag value = 1 days = 15 }
					hidden_effect = {
						subtract_from_variable = { var = SPA_garrison_control value = 1 }
						SPR = { subtract_from_variable = { var = spa_civil_war_divisions_counter_var value = 1 } }
						SPR = { add_to_variable = { var = spr_civil_war_divisions_counter_var value = 1 } }
					}
					SPA_garrison_control_tooltip = yes
					SPR_garrison_control_cost_calculation = yes
				}
			}
			clr_country_flag = SPA_already_expanding_influence_flag
		}

		ai_will_do = {
			base = 110
			modifier = {
				166 = { has_state_flag = SPR_recently_expanded_influence_flag }
				factor = 10
			}
			modifier = {
				has_completed_focus = SPA_a_great_spain
				NOT = { has_completed_focus = SPA_secure_the_northern_garrisons }
				factor = 0
			}
			modifier = {
				has_completed_focus = SPA_a_great_spain
				166 = { check_variable = { var = SPA_garrison_control value = 2 compare = greater_than_or_equals } }
				factor = 5
			}
			modifier = {
				has_completed_focus = SPA_a_great_spain
				166 = { check_variable = { var = SPA_garrison_control value = 3 compare = greater_than_or_equals } }
				factor = 5
			}
			modifier = {
				has_completed_focus = SPA_a_great_spain
				is_historical_focus_on = yes
				factor = 10
			}
		}
	}

	SPA_expand_influence_in_the_eastern_aragon_garrison = {

		icon = {
			key = spa_garrison_control_none
			trigger = {
				has_completed_focus = SPA_a_great_spain
				794 = { check_variable = { var = SPA_garrison_control value = 1 compare = equals } }
			}
		}
		icon = {
			key = spa_garrison_control_weak
			trigger = {
				has_completed_focus = SPA_a_great_spain
				794 = { check_variable = { var = SPA_garrison_control value = 2 compare = equals } }
			}
		}
		icon = {
			key = spa_garrison_control_strong
			trigger = {
				has_completed_focus = SPA_a_great_spain
				794 = { check_variable = { var = SPA_garrison_control value = 3 compare = equals } }
			}
		}
		icon = {
			key = spa_garrison_control_total
			trigger = {
				has_completed_focus = SPA_a_great_spain
				794 = { check_variable = { var = SPA_garrison_control value = 4 compare = greater_than_or_equals } }
			}
		}
		icon = {
			key = spr_garrison_control_none
			trigger = {
				has_completed_focus = SPR_the_popular_front
				794 = { check_variable = { var = SPA_garrison_control value = 1 compare = equals } }
			}
		}
		icon = {
			key = spr_garrison_control_weak
			trigger = {
				has_completed_focus = SPR_the_popular_front
				794 = { check_variable = { var = SPA_garrison_control value = 2 compare = equals } }
			}
		}
		icon = {
			key = spr_garrison_control_strong
			trigger = {
				has_completed_focus = SPR_the_popular_front
				794 = { check_variable = { var = SPA_garrison_control value = 3 compare = equals } }
			}
		}
		icon = {
			key = spr_garrison_control_total
			trigger = {
				has_completed_focus = SPR_the_popular_front
				794 = { check_variable = { var = SPA_garrison_control value = 4 compare = greater_than_or_equals } }
			}
		} 

		available = {
			has_full_control_of_state = 794
			if = {
				limit = {
					has_completed_focus = SPA_a_great_spain
				}
				custom_trigger_tooltip = {
					tooltip = SPA_expand_influence_nationalists_trigger_tt
					794 = { check_variable = { var = SPA_garrison_control value = 4 compare = less_than } }
				}
			}
			if = {
				limit = {
					has_completed_focus = SPR_the_popular_front
				}
				custom_trigger_tooltip = {
					tooltip = SPR_expand_influence_republicans_trigger_tt
					794 = { check_variable = { var = SPA_garrison_control value = 2 compare = greater_than_or_equals } }
				}
			}
			NOT = {
				has_country_flag = SPA_already_expanding_influence_flag
			}
		}

		highlight_states = {
			highlight_state_targets = {
				state = 794
			} 
		}

		on_map_mode = map_only

		cost = 794.SPA_garrison_control_cost?10

		fire_only_once = no

		days_remove = 14

		visible = {
			NOT = { has_global_flag = spanish_civil_war }
			has_country_flag = SPR_spanish_elections_flag
		}

		cancel_if_not_visible = yes

		complete_effect = {
			set_country_flag = SPA_already_expanding_influence_flag
		}

		remove_effect = {
			if = {
				limit = {
					has_completed_focus = SPA_a_great_spain
				}
				794 = {
					custom_effect_tooltip = SPA_expand_influence_nationalists_tt
					set_state_flag = { flag = SPR_recently_expanded_influence_flag value = 1 days = 15 }
					hidden_effect = {
						if = {
							limit = { check_variable = { SPA_garrison_control < 4 } }
							
							add_to_variable = { var = SPA_garrison_control value = 1 }
							SPR = { add_to_variable = { var = spa_civil_war_divisions_counter_var value = 1 } }
							SPR = { subtract_from_variable = { var = spr_civil_war_divisions_counter_var value = 1 } }
						}
					}
					SPA_garrison_control_tooltip = yes
					SPA_garrison_control_cost_calculation = yes
				}
			}
			if = {
				limit = {
					has_completed_focus = SPR_the_popular_front
				}
				794 = {
					custom_effect_tooltip = SPR_expand_influence_republicans_tt
					set_state_flag = { flag = SPR_recently_expanded_influence_flag value = 1 days = 15 }
					hidden_effect = {
						subtract_from_variable = { var = SPA_garrison_control value = 1 }
						SPR = { subtract_from_variable = { var = spa_civil_war_divisions_counter_var value = 1 } }
						SPR = { add_to_variable = { var = spr_civil_war_divisions_counter_var value = 1 } }
					}
					SPA_garrison_control_tooltip = yes
					SPR_garrison_control_cost_calculation = yes
				}
			}
			clr_country_flag = SPA_already_expanding_influence_flag
		}

		ai_will_do = {
			base = 110
			modifier = {
				794 = { has_state_flag = SPR_recently_expanded_influence_flag }
				factor = 10
			}
			modifier = {
				has_completed_focus = SPA_a_great_spain
				794 = { check_variable = { var = SPA_garrison_control value = 2 compare = greater_than_or_equals } }
				factor = 5
			}
			modifier = {
				has_completed_focus = SPA_a_great_spain
				794 = { check_variable = { var = SPA_garrison_control value = 3 compare = greater_than_or_equals } }
				factor = 5
			}
			modifier = {
				has_completed_focus = SPA_a_great_spain
				is_historical_focus_on = yes
				factor = 0
			}
		}
	}

	SPA_expand_influence_in_the_catalunya_garrison = {

		icon = {
			key = spa_garrison_control_none
			trigger = {
				has_completed_focus = SPA_a_great_spain
				165 = { check_variable = { var = SPA_garrison_control value = 1 compare = equals } }
			}
		}
		icon = {
			key = spa_garrison_control_weak
			trigger = {
				has_completed_focus = SPA_a_great_spain
				165 = { check_variable = { var = SPA_garrison_control value = 2 compare = equals } }
			}
		}
		icon = {
			key = spa_garrison_control_strong
			trigger = {
				has_completed_focus = SPA_a_great_spain
				165 = { check_variable = { var = SPA_garrison_control value = 3 compare = equals } }
			}
		}
		icon = {
			key = spa_garrison_control_total
			trigger = {
				has_completed_focus = SPA_a_great_spain
				165 = { check_variable = { var = SPA_garrison_control value = 4 compare = greater_than_or_equals } }
			}
		}
		icon = {
			key = spr_garrison_control_none
			trigger = {
				has_completed_focus = SPR_the_popular_front
				165 = { check_variable = { var = SPA_garrison_control value = 1 compare = equals } }
			}
		}
		icon = {
			key = spr_garrison_control_weak
			trigger = {
				has_completed_focus = SPR_the_popular_front
				165 = { check_variable = { var = SPA_garrison_control value = 2 compare = equals } }
			}
		}
		icon = {
			key = spr_garrison_control_strong
			trigger = {
				has_completed_focus = SPR_the_popular_front
				165 = { check_variable = { var = SPA_garrison_control value = 3 compare = equals } }
			}
		}
		icon = {
			key = spr_garrison_control_total
			trigger = {
				has_completed_focus = SPR_the_popular_front
				165 = { check_variable = { var = SPA_garrison_control value = 4 compare = greater_than_or_equals } }
			}
		}

		available = {
			has_full_control_of_state = 165
			if = {
				limit = {
					has_completed_focus = SPA_a_great_spain
				}
				custom_trigger_tooltip = {
					tooltip = SPA_expand_influence_nationalists_trigger_tt
					165 = { check_variable = { var = SPA_garrison_control value = 4 compare = less_than } }
				}
			}
			if = {
				limit = {
					has_completed_focus = SPR_the_popular_front
				}
				custom_trigger_tooltip = {
					tooltip = SPR_expand_influence_republicans_trigger_tt
					165 = { check_variable = { var = SPA_garrison_control value = 2 compare = greater_than_or_equals } }
				}
			}
			NOT = {
				has_country_flag = SPA_already_expanding_influence_flag
			}
		}

		highlight_states = {
			highlight_state_targets = {
				state = 165
			} 
		}

		on_map_mode = map_only

		cost = 165.SPA_garrison_control_cost?10

		fire_only_once = no

		days_remove = 14

		visible = {
			NOT = { has_global_flag = spanish_civil_war }
			has_country_flag = SPR_spanish_elections_flag
		}

		cancel_if_not_visible = yes

		complete_effect = {
			set_country_flag = SPA_already_expanding_influence_flag
		}

		remove_effect = {
			if = {
				limit = {
					has_completed_focus = SPA_a_great_spain
				}
				165 = {
					custom_effect_tooltip = SPA_expand_influence_nationalists_tt
					set_state_flag = { flag = SPR_recently_expanded_influence_flag value = 1 days = 15 }
					hidden_effect = {
						if = {
							limit = { check_variable = { SPA_garrison_control < 4 } }
							
							add_to_variable = { var = SPA_garrison_control value = 1 }
							SPR = { add_to_variable = { var = spa_civil_war_divisions_counter_var value = 1 } }
							SPR = { subtract_from_variable = { var = spr_civil_war_divisions_counter_var value = 1 } }
						}
					}
					SPA_garrison_control_tooltip = yes
					SPA_garrison_control_cost_calculation = yes
				}
			}
			if = {
				limit = {
					has_completed_focus = SPR_the_popular_front
				}
				165 = {
					custom_effect_tooltip = SPR_expand_influence_republicans_tt
					set_state_flag = { flag = SPR_recently_expanded_influence_flag value = 1 days = 15 }
					hidden_effect = {
						subtract_from_variable = { var = SPA_garrison_control value = 1 }
						SPR = { subtract_from_variable = { var = spa_civil_war_divisions_counter_var value = 1 } }
						SPR = { add_to_variable = { var = spr_civil_war_divisions_counter_var value = 1 } }
					}
					SPA_garrison_control_tooltip = yes
					SPR_garrison_control_cost_calculation = yes
				}
			}
			clr_country_flag = SPA_already_expanding_influence_flag
		}

		ai_will_do = {
			base = 110
			modifier = {
				165 = { has_state_flag = SPR_recently_expanded_influence_flag }
				factor = 10
			}
			modifier = {
				has_completed_focus = SPA_a_great_spain
				165 = { check_variable = { var = SPA_garrison_control value = 2 compare = greater_than_or_equals } }
				factor = 5
			}
			modifier = {
				has_completed_focus = SPA_a_great_spain
				165 = { check_variable = { var = SPA_garrison_control value = 3 compare = greater_than_or_equals } }
				factor = 5
			}
			modifier = {
				has_completed_focus = SPA_a_great_spain
				is_historical_focus_on = yes
				factor = 0
			}
		}
	}

	SPA_expand_influence_in_the_salamanca_garrison = {

		icon = {
			key = spa_garrison_control_none
			trigger = {
				has_completed_focus = SPA_a_great_spain
				788 = { check_variable = { var = SPA_garrison_control value = 1 compare = equals } }
			}
		}
		icon = {
			key = spa_garrison_control_weak
			trigger = {
				has_completed_focus = SPA_a_great_spain
				788 = {
					check_variable = { var = SPA_garrison_control value = 2 compare = equals }
					NOT = { has_state_flag = SPA_northern_garrisons_state_flag }
				}
			}
		}
		icon = {
			key = spa_garrison_control_weak2
			trigger = {
				has_completed_focus = SPA_a_great_spain
				788 = {
					check_variable = { var = SPA_garrison_control value = 2 compare = equals }
					has_state_flag = SPA_northern_garrisons_state_flag
				}
			}
		}
		icon = {
			key = spa_garrison_control_strong
			trigger = {
				has_completed_focus = SPA_a_great_spain
				788 = {
					check_variable = { var = SPA_garrison_control value = 3 compare = equals }
					NOT = { has_state_flag = SPA_northern_garrisons_state_flag }
				}
			}
		}
		icon = {
			key = spa_garrison_control_strong2
			trigger = {
				has_completed_focus = SPA_a_great_spain
				788 = {
					check_variable = { var = SPA_garrison_control value = 3 compare = equals }
					has_state_flag = SPA_northern_garrisons_state_flag
				}
			}
		}
		icon = {
			key = spa_garrison_control_total
			trigger = {
				has_completed_focus = SPA_a_great_spain
				788 = { check_variable = { var = SPA_garrison_control value = 4 compare = greater_than_or_equals } }
			}
		}
		icon = {
			key = spr_garrison_control_none
			trigger = {
				has_completed_focus = SPR_the_popular_front
				788 = { check_variable = { var = SPA_garrison_control value = 1 compare = equals } }
			}
		}
		icon = {
			key = spr_garrison_control_weak
			trigger = {
				has_completed_focus = SPR_the_popular_front
				788 = {
					check_variable = { var = SPA_garrison_control value = 2 compare = equals }
					NOT = { has_state_flag = SPA_northern_garrisons_state_flag }
				}
			}
		}
		icon = {
			key = spr_garrison_control_weak2
			trigger = {
				has_completed_focus = SPR_the_popular_front
				788 = {
					check_variable = { var = SPA_garrison_control value = 2 compare = equals }
					has_state_flag = SPA_northern_garrisons_state_flag
				}
			}
		}
		icon = {
			key = spr_garrison_control_strong
			trigger = {
				has_completed_focus = SPR_the_popular_front
				788 = {
					check_variable = { var = SPA_garrison_control value = 3 compare = equals }
					NOT = { has_state_flag = SPA_northern_garrisons_state_flag }
				}
			}
		}
		icon = {
			key = spr_garrison_control_strong2
			trigger = {
				has_completed_focus = SPR_the_popular_front
				788 = {
					check_variable = { var = SPA_garrison_control value = 3 compare = equals }
					has_state_flag = SPA_northern_garrisons_state_flag
				}
			}
		}
		icon = {
			key = spr_garrison_control_total
			trigger = {
				has_completed_focus = SPR_the_popular_front
				788 = { check_variable = { var = SPA_garrison_control value = 4 compare = greater_than_or_equals } }
			}
		}

		available = {
			has_full_control_of_state = 788
			if = {
				limit = {
					has_completed_focus = SPA_a_great_spain
				}
				custom_trigger_tooltip = {
					tooltip = SPA_expand_influence_nationalists_trigger_tt
					788 = { check_variable = { var = SPA_garrison_control value = 4 compare = less_than } }
				}
			}
			if = {
				limit = {
					has_completed_focus = SPR_the_popular_front
				}
				custom_trigger_tooltip = {
					tooltip = SPR_expand_influence_republicans_trigger_tt
					788 = { check_variable = { var = SPA_garrison_control value = 2 compare = greater_than_or_equals } }
				}
			}
			NOT = {
				has_country_flag = SPA_already_expanding_influence_flag
			}
		}

		highlight_states = {
			highlight_state_targets = {
				state = 788
			} 
		}

		on_map_mode = map_only

		cost = 788.SPA_garrison_control_cost?10

		fire_only_once = no

		days_remove = 14

		visible = {
			NOT = { has_global_flag = spanish_civil_war }
			has_country_flag = SPR_spanish_elections_flag
		}

		cancel_if_not_visible = yes

		complete_effect = {
			set_country_flag = SPA_already_expanding_influence_flag
		}

		remove_effect = {
			if = {
				limit = {
					has_completed_focus = SPA_a_great_spain
				}
				788 = {
					custom_effect_tooltip = SPA_expand_influence_nationalists_tt
					set_state_flag = { flag = SPR_recently_expanded_influence_flag value = 1 days = 15 }
					hidden_effect = {
						if = {
							limit = { check_variable = { SPA_garrison_control < 4 } }
							
							add_to_variable = { var = SPA_garrison_control value = 1 }
							SPR = { add_to_variable = { var = spa_civil_war_divisions_counter_var value = 1 } }
							SPR = { subtract_from_variable = { var = spr_civil_war_divisions_counter_var value = 1 } }
						}
					}
					SPA_garrison_control_tooltip = yes
					SPA_garrison_control_cost_calculation = yes
				}
			}
			if = {
				limit = {
					has_completed_focus = SPR_the_popular_front
				}
				788 = {
					custom_effect_tooltip = SPR_expand_influence_republicans_tt
					set_state_flag = { flag = SPR_recently_expanded_influence_flag value = 1 days = 15 }
					hidden_effect = {
						subtract_from_variable = { var = SPA_garrison_control value = 1 }
						SPR = { subtract_from_variable = { var = spa_civil_war_divisions_counter_var value = 1 } }
						SPR = { add_to_variable = { var = spr_civil_war_divisions_counter_var value = 1 } }
					}
					SPA_garrison_control_tooltip = yes
					SPR_garrison_control_cost_calculation = yes
				}
			}
			clr_country_flag = SPA_already_expanding_influence_flag
		}

		ai_will_do = {
			base = 110
			modifier = {
				788 = { has_state_flag = SPR_recently_expanded_influence_flag }
				factor = 10
			}
			modifier = {
				has_completed_focus = SPA_a_great_spain
				NOT = { has_completed_focus = SPA_secure_the_northern_garrisons }
				factor = 0
			}
			modifier = {
				has_completed_focus = SPA_a_great_spain
				788 = { check_variable = { var = SPA_garrison_control value = 2 compare = greater_than_or_equals } }
				factor = 5
			}
			modifier = {
				has_completed_focus = SPA_a_great_spain
				788 = { check_variable = { var = SPA_garrison_control value = 3 compare = greater_than_or_equals } }
				factor = 5
			}
			modifier = {
				has_completed_focus = SPA_a_great_spain
				is_historical_focus_on = yes
				factor = 10
			}
		}
	}

	SPA_expand_influence_in_the_madrid_garrison = {

		icon = {
			key = spa_garrison_control_none
			trigger = {
				has_completed_focus = SPA_a_great_spain
				41 = { check_variable = { var = SPA_garrison_control value = 1 compare = equals } }
			}
		}
		icon = {
			key = spa_garrison_control_weak
			trigger = {
				has_completed_focus = SPA_a_great_spain
				41 = { check_variable = { var = SPA_garrison_control value = 2 compare = equals } }
			}
		}
		icon = {
			key = spa_garrison_control_strong
			trigger = {
				has_completed_focus = SPA_a_great_spain
				41 = { check_variable = { var = SPA_garrison_control value = 3 compare = equals } }
			}
		}
		icon = {
			key = spa_garrison_control_total
			trigger = {
				has_completed_focus = SPA_a_great_spain
				41 = { check_variable = { var = SPA_garrison_control value = 4 compare = greater_than_or_equals } }
			}
		}
		icon = {
			key = spr_garrison_control_none
			trigger = {
				has_completed_focus = SPR_the_popular_front
				41 = { check_variable = { var = SPA_garrison_control value = 1 compare = equals } }
			}
		}
		icon = {
			key = spr_garrison_control_weak
			trigger = {
				has_completed_focus = SPR_the_popular_front
				41 = { check_variable = { var = SPA_garrison_control value = 2 compare = equals } }
			}
		}
		icon = {
			key = spr_garrison_control_strong
			trigger = {
				has_completed_focus = SPR_the_popular_front
				41 = { check_variable = { var = SPA_garrison_control value = 3 compare = equals } }
			}
		}
		icon = {
			key = spr_garrison_control_total
			trigger = {
				has_completed_focus = SPR_the_popular_front
				41 = { check_variable = { var = SPA_garrison_control value = 4 compare = greater_than_or_equals } }
			}
		}

		available = {
			has_full_control_of_state = 41
			if = {
				limit = {
					has_completed_focus = SPA_a_great_spain
				}
				custom_trigger_tooltip = {
					tooltip = SPA_expand_influence_nationalists_trigger_tt
					41 = { check_variable = { var = SPA_garrison_control value = 4 compare = less_than } }
				}
			}
			if = {
				limit = {
					has_completed_focus = SPR_the_popular_front
				}
				custom_trigger_tooltip = {
					tooltip = SPR_expand_influence_republicans_trigger_tt
					41 = { check_variable = { var = SPA_garrison_control value = 2 compare = greater_than_or_equals } }
				}
			}
			NOT = {
				has_country_flag = SPA_already_expanding_influence_flag
			}
		}

		highlight_states = {
			highlight_state_targets = {
				state = 41
			} 
		}

		on_map_mode = map_only

		cost = 41.SPA_garrison_control_cost?10

		fire_only_once = no

		days_remove = 14

		visible = {
			NOT = { has_global_flag = spanish_civil_war }
			has_country_flag = SPR_spanish_elections_flag
		}

		cancel_if_not_visible = yes

		complete_effect = {
			set_country_flag = SPA_already_expanding_influence_flag
		}

		remove_effect = {
			if = {
				limit = {
					has_completed_focus = SPA_a_great_spain
				}
				41 = {
					custom_effect_tooltip = SPA_expand_influence_nationalists_tt
					set_state_flag = { flag = SPR_recently_expanded_influence_flag value = 1 days = 15 }
					hidden_effect = {
						if = {
							limit = { check_variable = { SPA_garrison_control < 4 } }
							
							add_to_variable = { var = SPA_garrison_control value = 1 }
							SPR = { add_to_variable = { var = spa_civil_war_divisions_counter_var value = 1 } }
							SPR = { subtract_from_variable = { var = spr_civil_war_divisions_counter_var value = 1 } }
						}
					}
					SPA_garrison_control_tooltip = yes
					SPA_garrison_control_cost_calculation = yes
				}
			}
			if = {
				limit = {
					has_completed_focus = SPR_the_popular_front
				}
				41 = {
					custom_effect_tooltip = SPR_expand_influence_republicans_tt
					set_state_flag = { flag = SPR_recently_expanded_influence_flag value = 1 days = 15 }
					hidden_effect = {
						subtract_from_variable = { var = SPA_garrison_control value = 1 }
						SPR = { subtract_from_variable = { var = spa_civil_war_divisions_counter_var value = 1 } }
						SPR = { add_to_variable = { var = spr_civil_war_divisions_counter_var value = 1 } }
					}
					SPA_garrison_control_tooltip = yes
					SPR_garrison_control_cost_calculation = yes
				}
			}
			clr_country_flag = SPA_already_expanding_influence_flag
		}

		ai_will_do = {
			base = 110
			modifier = {
				41 = { has_state_flag = SPR_recently_expanded_influence_flag }
				factor = 10
			}
			modifier = {
				has_completed_focus = SPR_the_popular_front
				factor = 100
			}
			modifier = {
				has_completed_focus = SPA_a_great_spain
				is_historical_focus_on = yes
				factor = 0
			}
		}
	}

	SPA_expand_influence_in_the_guadalajara_garrison = {

		icon = {
			key = spa_garrison_control_none
			trigger = {
				has_completed_focus = SPA_a_great_spain
				793 = { check_variable = { var = SPA_garrison_control value = 1 compare = equals } }
			}
		}
		icon = {
			key = spa_garrison_control_weak
			trigger = {
				has_completed_focus = SPA_a_great_spain
				793 = { check_variable = { var = SPA_garrison_control value = 2 compare = equals } }
			}
		}
		icon = {
			key = spa_garrison_control_strong
			trigger = {
				has_completed_focus = SPA_a_great_spain
				793 = { check_variable = { var = SPA_garrison_control value = 3 compare = equals } }
			}
		}
		icon = {
			key = spa_garrison_control_total
			trigger = {
				has_completed_focus = SPA_a_great_spain
				793 = { check_variable = { var = SPA_garrison_control value = 4 compare = greater_than_or_equals } }
			}
		}
		icon = {
			key = spr_garrison_control_none
			trigger = {
				has_completed_focus = SPR_the_popular_front
				793 = { check_variable = { var = SPA_garrison_control value = 1 compare = equals } }
			}
		}
		icon = {
			key = spr_garrison_control_weak
			trigger = {
				has_completed_focus = SPR_the_popular_front
				793 = { check_variable = { var = SPA_garrison_control value = 2 compare = equals } }
			}
		}
		icon = {
			key = spr_garrison_control_strong
			trigger = {
				has_completed_focus = SPR_the_popular_front
				793 = { check_variable = { var = SPA_garrison_control value = 3 compare = equals } }
			}
		}
		icon = {
			key = spr_garrison_control_total
			trigger = {
				has_completed_focus = SPR_the_popular_front
				793 = { check_variable = { var = SPA_garrison_control value = 4 compare = greater_than_or_equals } }
			}
		}

		available = {
			has_full_control_of_state = 793
			if = {
				limit = {
					has_completed_focus = SPA_a_great_spain
				}
				custom_trigger_tooltip = {
					tooltip = SPA_expand_influence_nationalists_trigger_tt
					793 = { check_variable = { var = SPA_garrison_control value = 4 compare = less_than } }
				}
			}
			if = {
				limit = {
					has_completed_focus = SPR_the_popular_front
				}
				custom_trigger_tooltip = {
					tooltip = SPR_expand_influence_republicans_trigger_tt
					793 = { check_variable = { var = SPA_garrison_control value = 2 compare = greater_than_or_equals } }
				}
			}
			NOT = {
				has_country_flag = SPA_already_expanding_influence_flag
			}
		}

		highlight_states = {
			highlight_state_targets = {
				state = 793
			} 
		}

		on_map_mode = map_only

		cost = 793.SPA_garrison_control_cost?10

		fire_only_once = no

		days_remove = 14

		visible = {
			NOT = { has_global_flag = spanish_civil_war }
			has_country_flag = SPR_spanish_elections_flag
		}

		cancel_if_not_visible = yes

		complete_effect = {
			set_country_flag = SPA_already_expanding_influence_flag
		}

		remove_effect = {
			if = {
				limit = {
					has_completed_focus = SPA_a_great_spain
				}
				793 = {
					custom_effect_tooltip = SPA_expand_influence_nationalists_tt
					set_state_flag = { flag = SPR_recently_expanded_influence_flag value = 1 days = 15 }
					hidden_effect = {
						if = {
							limit = { check_variable = { SPA_garrison_control < 4 } }
							
							add_to_variable = { var = SPA_garrison_control value = 1 }
							SPR = { add_to_variable = { var = spa_civil_war_divisions_counter_var value = 1 } }
							SPR = { subtract_from_variable = { var = spr_civil_war_divisions_counter_var value = 1 } }
						}
					}
					SPA_garrison_control_tooltip = yes
					SPA_garrison_control_cost_calculation = yes
				}
			}
			if = {
				limit = {
					has_completed_focus = SPR_the_popular_front
				}
				793 = {
					custom_effect_tooltip = SPR_expand_influence_republicans_tt
					set_state_flag = { flag = SPR_recently_expanded_influence_flag value = 1 days = 15 }
					hidden_effect = {
						subtract_from_variable = { var = SPA_garrison_control value = 1 }
						SPR = { subtract_from_variable = { var = spa_civil_war_divisions_counter_var value = 1 } }
						SPR = { add_to_variable = { var = spr_civil_war_divisions_counter_var value = 1 } }
					}
					SPA_garrison_control_tooltip = yes
					SPR_garrison_control_cost_calculation = yes
				}
			}
			clr_country_flag = SPA_already_expanding_influence_flag
		}

		ai_will_do = {
			base = 110
			modifier = {
				793 = { has_state_flag = SPR_recently_expanded_influence_flag }
				factor = 10
			}
			modifier = {
				has_completed_focus = SPA_a_great_spain
				793 = { check_variable = { var = SPA_garrison_control value = 2 compare = greater_than_or_equals } }
				factor = 5
			}
			modifier = {
				has_completed_focus = SPA_a_great_spain
				793 = { check_variable = { var = SPA_garrison_control value = 3 compare = greater_than_or_equals } }
				factor = 5
			}
			modifier = {
				has_completed_focus = SPA_a_great_spain
				is_historical_focus_on = yes
				factor = 0
			}
		}
	}

	SPA_expand_influence_in_the_valencia_garrison = {

		icon = {
			key = spa_garrison_control_none
			trigger = {
				has_completed_focus = SPA_a_great_spain
				167 = { check_variable = { var = SPA_garrison_control value = 1 compare = equals } }
			}
		}
		icon = {
			key = spa_garrison_control_weak
			trigger = {
				has_completed_focus = SPA_a_great_spain
				167 = { check_variable = { var = SPA_garrison_control value = 2 compare = equals } }
			}
		}
		icon = {
			key = spa_garrison_control_strong
			trigger = {
				has_completed_focus = SPA_a_great_spain
				167 = { check_variable = { var = SPA_garrison_control value = 3 compare = equals } }
			}
		}
		icon = {
			key = spa_garrison_control_total
			trigger = {
				has_completed_focus = SPA_a_great_spain
				167 = { check_variable = { var = SPA_garrison_control value = 4 compare = greater_than_or_equals } }
			}
		}
		icon = {
			key = spr_garrison_control_none
			trigger = {
				has_completed_focus = SPR_the_popular_front
				167 = { check_variable = { var = SPA_garrison_control value = 1 compare = equals } }
			}
		}
		icon = {
			key = spr_garrison_control_weak
			trigger = {
				has_completed_focus = SPR_the_popular_front
				167 = { check_variable = { var = SPA_garrison_control value = 2 compare = equals } }
			}
		}
		icon = {
			key = spr_garrison_control_strong
			trigger = {
				has_completed_focus = SPR_the_popular_front
				167 = { check_variable = { var = SPA_garrison_control value = 3 compare = equals } }
			}
		}
		icon = {
			key = spr_garrison_control_total
			trigger = {
				has_completed_focus = SPR_the_popular_front
				167 = { check_variable = { var = SPA_garrison_control value = 4 compare = greater_than_or_equals } }
			}
		}

		available = {
			has_full_control_of_state = 167
			if = {
				limit = {
					has_completed_focus = SPA_a_great_spain
				}
				custom_trigger_tooltip = {
					tooltip = SPA_expand_influence_nationalists_trigger_tt
					167 = { check_variable = { var = SPA_garrison_control value = 4 compare = less_than } }
				}
			}
			if = {
				limit = {
					has_completed_focus = SPR_the_popular_front
				}
				custom_trigger_tooltip = {
					tooltip = SPR_expand_influence_republicans_trigger_tt
					167 = { check_variable = { var = SPA_garrison_control value = 2 compare = greater_than_or_equals } }
				}
			}
			NOT = {
				has_country_flag = SPA_already_expanding_influence_flag
			}
		}

		highlight_states = {
			highlight_state_targets = {
				state = 167
			} 
		}

		on_map_mode = map_only

		cost = 167.SPA_garrison_control_cost?10

		fire_only_once = no

		days_remove = 14

		visible = {
			NOT = { has_global_flag = spanish_civil_war }
			has_country_flag = SPR_spanish_elections_flag
		}

		cancel_if_not_visible = yes

		complete_effect = {
			set_country_flag = SPA_already_expanding_influence_flag
		}

		remove_effect = {
			if = {
				limit = {
					has_completed_focus = SPA_a_great_spain
				}
				167 = {
					custom_effect_tooltip = SPA_expand_influence_nationalists_tt
					set_state_flag = { flag = SPR_recently_expanded_influence_flag value = 1 days = 15 }
					hidden_effect = {
						if = {
							limit = { check_variable = { SPA_garrison_control < 4 } }
							
							add_to_variable = { var = SPA_garrison_control value = 1 }
							SPR = { add_to_variable = { var = spa_civil_war_divisions_counter_var value = 1 } }
							SPR = { subtract_from_variable = { var = spr_civil_war_divisions_counter_var value = 1 } }
						}
					}
					SPA_garrison_control_tooltip = yes
					SPA_garrison_control_cost_calculation = yes
				}
			}
			if = {
				limit = {
					has_completed_focus = SPR_the_popular_front
				}
				167 = {
					custom_effect_tooltip = SPR_expand_influence_republicans_tt
					set_state_flag = { flag = SPR_recently_expanded_influence_flag value = 1 days = 15 }
					hidden_effect = {
						subtract_from_variable = { var = SPA_garrison_control value = 1 }
						SPR = { subtract_from_variable = { var = spa_civil_war_divisions_counter_var value = 1 } }
						SPR = { add_to_variable = { var = spr_civil_war_divisions_counter_var value = 1 } }
					}
					SPA_garrison_control_tooltip = yes
					SPR_garrison_control_cost_calculation = yes
				}
			}
			clr_country_flag = SPA_already_expanding_influence_flag
		}

		ai_will_do = {
			base = 110
			modifier = {
				167 = { has_state_flag = SPR_recently_expanded_influence_flag }
				factor = 10
			}
			modifier = {
				has_completed_focus = SPA_a_great_spain
				167 = { check_variable = { var = SPA_garrison_control value = 2 compare = greater_than_or_equals } }
				factor = 5
			}
			modifier = {
				has_completed_focus = SPA_a_great_spain
				167 = { check_variable = { var = SPA_garrison_control value = 3 compare = greater_than_or_equals } }
				factor = 5
			}
			modifier = {
				has_completed_focus = SPA_a_great_spain
				is_historical_focus_on = yes
				factor = 0
			}
		}
	}

	SPA_expand_influence_in_the_extremadura_garrison = {

		icon = {
			key = spa_garrison_control_none
			trigger = {
				has_completed_focus = SPA_a_great_spain
				170 = { check_variable = { var = SPA_garrison_control value = 1 compare = equals } }
			}
		}
		icon = {
			key = spa_garrison_control_weak
			trigger = {
				has_completed_focus = SPA_a_great_spain
				170 = { check_variable = { var = SPA_garrison_control value = 2 compare = equals } }
			}
		}
		icon = {
			key = spa_garrison_control_strong
			trigger = {
				has_completed_focus = SPA_a_great_spain
				170 = { check_variable = { var = SPA_garrison_control value = 3 compare = equals } }
			}
		}
		icon = {
			key = spa_garrison_control_total
			trigger = {
				has_completed_focus = SPA_a_great_spain
				170 = { check_variable = { var = SPA_garrison_control value = 4 compare = greater_than_or_equals } }
			}
		}
		icon = {
			key = spr_garrison_control_none
			trigger = {
				has_completed_focus = SPR_the_popular_front
				170 = { check_variable = { var = SPA_garrison_control value = 1 compare = equals } }
			}
		}
		icon = {
			key = spr_garrison_control_weak
			trigger = {
				has_completed_focus = SPR_the_popular_front
				170 = { check_variable = { var = SPA_garrison_control value = 2 compare = equals } }
			}
		}
		icon = {
			key = spr_garrison_control_strong
			trigger = {
				has_completed_focus = SPR_the_popular_front
				170 = { check_variable = { var = SPA_garrison_control value = 3 compare = equals } }
			}
		}
		icon = {
			key = spr_garrison_control_total
			trigger = {
				has_completed_focus = SPR_the_popular_front
				170 = { check_variable = { var = SPA_garrison_control value = 4 compare = greater_than_or_equals } }
			}
		}

		available = {
			has_full_control_of_state = 170
			if = {
				limit = {
					has_completed_focus = SPA_a_great_spain
				}
				custom_trigger_tooltip = {
					tooltip = SPA_expand_influence_nationalists_trigger_tt
					170 = { check_variable = { var = SPA_garrison_control value = 4 compare = less_than } }
				}
			}
			if = {
				limit = {
					has_completed_focus = SPR_the_popular_front
				}
				custom_trigger_tooltip = {
					tooltip = SPR_expand_influence_republicans_trigger_tt
					170 = { check_variable = { var = SPA_garrison_control value = 2 compare = greater_than_or_equals } }
				}
			}
			NOT = {
				has_country_flag = SPA_already_expanding_influence_flag
			}
		}

		highlight_states = {
			highlight_state_targets = {
				state = 170
			} 
		}

		on_map_mode = map_only

		cost = 170.SPA_garrison_control_cost?10

		fire_only_once = no

		days_remove = 14

		visible = {
			NOT = { has_global_flag = spanish_civil_war }
			has_country_flag = SPR_spanish_elections_flag
		}

		cancel_if_not_visible = yes

		complete_effect = {
			set_country_flag = SPA_already_expanding_influence_flag
		}

		remove_effect = {
			if = {
				limit = {
					has_completed_focus = SPA_a_great_spain
				}
				170 = {
					custom_effect_tooltip = SPA_expand_influence_nationalists_tt
					set_state_flag = { flag = SPR_recently_expanded_influence_flag value = 1 days = 15 }
					hidden_effect = {
						if = {
							limit = { check_variable = { SPA_garrison_control < 4 } }
							
							add_to_variable = { var = SPA_garrison_control value = 1 }
							SPR = { add_to_variable = { var = spa_civil_war_divisions_counter_var value = 1 } }
							SPR = { subtract_from_variable = { var = spr_civil_war_divisions_counter_var value = 1 } }
						}
					}
					SPA_garrison_control_tooltip = yes
					SPA_garrison_control_cost_calculation = yes
				}
			}
			if = {
				limit = {
					has_completed_focus = SPR_the_popular_front
				}
				170 = {
					custom_effect_tooltip = SPR_expand_influence_republicans_tt
					set_state_flag = { flag = SPR_recently_expanded_influence_flag value = 1 days = 15 }
					hidden_effect = {
						subtract_from_variable = { var = SPA_garrison_control value = 1 }
						SPR = { subtract_from_variable = { var = spa_civil_war_divisions_counter_var value = 1 } }
						SPR = { add_to_variable = { var = spr_civil_war_divisions_counter_var value = 1 } }
					}
					SPA_garrison_control_tooltip = yes
					SPR_garrison_control_cost_calculation = yes
				}
			}
			clr_country_flag = SPA_already_expanding_influence_flag
		}

		ai_will_do = {
			base = 110
			modifier = {
				170 = { has_state_flag = SPR_recently_expanded_influence_flag }
				factor = 10
			}
			modifier = {
				has_completed_focus = SPA_a_great_spain
				170 = { check_variable = { var = SPA_garrison_control value = 2 compare = greater_than_or_equals } }
				factor = 5
			}
			modifier = {
				has_completed_focus = SPA_a_great_spain
				170 = { check_variable = { var = SPA_garrison_control value = 3 compare = greater_than_or_equals } }
				factor = 5
			}
			modifier = {
				has_completed_focus = SPA_a_great_spain
				is_historical_focus_on = yes
				factor = 10
			}
		}
	}

	SPA_expand_influence_in_the_ciudad_real_garrison = {

		icon = {
			key = spa_garrison_control_none
			trigger = {
				has_completed_focus = SPA_a_great_spain
				175 = { check_variable = { var = SPA_garrison_control value = 1 compare = equals } }
			}
		}
		icon = {
			key = spa_garrison_control_weak
			trigger = {
				has_completed_focus = SPA_a_great_spain
				175 = { check_variable = { var = SPA_garrison_control value = 2 compare = equals } }
			}
		}
		icon = {
			key = spa_garrison_control_strong
			trigger = {
				has_completed_focus = SPA_a_great_spain
				175 = { check_variable = { var = SPA_garrison_control value = 3 compare = equals } }
			}
		}
		icon = {
			key = spa_garrison_control_total
			trigger = {
				has_completed_focus = SPA_a_great_spain
				175 = { check_variable = { var = SPA_garrison_control value = 4 compare = greater_than_or_equals } }
			}
		}
		icon = {
			key = spr_garrison_control_none
			trigger = {
				has_completed_focus = SPR_the_popular_front
				175 = { check_variable = { var = SPA_garrison_control value = 1 compare = equals } }
			}
		}
		icon = {
			key = spr_garrison_control_weak
			trigger = {
				has_completed_focus = SPR_the_popular_front
				175 = { check_variable = { var = SPA_garrison_control value = 2 compare = equals } }
			}
		}
		icon = {
			key = spr_garrison_control_strong
			trigger = {
				has_completed_focus = SPR_the_popular_front
				175 = { check_variable = { var = SPA_garrison_control value = 3 compare = equals } }
			}
		}
		icon = {
			key = spr_garrison_control_total
			trigger = {
				has_completed_focus = SPR_the_popular_front
				175 = { check_variable = { var = SPA_garrison_control value = 4 compare = greater_than_or_equals } }
			}
		}

		available = {
			has_full_control_of_state = 175
			if = {
				limit = {
					has_completed_focus = SPA_a_great_spain
				}
				custom_trigger_tooltip = {
					tooltip = SPA_expand_influence_nationalists_trigger_tt
					175 = { check_variable = { var = SPA_garrison_control value = 4 compare = less_than } }
				}
			}
			if = {
				limit = {
					has_completed_focus = SPR_the_popular_front
				}
				custom_trigger_tooltip = {
					tooltip = SPR_expand_influence_republicans_trigger_tt
					175 = { check_variable = { var = SPA_garrison_control value = 2 compare = greater_than_or_equals } }
				}
			}
			NOT = {
				has_country_flag = SPA_already_expanding_influence_flag
			}
		}

		highlight_states = {
			highlight_state_targets = {
				state = 175
			} 
		}

		on_map_mode = map_only

		cost = 175.SPA_garrison_control_cost?10

		fire_only_once = no

		days_remove = 14

		visible = {
			NOT = { has_global_flag = spanish_civil_war }
			has_country_flag = SPR_spanish_elections_flag
		}

		cancel_if_not_visible = yes

		complete_effect = {
			set_country_flag = SPA_already_expanding_influence_flag
		}

		remove_effect = {
			if = {
				limit = {
					has_completed_focus = SPA_a_great_spain
				}
				175 = {
					custom_effect_tooltip = SPA_expand_influence_nationalists_tt
					set_state_flag = { flag = SPR_recently_expanded_influence_flag value = 1 days = 15 }
					hidden_effect = {
						if = {
							limit = { check_variable = { SPA_garrison_control < 4 } }
							
							add_to_variable = { var = SPA_garrison_control value = 1 }
							SPR = { add_to_variable = { var = spa_civil_war_divisions_counter_var value = 1 } }
							SPR = { subtract_from_variable = { var = spr_civil_war_divisions_counter_var value = 1 } }
						}
					}
					SPA_garrison_control_tooltip = yes
					SPA_garrison_control_cost_calculation = yes
				}
			}
			if = {
				limit = {
					has_completed_focus = SPR_the_popular_front
				}
				175 = {
					custom_effect_tooltip = SPR_expand_influence_republicans_tt
					set_state_flag = { flag = SPR_recently_expanded_influence_flag value = 1 days = 15 }
					hidden_effect = {
						subtract_from_variable = { var = SPA_garrison_control value = 1 }
						SPR = { subtract_from_variable = { var = spa_civil_war_divisions_counter_var value = 1 } }
						SPR = { add_to_variable = { var = spr_civil_war_divisions_counter_var value = 1 } }
					}
					SPA_garrison_control_tooltip = yes
					SPR_garrison_control_cost_calculation = yes
				}
			}
			clr_country_flag = SPA_already_expanding_influence_flag
		}

		ai_will_do = {
			base = 110
			modifier = {
				175 = { has_state_flag = SPR_recently_expanded_influence_flag }
				factor = 10
			}
			modifier = {
				has_completed_focus = SPA_a_great_spain
				175 = { check_variable = { var = SPA_garrison_control value = 2 compare = greater_than_or_equals } }
				factor = 5
			}
			modifier = {
				has_completed_focus = SPA_a_great_spain
				175 = { check_variable = { var = SPA_garrison_control value = 3 compare = greater_than_or_equals } }
				factor = 5
			}
			modifier = {
				has_completed_focus = SPA_a_great_spain
				is_historical_focus_on = yes
				factor = 0
			}
		}
	}

	SPA_expand_influence_in_the_murcia_garrison = {

		icon = {
			key = spa_garrison_control_none
			trigger = {
				has_completed_focus = SPA_a_great_spain
				168 = { check_variable = { var = SPA_garrison_control value = 1 compare = equals } }
			}
		}
		icon = {
			key = spa_garrison_control_weak
			trigger = {
				has_completed_focus = SPA_a_great_spain
				168 = { check_variable = { var = SPA_garrison_control value = 2 compare = equals } }
			}
		}
		icon = {
			key = spa_garrison_control_strong
			trigger = {
				has_completed_focus = SPA_a_great_spain
				168 = { check_variable = { var = SPA_garrison_control value = 3 compare = equals } }
			}
		}
		icon = {
			key = spa_garrison_control_total
			trigger = {
				has_completed_focus = SPA_a_great_spain
				168 = { check_variable = { var = SPA_garrison_control value = 4 compare = greater_than_or_equals } }
			}
		}
		icon = {
			key = spr_garrison_control_none
			trigger = {
				has_completed_focus = SPR_the_popular_front
				168 = { check_variable = { var = SPA_garrison_control value = 1 compare = equals } }
			}
		}
		icon = {
			key = spr_garrison_control_weak
			trigger = {
				has_completed_focus = SPR_the_popular_front
				168 = { check_variable = { var = SPA_garrison_control value = 2 compare = equals } }
			}
		}
		icon = {
			key = spr_garrison_control_strong
			trigger = {
				has_completed_focus = SPR_the_popular_front
				168 = { check_variable = { var = SPA_garrison_control value = 3 compare = equals } }
			}
		}
		icon = {
			key = spr_garrison_control_total
			trigger = {
				has_completed_focus = SPR_the_popular_front
				168 = { check_variable = { var = SPA_garrison_control value = 4 compare = greater_than_or_equals } }
			}
		}

		available = {
			has_full_control_of_state = 168
			if = {
				limit = {
					has_completed_focus = SPA_a_great_spain
				}
				custom_trigger_tooltip = {
					tooltip = SPA_expand_influence_nationalists_trigger_tt
					168 = { check_variable = { var = SPA_garrison_control value = 4 compare = less_than } }
				}
			}
			if = {
				limit = {
					has_completed_focus = SPR_the_popular_front
				}
				custom_trigger_tooltip = {
					tooltip = SPR_expand_influence_republicans_trigger_tt
					168 = { check_variable = { var = SPA_garrison_control value = 2 compare = greater_than_or_equals } }
				}
			}
			NOT = {
				has_country_flag = SPA_already_expanding_influence_flag
			}
		}

		highlight_states = {
			highlight_state_targets = {
				state = 168
			} 
		}

		on_map_mode = map_only

		cost = 168.SPA_garrison_control_cost?10

		fire_only_once = no

		days_remove = 14

		visible = {
			NOT = { has_global_flag = spanish_civil_war }
			has_country_flag = SPR_spanish_elections_flag
		}

		cancel_if_not_visible = yes

		complete_effect = {
			set_country_flag = SPA_already_expanding_influence_flag
		}

		remove_effect = {
			if = {
				limit = {
					has_completed_focus = SPA_a_great_spain
				}
				168 = {
					custom_effect_tooltip = SPA_expand_influence_nationalists_tt
					set_state_flag = { flag = SPR_recently_expanded_influence_flag value = 1 days = 15 }
					hidden_effect = {
						if = {
							limit = { check_variable = { SPA_garrison_control < 4 } }
							
							add_to_variable = { var = SPA_garrison_control value = 1 }
							SPR = { add_to_variable = { var = spa_civil_war_divisions_counter_var value = 1 } }
							SPR = { subtract_from_variable = { var = spr_civil_war_divisions_counter_var value = 1 } }
						}
					}
					SPA_garrison_control_tooltip = yes
					SPA_garrison_control_cost_calculation = yes
				}
			}
			if = {
				limit = {
					has_completed_focus = SPR_the_popular_front
				}
				168 = {
					custom_effect_tooltip = SPR_expand_influence_republicans_tt
					set_state_flag = { flag = SPR_recently_expanded_influence_flag value = 1 days = 15 }
					hidden_effect = {
						subtract_from_variable = { var = SPA_garrison_control value = 1 }
						SPR = { subtract_from_variable = { var = spa_civil_war_divisions_counter_var value = 1 } }
						SPR = { add_to_variable = { var = spr_civil_war_divisions_counter_var value = 1 } }
					}
					SPA_garrison_control_tooltip = yes
					SPR_garrison_control_cost_calculation = yes
				}
			}
			clr_country_flag = SPA_already_expanding_influence_flag
		}

		ai_will_do = {
			base = 110
			modifier = {
				168 = { has_state_flag = SPR_recently_expanded_influence_flag }
				factor = 10
			}
			modifier = {
				has_completed_focus = SPA_a_great_spain
				168 = { check_variable = { var = SPA_garrison_control value = 2 compare = greater_than_or_equals } }
				factor = 5
			}
			modifier = {
				has_completed_focus = SPA_a_great_spain
				168 = { check_variable = { var = SPA_garrison_control value = 3 compare = greater_than_or_equals } }
				factor = 5
			}
			modifier = {
				has_completed_focus = SPA_a_great_spain
				is_historical_focus_on = yes
				factor = 0
			}
		}
	}

	SPA_expand_influence_in_the_sevilla_garrison = {

		icon = {
			key = spa_garrison_control_none
			trigger = {
				has_completed_focus = SPA_a_great_spain
				169 = { check_variable = { var = SPA_garrison_control value = 1 compare = equals } }
			}
		}
		icon = {
			key = spa_garrison_control_weak
			trigger = {
				has_completed_focus = SPA_a_great_spain
				169 = { check_variable = { var = SPA_garrison_control value = 2 compare = equals } }
			}
		}
		icon = {
			key = spa_garrison_control_strong
			trigger = {
				has_completed_focus = SPA_a_great_spain
				169 = { check_variable = { var = SPA_garrison_control value = 3 compare = equals } }
			}
		}
		icon = {
			key = spa_garrison_control_total
			trigger = {
				has_completed_focus = SPA_a_great_spain
				169 = { check_variable = { var = SPA_garrison_control value = 4 compare = greater_than_or_equals } }
			}
		}
		icon = {
			key = spr_garrison_control_none
			trigger = {
				has_completed_focus = SPR_the_popular_front
				169 = { check_variable = { var = SPA_garrison_control value = 1 compare = equals } }
			}
		}
		icon = {
			key = spr_garrison_control_weak
			trigger = {
				has_completed_focus = SPR_the_popular_front
				169 = { check_variable = { var = SPA_garrison_control value = 2 compare = equals } }
			}
		}
		icon = {
			key = spr_garrison_control_strong
			trigger = {
				has_completed_focus = SPR_the_popular_front
				169 = { check_variable = { var = SPA_garrison_control value = 3 compare = equals } }
			}
		}
		icon = {
			key = spr_garrison_control_total
			trigger = {
				has_completed_focus = SPR_the_popular_front
				169 = { check_variable = { var = SPA_garrison_control value = 4 compare = greater_than_or_equals } }
			}
		}

		available = {
			has_full_control_of_state = 169
			if = {
				limit = {
					has_completed_focus = SPA_a_great_spain
				}
				custom_trigger_tooltip = {
					tooltip = SPA_expand_influence_nationalists_trigger_tt
					169 = { check_variable = { var = SPA_garrison_control value = 4 compare = less_than } }
				}
			}
			if = {
				limit = {
					has_completed_focus = SPR_the_popular_front
				}
				custom_trigger_tooltip = {
					tooltip = SPR_expand_influence_republicans_trigger_tt
					169 = { check_variable = { var = SPA_garrison_control value = 2 compare = greater_than_or_equals } }
				}
			}
			NOT = {
				has_country_flag = SPA_already_expanding_influence_flag
			}
		}

		highlight_states = {
			highlight_state_targets = {
				state = 169
			} 
		}

		on_map_mode = map_only

		cost = 169.SPA_garrison_control_cost?10

		fire_only_once = no

		days_remove = 14

		visible = {
			NOT = { has_global_flag = spanish_civil_war }
			has_country_flag = SPR_spanish_elections_flag
		}

		cancel_if_not_visible = yes

		complete_effect = {
			set_country_flag = SPA_already_expanding_influence_flag
		}

		remove_effect = {
			if = {
				limit = {
					has_completed_focus = SPA_a_great_spain
				}
				169 = {
					custom_effect_tooltip = SPA_expand_influence_nationalists_tt
					set_state_flag = { flag = SPR_recently_expanded_influence_flag value = 1 days = 15 }
					hidden_effect = {
						if = {
							limit = { check_variable = { SPA_garrison_control < 4 } }
							
							add_to_variable = { var = SPA_garrison_control value = 1 }
							SPR = { add_to_variable = { var = spa_civil_war_divisions_counter_var value = 1 } }
							SPR = { subtract_from_variable = { var = spr_civil_war_divisions_counter_var value = 1 } }
						}
					}
					SPA_garrison_control_tooltip = yes
					SPA_garrison_control_cost_calculation = yes
				}
			}
			if = {
				limit = {
					has_completed_focus = SPR_the_popular_front
				}
				169 = {
					custom_effect_tooltip = SPR_expand_influence_republicans_tt
					set_state_flag = { flag = SPR_recently_expanded_influence_flag value = 1 days = 15 }
					hidden_effect = {
						subtract_from_variable = { var = SPA_garrison_control value = 1 }
						SPR = { subtract_from_variable = { var = spa_civil_war_divisions_counter_var value = 1 } }
						SPR = { add_to_variable = { var = spr_civil_war_divisions_counter_var value = 1 } }
					}
					SPA_garrison_control_tooltip = yes
					SPR_garrison_control_cost_calculation = yes
				}
			}
			clr_country_flag = SPA_already_expanding_influence_flag
		}

		ai_will_do = {
			base = 110
			modifier = {
				169 = { has_state_flag = SPR_recently_expanded_influence_flag }
				factor = 10
			}
			modifier = {
				has_completed_focus = SPA_a_great_spain
				169 = { check_variable = { var = SPA_garrison_control value = 2 compare = greater_than_or_equals } }
				factor = 5
			}
			modifier = {
				has_completed_focus = SPA_a_great_spain
				169 = { check_variable = { var = SPA_garrison_control value = 3 compare = greater_than_or_equals } }
				factor = 5
			}
			modifier = {
				has_completed_focus = SPA_a_great_spain
				is_historical_focus_on = yes
				factor = 10
			}
		}
	}

	SPA_expand_influence_in_the_cordoba_garrison = {

		icon = {
			key = spa_garrison_control_none
			trigger = {
				has_completed_focus = SPA_a_great_spain
				789 = { check_variable = { var = SPA_garrison_control value = 1 compare = equals } }
			}
		}
		icon = {
			key = spa_garrison_control_weak
			trigger = {
				has_completed_focus = SPA_a_great_spain
				789 = { check_variable = { var = SPA_garrison_control value = 2 compare = equals } }
			}
		}
		icon = {
			key = spa_garrison_control_strong
			trigger = {
				has_completed_focus = SPA_a_great_spain
				789 = { check_variable = { var = SPA_garrison_control value = 3 compare = equals } }
			}
		}
		icon = {
			key = spa_garrison_control_total
			trigger = {
				has_completed_focus = SPA_a_great_spain
				789 = { check_variable = { var = SPA_garrison_control value = 4 compare = greater_than_or_equals } }
			}
		}
		icon = {
			key = spr_garrison_control_none
			trigger = {
				has_completed_focus = SPR_the_popular_front
				789 = { check_variable = { var = SPA_garrison_control value = 1 compare = equals } }
			}
		}
		icon = {
			key = spr_garrison_control_weak
			trigger = {
				has_completed_focus = SPR_the_popular_front
				789 = { check_variable = { var = SPA_garrison_control value = 2 compare = equals } }
			}
		}
		icon = {
			key = spr_garrison_control_strong
			trigger = {
				has_completed_focus = SPR_the_popular_front
				789 = { check_variable = { var = SPA_garrison_control value = 3 compare = equals } }
			}
		}
		icon = {
			key = spr_garrison_control_total
			trigger = {
				has_completed_focus = SPR_the_popular_front
				789 = { check_variable = { var = SPA_garrison_control value = 4 compare = greater_than_or_equals } }
			}
		}

		available = {
			has_full_control_of_state = 789
			if = {
				limit = {
					has_completed_focus = SPA_a_great_spain
				}
				custom_trigger_tooltip = {
					tooltip = SPA_expand_influence_nationalists_trigger_tt
					789 = { check_variable = { var = SPA_garrison_control value = 4 compare = less_than } }
				}
			}
			if = {
				limit = {
					has_completed_focus = SPR_the_popular_front
				}
				custom_trigger_tooltip = {
					tooltip = SPR_expand_influence_republicans_trigger_tt
					789 = { check_variable = { var = SPA_garrison_control value = 2 compare = greater_than_or_equals } }
				}
			}
			NOT = {
				has_country_flag = SPA_already_expanding_influence_flag
			}
		}

		highlight_states = {
			highlight_state_targets = {
				state = 789
			} 
		}

		on_map_mode = map_only

		cost = 789.SPA_garrison_control_cost?10

		fire_only_once = no

		days_remove = 14

		visible = {
			NOT = { has_global_flag = spanish_civil_war }
			has_country_flag = SPR_spanish_elections_flag
		}

		cancel_if_not_visible = yes

		complete_effect = {
			set_country_flag = SPA_already_expanding_influence_flag
		}

		remove_effect = {
			if = {
				limit = {
					has_completed_focus = SPA_a_great_spain
				}
				789 = {
					custom_effect_tooltip = SPA_expand_influence_nationalists_tt
					set_state_flag = { flag = SPR_recently_expanded_influence_flag value = 1 days = 15 }
					hidden_effect = {
						if = {
							limit = { check_variable = { SPA_garrison_control < 4 } }
							
							add_to_variable = { var = SPA_garrison_control value = 1 }
							SPR = { add_to_variable = { var = spa_civil_war_divisions_counter_var value = 1 } }
							SPR = { subtract_from_variable = { var = spr_civil_war_divisions_counter_var value = 1 } }
						}
					}
					SPA_garrison_control_tooltip = yes
					SPA_garrison_control_cost_calculation = yes
				}
			}
			if = {
				limit = {
					has_completed_focus = SPR_the_popular_front
				}
				789 = {
					custom_effect_tooltip = SPR_expand_influence_republicans_tt
					set_state_flag = { flag = SPR_recently_expanded_influence_flag value = 1 days = 15 }
					hidden_effect = {
						subtract_from_variable = { var = SPA_garrison_control value = 1 }
						SPR = { subtract_from_variable = { var = spa_civil_war_divisions_counter_var value = 1 } }
						SPR = { add_to_variable = { var = spr_civil_war_divisions_counter_var value = 1 } }
					}
					SPA_garrison_control_tooltip = yes
					SPR_garrison_control_cost_calculation = yes
				}
			}
			clr_country_flag = SPA_already_expanding_influence_flag
		}

		ai_will_do = {
			base = 110
			modifier = {
				789 = { has_state_flag = SPR_recently_expanded_influence_flag }
				factor = 10
			}
			modifier = {
				has_completed_focus = SPA_a_great_spain
				789 = { check_variable = { var = SPA_garrison_control value = 2 compare = greater_than_or_equals } }
				factor = 5
			}
			modifier = {
				has_completed_focus = SPA_a_great_spain
				789 = { check_variable = { var = SPA_garrison_control value = 3 compare = greater_than_or_equals } }
				factor = 5
			}
			modifier = {
				has_completed_focus = SPA_a_great_spain
				is_historical_focus_on = yes
				factor = 5
			}
		}
	}

	SPA_expand_influence_in_the_granada_garrison = {

		icon = {
			key = spa_garrison_control_none
			trigger = {
				has_completed_focus = SPA_a_great_spain
				173 = { check_variable = { var = SPA_garrison_control value = 1 compare = equals } }
			}
		}
		icon = {
			key = spa_garrison_control_weak
			trigger = {
				has_completed_focus = SPA_a_great_spain
				173 = { check_variable = { var = SPA_garrison_control value = 2 compare = equals } }
			}
		}
		icon = {
			key = spa_garrison_control_strong
			trigger = {
				has_completed_focus = SPA_a_great_spain
				173 = { check_variable = { var = SPA_garrison_control value = 3 compare = equals } }
			}
		}
		icon = {
			key = spa_garrison_control_total
			trigger = {
				has_completed_focus = SPA_a_great_spain
				173 = { check_variable = { var = SPA_garrison_control value = 4 compare = greater_than_or_equals } }
			}
		}
		icon = {
			key = spr_garrison_control_none
			trigger = {
				has_completed_focus = SPR_the_popular_front
				173 = { check_variable = { var = SPA_garrison_control value = 1 compare = equals } }
			}
		}
		icon = {
			key = spr_garrison_control_weak
			trigger = {
				has_completed_focus = SPR_the_popular_front
				173 = { check_variable = { var = SPA_garrison_control value = 2 compare = equals } }
			}
		}
		icon = {
			key = spr_garrison_control_strong
			trigger = {
				has_completed_focus = SPR_the_popular_front
				173 = { check_variable = { var = SPA_garrison_control value = 3 compare = equals } }
			}
		}
		icon = {
			key = spr_garrison_control_total
			trigger = {
				has_completed_focus = SPR_the_popular_front
				173 = { check_variable = { var = SPA_garrison_control value = 4 compare = greater_than_or_equals } }
			}
		}

		available = {
			has_full_control_of_state = 173
			if = {
				limit = {
					has_completed_focus = SPA_a_great_spain
				}
				custom_trigger_tooltip = {
					tooltip = SPA_expand_influence_nationalists_trigger_tt
					173 = { check_variable = { var = SPA_garrison_control value = 4 compare = less_than } }
				}
			}
			if = {
				limit = {
					has_completed_focus = SPR_the_popular_front
				}
				custom_trigger_tooltip = {
					tooltip = SPR_expand_influence_republicans_trigger_tt
					173 = { check_variable = { var = SPA_garrison_control value = 2 compare = greater_than_or_equals } }
				}
			}
			NOT = {
				has_country_flag = SPA_already_expanding_influence_flag
			}
		}

		highlight_states = {
			highlight_state_targets = {
				state = 173
			} 
		}

		on_map_mode = map_only

		cost = 173.SPA_garrison_control_cost?10

		fire_only_once = no

		days_remove = 14

		visible = {
			NOT = { has_global_flag = spanish_civil_war }
			has_country_flag = SPR_spanish_elections_flag
		}

		cancel_if_not_visible = yes

		complete_effect = {
			set_country_flag = SPA_already_expanding_influence_flag
		}

		remove_effect = {
			if = {
				limit = {
					has_completed_focus = SPA_a_great_spain
				}
				173 = {
					custom_effect_tooltip = SPA_expand_influence_nationalists_tt
					set_state_flag = { flag = SPR_recently_expanded_influence_flag value = 1 days = 15 }
					hidden_effect = {
						if = {
							limit = { check_variable = { SPA_garrison_control < 4 } }
							
							add_to_variable = { var = SPA_garrison_control value = 1 }
							SPR = { add_to_variable = { var = spa_civil_war_divisions_counter_var value = 1 } }
							SPR = { subtract_from_variable = { var = spr_civil_war_divisions_counter_var value = 1 } }
						}
					}
					SPA_garrison_control_tooltip = yes
					SPA_garrison_control_cost_calculation = yes
				}
			}
			if = {
				limit = {
					has_completed_focus = SPR_the_popular_front
				}
				173 = {
					custom_effect_tooltip = SPR_expand_influence_republicans_tt
					set_state_flag = { flag = SPR_recently_expanded_influence_flag value = 1 days = 15 }
					hidden_effect = {
						subtract_from_variable = { var = SPA_garrison_control value = 1 }
						SPR = { subtract_from_variable = { var = spa_civil_war_divisions_counter_var value = 1 } }
						SPR = { add_to_variable = { var = spr_civil_war_divisions_counter_var value = 1 } }
					}
					SPA_garrison_control_tooltip = yes
					SPR_garrison_control_cost_calculation = yes
				}
			}
			clr_country_flag = SPA_already_expanding_influence_flag
		}

		ai_will_do = {
			base = 110
			modifier = {
				173 = { has_state_flag = SPR_recently_expanded_influence_flag }
				factor = 10
			}
			modifier = {
				has_completed_focus = SPA_a_great_spain
				173 = { check_variable = { var = SPA_garrison_control value = 2 compare = greater_than_or_equals } }
				factor = 5
			}
			modifier = {
				has_completed_focus = SPA_a_great_spain
				173 = { check_variable = { var = SPA_garrison_control value = 3 compare = greater_than_or_equals } }
				factor = 5
			}
			modifier = {
				has_completed_focus = SPA_a_great_spain
				is_historical_focus_on = yes
				factor = 0
			}
		}
	}

}

SPR_opposition_civil_war_preparations = {

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

	SPA_hand_over_the_ceda_campaign_chest_mission = {

		priority = 10

		name = SPA_hand_over_the_ceda_campaign_chest

		icon = eng_trade_unions_support

		available = {
			hidden_trigger = { always = no }
		}

		days_mission_timeout = 23

		fire_only_once = yes

		activation = {
			always = no
		}

		visible = {
			tag = SPR
			NOT = { has_global_flag = spanish_civil_war }
		}

		cancel_if_not_visible = yes

		is_good = yes

		timeout_effect = {
			set_country_flag = SPA_hand_over_the_ceda_campaign_chest_flag
			hidden_effect = { activate_mission = SPA_negotiate_carlist_support_mission }
		}
	}

	SPA_negotiate_carlist_support_mission = {

		priority = 10

		name = SPA_negotiate_carlist_support

		icon = eng_trade_unions_support

		available = {
			hidden_trigger = { always = no }
		}

		days_mission_timeout = 28

		fire_only_once = yes

		activation = {
			always = no
		}

		visible = {
			tag = SPR
			NOT = { has_global_flag = spanish_civil_war }
		}

		cancel_if_not_visible = yes

		is_good = yes

		timeout_effect = {
			if = {
				limit = {
					difficulty > 1
					is_ai = no
				}
				custom_effect_tooltip = SPA_negotiate_carlist_support_mission_tt_2
				add_to_variable = { var = spa_civil_war_divisions_counter_var value = 10 }
			}
			else = {
				custom_effect_tooltip = SPA_negotiate_carlist_support_mission_tt
				add_to_variable = { var = spa_civil_war_divisions_counter_var value = 5 }
			}
			set_country_flag = SPA_negotiate_carlist_support_flag
			hidden_effect = { activate_mission = SPA_the_army_of_africa_mission }
		}
	}

	SPA_the_army_of_africa_mission = {

		priority = 10

		name = SPA_the_army_of_africa

		icon = eng_trade_unions_support

		available = {
			hidden_trigger = { always = no }
		}

		days_mission_timeout = 35

		fire_only_once = yes

		activation = {
			always = no
		}

		visible = {
			tag = SPR
			NOT = { has_global_flag = spanish_civil_war }
		}

		cancel_if_not_visible = yes

		is_good = yes

		timeout_effect = {
			custom_effect_tooltip = SPA_the_army_of_africa_mission_tt
			set_country_flag = SPA_the_army_of_africa_flag
			add_to_variable = { var = spa_civil_war_divisions_counter_var value = 5 }
			hidden_effect = { activate_mission = SPA_secure_the_northern_garrisons_mission }
		}
	}

	SPA_secure_the_northern_garrisons_mission = {

		priority = 10

		name = SPA_secure_the_northern_garrisons

		icon = eng_trade_unions_support

		available = {
			hidden_trigger = { always = no }
		}

		days_mission_timeout = 35

		fire_only_once = yes

		activation = {
			always = no
		}

		visible = {
			tag = SPR
			NOT = { has_global_flag = spanish_civil_war }
		}

		cancel_if_not_visible = yes

		is_good = yes

		timeout_effect = {
			custom_effect_tooltip = SPA_secure_the_northern_garrisons_mission_tt
			set_country_flag = SPA_secure_the_northern_garrisons_flag
			hidden_effect = {
				random_list = {
					10 = {
						modifier = {
							factor = 0
							is_historical_focus_on = yes
						}
						activate_mission = SPA_sin_paquito_mission
					}
					10 = {
						activate_mission = SPA_con_paquito_mission
					}
				}
				every_owned_state = {
					limit = {
						check_variable = { var = SPA_garrison_control value = 1 compare = equals }
						OR = {
							state = 171
							state = 174
							state = 788
							state = 791
							state = 176
							state = 166
							state = 172
						}
					}
					set_state_flag = SPA_northern_garrisons_state_flag
					add_to_variable = { var = SPA_garrison_control value = 3 }
					SPR = { add_to_variable = { var = spa_civil_war_divisions_counter_var value = 3 } }
					SPR = { subtract_from_variable = { var = spr_civil_war_divisions_counter_var value = 3 } }
					SPR_garrison_control_cost_calculation = yes
				}
				every_owned_state = {
					limit = {
						check_variable = { var = SPA_garrison_control value = 2 compare = equals }
						OR = {
							state = 171
							state = 174
							state = 788
							state = 791
							state = 176
							state = 166
							state = 172
						}
					}
					set_state_flag = SPA_northern_garrisons_state_flag
					add_to_variable = { var = SPA_garrison_control value = 2 }
					SPR = { add_to_variable = { var = spa_civil_war_divisions_counter_var value = 2 } }
					SPR = { subtract_from_variable = { var = spr_civil_war_divisions_counter_var value = 2 } }
					SPR_garrison_control_cost_calculation = yes
				}
				every_owned_state = {
					limit = {
						check_variable = { var = SPA_garrison_control value = 3 compare = equals }
						OR = {
							state = 171
							state = 174
							state = 788
							state = 791
							state = 176
							state = 166
							state = 172
						}
					}
					set_state_flag = SPA_northern_garrisons_state_flag
					add_to_variable = { var = SPA_garrison_control value = 1 }
					SPR = { add_to_variable = { var = spa_civil_war_divisions_counter_var value = 1 } }
					SPR = { subtract_from_variable = { var = spr_civil_war_divisions_counter_var value = 1 } }
					SPR_garrison_control_cost_calculation = yes
				}
			}
		}
	}

	SPA_sin_paquito_mission = {

		priority = 10

		name = SPA_sin_paquito

		icon = eng_trade_unions_support

		available = {
			hidden_trigger = { always = no }
		}

		days_mission_timeout = 28

		fire_only_once = yes

		activation = {
			always = no
		}

		visible = {
			tag = SPR
			NOT = { has_global_flag = spanish_civil_war }
		}

		cancel_if_not_visible = yes

		is_good = yes

		timeout_effect = {
			set_country_flag = SPA_sin_paquito_flag
		}
	}

	SPA_con_paquito_mission = {

		priority = 10

		name = SPA_con_paquito

		icon = eng_trade_unions_support

		available = {
			hidden_trigger = { always = no }
		}

		days_mission_timeout = 28

		fire_only_once = yes

		activation = {
			always = no
		}

		visible = {
			tag = SPR
			NOT = { has_global_flag = spanish_civil_war }
		}

		cancel_if_not_visible = yes

		is_good = yes

		timeout_effect = {
			random_unit_leader = {
				limit = {
					has_id = 1108
				}
				add_unit_leader_trait = trait_SPA_nationalist_sympathies
			}
			set_country_flag = SPA_con_paquito_flag
		}
	}

	SPR_secure_the_guardia_de_asalto_mission = {

		priority = 10

		name = SPR_secure_the_guardia_de_asalto

		icon = eng_trade_unions_support

		available = {
			hidden_trigger = { always = no }
		}

		days_mission_timeout = 58

		fire_only_once = yes

		activation = {
			always = no
		}

		visible = {
			tag = SPR
			NOT = { has_global_flag = spanish_civil_war }
		}

		cancel_if_not_visible = yes

		is_good = yes

		timeout_effect = {
			if = {
				limit = {
					difficulty > 1
					is_ai = no
				}
				custom_effect_tooltip = SPR_secure_the_guardia_de_asalto_mission_tt_2
				add_to_variable = { var = spa_civil_war_divisions_counter_var value = -10 }
				add_to_variable = { var = spr_civil_war_divisions_counter_var value = 5 }
			}
			else = {
				custom_effect_tooltip = SPR_secure_the_guardia_de_asalto_mission_tt
				add_to_variable = { var = spa_civil_war_divisions_counter_var value = -6 }
				add_to_variable = { var = spr_civil_war_divisions_counter_var value = 3 }
			}
			custom_effect_tooltip = SPR_remove_after_civil_war_tt
			hidden_effect = { activate_mission = SPR_train_the_union_youth_mission }
			set_country_flag = SPR_secure_the_guardia_de_asalto_flag
		}
	}

	SPR_secure_the_guardia_civil_mission = {

		priority = 10

		name = SPR_secure_the_guardia_civil

		icon = eng_trade_unions_support

		available = {
			hidden_trigger = { always = no }
		}

		days_mission_timeout = 58

		fire_only_once = yes

		activation = {
			always = no
		}

		visible = {
			tag = SPR
			NOT = { has_global_flag = spanish_civil_war }
		}

		cancel_if_not_visible = yes

		is_good = yes

		timeout_effect = {
			if = {
				limit = {
					difficulty > 1
					is_ai = no
				}
				custom_effect_tooltip = SPR_secure_the_guardia_civil_mission_tt_2
				add_to_variable = { var = spa_civil_war_divisions_counter_var value = -5 }
				add_to_variable = { var = spr_civil_war_divisions_counter_var value = 10 }
			}
			else = {
				custom_effect_tooltip = SPR_secure_the_guardia_civil_mission_tt
				add_to_variable = { var = spa_civil_war_divisions_counter_var value = -3 }
				add_to_variable = { var = spr_civil_war_divisions_counter_var value = 6 }
			}
			custom_effect_tooltip = SPR_remove_after_civil_war_tt
			hidden_effect = { activate_mission = SPR_train_the_union_youth_mission }
			set_country_flag = SPR_secure_the_guardia_civil_flag
		}
	}

	SPR_train_the_union_youth_mission = {

		priority = 10

		name = SPR_train_the_union_youth

		icon = eng_trade_unions_support

		available = {
			hidden_trigger = { always = no }
		}

		days_mission_timeout = 70

		fire_only_once = yes

		activation = {
			always = no
		}

		visible = {
			tag = SPR
			NOT = { has_global_flag = spanish_civil_war }
		}

		cancel_if_not_visible = yes

		is_good = yes

		timeout_effect = {
			if = {
				limit = {
					difficulty > 1
					is_ai = no
				}
				custom_effect_tooltip = SPR_train_the_union_youth_mission_tt_2
				add_to_variable = { var = spr_civil_war_divisions_counter_var value = 10 }
			}
			else = {
				custom_effect_tooltip = SPR_train_the_union_youth_mission_tt
				add_to_variable = { var = spr_civil_war_divisions_counter_var value = 5 }
			}
			hidden_effect = { activate_mission = SPR_enlarge_the_weapon_caches_mission }
			set_country_flag = SPR_train_the_union_youth_flag
		}
	}

	SPR_enlarge_the_weapon_caches_mission = {

		priority = 10

		name = SPR_enlarge_the_weapon_caches

		icon = eng_trade_unions_support

		available = {
			hidden_trigger = { always = no }
		}

		days_mission_timeout = 70

		fire_only_once = yes

		activation = {
			always = no
		}

		visible = {
			tag = SPR
			NOT = { has_global_flag = spanish_civil_war }
		}

		cancel_if_not_visible = yes

		is_good = yes

		timeout_effect = {
			custom_effect_tooltip = SPR_enlarge_the_weapon_caches_mission_tt
			hidden_effect = { activate_mission = SPR_distribute_arms_to_the_people_mission }
			set_country_flag = SPR_enlarge_the_weapon_caches_flag
		}
	}

	SPR_distribute_arms_to_the_people_mission = {

		priority = 10

		name = SPR_distribute_arms_to_the_people

		icon = eng_trade_unions_support

		available = {
			hidden_trigger = { always = no }
		}

		days_mission_timeout = 70

		fire_only_once = yes

		activation = {
			always = no
		}

		visible = {
			tag = SPR
			NOT = { has_global_flag = spanish_civil_war }
		}

		cancel_if_not_visible = yes

		is_good = yes

		timeout_effect = {
			custom_effect_tooltip = SPR_distribute_arms_to_the_people_mission_tt
			hidden_effect = { activate_mission = SPR_disband_the_army_mission }
			add_to_variable = { var = spr_civil_war_divisions_counter_var value = 10 }
			set_country_flag = SPR_distribute_arms_to_the_people_flag
		}
	}

	SPR_disband_the_army_mission = {

		priority = 10

		name = SPR_disband_the_army

		icon = eng_trade_unions_support

		available = {
			hidden_trigger = { always = no }
		}

		days_mission_timeout = 70

		fire_only_once = yes

		activation = {
			always = no
		}

		visible = {
			tag = SPR
			NOT = { has_global_flag = spanish_civil_war }
		}

		cancel_if_not_visible = yes

		is_good = yes

		timeout_effect = {
			custom_effect_tooltip = SPR_disband_the_army_mission_tt
			set_country_flag = SPR_disband_the_army_flag
			if = {
				limit = {
					has_idea = SPA_awaiting_the_rebellion
				}
				remove_ideas = SPA_awaiting_the_rebellion
			}
			hidden_effect = {
				country_event = lar_spain.2
			}
		}
	}

	SPR_primo_de_rivera_speech_mission = {

		icon = eng_propaganda_campaigns

		allowed = {
			tag = SPR
		}

		available = {
			hidden_trigger = { always = no }
		}

		fire_only_once = no

		days_mission_timeout = 38

		is_good = no

		cancel_if_not_visible = yes

		activation = {
			always = no
		}

		visible = {
			tag = SPR
			has_country_flag = SPR_spanish_elections_flag
			has_completed_focus = SPR_the_popular_front
			NOT = { has_global_flag = spanish_civil_war }
		}

		timeout_effect = {
			add_days_mission_timeout = {
				mission = SPR_military_plot_republicans
				days = -25
			}
			add_popularity = {
			    ideology = fascism
			    popularity = 0.05
			}
			add_stability = -0.05
			add_political_power = -15
			if = {
				limit = {
					NOT = { has_country_flag = SPR_primo_de_rivera_first_speech }
				}
				set_country_flag = SPR_primo_de_rivera_first_speech
			}
			hidden_effect = {
				country_event = { id = lar_spain.4 }
			}
		}

	}

	SPA_imprison_primo_de_rivera_mission = {

		icon = generic_independence

		allowed = {
			tag = SPR
		}

		available = {
			hidden_trigger = { always = no }
		}

		fire_only_once = yes

		days_mission_timeout = 38

		is_good = yes

		cancel_if_not_visible = yes

		activation = {
			always = no
		}

		visible = {
			tag = SPR
			has_country_flag = SPR_spanish_elections_flag
			has_completed_focus = SPA_a_great_spain
			NOT = { has_global_flag = spanish_civil_war }
		}

		timeout_effect = {
			add_days_mission_timeout = {
				mission = SPA_military_plot_nationalists
				days = 15
			}
			add_stability = -0.05
			custom_effect_tooltip = SPR_imprison_primo_de_rivera_tt
			set_country_flag = SPA_primo_de_rivera_imprisoned
			hidden_effect = {
				country_event = { id = lar_spain.3 }
			}
		}

	}

	SPR_political_assassination_mission = {

		icon = spr_political_assassination

		allowed = {
			tag = SPR
		}

		available = {
			hidden_trigger = { always = no }
		}

		fire_only_once = no

		days_mission_timeout = 38

		is_good = yes

		cancel_if_not_visible = yes

		activation = {
			always = no
		}

		visible = {
			tag = SPR
			has_country_flag = SPR_spanish_elections_flag
			has_completed_focus = SPR_the_popular_front
			NOT = { has_global_flag = spanish_civil_war }
		}

		timeout_effect = {
			add_stability = -0.1
			add_days_mission_timeout = {
				mission = SPR_military_plot_republicans
				days = -25
			}
			set_country_flag = SPA_political_assassination_flag
			hidden_effect = {
				country_event = { id = lar_spain.4 }
			}
		}

	}

	SPA_political_arrest_mission = {

		icon = generic_independence

		allowed = {
			tag = SPR
		}

		available = {
			hidden_trigger = { always = no }
		}

		fire_only_once = no

		days_mission_timeout = 38

		is_good = yes

		cancel_if_not_visible = yes

		activation = {
			always = no
		}

		visible = {
			tag = SPR
			has_country_flag = SPR_spanish_elections_flag
			has_completed_focus = SPA_a_great_spain
			NOT = { has_global_flag = spanish_civil_war }
		}

		timeout_effect = {
			add_days_mission_timeout = {
				mission = SPA_military_plot_nationalists
				days = 15
			}
			add_popularity = {
			    ideology = communism
			    popularity = 0.05
			}
			clr_country_flag = SPA_political_assassination_flag
			hidden_effect = {
				country_event = { id = lar_spain.3 }
			}
		}

	}

	SPR_sway_leader_loyalty_mission = {

		icon = generic_army_support

		allowed = {
			tag = SPR
		}

		available = {
			hidden_trigger = { always = no }
		}

		fire_only_once = no

		days_mission_timeout = 38

		is_good = yes

		cancel_if_not_visible = yes

		activation = {
			always = no
		}

		visible = {
			tag = SPR
			has_country_flag = SPR_spanish_elections_flag
			has_completed_focus = SPR_the_popular_front
			NOT = { has_global_flag = spanish_civil_war }
		}

		timeout_effect = {
			add_days_mission_timeout = {
				mission = SPR_military_plot_republicans
				days = -25
			}
			random_unit_leader = {
				limit = {
					NOT = { has_trait = trait_SPA_nationalist_sympathies }
					NOT = { has_id = 1108 }
				}
				add_unit_leader_trait = trait_SPA_nationalist_sympathies
				set_unit_leader_flag = SPA_swayed_leader_loyalty_flag
			}
			hidden_effect = {
				country_event = { id = lar_spain.4 }
			}
		}

	}

	SPA_reassign_disloyal_leader_mission = {

		icon = generic_army_support

		allowed = {
			tag = SPR
		}

		available = {
			hidden_trigger = { always = no }
		}

		fire_only_once = no

		days_mission_timeout = 38

		is_good = yes

		cancel_if_not_visible = yes

		activation = {
			always = no
		}

		visible = {
			tag = SPR
			has_country_flag = SPR_spanish_elections_flag
			has_completed_focus = SPA_a_great_spain
			NOT = { has_global_flag = spanish_civil_war }
		}

		timeout_effect = {
			add_days_mission_timeout = {
				mission = SPA_military_plot_nationalists
				days = 15
			}
			random_army_leader = {
				limit = {
					has_trait = trait_SPA_nationalist_sympathies
					NOT = {
						has_unit_leader_flag = SPA_swayed_leader_loyalty_flag
						has_unit_leader_flag = SPR_reassigned_flag
					}
				}
				custom_effect_tooltip = SPR_reassign_disloyal_leader_tt
				set_unit_leader_flag = SPR_reassigned_flag #make them pop up in the civil war with some delay, or require a decision to be taken before they're available (like Franco in the Canarias)
			}
			hidden_effect = {
				country_event = { id = lar_spain.3 }
			}
		}

	}

	SPR_suppress_the_strikes_mission = {

		icon = oppression

		allowed = {
			tag = SPR
		}

		available = {
			hidden_trigger = { always = no }
		}

		fire_only_once = no

		days_mission_timeout = 38

		is_good = yes

		cancel_if_not_visible = yes

		activation = {
			always = no
		}

		visible = {
			tag = SPR
			has_country_flag = SPR_spanish_elections_flag
			has_completed_focus = SPR_the_popular_front
			NOT = { has_global_flag = spanish_civil_war }
		}

		timeout_effect = {
			add_days_mission_timeout = {
				mission = SPR_military_plot_republicans
				days = -25
			}
			SPR_suppress_the_strikes_increase = yes
			hidden_effect = {
				country_event = { id = lar_spain.4 }
			}
		}

	}

	SPA_concessions_to_the_left_mission = {

		icon = eng_trade_unions_support

		allowed = {
			tag = SPR
		}

		available = {
			hidden_trigger = { always = no }
		}

		fire_only_once = no

		days_mission_timeout = 38

		is_good = yes

		cancel_if_not_visible = yes

		activation = {
			always = no
		}

		visible = {
			tag = SPR
			has_country_flag = SPR_spanish_elections_flag
			has_completed_focus = SPA_a_great_spain
			NOT = { has_global_flag = spanish_civil_war }
		}

		timeout_effect = {
			add_days_mission_timeout = {
				mission = SPA_military_plot_nationalists
				days = 15
			}
			SPR_concessions_to_the_left_increase = yes
			hidden_effect = {
				country_event = { id = lar_spain.3 }
			}
		}

	}

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

	SPA_expand_influence_in_the_galicia_garrison_mission = {

		icon = generic_prepare_civil_war

		allowed = {
			tag = SPR
		}

		available = {
			hidden_trigger = { always = no }
		}

		highlight_states = {
			highlight_state_targets = {
				state = 171
			} 
		}

		on_map_mode = map_and_decisions_view

		fire_only_once = no

		days_mission_timeout = 14

		is_good = no

		cancel_if_not_visible = yes

		activation = {
			always = no
		}

		visible = {
			tag = SPR
			has_country_flag = SPR_spanish_elections_flag
			NOT = { has_global_flag = spanish_civil_war }
		}

		timeout_effect = {
			171 = {
				if = {
					limit = {
						ROOT = { has_completed_focus = SPA_a_great_spain }
						date < 1936.5.2
					}
					set_state_flag = { flag = SPR_ai_recently_expanded_influence_flag value = 1 days = 45 }
				}
				if = {
					limit = {
						ROOT = { has_completed_focus = SPA_a_great_spain }
						date > 1936.5.1
						date < 1936.8.10
					}
					set_state_flag = { flag = SPR_ai_recently_expanded_influence_flag value = 1 days = 30 }
				}
				if = {
					limit = {
						ROOT = { has_completed_focus = SPA_a_great_spain }
						date > 1936.8.9
						date < 1936.10.2
					}
					set_state_flag = { flag = SPR_ai_recently_expanded_influence_flag value = 1 days = 21 }
				}
				if = {
					limit = {
						ROOT = { has_completed_focus = SPA_a_great_spain }
						date > 1936.10.1
					}
					set_state_flag = { flag = SPR_ai_recently_expanded_influence_flag value = 1 days = 15 }
				}
				if = {
					limit = {
						ROOT = { has_completed_focus = SPR_the_popular_front }
						date < 1936.7.20
					}
					set_state_flag = { flag = SPR_ai_recently_expanded_influence_flag value = 1 days = 15 }
				}
				if = {
					limit = {
						ROOT = { has_completed_focus = SPR_the_popular_front }
						date > 1936.7.19
						date < 1936.9.16
					}
					set_state_flag = { flag = SPR_ai_recently_expanded_influence_flag value = 1 days = 30 }
				}
				if = {
					limit = {
						ROOT = { has_completed_focus = SPR_the_popular_front }
						date > 1936.9.15
					}
					set_state_flag = { flag = SPR_ai_recently_expanded_influence_flag value = 1 days = 45 }
				}
			}
			if = {
				limit = {
					has_completed_focus = SPR_the_popular_front
				}
				171 = {
					custom_effect_tooltip = SPA_expand_influence_nationalists_tt
					SPA_garrison_control_tooltip = yes
				}
				hidden_effect = {
					171 = {
						if = {
							limit = { check_variable = { SPA_garrison_control < 4 } }
							
							add_to_variable = { var = SPA_garrison_control value = 1 }
							SPR = { add_to_variable = { var = spa_civil_war_divisions_counter_var value = 1 } }
							SPR = { subtract_from_variable = { var = spr_civil_war_divisions_counter_var value = 1 } }
						}
						SPR_garrison_control_cost_calculation = yes
					}
					if = {
						limit = {
							date < 1936.7.20
						}
						country_event = { id = lar_spain.5 days = 3 random_days = 5 }	#added this, since player can never achieve historical starting borders, but AI magically can! - Fantom
					}
					if = {
						limit = {
							date > 1936.7.19
							date < 1936.9.16
						}
						country_event = { id = lar_spain.5 days = 5 random_days = 10 }
					}
					if = {
						limit = {
							date > 1936.9.15
						}
						country_event = { id = lar_spain.5 days = 15 random_days = 15 }
					}
				}
			}
			if = {
				limit = {
					has_completed_focus = SPA_a_great_spain
				}
				171 = {
					custom_effect_tooltip = SPR_expand_influence_republicans_tt
					SPA_garrison_control_tooltip = yes
					SPA_garrison_control_cost_calculation = yes
				}
				hidden_effect = {
					171 = {
						subtract_from_variable = { var = SPA_garrison_control value = 1 }
						SPR = { subtract_from_variable = { var = spa_civil_war_divisions_counter_var value = 1 } }
						SPR = { add_to_variable = { var = spr_civil_war_divisions_counter_var value = 1 } }
						SPA_garrison_control_cost_calculation = yes
					}
					if = {
						limit = {
							date < 1936.5.2
						}
						country_event = { id = lar_spain.5 days = 90 random_days = 30 }
					}
					if = {
						limit = {
							date > 1936.5.1
							date < 1936.8.10
						}
						country_event = { id = lar_spain.5 days = 45 random_days = 20 }
					}
					if = {
						limit = {
							date > 1936.8.9
							date < 1936.10.2
						}
						country_event = { id = lar_spain.5 days = 1 random_days = 5 }
					}
					if = {
						limit = {
							date > 1936.10.1
						}
						country_event = { id = lar_spain.5 random_days = 3 }
					}
				}
			}
		}

	}

	SPA_expand_influence_in_the_asturias_garrison_mission = {

		icon = generic_prepare_civil_war

		allowed = {
			tag = SPR
		}

		available = {
			hidden_trigger = { always = no }
		}

		highlight_states = {
			highlight_state_targets = {
				state = 790
			} 
		}

		on_map_mode = map_and_decisions_view

		fire_only_once = no

		days_mission_timeout = 14

		is_good = no

		cancel_if_not_visible = yes

		activation = {
			always = no
		}

		visible = {
			tag = SPR
			has_country_flag = SPR_spanish_elections_flag
			NOT = { has_global_flag = spanish_civil_war }
		}

		timeout_effect = {
			790 = {
				if = {
					limit = {
						ROOT = { has_completed_focus = SPA_a_great_spain }
						date < 1936.5.2
					}
					set_state_flag = { flag = SPR_ai_recently_expanded_influence_flag value = 1 days = 45 }
				}
				if = {
					limit = {
						ROOT = { has_completed_focus = SPA_a_great_spain }
						date > 1936.5.1
						date < 1936.8.10
					}
					set_state_flag = { flag = SPR_ai_recently_expanded_influence_flag value = 1 days = 30 }
				}
				if = {
					limit = {
						ROOT = { has_completed_focus = SPA_a_great_spain }
						date > 1936.8.9
						date < 1936.10.2
					}
					set_state_flag = { flag = SPR_ai_recently_expanded_influence_flag value = 1 days = 21 }
				}
				if = {
					limit = {
						ROOT = { has_completed_focus = SPA_a_great_spain }
						date > 1936.10.1
					}
					set_state_flag = { flag = SPR_ai_recently_expanded_influence_flag value = 1 days = 15 }
				}
				if = {
					limit = {
						ROOT = { has_completed_focus = SPR_the_popular_front }
						date < 1936.7.20
					}
					set_state_flag = { flag = SPR_ai_recently_expanded_influence_flag value = 1 days = 15 }
				}
				if = {
					limit = {
						ROOT = { has_completed_focus = SPR_the_popular_front }
						date > 1936.7.19
						date < 1936.9.16
					}
					set_state_flag = { flag = SPR_ai_recently_expanded_influence_flag value = 1 days = 30 }
				}
				if = {
					limit = {
						ROOT = { has_completed_focus = SPR_the_popular_front }
						date > 1936.9.15
					}
					set_state_flag = { flag = SPR_ai_recently_expanded_influence_flag value = 1 days = 45 }
				}
			}
			if = {
				limit = {
					has_completed_focus = SPR_the_popular_front
				}
				790 = {
					custom_effect_tooltip = SPA_expand_influence_nationalists_tt
					SPA_garrison_control_tooltip = yes
				}
				hidden_effect = {
					790 = {
						if = {
							limit = { check_variable = { SPA_garrison_control < 4 } }
							
							add_to_variable = { var = SPA_garrison_control value = 1 }
							SPR = { add_to_variable = { var = spa_civil_war_divisions_counter_var value = 1 } }
							SPR = { subtract_from_variable = { var = spr_civil_war_divisions_counter_var value = 1 } }
						}
						SPR_garrison_control_cost_calculation = yes
					}
					if = {
						limit = {
							date < 1936.7.20
						}
						country_event = { id = lar_spain.5 days = 3 random_days = 5 }	#added this, since player can never achieve historical starting borders, but AI magically can! - Fantom
					}
					if = {
						limit = {
							date > 1936.7.19
							date < 1936.9.16
						}
						country_event = { id = lar_spain.5 days = 5 random_days = 10 }
					}
					if = {
						limit = {
							date > 1936.9.15
						}
						country_event = { id = lar_spain.5 days = 15 random_days = 15 }
					}
				}
			}
			if = {
				limit = {
					has_completed_focus = SPA_a_great_spain
				}
				790 = {
					custom_effect_tooltip = SPR_expand_influence_republicans_tt
					SPA_garrison_control_tooltip = yes
					SPA_garrison_control_cost_calculation = yes
				}
				hidden_effect = {
					790 = {
						subtract_from_variable = { var = SPA_garrison_control value = 1 }
						SPR = { subtract_from_variable = { var = spa_civil_war_divisions_counter_var value = 1 } }
						SPR = { add_to_variable = { var = spr_civil_war_divisions_counter_var value = 1 } }
						SPA_garrison_control_cost_calculation = yes
					}
					if = {
						limit = {
							date < 1936.5.2
						}
						country_event = { id = lar_spain.5 days = 90 random_days = 30 }
					}
					if = {
						limit = {
							date > 1936.5.1
							date < 1936.8.10
						}
						country_event = { id = lar_spain.5 days = 45 random_days = 20 }
					}
					if = {
						limit = {
							date > 1936.8.9
							date < 1936.10.2
						}
						country_event = { id = lar_spain.5 days = 1 random_days = 5 }
					}
					if = {
						limit = {
							date > 1936.10.1
						}
						country_event = { id = lar_spain.5 random_days = 3 }
					}
				}
			}
		}

	}

	SPA_expand_influence_in_the_leon_garrison_mission = {

		icon = generic_prepare_civil_war

		allowed = {
			tag = SPR
		}

		available = {
			hidden_trigger = { always = no }
		}

		highlight_states = {
			highlight_state_targets = {
				state = 174
			} 
		}

		on_map_mode = map_and_decisions_view

		fire_only_once = no

		days_mission_timeout = 14

		is_good = no

		cancel_if_not_visible = yes

		activation = {
			always = no
		}

		visible = {
			tag = SPR
			has_country_flag = SPR_spanish_elections_flag
			NOT = { has_global_flag = spanish_civil_war }
		}

		timeout_effect = {
			174 = {
				if = {
					limit = {
						ROOT = { has_completed_focus = SPA_a_great_spain }
						date < 1936.5.2
					}
					set_state_flag = { flag = SPR_ai_recently_expanded_influence_flag value = 1 days = 45 }
				}
				if = {
					limit = {
						ROOT = { has_completed_focus = SPA_a_great_spain }
						date > 1936.5.1
						date < 1936.8.10
					}
					set_state_flag = { flag = SPR_ai_recently_expanded_influence_flag value = 1 days = 30 }
				}
				if = {
					limit = {
						ROOT = { has_completed_focus = SPA_a_great_spain }
						date > 1936.8.9
						date < 1936.10.2
					}
					set_state_flag = { flag = SPR_ai_recently_expanded_influence_flag value = 1 days = 21 }
				}
				if = {
					limit = {
						ROOT = { has_completed_focus = SPA_a_great_spain }
						date > 1936.10.1
					}
					set_state_flag = { flag = SPR_ai_recently_expanded_influence_flag value = 1 days = 15 }
				}
				if = {
					limit = {
						ROOT = { has_completed_focus = SPR_the_popular_front }
						date < 1936.7.20
					}
					set_state_flag = { flag = SPR_ai_recently_expanded_influence_flag value = 1 days = 15 }
				}
				if = {
					limit = {
						ROOT = { has_completed_focus = SPR_the_popular_front }
						date > 1936.7.19
						date < 1936.9.16
					}
					set_state_flag = { flag = SPR_ai_recently_expanded_influence_flag value = 1 days = 30 }
				}
				if = {
					limit = {
						ROOT = { has_completed_focus = SPR_the_popular_front }
						date > 1936.9.15
					}
					set_state_flag = { flag = SPR_ai_recently_expanded_influence_flag value = 1 days = 45 }
				}
			}
			if = {
				limit = {
					has_completed_focus = SPR_the_popular_front
				}
				174 = {
					custom_effect_tooltip = SPA_expand_influence_nationalists_tt
					SPA_garrison_control_tooltip = yes
				}
				hidden_effect = {
					174 = {
						if = {
							limit = { check_variable = { SPA_garrison_control < 4 } }
							
							add_to_variable = { var = SPA_garrison_control value = 1 }
							SPR = { add_to_variable = { var = spa_civil_war_divisions_counter_var value = 1 } }
							SPR = { subtract_from_variable = { var = spr_civil_war_divisions_counter_var value = 1 } }
						}
						SPR_garrison_control_cost_calculation = yes
					}
					if = {
						limit = {
							date < 1936.7.20
						}
						country_event = { id = lar_spain.5 days = 3 random_days = 5 }	#added this, since player can never achieve historical starting borders, but AI magically can! - Fantom
					}
					if = {
						limit = {
							date > 1936.7.19
							date < 1936.9.16
						}
						country_event = { id = lar_spain.5 days = 5 random_days = 10 }
					}
					if = {
						limit = {
							date > 1936.9.15
						}
						country_event = { id = lar_spain.5 days = 15 random_days = 15 }
					}
				}
			}
			if = {
				limit = {
					has_completed_focus = SPA_a_great_spain
				}
				174 = {
					custom_effect_tooltip = SPR_expand_influence_republicans_tt
					SPA_garrison_control_tooltip = yes
					SPA_garrison_control_cost_calculation = yes
				}
				hidden_effect = {
					174 = {
						subtract_from_variable = { var = SPA_garrison_control value = 1 }
						SPR = { subtract_from_variable = { var = spa_civil_war_divisions_counter_var value = 1 } }
						SPR = { add_to_variable = { var = spr_civil_war_divisions_counter_var value = 1 } }
						SPA_garrison_control_cost_calculation = yes
					}
					if = {
						limit = {
							date < 1936.5.2
						}
						country_event = { id = lar_spain.5 days = 90 random_days = 30 }
					}
					if = {
						limit = {
							date > 1936.5.1
							date < 1936.8.10
						}
						country_event = { id = lar_spain.5 days = 45 random_days = 20 }
					}
					if = {
						limit = {
							date > 1936.8.9
							date < 1936.10.2
						}
						country_event = { id = lar_spain.5 days = 1 random_days = 5 }
					}
					if = {
						limit = {
							date > 1936.10.1
						}
						country_event = { id = lar_spain.5 random_days = 3 }
					}
				}
			}
		}

	}

	SPA_expand_influence_in_the_valladolid_garrison_mission = {

		icon = generic_prepare_civil_war

		allowed = {
			tag = SPR
		}

		available = {
			hidden_trigger = { always = no }
		}

		highlight_states = {
			highlight_state_targets = {
				state = 791
			} 
		}

		on_map_mode = map_and_decisions_view

		fire_only_once = no

		days_mission_timeout = 14

		is_good = no

		cancel_if_not_visible = yes

		activation = {
			always = no
		}

		visible = {
			tag = SPR
			has_country_flag = SPR_spanish_elections_flag
			NOT = { has_global_flag = spanish_civil_war }
		}

		timeout_effect = {
			791 = {
				if = {
					limit = {
						ROOT = { has_completed_focus = SPA_a_great_spain }
						date < 1936.5.2
					}
					set_state_flag = { flag = SPR_ai_recently_expanded_influence_flag value = 1 days = 45 }
				}
				if = {
					limit = {
						ROOT = { has_completed_focus = SPA_a_great_spain }
						date > 1936.5.1
						date < 1936.8.10
					}
					set_state_flag = { flag = SPR_ai_recently_expanded_influence_flag value = 1 days = 30 }
				}
				if = {
					limit = {
						ROOT = { has_completed_focus = SPA_a_great_spain }
						date > 1936.8.9
						date < 1936.10.2
					}
					set_state_flag = { flag = SPR_ai_recently_expanded_influence_flag value = 1 days = 21 }
				}
				if = {
					limit = {
						ROOT = { has_completed_focus = SPA_a_great_spain }
						date > 1936.10.1
					}
					set_state_flag = { flag = SPR_ai_recently_expanded_influence_flag value = 1 days = 15 }
				}
				if = {
					limit = {
						ROOT = { has_completed_focus = SPR_the_popular_front }
						date < 1936.7.20
					}
					set_state_flag = { flag = SPR_ai_recently_expanded_influence_flag value = 1 days = 15 }
				}
				if = {
					limit = {
						ROOT = { has_completed_focus = SPR_the_popular_front }
						date > 1936.7.19
						date < 1936.9.16
					}
					set_state_flag = { flag = SPR_ai_recently_expanded_influence_flag value = 1 days = 30 }
				}
				if = {
					limit = {
						ROOT = { has_completed_focus = SPR_the_popular_front }
						date > 1936.9.15
					}
					set_state_flag = { flag = SPR_ai_recently_expanded_influence_flag value = 1 days = 45 }
				}
			}
			if = {
				limit = {
					has_completed_focus = SPR_the_popular_front
				}
				791 = {
					custom_effect_tooltip = SPA_expand_influence_nationalists_tt
					SPA_garrison_control_tooltip = yes
				}
				hidden_effect = {
					791 = {
						if = {
							limit = { check_variable = { SPA_garrison_control < 4 } }
							
							add_to_variable = { var = SPA_garrison_control value = 1 }
							SPR = { add_to_variable = { var = spa_civil_war_divisions_counter_var value = 1 } }
							SPR = { subtract_from_variable = { var = spr_civil_war_divisions_counter_var value = 1 } }
						}
						SPR_garrison_control_cost_calculation = yes
					}
					if = {
						limit = {
							date < 1936.7.20
						}
						country_event = { id = lar_spain.5 days = 3 random_days = 5 }	#added this, since player can never achieve historical starting borders, but AI magically can! - Fantom
					}
					if = {
						limit = {
							date > 1936.7.19
							date < 1936.9.16
						}
						country_event = { id = lar_spain.5 days = 5 random_days = 10 }
					}
					if = {
						limit = {
							date > 1936.9.15
						}
						country_event = { id = lar_spain.5 days = 15 random_days = 15 }
					}
				}
			}
			if = {
				limit = {
					has_completed_focus = SPA_a_great_spain
				}
				791 = {
					custom_effect_tooltip = SPR_expand_influence_republicans_tt
					SPA_garrison_control_tooltip = yes
					SPA_garrison_control_cost_calculation = yes
				}
				hidden_effect = {
					791 = {
						subtract_from_variable = { var = SPA_garrison_control value = 1 }
						SPR = { subtract_from_variable = { var = spa_civil_war_divisions_counter_var value = 1 } }
						SPR = { add_to_variable = { var = spr_civil_war_divisions_counter_var value = 1 } }
						SPA_garrison_control_cost_calculation = yes
					}
					if = {
						limit = {
							date < 1936.5.2
						}
						country_event = { id = lar_spain.5 days = 90 random_days = 30 }
					}
					if = {
						limit = {
							date > 1936.5.1
							date < 1936.8.10
						}
						country_event = { id = lar_spain.5 days = 45 random_days = 20 }
					}
					if = {
						limit = {
							date > 1936.8.9
							date < 1936.10.2
						}
						country_event = { id = lar_spain.5 days = 1 random_days = 5 }
					}
					if = {
						limit = {
							date > 1936.10.1
						}
						country_event = { id = lar_spain.5 random_days = 3 }
					}
				}
			}
		}

	}

	SPA_expand_influence_in_the_burgos_garrison_mission = {

		icon = generic_prepare_civil_war

		allowed = {
			tag = SPR
		}

		available = {
			hidden_trigger = { always = no }
		}

		highlight_states = {
			highlight_state_targets = {
				state = 176
			} 
		}

		on_map_mode = map_and_decisions_view

		fire_only_once = no

		days_mission_timeout = 14

		is_good = no

		cancel_if_not_visible = yes

		activation = {
			always = no
		}

		visible = {
			tag = SPR
			has_country_flag = SPR_spanish_elections_flag
			NOT = { has_global_flag = spanish_civil_war }
		}

		timeout_effect = {
			176 = {
				if = {
					limit = {
						ROOT = { has_completed_focus = SPA_a_great_spain }
						date < 1936.5.2
					}
					set_state_flag = { flag = SPR_ai_recently_expanded_influence_flag value = 1 days = 45 }
				}
				if = {
					limit = {
						ROOT = { has_completed_focus = SPA_a_great_spain }
						date > 1936.5.1
						date < 1936.8.10
					}
					set_state_flag = { flag = SPR_ai_recently_expanded_influence_flag value = 1 days = 30 }
				}
				if = {
					limit = {
						ROOT = { has_completed_focus = SPA_a_great_spain }
						date > 1936.8.9
						date < 1936.10.2
					}
					set_state_flag = { flag = SPR_ai_recently_expanded_influence_flag value = 1 days = 21 }
				}
				if = {
					limit = {
						ROOT = { has_completed_focus = SPA_a_great_spain }
						date > 1936.10.1
					}
					set_state_flag = { flag = SPR_ai_recently_expanded_influence_flag value = 1 days = 15 }
				}
				if = {
					limit = {
						ROOT = { has_completed_focus = SPR_the_popular_front }
						date < 1936.7.20
					}
					set_state_flag = { flag = SPR_ai_recently_expanded_influence_flag value = 1 days = 15 }
				}
				if = {
					limit = {
						ROOT = { has_completed_focus = SPR_the_popular_front }
						date > 1936.7.19
						date < 1936.9.16
					}
					set_state_flag = { flag = SPR_ai_recently_expanded_influence_flag value = 1 days = 30 }
				}
				if = {
					limit = {
						ROOT = { has_completed_focus = SPR_the_popular_front }
						date > 1936.9.15
					}
					set_state_flag = { flag = SPR_ai_recently_expanded_influence_flag value = 1 days = 45 }
				}
			}
			if = {
				limit = {
					has_completed_focus = SPR_the_popular_front
				}
				176 = {
					custom_effect_tooltip = SPA_expand_influence_nationalists_tt
					SPA_garrison_control_tooltip = yes
				}
				hidden_effect = {
					176 = {
						if = {
							limit = { check_variable = { SPA_garrison_control < 4 } }
							
							add_to_variable = { var = SPA_garrison_control value = 1 }
							SPR = { add_to_variable = { var = spa_civil_war_divisions_counter_var value = 1 } }
							SPR = { subtract_from_variable = { var = spr_civil_war_divisions_counter_var value = 1 } }
						}
						SPR_garrison_control_cost_calculation = yes
					}
					if = {
						limit = {
							date < 1936.7.20
						}
						country_event = { id = lar_spain.5 days = 3 random_days = 5 }	#added this, since player can never achieve historical starting borders, but AI magically can! - Fantom
					}
					if = {
						limit = {
							date > 1936.7.19
							date < 1936.9.16
						}
						country_event = { id = lar_spain.5 days = 5 random_days = 10 }
					}
					if = {
						limit = {
							date > 1936.9.15
						}
						country_event = { id = lar_spain.5 days = 15 random_days = 15 }
					}
				}
			}
			if = {
				limit = {
					has_completed_focus = SPA_a_great_spain
				}
				176 = {
					custom_effect_tooltip = SPR_expand_influence_republicans_tt
					SPA_garrison_control_tooltip = yes
					SPA_garrison_control_cost_calculation = yes
				}
				hidden_effect = {
					176 = {
						subtract_from_variable = { var = SPA_garrison_control value = 1 }
						SPR = { subtract_from_variable = { var = spa_civil_war_divisions_counter_var value = 1 } }
						SPR = { add_to_variable = { var = spr_civil_war_divisions_counter_var value = 1 } }
						SPA_garrison_control_cost_calculation = yes
					}
					if = {
						limit = {
							date < 1936.5.2
						}
						country_event = { id = lar_spain.5 days = 90 random_days = 30 }
					}
					if = {
						limit = {
							date > 1936.5.1
							date < 1936.8.10
						}
						country_event = { id = lar_spain.5 days = 45 random_days = 20 }
					}
					if = {
						limit = {
							date > 1936.8.9
							date < 1936.10.2
						}
						country_event = { id = lar_spain.5 days = 1 random_days = 5 }
					}
					if = {
						limit = {
							date > 1936.10.1
						}
						country_event = { id = lar_spain.5 random_days = 3 }
					}
				}
			}
		}

	}

	SPA_expand_influence_in_the_pais_vasco_garrison_mission = {

		icon = generic_prepare_civil_war

		allowed = {
			tag = SPR
		}

		available = {
			hidden_trigger = { always = no }
		}

		highlight_states = {
			highlight_state_targets = {
				state = 792
			} 
		}

		on_map_mode = map_and_decisions_view

		fire_only_once = no

		days_mission_timeout = 14

		is_good = no

		cancel_if_not_visible = yes

		activation = {
			always = no
		}

		visible = {
			tag = SPR
			has_country_flag = SPR_spanish_elections_flag
			NOT = { has_global_flag = spanish_civil_war }
		}

		timeout_effect = {
			792 = {
				if = {
					limit = {
						ROOT = { has_completed_focus = SPA_a_great_spain }
						date < 1936.5.2
					}
					set_state_flag = { flag = SPR_ai_recently_expanded_influence_flag value = 1 days = 45 }
				}
				if = {
					limit = {
						ROOT = { has_completed_focus = SPA_a_great_spain }
						date > 1936.5.1
						date < 1936.8.10
					}
					set_state_flag = { flag = SPR_ai_recently_expanded_influence_flag value = 1 days = 30 }
				}
				if = {
					limit = {
						ROOT = { has_completed_focus = SPA_a_great_spain }
						date > 1936.8.9
						date < 1936.10.2
					}
					set_state_flag = { flag = SPR_ai_recently_expanded_influence_flag value = 1 days = 21 }
				}
				if = {
					limit = {
						ROOT = { has_completed_focus = SPA_a_great_spain }
						date > 1936.10.1
					}
					set_state_flag = { flag = SPR_ai_recently_expanded_influence_flag value = 1 days = 15 }
				}
				if = {
					limit = {
						ROOT = { has_completed_focus = SPR_the_popular_front }
						date < 1936.7.20
					}
					set_state_flag = { flag = SPR_ai_recently_expanded_influence_flag value = 1 days = 15 }
				}
				if = {
					limit = {
						ROOT = { has_completed_focus = SPR_the_popular_front }
						date > 1936.7.19
						date < 1936.9.16
					}
					set_state_flag = { flag = SPR_ai_recently_expanded_influence_flag value = 1 days = 30 }
				}
				if = {
					limit = {
						ROOT = { has_completed_focus = SPR_the_popular_front }
						date > 1936.9.15
					}
					set_state_flag = { flag = SPR_ai_recently_expanded_influence_flag value = 1 days = 45 }
				}
			}
			if = {
				limit = {
					has_completed_focus = SPR_the_popular_front
				}
				792 = {
					custom_effect_tooltip = SPA_expand_influence_nationalists_tt
					SPA_garrison_control_tooltip = yes
				}
				hidden_effect = {
					792 = {
						if = {
							limit = { check_variable = { SPA_garrison_control < 4 } }
							
							add_to_variable = { var = SPA_garrison_control value = 1 }
							SPR = { add_to_variable = { var = spa_civil_war_divisions_counter_var value = 1 } }
							SPR = { subtract_from_variable = { var = spr_civil_war_divisions_counter_var value = 1 } }
						}
						SPR_garrison_control_cost_calculation = yes
					}
					if = {
						limit = {
							date < 1936.7.20
						}
						country_event = { id = lar_spain.5 days = 3 random_days = 5 }	#added this, since player can never achieve historical starting borders, but AI magically can! - Fantom
					}
					if = {
						limit = {
							date > 1936.7.19
							date < 1936.9.16
						}
						country_event = { id = lar_spain.5 days = 5 random_days = 10 }
					}
					if = {
						limit = {
							date > 1936.9.15
						}
						country_event = { id = lar_spain.5 days = 15 random_days = 15 }
					}
				}
			}
			if = {
				limit = {
					has_completed_focus = SPA_a_great_spain
				}
				792 = {
					custom_effect_tooltip = SPR_expand_influence_republicans_tt
					SPA_garrison_control_tooltip = yes
					SPA_garrison_control_cost_calculation = yes
				}
				hidden_effect = {
					792 = {
						subtract_from_variable = { var = SPA_garrison_control value = 1 }
						SPR = { subtract_from_variable = { var = spa_civil_war_divisions_counter_var value = 1 } }
						SPR = { add_to_variable = { var = spr_civil_war_divisions_counter_var value = 1 } }
						SPA_garrison_control_cost_calculation = yes
					}
					if = {
						limit = {
							date < 1936.5.2
						}
						country_event = { id = lar_spain.5 days = 90 random_days = 30 }
					}
					if = {
						limit = {
							date > 1936.5.1
							date < 1936.8.10
						}
						country_event = { id = lar_spain.5 days = 45 random_days = 20 }
					}
					if = {
						limit = {
							date > 1936.8.9
							date < 1936.10.2
						}
						country_event = { id = lar_spain.5 days = 1 random_days = 5 }
					}
					if = {
						limit = {
							date > 1936.10.1
						}
						country_event = { id = lar_spain.5 random_days = 3 }
					}
				}
			}
		}

	}

	SPA_expand_influence_in_the_navarra_garrison_mission = {

		icon = generic_prepare_civil_war

		allowed = {
			tag = SPR
		}

		available = {
			hidden_trigger = { always = no }
		}

		highlight_states = {
			highlight_state_targets = {
				state = 172
			} 
		}

		on_map_mode = map_and_decisions_view

		fire_only_once = no

		days_mission_timeout = 14

		is_good = no

		cancel_if_not_visible = yes

		activation = {
			always = no
		}

		visible = {
			tag = SPR
			has_country_flag = SPR_spanish_elections_flag
			NOT = { has_global_flag = spanish_civil_war }
		}

		timeout_effect = {
			172 = {
				if = {
					limit = {
						ROOT = { has_completed_focus = SPA_a_great_spain }
						date < 1936.5.2
					}
					set_state_flag = { flag = SPR_ai_recently_expanded_influence_flag value = 1 days = 45 }
				}
				if = {
					limit = {
						ROOT = { has_completed_focus = SPA_a_great_spain }
						date > 1936.5.1
						date < 1936.8.10
					}
					set_state_flag = { flag = SPR_ai_recently_expanded_influence_flag value = 1 days = 30 }
				}
				if = {
					limit = {
						ROOT = { has_completed_focus = SPA_a_great_spain }
						date > 1936.8.9
						date < 1936.10.2
					}
					set_state_flag = { flag = SPR_ai_recently_expanded_influence_flag value = 1 days = 21 }
				}
				if = {
					limit = {
						ROOT = { has_completed_focus = SPA_a_great_spain }
						date > 1936.10.1
					}
					set_state_flag = { flag = SPR_ai_recently_expanded_influence_flag value = 1 days = 15 }
				}
				if = {
					limit = {
						ROOT = { has_completed_focus = SPR_the_popular_front }
						date < 1936.7.20
					}
					set_state_flag = { flag = SPR_ai_recently_expanded_influence_flag value = 1 days = 15 }
				}
				if = {
					limit = {
						ROOT = { has_completed_focus = SPR_the_popular_front }
						date > 1936.7.19
						date < 1936.9.16
					}
					set_state_flag = { flag = SPR_ai_recently_expanded_influence_flag value = 1 days = 30 }
				}
				if = {
					limit = {
						ROOT = { has_completed_focus = SPR_the_popular_front }
						date > 1936.9.15
					}
					set_state_flag = { flag = SPR_ai_recently_expanded_influence_flag value = 1 days = 45 }
				}
			}
			if = {
				limit = {
					has_completed_focus = SPR_the_popular_front
				}
				172 = {
					custom_effect_tooltip = SPA_expand_influence_nationalists_tt
					SPA_garrison_control_tooltip = yes
				}
				hidden_effect = {
					172 = {
						if = {
							limit = { check_variable = { SPA_garrison_control < 4 } }
							
							add_to_variable = { var = SPA_garrison_control value = 1 }
							SPR = { add_to_variable = { var = spa_civil_war_divisions_counter_var value = 1 } }
							SPR = { subtract_from_variable = { var = spr_civil_war_divisions_counter_var value = 1 } }
						}
						SPR_garrison_control_cost_calculation = yes
					}
					if = {
						limit = {
							date < 1936.7.20
						}
						country_event = { id = lar_spain.5 days = 3 random_days = 5 }	#added this, since player can never achieve historical starting borders, but AI magically can! - Fantom
					}
					if = {
						limit = {
							date > 1936.7.19
							date < 1936.9.16
						}
						country_event = { id = lar_spain.5 days = 5 random_days = 10 }
					}
					if = {
						limit = {
							date > 1936.9.15
						}
						country_event = { id = lar_spain.5 days = 15 random_days = 15 }
					}
				}
			}
			if = {
				limit = {
					has_completed_focus = SPA_a_great_spain
				}
				172 = {
					custom_effect_tooltip = SPR_expand_influence_republicans_tt
					SPA_garrison_control_tooltip = yes
					SPA_garrison_control_cost_calculation = yes
				}
				hidden_effect = {
					172 = {
						subtract_from_variable = { var = SPA_garrison_control value = 1 }
						SPR = { subtract_from_variable = { var = spa_civil_war_divisions_counter_var value = 1 } }
						SPR = { add_to_variable = { var = spr_civil_war_divisions_counter_var value = 1 } }
						SPA_garrison_control_cost_calculation = yes
					}
					if = {
						limit = {
							date < 1936.5.2
						}
						country_event = { id = lar_spain.5 days = 90 random_days = 30 }
					}
					if = {
						limit = {
							date > 1936.5.1
							date < 1936.8.10
						}
						country_event = { id = lar_spain.5 days = 45 random_days = 20 }
					}
					if = {
						limit = {
							date > 1936.8.9
							date < 1936.10.2
						}
						country_event = { id = lar_spain.5 days = 1 random_days = 5 }
					}
					if = {
						limit = {
							date > 1936.10.1
						}
						country_event = { id = lar_spain.5 random_days = 3 }
					}
				}
			}
		}

	}

	SPA_expand_influence_in_the_western_aragon_garrison_mission = {

		icon = generic_prepare_civil_war

		allowed = {
			tag = SPR
		}

		available = {
			hidden_trigger = { always = no }
		}

		highlight_states = {
			highlight_state_targets = {
				state = 166
			} 
		}

		on_map_mode = map_and_decisions_view

		fire_only_once = no

		days_mission_timeout = 14

		is_good = no

		cancel_if_not_visible = yes

		activation = {
			always = no
		}

		visible = {
			tag = SPR
			has_country_flag = SPR_spanish_elections_flag
			NOT = { has_global_flag = spanish_civil_war }
		}

		timeout_effect = {
			166 = {
				if = {
					limit = {
						ROOT = { has_completed_focus = SPA_a_great_spain }
						date < 1936.5.2
					}
					set_state_flag = { flag = SPR_ai_recently_expanded_influence_flag value = 1 days = 45 }
				}
				if = {
					limit = {
						ROOT = { has_completed_focus = SPA_a_great_spain }
						date > 1936.5.1
						date < 1936.8.10
					}
					set_state_flag = { flag = SPR_ai_recently_expanded_influence_flag value = 1 days = 30 }
				}
				if = {
					limit = {
						ROOT = { has_completed_focus = SPA_a_great_spain }
						date > 1936.8.9
						date < 1936.10.2
					}
					set_state_flag = { flag = SPR_ai_recently_expanded_influence_flag value = 1 days = 21 }
				}
				if = {
					limit = {
						ROOT = { has_completed_focus = SPA_a_great_spain }
						date > 1936.10.1
					}
					set_state_flag = { flag = SPR_ai_recently_expanded_influence_flag value = 1 days = 15 }
				}
				if = {
					limit = {
						ROOT = { has_completed_focus = SPR_the_popular_front }
						date < 1936.7.20
					}
					set_state_flag = { flag = SPR_ai_recently_expanded_influence_flag value = 1 days = 15 }
				}
				if = {
					limit = {
						ROOT = { has_completed_focus = SPR_the_popular_front }
						date > 1936.7.19
						date < 1936.9.16
					}
					set_state_flag = { flag = SPR_ai_recently_expanded_influence_flag value = 1 days = 30 }
				}
				if = {
					limit = {
						ROOT = { has_completed_focus = SPR_the_popular_front }
						date > 1936.9.15
					}
					set_state_flag = { flag = SPR_ai_recently_expanded_influence_flag value = 1 days = 45 }
				}
			}
			if = {
				limit = {
					has_completed_focus = SPR_the_popular_front
				}
				166 = {
					custom_effect_tooltip = SPA_expand_influence_nationalists_tt
					SPA_garrison_control_tooltip = yes
				}
				hidden_effect = {
					166 = {
						if = {
							limit = { check_variable = { SPA_garrison_control < 4 } }
							
							add_to_variable = { var = SPA_garrison_control value = 1 }
							SPR = { add_to_variable = { var = spa_civil_war_divisions_counter_var value = 1 } }
							SPR = { subtract_from_variable = { var = spr_civil_war_divisions_counter_var value = 1 } }
						}
						SPR_garrison_control_cost_calculation = yes
					}
					if = {
						limit = {
							date < 1936.7.20
						}
						country_event = { id = lar_spain.5 days = 3 random_days = 5 }	#added this, since player can never achieve historical starting borders, but AI magically can! - Fantom
					}
					if = {
						limit = {
							date > 1936.7.19
							date < 1936.9.16
						}
						country_event = { id = lar_spain.5 days = 5 random_days = 10 }
					}
					if = {
						limit = {
							date > 1936.9.15
						}
						country_event = { id = lar_spain.5 days = 15 random_days = 15 }
					}
				}
			}
			if = {
				limit = {
					has_completed_focus = SPA_a_great_spain
				}
				166 = {
					custom_effect_tooltip = SPR_expand_influence_republicans_tt
					SPA_garrison_control_tooltip = yes
					SPA_garrison_control_cost_calculation = yes
				}
				hidden_effect = {
					166 = {
						subtract_from_variable = { var = SPA_garrison_control value = 1 }
						SPR = { subtract_from_variable = { var = spa_civil_war_divisions_counter_var value = 1 } }
						SPR = { add_to_variable = { var = spr_civil_war_divisions_counter_var value = 1 } }
						SPA_garrison_control_cost_calculation = yes
					}
					if = {
						limit = {
							date < 1936.5.2
						}
						country_event = { id = lar_spain.5 days = 90 random_days = 30 }
					}
					if = {
						limit = {
							date > 1936.5.1
							date < 1936.8.10
						}
						country_event = { id = lar_spain.5 days = 45 random_days = 20 }
					}
					if = {
						limit = {
							date > 1936.8.9
							date < 1936.10.2
						}
						country_event = { id = lar_spain.5 days = 1 random_days = 5 }
					}
					if = {
						limit = {
							date > 1936.10.1
						}
						country_event = { id = lar_spain.5 random_days = 3 }
					}
				}
			}
		}

	}

	SPA_expand_influence_in_the_eastern_aragon_garrison_mission = {

		icon = generic_prepare_civil_war

		allowed = {
			tag = SPR
		}

		available = {
			hidden_trigger = { always = no }
		}

		highlight_states = {
			highlight_state_targets = {
				state = 794
			} 
		}

		on_map_mode = map_and_decisions_view

		fire_only_once = no

		days_mission_timeout = 14

		is_good = no

		cancel_if_not_visible = yes

		activation = {
			always = no
		}

		visible = {
			tag = SPR
			has_country_flag = SPR_spanish_elections_flag
			NOT = { has_global_flag = spanish_civil_war }
		}

		timeout_effect = {
			794 = {
				if = {
					limit = {
						ROOT = { has_completed_focus = SPA_a_great_spain }
						date < 1936.5.2
					}
					set_state_flag = { flag = SPR_ai_recently_expanded_influence_flag value = 1 days = 45 }
				}
				if = {
					limit = {
						ROOT = { has_completed_focus = SPA_a_great_spain }
						date > 1936.5.1
						date < 1936.8.10
					}
					set_state_flag = { flag = SPR_ai_recently_expanded_influence_flag value = 1 days = 30 }
				}
				if = {
					limit = {
						ROOT = { has_completed_focus = SPA_a_great_spain }
						date > 1936.8.9
						date < 1936.10.2
					}
					set_state_flag = { flag = SPR_ai_recently_expanded_influence_flag value = 1 days = 21 }
				}
				if = {
					limit = {
						ROOT = { has_completed_focus = SPA_a_great_spain }
						date > 1936.10.1
					}
					set_state_flag = { flag = SPR_ai_recently_expanded_influence_flag value = 1 days = 15 }
				}
				if = {
					limit = {
						ROOT = { has_completed_focus = SPR_the_popular_front }
						date < 1936.7.20
					}
					set_state_flag = { flag = SPR_ai_recently_expanded_influence_flag value = 1 days = 15 }
				}
				if = {
					limit = {
						ROOT = { has_completed_focus = SPR_the_popular_front }
						date > 1936.7.19
						date < 1936.9.16
					}
					set_state_flag = { flag = SPR_ai_recently_expanded_influence_flag value = 1 days = 30 }
				}
				if = {
					limit = {
						ROOT = { has_completed_focus = SPR_the_popular_front }
						date > 1936.9.15
					}
					set_state_flag = { flag = SPR_ai_recently_expanded_influence_flag value = 1 days = 45 }
				}
			}
			if = {
				limit = {
					has_completed_focus = SPR_the_popular_front
				}
				794 = {
					custom_effect_tooltip = SPA_expand_influence_nationalists_tt
					SPA_garrison_control_tooltip = yes
				}
				hidden_effect = {
					794 = {
						if = {
							limit = { check_variable = { SPA_garrison_control < 4 } }
							
							add_to_variable = { var = SPA_garrison_control value = 1 }
							SPR = { add_to_variable = { var = spa_civil_war_divisions_counter_var value = 1 } }
							SPR = { subtract_from_variable = { var = spr_civil_war_divisions_counter_var value = 1 } }
						}
						SPR_garrison_control_cost_calculation = yes
					}
					if = {
						limit = {
							date < 1936.7.20
						}
						country_event = { id = lar_spain.5 days = 3 random_days = 5 }	#added this, since player can never achieve historical starting borders, but AI magically can! - Fantom
					}
					if = {
						limit = {
							date > 1936.7.19
							date < 1936.9.16
						}
						country_event = { id = lar_spain.5 days = 5 random_days = 10 }
					}
					if = {
						limit = {
							date > 1936.9.15
						}
						country_event = { id = lar_spain.5 days = 15 random_days = 15 }
					}
				}
			}
			if = {
				limit = {
					has_completed_focus = SPA_a_great_spain
				}
				794 = {
					custom_effect_tooltip = SPR_expand_influence_republicans_tt
					SPA_garrison_control_tooltip = yes
					SPA_garrison_control_cost_calculation = yes
				}
				hidden_effect = {
					794 = {
						subtract_from_variable = { var = SPA_garrison_control value = 1 }
						SPR = { subtract_from_variable = { var = spa_civil_war_divisions_counter_var value = 1 } }
						SPR = { add_to_variable = { var = spr_civil_war_divisions_counter_var value = 1 } }
						SPA_garrison_control_cost_calculation = yes
					}
					if = {
						limit = {
							date < 1936.5.2
						}
						country_event = { id = lar_spain.5 days = 90 random_days = 30 }
					}
					if = {
						limit = {
							date > 1936.5.1
							date < 1936.8.10
						}
						country_event = { id = lar_spain.5 days = 45 random_days = 20 }
					}
					if = {
						limit = {
							date > 1936.8.9
							date < 1936.10.2
						}
						country_event = { id = lar_spain.5 days = 1 random_days = 5 }
					}
					if = {
						limit = {
							date > 1936.10.1
						}
						country_event = { id = lar_spain.5 random_days = 3 }
					}
				}
			}
		}

	}

	SPA_expand_influence_in_the_catalunya_garrison_mission = {

		icon = generic_prepare_civil_war

		allowed = {
			tag = SPR
		}

		available = {
			hidden_trigger = { always = no }
		}

		highlight_states = {
			highlight_state_targets = {
				state = 165
			} 
		}

		on_map_mode = map_and_decisions_view

		fire_only_once = no

		days_mission_timeout = 14

		is_good = no

		cancel_if_not_visible = yes

		activation = {
			always = no
		}

		visible = {
			tag = SPR
			has_country_flag = SPR_spanish_elections_flag
			NOT = { has_global_flag = spanish_civil_war }
		}

		timeout_effect = {
			165 = {
				if = {
					limit = {
						ROOT = { has_completed_focus = SPA_a_great_spain }
						date < 1936.5.2
					}
					set_state_flag = { flag = SPR_ai_recently_expanded_influence_flag value = 1 days = 45 }
				}
				if = {
					limit = {
						ROOT = { has_completed_focus = SPA_a_great_spain }
						date > 1936.5.1
						date < 1936.8.10
					}
					set_state_flag = { flag = SPR_ai_recently_expanded_influence_flag value = 1 days = 30 }
				}
				if = {
					limit = {
						ROOT = { has_completed_focus = SPA_a_great_spain }
						date > 1936.8.9
						date < 1936.10.2
					}
					set_state_flag = { flag = SPR_ai_recently_expanded_influence_flag value = 1 days = 21 }
				}
				if = {
					limit = {
						ROOT = { has_completed_focus = SPA_a_great_spain }
						date > 1936.10.1
					}
					set_state_flag = { flag = SPR_ai_recently_expanded_influence_flag value = 1 days = 15 }
				}
				if = {
					limit = {
						ROOT = { has_completed_focus = SPR_the_popular_front }
						date < 1936.7.20
					}
					set_state_flag = { flag = SPR_ai_recently_expanded_influence_flag value = 1 days = 15 }
				}
				if = {
					limit = {
						ROOT = { has_completed_focus = SPR_the_popular_front }
						date > 1936.7.19
						date < 1936.9.16
					}
					set_state_flag = { flag = SPR_ai_recently_expanded_influence_flag value = 1 days = 30 }
				}
				if = {
					limit = {
						ROOT = { has_completed_focus = SPR_the_popular_front }
						date > 1936.9.15
					}
					set_state_flag = { flag = SPR_ai_recently_expanded_influence_flag value = 1 days = 45 }
				}
			}
			if = {
				limit = {
					has_completed_focus = SPR_the_popular_front
				}
				165 = {
					custom_effect_tooltip = SPA_expand_influence_nationalists_tt
					SPA_garrison_control_tooltip = yes
				}
				hidden_effect = {
					165 = {
						if = {
							limit = { check_variable = { SPA_garrison_control < 4 } }
							
							add_to_variable = { var = SPA_garrison_control value = 1 }
							SPR = { add_to_variable = { var = spa_civil_war_divisions_counter_var value = 1 } }
							SPR = { subtract_from_variable = { var = spr_civil_war_divisions_counter_var value = 1 } }
						}
						SPR_garrison_control_cost_calculation = yes
					}
					if = {
						limit = {
							date < 1936.7.20
						}
						country_event = { id = lar_spain.5 days = 3 random_days = 5 }	#added this, since player can never achieve historical starting borders, but AI magically can! - Fantom
					}
					if = {
						limit = {
							date > 1936.7.19
							date < 1936.9.16
						}
						country_event = { id = lar_spain.5 days = 5 random_days = 10 }
					}
					if = {
						limit = {
							date > 1936.9.15
						}
						country_event = { id = lar_spain.5 days = 15 random_days = 15 }
					}
				}
			}
			if = {
				limit = {
					has_completed_focus = SPA_a_great_spain
				}
				165 = {
					custom_effect_tooltip = SPR_expand_influence_republicans_tt
					SPA_garrison_control_tooltip = yes
					SPA_garrison_control_cost_calculation = yes
				}
				hidden_effect = {
					165 = {
						subtract_from_variable = { var = SPA_garrison_control value = 1 }
						SPR = { subtract_from_variable = { var = spa_civil_war_divisions_counter_var value = 1 } }
						SPR = { add_to_variable = { var = spr_civil_war_divisions_counter_var value = 1 } }
						SPA_garrison_control_cost_calculation = yes
					}
					if = {
						limit = {
							date < 1936.5.2
						}
						country_event = { id = lar_spain.5 days = 90 random_days = 30 }
					}
					if = {
						limit = {
							date > 1936.5.1
							date < 1936.8.10
						}
						country_event = { id = lar_spain.5 days = 45 random_days = 20 }
					}
					if = {
						limit = {
							date > 1936.8.9
							date < 1936.10.2
						}
						country_event = { id = lar_spain.5 days = 1 random_days = 5 }
					}
					if = {
						limit = {
							date > 1936.10.1
						}
						country_event = { id = lar_spain.5 random_days = 3 }
					}
				}
			}
		}

	}

	SPA_expand_influence_in_the_salamanca_garrison_mission = {

		icon = generic_prepare_civil_war

		allowed = {
			tag = SPR
		}

		available = {
			hidden_trigger = { always = no }
		}

		highlight_states = {
			highlight_state_targets = {
				state = 788
			} 
		}

		on_map_mode = map_and_decisions_view

		fire_only_once = no

		days_mission_timeout = 14

		is_good = no

		cancel_if_not_visible = yes

		activation = {
			always = no
		}

		visible = {
			tag = SPR
			has_country_flag = SPR_spanish_elections_flag
			NOT = { has_global_flag = spanish_civil_war }
		}

		timeout_effect = {
			788 = {
				if = {
					limit = {
						ROOT = { has_completed_focus = SPA_a_great_spain }
						date < 1936.5.2
					}
					set_state_flag = { flag = SPR_ai_recently_expanded_influence_flag value = 1 days = 45 }
				}
				if = {
					limit = {
						ROOT = { has_completed_focus = SPA_a_great_spain }
						date > 1936.5.1
						date < 1936.8.10
					}
					set_state_flag = { flag = SPR_ai_recently_expanded_influence_flag value = 1 days = 30 }
				}
				if = {
					limit = {
						ROOT = { has_completed_focus = SPA_a_great_spain }
						date > 1936.8.9
						date < 1936.10.2
					}
					set_state_flag = { flag = SPR_ai_recently_expanded_influence_flag value = 1 days = 21 }
				}
				if = {
					limit = {
						ROOT = { has_completed_focus = SPA_a_great_spain }
						date > 1936.10.1
					}
					set_state_flag = { flag = SPR_ai_recently_expanded_influence_flag value = 1 days = 15 }
				}
				if = {
					limit = {
						ROOT = { has_completed_focus = SPR_the_popular_front }
						date < 1936.7.20
					}
					set_state_flag = { flag = SPR_ai_recently_expanded_influence_flag value = 1 days = 15 }
				}
				if = {
					limit = {
						ROOT = { has_completed_focus = SPR_the_popular_front }
						date > 1936.7.19
						date < 1936.9.16
					}
					set_state_flag = { flag = SPR_ai_recently_expanded_influence_flag value = 1 days = 30 }
				}
				if = {
					limit = {
						ROOT = { has_completed_focus = SPR_the_popular_front }
						date > 1936.9.15
					}
					set_state_flag = { flag = SPR_ai_recently_expanded_influence_flag value = 1 days = 45 }
				}
			}
			if = {
				limit = {
					has_completed_focus = SPR_the_popular_front
				}
				788 = {
					custom_effect_tooltip = SPA_expand_influence_nationalists_tt
					SPA_garrison_control_tooltip = yes
				}
				hidden_effect = {
					788 = {
						if = {
							limit = { check_variable = { SPA_garrison_control < 4 } }
							
							add_to_variable = { var = SPA_garrison_control value = 1 }
							SPR = { add_to_variable = { var = spa_civil_war_divisions_counter_var value = 1 } }
							SPR = { subtract_from_variable = { var = spr_civil_war_divisions_counter_var value = 1 } }
						}
						SPR_garrison_control_cost_calculation = yes
					}
					if = {
						limit = {
							date < 1936.7.20
						}
						country_event = { id = lar_spain.5 days = 3 random_days = 5 }	#added this, since player can never achieve historical starting borders, but AI magically can! - Fantom
					}
					if = {
						limit = {
							date > 1936.7.19
							date < 1936.9.16
						}
						country_event = { id = lar_spain.5 days = 5 random_days = 10 }
					}
					if = {
						limit = {
							date > 1936.9.15
						}
						country_event = { id = lar_spain.5 days = 15 random_days = 15 }
					}
				}
			}
			if = {
				limit = {
					has_completed_focus = SPA_a_great_spain
				}
				788 = {
					custom_effect_tooltip = SPR_expand_influence_republicans_tt
					SPA_garrison_control_tooltip = yes
					SPA_garrison_control_cost_calculation = yes
				}
				hidden_effect = {
					788 = {
						subtract_from_variable = { var = SPA_garrison_control value = 1 }
						SPR = { subtract_from_variable = { var = spa_civil_war_divisions_counter_var value = 1 } }
						SPR = { add_to_variable = { var = spr_civil_war_divisions_counter_var value = 1 } }
						SPA_garrison_control_cost_calculation = yes
					}
					if = {
						limit = {
							date < 1936.5.2
						}
						country_event = { id = lar_spain.5 days = 90 random_days = 30 }
					}
					if = {
						limit = {
							date > 1936.5.1
							date < 1936.8.10
						}
						country_event = { id = lar_spain.5 days = 45 random_days = 20 }
					}
					if = {
						limit = {
							date > 1936.8.9
							date < 1936.10.2
						}
						country_event = { id = lar_spain.5 days = 1 random_days = 5 }
					}
					if = {
						limit = {
							date > 1936.10.1
						}
						country_event = { id = lar_spain.5 random_days = 3 }
					}
				}
			}
		}

	}

	SPA_expand_influence_in_the_madrid_garrison_mission = {

		icon = generic_prepare_civil_war

		allowed = {
			tag = SPR
		}

		available = {
			hidden_trigger = { always = no }
		}

		highlight_states = {
			highlight_state_targets = {
				state = 41
			} 
		}

		on_map_mode = map_and_decisions_view

		fire_only_once = no

		days_mission_timeout = 14

		is_good = no

		cancel_if_not_visible = yes

		activation = {
			always = no
		}

		visible = {
			tag = SPR
			has_country_flag = SPR_spanish_elections_flag
			NOT = { has_global_flag = spanish_civil_war }
		}

		timeout_effect = {
			41 = {
				if = {
					limit = {
						ROOT = { has_completed_focus = SPA_a_great_spain }
						date < 1936.5.2
					}
					set_state_flag = { flag = SPR_ai_recently_expanded_influence_flag value = 1 days = 45 }
				}
				if = {
					limit = {
						ROOT = { has_completed_focus = SPA_a_great_spain }
						date > 1936.5.1
						date < 1936.8.10
					}
					set_state_flag = { flag = SPR_ai_recently_expanded_influence_flag value = 1 days = 30 }
				}
				if = {
					limit = {
						ROOT = { has_completed_focus = SPA_a_great_spain }
						date > 1936.8.9
						date < 1936.10.2
					}
					set_state_flag = { flag = SPR_ai_recently_expanded_influence_flag value = 1 days = 21 }
				}
				if = {
					limit = {
						ROOT = { has_completed_focus = SPA_a_great_spain }
						date > 1936.10.1
					}
					set_state_flag = { flag = SPR_ai_recently_expanded_influence_flag value = 1 days = 15 }
				}
				if = {
					limit = {
						ROOT = { has_completed_focus = SPR_the_popular_front }
						date < 1936.7.20
					}
					set_state_flag = { flag = SPR_ai_recently_expanded_influence_flag value = 1 days = 15 }
				}
				if = {
					limit = {
						ROOT = { has_completed_focus = SPR_the_popular_front }
						date > 1936.7.19
						date < 1936.9.16
					}
					set_state_flag = { flag = SPR_ai_recently_expanded_influence_flag value = 1 days = 30 }
				}
				if = {
					limit = {
						ROOT = { has_completed_focus = SPR_the_popular_front }
						date > 1936.9.15
					}
					set_state_flag = { flag = SPR_ai_recently_expanded_influence_flag value = 1 days = 45 }
				}
			}
			if = {
				limit = {
					has_completed_focus = SPR_the_popular_front
				}
				41 = {
					custom_effect_tooltip = SPA_expand_influence_nationalists_tt
					SPA_garrison_control_tooltip = yes
				}
				hidden_effect = {
					41 = {
						if = {
							limit = { check_variable = { SPA_garrison_control < 4 } }
							
							add_to_variable = { var = SPA_garrison_control value = 1 }
							SPR = { add_to_variable = { var = spa_civil_war_divisions_counter_var value = 1 } }
							SPR = { subtract_from_variable = { var = spr_civil_war_divisions_counter_var value = 1 } }
						}
						SPR_garrison_control_cost_calculation = yes
					}
					if = {
						limit = {
							date < 1936.7.20
						}
						country_event = { id = lar_spain.5 days = 3 random_days = 5 }	#added this, since player can never achieve historical starting borders, but AI magically can! - Fantom
					}
					if = {
						limit = {
							date > 1936.7.19
							date < 1936.9.16
						}
						country_event = { id = lar_spain.5 days = 5 random_days = 10 }
					}
					if = {
						limit = {
							date > 1936.9.15
						}
						country_event = { id = lar_spain.5 days = 15 random_days = 15 }
					}
				}
			}
			if = {
				limit = {
					has_completed_focus = SPA_a_great_spain
				}
				41 = {
					custom_effect_tooltip = SPR_expand_influence_republicans_tt
					SPA_garrison_control_tooltip = yes
					SPA_garrison_control_cost_calculation = yes
				}
				hidden_effect = {
					41 = {
						subtract_from_variable = { var = SPA_garrison_control value = 1 }
						SPR = { subtract_from_variable = { var = spa_civil_war_divisions_counter_var value = 1 } }
						SPR = { add_to_variable = { var = spr_civil_war_divisions_counter_var value = 1 } }
						SPA_garrison_control_cost_calculation = yes
					}
					if = {
						limit = {
							date < 1936.5.2
						}
						country_event = { id = lar_spain.5 days = 90 random_days = 30 }
					}
					if = {
						limit = {
							date > 1936.5.1
							date < 1936.8.10
						}
						country_event = { id = lar_spain.5 days = 45 random_days = 20 }
					}
					if = {
						limit = {
							date > 1936.8.9
							date < 1936.10.2
						}
						country_event = { id = lar_spain.5 days = 1 random_days = 5 }
					}
					if = {
						limit = {
							date > 1936.10.1
						}
						country_event = { id = lar_spain.5 random_days = 3 }
					}
				}
			}
		}

	}

	SPA_expand_influence_in_the_guadalajara_garrison_mission = {

		icon = generic_prepare_civil_war

		allowed = {
			tag = SPR
		}

		available = {
			hidden_trigger = { always = no }
		}

		highlight_states = {
			highlight_state_targets = {
				state = 793
			} 
		}

		on_map_mode = map_and_decisions_view

		fire_only_once = no

		days_mission_timeout = 14

		is_good = no

		cancel_if_not_visible = yes

		activation = {
			always = no
		}

		visible = {
			tag = SPR
			has_country_flag = SPR_spanish_elections_flag
			NOT = { has_global_flag = spanish_civil_war }
		}

		timeout_effect = {
			793 = {
				if = {
					limit = {
						ROOT = { has_completed_focus = SPA_a_great_spain }
						date < 1936.5.2
					}
					set_state_flag = { flag = SPR_ai_recently_expanded_influence_flag value = 1 days = 45 }
				}
				if = {
					limit = {
						ROOT = { has_completed_focus = SPA_a_great_spain }
						date > 1936.5.1
						date < 1936.8.10
					}
					set_state_flag = { flag = SPR_ai_recently_expanded_influence_flag value = 1 days = 30 }
				}
				if = {
					limit = {
						ROOT = { has_completed_focus = SPA_a_great_spain }
						date > 1936.8.9
						date < 1936.10.2
					}
					set_state_flag = { flag = SPR_ai_recently_expanded_influence_flag value = 1 days = 21 }
				}
				if = {
					limit = {
						ROOT = { has_completed_focus = SPA_a_great_spain }
						date > 1936.10.1
					}
					set_state_flag = { flag = SPR_ai_recently_expanded_influence_flag value = 1 days = 15 }
				}
				if = {
					limit = {
						ROOT = { has_completed_focus = SPR_the_popular_front }
						date < 1936.7.20
					}
					set_state_flag = { flag = SPR_ai_recently_expanded_influence_flag value = 1 days = 15 }
				}
				if = {
					limit = {
						ROOT = { has_completed_focus = SPR_the_popular_front }
						date > 1936.7.19
						date < 1936.9.16
					}
					set_state_flag = { flag = SPR_ai_recently_expanded_influence_flag value = 1 days = 30 }
				}
				if = {
					limit = {
						ROOT = { has_completed_focus = SPR_the_popular_front }
						date > 1936.9.15
					}
					set_state_flag = { flag = SPR_ai_recently_expanded_influence_flag value = 1 days = 45 }
				}
			}
			if = {
				limit = {
					has_completed_focus = SPR_the_popular_front
				}
				793 = {
					custom_effect_tooltip = SPA_expand_influence_nationalists_tt
					SPA_garrison_control_tooltip = yes
				}
				hidden_effect = {
					793 = {
						if = {
							limit = { check_variable = { SPA_garrison_control < 4 } }
							
							add_to_variable = { var = SPA_garrison_control value = 1 }
							SPR = { add_to_variable = { var = spa_civil_war_divisions_counter_var value = 1 } }
							SPR = { subtract_from_variable = { var = spr_civil_war_divisions_counter_var value = 1 } }
						}
						SPR_garrison_control_cost_calculation = yes
					}
					if = {
						limit = {
							date < 1936.7.20
						}
						country_event = { id = lar_spain.5 days = 3 random_days = 5 }	#added this, since player can never achieve historical starting borders, but AI magically can! - Fantom
					}
					if = {
						limit = {
							date > 1936.7.19
							date < 1936.9.16
						}
						country_event = { id = lar_spain.5 days = 5 random_days = 10 }
					}
					if = {
						limit = {
							date > 1936.9.15
						}
						country_event = { id = lar_spain.5 days = 15 random_days = 15 }
					}
				}
			}
			if = {
				limit = {
					has_completed_focus = SPA_a_great_spain
				}
				793 = {
					custom_effect_tooltip = SPR_expand_influence_republicans_tt
					SPA_garrison_control_tooltip = yes
					SPA_garrison_control_cost_calculation = yes
				}
				hidden_effect = {
					793 = {
						subtract_from_variable = { var = SPA_garrison_control value = 1 }
						SPR = { subtract_from_variable = { var = spa_civil_war_divisions_counter_var value = 1 } }
						SPR = { add_to_variable = { var = spr_civil_war_divisions_counter_var value = 1 } }
						SPA_garrison_control_cost_calculation = yes
					}
					if = {
						limit = {
							date < 1936.5.2
						}
						country_event = { id = lar_spain.5 days = 90 random_days = 30 }
					}
					if = {
						limit = {
							date > 1936.5.1
							date < 1936.8.10
						}
						country_event = { id = lar_spain.5 days = 45 random_days = 20 }
					}
					if = {
						limit = {
							date > 1936.8.9
							date < 1936.10.2
						}
						country_event = { id = lar_spain.5 days = 1 random_days = 5 }
					}
					if = {
						limit = {
							date > 1936.10.1
						}
						country_event = { id = lar_spain.5 random_days = 3 }
					}
				}
			}
		}

	}

	SPA_expand_influence_in_the_valencia_garrison_mission = {

		icon = generic_prepare_civil_war

		allowed = {
			tag = SPR
		}

		available = {
			hidden_trigger = { always = no }
		}

		highlight_states = {
			highlight_state_targets = {
				state = 167
			} 
		}

		on_map_mode = map_and_decisions_view

		fire_only_once = no

		days_mission_timeout = 14

		is_good = no

		cancel_if_not_visible = yes

		activation = {
			always = no
		}

		visible = {
			tag = SPR
			has_country_flag = SPR_spanish_elections_flag
			NOT = { has_global_flag = spanish_civil_war }
		}

		timeout_effect = {
			167 = {
				if = {
					limit = {
						ROOT = { has_completed_focus = SPA_a_great_spain }
						date < 1936.5.2
					}
					set_state_flag = { flag = SPR_ai_recently_expanded_influence_flag value = 1 days = 45 }
				}
				if = {
					limit = {
						ROOT = { has_completed_focus = SPA_a_great_spain }
						date > 1936.5.1
						date < 1936.8.10
					}
					set_state_flag = { flag = SPR_ai_recently_expanded_influence_flag value = 1 days = 30 }
				}
				if = {
					limit = {
						ROOT = { has_completed_focus = SPA_a_great_spain }
						date > 1936.8.9
						date < 1936.10.2
					}
					set_state_flag = { flag = SPR_ai_recently_expanded_influence_flag value = 1 days = 21 }
				}
				if = {
					limit = {
						ROOT = { has_completed_focus = SPA_a_great_spain }
						date > 1936.10.1
					}
					set_state_flag = { flag = SPR_ai_recently_expanded_influence_flag value = 1 days = 15 }
				}
				if = {
					limit = {
						ROOT = { has_completed_focus = SPR_the_popular_front }
						date < 1936.7.20
					}
					set_state_flag = { flag = SPR_ai_recently_expanded_influence_flag value = 1 days = 15 }
				}
				if = {
					limit = {
						ROOT = { has_completed_focus = SPR_the_popular_front }
						date > 1936.7.19
						date < 1936.9.16
					}
					set_state_flag = { flag = SPR_ai_recently_expanded_influence_flag value = 1 days = 30 }
				}
				if = {
					limit = {
						ROOT = { has_completed_focus = SPR_the_popular_front }
						date > 1936.9.15
					}
					set_state_flag = { flag = SPR_ai_recently_expanded_influence_flag value = 1 days = 45 }
				}
			}
			if = {
				limit = {
					has_completed_focus = SPR_the_popular_front
				}
				167 = {
					custom_effect_tooltip = SPA_expand_influence_nationalists_tt
					SPA_garrison_control_tooltip = yes
				}
				hidden_effect = {
					167 = {
						if = {
							limit = { check_variable = { SPA_garrison_control < 4 } }
							
							add_to_variable = { var = SPA_garrison_control value = 1 }
							SPR = { add_to_variable = { var = spa_civil_war_divisions_counter_var value = 1 } }
							SPR = { subtract_from_variable = { var = spr_civil_war_divisions_counter_var value = 1 } }
						}
						SPR_garrison_control_cost_calculation = yes
					}
					if = {
						limit = {
							date < 1936.7.20
						}
						country_event = { id = lar_spain.5 days = 3 random_days = 5 }	#added this, since player can never achieve historical starting borders, but AI magically can! - Fantom
					}
					if = {
						limit = {
							date > 1936.7.19
							date < 1936.9.16
						}
						country_event = { id = lar_spain.5 days = 5 random_days = 10 }
					}
					if = {
						limit = {
							date > 1936.9.15
						}
						country_event = { id = lar_spain.5 days = 15 random_days = 15 }
					}
				}
			}
			if = {
				limit = {
					has_completed_focus = SPA_a_great_spain
				}
				167 = {
					custom_effect_tooltip = SPR_expand_influence_republicans_tt
					SPA_garrison_control_tooltip = yes
					SPA_garrison_control_cost_calculation = yes
				}
				hidden_effect = {
					167 = {
						subtract_from_variable = { var = SPA_garrison_control value = 1 }
						SPR = { subtract_from_variable = { var = spa_civil_war_divisions_counter_var value = 1 } }
						SPR = { add_to_variable = { var = spr_civil_war_divisions_counter_var value = 1 } }
						SPA_garrison_control_cost_calculation = yes
					}
					if = {
						limit = {
							date < 1936.5.2
						}
						country_event = { id = lar_spain.5 days = 90 random_days = 30 }
					}
					if = {
						limit = {
							date > 1936.5.1
							date < 1936.8.10
						}
						country_event = { id = lar_spain.5 days = 45 random_days = 20 }
					}
					if = {
						limit = {
							date > 1936.8.9
							date < 1936.10.2
						}
						country_event = { id = lar_spain.5 days = 1 random_days = 5 }
					}
					if = {
						limit = {
							date > 1936.10.1
						}
						country_event = { id = lar_spain.5 random_days = 3 }
					}
				}
			}
		}

	}

	SPA_expand_influence_in_the_extremadura_garrison_mission = {

		icon = generic_prepare_civil_war

		allowed = {
			tag = SPR
		}

		available = {
			hidden_trigger = { always = no }
		}

		highlight_states = {
			highlight_state_targets = {
				state = 170
			} 
		}

		on_map_mode = map_and_decisions_view

		fire_only_once = no

		days_mission_timeout = 14

		is_good = no

		cancel_if_not_visible = yes

		activation = {
			always = no
		}

		visible = {
			tag = SPR
			has_country_flag = SPR_spanish_elections_flag
			NOT = { has_global_flag = spanish_civil_war }
		}

		timeout_effect = {
			170 = {
				if = {
					limit = {
						ROOT = { has_completed_focus = SPA_a_great_spain }
						date < 1936.5.2
					}
					set_state_flag = { flag = SPR_ai_recently_expanded_influence_flag value = 1 days = 45 }
				}
				if = {
					limit = {
						ROOT = { has_completed_focus = SPA_a_great_spain }
						date > 1936.5.1
						date < 1936.8.10
					}
					set_state_flag = { flag = SPR_ai_recently_expanded_influence_flag value = 1 days = 30 }
				}
				if = {
					limit = {
						ROOT = { has_completed_focus = SPA_a_great_spain }
						date > 1936.8.9
						date < 1936.10.2
					}
					set_state_flag = { flag = SPR_ai_recently_expanded_influence_flag value = 1 days = 21 }
				}
				if = {
					limit = {
						ROOT = { has_completed_focus = SPA_a_great_spain }
						date > 1936.10.1
					}
					set_state_flag = { flag = SPR_ai_recently_expanded_influence_flag value = 1 days = 15 }
				}
				if = {
					limit = {
						ROOT = { has_completed_focus = SPR_the_popular_front }
						date < 1936.7.20
					}
					set_state_flag = { flag = SPR_ai_recently_expanded_influence_flag value = 1 days = 15 }
				}
				if = {
					limit = {
						ROOT = { has_completed_focus = SPR_the_popular_front }
						date > 1936.7.19
						date < 1936.9.16
					}
					set_state_flag = { flag = SPR_ai_recently_expanded_influence_flag value = 1 days = 30 }
				}
				if = {
					limit = {
						ROOT = { has_completed_focus = SPR_the_popular_front }
						date > 1936.9.15
					}
					set_state_flag = { flag = SPR_ai_recently_expanded_influence_flag value = 1 days = 45 }
				}
			}
			if = {
				limit = {
					has_completed_focus = SPR_the_popular_front
				}
				170 = {
					custom_effect_tooltip = SPA_expand_influence_nationalists_tt
					SPA_garrison_control_tooltip = yes
				}
				hidden_effect = {
					170 = {
						if = {
							limit = { check_variable = { SPA_garrison_control < 4 } }
							
							add_to_variable = { var = SPA_garrison_control value = 1 }
							SPR = { add_to_variable = { var = spa_civil_war_divisions_counter_var value = 1 } }
							SPR = { subtract_from_variable = { var = spr_civil_war_divisions_counter_var value = 1 } }
						}
						SPR_garrison_control_cost_calculation = yes
					}
					if = {
						limit = {
							date < 1936.7.20
						}
						country_event = { id = lar_spain.5 days = 3 random_days = 5 }	#added this, since player can never achieve historical starting borders, but AI magically can! - Fantom
					}
					if = {
						limit = {
							date > 1936.7.19
							date < 1936.9.16
						}
						country_event = { id = lar_spain.5 days = 5 random_days = 10 }
					}
					if = {
						limit = {
							date > 1936.9.15
						}
						country_event = { id = lar_spain.5 days = 15 random_days = 15 }
					}
				}
			}
			if = {
				limit = {
					has_completed_focus = SPA_a_great_spain
				}
				170 = {
					custom_effect_tooltip = SPR_expand_influence_republicans_tt
					SPA_garrison_control_tooltip = yes
					SPA_garrison_control_cost_calculation = yes
				}
				hidden_effect = {
					170 = {
						subtract_from_variable = { var = SPA_garrison_control value = 1 }
						SPR = { subtract_from_variable = { var = spa_civil_war_divisions_counter_var value = 1 } }
						SPR = { add_to_variable = { var = spr_civil_war_divisions_counter_var value = 1 } }
						SPA_garrison_control_cost_calculation = yes
					}
					if = {
						limit = {
							date < 1936.5.2
						}
						country_event = { id = lar_spain.5 days = 90 random_days = 30 }
					}
					if = {
						limit = {
							date > 1936.5.1
							date < 1936.8.10
						}
						country_event = { id = lar_spain.5 days = 45 random_days = 20 }
					}
					if = {
						limit = {
							date > 1936.8.9
							date < 1936.10.2
						}
						country_event = { id = lar_spain.5 days = 1 random_days = 5 }
					}
					if = {
						limit = {
							date > 1936.10.1
						}
						country_event = { id = lar_spain.5 random_days = 3 }
					}
				}
			}
		}

	}

	SPA_expand_influence_in_the_ciudad_real_garrison_mission = {

		icon = generic_prepare_civil_war

		allowed = {
			tag = SPR
		}

		available = {
			hidden_trigger = { always = no }
		}

		highlight_states = {
			highlight_state_targets = {
				state = 175
			} 
		}

		on_map_mode = map_and_decisions_view

		fire_only_once = no

		days_mission_timeout = 14

		is_good = no

		cancel_if_not_visible = yes

		activation = {
			always = no
		}

		visible = {
			tag = SPR
			has_country_flag = SPR_spanish_elections_flag
			NOT = { has_global_flag = spanish_civil_war }
		}

		timeout_effect = {
			175 = {
				if = {
					limit = {
						ROOT = { has_completed_focus = SPA_a_great_spain }
						date < 1936.5.2
					}
					set_state_flag = { flag = SPR_ai_recently_expanded_influence_flag value = 1 days = 45 }
				}
				if = {
					limit = {
						ROOT = { has_completed_focus = SPA_a_great_spain }
						date > 1936.5.1
						date < 1936.8.10
					}
					set_state_flag = { flag = SPR_ai_recently_expanded_influence_flag value = 1 days = 30 }
				}
				if = {
					limit = {
						ROOT = { has_completed_focus = SPA_a_great_spain }
						date > 1936.8.9
						date < 1936.10.2
					}
					set_state_flag = { flag = SPR_ai_recently_expanded_influence_flag value = 1 days = 21 }
				}
				if = {
					limit = {
						ROOT = { has_completed_focus = SPA_a_great_spain }
						date > 1936.10.1
					}
					set_state_flag = { flag = SPR_ai_recently_expanded_influence_flag value = 1 days = 15 }
				}
				if = {
					limit = {
						ROOT = { has_completed_focus = SPR_the_popular_front }
						date < 1936.7.20
					}
					set_state_flag = { flag = SPR_ai_recently_expanded_influence_flag value = 1 days = 15 }
				}
				if = {
					limit = {
						ROOT = { has_completed_focus = SPR_the_popular_front }
						date > 1936.7.19
						date < 1936.9.16
					}
					set_state_flag = { flag = SPR_ai_recently_expanded_influence_flag value = 1 days = 30 }
				}
				if = {
					limit = {
						ROOT = { has_completed_focus = SPR_the_popular_front }
						date > 1936.9.15
					}
					set_state_flag = { flag = SPR_ai_recently_expanded_influence_flag value = 1 days = 45 }
				}
			}
			if = {
				limit = {
					has_completed_focus = SPR_the_popular_front
				}
				175 = {
					custom_effect_tooltip = SPA_expand_influence_nationalists_tt
					SPA_garrison_control_tooltip = yes
				}
				hidden_effect = {
					175 = {
						if = {
							limit = { check_variable = { SPA_garrison_control < 4 } }
							
							add_to_variable = { var = SPA_garrison_control value = 1 }
							SPR = { add_to_variable = { var = spa_civil_war_divisions_counter_var value = 1 } }
							SPR = { subtract_from_variable = { var = spr_civil_war_divisions_counter_var value = 1 } }
						}
						SPR_garrison_control_cost_calculation = yes
					}
					if = {
						limit = {
							date < 1936.7.20
						}
						country_event = { id = lar_spain.5 days = 3 random_days = 5 }	#added this, since player can never achieve historical starting borders, but AI magically can! - Fantom
					}
					if = {
						limit = {
							date > 1936.7.19
							date < 1936.9.16
						}
						country_event = { id = lar_spain.5 days = 5 random_days = 10 }
					}
					if = {
						limit = {
							date > 1936.9.15
						}
						country_event = { id = lar_spain.5 days = 15 random_days = 15 }
					}
				}
			}
			if = {
				limit = {
					has_completed_focus = SPA_a_great_spain
				}
				175 = {
					custom_effect_tooltip = SPR_expand_influence_republicans_tt
					SPA_garrison_control_tooltip = yes
					SPA_garrison_control_cost_calculation = yes
				}
				hidden_effect = {
					175 = {
						subtract_from_variable = { var = SPA_garrison_control value = 1 }
						SPR = { subtract_from_variable = { var = spa_civil_war_divisions_counter_var value = 1 } }
						SPR = { add_to_variable = { var = spr_civil_war_divisions_counter_var value = 1 } }
						SPA_garrison_control_cost_calculation = yes
					}
					if = {
						limit = {
							date < 1936.5.2
						}
						country_event = { id = lar_spain.5 days = 90 random_days = 30 }
					}
					if = {
						limit = {
							date > 1936.5.1
							date < 1936.8.10
						}
						country_event = { id = lar_spain.5 days = 45 random_days = 20 }
					}
					if = {
						limit = {
							date > 1936.8.9
							date < 1936.10.2
						}
						country_event = { id = lar_spain.5 days = 1 random_days = 5 }
					}
					if = {
						limit = {
							date > 1936.10.1
						}
						country_event = { id = lar_spain.5 random_days = 3 }
					}
				}
			}
		}

	}

	SPA_expand_influence_in_the_murcia_garrison_mission = {

		icon = generic_prepare_civil_war

		allowed = {
			tag = SPR
		}

		available = {
			hidden_trigger = { always = no }
		}

		highlight_states = {
			highlight_state_targets = {
				state = 168
			} 
		}

		on_map_mode = map_and_decisions_view

		fire_only_once = no

		days_mission_timeout = 14

		is_good = no

		cancel_if_not_visible = yes

		activation = {
			always = no
		}

		visible = {
			tag = SPR
			has_country_flag = SPR_spanish_elections_flag
			NOT = { has_global_flag = spanish_civil_war }
		}

		timeout_effect = {
			168 = {
				if = {
					limit = {
						ROOT = { has_completed_focus = SPA_a_great_spain }
						date < 1936.5.2
					}
					set_state_flag = { flag = SPR_ai_recently_expanded_influence_flag value = 1 days = 45 }
				}
				if = {
					limit = {
						ROOT = { has_completed_focus = SPA_a_great_spain }
						date > 1936.5.1
						date < 1936.8.10
					}
					set_state_flag = { flag = SPR_ai_recently_expanded_influence_flag value = 1 days = 30 }
				}
				if = {
					limit = {
						ROOT = { has_completed_focus = SPA_a_great_spain }
						date > 1936.8.9
						date < 1936.10.2
					}
					set_state_flag = { flag = SPR_ai_recently_expanded_influence_flag value = 1 days = 21 }
				}
				if = {
					limit = {
						ROOT = { has_completed_focus = SPA_a_great_spain }
						date > 1936.10.1
					}
					set_state_flag = { flag = SPR_ai_recently_expanded_influence_flag value = 1 days = 15 }
				}
				if = {
					limit = {
						ROOT = { has_completed_focus = SPR_the_popular_front }
						date < 1936.7.20
					}
					set_state_flag = { flag = SPR_ai_recently_expanded_influence_flag value = 1 days = 15 }
				}
				if = {
					limit = {
						ROOT = { has_completed_focus = SPR_the_popular_front }
						date > 1936.7.19
						date < 1936.9.16
					}
					set_state_flag = { flag = SPR_ai_recently_expanded_influence_flag value = 1 days = 30 }
				}
				if = {
					limit = {
						ROOT = { has_completed_focus = SPR_the_popular_front }
						date > 1936.9.15
					}
					set_state_flag = { flag = SPR_ai_recently_expanded_influence_flag value = 1 days = 45 }
				}
			}
			if = {
				limit = {
					has_completed_focus = SPR_the_popular_front
				}
				168 = {
					custom_effect_tooltip = SPA_expand_influence_nationalists_tt
					SPA_garrison_control_tooltip = yes
				}
				hidden_effect = {
					168 = {
						if = {
							limit = { check_variable = { SPA_garrison_control < 4 } }
							
							add_to_variable = { var = SPA_garrison_control value = 1 }
							SPR = { add_to_variable = { var = spa_civil_war_divisions_counter_var value = 1 } }
							SPR = { subtract_from_variable = { var = spr_civil_war_divisions_counter_var value = 1 } }
						}
						SPR_garrison_control_cost_calculation = yes
					}
					if = {
						limit = {
							date < 1936.7.20
						}
						country_event = { id = lar_spain.5 days = 3 random_days = 5 }	#added this, since player can never achieve historical starting borders, but AI magically can! - Fantom
					}
					if = {
						limit = {
							date > 1936.7.19
							date < 1936.9.16
						}
						country_event = { id = lar_spain.5 days = 5 random_days = 10 }
					}
					if = {
						limit = {
							date > 1936.9.15
						}
						country_event = { id = lar_spain.5 days = 15 random_days = 15 }
					}
				}
			}
			if = {
				limit = {
					has_completed_focus = SPA_a_great_spain
				}
				168 = {
					custom_effect_tooltip = SPR_expand_influence_republicans_tt
					SPA_garrison_control_tooltip = yes
					SPA_garrison_control_cost_calculation = yes
				}
				hidden_effect = {
					168 = {
						subtract_from_variable = { var = SPA_garrison_control value = 1 }
						SPR = { subtract_from_variable = { var = spa_civil_war_divisions_counter_var value = 1 } }
						SPR = { add_to_variable = { var = spr_civil_war_divisions_counter_var value = 1 } }
						SPA_garrison_control_cost_calculation = yes
					}
					if = {
						limit = {
							date < 1936.5.2
						}
						country_event = { id = lar_spain.5 days = 90 random_days = 30 }
					}
					if = {
						limit = {
							date > 1936.5.1
							date < 1936.8.10
						}
						country_event = { id = lar_spain.5 days = 45 random_days = 20 }
					}
					if = {
						limit = {
							date > 1936.8.9
							date < 1936.10.2
						}
						country_event = { id = lar_spain.5 days = 1 random_days = 5 }
					}
					if = {
						limit = {
							date > 1936.10.1
						}
						country_event = { id = lar_spain.5 random_days = 3 }
					}
				}
			}
		}

	}

	SPA_expand_influence_in_the_sevilla_garrison_mission = {

		icon = generic_prepare_civil_war

		allowed = {
			tag = SPR
		}

		available = {
			hidden_trigger = { always = no }
		}

		highlight_states = {
			highlight_state_targets = {
				state = 169
			} 
		}

		on_map_mode = map_and_decisions_view

		fire_only_once = no

		days_mission_timeout = 14

		is_good = no

		cancel_if_not_visible = yes

		activation = {
			always = no
		}

		visible = {
			tag = SPR
			has_country_flag = SPR_spanish_elections_flag
			NOT = { has_global_flag = spanish_civil_war }
		}

		timeout_effect = {
			169 = {
				if = {
					limit = {
						ROOT = { has_completed_focus = SPA_a_great_spain }
						date < 1936.5.2
					}
					set_state_flag = { flag = SPR_ai_recently_expanded_influence_flag value = 1 days = 45 }
				}
				if = {
					limit = {
						ROOT = { has_completed_focus = SPA_a_great_spain }
						date > 1936.5.1
						date < 1936.8.10
					}
					set_state_flag = { flag = SPR_ai_recently_expanded_influence_flag value = 1 days = 30 }
				}
				if = {
					limit = {
						ROOT = { has_completed_focus = SPA_a_great_spain }
						date > 1936.8.9
						date < 1936.10.2
					}
					set_state_flag = { flag = SPR_ai_recently_expanded_influence_flag value = 1 days = 21 }
				}
				if = {
					limit = {
						ROOT = { has_completed_focus = SPA_a_great_spain }
						date > 1936.10.1
					}
					set_state_flag = { flag = SPR_ai_recently_expanded_influence_flag value = 1 days = 15 }
				}
				if = {
					limit = {
						ROOT = { has_completed_focus = SPR_the_popular_front }
						date < 1936.7.20
					}
					set_state_flag = { flag = SPR_ai_recently_expanded_influence_flag value = 1 days = 15 }
				}
				if = {
					limit = {
						ROOT = { has_completed_focus = SPR_the_popular_front }
						date > 1936.7.19
						date < 1936.9.16
					}
					set_state_flag = { flag = SPR_ai_recently_expanded_influence_flag value = 1 days = 30 }
				}
				if = {
					limit = {
						ROOT = { has_completed_focus = SPR_the_popular_front }
						date > 1936.9.15
					}
					set_state_flag = { flag = SPR_ai_recently_expanded_influence_flag value = 1 days = 45 }
				}
			}
			if = {
				limit = {
					has_completed_focus = SPR_the_popular_front
				}
				169 = {
					custom_effect_tooltip = SPA_expand_influence_nationalists_tt
					SPA_garrison_control_tooltip = yes
				}
				hidden_effect = {
					169 = {
						if = {
							limit = { check_variable = { SPA_garrison_control < 4 } }
							
							add_to_variable = { var = SPA_garrison_control value = 1 }
							SPR = { add_to_variable = { var = spa_civil_war_divisions_counter_var value = 1 } }
							SPR = { subtract_from_variable = { var = spr_civil_war_divisions_counter_var value = 1 } }
						}
						SPR_garrison_control_cost_calculation = yes
					}
					if = {
						limit = {
							date < 1936.7.20
						}
						country_event = { id = lar_spain.5 days = 3 random_days = 5 }	#added this, since player can never achieve historical starting borders, but AI magically can! - Fantom
					}
					if = {
						limit = {
							date > 1936.7.19
							date < 1936.9.16
						}
						country_event = { id = lar_spain.5 days = 5 random_days = 10 }
					}
					if = {
						limit = {
							date > 1936.9.15
						}
						country_event = { id = lar_spain.5 days = 15 random_days = 15 }
					}
				}
			}
			if = {
				limit = {
					has_completed_focus = SPA_a_great_spain
				}
				169 = {
					custom_effect_tooltip = SPR_expand_influence_republicans_tt
					SPA_garrison_control_tooltip = yes
					SPA_garrison_control_cost_calculation = yes
				}
				hidden_effect = {
					169 = {
						subtract_from_variable = { var = SPA_garrison_control value = 1 }
						SPR = { subtract_from_variable = { var = spa_civil_war_divisions_counter_var value = 1 } }
						SPR = { add_to_variable = { var = spr_civil_war_divisions_counter_var value = 1 } }
						SPA_garrison_control_cost_calculation = yes
					}
					if = {
						limit = {
							date < 1936.5.2
						}
						country_event = { id = lar_spain.5 days = 90 random_days = 30 }
					}
					if = {
						limit = {
							date > 1936.5.1
							date < 1936.8.10
						}
						country_event = { id = lar_spain.5 days = 45 random_days = 20 }
					}
					if = {
						limit = {
							date > 1936.8.9
							date < 1936.10.2
						}
						country_event = { id = lar_spain.5 days = 1 random_days = 5 }
					}
					if = {
						limit = {
							date > 1936.10.1
						}
						country_event = { id = lar_spain.5 random_days = 3 }
					}
				}
			}
		}

	}

	SPA_expand_influence_in_the_cordoba_garrison_mission = {

		icon = generic_prepare_civil_war

		allowed = {
			tag = SPR
		}

		available = {
			hidden_trigger = { always = no }
		}

		highlight_states = {
			highlight_state_targets = {
				state = 789
			} 
		}

		on_map_mode = map_and_decisions_view

		fire_only_once = no

		days_mission_timeout = 14

		is_good = no

		cancel_if_not_visible = yes

		activation = {
			always = no
		}

		visible = {
			tag = SPR
			has_country_flag = SPR_spanish_elections_flag
			NOT = { has_global_flag = spanish_civil_war }
		}

		timeout_effect = {
			789 = {
				if = {
					limit = {
						ROOT = { has_completed_focus = SPA_a_great_spain }
						date < 1936.5.2
					}
					set_state_flag = { flag = SPR_ai_recently_expanded_influence_flag value = 1 days = 45 }
				}
				if = {
					limit = {
						ROOT = { has_completed_focus = SPA_a_great_spain }
						date > 1936.5.1
						date < 1936.8.10
					}
					set_state_flag = { flag = SPR_ai_recently_expanded_influence_flag value = 1 days = 30 }
				}
				if = {
					limit = {
						ROOT = { has_completed_focus = SPA_a_great_spain }
						date > 1936.8.9
						date < 1936.10.2
					}
					set_state_flag = { flag = SPR_ai_recently_expanded_influence_flag value = 1 days = 21 }
				}
				if = {
					limit = {
						ROOT = { has_completed_focus = SPA_a_great_spain }
						date > 1936.10.1
					}
					set_state_flag = { flag = SPR_ai_recently_expanded_influence_flag value = 1 days = 15 }
				}
				if = {
					limit = {
						ROOT = { has_completed_focus = SPR_the_popular_front }
						date < 1936.7.20
					}
					set_state_flag = { flag = SPR_ai_recently_expanded_influence_flag value = 1 days = 15 }
				}
				if = {
					limit = {
						ROOT = { has_completed_focus = SPR_the_popular_front }
						date > 1936.7.19
						date < 1936.9.16
					}
					set_state_flag = { flag = SPR_ai_recently_expanded_influence_flag value = 1 days = 30 }
				}
				if = {
					limit = {
						ROOT = { has_completed_focus = SPR_the_popular_front }
						date > 1936.9.15
					}
					set_state_flag = { flag = SPR_ai_recently_expanded_influence_flag value = 1 days = 45 }
				}
			}
			if = {
				limit = {
					has_completed_focus = SPR_the_popular_front
				}
				789 = {
					custom_effect_tooltip = SPA_expand_influence_nationalists_tt
					SPA_garrison_control_tooltip = yes
				}
				hidden_effect = {
					789 = {
						if = {
							limit = { check_variable = { SPA_garrison_control < 4 } }
							
							add_to_variable = { var = SPA_garrison_control value = 1 }
							SPR = { add_to_variable = { var = spa_civil_war_divisions_counter_var value = 1 } }
							SPR = { subtract_from_variable = { var = spr_civil_war_divisions_counter_var value = 1 } }
						}
						SPR_garrison_control_cost_calculation = yes
					}
					if = {
						limit = {
							date < 1936.7.20
						}
						country_event = { id = lar_spain.5 days = 3 random_days = 5 }	#added this, since player can never achieve historical starting borders, but AI magically can! - Fantom
					}
					if = {
						limit = {
							date > 1936.7.19
							date < 1936.9.16
						}
						country_event = { id = lar_spain.5 days = 5 random_days = 10 }
					}
					if = {
						limit = {
							date > 1936.9.15
						}
						country_event = { id = lar_spain.5 days = 15 random_days = 15 }
					}
				}
			}
			if = {
				limit = {
					has_completed_focus = SPA_a_great_spain
				}
				789 = {
					custom_effect_tooltip = SPR_expand_influence_republicans_tt
					SPA_garrison_control_tooltip = yes
					SPA_garrison_control_cost_calculation = yes
				}
				hidden_effect = {
					789 = {
						subtract_from_variable = { var = SPA_garrison_control value = 1 }
						SPR = { subtract_from_variable = { var = spa_civil_war_divisions_counter_var value = 1 } }
						SPR = { add_to_variable = { var = spr_civil_war_divisions_counter_var value = 1 } }
						SPA_garrison_control_cost_calculation = yes
					}
					if = {
						limit = {
							date < 1936.5.2
						}
						country_event = { id = lar_spain.5 days = 90 random_days = 30 }
					}
					if = {
						limit = {
							date > 1936.5.1
							date < 1936.8.10
						}
						country_event = { id = lar_spain.5 days = 45 random_days = 20 }
					}
					if = {
						limit = {
							date > 1936.8.9
							date < 1936.10.2
						}
						country_event = { id = lar_spain.5 days = 1 random_days = 5 }
					}
					if = {
						limit = {
							date > 1936.10.1
						}
						country_event = { id = lar_spain.5 random_days = 3 }
					}
				}
			}
		}

	}

	SPA_expand_influence_in_the_granada_garrison_mission = {

		icon = generic_prepare_civil_war

		allowed = {
			tag = SPR
		}

		available = {
			hidden_trigger = { always = no }
		}

		highlight_states = {
			highlight_state_targets = {
				state = 173
			} 
		}

		on_map_mode = map_and_decisions_view

		fire_only_once = no

		days_mission_timeout = 14

		is_good = no

		cancel_if_not_visible = yes

		activation = {
			always = no
		}

		visible = {
			tag = SPR
			has_country_flag = SPR_spanish_elections_flag
			NOT = { has_global_flag = spanish_civil_war }
		}

		timeout_effect = {
			173 = {
				if = {
					limit = {
						ROOT = { has_completed_focus = SPA_a_great_spain }
						date < 1936.5.2
					}
					set_state_flag = { flag = SPR_ai_recently_expanded_influence_flag value = 1 days = 45 }
				}
				if = {
					limit = {
						ROOT = { has_completed_focus = SPA_a_great_spain }
						date > 1936.5.1
						date < 1936.8.10
					}
					set_state_flag = { flag = SPR_ai_recently_expanded_influence_flag value = 1 days = 30 }
				}
				if = {
					limit = {
						ROOT = { has_completed_focus = SPA_a_great_spain }
						date > 1936.8.9
						date < 1936.10.2
					}
					set_state_flag = { flag = SPR_ai_recently_expanded_influence_flag value = 1 days = 21 }
				}
				if = {
					limit = {
						ROOT = { has_completed_focus = SPA_a_great_spain }
						date > 1936.10.1
					}
					set_state_flag = { flag = SPR_ai_recently_expanded_influence_flag value = 1 days = 15 }
				}
				if = {
					limit = {
						ROOT = { has_completed_focus = SPR_the_popular_front }
						date < 1936.7.20
					}
					set_state_flag = { flag = SPR_ai_recently_expanded_influence_flag value = 1 days = 15 }
				}
				if = {
					limit = {
						ROOT = { has_completed_focus = SPR_the_popular_front }
						date > 1936.7.19
						date < 1936.9.16
					}
					set_state_flag = { flag = SPR_ai_recently_expanded_influence_flag value = 1 days = 30 }
				}
				if = {
					limit = {
						ROOT = { has_completed_focus = SPR_the_popular_front }
						date > 1936.9.15
					}
					set_state_flag = { flag = SPR_ai_recently_expanded_influence_flag value = 1 days = 45 }
				}
			}
			if = {
				limit = {
					has_completed_focus = SPR_the_popular_front
				}
				173 = {
					custom_effect_tooltip = SPA_expand_influence_nationalists_tt
					SPA_garrison_control_tooltip = yes
				}
				hidden_effect = {
					173 = {
						if = {
							limit = { check_variable = { SPA_garrison_control < 4 } }
							
							add_to_variable = { var = SPA_garrison_control value = 1 }
							SPR = { add_to_variable = { var = spa_civil_war_divisions_counter_var value = 1 } }
							SPR = { subtract_from_variable = { var = spr_civil_war_divisions_counter_var value = 1 } }
						}
						SPR_garrison_control_cost_calculation = yes
					}
					if = {
						limit = {
							date < 1936.7.20
						}
						country_event = { id = lar_spain.5 days = 3 random_days = 5 }	#added this, since player can never achieve historical starting borders, but AI magically can! - Fantom
					}
					if = {
						limit = {
							date > 1936.7.19
							date < 1936.9.16
						}
						country_event = { id = lar_spain.5 days = 5 random_days = 10 }
					}
					if = {
						limit = {
							date > 1936.9.15
						}
						country_event = { id = lar_spain.5 days = 15 random_days = 15 }
					}
				}
			}
			if = {
				limit = {
					has_completed_focus = SPA_a_great_spain
				}
				173 = {
					custom_effect_tooltip = SPR_expand_influence_republicans_tt
					SPA_garrison_control_tooltip = yes
					SPA_garrison_control_cost_calculation = yes
				}
				hidden_effect = {
					173 = {
						subtract_from_variable = { var = SPA_garrison_control value = 1 }
						SPR = { subtract_from_variable = { var = spa_civil_war_divisions_counter_var value = 1 } }
						SPR = { add_to_variable = { var = spr_civil_war_divisions_counter_var value = 1 } }
						SPA_garrison_control_cost_calculation = yes
					}
					if = {
						limit = {
							date < 1936.5.2
						}
						country_event = { id = lar_spain.5 days = 90 random_days = 30 }
					}
					if = {
						limit = {
							date > 1936.5.1
							date < 1936.8.10
						}
						country_event = { id = lar_spain.5 days = 45 random_days = 20 }
					}
					if = {
						limit = {
							date > 1936.8.9
							date < 1936.10.2
						}
						country_event = { id = lar_spain.5 days = 1 random_days = 5 }
					}
					if = {
						limit = {
							date > 1936.10.1
						}
						country_event = { id = lar_spain.5 random_days = 3 }
					}
				}
			}
		}

	}

}

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

SPR_civil_war_offensives = {

	SPA_galicia_offensive = {

		icon = hol_draw_up_staff_plans

		allowed = {
			original_tag = SPR
		}

		available = {
			NOT = { has_full_control_of_state = 171 }
			NOT = { has_active_mission = SPR_preparing_offensive }
			171 = {
				has_state_flag = SPR_unplanned_offensive_flag
				OR = {
					is_controlled_by = ROOT
					any_neighbor_state = {
						is_controlled_by = ROOT
					}
				}
			}
		}

		highlight_states = {
			highlight_state_targets = {
				state = 171
			}
			highlight_color_before_active = 3
			highlight_color_while_active = 2
		}


		on_map_mode = map_only

		cost = 0

		fire_only_once = yes

		days_remove = 14

		modifier = {
			
		}

		visible = {
			original_tag = SPR
			has_global_flag = spanish_civil_war
			NOT = { has_global_flag = scw_over }
			171 = { has_state_flag = SPR_unplanned_offensive_flag }
		}

		complete_effect = {
			activate_mission = SPR_preparing_offensive
			set_country_flag = SPR_preparing_offensive_in_progress_flag
			every_other_country = {
				limit = {
					original_tag = SPR
				}
				activate_mission = SPA_galicia_offensive_mission
			}
		}

		remove_effect = {
			171 = {
				clr_state_flag = SPR_unplanned_offensive_flag
				remove_province_modifier = {
					static_modifiers = { unplanned_offensive }
					province = {
						all_provinces = yes
					}
				}
			}
			if = {
				limit = {
					has_completed_focus = SPA_tackle_the_vulnerable_fronts
					171 = { is_controlled_by = SPD }
				}
				add_timed_idea = { idea = SPA_anti_republican_offensive days = 30 }
			}
			if = {
				limit = {
					OR = {
						has_completed_focus = SPA_tackle_the_vulnerable_fronts
						has_completed_focus = SPR_take_the_initiative
					}
					171 = { is_controlled_by = SPC }
				}
				add_timed_idea = { idea = SPA_anti_anarchist_offensive days = 30 }
			}
			if = {
				limit = {
					OR = {
						has_completed_focus = SPA_tackle_the_vulnerable_fronts
						has_completed_focus = SPR_take_the_initiative
					}
					171 = { is_controlled_by = SPB }
				}
				add_timed_idea = { idea = SPA_anti_carlist_offensive days = 30 }
			}
			if = {
				limit = {
					has_completed_focus = SPR_take_the_initiative
					171 = { is_controlled_by = SPA }
				}
				add_timed_idea = { idea = SPR_anti_nationalist_offensive days = 30 }
			}
		}

		ai_will_do = {
			base = 0.1
			modifier = {
				factor = 0
				has_full_control_of_state = 171
			}
			modifier = {
				factor = 10
				OR = {
					tag = SPA
					tag = SPB
				}
			}
			modifier = {
				factor = 10
				divisions_in_state = {
					state = 171
					size > 0
				}
				NOT = {
					has_full_control_of_state = 171
				}
			}
			modifier = {
				factor = 0
				original_tag = SPR
				surrender_progress > 0.15	#losing war, no offensives
				any_enemy_country = {		#go defensive with superior enemy
					strength_ratio = {
						tag = ROOT
						ratio > 1.2
					}
				}
			}
		}
	}

	SPA_asturias_offensive = {

		icon = hol_draw_up_staff_plans

		allowed = {
			original_tag = SPR
		}

		available = {
			NOT = { has_full_control_of_state = 790 }
			NOT = { has_active_mission = SPR_preparing_offensive }
			790 = {
				has_state_flag = SPR_unplanned_offensive_flag
				OR = {
					is_controlled_by = ROOT
					any_neighbor_state = {
						is_controlled_by = ROOT
					}
				}
			}
		}

		highlight_states = {
			highlight_state_targets = {
				state = 790
			} 
			highlight_color_before_active = 3
			highlight_color_while_active = 2
		}

		on_map_mode = map_only

		cost = 0

		fire_only_once = yes

		days_remove = 14

		modifier = {
			
		}

		visible = {
			original_tag = SPR
			has_global_flag = spanish_civil_war
			NOT = { has_global_flag = scw_over }
			790 = { has_state_flag = SPR_unplanned_offensive_flag }
		}

		complete_effect = {
			activate_mission = SPR_preparing_offensive
			set_country_flag = SPR_preparing_offensive_in_progress_flag
			every_other_country = {
				limit = {
					original_tag = SPR
				}
				activate_mission = SPA_asturias_offensive_mission
			}
		}

		remove_effect = {
			790 = {
				clr_state_flag = SPR_unplanned_offensive_flag
				remove_province_modifier = {
					static_modifiers = { unplanned_offensive }
					province = {
						all_provinces = yes
					}
				}
			}
			if = {
				limit = {
					has_completed_focus = SPA_tackle_the_vulnerable_fronts
					790 = { is_controlled_by = SPR }
				}
				add_timed_idea = { idea = SPA_anti_republican_offensive days = 30 }
			}
			if = {
				limit = {
					has_completed_focus = SPA_tackle_the_vulnerable_fronts
					790 = { is_controlled_by = SPC }
				}
				add_timed_idea = { idea = SPA_anti_anarchist_offensive days = 30 }
			}
			if = {
				limit = {
					has_completed_focus = SPA_tackle_the_vulnerable_fronts
					790 = { is_controlled_by = SPB }
				}
				add_timed_idea = { idea = SPA_anti_carlist_offensive days = 30 }
			}
		}

		ai_will_do = {
			base = 0.1
			modifier = {
				factor = 0
				has_full_control_of_state = 790
			}
			modifier = {
				factor = 10
				OR = {
					tag = SPA
					tag = SPB
				}
			}
			modifier = {
				factor = 10
				divisions_in_state = {
					state = 790
					size > 0
				}
				NOT = {
					has_full_control_of_state = 790
				}
			}
			modifier = {
				factor = 100
				tag = SPA
				NOT = {
					controls_state = 790
				}
				OR = {
					AND = {
						is_historical_focus_on = yes
						has_game_rule = {
							rule = SPR_ai_behavior 
							option = DEFAULT
						}
					}
					has_country_flag = SPR_AI_RANDOM_NATIONALIST_HISTORICAL
					has_game_rule = {
						rule = SPR_ai_behavior 
						option = NATIONALIST_HISTORICAL
					}
				}
			}
			modifier = {
				factor = 0
				original_tag = SPR
				surrender_progress > 0.15	#losing war, no offensives
				any_enemy_country = {		#go defensive with superior enemy
					strength_ratio = {
						tag = ROOT
						ratio > 1.2
					}
				}
			}
		}
	}

	SPA_leon_offensive = {

		icon = hol_draw_up_staff_plans

		allowed = {
			original_tag = SPR
		}

		available = {
			NOT = { has_full_control_of_state = 174 }
			NOT = { has_active_mission = SPR_preparing_offensive }
			174 = {
				has_state_flag = SPR_unplanned_offensive_flag
				OR = {
					is_controlled_by = ROOT
					any_neighbor_state = {
						is_controlled_by = ROOT
					}
				}
			}
		}

		highlight_states = {
			highlight_state_targets = {
				state = 174
			} 
			highlight_color_before_active = 3
			highlight_color_while_active = 2
		}

		on_map_mode = map_only

		cost = 0

		fire_only_once = yes

		days_remove = 14

		modifier = {
			
		}

		visible = {
			original_tag = SPR
			has_global_flag = spanish_civil_war
			NOT = { has_global_flag = scw_over }
			174 = { has_state_flag = SPR_unplanned_offensive_flag }
		}

		complete_effect = {
			activate_mission = SPR_preparing_offensive
			set_country_flag = SPR_preparing_offensive_in_progress_flag
			every_other_country = {
				limit = {
					original_tag = SPR
				}
				activate_mission = SPA_leon_offensive_mission
			}
		}

		remove_effect = {
			174 = {
				clr_state_flag = SPR_unplanned_offensive_flag
				remove_province_modifier = {
					static_modifiers = { unplanned_offensive }
					province = {
						all_provinces = yes
					}
				}
			}
			if = {
				limit = {
					has_completed_focus = SPA_tackle_the_vulnerable_fronts
					174 = { is_controlled_by = SPR }
				}
				add_timed_idea = { idea = SPA_anti_republican_offensive days = 30 }
			}
			if = {
				limit = {
					has_completed_focus = SPA_tackle_the_vulnerable_fronts
					174 = { is_controlled_by = SPC }
				}
				add_timed_idea = { idea = SPA_anti_anarchist_offensive days = 30 }
			}
			if = {
				limit = {
					has_completed_focus = SPA_tackle_the_vulnerable_fronts
					174 = { is_controlled_by = SPB }
				}
				add_timed_idea = { idea = SPA_anti_carlist_offensive days = 30 }
			}
		}

		ai_will_do = {
			base = 0.1
			modifier = {
				factor = 0
				has_full_control_of_state = 174
			}
			modifier = {
				factor = 10
				OR = {
					tag = SPA
					tag = SPB
				}
			}
			modifier = {
				factor = 10
				divisions_in_state = {
					state = 174
					size > 0
				}
				NOT = {
					has_full_control_of_state = 174
				}
			}
			modifier = {
				factor = 0
				original_tag = SPR
				surrender_progress > 0.15	#losing war, no offensives
				any_enemy_country = {		#go defensive with superior enemy
					strength_ratio = {
						tag = ROOT
						ratio > 1.2
					}
				}
			}
		}
	}

	SPA_valladolid_offensive = {

		icon = hol_draw_up_staff_plans

		allowed = {
			original_tag = SPR
		}

		available = {
			NOT = { has_full_control_of_state = 791 }
			NOT = { has_active_mission = SPR_preparing_offensive }
			791 = {
				has_state_flag = SPR_unplanned_offensive_flag
				OR = {
					is_controlled_by = ROOT
					any_neighbor_state = {
						is_controlled_by = ROOT
					}
				}
			}
		}

		highlight_states = {
			highlight_state_targets = {
				state = 791
			} 
			highlight_color_before_active = 3
			highlight_color_while_active = 2
		}


		on_map_mode = map_only

		cost = 0

		fire_only_once = yes

		days_remove = 14

		modifier = {
			
		}

		visible = {
			original_tag = SPR
			has_global_flag = spanish_civil_war
			NOT = { has_global_flag = scw_over }
			791 = { has_state_flag = SPR_unplanned_offensive_flag }
		}

		complete_effect = {
			activate_mission = SPR_preparing_offensive
			set_country_flag = SPR_preparing_offensive_in_progress_flag
			every_other_country = {
				limit = {
					original_tag = SPR
				}
				activate_mission = SPA_valladolid_offensive_mission
			}
		}

		remove_effect = {
			791 = {
				clr_state_flag = SPR_unplanned_offensive_flag
				remove_province_modifier = {
					static_modifiers = { unplanned_offensive }
					province = {
						all_provinces = yes
					}
				}
			}
			if = {
				limit = {
					has_completed_focus = SPA_tackle_the_vulnerable_fronts
					791 = { is_controlled_by = SPR }
				}
				add_timed_idea = { idea = SPA_anti_republican_offensive days = 30 }
			}
			if = {
				limit = {
					has_completed_focus = SPA_tackle_the_vulnerable_fronts
					791 = { is_controlled_by = SPC }
				}
				add_timed_idea = { idea = SPA_anti_anarchist_offensive days = 30 }
			}
			if = {
				limit = {
					has_completed_focus = SPA_tackle_the_vulnerable_fronts
					791 = { is_controlled_by = SPB }
				}
				add_timed_idea = { idea = SPA_anti_carlist_offensive days = 30 }
			}
		}

		ai_will_do = {
			base = 0.1
			modifier = {
				factor = 0
				has_full_control_of_state = 791
			}
			modifier = {
				factor = 10
				OR = {
					tag = SPA
					tag = SPB
				}
			}
			modifier = {
				factor = 10
				divisions_in_state = {
					state = 791
					size > 0
				}
				NOT = {
					has_full_control_of_state = 791
				}
			}
			modifier = {
				factor = 0
				original_tag = SPR
				surrender_progress > 0.15	#losing war, no offensives
				any_enemy_country = {		#go defensive with superior enemy
					strength_ratio = {
						tag = ROOT
						ratio > 1.2
					}
				}
			}
		}
	}

	SPA_burgos_offensive = {

		icon = hol_draw_up_staff_plans

		allowed = {
			original_tag = SPR
		}

		available = {
			NOT = { has_full_control_of_state = 176 }
			NOT = { has_active_mission = SPR_preparing_offensive }
			176 = {
				has_state_flag = SPR_unplanned_offensive_flag
				OR = {
					is_controlled_by = ROOT
					any_neighbor_state = {
						is_controlled_by = ROOT
					}
				}
			}
		}

		highlight_states = {
			highlight_state_targets = {
				state = 176
			} 
			highlight_color_before_active = 3
			highlight_color_while_active = 2
		}

		on_map_mode = map_only

		cost = 0

		fire_only_once = yes

		days_remove = 14

		modifier = {
			
		}

		visible = {
			original_tag = SPR
			has_global_flag = spanish_civil_war
			NOT = { has_global_flag = scw_over }
			176 = { has_state_flag = SPR_unplanned_offensive_flag }
		}

		complete_effect = {
			activate_mission = SPR_preparing_offensive
			set_country_flag = SPR_preparing_offensive_in_progress_flag
			every_other_country = {
				limit = {
					original_tag = SPR
				}
				activate_mission = SPA_burgos_offensive_mission
			}
		}

		remove_effect = {
			176 = {
				clr_state_flag = SPR_unplanned_offensive_flag
				remove_province_modifier = {
					static_modifiers = { unplanned_offensive }
					province = {
						all_provinces = yes
					}
				}
			}
			if = {
				limit = {
					has_completed_focus = SPA_tackle_the_vulnerable_fronts
					176 = { is_controlled_by = SPR }
				}
				add_timed_idea = { idea = SPA_anti_republican_offensive days = 30 }
			}
			if = {
				limit = {
					has_completed_focus = SPA_tackle_the_vulnerable_fronts
					176 = { is_controlled_by = SPC }
				}
				add_timed_idea = { idea = SPA_anti_anarchist_offensive days = 30 }
			}
			if = {
				limit = {
					has_completed_focus = SPA_tackle_the_vulnerable_fronts
					176 = { is_controlled_by = SPB }
				}
				add_timed_idea = { idea = SPA_anti_carlist_offensive days = 30 }
			}
		}

		ai_will_do = {
			base = 0.1
			modifier = {
				factor = 0
				has_full_control_of_state = 176
			}
			modifier = {
				factor = 10
				OR = {
					tag = SPA
					tag = SPB
				}
			}
			modifier = {
				factor = 10
				divisions_in_state = {
					state = 176
					size > 0
				}
				NOT = {
					has_full_control_of_state = 176
				}
			}
			modifier = {
				factor = 100
				tag = SPA
				NOT = {
					controls_state = 176
				}
				OR = {
					AND = {
						is_historical_focus_on = yes
						has_game_rule = {
							rule = SPR_ai_behavior 
							option = DEFAULT
						}
					}
					has_country_flag = SPR_AI_RANDOM_NATIONALIST_HISTORICAL
					has_game_rule = {
						rule = SPR_ai_behavior 
						option = NATIONALIST_HISTORICAL
					}
				}
			}
			modifier = {
				factor = 0
				original_tag = SPR
				surrender_progress > 0.15	#losing war, no offensives
				any_enemy_country = {		#go defensive with superior enemy
					strength_ratio = {
						tag = ROOT
						ratio > 1.2
					}
				}
			}
		}
	}

	SPA_pais_vasco_offensive = {

		icon = hol_draw_up_staff_plans

		allowed = {
			original_tag = SPR
		}

		available = {
			NOT = { has_full_control_of_state = 792 }
			NOT = { has_active_mission = SPR_preparing_offensive }
			792 = {
				has_state_flag = SPR_unplanned_offensive_flag
				OR = {
					is_controlled_by = ROOT
					any_neighbor_state = {
						is_controlled_by = ROOT
					}
				}
			}
		}

		highlight_states = {
			highlight_state_targets = {
				state = 792
			} 
			highlight_color_before_active = 3
			highlight_color_while_active = 2
		}

		on_map_mode = map_only

		cost = 0

		fire_only_once = yes

		days_remove = 14

		modifier = {
			
		}

		visible = {
			original_tag = SPR
			has_global_flag = spanish_civil_war
			NOT = { has_global_flag = scw_over }
			792 = { has_state_flag = SPR_unplanned_offensive_flag }
		}

		complete_effect = {
			activate_mission = SPR_preparing_offensive
			set_country_flag = SPR_preparing_offensive_in_progress_flag
			every_other_country = {
				limit = {
					original_tag = SPR
				}
				activate_mission = SPA_pais_vasco_offensive_mission
			}
		}

		remove_effect = {
			792 = {
				clr_state_flag = SPR_unplanned_offensive_flag
				remove_province_modifier = {
					static_modifiers = { unplanned_offensive }
					province = {
						all_provinces = yes
					}
				}
			}
			if = {
				limit = {
					has_completed_focus = SPA_tackle_the_vulnerable_fronts
					792 = { is_controlled_by = SPR }
				}
				add_timed_idea = { idea = SPA_anti_republican_offensive days = 30 }
			}
			if = {
				limit = {
					has_completed_focus = SPA_tackle_the_vulnerable_fronts
					792 = { is_controlled_by = SPC }
				}
				add_timed_idea = { idea = SPA_anti_anarchist_offensive days = 30 }
			}
			if = {
				limit = {
					has_completed_focus = SPA_tackle_the_vulnerable_fronts
					792 = { is_controlled_by = SPB }
				}
				add_timed_idea = { idea = SPA_anti_carlist_offensive days = 30 }
			}
		}

		ai_will_do = {
			base = 0.1
			modifier = {
				factor = 0
				has_full_control_of_state = 792
			}
			modifier = {
				factor = 10
				OR = {
					tag = SPA
					tag = SPB
				}
			}
			modifier = {
				factor = 10
				divisions_in_state = {
					state = 792
					size > 0
				}
				NOT = {
					has_full_control_of_state = 792
				}
			}
			modifier = {
				factor = 200
				tag = SPA
				NOT = {
					controls_state = 792
				}
				OR = {
					AND = {
						is_historical_focus_on = yes
						has_game_rule = {
							rule = SPR_ai_behavior 
							option = DEFAULT
						}
					}
					has_country_flag = SPR_AI_RANDOM_NATIONALIST_HISTORICAL
					has_game_rule = {
						rule = SPR_ai_behavior 
						option = NATIONALIST_HISTORICAL
					}
				}
			}
			modifier = {
				factor = 0
				original_tag = SPR
				surrender_progress > 0.15	#losing war, no offensives
				any_enemy_country = {		#go defensive with superior enemy
					strength_ratio = {
						tag = ROOT
						ratio > 1.2
					}
				}
			}
		}
	}

	SPA_navarra_offensive = {

		icon = hol_draw_up_staff_plans

		allowed = {
			original_tag = SPR
		}

		available = {
			NOT = { has_full_control_of_state = 172 }
			NOT = { has_active_mission = SPR_preparing_offensive }
			172 = {
				has_state_flag = SPR_unplanned_offensive_flag
				OR = {
					is_controlled_by = ROOT
					any_neighbor_state = {
						is_controlled_by = ROOT
					}
				}
			}
		}

		highlight_states = {
			highlight_state_targets = {
				state = 172
			} 
			highlight_color_before_active = 3
			highlight_color_while_active = 2
		}

		on_map_mode = map_only

		cost = 0

		fire_only_once = yes

		days_remove = 14

		modifier = {
			
		}

		visible = {
			original_tag = SPR
			has_global_flag = spanish_civil_war
			NOT = { has_global_flag = scw_over }
			172 = { has_state_flag = SPR_unplanned_offensive_flag }
		}

		complete_effect = {
			activate_mission = SPR_preparing_offensive
			set_country_flag = SPR_preparing_offensive_in_progress_flag
			every_other_country = {
				limit = {
					original_tag = SPR
				}
				activate_mission = SPA_navarra_offensive_mission
			}
		}

		remove_effect = {
			172 = {
				clr_state_flag = SPR_unplanned_offensive_flag
				remove_province_modifier = {
					static_modifiers = { unplanned_offensive }
					province = {
						all_provinces = yes
					}
				}
			}
			if = {
				limit = {
					has_completed_focus = SPA_tackle_the_vulnerable_fronts
					172 = { is_controlled_by = SPR }
				}
				add_timed_idea = { idea = SPA_anti_republican_offensive days = 30 }
			}
			if = {
				limit = {
					has_completed_focus = SPA_tackle_the_vulnerable_fronts
					172 = { is_controlled_by = SPC }
				}
				add_timed_idea = { idea = SPA_anti_anarchist_offensive days = 30 }
			}
			if = {
				limit = {
					has_completed_focus = SPA_tackle_the_vulnerable_fronts
					172 = { is_controlled_by = SPB }
				}
				add_timed_idea = { idea = SPA_anti_carlist_offensive days = 30 }
			}
		}

		ai_will_do = {
			base = 0.1
			modifier = {
				factor = 0
				has_full_control_of_state = 172
			}
			modifier = {
				factor = 10
				OR = {
					tag = SPA
					tag = SPB
				}
			}
			modifier = {
				factor = 10
				divisions_in_state = {
					state = 172
					size > 0
				}
				NOT = {
					has_full_control_of_state = 172
				}
			}
			modifier = {
				factor = 100
				tag = SPA
				NOT = {
					controls_state = 172
				}
				OR = {
					AND = {
						is_historical_focus_on = yes
						has_game_rule = {
							rule = SPR_ai_behavior 
							option = DEFAULT
						}
					}
					has_country_flag = SPR_AI_RANDOM_NATIONALIST_HISTORICAL
					has_game_rule = {
						rule = SPR_ai_behavior 
						option = NATIONALIST_HISTORICAL
					}
				}
			}
			modifier = {
				factor = 0
				original_tag = SPR
				surrender_progress > 0.15	#losing war, no offensives
				any_enemy_country = {		#go defensive with superior enemy
					strength_ratio = {
						tag = ROOT
						ratio > 1.2
					}
				}
			}
		}
	}

	SPA_western_aragon_offensive = {

		icon = hol_draw_up_staff_plans

		allowed = {
			original_tag = SPR
		}

		available = {
			NOT = { has_full_control_of_state = 166 }
			NOT = { has_active_mission = SPR_preparing_offensive }
			166 = {
				has_state_flag = SPR_unplanned_offensive_flag
				OR = {
					is_controlled_by = ROOT
					any_neighbor_state = {
						is_controlled_by = ROOT
					}
				}
			}
		}

		highlight_states = {
			highlight_state_targets = {
				state = 166
			} 
			highlight_color_before_active = 3
			highlight_color_while_active = 2
		}

		on_map_mode = map_only

		cost = 0

		fire_only_once = yes

		days_remove = 14

		modifier = {
			
		}

		visible = {
			original_tag = SPR
			has_global_flag = spanish_civil_war
			NOT = { has_global_flag = scw_over }
			166 = { has_state_flag = SPR_unplanned_offensive_flag }
		}

		complete_effect = {
			activate_mission = SPR_preparing_offensive
			set_country_flag = SPR_preparing_offensive_in_progress_flag
			every_other_country = {
				limit = {
					original_tag = SPR
				}
				activate_mission = SPA_western_aragon_offensive_mission
			}
		}

		remove_effect = {
			166 = {
				clr_state_flag = SPR_unplanned_offensive_flag
				remove_province_modifier = {
					static_modifiers = { unplanned_offensive }
					province = {
						all_provinces = yes
					}
				}
			}
			if = {
				limit = {
					has_completed_focus = SPA_tackle_the_vulnerable_fronts
					166 = { is_controlled_by = SPR }
				}
				add_timed_idea = { idea = SPA_anti_republican_offensive days = 30 }
			}
			if = {
				limit = {
					has_completed_focus = SPA_tackle_the_vulnerable_fronts
					166 = { is_controlled_by = SPC }
				}
				add_timed_idea = { idea = SPA_anti_anarchist_offensive days = 30 }
			}
			if = {
				limit = {
					has_completed_focus = SPA_tackle_the_vulnerable_fronts
					166 = { is_controlled_by = SPB }
				}
				add_timed_idea = { idea = SPA_anti_carlist_offensive days = 30 }
			}
		}

		ai_will_do = {
			base = 0.1
			modifier = {
				factor = 0
				has_full_control_of_state = 166
			}
			modifier = {
				factor = 10
				OR = {
					tag = SPA
					tag = SPB
				}
			}
			modifier = {
				factor = 10
				divisions_in_state = {
					state = 166
					size > 0
				}
				NOT = {
					has_full_control_of_state = 166
				}
			}
			modifier = {
				factor = 100
				tag = SPA
				NOT = {
					controls_state = 166
				}
				OR = {
					AND = {
						is_historical_focus_on = yes
						has_game_rule = {
							rule = SPR_ai_behavior 
							option = DEFAULT
						}
					}
					has_country_flag = SPR_AI_RANDOM_NATIONALIST_HISTORICAL
					has_game_rule = {
						rule = SPR_ai_behavior 
						option = NATIONALIST_HISTORICAL
					}
				}
			}
			modifier = {
				factor = 0
				original_tag = SPR
				surrender_progress > 0.15	#losing war, no offensives
				any_enemy_country = {		#go defensive with superior enemy
					strength_ratio = {
						tag = ROOT
						ratio > 1.2
					}
				}
			}
		}
	}

	SPA_eastern_aragon_offensive = {

		icon = hol_draw_up_staff_plans

		allowed = {
			original_tag = SPR
		}

		available = {
			NOT = { has_full_control_of_state = 794 }
			NOT = { has_active_mission = SPR_preparing_offensive }
			794 = {
				has_state_flag = SPR_unplanned_offensive_flag
				OR = {
					is_controlled_by = ROOT
					any_neighbor_state = {
						is_controlled_by = ROOT
					}
				}
			}
		}

		highlight_states = {
			highlight_state_targets = {
				state = 794
			} 
			highlight_color_before_active = 3
			highlight_color_while_active = 2
		}

		on_map_mode = map_only

		cost = 0

		fire_only_once = yes

		days_remove = 14

		modifier = {
			
		}

		visible = {
			original_tag = SPR
			has_global_flag = spanish_civil_war
			NOT = { has_global_flag = scw_over }
			794 = { has_state_flag = SPR_unplanned_offensive_flag }
		}

		complete_effect = {
			activate_mission = SPR_preparing_offensive
			set_country_flag = SPR_preparing_offensive_in_progress_flag
			every_other_country = {
				limit = {
					original_tag = SPR
				}
				activate_mission = SPA_eastern_aragon_offensive_mission
			}
		}

		remove_effect = {
			794 = {
				clr_state_flag = SPR_unplanned_offensive_flag
				remove_province_modifier = {
					static_modifiers = { unplanned_offensive }
					province = {
						all_provinces = yes
					}
				}
			}
			if = {
				limit = {
					has_completed_focus = SPA_tackle_the_vulnerable_fronts
					794 = { is_controlled_by = SPR }
				}
				add_timed_idea = { idea = SPA_anti_republican_offensive days = 30 }
			}
			if = {
				limit = {
					has_completed_focus = SPA_tackle_the_vulnerable_fronts
					794 = { is_controlled_by = SPC }
				}
				add_timed_idea = { idea = SPA_anti_anarchist_offensive days = 30 }
			}
			if = {
				limit = {
					has_completed_focus = SPA_tackle_the_vulnerable_fronts
					794 = { is_controlled_by = SPB }
				}
				add_timed_idea = { idea = SPA_anti_carlist_offensive days = 30 }
			}
		}

		ai_will_do = {
			base = 0.1
			modifier = {
				factor = 0
				has_full_control_of_state = 794
			}
			modifier = {
				factor = 10
				OR = {
					tag = SPA
					tag = SPB
				}
			}
			modifier = {
				factor = 10
				divisions_in_state = {
					state = 794
					size > 0
				}
				NOT = {
					has_full_control_of_state = 794
				}
			}
			modifier = {
				factor = 0
				original_tag = SPR
				surrender_progress > 0.15	#losing war, no offensives
				any_enemy_country = {		#go defensive with superior enemy
					strength_ratio = {
						tag = ROOT
						ratio > 1.2
					}
				}
			}
		}
	}

	SPA_catalunya_offensive = {

		icon = hol_draw_up_staff_plans

		allowed = {
			original_tag = SPR
		}

		available = {
			NOT = { has_full_control_of_state = 165 }
			NOT = { has_active_mission = SPR_preparing_offensive }
			165 = {
				has_state_flag = SPR_unplanned_offensive_flag
				OR = {
					is_controlled_by = ROOT
					any_neighbor_state = {
						is_controlled_by = ROOT
					}
				}
			}
		}

		highlight_states = {
			highlight_state_targets = {
				state = 165
			} 
			highlight_color_before_active = 3
			highlight_color_while_active = 2
		}

		on_map_mode = map_only

		cost = 0

		fire_only_once = yes

		days_remove = 14

		modifier = {
			
		}

		visible = {
			original_tag = SPR
			has_global_flag = spanish_civil_war
			NOT = { has_global_flag = scw_over }
			165 = { has_state_flag = SPR_unplanned_offensive_flag }
		}

		complete_effect = {
			activate_mission = SPR_preparing_offensive
			set_country_flag = SPR_preparing_offensive_in_progress_flag
			every_other_country = {
				limit = {
					original_tag = SPR
				}
				activate_mission = SPA_catalunya_offensive_mission
			}
		}

		remove_effect = {
			165 = {
				clr_state_flag = SPR_unplanned_offensive_flag
				remove_province_modifier = {
					static_modifiers = { unplanned_offensive }
					province = {
						all_provinces = yes
					}
				}
			}
			if = {
				limit = {
					has_completed_focus = SPA_tackle_the_vulnerable_fronts
					165 = { is_controlled_by = SPR }
				}
				add_timed_idea = { idea = SPA_anti_republican_offensive days = 30 }
			}
			if = {
				limit = {
					has_completed_focus = SPA_tackle_the_vulnerable_fronts
					165 = { is_controlled_by = SPC }
				}
				add_timed_idea = { idea = SPA_anti_anarchist_offensive days = 30 }
			}
			if = {
				limit = {
					has_completed_focus = SPA_tackle_the_vulnerable_fronts
					165 = { is_controlled_by = SPB }
				}
				add_timed_idea = { idea = SPA_anti_carlist_offensive days = 30 }
			}
		}

		ai_will_do = {
			base = 0.1
			modifier = {
				factor = 0
				has_full_control_of_state = 165
			}
			modifier = {
				factor = 10
				OR = {
					tag = SPA
					tag = SPB
				}
			}
			modifier = {
				factor = 10
				divisions_in_state = {
					state = 165
					size > 0
				}
				NOT = {
					has_full_control_of_state = 165
				}
			}
			modifier = {
				factor = 0
				original_tag = SPR
				surrender_progress > 0.15	#losing war, no offensives
				any_enemy_country = {		#go defensive with superior enemy
					strength_ratio = {
						tag = ROOT
						ratio > 1.2
					}
				}
			}
		}
	}

	SPA_salamanca_offensive = {

		icon = hol_draw_up_staff_plans

		allowed = {
			original_tag = SPR
		}

		available = {
			NOT = { has_full_control_of_state = 788 }
			NOT = { has_active_mission = SPR_preparing_offensive }
			788 = {
				has_state_flag = SPR_unplanned_offensive_flag
				OR = {
					is_controlled_by = ROOT
					any_neighbor_state = {
						is_controlled_by = ROOT
					}
				}
			}
		}

		highlight_states = {
			highlight_state_targets = {
				state = 788
			} 
			highlight_color_before_active = 3
			highlight_color_while_active = 2
		}

		on_map_mode = map_only

		cost = 0

		fire_only_once = yes

		days_remove = 14

		modifier = {
			
		}

		visible = {
			original_tag = SPR
			has_global_flag = spanish_civil_war
			NOT = { has_global_flag = scw_over }
			788 = { has_state_flag = SPR_unplanned_offensive_flag }
		}

		complete_effect = {
			activate_mission = SPR_preparing_offensive
			set_country_flag = SPR_preparing_offensive_in_progress_flag
			every_other_country = {
				limit = {
					original_tag = SPR
				}
				activate_mission = SPA_salamanca_offensive_mission
			}
		}

		remove_effect = {
			788 = {
				clr_state_flag = SPR_unplanned_offensive_flag
				remove_province_modifier = {
					static_modifiers = { unplanned_offensive }
					province = {
						all_provinces = yes
					}
				}
			}
			if = {
				limit = {
					has_completed_focus = SPA_tackle_the_vulnerable_fronts
					788 = { is_controlled_by = SPR }
				}
				add_timed_idea = { idea = SPA_anti_republican_offensive days = 30 }
			}
			if = {
				limit = {
					has_completed_focus = SPA_tackle_the_vulnerable_fronts
					788 = { is_controlled_by = SPC }
				}
				add_timed_idea = { idea = SPA_anti_anarchist_offensive days = 30 }
			}
			if = {
				limit = {
					has_completed_focus = SPA_tackle_the_vulnerable_fronts
					788 = { is_controlled_by = SPB }
				}
				add_timed_idea = { idea = SPA_anti_carlist_offensive days = 30 }
			}
		}

		ai_will_do = {
			base = 0.1
			modifier = {
				factor = 0
				has_full_control_of_state = 788
			}
			modifier = {
				factor = 10
				OR = {
					tag = SPA
					tag = SPB
				}
			}
			modifier = {
				factor = 10
				divisions_in_state = {
					state = 788
					size > 0
				}
				NOT = {
					has_full_control_of_state = 788
				}
			}
			modifier = {
				factor = 0
				original_tag = SPR
				surrender_progress > 0.15	#losing war, no offensives
				any_enemy_country = {		#go defensive with superior enemy
					strength_ratio = {
						tag = ROOT
						ratio > 1.2
					}
				}
			}
		}
	}

	SPA_madrid_offensive = {

		icon = hol_draw_up_staff_plans

		allowed = {
			original_tag = SPR
		}

		available = {
			NOT = { has_full_control_of_state = 41 }
			NOT = { has_active_mission = SPR_preparing_offensive }
			41 = {
				has_state_flag = SPR_unplanned_offensive_flag
				OR = {
					is_controlled_by = ROOT
					any_neighbor_state = {
						is_controlled_by = ROOT
					}
				}
			}
		}

		highlight_states = {
			highlight_state_targets = {
				state = 41
			} 
			highlight_color_before_active = 3
			highlight_color_while_active = 2
		}

		on_map_mode = map_only

		cost = 0

		fire_only_once = yes

		days_remove = 14

		modifier = {
			
		}

		visible = {
			original_tag = SPR
			has_global_flag = spanish_civil_war
			NOT = { has_global_flag = scw_over }
			41 = { has_state_flag = SPR_unplanned_offensive_flag }
		}

		complete_effect = {
			activate_mission = SPR_preparing_offensive
			set_country_flag = SPR_preparing_offensive_in_progress_flag
			every_other_country = {
				limit = {
					original_tag = SPR
				}
				activate_mission = SPA_madrid_offensive_mission
			}
		}

		remove_effect = {
			41 = {
				clr_state_flag = SPR_unplanned_offensive_flag
				remove_province_modifier = {
					static_modifiers = { unplanned_offensive }
					province = {
						all_provinces = yes
					}
				}
			}
			if = {
				limit = {
					has_completed_focus = SPA_tackle_the_vulnerable_fronts
					41 = { is_controlled_by = SPR }
				}
				add_timed_idea = { idea = SPA_anti_republican_offensive days = 30 }
			}
			if = {
				limit = {
					has_completed_focus = SPA_tackle_the_vulnerable_fronts
					41 = { is_controlled_by = SPC }
				}
				add_timed_idea = { idea = SPA_anti_anarchist_offensive days = 30 }
			}
			if = {
				limit = {
					has_completed_focus = SPA_tackle_the_vulnerable_fronts
					41 = { is_controlled_by = SPB }
				}
				add_timed_idea = { idea = SPA_anti_carlist_offensive days = 30 }
			}
		}

		ai_will_do = {
			base = 0.1
			modifier = {
				factor = 0
				has_full_control_of_state = 41
			}
			modifier = {
				factor = 10
				OR = {
					tag = SPA
					tag = SPB
				}
			}
			modifier = {
				factor = 10
				divisions_in_state ={
					state = 41
					size > 0
				}
				NOT = {
					has_full_control_of_state = 41
				}
			}
			modifier = {
				factor = 0
				original_tag = SPR
				surrender_progress > 0.15	#losing war, no offensives
				any_enemy_country = {		#go defensive with superior enemy
					strength_ratio = {
						tag = ROOT
						ratio > 1.2
					}
				}
			}
		}
	}

	SPA_guadalajara_offensive = {

		icon = hol_draw_up_staff_plans

		allowed = {
			original_tag = SPR
		}

		available = {
			NOT = { has_full_control_of_state = 793 }
			NOT = { has_active_mission = SPR_preparing_offensive }
			793 = {
				has_state_flag = SPR_unplanned_offensive_flag
				OR = {
					is_controlled_by = ROOT
					any_neighbor_state = {
						is_controlled_by = ROOT
					}
				}
			}
		}

		highlight_states = {
			highlight_state_targets = {
				state = 793
			} 
			highlight_color_before_active = 3
			highlight_color_while_active = 2
		}

		on_map_mode = map_only

		cost = 0

		fire_only_once = yes

		days_remove = 14

		modifier = {
			
		}

		visible = {
			original_tag = SPR
			has_global_flag = spanish_civil_war
			NOT = { has_global_flag = scw_over }
			793 = { has_state_flag = SPR_unplanned_offensive_flag }
		}

		complete_effect = {
			activate_mission = SPR_preparing_offensive
			set_country_flag = SPR_preparing_offensive_in_progress_flag
			every_other_country = {
				limit = {
					original_tag = SPR
				}
				activate_mission = SPA_guadalajara_offensive_mission
			}
		}

		remove_effect = {
			793 = {
				clr_state_flag = SPR_unplanned_offensive_flag
				remove_province_modifier = {
					static_modifiers = { unplanned_offensive }
					province = {
						all_provinces = yes
					}
				}
			}
			if = {
				limit = {
					has_completed_focus = SPA_tackle_the_vulnerable_fronts
					793 = { is_controlled_by = SPR }
				}
				add_timed_idea = { idea = SPA_anti_republican_offensive days = 30 }
			}
			if = {
				limit = {
					has_completed_focus = SPA_tackle_the_vulnerable_fronts
					793 = { is_controlled_by = SPC }
				}
				add_timed_idea = { idea = SPA_anti_anarchist_offensive days = 30 }
			}
			if = {
				limit = {
					has_completed_focus = SPA_tackle_the_vulnerable_fronts
					793 = { is_controlled_by = SPB }
				}
				add_timed_idea = { idea = SPA_anti_carlist_offensive days = 30 }
			}
		}

		ai_will_do = {
			base = 0.1
			modifier = {
				factor = 0
				has_full_control_of_state = 793
			}
			modifier = {
				factor = 10
				OR = {
					tag = SPA
					tag = SPB
				}
			}
			modifier = {
				factor = 10
				divisions_in_state = {
					state = 793
					size > 0
				}
				NOT = {
					has_full_control_of_state = 793
				}
			}
			modifier = {
				factor = 0
				original_tag = SPR
				surrender_progress > 0.15	#losing war, no offensives
				any_enemy_country = {		#go defensive with superior enemy
					strength_ratio = {
						tag = ROOT
						ratio > 1.2
					}
				}
			}
		}
	}

	SPA_valencia_offensive = {

		icon = hol_draw_up_staff_plans

		allowed = {
			original_tag = SPR
		}

		available = {
			NOT = { has_full_control_of_state = 167 }
			NOT = { has_active_mission = SPR_preparing_offensive }
			167 = {
				has_state_flag = SPR_unplanned_offensive_flag
				OR = {
					is_controlled_by = ROOT
					any_neighbor_state = {
						is_controlled_by = ROOT
					}
				}
			}
		}

		highlight_states = {
			highlight_state_targets = {
				state = 167
			} 
			highlight_color_before_active = 3
			highlight_color_while_active = 2
		}

		on_map_mode = map_only

		cost = 0

		fire_only_once = yes

		days_remove = 14

		modifier = {
			
		}

		visible = {
			original_tag = SPR
			has_global_flag = spanish_civil_war
			NOT = { has_global_flag = scw_over }
			167 = { has_state_flag = SPR_unplanned_offensive_flag }
		}

		complete_effect = {
			activate_mission = SPR_preparing_offensive
			set_country_flag = SPR_preparing_offensive_in_progress_flag
			every_other_country = {
				limit = {
					original_tag = SPR
				}
				activate_mission = SPA_valencia_offensive_mission
			}
		}

		remove_effect = {
			167 = {
				clr_state_flag = SPR_unplanned_offensive_flag
				remove_province_modifier = {
					static_modifiers = { unplanned_offensive }
					province = {
						all_provinces = yes
					}
				}
			}
			if = {
				limit = {
					has_completed_focus = SPA_tackle_the_vulnerable_fronts
					167 = { is_controlled_by = SPR }
				}
				add_timed_idea = { idea = SPA_anti_republican_offensive days = 30 }
			}
			if = {
				limit = {
					has_completed_focus = SPA_tackle_the_vulnerable_fronts
					167 = { is_controlled_by = SPC }
				}
				add_timed_idea = { idea = SPA_anti_anarchist_offensive days = 30 }
			}
			if = {
				limit = {
					has_completed_focus = SPA_tackle_the_vulnerable_fronts
					167 = { is_controlled_by = SPB }
				}
				add_timed_idea = { idea = SPA_anti_carlist_offensive days = 30 }
			}
		}

		ai_will_do = {
			base = 0.1
			modifier = {
				factor = 0
				has_full_control_of_state = 167
			}
			modifier = {
				factor = 10
				OR = {
					tag = SPA
					tag = SPB
				}
			}
			modifier = {
				factor = 10
				divisions_in_state = {
					state = 167
					size > 0
				}
				NOT = {
					has_full_control_of_state = 167
				}
			}
			modifier = {
				factor = 0
				original_tag = SPR
				surrender_progress > 0.15	#losing war, no offensives
				any_enemy_country = {		#go defensive with superior enemy
					strength_ratio = {
						tag = ROOT
						ratio > 1.2
					}
				}
			}
		}
	}

	SPA_extremadura_offensive = {

		icon = hol_draw_up_staff_plans

		allowed = {
			original_tag = SPR
		}

		available = {
			NOT = { has_full_control_of_state = 170 }
			NOT = { has_active_mission = SPR_preparing_offensive }
			170 = {
				has_state_flag = SPR_unplanned_offensive_flag
				OR = {
					is_controlled_by = ROOT
					any_neighbor_state = {
						is_controlled_by = ROOT
					}
				}
			}
		}

		highlight_states = {
			highlight_state_targets = {
				state = 170
			} 
			highlight_color_before_active = 3
			highlight_color_while_active = 2
		}

		on_map_mode = map_only

		cost = 0

		fire_only_once = yes

		days_remove = 14

		modifier = {
			
		}

		visible = {
			original_tag = SPR
			has_global_flag = spanish_civil_war
			NOT = { has_global_flag = scw_over }
			170 = { has_state_flag = SPR_unplanned_offensive_flag }
		}

		complete_effect = {
			activate_mission = SPR_preparing_offensive
			set_country_flag = SPR_preparing_offensive_in_progress_flag
			every_other_country = {
				limit = {
					original_tag = SPR
				}
				activate_mission = SPA_extremadura_offensive_mission
			}
		}

		remove_effect = {
			170 = {
				clr_state_flag = SPR_unplanned_offensive_flag
				remove_province_modifier = {
					static_modifiers = { unplanned_offensive }
					province = {
						all_provinces = yes
					}
				}
			}
			if = {
				limit = {
					has_completed_focus = SPA_tackle_the_vulnerable_fronts
					170 = { is_controlled_by = SPR }
				}
				add_timed_idea = { idea = SPA_anti_republican_offensive days = 30 }
			}
			if = {
				limit = {
					has_completed_focus = SPA_tackle_the_vulnerable_fronts
					170 = { is_controlled_by = SPC }
				}
				add_timed_idea = { idea = SPA_anti_anarchist_offensive days = 30 }
			}
			if = {
				limit = {
					has_completed_focus = SPA_tackle_the_vulnerable_fronts
					170 = { is_controlled_by = SPB }
				}
				add_timed_idea = { idea = SPA_anti_carlist_offensive days = 30 }
			}
		}

		ai_will_do = {
			base = 0.1
			modifier = {
				factor = 0
				has_full_control_of_state = 170
			}
			modifier = {
				factor = 10
				OR = {
					tag = SPA
					tag = SPB
				}
			}
			modifier = {
				factor = 10
				divisions_in_state = {
					state = 170
					size > 0
				}
				NOT = {
					has_full_control_of_state = 170
				}
			}
			modifier = {
				factor = 0
				original_tag = SPR
				surrender_progress > 0.15	#losing war, no offensives
				any_enemy_country = {		#go defensive with superior enemy
					strength_ratio = {
						tag = ROOT
						ratio > 1.2
					}
				}
			}
		}
	}

	SPA_ciudad_real_offensive = {

		icon = hol_draw_up_staff_plans

		allowed = {
			original_tag = SPR
		}

		available = {
			NOT = { has_full_control_of_state = 175 }
			NOT = { has_active_mission = SPR_preparing_offensive }
			175 = {
				has_state_flag = SPR_unplanned_offensive_flag
				OR = {
					is_controlled_by = ROOT
					any_neighbor_state = {
						is_controlled_by = ROOT
					}
				}
			}
		}

		highlight_states = {
			highlight_state_targets = {
				state = 175
			} 
			highlight_color_before_active = 3
			highlight_color_while_active = 2
		}

		on_map_mode = map_only

		cost = 0

		fire_only_once = yes

		days_remove = 14

		modifier = {
			
		}

		visible = {
			original_tag = SPR
			has_global_flag = spanish_civil_war
			NOT = { has_global_flag = scw_over }
			175 = { has_state_flag = SPR_unplanned_offensive_flag }
		}

		complete_effect = {
			activate_mission = SPR_preparing_offensive
			set_country_flag = SPR_preparing_offensive_in_progress_flag
			every_other_country = {
				limit = {
					original_tag = SPR
				}
				activate_mission = SPA_ciudad_real_offensive_mission
			}
		}

		remove_effect = {
			175 = {
				clr_state_flag = SPR_unplanned_offensive_flag
				remove_province_modifier = {
					static_modifiers = { unplanned_offensive }
					province = {
						all_provinces = yes
					}
				}
			}
			if = {
				limit = {
					has_completed_focus = SPA_tackle_the_vulnerable_fronts
					175 = { is_controlled_by = SPR }
				}
				add_timed_idea = { idea = SPA_anti_republican_offensive days = 30 }
			}
			if = {
				limit = {
					has_completed_focus = SPA_tackle_the_vulnerable_fronts
					175 = { is_controlled_by = SPC }
				}
				add_timed_idea = { idea = SPA_anti_anarchist_offensive days = 30 }
			}
			if = {
				limit = {
					has_completed_focus = SPA_tackle_the_vulnerable_fronts
					175 = { is_controlled_by = SPB }
				}
				add_timed_idea = { idea = SPA_anti_carlist_offensive days = 30 }
			}
		}

		ai_will_do = {
			base = 0.1
			modifier = {
				factor = 0
				has_full_control_of_state = 175
			}
			modifier = {
				factor = 10
				OR = {
					tag = SPA
					tag = SPB
				}
			}
			modifier = {
				factor = 10
				divisions_in_state = {
					state = 175
					size > 0
				}
				NOT = {
					has_full_control_of_state = 175
				}
			}
			modifier = {
				factor = 0
				original_tag = SPR
				surrender_progress > 0.15	#losing war, no offensives
				any_enemy_country = {		#go defensive with superior enemy
					strength_ratio = {
						tag = ROOT
						ratio > 1.2
					}
				}
			}
		}
	}

	SPA_murcia_offensive = {

		icon = hol_draw_up_staff_plans

		allowed = {
			original_tag = SPR
		}

		available = {
			NOT = { has_full_control_of_state = 168 }
			NOT = { has_active_mission = SPR_preparing_offensive }
			168 = {
				has_state_flag = SPR_unplanned_offensive_flag
				OR = {
					is_controlled_by = ROOT
					any_neighbor_state = {
						is_controlled_by = ROOT
					}
				}
			}
		}

		highlight_states = {
			highlight_state_targets = {
				state = 168
			} 
			highlight_color_before_active = 3
			highlight_color_while_active = 2
		}

		on_map_mode = map_only

		cost = 0

		fire_only_once = yes

		days_remove = 14

		modifier = {
			
		}

		visible = {
			original_tag = SPR
			has_global_flag = spanish_civil_war
			NOT = { has_global_flag = scw_over }
			168 = { has_state_flag = SPR_unplanned_offensive_flag }
		}

		complete_effect = {
			activate_mission = SPR_preparing_offensive
			set_country_flag = SPR_preparing_offensive_in_progress_flag
			every_other_country = {
				limit = {
					original_tag = SPR
				}
				activate_mission = SPA_murcia_offensive_mission
			}
		}

		remove_effect = {
			168 = {
				clr_state_flag = SPR_unplanned_offensive_flag
				remove_province_modifier = {
					static_modifiers = { unplanned_offensive }
					province = {
						all_provinces = yes
					}
				}
			}
			if = {
				limit = {
					has_completed_focus = SPA_tackle_the_vulnerable_fronts
					168 = { is_controlled_by = SPR }
				}
				add_timed_idea = { idea = SPA_anti_republican_offensive days = 30 }
			}
			if = {
				limit = {
					has_completed_focus = SPA_tackle_the_vulnerable_fronts
					168 = { is_controlled_by = SPC }
				}
				add_timed_idea = { idea = SPA_anti_anarchist_offensive days = 30 }
			}
			if = {
				limit = {
					has_completed_focus = SPA_tackle_the_vulnerable_fronts
					168 = { is_controlled_by = SPB }
				}
				add_timed_idea = { idea = SPA_anti_carlist_offensive days = 30 }
			}
		}

		ai_will_do = {
			base = 0.1
			modifier = {
				factor = 0
				has_full_control_of_state = 168
			}
			modifier = {
				factor = 10
				OR = {
					tag = SPA
					tag = SPB
				}
			}
			modifier = {
				factor = 10
				divisions_in_state = {
					state = 168
					size > 0
				}
				NOT = {
					has_full_control_of_state = 168
				}
			}
			modifier = {
				factor = 0
				original_tag = SPR
				surrender_progress > 0.15	#losing war, no offensives
				any_enemy_country = {		#go defensive with superior enemy
					strength_ratio = {
						tag = ROOT
						ratio > 1.2
					}
				}
			}
		}
	}

	SPA_sevilla_offensive = {

		icon = hol_draw_up_staff_plans

		allowed = {
			original_tag = SPR
		}

		available = {
			NOT = { has_full_control_of_state = 169 }
			NOT = { has_active_mission = SPR_preparing_offensive }
			169 = {
				has_state_flag = SPR_unplanned_offensive_flag
				OR = {
					is_controlled_by = ROOT
					any_neighbor_state = {
						is_controlled_by = ROOT
					}
				}
			}
		}

		highlight_states = {
			highlight_state_targets = {
				state = 169
			} 
			highlight_color_before_active = 3
			highlight_color_while_active = 2
		}

		on_map_mode = map_only

		cost = 0

		fire_only_once = yes

		days_remove = 14

		modifier = {
			
		}

		visible = {
			original_tag = SPR
			has_global_flag = spanish_civil_war
			NOT = { has_global_flag = scw_over }
			169 = { has_state_flag = SPR_unplanned_offensive_flag }
		}

		complete_effect = {
			activate_mission = SPR_preparing_offensive
			set_country_flag = SPR_preparing_offensive_in_progress_flag
			every_other_country = {
				limit = {
					original_tag = SPR
				}
				activate_mission = SPA_sevilla_offensive_mission
			}
		}

		remove_effect = {
			169 = {
				clr_state_flag = SPR_unplanned_offensive_flag
				remove_province_modifier = {
					static_modifiers = { unplanned_offensive }
					province = {
						all_provinces = yes
					}
				}
			}
			if = {
				limit = {
					has_completed_focus = SPA_tackle_the_vulnerable_fronts
					169 = { is_controlled_by = SPR }
				}
				add_timed_idea = { idea = SPA_anti_republican_offensive days = 30 }
			}
			if = {
				limit = {
					has_completed_focus = SPA_tackle_the_vulnerable_fronts
					169 = { is_controlled_by = SPC }
				}
				add_timed_idea = { idea = SPA_anti_anarchist_offensive days = 30 }
			}
			if = {
				limit = {
					has_completed_focus = SPA_tackle_the_vulnerable_fronts
					169 = { is_controlled_by = SPB }
				}
				add_timed_idea = { idea = SPA_anti_carlist_offensive days = 30 }
			}
		}

		ai_will_do = {
			base = 0.1
			modifier = {
				factor = 0
				has_full_control_of_state = 169
			}
			modifier = {
				factor = 10
				OR = {
					tag = SPA
					tag = SPB
				}
			}
			modifier = {
				factor = 10
				divisions_in_state = {
					state = 169
					size > 0
				}
				NOT = {
					has_full_control_of_state = 169
				}
			}
			modifier = {
				factor = 0
				original_tag = SPR
				surrender_progress > 0.15	#losing war, no offensives
				any_enemy_country = {		#go defensive with superior enemy
					strength_ratio = {
						tag = ROOT
						ratio > 1.2
					}
				}
			}
		}
	}

	SPA_cordoba_offensive = {

		icon = hol_draw_up_staff_plans

		allowed = {
			original_tag = SPR
		}

		available = {
			NOT = { has_full_control_of_state = 789 }
			NOT = { has_active_mission = SPR_preparing_offensive }
			789 = {
				has_state_flag = SPR_unplanned_offensive_flag
				OR = {
					is_controlled_by = ROOT
					any_neighbor_state = {
						is_controlled_by = ROOT
					}
				}
			}
		}

		highlight_states = {
			highlight_state_targets = {
				state = 789
			} 
			highlight_color_before_active = 3
			highlight_color_while_active = 2
		}

		on_map_mode = map_only

		cost = 0

		fire_only_once = yes

		days_remove = 14

		modifier = {
			
		}

		visible = {
			original_tag = SPR
			has_global_flag = spanish_civil_war
			NOT = { has_global_flag = scw_over }
			789 = { has_state_flag = SPR_unplanned_offensive_flag }
		}

		complete_effect = {
			activate_mission = SPR_preparing_offensive
			set_country_flag = SPR_preparing_offensive_in_progress_flag
			every_other_country = {
				limit = {
					original_tag = SPR
				}
				activate_mission = SPA_cordoba_offensive_mission
			}
		}

		remove_effect = {
			789 = {
				clr_state_flag = SPR_unplanned_offensive_flag
				remove_province_modifier = {
					static_modifiers = { unplanned_offensive }
					province = {
						all_provinces = yes
					}
				}
			}
			if = {
				limit = {
					has_completed_focus = SPA_tackle_the_vulnerable_fronts
					789 = { is_controlled_by = SPR }
				}
				add_timed_idea = { idea = SPA_anti_republican_offensive days = 30 }
			}
			if = {
				limit = {
					has_completed_focus = SPA_tackle_the_vulnerable_fronts
					789 = { is_controlled_by = SPC }
				}
				add_timed_idea = { idea = SPA_anti_anarchist_offensive days = 30 }
			}
			if = {
				limit = {
					has_completed_focus = SPA_tackle_the_vulnerable_fronts
					789 = { is_controlled_by = SPB }
				}
				add_timed_idea = { idea = SPA_anti_carlist_offensive days = 30 }
			}
		}

		ai_will_do = {
			base = 0.1
			modifier = {
				factor = 0
				has_full_control_of_state = 789
			}
			modifier = {
				factor = 10
				OR = {
					tag = SPA
					tag = SPB
				}
			}
			modifier = {
				factor = 10
				divisions_in_state = {
					state = 789
					size > 0
				}
				NOT = {
					has_full_control_of_state = 789
				}
			}
			modifier = {		#allows to shorten frontline + a possible way to prevent Republicans in pushing in the Aragon, thus allowing Carlists to rise on historical
				factor = 100
				OR = {
					tag = SPD
					tag = SPC
				}
				AND = {
					is_historical_focus_on = yes
					has_game_rule = {
						rule = SPR_ai_behavior 
						option = DEFAULT
					}
				}
			}
			modifier = {
				factor = 0
				original_tag = SPR
				surrender_progress > 0.15	#losing war, no offensives
				any_enemy_country = {		#go defensive with superior enemy
					strength_ratio = {
						tag = ROOT
						ratio > 1.2
					}
				}
			}
		}
	}

	SPA_granada_offensive = {

		icon = hol_draw_up_staff_plans

		allowed = {
			original_tag = SPR
		}

		available = {
			NOT = { has_full_control_of_state = 173 }
			NOT = { has_active_mission = SPR_preparing_offensive }
			173 = {
				has_state_flag = SPR_unplanned_offensive_flag
				OR = {
					is_controlled_by = ROOT
					any_neighbor_state = {
						is_controlled_by = ROOT
					}
				}
			}
		}

		highlight_states = {
			highlight_state_targets = {
				state = 173
			} 
			highlight_color_before_active = 3
			highlight_color_while_active = 2
		}

		on_map_mode = map_only

		cost = 0

		fire_only_once = yes

		days_remove = 14

		modifier = {
			
		}

		visible = {
			original_tag = SPR
			has_global_flag = spanish_civil_war
			NOT = { has_global_flag = scw_over }
			173 = { has_state_flag = SPR_unplanned_offensive_flag }
		}

		complete_effect = {
			activate_mission = SPR_preparing_offensive
			set_country_flag = SPR_preparing_offensive_in_progress_flag
			every_other_country = {
				limit = {
					original_tag = SPR
				}
				activate_mission = SPA_granada_offensive_mission
			}
		}

		remove_effect = {
			173 = {
				clr_state_flag = SPR_unplanned_offensive_flag
				remove_province_modifier = {
					static_modifiers = { unplanned_offensive }
					province = {
						all_provinces = yes
					}
				}
			}
			if = {
				limit = {
					has_completed_focus = SPA_tackle_the_vulnerable_fronts
					173 = { is_controlled_by = SPR }
				}
				add_timed_idea = { idea = SPA_anti_republican_offensive days = 30 }
			}
			if = {
				limit = {
					has_completed_focus = SPA_tackle_the_vulnerable_fronts
					173 = { is_controlled_by = SPC }
				}
				add_timed_idea = { idea = SPA_anti_anarchist_offensive days = 30 }
			}
			if = {
				limit = {
					has_completed_focus = SPA_tackle_the_vulnerable_fronts
					173 = { is_controlled_by = SPB }
				}
				add_timed_idea = { idea = SPA_anti_carlist_offensive days = 30 }
			}
		}

		ai_will_do = {
			base = 0.1
			modifier = {
				factor = 0
				has_full_control_of_state = 173
			}
			modifier = {
				factor = 10
				OR = {
					tag = SPA
					tag = SPB
				}
			}
			modifier = {
				factor = 10
				divisions_in_state = {
					state = 173
					size > 0
				}
				NOT = {
					has_full_control_of_state = 173
				}
			}
			modifier = {
				factor = 0
				original_tag = SPR
				surrender_progress > 0.15	#losing war, no offensives
				any_enemy_country = {		#go defensive with superior enemy
					strength_ratio = {
						tag = ROOT
						ratio > 1.2
					}
				}
			}
		}
	}

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

 	SPR_preparing_offensive = {

		icon = hol_draw_up_staff_plans

		allowed = {
			original_tag = SPR
		}

		available = {
			hidden_trigger = { always = no }
		}

		fire_only_once = yes

		days_mission_timeout = 90

		is_good = no

		cancel_if_not_visible = yes

		activation = {
			always = no
		}

		visible = {
			original_tag = SPR
			has_global_flag = spanish_civil_war
			NOT = { has_global_flag = scw_over }
			has_country_flag = SPR_preparing_offensive_in_progress_flag
		}

		timeout_effect = {
			clr_country_flag = SPR_preparing_offensive_in_progress_flag
		}
	}

 	SPA_galicia_offensive_mission = {

		icon = hol_draw_up_staff_plans

		allowed = {
			original_tag = SPR
		}

		available = {
			hidden_trigger = { always = no }
		}

		highlight_states = {
			highlight_state_targets = {
				state = 171
			}
			highlight_color_while_active = 1
		}


		on_map_mode = map_and_decisions_view

		fire_only_once = yes

		days_mission_timeout = 14

		is_good = no

		cancel_if_not_visible = yes

		activation = {
			always = no
		}

		visible = {
			original_tag = SPR
			has_global_flag = spanish_civil_war
			NOT = { has_global_flag = scw_over }
			171 = { has_state_flag = SPR_unplanned_offensive_flag }
		}

		timeout_effect = {
			171 = {
				clr_state_flag = SPR_unplanned_offensive_flag
				remove_province_modifier = {
					static_modifiers = { unplanned_offensive }
					province = {
						all_provinces = yes
					}
				}
			}
		}
	}

	SPA_asturias_offensive_mission = {

		icon = hol_draw_up_staff_plans

		allowed = {
			original_tag = SPR
		}

		available = {
			hidden_trigger = { always = no }
		}

		highlight_states = {
			highlight_state_targets = {
				state = 790
			} 
			highlight_color_while_active = 1
		}


		on_map_mode = map_and_decisions_view

		fire_only_once = yes

		days_mission_timeout = 14

		is_good = no

		cancel_if_not_visible = yes

		activation = {
			always = no
		}

		visible = {
			original_tag = SPR
			has_global_flag = spanish_civil_war
			NOT = { has_global_flag = scw_over }
			790 = { has_state_flag = SPR_unplanned_offensive_flag }
		}

		timeout_effect = {
			790 = {
				clr_state_flag = SPR_unplanned_offensive_flag
				remove_province_modifier = {
					static_modifiers = { unplanned_offensive }
					province = {
						all_provinces = yes
					}
				}
			}
		}
	}

	SPA_leon_offensive_mission = {

		icon = hol_draw_up_staff_plans

		allowed = {
			original_tag = SPR
		}

		available = {
			hidden_trigger = { always = no }
		}

		highlight_states = {
			highlight_state_targets = {
				state = 174
			} 
			highlight_color_while_active = 1
		}


		on_map_mode = map_and_decisions_view

		fire_only_once = yes

		days_mission_timeout = 14

		is_good = no

		cancel_if_not_visible = yes

		activation = {
			always = no
		}

		visible = {
			original_tag = SPR
			has_global_flag = spanish_civil_war
			NOT = { has_global_flag = scw_over }
			174 = { has_state_flag = SPR_unplanned_offensive_flag }
		}

		timeout_effect = {
			174 = {
				clr_state_flag = SPR_unplanned_offensive_flag
				remove_province_modifier = {
					static_modifiers = { unplanned_offensive }
					province = {
						all_provinces = yes
					}
				}
			}
		}
	}

	SPA_valladolid_offensive_mission = {

		icon = hol_draw_up_staff_plans

		allowed = {
			original_tag = SPR
		}

		available = {
			hidden_trigger = { always = no }
		}

		highlight_states = {
			highlight_state_targets = {
				state = 791
			} 
			highlight_color_while_active = 1
		}


		on_map_mode = map_and_decisions_view

		fire_only_once = yes

		days_mission_timeout = 14

		is_good = no

		cancel_if_not_visible = yes

		activation = {
			always = no
		}

		visible = {
			original_tag = SPR
			has_global_flag = spanish_civil_war
			NOT = { has_global_flag = scw_over }
			791 = { has_state_flag = SPR_unplanned_offensive_flag }
		}

		timeout_effect = {
			791 = {
				clr_state_flag = SPR_unplanned_offensive_flag
				remove_province_modifier = {
					static_modifiers = { unplanned_offensive }
					province = {
						all_provinces = yes
					}
				}
			}
		}
	}

	SPA_burgos_offensive_mission = {

		icon = hol_draw_up_staff_plans

		allowed = {
			original_tag = SPR
		}

		available = {
			hidden_trigger = { always = no }
		}

		highlight_states = {
			highlight_state_targets = {
				state = 176
			} 
			highlight_color_while_active = 1
		}


		on_map_mode = map_and_decisions_view

		fire_only_once = yes

		days_mission_timeout = 14

		is_good = no

		cancel_if_not_visible = yes

		activation = {
			always = no
		}

		visible = {
			original_tag = SPR
			has_global_flag = spanish_civil_war
			NOT = { has_global_flag = scw_over }
			176 = { has_state_flag = SPR_unplanned_offensive_flag }
		}

		timeout_effect = {
			176 = {
				clr_state_flag = SPR_unplanned_offensive_flag
				remove_province_modifier = {
					static_modifiers = { unplanned_offensive }
					province = {
						all_provinces = yes
					}
				}
			}
		}
	}

	SPA_pais_vasco_offensive_mission = {

		icon = hol_draw_up_staff_plans

		allowed = {
			original_tag = SPR
		}

		available = {
			hidden_trigger = { always = no }
		}

		highlight_states = {
			highlight_state_targets = {
				state = 792
			} 
			highlight_color_while_active = 1
		}


		on_map_mode = map_and_decisions_view

		fire_only_once = yes

		days_mission_timeout = 14

		is_good = no

		cancel_if_not_visible = yes

		activation = {
			always = no
		}

		visible = {
			original_tag = SPR
			has_global_flag = spanish_civil_war
			NOT = { has_global_flag = scw_over }
			792 = { has_state_flag = SPR_unplanned_offensive_flag }
		}

		timeout_effect = {
			792 = {
				clr_state_flag = SPR_unplanned_offensive_flag
				remove_province_modifier = {
					static_modifiers = { unplanned_offensive }
					province = {
						all_provinces = yes
					}
				}
			}
		}
	}

	SPA_navarra_offensive_mission = {

		icon = hol_draw_up_staff_plans

		allowed = {
			original_tag = SPR
		}

		available = {
			hidden_trigger = { always = no }
		}

		highlight_states = {
			highlight_state_targets = {
				state = 172
			} 
			highlight_color_while_active = 1
		}

		on_map_mode = map_and_decisions_view

		fire_only_once = yes

		days_mission_timeout = 14

		is_good = no

		cancel_if_not_visible = yes

		activation = {
			always = no
		}

		visible = {
			original_tag = SPR
			has_global_flag = spanish_civil_war
			NOT = { has_global_flag = scw_over }
			172 = { has_state_flag = SPR_unplanned_offensive_flag }
		}

		timeout_effect = {
			172 = {
				clr_state_flag = SPR_unplanned_offensive_flag
				remove_province_modifier = {
					static_modifiers = { unplanned_offensive }
					province = {
						all_provinces = yes
					}
				}
			}
		}
	}

	SPA_western_aragon_offensive_mission = {

		icon = hol_draw_up_staff_plans

		allowed = {
			original_tag = SPR
		}

		available = {
			hidden_trigger = { always = no }
		}

		highlight_states = {
			highlight_state_targets = {
				state = 166
			} 
			highlight_color_while_active = 1
		}


		on_map_mode = map_and_decisions_view

		fire_only_once = yes

		days_mission_timeout = 14

		is_good = no

		cancel_if_not_visible = yes

		activation = {
			always = no
		}

		visible = {
			original_tag = SPR
			has_global_flag = spanish_civil_war
			NOT = { has_global_flag = scw_over }
			166 = { has_state_flag = SPR_unplanned_offensive_flag }
		}

		timeout_effect = {
			166 = {
				clr_state_flag = SPR_unplanned_offensive_flag
				remove_province_modifier = {
					static_modifiers = { unplanned_offensive }
					province = {
						all_provinces = yes
					}
				}
			}
		}
	}

	SPA_eastern_aragon_offensive_mission = {

		icon = hol_draw_up_staff_plans

		allowed = {
			original_tag = SPR
		}

		available = {
			hidden_trigger = { always = no }
		}

		highlight_states = {
			highlight_state_targets = {
				state = 794
			} 
			highlight_color_while_active = 1
		}

		on_map_mode = map_and_decisions_view

		fire_only_once = yes

		days_mission_timeout = 14

		is_good = no

		cancel_if_not_visible = yes

		activation = {
			always = no
		}

		visible = {
			original_tag = SPR
			has_global_flag = spanish_civil_war
			NOT = { has_global_flag = scw_over }
			794 = { has_state_flag = SPR_unplanned_offensive_flag }
		}

		timeout_effect = {
			794 = {
				clr_state_flag = SPR_unplanned_offensive_flag
				remove_province_modifier = {
					static_modifiers = { unplanned_offensive }
					province = {
						all_provinces = yes
					}
				}
			}
		}
	}

	SPA_catalunya_offensive_mission = {

		icon = hol_draw_up_staff_plans

		allowed = {
			original_tag = SPR
		}

		available = {
			hidden_trigger = { always = no }
		}
		highlight_states = {
			highlight_state_targets = {
				state = 165
			} 
			highlight_color_while_active = 1
		}


		on_map_mode = map_and_decisions_view

		fire_only_once = yes

		days_mission_timeout = 14

		is_good = no

		cancel_if_not_visible = yes

		activation = {
			always = no
		}

		visible = {
			original_tag = SPR
			has_global_flag = spanish_civil_war
			NOT = { has_global_flag = scw_over }
			165 = { has_state_flag = SPR_unplanned_offensive_flag }
		}

		timeout_effect = {
			165 = {
				clr_state_flag = SPR_unplanned_offensive_flag
				remove_province_modifier = {
					static_modifiers = { unplanned_offensive }
					province = {
						all_provinces = yes
					}
				}
			}
		}
	}

	SPA_salamanca_offensive_mission = {

		icon = hol_draw_up_staff_plans

		allowed = {
			original_tag = SPR
		}

		available = {
			hidden_trigger = { always = no }
		}
		highlight_states = {
			highlight_state_targets = {
				state = 788
			} 
			highlight_color_while_active = 1
		}

		on_map_mode = map_and_decisions_view

		fire_only_once = yes

		days_mission_timeout = 14

		is_good = no

		cancel_if_not_visible = yes

		activation = {
			always = no
		}

		visible = {
			original_tag = SPR
			has_global_flag = spanish_civil_war
			NOT = { has_global_flag = scw_over }
			788 = { has_state_flag = SPR_unplanned_offensive_flag }
		}

		timeout_effect = {
			788 = {
				clr_state_flag = SPR_unplanned_offensive_flag
				remove_province_modifier = {
					static_modifiers = { unplanned_offensive }
					province = {
						all_provinces = yes
					}
				}
			}
		}
	}

	SPA_madrid_offensive_mission = {

		icon = hol_draw_up_staff_plans

		allowed = {
			original_tag = SPR
		}

		available = {
			hidden_trigger = { always = no }
		}

		highlight_states = {
			highlight_state_targets = {
				state = 41
			} 
			highlight_color_while_active = 1
		}


		on_map_mode = map_and_decisions_view

		fire_only_once = yes

		days_mission_timeout = 14

		is_good = no

		cancel_if_not_visible = yes

		activation = {
			always = no
		}

		visible = {
			original_tag = SPR
			has_global_flag = spanish_civil_war
			NOT = { has_global_flag = scw_over }
			41 = { has_state_flag = SPR_unplanned_offensive_flag }
		}

		timeout_effect = {
			41 = {
				clr_state_flag = SPR_unplanned_offensive_flag
				remove_province_modifier = {
					static_modifiers = { unplanned_offensive }
					province = {
						all_provinces = yes
					}
				}
			}
		}
	}

	SPA_guadalajara_offensive_mission = {

		icon = hol_draw_up_staff_plans

		allowed = {
			original_tag = SPR
		}

		available = {
			hidden_trigger = { always = no }
		}

		highlight_states = {
			highlight_state_targets = {
				state = 793
			} 
			highlight_color_while_active = 1
		}


		on_map_mode = map_and_decisions_view

		fire_only_once = yes

		days_mission_timeout = 14

		is_good = no

		cancel_if_not_visible = yes

		activation = {
			always = no
		}

		visible = {
			original_tag = SPR
			has_global_flag = spanish_civil_war
			NOT = { has_global_flag = scw_over }
			793 = { has_state_flag = SPR_unplanned_offensive_flag }
		}

		timeout_effect = {
			793 = {
				clr_state_flag = SPR_unplanned_offensive_flag
				remove_province_modifier = {
					static_modifiers = { unplanned_offensive }
					province = {
						all_provinces = yes
					}
				}
			}
		}
	}

	SPA_valencia_offensive_mission = {

		icon = hol_draw_up_staff_plans

		allowed = {
			original_tag = SPR
		}

		available = {
			hidden_trigger = { always = no }
		}
		highlight_states = {
			highlight_state_targets = {
				state = 167
			} 
			highlight_color_while_active = 1
		}


		on_map_mode = map_and_decisions_view

		fire_only_once = yes

		days_mission_timeout = 14

		is_good = no

		cancel_if_not_visible = yes

		activation = {
			always = no
		}

		visible = {
			original_tag = SPR
			has_global_flag = spanish_civil_war
			NOT = { has_global_flag = scw_over }
			167 = { has_state_flag = SPR_unplanned_offensive_flag }
		}

		timeout_effect = {
			167 = {
				clr_state_flag = SPR_unplanned_offensive_flag
				remove_province_modifier = {
					static_modifiers = { unplanned_offensive }
					province = {
						all_provinces = yes
					}
				}
			}
		}
	}

	SPA_extremadura_offensive_mission = {

		icon = hol_draw_up_staff_plans

		allowed = {
			original_tag = SPR
		}

		available = {
			hidden_trigger = { always = no }
		}

		highlight_states = {
			highlight_state_targets = {
				state = 170
			} 
			highlight_color_while_active = 1
		}


		on_map_mode = map_and_decisions_view

		fire_only_once = yes

		days_mission_timeout = 14

		is_good = no

		cancel_if_not_visible = yes

		activation = {
			always = no
		}

		visible = {
			original_tag = SPR
			has_global_flag = spanish_civil_war
			NOT = { has_global_flag = scw_over }
			170 = { has_state_flag = SPR_unplanned_offensive_flag }
		}

		timeout_effect = {
			170 = {
				clr_state_flag = SPR_unplanned_offensive_flag
				remove_province_modifier = {
					static_modifiers = { unplanned_offensive }
					province = {
						all_provinces = yes
					}
				}
			}
		}
	}

	SPA_ciudad_real_offensive_mission = {

		icon = hol_draw_up_staff_plans

		allowed = {
			original_tag = SPR
		}

		available = {
			hidden_trigger = { always = no }
		}

		highlight_states = {
			highlight_state_targets = {
				state = 175
			} 
			highlight_color_while_active = 1
		}


		on_map_mode = map_and_decisions_view

		fire_only_once = yes

		days_mission_timeout = 14

		is_good = no

		cancel_if_not_visible = yes

		activation = {
			always = no
		}

		visible = {
			original_tag = SPR
			has_global_flag = spanish_civil_war
			NOT = { has_global_flag = scw_over }
			175 = { has_state_flag = SPR_unplanned_offensive_flag }
		}

		timeout_effect = {
			175 = {
				clr_state_flag = SPR_unplanned_offensive_flag
				remove_province_modifier = {
					static_modifiers = { unplanned_offensive }
					province = {
						all_provinces = yes
					}
				}
			}
		}
	}

	SPA_murcia_offensive_mission = {

		icon = hol_draw_up_staff_plans

		allowed = {
			original_tag = SPR
		}

		available = {
			hidden_trigger = { always = no }
		}

		highlight_states = {
			highlight_state_targets = {
				state = 168
			} 
			highlight_color_while_active = 1
		}


		on_map_mode = map_and_decisions_view

		fire_only_once = yes

		days_mission_timeout = 14

		is_good = no

		cancel_if_not_visible = yes

		activation = {
			always = no
		}

		visible = {
			original_tag = SPR
			has_global_flag = spanish_civil_war
			NOT = { has_global_flag = scw_over }
			168 = { has_state_flag = SPR_unplanned_offensive_flag }
		}

		timeout_effect = {
			168 = {
				clr_state_flag = SPR_unplanned_offensive_flag
				remove_province_modifier = {
					static_modifiers = { unplanned_offensive }
					province = {
						all_provinces = yes
					}
				}
			}
		}
	}

	SPA_sevilla_offensive_mission = {

		icon = hol_draw_up_staff_plans

		allowed = {
			original_tag = SPR
		}

		available = {
			hidden_trigger = { always = no }
		}

		highlight_states = {
			highlight_state_targets = {
				state = 169
			} 
			highlight_color_while_active = 1
		}


		on_map_mode = map_and_decisions_view

		fire_only_once = yes

		days_mission_timeout = 14

		is_good = no

		cancel_if_not_visible = yes

		activation = {
			always = no
		}

		visible = {
			original_tag = SPR
			has_global_flag = spanish_civil_war
			NOT = { has_global_flag = scw_over }
			169 = { has_state_flag = SPR_unplanned_offensive_flag }
		}

		timeout_effect = {
			169 = {
				clr_state_flag = SPR_unplanned_offensive_flag
				remove_province_modifier = {
					static_modifiers = { unplanned_offensive }
					province = {
						all_provinces = yes
					}
				}
			}
		}
	}

	SPA_cordoba_offensive_mission = {

		icon = hol_draw_up_staff_plans

		allowed = {
			original_tag = SPR
		}

		available = {
			hidden_trigger = { always = no }
		}

		highlight_states = {
			highlight_state_targets = {
				state = 789
			} 
			highlight_color_while_active = 1
		}

		on_map_mode = map_and_decisions_view

		fire_only_once = yes

		days_mission_timeout = 14

		is_good = no

		cancel_if_not_visible = yes

		activation = {
			always = no
		}

		visible = {
			original_tag = SPR
			has_global_flag = spanish_civil_war
			NOT = { has_global_flag = scw_over }
			789 = { has_state_flag = SPR_unplanned_offensive_flag }
		}

		timeout_effect = {
			789 = {
				clr_state_flag = SPR_unplanned_offensive_flag
				remove_province_modifier = {
					static_modifiers = { unplanned_offensive }
					province = {
						all_provinces = yes
					}
				}
			}
		}
	}

	SPA_granada_offensive_mission = {

		icon = hol_draw_up_staff_plans

		allowed = {
			original_tag = SPR
		}

		available = {
			hidden_trigger = { always = no }
		}

		highlight_states = {
			highlight_state_targets = {
				state = 173
			} 
			highlight_color_while_active = 1
		}


		on_map_mode = map_and_decisions_view

		fire_only_once = yes

		days_mission_timeout = 14

		is_good = no

		cancel_if_not_visible = yes

		activation = {
			always = no
		}

		visible = {
			original_tag = SPR
			has_global_flag = spanish_civil_war
			NOT = { has_global_flag = scw_over }
			173 = { has_state_flag = SPR_unplanned_offensive_flag }
		}

		timeout_effect = {
			173 = {
				clr_state_flag = SPR_unplanned_offensive_flag
				remove_province_modifier = {
					static_modifiers = { unplanned_offensive }
					province = {
						all_provinces = yes
					}
				}
			}
		}
	}

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

	SPA_activate_galicia_fifth_columnists = {

		icon = generic_ignite_civil_war

		allowed = {
			tag = SPA
		}

		available = {
			171 = {
				NOT = { is_controlled_by = ROOT }
				any_neighbor_state = {
					is_controlled_by = ROOT
				}
			}
		}

		highlight_states = {
			highlight_state_targets = {
				state = 171
			} 
		}

		on_map_mode = map_only

		cost = 25

		fire_only_once = yes

		days_remove = 30

		modifier = {
			
		}

		visible = {
			tag = SPA
			has_global_flag = spanish_civil_war
			NOT = { has_global_flag = scw_over }
			171 = { NOT = { is_controlled_by = ROOT } }
			has_completed_focus = SPA_the_fifth_column
		}

		complete_effect = {
			
		}

		remove_effect = {
			171 = {
				create_unit = {
					division = "division_template = \"Fifth Columnist Brigade\"	start_experience_factor = 0	start_equipment_factor = 1"
					owner = ROOT
					allow_spawning_on_enemy_provs = yes
					count = 2
					country_score = {
						base = 100
						modifier = {
							tag = SPR
							add = 100
						}
						modifier = {
							tag = SPB
							add = 100
						}
						modifier = {
							tag = SPC
							add = 100
						}
					}
				}
			}
		}
	}

	SPA_activate_asturias_fifth_columnists = {

		icon = generic_ignite_civil_war

		allowed = {
			tag = SPA
		}

		available = {
			790 = {
				NOT = { is_controlled_by = ROOT }
				any_neighbor_state = {
					is_controlled_by = ROOT
				}
			}
		}

		highlight_states = {
			highlight_state_targets = {
				state = 790
			} 
		}

		on_map_mode = map_only

		cost = 25

		fire_only_once = yes

		days_remove = 30

		modifier = {
			
		}

		visible = {
			tag = SPA
			has_global_flag = spanish_civil_war
			NOT = { has_global_flag = scw_over }
			790 = { NOT = { is_controlled_by = ROOT } }
			has_completed_focus = SPA_the_fifth_column
		}

		complete_effect = {
			
		}

		remove_effect = {
			790 = {
				create_unit = {
					division = "division_template = \"Fifth Columnist Brigade\"	start_experience_factor = 0	start_equipment_factor = 1"
					owner = ROOT
					allow_spawning_on_enemy_provs = yes
					count = 2
					country_score = {
						base = 100
						modifier = {
							tag = SPR
							add = 100
						}
						modifier = {
							tag = SPB
							add = 100
						}
						modifier = {
							tag = SPC
							add = 100
						}
					}
				}
			}
		}
	}

	SPA_activate_leon_fifth_columnists = {

		icon = generic_ignite_civil_war

		allowed = {
			tag = SPA
		}

		available = {
			174 = {
				NOT = { is_controlled_by = ROOT }
				any_neighbor_state = {
					is_controlled_by = ROOT
				}
			}
		}

		highlight_states = {
			highlight_state_targets = {
				state = 174
			} 
		}

		on_map_mode = map_only

		cost = 25

		fire_only_once = yes

		days_remove = 30

		modifier = {
			
		}

		visible = {
			tag = SPA
			has_global_flag = spanish_civil_war
			NOT = { has_global_flag = scw_over }
			174 = { NOT = { is_controlled_by = ROOT } }
			has_completed_focus = SPA_the_fifth_column
		}

		complete_effect = {
			
		}

		remove_effect = {
			174 = {
				create_unit = {
					division = "division_template = \"Fifth Columnist Brigade\"	start_experience_factor = 0	start_equipment_factor = 1"
					owner = ROOT
					allow_spawning_on_enemy_provs = yes
					count = 2
					country_score = {
						base = 100
						modifier = {
							tag = SPR
							add = 100
						}
						modifier = {
							tag = SPB
							add = 100
						}
						modifier = {
							tag = SPC
							add = 100
						}
					}
				}
			}
		}
	}

	SPA_activate_valladolid_fifth_columnists = {

		icon = generic_ignite_civil_war

		allowed = {
			tag = SPA
		}

		available = {
			791 = {
				NOT = { is_controlled_by = ROOT }
				any_neighbor_state = {
					is_controlled_by = ROOT
				}
			}
		}

		highlight_states = {
			highlight_state_targets = {
				state = 791
			} 
		}

		on_map_mode = map_only

		cost = 25

		fire_only_once = yes

		days_remove = 30

		modifier = {
			
		}

		visible = {
			tag = SPA
			has_global_flag = spanish_civil_war
			NOT = { has_global_flag = scw_over }
			791 = { NOT = { is_controlled_by = ROOT } }
			has_completed_focus = SPA_the_fifth_column
		}

		complete_effect = {
			
		}

		remove_effect = {
			791 = {
				create_unit = {
					division = "division_template = \"Fifth Columnist Brigade\"	start_experience_factor = 0	start_equipment_factor = 1"
					owner = ROOT
					allow_spawning_on_enemy_provs = yes
					count = 2
					country_score = {
						base = 100
						modifier = {
							tag = SPR
							add = 100
						}
						modifier = {
							tag = SPB
							add = 100
						}
						modifier = {
							tag = SPC
							add = 100
						}
					}
				}
			}
		}
	}

	SPA_activate_burgos_fifth_columnists = {

		icon = generic_ignite_civil_war

		allowed = {
			tag = SPA
		}

		available = {
			176 = {
				NOT = { is_controlled_by = ROOT }
				any_neighbor_state = {
					is_controlled_by = ROOT
				}
			}
		}

		highlight_states = {
			highlight_state_targets = {
				state = 176
			} 
		}

		on_map_mode = map_only

		cost = 25

		fire_only_once = yes

		days_remove = 30

		modifier = {
			
		}

		visible = {
			tag = SPA
			has_global_flag = spanish_civil_war
			NOT = { has_global_flag = scw_over }
			176 = { NOT = { is_controlled_by = ROOT } }
			has_completed_focus = SPA_the_fifth_column
		}

		complete_effect = {
			
		}

		remove_effect = {
			176 = {
				create_unit = {
					division = "division_template = \"Fifth Columnist Brigade\"	start_experience_factor = 0	start_equipment_factor = 1"
					owner = ROOT
					allow_spawning_on_enemy_provs = yes
					count = 2
					country_score = {
						base = 100
						modifier = {
							tag = SPR
							add = 100
						}
						modifier = {
							tag = SPB
							add = 100
						}
						modifier = {
							tag = SPC
							add = 100
						}
					}
				}
			}
		}
	}

	SPA_activate_pais_vasco_fifth_columnists = {

		icon = generic_ignite_civil_war

		allowed = {
			tag = SPA
		}

		available = {
			792 = {
				NOT = { is_controlled_by = ROOT }
				any_neighbor_state = {
					is_controlled_by = ROOT
				}
			}
		}

		highlight_states = {
			highlight_state_targets = {
				state = 792
			} 
		}

		on_map_mode = map_only

		cost = 25

		fire_only_once = yes

		days_remove = 30

		modifier = {
			
		}

		visible = {
			tag = SPA
			has_global_flag = spanish_civil_war
			NOT = { has_global_flag = scw_over }
			792 = { NOT = { is_controlled_by = ROOT } }
			has_completed_focus = SPA_the_fifth_column
		}

		complete_effect = {
			
		}

		remove_effect = {
			792 = {
				create_unit = {
					division = "division_template = \"Fifth Columnist Brigade\"	start_experience_factor = 0	start_equipment_factor = 1"
					owner = ROOT
					allow_spawning_on_enemy_provs = yes
					count = 2
					country_score = {
						base = 100
						modifier = {
							tag = SPR
							add = 100
						}
						modifier = {
							tag = SPB
							add = 100
						}
						modifier = {
							tag = SPC
							add = 100
						}
					}
				}
			}
		}
	}

	SPA_activate_navarra_fifth_columnists = {

		icon = generic_ignite_civil_war

		allowed = {
			tag = SPA
		}

		available = {
			172 = {
				NOT = { is_controlled_by = ROOT }
				any_neighbor_state = {
					is_controlled_by = ROOT
				}
			}
		}
		highlight_states = {
			highlight_state_targets = {
				state = 172
			} 
		}

		on_map_mode = map_only

		cost = 25

		fire_only_once = yes

		days_remove = 30

		modifier = {
			
		}

		visible = {
			tag = SPA
			has_global_flag = spanish_civil_war
			NOT = { has_global_flag = scw_over }
			172 = { NOT = { is_controlled_by = ROOT } }
			has_completed_focus = SPA_the_fifth_column
		}

		complete_effect = {
			
		}

		remove_effect = {
			172 = {
				create_unit = {
					division = "division_template = \"Fifth Columnist Brigade\"	start_experience_factor = 0	start_equipment_factor = 1"
					owner = ROOT
					allow_spawning_on_enemy_provs = yes
					count = 2
					country_score = {
						base = 100
						modifier = {
							tag = SPR
							add = 100
						}
						modifier = {
							tag = SPB
							add = 100
						}
						modifier = {
							tag = SPC
							add = 100
						}
					}
				}
			}
		}
	}

	SPA_activate_western_aragon_fifth_columnists = {

		icon = generic_ignite_civil_war

		allowed = {
			tag = SPA
		}

		available = {
			166 = {
				NOT = { is_controlled_by = ROOT }
				any_neighbor_state = {
					is_controlled_by = ROOT
				}
			}
		}

		highlight_states = {
			highlight_state_targets = {
				state = 166
			} 
		}

		on_map_mode = map_only

		cost = 25

		fire_only_once = yes

		days_remove = 30

		modifier = {
			
		}

		visible = {
			tag = SPA
			has_global_flag = spanish_civil_war
			NOT = { has_global_flag = scw_over }
			166 = { NOT = { is_controlled_by = ROOT } }
			has_completed_focus = SPA_the_fifth_column
		}

		complete_effect = {
			
		}

		remove_effect = {
			166 = {
				create_unit = {
					division = "division_template = \"Fifth Columnist Brigade\"	start_experience_factor = 0	start_equipment_factor = 1"
					owner = ROOT
					allow_spawning_on_enemy_provs = yes
					count = 2
					country_score = {
						base = 100
						modifier = {
							tag = SPR
							add = 100
						}
						modifier = {
							tag = SPB
							add = 100
						}
						modifier = {
							tag = SPC
							add = 100
						}
					}
				}
			}
		}
	}

	SPA_activate_eastern_aragon_fifth_columnists = {

		icon = generic_ignite_civil_war

		allowed = {
			tag = SPA
		}

		available = {
			794 = {
				NOT = { is_controlled_by = ROOT }
				any_neighbor_state = {
					is_controlled_by = ROOT
				}
			}
		}

		highlight_states = {
			highlight_state_targets = {
				state = 794
			} 
		}

		on_map_mode = map_only

		cost = 25

		fire_only_once = yes

		days_remove = 30

		modifier = {
			
		}

		visible = {
			tag = SPA
			has_global_flag = spanish_civil_war
			NOT = { has_global_flag = scw_over }
			794 = { NOT = { is_controlled_by = ROOT } }
			has_completed_focus = SPA_the_fifth_column
		}

		complete_effect = {
			
		}

		remove_effect = {
			794 = {
				create_unit = {
					division = "division_template = \"Fifth Columnist Brigade\"	start_experience_factor = 0	start_equipment_factor = 1"
					owner = ROOT
					allow_spawning_on_enemy_provs = yes
					count = 2
					country_score = {
						base = 100
						modifier = {
							tag = SPR
							add = 100
						}
						modifier = {
							tag = SPB
							add = 100
						}
						modifier = {
							tag = SPC
							add = 100
						}
					}
				}
			}
		}
	}

	SPA_activate_catalunya_fifth_columnists = {

		icon = generic_ignite_civil_war

		allowed = {
			tag = SPA
		}

		available = {
			165 = {
				NOT = { is_controlled_by = ROOT }
				any_neighbor_state = {
					is_controlled_by = ROOT
				}
			}
		}

		highlight_states = {
			highlight_state_targets = {
				state = 165
			} 
		}

		on_map_mode = map_only

		cost = 25

		fire_only_once = yes

		days_remove = 30

		modifier = {
			
		}

		visible = {
			tag = SPA
			has_global_flag = spanish_civil_war
			NOT = { has_global_flag = scw_over }
			165 = { NOT = { is_controlled_by = ROOT } }
			has_completed_focus = SPA_the_fifth_column
		}

		complete_effect = {
			
		}

		remove_effect = {
			165 = {
				create_unit = {
					division = "division_template = \"Fifth Columnist Brigade\"	start_experience_factor = 0	start_equipment_factor = 1"
					owner = ROOT
					allow_spawning_on_enemy_provs = yes
					count = 2
					country_score = {
						base = 100
						modifier = {
							tag = SPR
							add = 100
						}
						modifier = {
							tag = SPB
							add = 100
						}
						modifier = {
							tag = SPC
							add = 100
						}
					}
				}
			}
		}
	}

	SPA_activate_salamanca_fifth_columnists = {

		icon = generic_ignite_civil_war

		allowed = {
			tag = SPA
		}

		available = {
			788 = {
				NOT = { is_controlled_by = ROOT }
				any_neighbor_state = {
					is_controlled_by = ROOT
				}
			}
		}

		highlight_states = {
			highlight_state_targets = {
				state = 788
			} 
		}

		on_map_mode = map_only

		cost = 25

		fire_only_once = yes

		days_remove = 30

		modifier = {
			
		}

		visible = {
			tag = SPA
			has_global_flag = spanish_civil_war
			NOT = { has_global_flag = scw_over }
			788 = { NOT = { is_controlled_by = ROOT } }
			has_completed_focus = SPA_the_fifth_column
		}

		complete_effect = {
			
		}

		remove_effect = {
			788 = {
				create_unit = {
					division = "division_template = \"Fifth Columnist Brigade\"	start_experience_factor = 0	start_equipment_factor = 1"
					owner = ROOT
					allow_spawning_on_enemy_provs = yes
					count = 2
					country_score = {
						base = 100
						modifier = {
							tag = SPR
							add = 100
						}
						modifier = {
							tag = SPB
							add = 100
						}
						modifier = {
							tag = SPC
							add = 100
						}
					}
				}
			}
		}
	}

	SPA_activate_madrid_fifth_columnists = {

		icon = generic_ignite_civil_war

		allowed = {
			tag = SPA
		}

		available = {
			41 = {
				NOT = { is_controlled_by = ROOT }
				any_neighbor_state = {
					is_controlled_by = ROOT
				}
			}
		}

		highlight_states = {
			highlight_state_targets = {
				state = 41
			} 
		}

		on_map_mode = map_only

		cost = 25

		fire_only_once = yes

		days_remove = 30

		modifier = {
			
		}

		visible = {
			tag = SPA
			has_global_flag = spanish_civil_war
			NOT = { has_global_flag = scw_over }
			41 = { NOT = { is_controlled_by = ROOT } }
			has_completed_focus = SPA_the_fifth_column
		}

		complete_effect = {
			
		}

		remove_effect = {
			41 = {
				create_unit = {
					division = "division_template = \"Fifth Columnist Brigade\" start_experience_factor = 0 start_equipment_factor = 1"
					owner = ROOT
					allow_spawning_on_enemy_provs = yes
					count = 2
					country_score = {
						base = 100
						modifier = {
							tag = SPR
							add = 100
						}
						modifier = {
							tag = SPB
							add = 100
						}
						modifier = {
							tag = SPC
							add = 100
						}
					}
				}
			}
		}
	}
					
	SPA_activate_guadalajara_fifth_columnists = {

		icon = generic_ignite_civil_war

		allowed = {
			tag = SPA
		}

		available = {
			793 = {
				NOT = { is_controlled_by = ROOT }
				any_neighbor_state = {
					is_controlled_by = ROOT
				}
			}
		}

		highlight_states = {
			highlight_state_targets = {
				state = 793
			} 
		}

		on_map_mode = map_only

		cost = 25

		fire_only_once = yes

		days_remove = 30

		modifier = {
			
		}

		visible = {
			tag = SPA
			has_global_flag = spanish_civil_war
			NOT = { has_global_flag = scw_over }
			793 = { NOT = { is_controlled_by = ROOT } }
			has_completed_focus = SPA_the_fifth_column
		}

		complete_effect = {
			
		}

		remove_effect = {
			793 = {
				create_unit = {
					division = "division_template = \"Fifth Columnist Brigade\"	start_experience_factor = 0	start_equipment_factor = 1"
					owner = ROOT
					allow_spawning_on_enemy_provs = yes
					count = 2
					country_score = {
						base = 100
						modifier = {
							tag = SPR
							add = 100
						}
						modifier = {
							tag = SPB
							add = 100
						}
						modifier = {
							tag = SPC
							add = 100
						}
					}
				}
			}
		}
	}

	SPA_activate_valencia_fifth_columnists = {

		icon = generic_ignite_civil_war

		allowed = {
			tag = SPA
		}

		available = {
			167 = {
				NOT = { is_controlled_by = ROOT }
				any_neighbor_state = {
					is_controlled_by = ROOT
				}
			}
		}

		highlight_states = {
			highlight_state_targets = {
				state = 167
			} 
		}

		on_map_mode = map_only

		cost = 25

		fire_only_once = yes

		days_remove = 30

		modifier = {
			
		}

		visible = {
			tag = SPA
			has_global_flag = spanish_civil_war
			NOT = { has_global_flag = scw_over }
			167 = { NOT = { is_controlled_by = ROOT } }
			has_completed_focus = SPA_the_fifth_column
		}

		complete_effect = {
			
		}

		remove_effect = {
			167 = {
				create_unit = {
					division = "division_template = \"Fifth Columnist Brigade\"	start_experience_factor = 0	start_equipment_factor = 1"
					owner = ROOT
					allow_spawning_on_enemy_provs = yes
					count = 2
					country_score = {
						base = 100
						modifier = {
							tag = SPR
							add = 100
						}
						modifier = {
							tag = SPB
							add = 100
						}
						modifier = {
							tag = SPC
							add = 100
						}
					}
				}
			}
		}
	}

	SPA_activate_extremadura_fifth_columnists = {

		icon = generic_ignite_civil_war

		allowed = {
			tag = SPA
		}

		available = {
			170 = {
				NOT = { is_controlled_by = ROOT }
				any_neighbor_state = {
					is_controlled_by = ROOT
				}
			}
		}

		highlight_states = {
			highlight_state_targets = {
				state = 170
			} 
		}

		on_map_mode = map_only

		cost = 25

		fire_only_once = yes

		days_remove = 30

		modifier = {
			
		}

		visible = {
			tag = SPA
			has_global_flag = spanish_civil_war
			NOT = { has_global_flag = scw_over }
			170 = { NOT = { is_controlled_by = ROOT } }
			has_completed_focus = SPA_the_fifth_column
		}

		complete_effect = {
			
		}

		remove_effect = {
			170 = {
				create_unit = {
					division = "division_template = \"Fifth Columnist Brigade\"	start_experience_factor = 0	start_equipment_factor = 1"
					owner = ROOT
					allow_spawning_on_enemy_provs = yes
					count = 2
					country_score = {
						base = 100
						modifier = {
							tag = SPR
							add = 100
						}
						modifier = {
							tag = SPB
							add = 100
						}
						modifier = {
							tag = SPC
							add = 100
						}
					}
				}
			}
		}
	}

	SPA_activate_ciudad_real_fifth_columnists = {

		icon = generic_ignite_civil_war

		allowed = {
			tag = SPA
		}

		available = {
			175 = {
				NOT = { is_controlled_by = ROOT }
				any_neighbor_state = {
					is_controlled_by = ROOT
				}
			}
		}
		highlight_states = {
			highlight_state_targets = {
				state = 175
			} 
		}

		on_map_mode = map_only

		cost = 25

		fire_only_once = yes

		days_remove = 30

		modifier = {
			
		}

		visible = {
			tag = SPA
			has_global_flag = spanish_civil_war
			NOT = { has_global_flag = scw_over }
			175 = { NOT = { is_controlled_by = ROOT } }
			has_completed_focus = SPA_the_fifth_column
		}

		complete_effect = {
			
		}

		remove_effect = {
			175 = {
				create_unit = {
					division = "division_template = \"Fifth Columnist Brigade\"	start_experience_factor = 0	start_equipment_factor = 1"
					owner = ROOT
					allow_spawning_on_enemy_provs = yes
					count = 2
					country_score = {
						base = 100
						modifier = {
							tag = SPR
							add = 100
						}
						modifier = {
							tag = SPB
							add = 100
						}
						modifier = {
							tag = SPC
							add = 100
						}
					}
				}
			}
		}
	}

	SPA_activate_murcia_fifth_columnists = {

		icon = generic_ignite_civil_war

		allowed = {
			tag = SPA
		}

		available = {
			168 = {
				NOT = { is_controlled_by = ROOT }
				any_neighbor_state = {
					is_controlled_by = ROOT
				}
			}
		}

		highlight_states = {
			highlight_state_targets = {
				state = 168
			} 
		}

		on_map_mode = map_only

		cost = 25

		fire_only_once = yes

		days_remove = 30

		modifier = {
			
		}

		visible = {
			tag = SPA
			has_global_flag = spanish_civil_war
			NOT = { has_global_flag = scw_over }
			168 = { NOT = { is_controlled_by = ROOT } }
			has_completed_focus = SPA_the_fifth_column
		}

		complete_effect = {
			
		}

		remove_effect = {
			168 = {
				create_unit = {
					division = "division_template = \"Fifth Columnist Brigade\"	start_experience_factor = 0	start_equipment_factor = 1"
					owner = ROOT
					allow_spawning_on_enemy_provs = yes
					count = 2
					country_score = {
						base = 100
						modifier = {
							tag = SPR
							add = 100
						}
						modifier = {
							tag = SPB
							add = 100
						}
						modifier = {
							tag = SPC
							add = 100
						}
					}
				}
			}
		}
	}

	SPA_activate_sevilla_fifth_columnists = {

		icon = generic_ignite_civil_war

		allowed = {
			tag = SPA
		}

		available = {
			169 = {
				NOT = { is_controlled_by = ROOT }
				any_neighbor_state = {
					is_controlled_by = ROOT
				}
			}
		}

		highlight_states = {
			highlight_state_targets = {
				state = 169
			} 
		}

		on_map_mode = map_only

		cost = 25

		fire_only_once = yes

		days_remove = 30

		modifier = {
			
		}

		visible = {
			tag = SPA
			has_global_flag = spanish_civil_war
			NOT = { has_global_flag = scw_over }
			169 = { NOT = { is_controlled_by = ROOT } }
			has_completed_focus = SPA_the_fifth_column
		}

		complete_effect = {
			
		}

		remove_effect = {
			169 = {
				create_unit = {
					division = "division_template = \"Fifth Columnist Brigade\"	start_experience_factor = 0	start_equipment_factor = 1"
					owner = ROOT
					allow_spawning_on_enemy_provs = yes
					count = 2
					country_score = {
						base = 100
						modifier = {
							tag = SPR
							add = 100
						}
						modifier = {
							tag = SPB
							add = 100
						}
						modifier = {
							tag = SPC
							add = 100
						}
					}
				}
			}
		}
	}

	SPA_activate_cordoba_fifth_columnists = {

		icon = generic_ignite_civil_war

		allowed = {
			tag = SPA
		}

		available = {
			789 = {
				NOT = { is_controlled_by = ROOT }
				any_neighbor_state = {
					is_controlled_by = ROOT
				}
			}
		}

		highlight_states = {
			highlight_state_targets = {
				state = 789
			} 
		}

		on_map_mode = map_only

		cost = 25

		fire_only_once = yes

		days_remove = 30

		modifier = {
			
		}

		visible = {
			tag = SPA
			has_global_flag = spanish_civil_war
			NOT = { has_global_flag = scw_over }
			789 = { NOT = { is_controlled_by = ROOT } }
			has_completed_focus = SPA_the_fifth_column
		}

		complete_effect = {
			
		}

		remove_effect = {
			789 = {
				create_unit = {
					division = "division_template = \"Fifth Columnist Brigade\"	start_experience_factor = 0	start_equipment_factor = 1"
					owner = ROOT
					allow_spawning_on_enemy_provs = yes
					count = 2
					country_score = {
						base = 100
						modifier = {
							tag = SPR
							add = 100
						}
						modifier = {
							tag = SPB
							add = 100
						}
						modifier = {
							tag = SPC
							add = 100
						}
					}
				}
			}
		}
	}

	SPA_activate_granada_fifth_columnists = {

		icon = generic_ignite_civil_war

		allowed = {
			tag = SPA
		}

		available = {
			173 = {
				NOT = { is_controlled_by = ROOT }
				any_neighbor_state = {
					is_controlled_by = ROOT
				}
			}
		}

		highlight_states = {
			highlight_state_targets = {
				state = 173
			} 
		}

		on_map_mode = map_only

		cost = 25

		fire_only_once = yes

		days_remove = 30

		modifier = {
			
		}

		visible = {
			tag = SPA
			has_global_flag = spanish_civil_war
			NOT = { has_global_flag = scw_over }
			173 = { NOT = { is_controlled_by = ROOT } }
			has_completed_focus = SPA_the_fifth_column
		}

		complete_effect = {
			
		}

		remove_effect = {
			173 = {
				create_unit = {
					division = "division_template = \"Fifth Columnist Brigade\"	start_experience_factor = 0	start_equipment_factor = 1"
					owner = ROOT
					allow_spawning_on_enemy_provs = yes
					count = 2
					country_score = {
						base = 100
						modifier = {
							tag = SPR
							add = 100
						}
						modifier = {
							tag = SPB
							add = 100
						}
						modifier = {
							tag = SPC
							add = 100
						}
					}
				}
			}
		}
	}

}

political_actions = {
	
	SPA_carlist_uprising_mission = {

		icon = generic_ignite_civil_war

		allowed = {
			tag = SPA
		}

		available = {
			if = {
				limit = {
					has_completed_focus = SPA_the_phalanx_ascendant
				}
				hidden_trigger = { always = no }
			}
			if = {
				limit = {
					has_completed_focus = SPA_unify_the_nationalist_front
				}
				has_completed_focus = SPA_fuse_the_parties
			}
		}

		priority = 10

		fire_only_once = yes

		days_mission_timeout = 316

		is_good = no

		cancel_if_not_visible = yes

		activation = {
			always = no
		}

		visible = {
			tag = SPA
			if = {
				limit = {
					has_completed_focus = SPA_the_phalanx_ascendant
				}
				NOT = { has_completed_focus = SPA_eliminate_the_carlists }
			}
			if = {
				limit = {
					has_completed_focus = SPA_unify_the_nationalist_front
				}
				NOT = { has_completed_focus = SPA_fuse_the_parties }
			}
		}

		timeout_effect = {
			if = {
				limit = {
					num_of_controlled_states > 4
				}
				country_event = lar_spain.7
			}
			else = {
				activate_mission = SPA_carlist_uprising_mission
				add_days_mission_timeout = {
					mission = SPA_carlist_uprising_mission
					days = -316
				}
			}
		}
	}
	
	SPA_appease_anti_secular_elements = {

		icon = GFX_decision_court

		allowed = {
			original_tag = SPR
		}

		available = {
			OR = {
				country_exists = SPA
				country_exists = SPB
			}
		}
		fire_only_once = yes

		visible = {
			tag = SPA
			if = {
				limit = {
					has_completed_focus = SPA_the_phalanx_ascendant
				}
				NOT = { has_completed_focus = SPA_eliminate_the_carlists }
			}
			if = {
				limit = {
					has_completed_focus = SPA_unify_the_nationalist_front
				}
				NOT = { has_completed_focus = SPA_fuse_the_parties }
			}
			NOT = {														#sanity check
				has_idea = r56i_laws_leadership_cult
				has_idea = r56i_laws_leadership_secular
				has_idea = r56i_laws_leadership_divine
				has_idea = r56i_laws_leadership_people
				has_idea = r56i_laws_leadership_communal_decision_making
				has_global_flag = NATIONAL_CHARACTERS_BLOCKED
			}
		}

		ai_will_do = {
			base = 0.1
			modifier = {
				factor = 0
				NOT = { has_active_mission = SPA_carlist_uprising_mission }
			}
			modifier = {			#just making sure they do not rise up fast
				factor = 200
				has_active_mission = SPA_carlist_uprising_mission
				date > 1937.3.1
			}
		}

		complete_effect = {
			if = {
				limit = {
					has_active_mission = SPA_carlist_uprising_mission
				}
				add_days_mission_timeout = {
					mission = SPA_carlist_uprising_mission
					days = 70
				}
			}
			add_popularity = {
				ideology = neutrality
				popularity = 0.05
			}
		}

		days_remove = 65
		modifier = {
			political_power_gain = -0.1
			consumer_goods_factor = 0.15
		}

		remove_effect = {
			add_stability = -0.05
			if = {
				limit = {
					NOT = {
						has_idea = r56i_laws_leadership_cult
						has_idea = r56i_laws_leadership_secular
						has_idea = r56i_laws_leadership_divine
						has_idea = r56i_laws_leadership_people
						has_idea = r56i_laws_leadership_communal_decision_making
					}
					NOT = {
						has_global_flag = NATIONAL_CHARACTERS_BLOCKED
					}
				}
				custom_effect_tooltip = EFFECT_CHANGE_LAW_r56i_leadership
				show_ideas_tooltip = r56i_laws_leadership_divine
				hidden_effect = {
					add_ideas = r56i_laws_leadership_divine
				}
			}
		}
	}
	
	SPA_prepare_the_merge_of_falanga_with_carlists = {

		icon = GFX_decision_eng_trade_unions_support

		allowed = {
			original_tag = SPR
		}

		available = {
			OR = {
				country_exists = SPA
				country_exists = SPB
			}
			has_country_leader = {
				character = SPA_francisco_franco
				ruling_only = yes
			}
		}

		cost = 50

		fire_only_once = yes

		visible = {
			tag = SPA
			if = {
				limit = {
					has_completed_focus = SPA_the_phalanx_ascendant
				}
				NOT = { has_completed_focus = SPA_eliminate_the_carlists }
			}
			if = {
				limit = {
					has_completed_focus = SPA_unify_the_nationalist_front
				}
				NOT = { has_completed_focus = SPA_fuse_the_parties }
			}
		}

		ai_will_do = {
			base = 0.1
			modifier = {
				factor = 0
				NOT = { has_active_mission = SPA_carlist_uprising_mission }
			}
			modifier = {			#finalizing state reforms
				factor = 200
				has_active_mission = SPA_carlist_uprising_mission
				date > 1938.1.1
			}
		}

		complete_effect = {
			if = {
				limit = {
					has_active_mission = SPA_carlist_uprising_mission
				}
				add_days_mission_timeout = {
					mission = SPA_carlist_uprising_mission
					days = 90
				}
			}
		}

		days_remove = 35
		modifier = {
			stability_weekly = -0.005
		}

		remove_effect = {
			add_popularity = {
				ideology = neutrality
				popularity = 0.1
			}
			add_popularity = {
				ideology = fascism
				popularity = 0.05
			}
		}
	}

	SPR_anarchist_uprising_mission = {

		icon = generic_ignite_civil_war

		allowed = {
			tag = SPR
		}

		available = {
			hidden_trigger = { always = no }
		}

		priority = 10

		fire_only_once = yes

		days_mission_timeout = 246

		is_good = no

		cancel_if_not_visible = yes

		activation = {
			always = no
		}

		visible = {
			tag = SPD
			NOT = { has_completed_focus = SPR_crush_the_revolution }
		}

		timeout_effect = {
			if = {
				limit = {
					num_of_controlled_states > 1
				}
				country_event = lar_spain.9
			}
			else = {
				activate_mission = SPR_anarchist_uprising_mission
				add_days_mission_timeout = {
					mission = SPR_anarchist_uprising_mission
					days = -211
				}
			}
		}
	}

	SPA_fascist_crackdown_mission = {

		icon = generic_ignite_civil_war

		allowed = {
			tag = SPA
		}

		available = {
			hidden_trigger = { always = no }
		}

		priority = 10

		fire_only_once = yes

		days_mission_timeout = 316

		is_good = no

		cancel_if_not_visible = yes

		activation = {
			always = no
		}

		visible = {
			tag = SPA
			NOT = { has_completed_focus = SPA_no_compromise_on_carlist_ideals }
		}

		timeout_effect = {
			if = {
				limit = {
					num_of_controlled_states > 4
				}
				country_event = lar_spain.8
			}
			else = {
				activate_mission = SPA_fascist_crackdown_mission
				add_days_mission_timeout = {
					mission = SPA_fascist_crackdown_mission
					days = -316
				}
			}
		}
	}

	SPR_government_crackdown_mission = {

		icon = generic_ignite_civil_war

		allowed = {
			tag = SPR
		}

		available = {
			hidden_trigger = { always = no }
		}

		priority = 10

		fire_only_once = yes

		days_mission_timeout = SPR_communists_uprising_mission_var?246

		is_good = no

		cancel_if_not_visible = yes

		activation = {
			always = no
		}

		visible = {
			tag = SPD
			NOT = { has_completed_focus = SPR_masters_of_our_own_fate }
		}

		timeout_effect = {
			if = {
				limit = {
					num_of_controlled_states > 1
				}
				country_event = lar_spain.10
			}
			else = {
				activate_mission = SPR_government_crackdown_mission
				add_days_mission_timeout = {
					mission = SPR_government_crackdown_mission
					days = -211
				}
			}
		}
	}

	SPA_save_the_alcazar_mission = {

		name = SPA_save_the_alcazar

		icon = eng_propaganda_campaigns

		allowed = {
			tag = SPA
		}

		available = {
			controls_province = 858
		}

		fire_only_once = yes

		days_mission_timeout = 140

		cancel_if_not_visible = yes

		activation = {
			always = no
		}

		visible = {
			tag = SPA
			has_global_flag = spanish_civil_war
			has_completed_focus = SPA_save_the_alcazar
		}

		complete_effect = {
			add_war_support = 0.1
			add_stability = 0.1
			add_political_power = 100
			complete_national_focus = SPA_caudillo_of_spain
			add_days_mission_timeout = {
				mission = SPA_carlist_uprising_mission
				days = 70
			}
		}

		timeout_effect = {
		}
	}

}

SPA_reassert_american_dominance = {
	
	SPA_reassert_dominance = {

		icon = eng_trade_unions_demand

		allowed = {
			original_tag = SPR
		}

		available = {
			strength_ratio = {
			    tag = FROM
			    ratio > 2
			}
		}

		target_trigger = {
			FROM = {
				capital_scope = {
					OR = {
						is_on_continent = south_america
						is_on_continent = north_america
					}
				}
				NOT = { is_subject_of = ROOT }
				NOT = { is_in_faction_with = ROOT }
				NOT = { has_war_with = ROOT }
				NOT = {
					original_tag = HOL
					original_tag = DEN
					original_tag = FRA
					original_tag = ENG
					original_tag = BRA
					original_tag = BOL
					original_tag = CAN
					original_tag = ARG
					original_tag = CHL
					original_tag = PRU
					original_tag = VEN
					original_tag = COL
					original_tag = MEX
					original_tag = USA
				}
			}
		}

		fire_only_once = yes

		visible = {
			has_completed_focus = SPA_reassert_american_dominance
			tag = SPA
		}

		complete_effect = {
			FROM = { country_event = lar_spain.19 }
		}
	}

}

SPR_expand_resource_extraction = {

	expand_basque_steel_works = { #792
		
		icon = steel

		allowed = {

		}

		highlight_states = {
			highlight_state_targets = {
				state = 792
			} 
		}

		available = {
			has_tech = construction3
			num_of_civilian_factories_available_for_projects > 2
			owns_state = 792
			controls_state = 792
		}

		visible = {
			owns_state = 792
			controls_state = 792
			792 = {
				NOT = {
					has_state_flag = basque_steel_developed
				}
			}
			OR = {
				has_completed_focus = SPR_communal_autarky
				has_completed_focus = SPA_reduce_reliance_on_foreign_resources
				has_completed_focus = SPA_support_the_war_industry
				has_completed_focus = SPA_encourage_local_mining
				has_completed_focus = SPR_exploit_spains_riches
				has_completed_focus = SPR_fuel_for_the_war_machine
			}
		}

		fire_only_once = yes

		cost = 25
		days_remove = 90

		modifier = {
			civilian_factory_use = 3
		}

		remove_effect = {
			792 = { set_state_flag = basque_steel_developed }
			792 = {
				add_resource = {
					type = steel
					amount = 8
				}
			}
		}

		ai_will_do = {
			factor = 1
		}
	}

	expand_western_aragon_steel_works = { #166
		
		icon = steel

		allowed = {

		}

		highlight_states = {
			highlight_state_targets = {
				state = 166
			} 
		}

		available = {
			has_tech = construction3
			num_of_civilian_factories_available_for_projects > 2
			owns_state = 166
			controls_state = 166
		}

		visible = {
			owns_state = 166
			controls_state = 166
			166 = {
				NOT = {
					has_state_flag = western_aragon_steel_developed
				}
			}
			OR = {
				has_completed_focus = SPR_communal_autarky
				has_completed_focus = SPA_reduce_reliance_on_foreign_resources
				has_completed_focus = SPA_support_the_war_industry
				has_completed_focus = SPA_encourage_local_mining
				has_completed_focus = SPR_exploit_spains_riches
				has_completed_focus = SPR_fuel_for_the_war_machine
			}
		}

		fire_only_once = yes

		cost = 25
		days_remove = 90

		modifier = {
			civilian_factory_use = 3
		}

		remove_effect = {
			166 = { set_state_flag = western_aragon_steel_developed }
			166 = {
				add_resource = {
					type = steel
					amount = 8
				}
			}
		}

		ai_will_do = {
			factor = 1
		}
	}

	expand_granada_steel_works = { #173
		
		icon = steel

		allowed = {

		}

		highlight_states = {
			highlight_state_targets = {
				state = 173
			} 
		}

		available = {
			has_tech = construction3
			num_of_civilian_factories_available_for_projects > 2
			owns_state = 173
			controls_state = 173
		}

		visible = {
			owns_state = 173
			controls_state = 173
			173 = {
				NOT = {
					has_state_flag = granada_steel_developed
				}
			}
			OR = {
				has_completed_focus = SPR_communal_autarky
				has_completed_focus = SPA_reduce_reliance_on_foreign_resources
				has_completed_focus = SPA_support_the_war_industry
				has_completed_focus = SPA_encourage_local_mining
				has_completed_focus = SPR_exploit_spains_riches
				has_completed_focus = SPR_fuel_for_the_war_machine
			}
		}

		fire_only_once = yes

		cost = 25
		days_remove = 90

		modifier = {
			civilian_factory_use = 3
		}

		remove_effect = {
			173 = { set_state_flag = granada_steel_developed }
			173 = {
				add_resource = {
					type = steel
					amount = 8
				}
			}
		}

		ai_will_do = {
			factor = 1
		}
	}

	develop_salamanca_tungsten_deposits = { #788
		
		icon = tungsten

		allowed = {
			
		}

		available = {
			has_tech = excavation4
			num_of_civilian_factories_available_for_projects > 2
			owns_state = 788
			controls_state = 788
		}

		highlight_states = {
			highlight_state_targets = {
				state = 788
			} 
		}

		visible = {
			owns_state = 788
			controls_state = 788
			788 = {
				NOT = {
					has_state_flag = salamanca_tungsten_developed
				}
			}
			OR = {
				has_completed_focus = SPR_communal_autarky
				has_completed_focus = SPA_reduce_reliance_on_foreign_resources
				has_completed_focus = SPA_support_the_war_industry
				has_completed_focus = SPA_encourage_local_mining
				has_completed_focus = SPR_exploit_spains_riches
				has_completed_focus = SPR_fuel_for_the_war_machine
			}
		}

		fire_only_once = yes

		cost = 25
		days_remove = 60

		modifier = {
			civilian_factory_use = 3
		}

		ai_will_do = {
			factor = 1
			modifier = {
				tag = ENG
				has_war = no
				factor = 0
			}
		}

		remove_effect = {
			788 = { set_state_flag = salamanca_tungsten_developed }
			788 = {
				add_resource = {
					type = tungsten
					amount = 12
				}
			}
		}
	}

	develop_valladolid_tungsten_deposits = { #791
		
		icon = tungsten

		allowed = {
			
		}

		available = {
			has_tech = excavation4
			num_of_civilian_factories_available_for_projects > 2
			owns_state = 791
			controls_state = 791
		}

		highlight_states = {
			highlight_state_targets = {
				state = 791
			} 
		}

		visible = {
			owns_state = 791
			controls_state = 791
			791 = {
				NOT = {
					has_state_flag = valladolid_tungsten_developed
				}
			}
			OR = {
				has_completed_focus = SPR_communal_autarky
				has_completed_focus = SPA_reduce_reliance_on_foreign_resources
				has_completed_focus = SPA_support_the_war_industry
				has_completed_focus = SPA_encourage_local_mining
				has_completed_focus = SPR_exploit_spains_riches
				has_completed_focus = SPR_fuel_for_the_war_machine
			}
		}

		fire_only_once = yes

		cost = 35
		days_remove = 60

		modifier = {
			civilian_factory_use = 3
		}

		ai_will_do = {
			factor = 1
			modifier = {
				tag = ENG
				has_war = no
				factor = 0
			}
		}

		remove_effect = {
			791 = { set_state_flag = valladolid_tungsten_developed }
			791 = {
				add_resource = {
					type = tungsten
					amount = 14
				}
			}
		}
	}

	develop_galicia_tungsten_deposits = { #171
		
		icon = tungsten

		allowed = {
			
		}

		available = {
			has_tech = excavation3
			num_of_civilian_factories_available_for_projects > 2
			owns_state = 171
			controls_state = 171
		}

		highlight_states = {
			highlight_state_targets = {
				state = 171
			} 
		}
		visible = {
			owns_state = 171
			controls_state = 171
			171 = {
				NOT = {
					has_state_flag = galicia_tungsten_developed
				}
			}
			OR = {
				has_completed_focus = SPR_communal_autarky
				has_completed_focus = SPA_reduce_reliance_on_foreign_resources
				has_completed_focus = SPA_support_the_war_industry
				has_completed_focus = SPA_encourage_local_mining
				has_completed_focus = SPR_exploit_spains_riches
				has_completed_focus = SPR_fuel_for_the_war_machine
			}
		}

		fire_only_once = yes

		cost = 25
		days_remove = 60

		modifier = {
			civilian_factory_use = 3
		}

		ai_will_do = {
			factor = 1
			modifier = {
				tag = ENG
				has_war = no
				factor = 0
			}
		}

		remove_effect = {
			171 = { set_state_flag = galicia_tungsten_developed }
			171 = {
				add_resource = {
					type = tungsten
					amount = 12
				}
			}
		}
	}

	expand_extremadura_tungsten_mines = { #170
		
		icon = tungsten

		allowed = {
			
		}

		available = {
			has_tech = excavation3
			num_of_civilian_factories_available_for_projects > 2
			owns_state = 170
			controls_state = 170
		}

		highlight_states = {
			highlight_state_targets = {
				state = 170
			} 
		}

		visible = {
			owns_state = 170
			controls_state = 170
			170 = {
				NOT = {
					has_state_flag = extremadura_tungsten_developed
				}
			}
			OR = {
				has_completed_focus = SPR_communal_autarky
				has_completed_focus = SPA_reduce_reliance_on_foreign_resources
				has_completed_focus = SPA_support_the_war_industry
				has_completed_focus = SPA_encourage_local_mining
				has_completed_focus = SPR_exploit_spains_riches
				has_completed_focus = SPR_fuel_for_the_war_machine
			}
		}

		fire_only_once = yes

		cost = 35
		days_remove = 60

		modifier = {
			civilian_factory_use = 3
		}

		ai_will_do = {
			factor = 1
			modifier = {
				tag = ENG
				has_war = no
				factor = 0
			}
		}

		remove_effect = {
			170 = { set_state_flag = extremadura_tungsten_developed }
			170 = {
				add_resource = {
					type = tungsten
					amount = 12
				}
			}
		}
	}
	
	expand_madrid_bauxite_mines = { #41
		
		icon = aluminium

		allowed = {
			
		}

		highlight_states = {
			highlight_state_targets = {
				state = 41
			} 
		}

		available = {
			has_tech = excavation3
			num_of_civilian_factories_available_for_projects > 2
			owns_state = 41
			controls_state = 41
		}

		visible = {
			owns_state = 41
			controls_state = 41
			41 = {
				NOT = {
					has_state_flag = madrid_aluminium_developed
				}
			}
			OR = {
				has_completed_focus = SPR_communal_autarky
				has_completed_focus = SPA_reduce_reliance_on_foreign_resources
				has_completed_focus = SPA_support_the_war_industry
				has_completed_focus = SPA_encourage_local_mining
				has_completed_focus = SPR_exploit_spains_riches
				has_completed_focus = SPR_fuel_for_the_war_machine
			}
		}

		fire_only_once = yes

		cost = 25
		days_remove = 60

		modifier = {
			civilian_factory_use = 3
		}

		ai_will_do = {
			factor = 1
		}
		remove_effect = { 
			41 = { set_state_flag = madrid_aluminium_developed } 
			41 = {
				add_resource = {
					type = aluminium
					amount = 8
				}
			}
		}
	}

}

SPA_preparing_the_carlist_insurrection = {

	SPA_establish_galicia_carlist_cell = {

		icon = generic_prepare_civil_war

		available = {
			controls_state = 171
			171 = {
				NOT = {
					has_state_flag = SPA_carlist_cell_flag
				}
			}
			171 = {
				NOT = {
					has_state_flag = SPA_union_militar_flag
				}
			}
			NOT = { has_country_flag = SPA_already_establishing_carlist_cell_flag }
		}

		highlight_states = {
			highlight_state_targets = {
				state = 171
			} 
		}

		on_map_mode = map_only

		cost = 50

		fire_only_once = no

		days_remove = 90

		visible = {
			has_global_flag = spanish_civil_war
			NOT = { has_global_flag = scw_over }
			has_completed_focus = SPA_prepare_the_carlist_insurrection
			NOT = { has_global_flag = SPR_carlist_uprising_flag }
		}

		cancel_if_not_visible = yes

		complete_effect = {
			set_country_flag = SPA_already_establishing_carlist_cell_flag
		}

		remove_effect = {
			171 = { set_state_flag = SPA_carlist_cell_flag }
			clr_country_flag = SPA_already_establishing_carlist_cell_flag
		}


	}

	SPA_establish_asturias_carlist_cell = {

		icon = generic_prepare_civil_war

		available = {
			controls_state = 790
			790 = {
				NOT = {
					has_state_flag = SPA_carlist_cell_flag
				}
			}
			790 = {
				NOT = {
					has_state_flag = SPA_union_militar_flag
				}
			}
			NOT = { has_country_flag = SPA_already_establishing_carlist_cell_flag }
		}

		highlight_states = {
			highlight_state_targets = {
				state = 790
			} 
		}

		on_map_mode = map_only

		cost = 50

		fire_only_once = no

		days_remove = 90

		visible = {
			has_global_flag = spanish_civil_war
			NOT = { has_global_flag = scw_over }
			has_completed_focus = SPA_prepare_the_carlist_insurrection
			NOT = { has_global_flag = SPR_carlist_uprising_flag }
		}

		cancel_if_not_visible = yes

		complete_effect = {
			set_country_flag = SPA_already_establishing_carlist_cell_flag
		}

		remove_effect = {
			790 = { set_state_flag = SPA_carlist_cell_flag }
			clr_country_flag = SPA_already_establishing_carlist_cell_flag
		}


	}

	SPA_establish_leon_carlist_cell = {

		icon = generic_prepare_civil_war

		available = {
			controls_state = 174
			174 = {
				NOT = {
					has_state_flag = SPA_carlist_cell_flag
				}
			}
			174 = {
				NOT = {
					has_state_flag = SPA_union_militar_flag
				}
			}
			NOT = { has_country_flag = SPA_already_establishing_carlist_cell_flag }
		}

		highlight_states = {
			highlight_state_targets = {
				state = 174
			} 
		}

		on_map_mode = map_only

		cost = 50

		fire_only_once = no

		days_remove = 90

		visible = {
			has_global_flag = spanish_civil_war
			NOT = { has_global_flag = scw_over }
			has_completed_focus = SPA_prepare_the_carlist_insurrection
			NOT = { has_global_flag = SPR_carlist_uprising_flag }
		}

		cancel_if_not_visible = yes

		complete_effect = {
			set_country_flag = SPA_already_establishing_carlist_cell_flag
		}

		remove_effect = {
			174 = { set_state_flag = SPA_carlist_cell_flag }
			clr_country_flag = SPA_already_establishing_carlist_cell_flag
		}


	}

	SPA_establish_valladolid_carlist_cell = {

		icon = generic_prepare_civil_war

		available = {
			controls_state = 791
			791 = {
				NOT = {
					has_state_flag = SPA_carlist_cell_flag
				}
			}
			791 = {
				NOT = {
					has_state_flag = SPA_union_militar_flag
				}
			}
			NOT = { has_country_flag = SPA_already_establishing_carlist_cell_flag }
		}

		highlight_states = {
			highlight_state_targets = {
				state = 791
			} 
		}

		on_map_mode = map_only

		cost = 50

		fire_only_once = no

		days_remove = 90

		visible = {
			has_global_flag = spanish_civil_war
			NOT = { has_global_flag = scw_over }
			has_completed_focus = SPA_prepare_the_carlist_insurrection
			NOT = { has_global_flag = SPR_carlist_uprising_flag }
		}

		cancel_if_not_visible = yes

		complete_effect = {
			set_country_flag = SPA_already_establishing_carlist_cell_flag
		}

		remove_effect = {
			791 = { set_state_flag = SPA_carlist_cell_flag }
			clr_country_flag = SPA_already_establishing_carlist_cell_flag
		}


	}

	SPA_establish_burgos_carlist_cell = {

		icon = generic_prepare_civil_war

		available = {
			controls_state = 176
			176 = {
				NOT = {
					has_state_flag = SPA_carlist_cell_flag
				}
			}
			176 = {
				NOT = {
					has_state_flag = SPA_union_militar_flag
				}
			}
			NOT = { has_country_flag = SPA_already_establishing_carlist_cell_flag }
		}

		highlight_states = {
			highlight_state_targets = {
				state = 176
			} 
		}

		on_map_mode = map_only

		cost = 50

		fire_only_once = no

		days_remove = 90

		visible = {
			has_global_flag = spanish_civil_war
			NOT = { has_global_flag = scw_over }
			has_completed_focus = SPA_prepare_the_carlist_insurrection
			NOT = { has_global_flag = SPR_carlist_uprising_flag }
		}

		cancel_if_not_visible = yes

		complete_effect = {
			set_country_flag = SPA_already_establishing_carlist_cell_flag
		}

		remove_effect = {
			176 = { set_state_flag = SPA_carlist_cell_flag }
			clr_country_flag = SPA_already_establishing_carlist_cell_flag
		}


	}

	SPA_establish_pais_vasco_carlist_cell = {

		icon = generic_prepare_civil_war

		available = {
			controls_state = 792
			792 = {
				NOT = {
					has_state_flag = SPA_carlist_cell_flag
				}
			}
			792 = {
				NOT = {
					has_state_flag = SPA_union_militar_flag
				}
			}
			NOT = { has_country_flag = SPA_already_establishing_carlist_cell_flag }
		}

		highlight_states = {
			highlight_state_targets = {
				state = 792
			} 
		}

		on_map_mode = map_only

		cost = 50

		fire_only_once = no

		days_remove = 90

		visible = {
			has_global_flag = spanish_civil_war
			NOT = { has_global_flag = scw_over }
			has_completed_focus = SPA_prepare_the_carlist_insurrection
			NOT = { has_global_flag = SPR_carlist_uprising_flag }
		}

		cancel_if_not_visible = yes

		complete_effect = {
			set_country_flag = SPA_already_establishing_carlist_cell_flag
		}

		remove_effect = {
			792 = { set_state_flag = SPA_carlist_cell_flag }
			clr_country_flag = SPA_already_establishing_carlist_cell_flag
		}


	}

	SPA_establish_navarra_carlist_cell = {

		icon = generic_prepare_civil_war

		available = {
			controls_state = 172
			172 = {
				NOT = {
					has_state_flag = SPA_carlist_cell_flag
				}
			}
			172 = {
				NOT = {
					has_state_flag = SPA_union_militar_flag
				}
			}
			NOT = { has_country_flag = SPA_already_establishing_carlist_cell_flag }
		}

		highlight_states = {
			highlight_state_targets = {
				state = 172
			} 
		}

		on_map_mode = map_only

		cost = 50

		fire_only_once = no

		days_remove = 90

		visible = {
			has_global_flag = spanish_civil_war
			NOT = { has_global_flag = scw_over }
			has_completed_focus = SPA_prepare_the_carlist_insurrection
			NOT = { has_global_flag = SPR_carlist_uprising_flag }
		}

		cancel_if_not_visible = yes

		complete_effect = {
			set_country_flag = SPA_already_establishing_carlist_cell_flag
		}

		remove_effect = {
			172 = { set_state_flag = SPA_carlist_cell_flag }
			clr_country_flag = SPA_already_establishing_carlist_cell_flag
		}


	}

	SPA_establish_western_aragon_carlist_cell = {

		icon = generic_prepare_civil_war

		available = {
			controls_state = 166
			166 = {
				NOT = {
					has_state_flag = SPA_carlist_cell_flag
				}
			}
			166 = {
				NOT = {
					has_state_flag = SPA_union_militar_flag
				}
			}
			NOT = { has_country_flag = SPA_already_establishing_carlist_cell_flag }
		}

		highlight_states = {
			highlight_state_targets = {
				state = 166
			} 
		}

		on_map_mode = map_only

		cost = 50

		fire_only_once = no

		days_remove = 90

		visible = {
			has_global_flag = spanish_civil_war
			NOT = { has_global_flag = scw_over }
			has_completed_focus = SPA_prepare_the_carlist_insurrection
			NOT = { has_global_flag = SPR_carlist_uprising_flag }
		}

		cancel_if_not_visible = yes

		complete_effect = {
			set_country_flag = SPA_already_establishing_carlist_cell_flag
		}

		remove_effect = {
			166 = { set_state_flag = SPA_carlist_cell_flag }
			clr_country_flag = SPA_already_establishing_carlist_cell_flag
		}


	}

	SPA_establish_eastern_aragon_carlist_cell = {

		icon = generic_prepare_civil_war

		available = {
			controls_state = 794
			794 = {
				NOT = {
					has_state_flag = SPA_carlist_cell_flag
				}
			}
			794 = {
				NOT = {
					has_state_flag = SPA_union_militar_flag
				}
			}
			NOT = { has_country_flag = SPA_already_establishing_carlist_cell_flag }
		}

		highlight_states = {
			highlight_state_targets = {
				state = 794
			} 
		}

		on_map_mode = map_only

		cost = 50

		fire_only_once = no

		days_remove = 90

		visible = {
			has_global_flag = spanish_civil_war
			NOT = { has_global_flag = scw_over }
			has_completed_focus = SPA_prepare_the_carlist_insurrection
			NOT = { has_global_flag = SPR_carlist_uprising_flag }
		}

		cancel_if_not_visible = yes

		complete_effect = {
			set_country_flag = SPA_already_establishing_carlist_cell_flag
		}

		remove_effect = {
			794 = { set_state_flag = SPA_carlist_cell_flag }
			clr_country_flag = SPA_already_establishing_carlist_cell_flag
		}


	}

	SPA_establish_catalunya_carlist_cell = {

		icon = generic_prepare_civil_war

		available = {
			controls_state = 165
			165 = {
				NOT = {
					has_state_flag = SPA_carlist_cell_flag
				}
			}
			165 = {
				NOT = {
					has_state_flag = SPA_union_militar_flag
				}
			}
			NOT = { has_country_flag = SPA_already_establishing_carlist_cell_flag }
		}

		highlight_states = {
			highlight_state_targets = {
				state = 165
			} 
		}

		on_map_mode = map_only

		cost = 50

		fire_only_once = no

		days_remove = 90

		visible = {
			has_global_flag = spanish_civil_war
			NOT = { has_global_flag = scw_over }
			has_completed_focus = SPA_prepare_the_carlist_insurrection
			NOT = { has_global_flag = SPR_carlist_uprising_flag }
		}

		cancel_if_not_visible = yes

		complete_effect = {
			set_country_flag = SPA_already_establishing_carlist_cell_flag
		}

		remove_effect = {
			165 = { set_state_flag = SPA_carlist_cell_flag }
			clr_country_flag = SPA_already_establishing_carlist_cell_flag
		}


	}

	SPA_establish_salamanca_carlist_cell = {

		icon = generic_prepare_civil_war

		available = {
			controls_state = 788
			788 = {
				NOT = {
					has_state_flag = SPA_carlist_cell_flag
				}
			}
			788 = {
				NOT = {
					has_state_flag = SPA_union_militar_flag
				}
			}
			NOT = { has_country_flag = SPA_already_establishing_carlist_cell_flag }
		}

		highlight_states = {
			highlight_state_targets = {
				state = 788
			} 
		}

		on_map_mode = map_only

		cost = 50

		fire_only_once = no

		days_remove = 90

		visible = {
			has_global_flag = spanish_civil_war
			NOT = { has_global_flag = scw_over }
			has_completed_focus = SPA_prepare_the_carlist_insurrection
			NOT = { has_global_flag = SPR_carlist_uprising_flag }
		}

		cancel_if_not_visible = yes

		complete_effect = {
			set_country_flag = SPA_already_establishing_carlist_cell_flag
		}

		remove_effect = {
			788 = { set_state_flag = SPA_carlist_cell_flag }
			clr_country_flag = SPA_already_establishing_carlist_cell_flag
		}


	}

	SPA_establish_madrid_carlist_cell = {

		icon = generic_prepare_civil_war

		available = {
			controls_state = 41
			41 = {
				NOT = { 
					has_state_flag = SPA_carlist_cell_flag
				}
			}
			41 = {
				NOT = {
					has_state_flag = SPA_union_militar_flag
				}
			}
			NOT = { has_country_flag = SPA_already_establishing_carlist_cell_flag }
		}

		#highlight_state_targets = { state = 41 }
		highlight_states = {
			highlight_state_targets = {
				state = 41
			} 
		}
		on_map_mode = map_only

		cost = 50

		fire_only_once = no

		days_remove = 90

		visible = {
			has_global_flag = spanish_civil_war
			NOT = { has_global_flag = scw_over }
			has_completed_focus = SPA_prepare_the_carlist_insurrection
			NOT = { has_global_flag = SPR_carlist_uprising_flag }
		}

		cancel_if_not_visible = yes

		complete_effect = {
			set_country_flag = SPA_already_establishing_carlist_cell_flag
		}

		remove_effect = {
			41 = { set_state_flag = SPA_carlist_cell_flag }
			clr_country_flag = SPA_already_establishing_carlist_cell_flag
		}


	}

	SPA_establish_guadalajara_carlist_cell = {

		icon = generic_prepare_civil_war

		available = {
			controls_state = 793
			793 = {
				NOT = {
					has_state_flag = SPA_carlist_cell_flag
				}
			}
			793 = {
				NOT = {
					has_state_flag = SPA_union_militar_flag
				}
			}
			NOT = { has_country_flag = SPA_already_establishing_carlist_cell_flag }
		}

		highlight_states = {
			highlight_state_targets = {
				state = 793
			} 
		}

		on_map_mode = map_only

		cost = 50

		fire_only_once = no

		days_remove = 90

		visible = {
			has_global_flag = spanish_civil_war
			NOT = { has_global_flag = scw_over }
			has_completed_focus = SPA_prepare_the_carlist_insurrection
			NOT = { has_global_flag = SPR_carlist_uprising_flag }
		}

		cancel_if_not_visible = yes

		complete_effect = {
			set_country_flag = SPA_already_establishing_carlist_cell_flag
		}

		remove_effect = {
			793 = { set_state_flag = SPA_carlist_cell_flag }
			clr_country_flag = SPA_already_establishing_carlist_cell_flag
		}


	}

	SPA_establish_valencia_carlist_cell = {

		icon = generic_prepare_civil_war

		available = {
			controls_state = 167
			167 = {
				NOT = {
					has_state_flag = SPA_carlist_cell_flag
				}
			}
			167 = {
				NOT = {
					has_state_flag = SPA_union_militar_flag
				}
			}
			NOT = { has_country_flag = SPA_already_establishing_carlist_cell_flag }
		}

		highlight_states = {
			highlight_state_targets = {
				state = 167
			} 
		}

		on_map_mode = map_only

		cost = 50

		fire_only_once = no

		days_remove = 90

		visible = {
			has_global_flag = spanish_civil_war
			NOT = { has_global_flag = scw_over }
			has_completed_focus = SPA_prepare_the_carlist_insurrection
			NOT = { has_global_flag = SPR_carlist_uprising_flag }
		}

		cancel_if_not_visible = yes

		complete_effect = {
			set_country_flag = SPA_already_establishing_carlist_cell_flag
		}

		remove_effect = {
			167 = { set_state_flag = SPA_carlist_cell_flag }
			clr_country_flag = SPA_already_establishing_carlist_cell_flag
		}


	}

	SPA_establish_extremadura_carlist_cell = {

		icon = generic_prepare_civil_war

		available = {
			controls_state = 170
			170 = {
				NOT = {
					has_state_flag = SPA_carlist_cell_flag
				}
			}
			170 = {
				NOT = {
					has_state_flag = SPA_union_militar_flag
				}
			}
			NOT = { has_country_flag = SPA_already_establishing_carlist_cell_flag }
		}
		highlight_states = {
			highlight_state_targets = {
				state = 170
			} 
		}

		on_map_mode = map_only

		cost = 50

		fire_only_once = no

		days_remove = 90

		visible = {
			has_global_flag = spanish_civil_war
			NOT = { has_global_flag = scw_over }
			has_completed_focus = SPA_prepare_the_carlist_insurrection
			NOT = { has_global_flag = SPR_carlist_uprising_flag }
		}

		cancel_if_not_visible = yes

		complete_effect = {
			set_country_flag = SPA_already_establishing_carlist_cell_flag
		}

		remove_effect = {
			170 = { set_state_flag = SPA_carlist_cell_flag }
			clr_country_flag = SPA_already_establishing_carlist_cell_flag
		}


	}

	SPA_establish_ciudad_real_carlist_cell = {

		icon = generic_prepare_civil_war

		available = {
			controls_state = 175
			175 = {
				NOT = {
					has_state_flag = SPA_carlist_cell_flag
				}
			}
			175 = {
				NOT = {
					has_state_flag = SPA_union_militar_flag
				}
			}
			NOT = { has_country_flag = SPA_already_establishing_carlist_cell_flag }
		}

		highlight_states = {
			highlight_state_targets = {
				state = 175
			} 
		}

		on_map_mode = map_only

		cost = 50

		fire_only_once = no

		days_remove = 90

		visible = {
			has_global_flag = spanish_civil_war
			NOT = { has_global_flag = scw_over }
			has_completed_focus = SPA_prepare_the_carlist_insurrection
			NOT = { has_global_flag = SPR_carlist_uprising_flag }
		}

		cancel_if_not_visible = yes

		complete_effect = {
			set_country_flag = SPA_already_establishing_carlist_cell_flag
		}

		remove_effect = {
			175 = { set_state_flag = SPA_carlist_cell_flag }
			clr_country_flag = SPA_already_establishing_carlist_cell_flag
		}


	}

	SPA_establish_murcia_carlist_cell = {

		icon = generic_prepare_civil_war

		available = {
			controls_state = 168
			168 = {
				NOT = {
					has_state_flag = SPA_carlist_cell_flag
				}
			}
			168 = {
				NOT = {
					has_state_flag = SPA_union_militar_flag
				}
			}
			NOT = { has_country_flag = SPA_already_establishing_carlist_cell_flag }
		}
		highlight_states = {
			highlight_state_targets = {
				state = 168
			} 
		}

		on_map_mode = map_only

		cost = 50

		fire_only_once = no

		days_remove = 90

		visible = {
			has_global_flag = spanish_civil_war
			NOT = { has_global_flag = scw_over }
			has_completed_focus = SPA_prepare_the_carlist_insurrection
			NOT = { has_global_flag = SPR_carlist_uprising_flag }
		}

		cancel_if_not_visible = yes

		complete_effect = {
			set_country_flag = SPA_already_establishing_carlist_cell_flag
		}

		remove_effect = {
			168 = { set_state_flag = SPA_carlist_cell_flag }
			clr_country_flag = SPA_already_establishing_carlist_cell_flag
		}


	}

	SPA_establish_sevilla_carlist_cell = {

		icon = generic_prepare_civil_war

		available = {
			controls_state = 169
			169 = {
				NOT = {
					has_state_flag = SPA_carlist_cell_flag
				}
			}
			169 = {
				NOT = {
					has_state_flag = SPA_union_militar_flag
				}
			}
			NOT = { has_country_flag = SPA_already_establishing_carlist_cell_flag }
		}

		highlight_states = {
			highlight_state_targets = {
				state = 169
			} 
		}

		on_map_mode = map_only

		cost = 50

		fire_only_once = no

		days_remove = 90

		visible = {
			has_global_flag = spanish_civil_war
			NOT = { has_global_flag = scw_over }
			has_completed_focus = SPA_prepare_the_carlist_insurrection
			NOT = { has_global_flag = SPR_carlist_uprising_flag }
		}

		cancel_if_not_visible = yes

		complete_effect = {
			set_country_flag = SPA_already_establishing_carlist_cell_flag
		}

		remove_effect = {
			169 = { set_state_flag = SPA_carlist_cell_flag }
			clr_country_flag = SPA_already_establishing_carlist_cell_flag
		}


	}

	SPA_establish_cordoba_carlist_cell = {

		icon = generic_prepare_civil_war

		available = {
			controls_state = 789
			789 = {
				NOT = {
					has_state_flag = SPA_carlist_cell_flag
				}
			}
			789 = {
				NOT = {
					has_state_flag = SPA_union_militar_flag
				}
			}
			NOT = { has_country_flag = SPA_already_establishing_carlist_cell_flag }
		}

		highlight_states = {
			highlight_state_targets = {
				state = 789
			} 
		}

		on_map_mode = map_only

		cost = 50

		fire_only_once = no

		days_remove = 90

		visible = {
			has_global_flag = spanish_civil_war
			NOT = { has_global_flag = scw_over }
			has_completed_focus = SPA_prepare_the_carlist_insurrection
			NOT = { has_global_flag = SPR_carlist_uprising_flag }
		}

		cancel_if_not_visible = yes

		complete_effect = {
			set_country_flag = SPA_already_establishing_carlist_cell_flag
		}

		remove_effect = {
			789 = { set_state_flag = SPA_carlist_cell_flag }
			clr_country_flag = SPA_already_establishing_carlist_cell_flag
		}


	}

	SPA_establish_granada_carlist_cell = {

		icon = generic_prepare_civil_war

		available = {
			controls_state = 173
			173 = {
				NOT = {
					has_state_flag = SPA_carlist_cell_flag
				}
			}
			173 = {
				NOT = {
					has_state_flag = SPA_union_militar_flag
				}
			}
			NOT = { has_country_flag = SPA_already_establishing_carlist_cell_flag }
		}

		highlight_states = {
			highlight_state_targets = {
				state = 173
			} 
		}

		on_map_mode = map_only

		cost = 50

		fire_only_once = no

		days_remove = 90

		visible = {
			has_global_flag = spanish_civil_war
			NOT = { has_global_flag = scw_over }
			has_completed_focus = SPA_prepare_the_carlist_insurrection

			NOT = { has_global_flag = SPR_carlist_uprising_flag }
		}

		cancel_if_not_visible = yes

		complete_effect = {
			set_country_flag = SPA_already_establishing_carlist_cell_flag
		}

		remove_effect = {
			173 = { set_state_flag = SPA_carlist_cell_flag }
			clr_country_flag = SPA_already_establishing_carlist_cell_flag
		}


	}

}

SPR_foreign_arms_purchases = {

	SPR_purchase_infantry_equipment = {

		icon = generic_prepare_civil_war

		allowed = {
			original_tag = SPR
		}

		available = {
			
		}

		cost = 25

		fire_only_once = no

		days_remove = 20

		modifier = {
			
		}

		visible = {
			OR = {
				tag = SPD
				tag = SPC
			}
			
			has_completed_focus = SPR_foreign_arms_purchases
			NOT = { has_global_flag = scw_over }
		}

		complete_effect = {
		}

		remove_effect = {
			random_list = {
				10 = {
					modifier = {
						factor = 0
						has_government = fascism
					}
					modifier = {
						factor = 0
						has_war_with = ENG
					}
					add_equipment_to_stockpile = {
					    type = infantry_equipment
					    amount = 1000
					    producer = ENG
					}
				}
				10 = {
					modifier = {
						factor = 0
						has_government = fascism
					}
					modifier = {
						factor = 0
						has_war_with = FRA
					}
					modifier = {
						factor = 0
						FRA = { NOT = { has_country_flag = FRA_arms_purchases_allowed } }
					}
					add_equipment_to_stockpile = {
					    type = infantry_equipment
					    amount = 1000
					    producer = FRA
					}
				}
				10 = {
					modifier = {
						factor = 0
						has_government = fascism
					}
					modifier = {
						factor = 0
						has_war_with = SOV
					}
					add_equipment_to_stockpile = {
					    type = infantry_equipment
					    amount = 1000
					    producer = SOV
					}
				}
				10 = {
					modifier = {
						factor = 0
						has_government = fascism
					}
					modifier = {
						factor = 0
						has_war_with = USA
					}
					add_equipment_to_stockpile = {
					    type = infantry_equipment
					    amount = 1000
					    producer = USA
					}
				}
				10 = {
					modifier = {
						factor = 0
						has_government = fascism
					}
					modifier = {
						factor = 0
						has_war_with = SWE
					}
					add_equipment_to_stockpile = {
					    type = infantry_equipment
					    amount = 1000
					    producer = SWE
					}
				}
				10 = {
					modifier = {
						factor = 0
						has_government = fascism
					}
					modifier = {
						factor = 0
						has_war_with = GER
					}
					add_equipment_to_stockpile = {
					    type = infantry_equipment
					    amount = 1000
					    producer = GER
					}
				}
				10 = {
					modifier = {
						factor = 0
						has_government = fascism
					}
					modifier = {
						factor = 0
						has_war_with = ITA
					}
					add_equipment_to_stockpile = {
					    type = infantry_equipment
					    amount = 1000
					    producer = ITA
					}
				}
			}
			effect_tooltip = {
				add_equipment_to_stockpile = {
				    type = infantry_equipment
				    amount = 1000
				    producer = ENG
				}
			}
		}

	}

	SPR_purchase_support_equipment = {

		icon = generic_prepare_civil_war

		allowed = {
			original_tag = SPR
		}

		available = {
			
		}

		cost = 25

		fire_only_once = no

		days_remove = 20

		modifier = {
			
		}

		visible = {
			tag = SPD
			has_completed_focus = SPR_foreign_arms_purchases
			NOT = { has_global_flag = scw_over }
		}

		complete_effect = {
		}

		remove_effect = {
			random_list = {
				10 = {
					modifier = {
						factor = 0
						has_government = fascism
					}
					modifier = {
						factor = 0
						has_war_with = ENG
					}
					add_equipment_to_stockpile = {
					    type = support_equipment
					    amount = 200
					    producer = ENG
					}
				}
				10 = {
					modifier = {
						factor = 0
						has_government = fascism
					}
					modifier = {
						factor = 0
						has_war_with = FRA
					}
					modifier = {
						factor = 0
						FRA = { NOT = { has_country_flag = FRA_non_military_aid_allowed } }
					}
					add_equipment_to_stockpile = {
					    type = support_equipment
					    amount = 200
					    producer = FRA
					}
				}
				10 = {
					modifier = {
						factor = 0
						has_government = fascism
					}
					modifier = {
						factor = 0
						has_war_with = SOV
					}
					add_equipment_to_stockpile = {
					    type = support_equipment
					    amount = 200
					    producer = SOV
					}
				}
				10 = {
					modifier = {
						factor = 0
						has_government = fascism
					}
					modifier = {
						factor = 0
						has_war_with = USA
					}
					add_equipment_to_stockpile = {
					    type = support_equipment
					    amount = 200
					    producer = USA
					}
				}
				10 = {
					modifier = {
						factor = 0
						has_government = fascism
					}
					modifier = {
						factor = 0
						has_war_with = SWE
					}
					add_equipment_to_stockpile = {
					    type = support_equipment
					    amount = 200
					    producer = SWE
					}
				}
				10 = {
					modifier = {
						factor = 0
						has_government = fascism
					}
					modifier = {
						factor = 0
						has_war_with = GER
					}
					add_equipment_to_stockpile = {
					    type = support_equipment
					    amount = 200
					    producer = GER
					}
				}
				10 = {
					modifier = {
						factor = 0
						has_government = fascism
					}
					modifier = {
						factor = 0
						has_war_with = ITA
					}
					add_equipment_to_stockpile = {
					    type = support_equipment
					    amount = 200
					    producer = ITA
					}
				}
			}
			effect_tooltip = {
				add_equipment_to_stockpile = {
				    type = support_equipment
				    amount = 200
				    producer = ENG
				}
			}
		}

	}

	SPR_purchase_artillery_equipment = {

		icon = generic_prepare_civil_war

		allowed = {
			original_tag = SPR
		}

		available = {
			
		}

		cost = 25

		fire_only_once = no

		days_remove = 20

		modifier = {
			
		}

		visible = {
			tag = SPD
			has_completed_focus = SPR_foreign_arms_purchases
			NOT = { has_global_flag = scw_over }
		}

		complete_effect = {
		}

		remove_effect = {
			random_list = {
				10 = {
					modifier = {
						factor = 0
						has_government = fascism
					}
					modifier = {
						factor = 0
						has_war_with = ENG
					}
					add_equipment_to_stockpile = {
					    type = artillery_equipment
					    amount = 200
					    producer = ENG
					}
				}
				10 = {
					modifier = {
						factor = 0
						has_government = fascism
					}
					modifier = {
						factor = 0
						has_war_with = FRA
					}
					modifier = {
						factor = 0
						FRA = { NOT = { has_country_flag = FRA_arms_purchases_allowed } }
					}
					add_equipment_to_stockpile = {
					    type = artillery_equipment
					    amount = 200
					    producer = FRA
					}
				}
				10 = {
					modifier = {
						factor = 0
						has_government = fascism
					}
					modifier = {
						factor = 0
						has_war_with = SOV
					}
					add_equipment_to_stockpile = {
					    type = artillery_equipment
					    amount = 200
					    producer = SOV
					}
				}
				10 = {
					modifier = {
						factor = 0
						has_government = fascism
					}
					modifier = {
						factor = 0
						has_war_with = USA
					}
					add_equipment_to_stockpile = {
					    type = artillery_equipment
					    amount = 200
					    producer = USA
					}
				}
				10 = {
					modifier = {
						factor = 0
						has_government = fascism
					}
					modifier = {
						factor = 0
						has_war_with = SWE
					}
					add_equipment_to_stockpile = {
					    type = artillery_equipment
					    amount = 200
					    producer = SWE
					}
				}
				10 = {
					modifier = {
						factor = 0
						has_government = fascism
					}
					modifier = {
						factor = 0
						has_war_with = GER
					}
					add_equipment_to_stockpile = {
					    type = artillery_equipment
					    amount = 200
					    producer = GER
					}
				}
				10 = {
					modifier = {
						factor = 0
						has_government = fascism
					}
					modifier = {
						factor = 0
						has_war_with = ITA
					}
					add_equipment_to_stockpile = {
					    type = artillery_equipment
					    amount = 200
					    producer = ITA
					}
				}
			}
			effect_tooltip = {
				add_equipment_to_stockpile = {
				    type = artillery_equipment
				    amount = 200
				    producer = ENG
				}
			}
		}

	}

	SPR_purchase_aircraft = {

		icon = generic_air

		allowed = {
			original_tag = SPR
		}

		available = {
			
		}

		cost = 25

		fire_only_once = no

		days_remove = 20

		modifier = {
			
		}

		visible = {
			tag = SPD
			has_completed_focus = SPR_foreign_arms_purchases
			NOT = { has_global_flag = scw_over }
		}

		complete_effect = {
		}

		remove_effect = {
			random_list = {
				10 = {
					modifier = {
						factor = 0
						has_government = fascism
					}
					modifier = {
						factor = 0
						has_war_with = ENG
					}
					IF = {
						limit = {
							has_dlc = "Arms Against Tyranny"
							has_dlc = "By Blood Alone"
						}
						add_equipment_subsidy = {
							cic = 350
							equipment_type = small_plane_airframe
							seller_tags = { ENG } 
						}
					}
					ELSE_IF = {
						limit = {
							has_dlc = "By Blood Alone"
							NOT = {
								has_dlc = "Arms Against Tyranny"
							}
						}
						add_equipment_to_stockpile = { 
							type = small_plane_airframe
							amount = 25
							producer = ENG
						}
					}
					ELSE = {
						add_equipment_to_stockpile = { 
							type = fighter_equipment_1
							amount = 25
							producer = ENG
						}
					}
				}
				10 = {
					modifier = {
						factor = 0
						has_government = fascism
					}
					modifier = {
						factor = 0
						has_war_with = FRA
					}
					modifier = {
						factor = 0
						FRA = { NOT = { has_country_flag = FRA_arms_purchases_allowed } }
					}

					IF = {
						limit = {
							has_dlc = "Arms Against Tyranny"
							has_dlc = "By Blood Alone"
						}
						add_equipment_subsidy = {
							cic = 350
							equipment_type = small_plane_airframe
							seller_tags = { FRA } 
						}
					}
					ELSE_IF = {
						limit = {
							has_dlc = "By Blood Alone"
							NOT = {
								has_dlc = "Arms Against Tyranny"
							}
						}
						add_equipment_to_stockpile = { 
							type = small_plane_airframe
							amount = 25
							producer = FRA
						}
					}
					ELSE = {
						add_equipment_to_stockpile = { 
							type = fighter_equipment_1
							amount = 25
							producer = FRA
						}
					}
				}
				10 = {
					modifier = {
						factor = 0
						has_government = fascism
					}
					modifier = {
						factor = 0
						has_war_with = SOV
					}
					add_equipment_to_stockpile = {
					    type = small_plane_airframe
					    amount = 25
					    producer = SOV
					}
				}
				10 = {
					modifier = {
						factor = 0
						has_government = fascism
					}
					modifier = {
						factor = 0
						has_war_with = USA
					}
					
					IF = {
						limit = {
							has_dlc = "Arms Against Tyranny"
							has_dlc = "By Blood Alone"
						}
						add_equipment_subsidy = {
							cic = 350
							equipment_type = small_plane_airframe
							seller_tags = { SOV } 
						}
					}
					ELSE_IF = {
						limit = {
							has_dlc = "By Blood Alone"
							NOT = {
								has_dlc = "Arms Against Tyranny"
							}
						}
						add_equipment_to_stockpile = { 
							type = small_plane_airframe
							amount = 25
							producer = SOV
						}
					}
					ELSE = {
						add_equipment_to_stockpile = { 
							type = fighter_equipment_1
							amount = 25
							producer = SOV
						}
					}
				}
				10 = {
					modifier = {
						factor = 0
						has_government = fascism
					}
					modifier = {
						factor = 0
						has_war_with = SWE
					}
					IF = {
						limit = {
							has_dlc = "Arms Against Tyranny"
							has_dlc = "By Blood Alone"
						}
						add_equipment_subsidy = {
							cic = 350
							equipment_type = small_plane_airframe
							seller_tags = { SWE } 
						}
					}
					ELSE_IF = {
						limit = {
							has_dlc = "By Blood Alone"
							NOT = {
								has_dlc = "Arms Against Tyranny"
							}
						}
						add_equipment_to_stockpile = { 
							type = small_plane_airframe
							amount = 25
							producer = SWE
						}
					}
					ELSE = {
						add_equipment_to_stockpile = { 
							type = fighter_equipment_1
							amount = 25
							producer = SWE
						}
					}
				}
				10 = {
					modifier = {
						factor = 0
						has_government = fascism
					}
					modifier = {
						factor = 0
						has_war_with = GER
					}
					IF = {
						limit = {
							has_dlc = "Arms Against Tyranny"
							has_dlc = "By Blood Alone"
						}
						add_equipment_subsidy = {
							cic = 350
							equipment_type = small_plane_airframe
							seller_tags = { GER } 
						}
					}
					ELSE_IF = {
						limit = {
							has_dlc = "By Blood Alone"
							NOT = {
								has_dlc = "Arms Against Tyranny"
							}
						}
						add_equipment_to_stockpile = { 
							type = small_plane_airframe
							amount = 25
							producer = GER
						}
					}
					ELSE = {
						add_equipment_to_stockpile = { 
							type = fighter_equipment_1
							amount = 25
							producer = GER
						}
					}
				}
				10 = {
					modifier = {
						factor = 0
						has_government = fascism
					}
					modifier = {
						factor = 0
						has_war_with = ITA
					}
					IF = {
						limit = {
							has_dlc = "Arms Against Tyranny"
							has_dlc = "By Blood Alone"
						}
						add_equipment_subsidy = {
							cic = 350
							equipment_type = small_plane_airframe
							seller_tags = { ITA } 
						}
					}
					ELSE_IF = {
						limit = {
							has_dlc = "By Blood Alone"
							NOT = {
								has_dlc = "Arms Against Tyranny"
							}
						}
						add_equipment_to_stockpile = { 
							type = small_plane_airframe
							amount = 25
							producer = ITA
						}
					}
					ELSE = {
						add_equipment_to_stockpile = { 
							type = fighter_equipment_1
							amount = 25
							producer = ITA
						}
					}
				}
			}
			effect_tooltip = {
				add_equipment_to_stockpile = {
				    type = small_plane_airframe
				    amount = 25
				    producer = ENG
				}
			}
		}

	}

	SPR_purchase_trucks = {

		icon = generic_prepare_civil_war

		allowed = {
			original_tag = SPR
		}

		available = {
			
		}

		cost = 25

		fire_only_once = no

		days_remove = 20

		modifier = {
			
		}

		visible = {
			tag = SPD
			has_completed_focus = SPR_foreign_arms_purchases
			NOT = { has_global_flag = scw_over }
		}

		complete_effect = {
		}

		remove_effect = {
			random_list = {
				10 = {
					modifier = {
						factor = 0
						has_government = fascism
					}
					modifier = {
						factor = 0
						has_war_with = ENG
					}
					add_equipment_to_stockpile = {
					    type = motorized_equipment
					    amount = 100
					    producer = ENG
					}
				}
				10 = {
					modifier = {
						factor = 0
						has_government = fascism
					}
					modifier = {
						factor = 0
						has_war_with = FRA
					}
					modifier = {
						factor = 0
						FRA = { NOT = { has_country_flag = FRA_non_military_aid_allowed } }
					}
					add_equipment_to_stockpile = {
					    type = motorized_equipment
					    amount = 100
					    producer = FRA
					}
				}
				10 = {
					modifier = {
						factor = 0
						has_government = fascism
					}
					modifier = {
						factor = 0
						has_war_with = SOV
					}
					add_equipment_to_stockpile = {
					    type = motorized_equipment
					    amount = 100
					    producer = SOV
					}
				}
				10 = {
					modifier = {
						factor = 0
						has_government = fascism
					}
					modifier = {
						factor = 0
						has_war_with = USA
					}
					add_equipment_to_stockpile = {
					    type = motorized_equipment
					    amount = 100
					    producer = USA
					}
				}
				10 = {
					modifier = {
						factor = 0
						has_government = fascism
					}
					modifier = {
						factor = 0
						has_war_with = SWE
					}
					add_equipment_to_stockpile = {
					    type = motorized_equipment
					    amount = 100
					    producer = SWE
					}
				}
				10 = {
					modifier = {
						factor = 0
						has_government = fascism
					}
					modifier = {
						factor = 0
						has_war_with = GER
					}
					add_equipment_to_stockpile = {
					    type = motorized_equipment
					    amount = 100
					    producer = GER
					}
				}
				10 = {
					modifier = {
						factor = 0
						has_government = fascism
					}
					modifier = {
						factor = 0
						has_war_with = ITA
					}
					add_equipment_to_stockpile = {
					    type = motorized_equipment
					    amount = 100
					    producer = ITA
					}
				}
			}
			effect_tooltip = {
				add_equipment_to_stockpile = {
				    type = motorized_equipment
				    amount = 100
				    producer = ENG
				}
			}
		}

	}

	SPR_purchase_tanks = {

		icon = generic_tank

		allowed = {
			original_tag = SPR
		}

		available = {
			
		}

		cost = 25

		fire_only_once = no

		days_remove = 20

		modifier = {
			
		}

		visible = {
			tag = SPD
			has_completed_focus = SPR_foreign_arms_purchases
			NOT = { has_global_flag = scw_over }
		}

		complete_effect = {
		}

		remove_effect = {
			random_list = {
				10 = {
					modifier = {
						factor = 0
						has_government = fascism
					}
					modifier = {
						factor = 0
						has_war_with = ENG
					}
					add_equipment_to_stockpile = {
					    type = light_tank_chassis
					    amount = 50
					    producer = ENG
					}
				}
				10 = {
					modifier = {
						factor = 0
						has_government = fascism
					}
					modifier = {
						factor = 0
						has_war_with = FRA
					}
					modifier = {
						factor = 0
						FRA = { NOT = { has_country_flag = FRA_arms_purchases_allowed } }
					}
					add_equipment_to_stockpile = {
					    type = light_tank_chassis
					    amount = 50
					    producer = FRA
					}
				}
				10 = {
					modifier = {
						factor = 0
						has_government = fascism
					}
					modifier = {
						factor = 0
						has_war_with = SOV
					}
					add_equipment_to_stockpile = {
					    type = light_tank_chassis
					    amount = 50
					    producer = SOV
					}
				}
				10 = {
					modifier = {
						factor = 0
						has_government = fascism
					}
					modifier = {
						factor = 0
						has_war_with = USA
					}
					add_equipment_to_stockpile = {
					    type = light_tank_chassis
					    amount = 50
					    producer = USA
					}
				}
				10 = {
					modifier = {
						factor = 0
						has_government = fascism
					}
					modifier = {
						factor = 0
						has_war_with = SWE
					}
					add_equipment_to_stockpile = {
					    type = light_tank_chassis
					    amount = 50
					    producer = SWE
					}
				}
				10 = {
					modifier = {
						factor = 0
						has_government = fascism
					}
					modifier = {
						factor = 0
						has_war_with = GER
					}
					add_equipment_to_stockpile = {
					    type = light_tank_chassis
					    amount = 50
					    producer = GER
					}
				}
				10 = {
					modifier = {
						factor = 0
						has_government = fascism
					}
					modifier = {
						factor = 0
						has_war_with = ITA
					}
					add_equipment_to_stockpile = {
					    type = light_tank_chassis
					    amount = 50
					    producer = ITA
					}
				}
			}
			effect_tooltip = {
				add_equipment_to_stockpile = {
				    type = light_tank_chassis
				    amount = 50
				    producer = ENG
				}
			}
		}

	}

}

SPR_the_seeds_of_revolution = {

	SPR_integrate_commune_1 = {

		name = SPR_integrate_commune

		icon = generic_nationalism

		allowed = {
			original_tag = SPR
		}

		available = {
			FROM = {
				compliance > 50
				OR = {
					is_island_state = yes
					any_neighbor_state = {
						is_core_of = ROOT
					}
				}
			}
		}

		state_target = yes

		on_map_mode = map_only

		#targets = {  }

		target_array = controlled_states

		target_trigger = {
			has_completed_focus = SPR_global_defense_council
			FROM = {
				NOT = {
					is_core_of = ROOT
				}
				OR = {
					is_island_state = yes
					any_neighbor_state = {
						is_core_of = ROOT
					}
				}
				OR = {
					NOT = {
						is_owned_by = ROOT
					}
					NOT = {
						state = 41
						state = 165
						state = 166
						state = 167
						state = 168
						state = 169
						state = 170
						state = 171
						state = 172
						state = 173
						state = 174
						state = 175
						state = 176
						state = 788
						state = 789
						state = 790
						state = 791
						state = 792
						state = 793
						state = 794
					}
				}
				compliance > 35
			}
		}

		cost = 50

		fire_only_once = yes

		days_remove = 60

		modifier = {
			political_power_gain = -1
		}

		visible = {
			tag = SPC
			has_completed_focus = SPR_global_defense_council
			always = yes
		}

		complete_effect = {

		}

		remove_effect = {
			FROM = {
				add_core_of = ROOT
			}
			transfer_state = FROM
		}
	}

	SPR_integrate_commune_2 = {

		name = SPR_integrate_commune

		icon = generic_nationalism

		allowed = {
			original_tag = SPR
		}

		available = {
			FROM = {
				compliance > 50
				NOT = {
					is_island_state = yes
					any_neighbor_state = {
						is_core_of = ROOT
					}
				}
			}
		}

		state_target = yes

		on_map_mode = map_only

		#targets = {  }

		target_array = controlled_states

		target_trigger = {
			has_completed_focus = SPR_global_defense_council
			FROM = {
				NOT = {
					is_core_of = ROOT
				}
				NOT = {
					is_island_state = yes
					any_neighbor_state = {
						is_core_of = ROOT
					}
				}
				OR = {
					NOT = {
						is_owned_by = ROOT
					}
					NOT = {
						state = 41
						state = 165
						state = 166
						state = 167
						state = 168
						state = 169
						state = 170
						state = 171
						state = 172
						state = 173
						state = 174
						state = 175
						state = 176
						state = 788
						state = 789
						state = 790
						state = 791
						state = 792
						state = 793
						state = 794
					}
				}
				compliance > 35
			}
		}

		cost = 150

		fire_only_once = yes

		days_remove = 90

		modifier = {
			political_power_gain = -1
		}

		visible = {
			tag = SPC
			has_completed_focus = SPR_global_defense_council
			always = yes
		}

		complete_effect = {

		}

		remove_effect = {
			FROM = {
				add_core_of = ROOT
			}
			transfer_state = FROM
		}
	}

	SPR_ignite_uprising = {

		icon = generic_ignite_civil_war

		allowed = {
			original_tag = SPR
		}

		available = {
			FROM = {
				has_civil_war = no
				any_controlled_state = {
					is_in_home_area = yes
					is_capital = no
				}
			}
			has_equipment = {
			    infantry_equipment > 19999
			}
			any_controlled_state = {
				NOT = { has_state_flag = anarchist_uprising }
			}
		}

		target_trigger = {
			FROM = {
				exists = yes
				has_war_with = ROOT
				any_controlled_state = {
					is_in_home_area = yes
					any_neighbor_state = {
						is_controlled_by = ROOT
					}
				}
			}
		}

		cost = 150

		fire_only_once = yes

		days_remove = 90

		modifier = {
			
		}

		visible = {
			tag = SPC
			has_completed_focus = SPR_plant_the_seeds_of_revolution
			FROM = {
				exists = yes
			}
		}

		complete_effect = {
			add_equipment_to_stockpile = {
			    type = infantry_equipment
			    amount = -20000
			}
			hidden_effect = {
				FROM = {
					set_country_flag = SPR_ignite_uprising_timer_flag
					activate_mission = SPR_ignite_uprising_timer_mission
				}
			}
		}

		remove_effect = {
			if = {
				limit = {
					any_state = {
						is_controlled_by = FROM
						is_in_home_area = yes
						is_capital = no
						NOT = { has_state_flag = anarchist_uprising }
						any_state = {
							is_controlled_by = ROOT
							NOT = { has_state_flag = anarchist_uprising }
							distance_to = {
								target = PREV
								value < 750
							}
						}
					}
				}
				random_state = {
					limit = {
						is_controlled_by = FROM
						is_in_home_area = yes
						is_capital = no
						NOT = { has_state_flag = anarchist_uprising }
						any_state = {
							is_controlled_by = ROOT
							NOT = { has_state_flag = anarchist_uprising }
							distance_to = {
								target = PREV
								value < 750
							}
						}
					}
					set_state_flag = anarchist_uprising
					create_unit = {
						division = "division_template = \"Anarchist Militia\" start_experience_factor = 0.1" 
						owner = ROOT
						allow_spawning_on_enemy_provs = yes
					}
					create_unit = {
						division = "division_template = \"Anarchist Militia\" start_experience_factor = 0.1" 
						owner = ROOT
						allow_spawning_on_enemy_provs = yes
					}
					create_unit = {
						division = "division_template = \"Anarchist Militia\" start_experience_factor = 0.1" 
						owner = ROOT
						allow_spawning_on_enemy_provs = yes
					}
				}
			}
			else_if = {
				limit = {
					any_state = {
						is_controlled_by = FROM
						is_in_home_area = yes
						is_capital = no
						NOT = { has_state_flag = anarchist_uprising }
						any_state = {
							is_controlled_by = ROOT
							NOT = { has_state_flag = anarchist_uprising }
							distance_to = {
								target = PREV
								value < 1500
							}
						}
					}
				}
				random_state = {
					limit = {
						is_controlled_by = FROM
						is_in_home_area = yes
						is_capital = no
						NOT = { has_state_flag = anarchist_uprising }
						any_state = {
							is_controlled_by = ROOT
							NOT = { has_state_flag = anarchist_uprising }
							distance_to = {
								target = PREV
								value < 1500
							}
						}
					}
					set_state_flag = anarchist_uprising
					create_unit = {
						division = "division_template = \"Anarchist Militia\" start_experience_factor = 0.1" 
						owner = ROOT
						allow_spawning_on_enemy_provs = yes
					}
					create_unit = {
						division = "division_template = \"Anarchist Militia\" start_experience_factor = 0.1" 
						owner = ROOT
						allow_spawning_on_enemy_provs = yes
					}
					create_unit = {
						division = "division_template = \"Anarchist Militia\" start_experience_factor = 0.1" 
						owner = ROOT
						allow_spawning_on_enemy_provs = yes
					}
				}
			}
			else = {
				random_state = {
					limit = {
						is_controlled_by = FROM
						is_in_home_area = yes
						is_capital = no
						NOT = { has_state_flag = anarchist_uprising }
						any_state = {
							is_controlled_by = ROOT
							NOT = { has_state_flag = anarchist_uprising }
						}
					}
					set_state_flag = anarchist_uprising
					create_unit = {
						division = "division_template = \"Anarchist Militia\" start_experience_factor = 0.1" 
						owner = ROOT
						allow_spawning_on_enemy_provs = yes
					}
					create_unit = {
						division = "division_template = \"Anarchist Militia\" start_experience_factor = 0.1" 
						owner = ROOT
						allow_spawning_on_enemy_provs = yes
					}
					create_unit = {
						division = "division_template = \"Anarchist Militia\" start_experience_factor = 0.1" 
						owner = ROOT
						allow_spawning_on_enemy_provs = yes
					}
				}
			}

			if = {
				limit = {
					FROM = { num_of_controlled_states > 4 }
				}
				if = {
					limit = {
						any_state = {
							is_controlled_by = FROM
							is_in_home_area = yes
							is_capital = no
							NOT = { has_state_flag = anarchist_uprising }
							any_state = {
								is_controlled_by = ROOT
								NOT = { has_state_flag = anarchist_uprising }
								distance_to = {
									target = PREV
									value < 750
								}
							}
						}
					}
					random_state = {
						limit = {
							is_controlled_by = FROM
							is_in_home_area = yes
							is_capital = no
							NOT = { has_state_flag = anarchist_uprising }
							any_state = {
								is_controlled_by = ROOT
								NOT = { has_state_flag = anarchist_uprising }
								distance_to = {
									target = PREV
									value < 750
								}
							}
						}
						set_state_flag = anarchist_uprising
						create_unit = {
							division = "division_template = \"Anarchist Militia\" start_experience_factor = 0.1" 
							owner = ROOT
							allow_spawning_on_enemy_provs = yes
						}
						create_unit = {
							division = "division_template = \"Anarchist Militia\" start_experience_factor = 0.1" 
							owner = ROOT
							allow_spawning_on_enemy_provs = yes
						}
						create_unit = {
							division = "division_template = \"Anarchist Militia\" start_experience_factor = 0.1" 
							owner = ROOT
							allow_spawning_on_enemy_provs = yes
						}
					}
				}
				else_if = {
					limit = {
						any_state = {
							is_controlled_by = FROM
							is_in_home_area = yes
							is_capital = no
							NOT = { has_state_flag = anarchist_uprising }
							any_state = {
								is_controlled_by = ROOT
								NOT = { has_state_flag = anarchist_uprising }
								distance_to = {
									target = PREV
									value < 1500
								}
							}
						}
					}
					random_state = {
						limit = {
							is_controlled_by = FROM
							is_in_home_area = yes
							is_capital = no
							NOT = { has_state_flag = anarchist_uprising }
							any_state = {
								is_controlled_by = ROOT
								NOT = { has_state_flag = anarchist_uprising }
								distance_to = {
									target = PREV
									value < 1500
								}
							}
						}
						set_state_flag = anarchist_uprising
						create_unit = {
							division = "division_template = \"Anarchist Militia\" start_experience_factor = 0.1" 
							owner = ROOT
							allow_spawning_on_enemy_provs = yes
						}
						create_unit = {
							division = "division_template = \"Anarchist Militia\" start_experience_factor = 0.1" 
							owner = ROOT
							allow_spawning_on_enemy_provs = yes
						}
						create_unit = {
							division = "division_template = \"Anarchist Militia\" start_experience_factor = 0.1" 
							owner = ROOT
							allow_spawning_on_enemy_provs = yes
						}
					}
				}
				else = {
					random_state = {
						limit = {
							is_controlled_by = FROM
							is_in_home_area = yes
							is_capital = no
							NOT = { has_state_flag = anarchist_uprising }
							any_state = {
								is_controlled_by = ROOT
								NOT = { has_state_flag = anarchist_uprising }
							}
						}
						set_state_flag = anarchist_uprising
						create_unit = {
							division = "division_template = \"Anarchist Militia\" start_experience_factor = 0.1" 
							owner = ROOT
							allow_spawning_on_enemy_provs = yes
						}
						create_unit = {
							division = "division_template = \"Anarchist Militia\" start_experience_factor = 0.1" 
							owner = ROOT
							allow_spawning_on_enemy_provs = yes
						}
						create_unit = {
							division = "division_template = \"Anarchist Militia\" start_experience_factor = 0.1" 
							owner = ROOT
							allow_spawning_on_enemy_provs = yes
						}
					}
				}
			}
			if = {
				limit = {
					FROM = { num_of_controlled_states > 7 }
				}
				if = {
					limit = {
						any_state = {
							is_controlled_by = FROM
							is_in_home_area = yes
							is_capital = no
							NOT = { has_state_flag = anarchist_uprising }
							any_state = {
								is_controlled_by = ROOT
								NOT = { has_state_flag = anarchist_uprising }
								distance_to = {
									target = PREV
									value < 750
								}
							}
						}
					}
					random_state = {
						limit = {
							is_controlled_by = FROM
							is_in_home_area = yes
							is_capital = no
							NOT = { has_state_flag = anarchist_uprising }
							any_state = {
								is_controlled_by = ROOT
								NOT = { has_state_flag = anarchist_uprising }
								distance_to = {
									target = PREV
									value < 750
								}
							}
						}
						set_state_flag = anarchist_uprising
						create_unit = {
							division = "division_template = \"Anarchist Militia\" start_experience_factor = 0.1" 
							owner = ROOT
							allow_spawning_on_enemy_provs = yes
						}
						create_unit = {
							division = "division_template = \"Anarchist Militia\" start_experience_factor = 0.1" 
							owner = ROOT
							allow_spawning_on_enemy_provs = yes
						}
						create_unit = {
							division = "division_template = \"Anarchist Militia\" start_experience_factor = 0.1" 
							owner = ROOT
							allow_spawning_on_enemy_provs = yes
						}
					}
				}
				else_if = {
					limit = {
						any_state = {
							is_controlled_by = FROM
							is_in_home_area = yes
							is_capital = no
							NOT = { has_state_flag = anarchist_uprising }
							any_state = {
								is_controlled_by = ROOT
								NOT = { has_state_flag = anarchist_uprising }
								distance_to = {
									target = PREV
									value < 1500
								}
							}
						}
					}
					random_state = {
						limit = {
							is_controlled_by = FROM
							is_in_home_area = yes
							is_capital = no
							NOT = { has_state_flag = anarchist_uprising }
							any_state = {
								is_controlled_by = ROOT
								NOT = { has_state_flag = anarchist_uprising }
								distance_to = {
									target = PREV
									value < 1500
								}
							}
						}
						set_state_flag = anarchist_uprising
						create_unit = {
							division = "division_template = \"Anarchist Militia\" start_experience_factor = 0.1" 
							owner = ROOT
							allow_spawning_on_enemy_provs = yes
						}
						create_unit = {
							division = "division_template = \"Anarchist Militia\" start_experience_factor = 0.1" 
							owner = ROOT
							allow_spawning_on_enemy_provs = yes
						}
						create_unit = {
							division = "division_template = \"Anarchist Militia\" start_experience_factor = 0.1" 
							owner = ROOT
							allow_spawning_on_enemy_provs = yes
						}
					}
				}
				else = {
					random_state = {
						limit = {
							is_controlled_by = FROM
							is_in_home_area = yes
							is_capital = no
							NOT = { has_state_flag = anarchist_uprising }
							any_state = {
								is_controlled_by = ROOT
								NOT = { has_state_flag = anarchist_uprising }
							}
						}
						set_state_flag = anarchist_uprising
						create_unit = {
							division = "division_template = \"Anarchist Militia\" start_experience_factor = 0.1" 
							owner = ROOT
							allow_spawning_on_enemy_provs = yes
						}
						create_unit = {
							division = "division_template = \"Anarchist Militia\" start_experience_factor = 0.1" 
							owner = ROOT
							allow_spawning_on_enemy_provs = yes
						}
						create_unit = {
							division = "division_template = \"Anarchist Militia\" start_experience_factor = 0.1" 
							owner = ROOT
							allow_spawning_on_enemy_provs = yes
						}
					}
				}
			}
			if = {
				limit = {
					FROM = { num_of_controlled_states > 11 }
				}
				if = {
					limit = {
						any_state = {
							is_controlled_by = FROM
							is_in_home_area = yes
							is_capital = no
							NOT = { has_state_flag = anarchist_uprising }
							any_state = {
								is_controlled_by = ROOT
								NOT = { has_state_flag = anarchist_uprising }
								distance_to = {
									target = PREV
									value < 750
								}
							}
						}
					}
					random_state = {
						limit = {
							is_controlled_by = FROM
							is_in_home_area = yes
							is_capital = no
							NOT = { has_state_flag = anarchist_uprising }
							any_state = {
								is_controlled_by = ROOT
								NOT = { has_state_flag = anarchist_uprising }
								distance_to = {
									target = PREV
									value < 750
								}
							}
						}
						set_state_flag = anarchist_uprising
						create_unit = {
							division = "division_template = \"Anarchist Militia\" start_experience_factor = 0.1" 
							owner = ROOT
							allow_spawning_on_enemy_provs = yes
						}
						create_unit = {
							division = "division_template = \"Anarchist Militia\" start_experience_factor = 0.1" 
							owner = ROOT
							allow_spawning_on_enemy_provs = yes
						}
						create_unit = {
							division = "division_template = \"Anarchist Militia\" start_experience_factor = 0.1" 
							owner = ROOT
							allow_spawning_on_enemy_provs = yes
						}
					}
					random_state = {
						limit = {
							is_controlled_by = FROM
							is_in_home_area = yes
							is_capital = no
							NOT = { has_state_flag = anarchist_uprising }
							any_state = {
								is_controlled_by = ROOT
								NOT = { has_state_flag = anarchist_uprising }
								distance_to = {
									target = PREV
									value < 750
								}
							}
						}
						set_state_flag = anarchist_uprising
						create_unit = {
							division = "division_template = \"Anarchist Militia\" start_experience_factor = 0.1" 
							owner = ROOT
							allow_spawning_on_enemy_provs = yes
						}
						create_unit = {
							division = "division_template = \"Anarchist Militia\" start_experience_factor = 0.1" 
							owner = ROOT
							allow_spawning_on_enemy_provs = yes
						}
						create_unit = {
							division = "division_template = \"Anarchist Militia\" start_experience_factor = 0.1" 
							owner = ROOT
							allow_spawning_on_enemy_provs = yes
						}
					}
				}
				else_if = {
					limit = {
						any_state = {
							is_controlled_by = FROM
							is_in_home_area = yes
							is_capital = no
							NOT = { has_state_flag = anarchist_uprising }
							any_state = {
								is_controlled_by = ROOT
								NOT = { has_state_flag = anarchist_uprising }
								distance_to = {
									target = PREV
									value < 1500
								}
							}
						}
					}
					random_state = {
						limit = {
							is_controlled_by = FROM
							is_in_home_area = yes
							is_capital = no
							NOT = { has_state_flag = anarchist_uprising }
							any_state = {
								is_controlled_by = ROOT
								NOT = { has_state_flag = anarchist_uprising }
								distance_to = {
									target = PREV
									value < 1500
								}
							}
						}
						set_state_flag = anarchist_uprising
						create_unit = {
							division = "division_template = \"Anarchist Militia\" start_experience_factor = 0.1" 
							owner = ROOT
							allow_spawning_on_enemy_provs = yes
						}
						create_unit = {
							division = "division_template = \"Anarchist Militia\" start_experience_factor = 0.1" 
							owner = ROOT
							allow_spawning_on_enemy_provs = yes
						}
						create_unit = {
							division = "division_template = \"Anarchist Militia\" start_experience_factor = 0.1" 
							owner = ROOT
							allow_spawning_on_enemy_provs = yes
						}
					}
					random_state = {
						limit = {
							is_controlled_by = FROM
							is_in_home_area = yes
							is_capital = no
							NOT = { has_state_flag = anarchist_uprising }
							any_state = {
								is_controlled_by = ROOT
								NOT = { has_state_flag = anarchist_uprising }
								distance_to = {
									target = PREV
									value < 1500
								}
							}
						}
						set_state_flag = anarchist_uprising
						create_unit = {
							division = "division_template = \"Anarchist Militia\" start_experience_factor = 0.1" 
							owner = ROOT
							allow_spawning_on_enemy_provs = yes
						}
						create_unit = {
							division = "division_template = \"Anarchist Militia\" start_experience_factor = 0.1" 
							owner = ROOT
							allow_spawning_on_enemy_provs = yes
						}
						create_unit = {
							division = "division_template = \"Anarchist Militia\" start_experience_factor = 0.1" 
							owner = ROOT
							allow_spawning_on_enemy_provs = yes
						}
					}
				}
				else = {
					random_state = {
						limit = {
							is_controlled_by = FROM
							is_in_home_area = yes
							is_capital = no
							NOT = { has_state_flag = anarchist_uprising }
							any_state = {
								is_controlled_by = ROOT
								NOT = { has_state_flag = anarchist_uprising }
							}
						}
						set_state_flag = anarchist_uprising
						create_unit = {
							division = "division_template = \"Anarchist Militia\" start_experience_factor = 0.1" 
							owner = ROOT
							allow_spawning_on_enemy_provs = yes
						}
						create_unit = {
							division = "division_template = \"Anarchist Militia\" start_experience_factor = 0.1" 
							owner = ROOT
							allow_spawning_on_enemy_provs = yes
						}
						create_unit = {
							division = "division_template = \"Anarchist Militia\" start_experience_factor = 0.1" 
							owner = ROOT
							allow_spawning_on_enemy_provs = yes
						}
					}
					random_state = {
						limit = {
							is_controlled_by = FROM
							is_in_home_area = yes
							is_capital = no
							NOT = { has_state_flag = anarchist_uprising }
							any_state = {
								is_controlled_by = ROOT
								NOT = { has_state_flag = anarchist_uprising }
							}
						}
						set_state_flag = anarchist_uprising
						create_unit = {
							division = "division_template = \"Anarchist Militia\" start_experience_factor = 0.1" 
							owner = ROOT
							allow_spawning_on_enemy_provs = yes
						}
						create_unit = {
							division = "division_template = \"Anarchist Militia\" start_experience_factor = 0.1" 
							owner = ROOT
							allow_spawning_on_enemy_provs = yes
						}
						create_unit = {
							division = "division_template = \"Anarchist Militia\" start_experience_factor = 0.1" 
							owner = ROOT
							allow_spawning_on_enemy_provs = yes
						}
					}
				}
			}
			if = {
				limit = {
					FROM = { num_of_controlled_states > 19 }
				}
				if = {
					limit = {
						any_state = {
							is_controlled_by = FROM
							is_in_home_area = yes
							is_capital = no
							NOT = { has_state_flag = anarchist_uprising }
							any_state = {
								is_controlled_by = ROOT
								NOT = { has_state_flag = anarchist_uprising }
								distance_to = {
									target = PREV
									value < 750
								}
							}
						}
					}
					random_state = {
						limit = {
							is_controlled_by = FROM
							is_in_home_area = yes
							is_capital = no
							NOT = { has_state_flag = anarchist_uprising }
							any_state = {
								is_controlled_by = ROOT
								NOT = { has_state_flag = anarchist_uprising }
								distance_to = {
									target = PREV
									value < 750
								}
							}
						}
						set_state_flag = anarchist_uprising
						create_unit = {
							division = "division_template = \"Anarchist Militia\" start_experience_factor = 0.1" 
							owner = ROOT
							allow_spawning_on_enemy_provs = yes
						}
						create_unit = {
							division = "division_template = \"Anarchist Militia\" start_experience_factor = 0.1" 
							owner = ROOT
							allow_spawning_on_enemy_provs = yes
						}
						create_unit = {
							division = "division_template = \"Anarchist Militia\" start_experience_factor = 0.1" 
							owner = ROOT
							allow_spawning_on_enemy_provs = yes
						}
					}
					random_state = {
						limit = {
							is_controlled_by = FROM
							is_in_home_area = yes
							is_capital = no
							NOT = { has_state_flag = anarchist_uprising }
							any_state = {
								is_controlled_by = ROOT
								NOT = { has_state_flag = anarchist_uprising }
								distance_to = {
									target = PREV
									value < 750
								}
							}
						}
						set_state_flag = anarchist_uprising
						create_unit = {
							division = "division_template = \"Anarchist Militia\" start_experience_factor = 0.1" 
							owner = ROOT
							allow_spawning_on_enemy_provs = yes
						}
						create_unit = {
							division = "division_template = \"Anarchist Militia\" start_experience_factor = 0.1" 
							owner = ROOT
							allow_spawning_on_enemy_provs = yes
						}
						create_unit = {
							division = "division_template = \"Anarchist Militia\" start_experience_factor = 0.1" 
							owner = ROOT
							allow_spawning_on_enemy_provs = yes
						}
					}
				}
				else_if = {
					limit = {
						any_state = {
							is_controlled_by = FROM
							is_in_home_area = yes
							is_capital = no
							NOT = { has_state_flag = anarchist_uprising }
							any_state = {
								is_controlled_by = ROOT
								NOT = { has_state_flag = anarchist_uprising }
								distance_to = {
									target = PREV
									value < 1500
								}
							}
						}
					}
					random_state = {
						limit = {
							is_controlled_by = FROM
							is_in_home_area = yes
							is_capital = no
							NOT = { has_state_flag = anarchist_uprising }
							any_state = {
								is_controlled_by = ROOT
								NOT = { has_state_flag = anarchist_uprising }
								distance_to = {
									target = PREV
									value < 1500
								}
							}
						}
						set_state_flag = anarchist_uprising
						create_unit = {
							division = "division_template = \"Anarchist Militia\" start_experience_factor = 0.1" 
							owner = ROOT
							allow_spawning_on_enemy_provs = yes
						}
						create_unit = {
							division = "division_template = \"Anarchist Militia\" start_experience_factor = 0.1" 
							owner = ROOT
							allow_spawning_on_enemy_provs = yes
						}
						create_unit = {
							division = "division_template = \"Anarchist Militia\" start_experience_factor = 0.1" 
							owner = ROOT
							allow_spawning_on_enemy_provs = yes
						}
					}
					random_state = {
						limit = {
							is_controlled_by = FROM
							is_in_home_area = yes
							is_capital = no
							NOT = { has_state_flag = anarchist_uprising }
							any_state = {
								is_controlled_by = ROOT
								NOT = { has_state_flag = anarchist_uprising }
								distance_to = {
									target = PREV
									value < 1500
								}
							}
						}
						set_state_flag = anarchist_uprising
						create_unit = {
							division = "division_template = \"Anarchist Militia\" start_experience_factor = 0.1" 
							owner = ROOT
							allow_spawning_on_enemy_provs = yes
						}
						create_unit = {
							division = "division_template = \"Anarchist Militia\" start_experience_factor = 0.1" 
							owner = ROOT
							allow_spawning_on_enemy_provs = yes
						}
						create_unit = {
							division = "division_template = \"Anarchist Militia\" start_experience_factor = 0.1" 
							owner = ROOT
							allow_spawning_on_enemy_provs = yes
						}
					}
				}
				else = {
					random_state = {
						limit = {
							is_controlled_by = FROM
							is_in_home_area = yes
							is_capital = no
							NOT = { has_state_flag = anarchist_uprising }
							any_state = {
								is_controlled_by = ROOT
								NOT = { has_state_flag = anarchist_uprising }
							}
						}
						set_state_flag = anarchist_uprising
						create_unit = {
							division = "division_template = \"Anarchist Militia\" start_experience_factor = 0.1" 
							owner = ROOT
							allow_spawning_on_enemy_provs = yes
						}
						create_unit = {
							division = "division_template = \"Anarchist Militia\" start_experience_factor = 0.1" 
							owner = ROOT
							allow_spawning_on_enemy_provs = yes
						}
						create_unit = {
							division = "division_template = \"Anarchist Militia\" start_experience_factor = 0.1" 
							owner = ROOT
							allow_spawning_on_enemy_provs = yes
						}
					}
					random_state = {
						limit = {
							is_controlled_by = FROM
							is_in_home_area = yes
							is_capital = no
							NOT = { has_state_flag = anarchist_uprising }
							any_state = {
								is_controlled_by = ROOT
								NOT = { has_state_flag = anarchist_uprising }
							}
						}
						set_state_flag = anarchist_uprising
						create_unit = {
							division = "division_template = \"Anarchist Militia\" start_experience_factor = 0.1" 
							owner = ROOT
							allow_spawning_on_enemy_provs = yes
						}
						create_unit = {
							division = "division_template = \"Anarchist Militia\" start_experience_factor = 0.1" 
							owner = ROOT
							allow_spawning_on_enemy_provs = yes
						}
						create_unit = {
							division = "division_template = \"Anarchist Militia\" start_experience_factor = 0.1" 
							owner = ROOT
							allow_spawning_on_enemy_provs = yes
						}
					}
				}
			}
		}

	}

	SPR_ignite_uprising_timer_mission = {

		icon = generic_ignite_civil_war

		available = {
			hidden_trigger = { always = no }
		}

		days_mission_timeout = 90

		fire_only_once = yes

		activation = {
			always = no
		}

		visible = {
			has_country_flag = SPR_ignite_uprising_timer_flag
		}

		cancel_if_not_visible = no

		is_good = yes

		timeout_effect = {
			clr_country_flag = SPR_ignite_uprising_timer_flag
			custom_effect_tooltip = SPR_ignite_uprising_timer_mission_tt
		}
	}

}

SPR_anti_fascist_unity = {

	SPR_concessions_to_the_anarchists = {

		icon = eng_trade_unions_support

		allowed = {
			original_tag = SPR
		}

		available = {
			OR = {
				country_exists = SPA
				country_exists = SPB
			}
		}

		cost = 150

		fire_only_once = no

		visible = {
			tag = SPR
			has_completed_focus = SPR_anti_fascist_unity
			NOT = { has_global_flag = scw_over }
			NOT = { has_global_flag = scw_early_end }
		}

		complete_effect = {
			add_days_mission_timeout = {
				mission = SPR_anarchist_uprising_mission
				days = 70
			}
		}

	}

}

SPR_recovering_from_civil_war = {

	SPR_eliminate_guerrillas = {

		icon = generic_civil_support

		allowed = {
			OR = {
				original_tag = SPR
				original_tag = FRA
			}

		}

		available = {
			has_equipment = {
			    infantry_equipment > 1000
			}
			#has_army_experience > 10
		}

		state_target = yes

		targets = { 41 165 166 167 168 169 170 171 172 173 174 175 176 177 178 788 789 790 791 792 793 794 }

		target_trigger = {
			OR = {
				has_completed_focus = SPA_strengthen_the_supreme_reality_of_spain
				has_completed_focus = SPA_stamp_out_the_maquis
				has_completed_focus = SPR_the_inevitable_counterblow
				has_completed_focus = SPR_all_must_do_their_part
				has_completed_focus = SPR_red_bulwark_in_the_west
				has_completed_focus = SPR_stabilize_the_nation
				has_completed_focus = FRA_pacify_the_spanish_countryside
			}
			FROM = {
				is_owned_by = ROOT
				has_dynamic_modifier = {
    				modifier = r56_SPR_post_civil_war_resistance
				}
			}
		}

		cost = 30

		fire_only_once = yes

		days_remove = 70

		ai_will_do = {
			base = 200
		}

		modifier = {
			weekly_manpower = -250
		}

		visible = {
			OR = {
				has_completed_focus = SPA_strengthen_the_supreme_reality_of_spain
				has_completed_focus = SPA_stamp_out_the_maquis
				has_completed_focus = SPR_the_inevitable_counterblow
				has_completed_focus = SPR_all_must_do_their_part
				has_completed_focus = SPR_red_bulwark_in_the_west
				has_completed_focus = SPR_stabilize_the_nation
				has_completed_focus = FRA_pacify_the_spanish_countryside
			}
		}

		complete_effect = {
			add_equipment_to_stockpile = {
			    type = infantry_equipment
			    amount = -1000
			}
			#army_experience = -10
		}

		remove_effect = {
			FROM = {
				remove_dynamic_modifier = { modifier = r56_SPR_post_civil_war_resistance }
			}
		}
	}

}
