upgrades = {

	tank_nsb_engine_upgrade = {
		abbreviation = "eng"
		max_level = 20 #each level represents ~50HP
		cost = land

		linear_cost = {
			cost_by_level = 2
			cost_by_level_for_licensed_equipment = 2
		}

		level_requirements = {
			5 = {
				has_tech = engine_tech_1
			}
			10 = {
				has_tech = engine_tech_2
			}
			15 = {
				has_tech = engine_tech_3
			}
			18 = { 
				has_tech = engine_tech_4
			}
		}

		resource_cost_thresholds = {
			8 = {
				chromium = 1
			}
			16 = {
				chromium = 1
			} 
		}

		add_stats = {
		#combat
		armor_value = -0.2
		soft_attack = 0.1
		hard_attack = 0.1
		#mobile
		maximum_speed = 0.5
		fuel_consumption = 0.02
		
		#production
		build_cost_ic = 0.08
		reliability = -0.05
		}
	}

	tank_nsb_armor_upgrade = {
		abbreviation = "arm"
		max_level = 20 #each level represents ~10mm of armor 
		cost = land

		linear_cost = {
			cost_by_level = 2
			cost_by_level_for_licensed_equipment = 2
		}

		level_requirements = {
			5 = {
				has_tech = armor_tech_1
			}
			10 = {
				has_tech = armor_tech_2
			}
			15 = {
				has_tech = armor_tech_3
			}
			18 = {
				has_tech = armor_tech_4
			}
		}

		resource_cost_thresholds = { # resource values defined here are TOTAL added cost, not cumulative
			8 = {
				steel = 1
			}
			12 = {
				steel = 1
			}
			18 = {
				steel = 1
			}
		}
		
		add_stats = {
		#combat
		armor_value = 1.0
		breakthrough = 0.2
		defense = 0.2
		hardness = 0.002
		
		#mobile
		maximum_speed = -0.2
		fuel_capacity = -0.8
		
		#production
		build_cost_ic = 0.05
		reliability = -0.005
		}
	}

	tank_gun_upgrade = {
		max_level = 11

		cost = land				# This determies how much XP it will cost, controlled by defines, there are 3 cost types: air, land and naval

		

		add_stats = {
		  #combat
		  soft_attack = 0.5
		  hard_attack = 0.5
		  ap_attack = 0.5
		  breakthrough = 0.3
		
		  #mobile
		  maximum_speed = -0.3
		
		  reliability = -0.05
		  build_cost_ic = 0.2
		}
		
		resource_cost_thresholds = { 
			6 = {
				tungsten = 1
			}
		}
		
        level_requirements = {
			1 = {
			    num_of_factories > 10
			}
			2 = {
			    num_of_factories > 10
			}
			3 = {
			    num_of_factories > 10
			}
			4 = {
			    num_of_factories > 10
			}
			5 = {
			    num_of_factories > 10
			}
			6 = {
			    num_of_factories > 10
			}
			7 = {
			    num_of_factories > 10
			}
			8 = {
			    num_of_factories > 10
			}
			9 = {
			    num_of_factories > 10
			}
			10 = {
			    num_of_factories > 10
			}
			11 = {
			    num_of_factories > 99999
				is_ai = yes
			}
		}
	}
	tank_armor_upgrade = {
		max_level = 11

		cost = land
		
		
		add_stats = {
		  #combat
		  armor_value = 1.5
		  defense = 0.5
		  breakthrough = 0.5
		
		  #mobile
		  maximum_speed = -0.3
		
		  reliability = -0.02
		  build_cost_ic = 0.08
		}
		
		resource_cost_thresholds = { 
			6 = {
				steel = 1
			}
		}

		
		level_requirements = {
			1 = {
			    num_of_factories > 10
			}
			2 = {
			    num_of_factories > 10
			}
			3 = {
			    num_of_factories > 10
			}
			4 = {
			    num_of_factories > 10
			}
			5 = {
			    num_of_factories > 10
			}
			6 = {
			    num_of_factories > 10
			}
			7 = {
			    num_of_factories > 10
			}
			8 = {
			    num_of_factories > 10
			}
			9 = {
			    num_of_factories > 10
			}
			10 = {
			    num_of_factories > 10
			}
			11 = {
			    num_of_factories > 99999
				is_ai = yes
			}
		}
	}
	tank_engine_upgrade = {
		max_level = 11
		cost = land
		
		add_stats = {
		  #combat
		   maximum_speed = 0.4
		   fuel_consumption = 0.02
		   reliability = -0.02
		   build_cost_ic = 0.15
		}
		
		level_requirements = {
			1 = {
			    num_of_factories > 10
			}
			2 = {
			    num_of_factories > 10
			}
			3 = {
			    num_of_factories > 10
			}
			4 = {
			    num_of_factories > 10
			}
			5 = {
			    num_of_factories > 10
			}
			6 = {
			    num_of_factories > 10
			}
			7 = {
			    num_of_factories > 10
			}
			8 = {
			    num_of_factories > 10
			}
			9 = {
			    num_of_factories > 10
			}
			10 = {
			    num_of_factories > 10
			}
			11 = {
			    num_of_factories > 99999
				is_ai = yes
			}
		}
	}	
	ac_engine_upgrade = {
		max_level = 11
		cost = land
		
		
		add_stats = {
		   maximum_speed = 0.4
		   fuel_consumption = 0.02
		   reliability = -0.02
		   build_cost_ic = 0.08
		}
		
		level_requirements = {
			1 = {
			    num_of_factories > 10
			}
			2 = {
			    num_of_factories > 10
			}
			3 = {
			    num_of_factories > 10
			}
			4 = {
			    num_of_factories > 10
			}
			5 = {
			    num_of_factories > 10
			}
			6 = {
			    num_of_factories > 10
			}
			7 = {
			    num_of_factories > 10
			}
			8 = {
			    num_of_factories > 10
			}
			9 = {
			    num_of_factories > 10
			}
			10 = {
			    num_of_factories > 10
			}
			11 = {
			    num_of_factories > 99999
				is_ai = yes
			}
		}
	}	
	tank_reliability_upgrade = {
		max_level = 11
		cost = land
		
		add_stats = {
		   reliability = 0.03
           fuel_capacity = 40
		   build_cost_ic = 0.1
		}
		
		level_requirements = {
			1 = {
			    num_of_factories > 10
			}
			2 = {
			    num_of_factories > 10
			}
			3 = {
			    num_of_factories > 10
			}
			4 = {
			    num_of_factories > 10
			}
			5 = {
			    num_of_factories > 10
			}
			6 = {
			    num_of_factories > 10
			}
			7 = {
			    num_of_factories > 10
			}
			8 = {
			    num_of_factories > 10
			}
			9 = {
			    num_of_factories > 10
			}
			10 = {
			    num_of_factories > 10
			}
			11 = {
			    num_of_factories > 99999
				is_ai = yes
			}
		}
	}
	tank_aa_upgrade = {
		max_level = 11

		cost = land
		
		add_stats = {
		   reliability = -0.03
		   maximum_speed = -0.2
           air_attack = 0.9
		   soft_attack = 0.4
		   hard_attack = 0.4
		   ap_attack = 0.4
		   build_cost_ic = 0.15
		}
		
		resource_cost_thresholds = { 
			8 = {
				tungsten = 1
			}
		}
		
		level_requirements = {
			1 = {
			    num_of_factories > 10
			}
			2 = {
			    num_of_factories > 10
			}
			3 = {
			    num_of_factories > 10
			}
			4 = {
			    num_of_factories > 10
			}
			5 = {
			    num_of_factories > 10
			}
			6 = {
			    num_of_factories > 10
			}
			7 = {
			    num_of_factories > 10
			}
			8 = {
			    num_of_factories > 10
			}
			9 = {
			    num_of_factories > 10
			}
			10 = {
			    num_of_factories > 10
			}
			11 = {
			    num_of_factories > 99999
				is_ai = yes
			}
		}
	}
	tank_at_upgrade = {
		max_level = 11

		cost = land
		
		add_stats = {
		   reliability = -0.03
		   maximum_speed = -0.3
		   soft_attack = 0.3
		   hard_attack = 0.7
		   ap_attack = 1.2
		   build_cost_ic = 0.3
		}
		
		resource_cost_thresholds = { 
			6 = {
				tungsten = 1
			}
		}
		
		level_requirements = {
			1 = {
			    num_of_factories > 10
			}
			2 = {
			    num_of_factories > 10
			}
			3 = {
			    num_of_factories > 10
			}
			4 = {
			    num_of_factories > 10
			}
			5 = {
			    num_of_factories > 10
			}
			6 = {
			    num_of_factories > 10
			}
			7 = {
			    num_of_factories > 10
			}
			8 = {
			    num_of_factories > 10
			}
			9 = {
			    num_of_factories > 10
			}
			10 = {
			    num_of_factories > 10
			}
			11 = {
			    num_of_factories > 99999
				is_ai = yes
			}
		}
	}
	tank_art_upgrade = {
		max_level = 11

		cost = land
		
		add_stats = {
		   reliability = -0.03
		   maximum_speed = -0.4
		   soft_attack = 0.7
		   hard_attack = 0.3
		   ap_attack = 0.2
		   breakthrough = 0.2
		   build_cost_ic = 0.2
		}
		
		resource_cost_thresholds = { 
			8 = {
				tungsten = 1
			}
		}

		level_requirements = {
			1 = {
			    num_of_factories > 10
			}
			2 = {
			    num_of_factories > 10
			}
			3 = {
			    num_of_factories > 10
			}
			4 = {
			    num_of_factories > 10
			}
			5 = {
			    num_of_factories > 10
			}
			6 = {
			    num_of_factories > 10
			}
			7 = {
			    num_of_factories > 10
			}
			8 = {
			    num_of_factories > 10
			}
			9 = {
			    num_of_factories > 10
			}
			10 = {
			    num_of_factories > 10
			}
			11 = {
			    num_of_factories > 99999
				is_ai = yes
			}
		}
	}
}
