#
# HoI - Republican Spain Events
#
#		written by Henrik Fahraeus
#

#########################################################################
#  Spanish Civil War
#########################################################################
event = {
	id = 3100
	random = no
	country = SPR

	trigger = {
		NOT = {
			exists = SPA
		}
		atwar = no
		OR = {
			government = communist
			government = democratic
		}
	}

	name = "EVT_3100_NAME"
	desc = "EVT_3100_DESC"
	style = 0
	picture = "SCW"

	date = { day = 16 month = july year = 1936 }

	action_a = {
		name = "OK" # En la Defensa de la Democracia!
		command = { type = set_domestic which = democratic value = 7 }
		command = { type = set_domestic which = political_left value = 6 }
		command = { type = civil_war which = SPA }
		command = { type = add_division value = militia }
		command = { type = add_division value = militia }
		command = { type = add_division value = militia }
		command = { type = add_division value = militia }
		command = { type = add_division value = infantry }
		command = { type = add_division value = infantry }
		command = { type = add_division value = infantry }
		command = { type = add_division value = infantry }
		command = { type = add_division value = infantry }
		command = { type = add_division value = infantry when = 0 }
		command = { type = add_division value = infantry when = 0 }
		command = { type = add_division value = infantry when = 0 }
		command = { type = headofstate which = 11033 } #Azana
		command = { type = headofgovernment which = 11062 } #Largo Caballero
		command = { type = foreignminister which = 11096 } #Barcia Trelles
		command = { type = armamentminister which = 11144 } #Giner de los Rios
		command = { type = ministerofsecurity which = 11189 } #Azcarate
		command = { type = ministerofintelligence which = 11217 } #Balboa
		command = { type = chiefofstaff which = 11007 } #Miaja
		command = { type = chiefofarmy which = 11291 } #Miaja
		command = { type = chiefofnavy which = 11309 } #Giral
		command = { type = chiefofair which = 11321 } #Hidalgo de Cisneros

		command = { type = relation which = ENG value = 10 }
		command = { type = relation which = FRA value = 10 }
		command = { type = relation which = SOV value = 5 }
		command = { type = relation which = USA value = 5 }
		command = { type = relation which = GER value = -15 }
		command = { type = relation which = ITA value = -10 }
		command = { type = relation which = POR value = -10 }

		command = { type = add_division which = "全国労働者連合義勇部隊" value = militia when = 0 }
		command = { type = add_division which = "マルクス主義統一労働者党員隊" value = militia when = 0 }
		command = { type = dissent value = 25 }

		# command = { type = trigger which = 3107 }
	}
}

#########################################################################
#  Communist Coup - Anarchist movement crushed
#########################################################################
event = {
	id = 3101
	random = no
	country = SPR

	name = "EVT_3101_NAME"
	desc = "EVT_3101_DESC"
	style = 0
	picture = "SPR_Communist_Coup"

	trigger = {
		random = 7
		NOT = {
			government = communist
			exists = SPA
			war = { country = SPA country = SPR }
		}

	}

	# Note: historical date: May 3, 1937
	date = { day = 3 month = april year = 1937 }
	offset = 7
	deathdate = { day = 3 month = june year = 1937 }

	action_a = {
		name = "OK"
		command = { type = set_domestic which = democratic value = 5 } 
		command = { type = set_domestic which = political_left value = 9 }
		command = { type = revolt which = 357 } #Barcelona Uprising-Pending balancing
		command = { type = headofstate which = 11046 }
		command = { type = headofgovernment which = 11060 }
		command = { type = foreignminister which = 11092 }
		command = { type = armamentminister which = 11134 }
		command = { type = ministerofsecurity which = 11176 }
		command = { type = ministerofintelligence which = 11217 }
		command = { type = chiefofstaff which = 11247 }
		command = { type = chiefofarmy which = 11277 }
		command = { type = chiefofnavy which = 11305 }
		command = { type = chiefofair which = 11010 }
		command = { type = domestic which = freedom value = -1 }
		command = { type = relation which = SOV value = 20 }
		command = { type = relation which = ENG value = -10 }
		command = { type = relation which = FRA value = -10 }
		command = { type = relation which = GER value = -20 }
		command = { type = relation which = ITA value = -20 }
		command = { type = relation which = USA value = -5 }
		command = { type = relation which = POR value = -15 }
		command = { type = dissent value = 10 }

		command = { type = sleepleader which = 3007 }
		command = { type = sleepleader which = 3050 }
	}
}


#########################################################################
#  Spanish Civil War - Soviet Intervention
#########################################################################
event = {
	id = 3102
	random = no
	country = SPR

	# Triggered by SOV 2623

	name = "EVT_3102_NAME"
	desc = "EVT_3102_DESC"
	style = 0
	picture = "SCW_Soviet Intervention"

	action_a = {
		name = "OK" # Great!
		command = { type = money value = -100 }
		command = { type = manpowerpool value = 10 }
		command = { type = supplies value = 2500 }
		command = { type = add_division which = "ソビエト連邦車両部隊" value = armor when = 1 }
		command = { type = add_division which = "国際旅団" value = infantry when = 0 }
		command = { type = add_division which = "ソビエト連邦戦闘機隊" value = interceptor when = 1 }
		command = { type = add_division which = "ソビエト連邦爆撃機隊" value = tactical_bomber when = 1 }
		command = { type = steal_tech which = SOV }

		command = { type = wakeleader which = 3007 }
		command = { type = wakeleader which = 3050 }
	}
}
#########################################################################
#  Spanish Civil War - UK Intervention
#########################################################################
event = {
	id = 3103
	random = no
	country = SPR

	# Triggered by UK

	name = "EVT_3103_NAME"
	desc = "EVT_3103_DESC"
        picture = "spanish_civil_war_uk"
	style = 0

	action_a = {
		name = "OK" # Great!
		command = { type = manpowerpool value = 10 }
		command = { type = supplies value = 1500 }
		command = { type = add_division value = infantry when = 0 }
	}
}
#########################################################################
#  Spanish Civil War - French Intervention
#########################################################################
event = {
	id = 3104
	random = no
	country = SPR

	# Triggered by FRA

	name = "EVT_3104_NAME"
	desc = "EVT_3104_DESC"
	style = 0
	picture = "SCW_French Intervention"

	action_a = {
		name = "OK" # Great!
		command = { type = manpowerpool value = 10 }
		command = { type = supplies value = 1500 }
		command = { type = add_division value = infantry when = 0 }
	}
}
#########################################################################
#  Democracy Defended - Germany don't support the Nationalists
#########################################################################
event = {
	id = 3105
	random = no
	country = SPR

	# Triggered by GER2023

	name = "EVT_3105_NAME"
	desc = "EVT_3105_DESC"
	style = 0
	picture = "SCW"

	action_a = {
		name = "OK" # Great!
		command = { type = manpowerpool value = 40 }
		command = { type = supplies value = 1500 }
		command = { type = add_division value = infantry when = 0 }
		command = { type = add_division value = infantry when = 0 }
		command = { type = add_division value = infantry when = 0 }
	}
}
#########################################################################
#  Democracy Defended - Italy don't support the Nationalists
#########################################################################
event = {
	id = 3106
	random = no
	country = SPR

	# Triggered by ITA2901

	name = "EVT_3106_NAME"
	desc = "EVT_3105_DESC"
	style = 0
	picture = "SCW"

	action_a = {
		name = "OK" # Great!
		command = { type = manpowerpool value = 40 }
		command = { type = supplies value = 1500 }
		command = { type = add_division value = infantry when = 0 }
		command = { type = add_division value = infantry when = 0 }
		command = { type = add_division value = infantry when = 0 }
	}
}

#########################################################################
#  Spanish Civil War - Follow up event - Ceding oversea provinces to SPA
#########################################################################
event = {
	id = 3107
	random = no
	country = SPR

	trigger = {
		event = 3100 
		exists = SPA
		war = { country = SPA country = SPR }
		}

	name = "EVT_3107_NAME"
	desc = "EVT_3107_DESC"
	style = 0
	picture = "SCW"

	date = { day = 16 month = july	year = 1936 }
	offset = 1
	deathdate = { day = 30	month = december year = 1963 }

	action_a = {
		name = "OK" # En la Defensa de la Democracia!
		command = { type = secedeprovince which = SPA value = 535 } # Mallorca
		command = { type = secedeprovince which = SPA value = 536 } # Menorca
		command = { type = secedeprovince which = SPA value = 537 } # Ibiza
		command = { type = secedeprovince which = SPA value = 954 } # Melilla
		command = { type = secedeprovince which = SPA value = 955 } # Villa Sanjurjo
		command = { type = secedeprovince which = SPA value = 957 } # Ceuta
		command = { type = secedeprovince which = SPA value = 961 } # Lanzarote
		command = { type = secedeprovince which = SPA value = 962 } # Fuerteventura
		command = { type = secedeprovince which = SPA value = 963 } # Gran Canaria
		command = { type = secedeprovince which = SPA value = 964 } # Tenerife
		command = { type = secedeprovince which = SPA value = 965 } # La Palma
		command = { type = secedeprovince which = SPA value = 967 } # Ifni
		command = { type = secedeprovince which = SPA value = 971 } # El Aaiun
		command = { type = secedeprovince which = SPA value = 972 } # Villa Cisneros
		command = { type = secedeprovince which = SPA value = 1091 } # Bata
	}
}

#########################################################################
# Republican Spain wins the Civil War
#########################################################################
event = {
	id = 3108
	random = no
	country = SPR
 
	trigger = {
		owned = { province = 341 data = SPR }
		NOT = { 
			exists = SPA 
			event = 3004 
			}
		}

	name = "EVT_3108_NAME" 
	desc = "EVT_3108_DESC"

	date = { day = 18 month = july year = 1936 }
	offset = 5
	deathdate = { day = 30 month = december year = 1999 }

	action_a = {
		name = "OK"
		# In case any Italian & German units given to SPA survives the war.
		command = { type = remove_division which = "コンドル軍団爆撃機隊" value = SPR }
		command = { type = remove_division which = "コンドル軍団戦闘機隊" value = SPR }
		command = { type = remove_division which = "コンドル軍団装甲部隊" value = SPR }
		command = { type = remove_division which = "リットリオ部隊" value = SPR }
		command = { type = remove_division which = "ディオ・ロ・ヴォーレ部隊" value = SPR }
		command = { type = remove_division which = "フィアンメ・ネーレ部隊" value = SPR }
		command = { type = remove_division which = "ペンネ・ネーレ部隊" value = SPR }
		command = { type = remove_division which = "航空軍団爆撃機隊" value = SPR }
		command = { type = remove_division which = "航空軍団戦闘機隊" value = SPR }

		# In case any of these four Communist, Anarchist & Fascist militia survive SCW.
		command = { type = remove_division which = "全国労働者連合義勇部隊" value = SPR }
		command = { type = remove_division which = "マルクス主義統一労働者党員隊" value = SPR }
		command = { type = remove_division which = "第1ファランヘ党員隊" value = SPR }
		command = { type = remove_division which = "第2ファランヘ党員隊" value = SPR }
		# Soviet units
		command = { type = remove_division which = "ソビエト連邦車両部隊" value = SPR }	
		command = { type = remove_division which = "国際旅団" value = SPR }
		command = { type = remove_division which = "ソビエト連邦戦闘機隊" value = SPR }
		command = { type = remove_division which = "ソビエト連邦爆撃機隊" value = SPR }

		command = { type = sleepevent which = 3004 }	# SPA SCW win event
		command = { type = capital which = 341 }
	}	
}