capital = 277

oob = "MEX_1936"

IF = {
	limit = { has_dlc = "Man the Guns" }
		set_naval_oob = "MEX_1936_naval_mtg"
	ELSE = {
		set_naval_oob = "MEX_1936_naval_legacy"
	}
}
IF = {
	limit = { has_dlc = "By Blood Alone" }
	set_air_oob = "MEX_1936_air_bba"
	set_technology = {
		aa_lmg = 1
		engines_1 = 1
		early_bombs = 1
		aircraft_construction = 1
		iw_small_airframe = 1
	}
	ELSE = {
		set_air_oob = "MEX_1936_air_legacy"
		set_technology = {
			early_fighter = 1
			early_bomber = 1
			CAS1 = 1

		}
	}
}

# Starting tech
set_technology = {
	infantry_weapons = 1
	tech_trucks = 1
	gw_artillery = 1
	interwar_antiair = 1
	
	fuel_silos = 1
	fuel_refining = 1
}
IF = {
	limit = {
		has_dlc = "No Step Back"
	}
	set_technology = {
		gwtank_chassis = 1
	}
}
IF = {
	limit = {
		NOT = { has_dlc = "No Step Back" }
	}
	set_technology = {
		gwtank = 1
	}
}
IF = {
	limit = { not = { has_dlc = "Man the Guns" } }
	set_technology = {
		early_submarine = 1
		early_destroyer = 1
		early_light_cruiser = 1
		early_heavy_cruiser = 1
	}
}
IF = {
	limit = { has_dlc = "Man the Guns" }
	set_technology = {
		basic_naval_mines = 1
		early_ship_hull_light = 1
		early_ship_hull_submarine = 1
		basic_battery = 1
		coastal_defense_ships = 1
	}
}

set_country_flag = monroe_doctrine

set_convoys = 45
set_stability = 0.2
set_war_support = 0.1

IF = {
	limit = {
		has_dlc = "Man the Guns"
	}
	add_ideas = {
		MEX_callistas
		MEX_church_power_2
		MEX_oil_concessions
		MEX_politicised_army
		MEX_cedillo_tension_2
	}
}

1939.1.1 = {
	add_political_power = 1198
	add_command_power = 100

	set_global_flag = flag_mexico_cedillo_has_revolted
	
	oob = "MEX_1939"
	IF = {
		limit = { has_dlc = "By Blood Alone" }
			set_air_oob = "MEX_1936_air_bba" #deliberately using 1936
		ELSE = {
			set_air_oob = "MEX_1936_air_legacy"
		}
	}
	IF = {
		limit = { has_dlc = "Man the Guns" }
			set_naval_oob = "MEX_1939_naval_mtg"
		ELSE = {
			set_naval_oob = "MEX_1939_naval_legacy"
		}
	}
	
	set_technology = {
		interwar_artillery = 1
		infantry_weapons1 = 1
		infantry_weapons2 = 1
		support_weapons = 1

		#doctrines
		air_superiority = 1
		grand_battle_plan = 1
		trench_warfare = 1
		fleet_in_being = 1
		battlefleet_concentration = 1

		#electronics
		electronic_mechanical_engineering = 1
		radio = 1
		mechanical_computing = 1
		computing_machine = 1

		#industry
		basic_machine_tools = 1
		improved_machine_tools = 1
		advanced_machine_tools = 1
		fuel_refining2 = 1
		construction1 = 1
		construction2 = 1
		construction3 = 1
		dispersed_industry = 1
		dispersed_industry2 = 1
		dispersed_industry3 = 1
	}
	complete_special_project = {
		project = sp:sp_air_radar
	}

	IF = {
		limit = {
			has_dlc = "Man the Guns"
		}

		remove_ideas = {
			MEX_cedillo_tension_2 # Already rebelled by this point
		}
		
		complete_national_focus = MEX_focus_plan_of_agua_prieta
		# 70
		complete_national_focus = MEX_focus_exile_calles # Increase Church Power (3)
		# 140
		complete_national_focus = MEX_focus_control_the_army
		# 210
		complete_national_focus = MEX_focus_repeal_the_calles_law # Increase Church Power (4)
		# 280
		complete_national_focus = MEX_focus_peripheral_infrastructure
		# 350
		complete_national_focus = MEX_focus_rural_schools # 3rd research slot, decrease Church Power (3)
		# 420
		complete_national_focus = MEX_focus_national_bank
		# 490
		complete_national_focus = MEX_focus_agricultural_credit_bank
		# 560
		complete_national_focus = MEX_focus_rent_freeze
		# 630
		complete_national_focus = MEX_focus_confederation_of_mexican_workers # Decrease Church Power (2)
		# 700
		complete_national_focus = MEX_focus_ejido_worker_militias # Communist drift
		# 770
		complete_national_focus = MEX_focus_oil_field_expansion
		# 840
		complete_national_focus = MEX_focus_rural_infrastructure
		# 910
		unlock_national_focus = MEX_focus_nationalize_the_oil_fields
		# 980
		remove_ideas = {
			MEX_oil_concessions
		}
		
		ENG = {
			add_opinion_modifier = {
				target = MEX
				modifier = embargo
			}
		}
		USA = {
			add_opinion_modifier = {
				target = MEX
				modifier = embargo
			}
		}
		add_opinion_modifier = {
			target = ENG
			modifier = embargo
		}
		add_opinion_modifier = {
			target = USA
			modifier = embargo
		}
		
		ELSE = {
			#generic focuses
			complete_national_focus = army_effort
			complete_national_focus = equipment_effort
			complete_national_focus = motorization_effort
			complete_national_focus = aviation_effort
			complete_national_focus = naval_effort
			complete_national_focus = large_navy
			complete_national_focus = industrial_effort
			complete_national_focus = construction_effort
			complete_national_focus = production_effort
		}
	}
}

set_politics = {
	ruling_party = neutrality
	last_election = "1934.7.1"
	election_frequency = 72
	elections_allowed = yes
}
set_popularities = {
	democratic = 18
	fascism = 20
	communism = 9
	neutrality = 53
}

### VARIANTS ###
# 1936 Start #
IF = {
	limit = { not = { has_dlc = "Man the Guns" } }
	create_equipment_variant = {
		name = "Durango Class"
		type = destroyer_1
		upgrades = {
			ship_anti_air_upgrade = 1
		}
		obsolete = yes
	}
	create_equipment_variant = {
		name = "Nicolás Bravo Class"
		type = destroyer_1
		upgrades = {
			ship_torpedo_upgrade = 1
			destroyer_engine_upgrade = 1
			ship_ASW_upgrade = 1
			ship_anti_air_upgrade = 2
		}
	}
}
IF = {
	limit = { has_dlc = "Man the Guns" }
	# Destroyers #
	create_equipment_variant = {
		name = "Nicolás Bravo Class"			
		type = ship_hull_light_1
		name_group = MEX_DD_HISTORICAL
		parent_version = 0
		modules = {
			fixed_ship_battery_slot = ship_light_battery_1
			fixed_ship_anti_air_slot = empty
			fixed_ship_fire_control_system_slot = ship_fire_control_system_0
			fixed_ship_radar_slot = empty
			fixed_ship_engine_slot = light_ship_engine_1
			fixed_ship_torpedo_slot = empty
			mid_1_custom_slot = empty
			rear_1_custom_slot = empty
		}
		obsolete = yes
	}
	create_equipment_variant = {
		name = "Durango Class"			# represents both Guanajuato and Durango classes (gunboats)
		type = ship_hull_light_1
		name_group = MEX_DD_HISTORICAL
		parent_version = 0
		modules = {
			fixed_ship_battery_slot = ship_light_battery_1
			fixed_ship_anti_air_slot = ship_anti_air_1
			fixed_ship_fire_control_system_slot = ship_fire_control_system_0
			fixed_ship_radar_slot = empty
			fixed_ship_engine_slot = light_ship_engine_1
			fixed_ship_torpedo_slot = empty
			mid_1_custom_slot = empty
			rear_1_custom_slot = empty
		}
	}
	create_equipment_variant = {
		name = "Anahuac Class"			
		type = ship_hull_cruiser_coastal_defense_ship
		name_group = MEX_BB_HISTORICAL
		parent_version = 0
		modules = {
			fixed_ship_battery_slot = ship_medium_battery_1
			fixed_ship_anti_air_slot = empty
			fixed_ship_fire_control_system_slot = ship_fire_control_system_0
			fixed_ship_radar_slot = empty
			fixed_ship_engine_slot = cruiser_ship_engine_1
			fixed_ship_secondaries_slot = ship_secondaries_1
			fixed_ship_armor_slot = ship_armor_cruiser_1
			mid_1_custom_slot = empty
			rear_1_custom_slot = empty
		}
	}
}




