capital = 279

IF = {
	limit = { 
		has_dlc = "Trial of Allegiance"
	}
	set_oob = "CHL_TOA_1936"
}
IF = {
	limit = {
		NOT = {
			has_dlc = "Trial of Allegiance"
		}
	}
	set_oob = "CHL_1936"
}

IF = {
	limit = { 
		has_dlc = "Trial of Allegiance"
	}
	### Set National Spirits ###
	add_ideas = {
		CHL_the_mapuche_conflict
		idea_CHL_the_Hacienda_inquilinaje_system
		idea_CHL_near_anarchic_society
		idea_CHL_repubican_guard
		SMB_MTG_naval_arms_race_legacy
	}

	### Set Base Values ###
	set_war_support = 0.25 
	set_stability = 0.40

	### Set dynamic modifiers ###
	add_dynamic_modifier = {
		modifier = CHL_chilean_economy_dynamic_modifier
	}
	JUNO_set_shared_military_branch_defaults = yes

	# The Economy Modifier 
	set_variable = { CHL_economy_stability_factor = -0.05 }
	set_variable = { CHL_economy_consumer_goods_factor = 0.1 }
	set_variable = { CHL_economy_production_speed_buildings_factor = -0.15 }
	set_variable = { CHL_economy_local_resources_factor = -0.1 }
	set_variable = { CHL_economy_industrial_capacity_dockyard = -0.05 }
	set_variable = { CHL_economy_industrial_capacity_factory = -0.15 }
	set_variable = { CHL_economy_political_advisor_cost_factor = 0.00 }

	# Mapuche Nationalism Modifier
	set_variable = { CHL_mapuche_nationalism_stability_factor = 0.0 }
	set_variable = { CHL_mapuche_nationalism_production_speed_buildings_factor = 0.0 }
	set_variable = { CHL_mapuche_nationalism_war_support_factor = 0.0 }
	set_variable = { CHL_mapuche_nationalism_recruitable_population_factor = 0.0 }
	set_variable = { CHL_mapuche_nationalism_consumer_goods_factor = 0.0 }
	set_variable = { CHL_mapuche_nationalism_political_power_factor = 0.15 }
	set_variable = { CHL_mapuche_nationalism_industrial_capacity_dockyard = 0.0 }
	set_variable = { CHL_mapuche_nationalism_industrial_capacity_factory = 0.0 }
	set_variable = { CHL_mapuche_nationalism_research_speed_factor = 0.0 }
	set_variable = { CHL_mapuche_nationalism_army_core_defence_factor = 0.0 }
	set_variable = { CHL_mapuche_nationalism_modifier_compliance_gain = 0.0 }
	set_variable = { CHL_mapuche_nationalism_resistance_target_on_our_occupied_states = 0.0 }
	set_variable = { CHL_mapuche_nationalism_army_org_factor = 0.0 }
	set_variable = { CHL_mapuche_nationalism_army_morale_factor = 0.0 }

	### Activate Missions ###
	country_event = {
		id = CHL_political_events.95
		days = 7
	}

	### Set Country Flags ###
	set_country_flag = CHL_no_fascist_focuses_done 

}

### Starting technologies ###
set_technology = {
	infantry_weapons = 1
	gw_artillery = 1
	basic_train = 1
}

IF = {
	limit = { has_dlc = "Man the Guns" }
		set_naval_oob = "CHL_1936_naval_mtg"
	ELSE = {
		set_naval_oob = "CHL_1936_naval_legacy"
	}
}
IF = {
	limit = { has_dlc = "By Blood Alone" }
		set_air_oob = "CHL_1936_air_bba"
		set_technology = {
			iw_small_airframe = 1
			aa_lmg = 1
			engines_1 = 1
		}
	ELSE = {
		set_air_oob = "CHL_1936_air_legacy"
		set_technology = {
			early_fighter = 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
		early_battleship = 1
		transport = 1
	}
}
IF = {
	limit = { has_dlc = "Man the Guns" }
	set_technology = {
		basic_naval_mines = 1
		early_ship_hull_light = 1
		early_ship_hull_submarine = 1
		early_ship_hull_cruiser = 1
		early_ship_hull_heavy = 1
		basic_battery = 1
		basic_torpedo = 1
		basic_depth_charges = 1
		coastal_defense_ships = 1
		mtg_transport = 1
	}
}

### Recruiting Characters ###
IF = {
	limit = { 
		NOT = {
			has_dlc = "Trial of Allegiance"
		}
	}
	recruit_character = CHL_arturo_alessandri
	recruit_character = CHL_jorge_gonzález_von_marées
	recruit_character = CHL_carlos_contreras_labarca
	recruit_character = CHL_escudero_oscar_otárola
	recruit_character = CHL_domingo_blanco # not in the dlc
	recruit_character = CHL_julio_allard_pinto
	recruit_character = CHL_gustavo_silva # not in the dlc
	recruit_character = CHL_jose_luis_sanchez_besa
	recruit_character = CHL_marmaduke_grove
	recruit_character = CHL_e_novoa_fuentes
	recruit_character = CHL_dario_mujica_gamboa
	recruit_character = CHL_c_j_de_la_motte
	recruit_character = CHL_carlos_fuentes_rabe
	recruit_character = CHL_arturo_espinoza_mujica
	recruit_character = CHL_carlos_puga_monsalve
	recruit_character = CHL_francisco_o_ryan_orrego
	recruit_character = CHL_ernesto_m_orlando
	recruit_character = CHL_dario_cellejas_rojas
	recruit_character = CHL_ariosto_herrera
	recruit_character = CHL_luis_alamos_barros
	recruit_character = CHL_miguel_cruchaga_tacomal
	recruit_character = CHL_gustavo_ross_santa_maria
	ELSE_IF = {
		limit = {
			has_dlc = "Trial of Allegiance"
		}
		recruit_character = CHL_arturo_alessandri
		recruit_character = CHL_jorge_gonzález_von_marées
		recruit_character = CHL_carlos_contreras_labarca
		recruit_character = CHL_pedro_aguirre_cerda
		recruit_character = CHL_escudero_oscar_otárola
		recruit_character = CHL_julio_allard_pinto
		recruit_character = CHL_jose_luis_sanchez_besa
		recruit_character = CHL_marmaduke_grove
		recruit_character = CHL_e_novoa_fuentes
		recruit_character = CHL_carlos_fuentes_rabe
		recruit_character = CHL_arturo_espinoza_mujica
		recruit_character = CHL_ariosto_herrera
		recruit_character = CHL_luis_alamos_barros
		recruit_character = CHL_miguel_cruchaga_tacomal
		recruit_character = CHL_gustavo_ross_santa_maria
		recruit_character = CHL_elias_lafertte_gavino
		recruit_character = CHL_carlos_ibanez
		recruit_character = CHL_carlos_keller_reuff
		recruit_character = CHL_juan_gomez_millas
		recruit_character = CHL_manuel_hidalgo_plaza
		recruit_character = CHL_juan_antonio_rios
		recruit_character = CHL_gabriel_gonzales_videla
		recruit_character = CHL_eduardo_cruz_coke
		recruit_character = CHL_fernando_alessandri
		recruit_character = CHL_antoine_iii
		recruit_character = CHL_manuel_manquilef
		recruit_character = CHL_venancio_huenchual
		recruit_character = CHL_esteban_romero_sandoval
		recruit_character = CHL_bartolome_blanche
		recruit_character = CHL_pedro_dartnell
		recruit_character = CHL_guillermo_barrios_tirado
		recruit_character = CHL_francisco_valderrama
		recruit_character = CHL_augustin_de_guevara
		recruit_character = CHL_pedro_calderon
		recruit_character = CHL_ricardo_aguayo
		recruit_character = CHL_humberto_valdivieso
		recruit_character = CHL_gregorio_tascon
		recruit_character = CHL_rafael_reyes
		recruit_character = CHL_vincente_merino_bielich
		recruit_character = CHL_oscar_reeves_leiva
		recruit_character = CHL_oscar_fuentes_pantoja
		recruit_character = CHL_alfredo_portales_mourgues
		recruit_character = CHL_olegario_reyes
		recruit_character = CHL_emilio_soto
		recruit_character = CHL_jorge_cobo
		recruit_character = CHL_peter_hansen
		recruit_character = CHL_manuel_pedregal
		recruit_character = CHL_augusto_pimochet
		recruit_character = CHL_carlos_prats
		recruit_character = CHL_rene_schneider
		recruit_character = CHL_ulk
		recruit_character = CHL_arnaldo_carrasco
		recruit_character = CHL_elena_caffarena
		recruit_character = CHL_pablo_neruda
		recruit_character = CHL_jaime_quintana
		recruit_character = CHL_maria_de_la_cruz
		recruit_character = CHL_salvador_allende
		recruit_character = CHL_rayen_quitral
		recruit_character = CHL_jorge_alessandri
		recruit_character = CHL_guido_beck
		recruit_character = CHL_gabriela_mistral
		recruit_character = CHL_juan_rosetti
		recruit_character = CHL_emilio_codesido
		recruit_character = CHL_ernesto_jarpa
		recruit_character = CHL_francisco_encina
		recruit_character = CHL_jose_morales
		recruit_character = CHL_ramon_perez
		recruit_character = CHL_manuel_panguilef
		recruit_character = CHL_oskar_schnake
		recruit_character = CHL_bernardo_leighton
		recruit_character = CHL_tancredo_pinochet
		recruit_character = CHL_emilio_diaz
		recruit_character = CHL_radomiro_romero
		recruit_character = CHL_roberto_araya
		recruit_character = CHL_arturo_olavaria
		recruit_character = CHL_rolando_reyes
		recruit_character = CHL_diego_aguilar
		recruit_character = CHL_arturo_benitez
		recruit_character = CHL_jeronimo_mendez
		recruit_character = CHL_miguel_serrano
		recruit_character = CHL_manuel_neculman
		recruit_character = CHL_benjamin_larrain
		recruit_character = CHL_pedro_alfonso
		recruit_character = CHL_guillermo_araya
		recruit_character = CHL_marta_vergara
		recruit_character = CHL_osvaldo_lira_perez
		recruit_character = CHL_quintin_lame
		recruit_character = CHL_carlos_huayquinir
	}
}

IF = {
	limit = {
		AND = {
			has_dlc = "La Resistance"
			has_dlc = "Trial of Allegiance"
		}
	}
	JUNO_create_rosita_serrano_operative = yes
}

set_country_flag = monroe_doctrine

set_convoys = 50

set_politics = {
	ruling_party = democratic
	last_election = "1932.10.30"
	election_frequency = 72  #but 4 years after this one in 1938.
	elections_allowed = yes
}
set_popularities = {
	democratic = 80
	communism = 10
	fascism = 7
	neutrality = 3
}

### VARIANTS ###
# 1936 Start #
IF = {
	limit = { NOT = { has_dlc = "Man the Guns" } }
	### Ship Variants ###
	create_equipment_variant = {
		name = "Capitán O'Brien Class"
		type = submarine_1
		upgrades = {
			ship_reliability_upgrade = 1
			sub_engine_upgrade = 1
			sub_stealth_upgrade = 1
			sub_torpedo_upgrade = 1
		}
	}
	create_equipment_variant = {
		name = "Serrano Class"
		type = destroyer_1
		upgrades = {
			ship_torpedo_upgrade = 1
			destroyer_engine_upgrade = 1
			ship_ASW_upgrade = 1
			ship_anti_air_upgrade = 1
		}
	}
}
IF = {
	limit = { has_dlc = "Man the Guns" }
	# Submarines #
	create_equipment_variant = {
		name = "H1 Class"				
		type = ship_hull_submarine_1
		name_group = CHL_SS_HISTORICAL
		parent_version = 0
		modules = {
			fixed_ship_torpedo_slot = ship_torpedo_sub_1
			fixed_ship_engine_slot = sub_ship_engine_1
			rear_1_custom_slot = empty
		}
		obsolete = yes
	}
	create_equipment_variant = {
		name = "Capitán O'Brien Class"				
		type = ship_hull_submarine_1
		name_group = CHL_SS_HISTORICAL
		parent_version = 0
		modules = {
			fixed_ship_torpedo_slot = ship_torpedo_sub_1
			fixed_ship_engine_slot = sub_ship_engine_1
			rear_1_custom_slot = ship_torpedo_sub_1
		}
	}
	# Destroyers #
	create_equipment_variant = {
		name = "Almirante Lynch Class"				
		type = ship_hull_light_1
		name_group = CHL_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 = ship_torpedo_1
			mid_1_custom_slot = empty
			rear_1_custom_slot = empty
		}
		obsolete = yes
	}
	create_equipment_variant = {
		name = "Serrano Class"	
		type = ship_hull_light_1
		name_group = CHL_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 = ship_torpedo_1
			mid_1_custom_slot = ship_mine_layer_1
			rear_1_custom_slot = ship_depth_charge_1
		}
	}
	# Cruisers #
	create_equipment_variant = {
		name = "O'Higgins Class"				
		type = ship_hull_cruiser_coastal_defense_ship
		name_group = CHL_CA_HISTORICAL
		parent_version = 0
		modules = {
			fixed_ship_battery_slot = ship_medium_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 = cruiser_ship_engine_1
			fixed_ship_armor_slot = ship_armor_cruiser_1
			fixed_ship_secondaries_slot = ship_secondaries_1
			mid_1_custom_slot = empty
			mid_2_custom_slot = empty
			rear_1_custom_slot = empty
		}
	}
	create_equipment_variant = {
		name = "Chacabuco Class"				
		type = ship_hull_cruiser_coastal_defense_ship
		name_group = CHL_CL_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_armor_slot = empty
			fixed_ship_secondaries_slot = empty
			mid_1_custom_slot = empty
			mid_2_custom_slot = empty
			rear_1_custom_slot = ship_torpedo_1
		}
	}
	# Battleships #
	create_equipment_variant = {
		name = "Almirante Latorre Class"	
		type = ship_hull_heavy_1
		name_group = CHL_BB_HISTORICAL
		parent_version = 0
		modules = {
			fixed_ship_battery_slot = ship_heavy_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 = heavy_ship_engine_1
			fixed_ship_secondaries_slot = ship_secondaries_1
			fixed_ship_armor_slot = ship_armor_bb_1
			front_1_custom_slot = ship_heavy_battery_1
			mid_1_custom_slot = ship_secondaries_1
			mid_2_custom_slot = ship_airplane_launcher_1
			rear_1_custom_slot = empty
		}
	}
}
