capital = 267

if = {
	limit = {
		NOT = {
			has_dlc = "No Step Back"
		}
	}
	set_oob = "AFG_1936"
}
if = {
	limit = {
		has_dlc = "No Step Back"
	}
	set_oob = "AFG_1936_nsb"
}

set_technology = {
	infantry_weapons = 1
}
if = {
	limit = {
		NOT = { has_dlc = "No Step Back" }
	}
	set_technology = { #vanilla keeps the old system, nsb afghanistan will no longer produce some of the most advanced tanks in the world
		gwtank = 1
	}
}

if = {
	limit = {
		has_dlc = "No Step Back"
	}
	set_technology = { 
		gwtank_chassis = 1
	}
}

IF = {
	limit = {
		has_dlc = "Graveyard of Empires"
	}
	recruit_character = AFG_mohammed_zahir_shah
	recruit_character = AFG_mohammad_hashim_khan
	recruit_character = AFG_sardar_shah_wali_khan
	recruit_character = AFG_abdur_rahim_khan
	recruit_character = AFG_mahmud_tarzi
	recruit_character = AFG_mohammed_daoud_khan
	recruit_character = AFG_abdul_majid_zabuli
	recruit_character = AFG_abdul_hai_habibi
	recruit_character = AFG_qiamuddin_khadim
	recruit_character = AFG_ghulam_yahya_khan_tarzi
	recruit_character = AFG_ghulam_muhammad_ghobar
	recruit_character = AFG_turbaz_khan
	recruit_character = AFG_mohammad_gul_khan_momand
	recruit_character = AFG_shah_mahmud_khan
	recruit_character = AFG_amunullah_khan
	recruit_character = AFG_soraya_tarzi
	recruit_character = AFG_provisional_government
	recruit_character = AFG_muhammad_ibrahim_khan
	recruit_character = AFG_faqir_of_ipi
	recruit_character = AFG_mazrak_zadran
	recruit_character = AFG_nisar_muhammad_yousafzai
	recruit_character = GER_oskar_von_nidermayer
	recruit_character = AFG_abdurauf_fitrat
	recruit_character = AFG_fayzulla_xojayev
	recruit_character = AFG_korsirmat
	recruit_character = AFG_junaid_khan
	recruit_character = AFG_sher_khan_nashir
	recruit_character = AFG_nur_muhammad_taraki
	recruit_character = AFG_inyatullah_khan
	recruit_character = AFG_sheikh_omar_mojadidi

	# Generics
	recruit_character = AFG_generic_army_1
	recruit_character = AFG_generic_army_2
	recruit_character = AFG_generic_army_3
	recruit_character = AFG_generic_army_4
	recruit_character = AFG_generic_navy_1
	recruit_character = AFG_generic_navy_2
	recruit_character = AFG_placeholder_fascist
	recruit_character = AFG_generic_american_1
	recruit_character = AFG_generic_american_2
	recruit_character = AFG_generic_american_3
	
	#add_stability = -0.7
	
	set_variable = { AFG_electrification_cooldown = 0 }
	### Techs ###

	set_technology = {
		gw_artillery = 1
	}

	#### Ideas/Modifiers/Variables ####

	add_ideas = AFG_mohammad_zahir_shah_ns
	add_ideas = AFG_pashtunwali
	add_ideas = AFG_turkish_military_mission
	# Variables for subsistence economy modifier
	set_variable = { AFG_economy_production_efficiency_gain_factor = -0.5 }
	set_variable = { AFG_economy_production_max_efficiency_factor = -0.35 }
	set_variable = { AFG_economy_industrial_capacity_factor = -0.5 }
	set_variable = { AFG_stability_factor_dm = 0.2 }
	add_dynamic_modifier = { modifier = AFG_subsistence_economy_modifier }

	#Variables for Quami modifier
	set_variable = { AFG_modifier_army_sub_unit_irregular_infantry_defence_factor = 0.05 }
	set_variable = { AFG_modifier_army_sub_unit_irregular_infantry_speed_factor = 0.05 }
	set_variable = { AFG_modifier_army_sub_unit_irregular_infantry_max_org_factor = 0.05 }
	set_variable = { AFG_modifier_army_sub_unit_irregular_infantry_attack_factor = 0 }
	#set_variable = { AFG_MODIFIER_CAVALRY_ATTACK_FACTOR = 0 }
	#set_variable = { AFG_MODIFIER_CAVALRY_DEFENCE_FACTOR = 0}
	set_variable = { AFG_modifier_army_sub_unit_cavalry_attack_factor = 0 }
	set_variable = { AFG_modifier_army_sub_unit_cavalry_defence_factor = 0 }
	set_variable = { AFG_modifier_army_sub_unit_cavalry_speed_factor = 0 }
	set_variable = { AFG_army_core_defence_factor = 0 }
	set_variable = { AFG_acclimatization_cold_climate_gain_factor = 0 }
	set_variable = { AFG_acclimatization_hot_climate_gain_factor = 0 }
	set_variable = { AFG_conscription_factor = 0.2 }
	set_variable = { AFG_experience_gain_army_factor = 0 }
	set_variable = { AFG_training_time_factor = 0 }
	set_variable = { AFG_max_planning_factor = 0 }
	set_variable = { AFG_planning_speed = 0 }
	set_variable = { AFG_army_supply_consumption_factor = 0 }
	set_variable = { AFG_army_supply_combat_penalties_on_core_factor = 0 }


	add_dynamic_modifier = {
		modifier = AFG_quami_modifier
	}

	#variables for Nufus modifier

	set_variable = { AFG_experience_gain_army_factor = 0.02 }
	set_variable = { AFG_army_org_factor = 0 }
	set_variable = { AFG_army_core_defence_factor = 0.03 }
	set_variable = { AFG_army_armor_defence_factor = 0 }
	set_variable = { AFG_army_armor_attack_factor = 0 }
	set_variable = { AFG_army_artillery_attack_factor = 0 }
	set_variable = { AFG_army_artillery_defence_factor = 0 }
	set_variable = { AFG_conscription_factor = 0 }
	set_variable = { AFG_training_time_factor = 0 }
	set_variable = { AFG_conscription = 0 }
	set_variable = { AFG_army_defence_factor = 0 }
	set_variable = { AFG_army_attack_factor = 0 }
	set_variable = { AFG_special_forces_cap = 0 }
	set_variable = { AFG_special_forces_out_of_supply_factor = 0 }
	set_variable = { AFG_extra_marine_supply_grace = 0 }
	set_variable = { AFG_max_planning_factor = 0 }
	set_variable = { AFG_planning_speed = 0 }
	set_variable = { AFG_max_command_power_mult = 0 }
	set_variable = { AFG_command_power_gain_mult = 0 }
	set_variable = { AFG_acclimatization_cold_climate_gain_factor = 0 }
	set_variable = { AFG_acclimatization_hot_climate_gain_factor = 0 }
	set_variable = { AFG_army_experience_gain_army_factor = 0 }

	# Varaibles for Amanullah modifier

	set_variable = { AFG_amanullah_modifier_stability_factor = -0.05 }
	set_variable = { AFG_amanullah_modifier_fascism_drift = 0.01 }
	set_variable = { AFG_amanullah_modifier_core_defense_factor = 0 }
	set_variable = { AFG_amanullah_modifier_core_attack_factor = 0 }

	# Variables for 1923 constitution modifier 

	set_variable = { AFG_1923_const_modifier_stability_factor = -0.1 }
	set_variable = { AFG_1923_const_modifier_mobilization_laws_cost_factor = -0.25 }
	set_variable = { AFG_1923_const_modifier_political_advisor_cost_factor = -0.25 }
	set_variable = { AFG_1923_const_modifier_production_speed_industrial_complex_factor = 0.1 }
	set_variable = { AFG_1923_const_modifier_research_speed_factor = 0 }
	set_variable = { AFG_1923_const_modifier_production_factory_efficiency_gain_factor = 0 }
	set_variable = { AFG_1923_const_modifier_production_factory_max_efficiency_factor = 0 }

	# Variables for Return to Tradition modifier

	set_variable = { AFG_look_to_the_past_modifier_stability_factor = -0.05 }
	set_variable = { AFG_look_to_the_past_modifier_war_support_factor = 0.03 }
	set_variable = { AFG_look_to_the_past_modifier_core_defense_factor = 0}
	set_variable = { AFG_look_to_the_past_modifier_core_attack_factor = 0 }
	set_variable = { AFG_look_to_the_past_modifier_research_speed_factor = -0.01 }

	# State Modifier 
	every_owned_state = {
		limit = {
			is_owned_by = AFG
		}
		set_variable = { AFG_state_development_production_speed = -0.2 }
		set_variable = { AFG_state_development_state_resources_factor = -0.2 }
		set_variable = { AFG_state_production_speed_infrastructure_factor = -0.2 }

		add_dynamic_modifier = {
			modifier = AFG_economic_regionalism
		}
	}

	every_owned_state = {
		limit = {
			OR = { 
				state = 1005
				state = 1007
			}
		}
		add_dynamic_modifier = { 
			modifier = AFG_disgruntled_minority
		}
	}

	set_politics = {
		ruling_party = neutrality
		last_election = "1936.1.1"
		election_frequency = 48
		elections_allowed = no
	}
	
	set_popularities = {
		fascism = 10
		communism = 0
		democratic = 15
		neutrality = 75
	}
	set_war_support = 0.1

	set_stability = 0.0

	set_variable = { AFG_levy_cap_max = 24 }
	set_variable = { AFG_levy_cap_min = 0 }
	set_variable = { AFG_levy_cap = 6 }
	set_variable = { AFG_levy_deployed = 0 }
	clamp_variable = {
		var = AFG_levy_cap
		min = AFG_levy_cap_min
		max = AFG_levy_cap_max
	}

	division_template = {
		name = "Pashtun Levy"		
		#division_names_group = 
		is_locked = yes
		force_allow_recruiting = no
		regiments = {
			irregular_infantry = { x = 0 y = 0 }
			irregular_infantry = { x = 0 y = 1 }
			irregular_infantry = { x = 1 y = 0 }
			irregular_infantry = { x = 1 y = 1 }
			irregular_infantry = { x = 2 y = 0 }
			irregular_infantry = { x = 2 y = 1 }
		}
		override_model = AFG_militia_entity
	}
	set_country_flag = AFG_quami_is_active

}
IF = {
	limit = {
		NOT = { has_dlc = "Graveyard of Empires"}
	}
	recruit_character = AFG_mohammed_zahir_shah
	recruit_character = AFG_akram_sattari
	recruit_character = AFG_yaqub_khan
	recruit_character = AFG_mihrdil_shahnawaz
	recruit_character = AFG_sardar_shah_wali_khan
	recruit_character = AFG_hares_muzafar
	recruit_character = AFG_asadullah_seraj_khan
	recruit_character = AFG_gholam_wali
	recruit_character = AFG_nasirullah_husain
	recruit_character = AFG_muhammad_amin_bughra
	recruit_character = AFG_azam_ataullah
	recruit_character = AFG_mohammed_daoud_khan
	recruit_character = AFG_renato_bardolucci
	recruit_character = AFG_ali_muhammed_khan
	recruit_character = AFG_mohammed_etemadi_khan
	recruit_character = AFG_aalem_daana
	recruit_character = AFG_wazir_akbar_khan
	recruit_character = AFG_mahmud_khan
	recruit_character = AFG_haji_faiz_muhammed_zikeria
	recruit_character = AFG_mohammad_hashim_khan
	recruit_character = AFG_muhammed_nowroz
	
	set_politics = {
		ruling_party = neutrality
		last_election = "1936.1.1"
		election_frequency = 48
		elections_allowed = no
	}
	
	set_popularities = {
		fascism = 15
		communism = 10
		neutrality = 75
	}

	### Techs ###
	set_technology = {
		gw_artillery = 1
	}
}