

###################################################################################

 ## #  # ###  #   #  ##  ###  ### #  # ###     ###  ###   ##   ### ###  ##  ###  ##
#   #  # #  # ## ## #  # #  #  #  ## # #       #  # #  # #  #    # #   #  #  #  #
 #  #  # ###  # # # #### ###   #  # ## ##      ###  ###  #  #    # ##  #     #   #
  # #  # #  # #   # #  # #  #  #  #  # #       #    #  # #  # #  # #   #  #  #    #
##   ##  ###  #   # #  # #  # ### #  # ###     #    #  #  ##   ##  ###  ##   #  ##

###################################################################################


sp_dual_purpose_guns = {
	specialization = specialization_naval

	project_tags = sp_tag_surface_ship

	ai_will_do = {
		base = 1
	}

	allowed = {
		has_dlc = "Gotterdammerung"
	}

	available = {
		FROM = {
			has_tech = basic_battery
		}
	}

	resource_cost = {
		resources = {
			steel = 12
			chromium = 4
			tungsten = 12
		}
	}

	complexity = sp_complexity.small
	prototype_time = sp_time.prototype.short

	breakthrough_cost = {
		specialization_naval = 1
	}

	project_output = {
		country_effects = {
			#custom_effect_tooltip = sp_naval_proximity_fuze_custom_tt
			custom_effect_tooltip = {
				localization_key = SP_UNLOCK_TECH
				TECH = basic_dp_light_battery
				}
			hidden_effect = {
				set_technology = {
					basic_dp_light_battery = 1
					popup = no
				}
			}
		}

		enable_equipment_modules = {
			dp_light_battery_2
			dp_ship_secondaries_2
			dp_light_battery_1
			dp_ship_secondaries_1
		}

		enable_subunits = {

		}
	}

	generic_prototype_rewards = {
		sp_naval_generic_reward_scientist_xp_1
		sp_naval_generic_reward_scientist_xp_2
		sp_naval_generic_reward_scientist_xp_3
		sp_naval_generic_reward_navy_xp_1
		sp_naval_generic_reward_navy_xp_2
		sp_naval_generic_reward_navy_xp_3
		sp_naval_generic_reward_major_progress_1
		sp_naval_generic_reward_major_progress_2
		sp_naval_generic_reward_major_progress_3
		sp_naval_generic_reward_test_failure_1
		sp_naval_generic_reward_test_failure_2
		sp_naval_generic_reward_test_failure_3
	}

	unique_prototype_rewards = {
	}

}

# Cruiser Submarine
sp_naval_cruiser_submarine = {
	specialization = specialization_naval

	project_tags = sp_tag_submarine

	# ai_will_do = {
		# base = 0
		# modifier = {
			# ROOT = { is_major = yes }
			# add = 1
		# }

	# }

	complexity = sp_complexity.small
	prototype_time = sp_time.prototype.medium
	allowed = {
		#FREE PROJECT
	}

	special_project_parent = {

	}

	available = {
		FROM = {
			if = { limit = { is_ai = yes }
				sp_naval_cruiser_submarine_trigger = yes
			}
		}
		FROM = {
			if = {
				limit = {
					has_dlc = "Man the Guns"
				}
				has_tech = early_ship_hull_submarine
			}
			else = {
				has_tech = early_submarine
			}
		}
	}

	breakthrough_cost = {
		specialization_naval = 1
	}

	resource_cost = {
		resources = {
			steel = 8
		 }
	}

	project_output = {
		enable_equipments = {
			limit = {
				has_dlc = "Man the Guns"
			}
			ship_hull_cruiser_submarine
		}
		enable_equipments = {
			limit = {
				not = { has_dlc = "Man the Guns" }
			}
			cruiser_submarine
		}

		country_effects = {
			if = {
				limit = {
					has_dlc = "Man the Guns"
				}
				add_design_template_bonus = {
					name = sp_naval_cruiser_submarine_free_design
					uses = 1
					cost_factor = 1
					equipment = ship_hull_cruiser_submarine
				}
				hidden_effect = {
					set_technology = {
						cruiser_submarines = 1
						popup = no
					}
				}
			}
		}
	}

	generic_prototype_rewards = {
		sp_naval_generic_reward_scientist_xp_1
		sp_naval_generic_reward_scientist_xp_2
		sp_naval_generic_reward_scientist_xp_3
		sp_naval_generic_reward_navy_xp_1
		sp_naval_generic_reward_navy_xp_2
		sp_naval_generic_reward_navy_xp_3
		sp_naval_generic_reward_major_progress_1
		sp_naval_generic_reward_major_progress_2
		sp_naval_generic_reward_major_progress_3
		sp_naval_generic_reward_test_failure_1
		sp_naval_generic_reward_test_failure_2
		sp_naval_generic_reward_test_failure_3
		sp_naval_generic_failure_torpedo_accident
	}

	unique_prototype_rewards = {

		sp_naval_cruiser_submarine_unique_reward_a = {
			fire_only_once = yes

			threshold = {
				min = 40
				max = 90
			}

			weight = {
				base = 100
			}

			option = {
				token = sp_naval_cruiser_submarine_preference_a

				iteration_output = {
					country_effects = {
						if = {
							limit = {
								NOT = {has_dlc = "Man the Guns"}
							}
							add_equipment_bonus = {
								name = sp_cruiser_submarine_eq_bonus_range
								bonus = {
									cruiser_submarine = {
										naval_range = 0.1
									}
								}
							}
						}
					}

					enable_equipment_modules = {
						limit = {
							has_dlc = "Man the Guns"
						}
						ship_extra_fuel_tank
					}
				}
			}

			option = {
				token = sp_naval_cruiser_submarine_preference_b

				iteration_output = {
					country_effects = {
						if = {
							limit = {
								NOT = {has_dlc = "Man the Guns"}
							}
							add_equipment_bonus = {
								name = sp_cruiser_submarine_eq_bonus_raiding
								bonus = {
									cruiser_submarine = {
										torpedo_attack = 0.1
									}
								}
							}
						}
					}

					enable_equipment_modules = {
						limit = {
							has_dlc = "Man the Guns"
						}
						ship_light_battery_sub
					}
				}
			}
		}
	}
}

#Fleet Submarine
sp_naval_fleet_submarine = {
	specialization = specialization_naval

	project_tags = sp_tag_submarine

	# ai_will_do = {
		# base = 0
		# modifier = {
			# ROOT = { is_major = yes }
			# add = 1
		# }
	# }

	allowed = {
		#FREE PROJECT
	}

	complexity = sp_complexity.small
	prototype_time = sp_time.prototype.medium

	available = {
		FROM = {
			if = { limit = { is_ai = yes }
				sp_naval_fleet_submarine_trigger = yes
			}
		}
		FROM = {
			if = {
				limit = {
					has_dlc = "Man the Guns"
				}
				has_tech = improved_ship_hull_submarine
			}
			else = {
				has_tech = basic_submarine
			}

		}
	}


	special_project_parent = {
		sp_naval_cruiser_submarine
	}
	resource_cost = {
		resources = {
			steel = 12
			chromium = 4
		}
	}

	breakthrough_cost = {
		specialization_naval = 1
	}

	project_output = {
		country_effects = {
			if = {
				limit = {
					has_dlc = "Man the Guns"
				}
				add_design_template_bonus = {
					name = sp_naval_fleet_submarine_free_design
					uses = 1
					cost_factor = 1
					equipment = ship_hull_submarine_4
				}
			}
			hidden_effect = {
				set_technology = {
					ship_hull_fleet_submarine = 1
					popup = no
				}
			}
		}
		facility_state_effects = {

		}
		scientist_effects = {

		}
		enable_equipments = {
			limit = {
				has_dlc = "Man the Guns"
			}
			ship_hull_fleet_submarine_1
		}
		enable_equipment_modules = {
			ship_sub_aa_turret
		}
	}

	generic_prototype_rewards = {
		sp_naval_generic_reward_scientist_xp_1
		sp_naval_generic_reward_scientist_xp_2
		sp_naval_generic_reward_scientist_xp_3
		sp_naval_generic_reward_navy_xp_1
		sp_naval_generic_reward_navy_xp_2
		sp_naval_generic_reward_navy_xp_3
		sp_naval_generic_reward_major_progress_1
		sp_naval_generic_reward_major_progress_2
		sp_naval_generic_reward_major_progress_3
		sp_naval_generic_reward_test_failure_1
		sp_naval_generic_reward_test_failure_2
		sp_naval_generic_reward_test_failure_3
		sp_naval_generic_failure_torpedo_accident
	}

	unique_prototype_rewards = {
		sp_naval_fleet_submarine_unique_reward_a = {
			fire_only_once = yes

			threshold = {
				min = 40
				max = 90
			}

			weight = {
				base = 100
			}

			option = {
				token = sp_naval_fleet_submarine_preference_a

				iteration_output = {
					country_effects = {
						if = {
							limit = { has_dlc = "Man the Guns"}

							add_equipment_bonus = {
								name = sp_fleet_submarine_eq_bonus_attack
								bonus = {
									ship_hull_fleet_submarine = {
										naval_speed = 0.05
										torpedo_attack = 0.05
										sub_visibility = -0.03
									}
								}
							}
						}
						else = {
							add_equipment_bonus = {
								name = sp_fleet_submarine_eq_bonus_attack
								bonus = {
									ship_hull_fleet_submarine = {
										naval_speed = 0.05
										torpedo_attack = 0.05
										sub_visibility = -0.03
									}
								}
							}
						}
					}
				}
			}

			option = {
				token = sp_naval_fleet_submarine_preference_b

				iteration_output = {
					country_effects = {
						if = {
							limit = { has_dlc = "Man the Guns"}
							add_equipment_bonus = {
								name = sp_fleet_submarine_eq_bonus_reliability
								bonus = {
									ship_hull_fleet_submarine = {
										reliability = 0.05
										max_strength = 0.05
										naval_weather_penalty_factor = -0.1
									}
								}
							}
						}
						else = {
							add_equipment_bonus = {
								name = sp_fleet_submarine_eq_bonus_reliability
								bonus = {
									ship_hull_fleet_submarine = {
										reliability = 0.05
										max_strength = 0.05
										naval_weather_penalty_factor = -0.1
									}
								}
							}
						}
					}
				}
			}
		}
	}

}

# Nuclear Powered Submarine
sp_naval_nuclear_submarine = {
	specialization = specialization_naval

	# ai_will_do = {
		# base = 0
		# modifier = {
			# ROOT = { is_major = yes }
			# add = 1
		# }
	# }

	project_tags = {
		sp_tag_nuclear_power
		sp_tag_submarine
	}

	complexity = sp_complexity.large
	prototype_time = sp_time.prototype.long
	allowed = {
		has_dlc = "Gotterdammerung"
	}

	special_project_parent = {
		sp_naval_fleet_submarine
		sp_nuclear_engines
	}

	available = {

	}

	breakthrough_cost = {
		specialization_naval = 3
	}

	resource_cost = {
		resources = {
			steel = 20
			chromium = 8
			tungsten = 8
		}
	}

	project_output = {
		country_effects = {
			if = {
				limit = {
					has_dlc = "Man the Guns"
				}
				add_design_template_bonus = {
					name = sp_naval_nuclear_submarine_free_design
					uses = 1
					cost_factor = 1
					equipment = ship_hull_submarine
				}
			}
			hidden_effect = {
				set_technology = {
					ship_hull_nuclear_attack_sub = 1
					popup = no
				}
			}
		}
		facility_state_effects = {

		}
		scientist_effects = {

		}
		# enable_equipments = {
			# limit = { has_dlc = "Man the Guns"}
			# ship_hull_nuclear_submarine
		# }
		enable_equipment_modules = {
			limit = {
				has_dlc = "Man the Guns"
			}
			sub_nuclear_reactor_module
		}
	}

	generic_prototype_rewards = {
		sp_naval_generic_reward_scientist_xp_1
		sp_naval_generic_reward_scientist_xp_2
		sp_naval_generic_reward_scientist_xp_3
		sp_naval_generic_reward_navy_xp_1
		sp_naval_generic_reward_navy_xp_2
		sp_naval_generic_reward_navy_xp_3
		sp_naval_generic_reward_major_progress_1
		sp_naval_generic_reward_major_progress_2
		sp_naval_generic_reward_major_progress_3
		sp_naval_generic_reward_test_failure_1
		sp_naval_generic_reward_test_failure_2
		sp_naval_generic_reward_test_failure_3
		sp_naval_generic_failure_nuclear_accident
	}

	# unique_prototype_rewards = {
		# sp_naval_nuclear_submarine_unique_reward_a = {
			# fire_only_once = yes

			# threshold = {
				# min = 40
				# max = 90
			# }

			# weight = {
				# base = 100
			# }

			# option = {
				# token = sp_naval_nuclear_submarine_preference_a

				# iteration_output = {
					# country_effects = {
						# if = {
							# limit = { has_dlc = "Man the Guns"}
							# add_equipment_bonus = {
								# name = sp_nuclear_submarine_eq_bonus_ic_reduction
								# bonus = {
									# ship_hull_nuclear_submarine = {
										# build_cost_ic = -0.1
										# reliability = -0.05
										# sub_visibility = 0.1
										# naval_range = -0.1
									# }
								# }
							# }
						# }
						# else = {
							# add_equipment_bonus = {
								# name = sp_nuclear_submarine_eq_bonus_ic_reduction
								# bonus = {
									# nuclear_submarine = {
										# build_cost_ic = -0.1
										# reliability = -0.05
										# sub_visibility = 0.1
										# naval_range = -0.1
									# }
								# }
							# }
						# }
					# }
				# }
			# }

			# option = {
				# token = sp_naval_nuclear_submarine_preference_b
				# default = yes
				# iteration_output = {
					# country_effects = {

					# }

				# }
			# }

			# option = {
				# token = sp_naval_nuclear_submarine_preference_c

				# iteration_output = {
					# country_effects = {
						# if = {
							# limit = { has_dlc = "Man the Guns"}
							# add_equipment_bonus = {
								# name = sp_nuclear_submarine_eq_bonus_quality
								# bonus = {
									# ship_hull_nuclear_submarine = {
										# build_cost_ic = 0.1
										# max_strength = 0.1
										# reliability = 0.05
										# sub_visibility = -0.05
									# }
								# }
							# }
						# }
						# else = {
							# add_equipment_bonus = {
								# name = sp_nuclear_submarine_eq_bonus_quality
								# bonus = {
									# nuclear_submarine = {
										# build_cost_ic = 0.1
										# max_strength = 0.1
										# reliability = 0.05
										# sub_visibility = -0.05
									# }
								# }
							# }
						# }
					# }
				# }
			# }
		# }
	# }
}

# Rocket Launching Submarine
sp_naval_rocket_launching_submarine = {
	specialization = specialization_naval

	# ai_will_do = {
		# base = 0
		# modifier = {
			# ROOT = { is_major = yes }
			# add = 1
		# }
	# }

	project_tags = {
		sp_tag_rocket
		sp_tag_submarine
	}

	resource_cost = {
		resources = {
			steel = 12
			chromium = 4
			tungsten = 12
		}
	}
	complexity = sp_complexity.medium
	prototype_time = sp_time.prototype.long
	allowed = {
		has_dlc = "Gotterdammerung"
	}

	special_project_parent = {
		sp_naval_fleet_submarine
		sp_rockets_ballistic_missile
	}

	available = {
		FROM = { has_tech = sp_flying_bomb_2 }
	}

	breakthrough_cost = {
		specialization_naval = 2
	}

	project_output = {
		country_effects = {
			custom_effect_tooltip = {
				localization_key = enable_slcm_tech_tt
			}
			hidden_effect = {
				set_technology = {
					slcm_tech_1 = 1
					popup = no
				}
			}
		}
		facility_state_effects = {

		}
		scientist_effects = {

		}
		enable_equipments = {
			slcm_equipment_1
			rocket_submarine
		}
		enable_equipment_modules = {
			limit = {
				has_dlc = "Man the Guns"
			}
			sub_missile_launcher
		}
	}

	generic_prototype_rewards = {
		sp_naval_generic_reward_scientist_xp_1
		sp_naval_generic_reward_scientist_xp_2
		sp_naval_generic_reward_scientist_xp_3
		sp_naval_generic_reward_navy_xp_1
		sp_naval_generic_reward_navy_xp_2
		sp_naval_generic_reward_navy_xp_3
		sp_naval_generic_reward_major_progress_1
		sp_naval_generic_reward_major_progress_2
		sp_naval_generic_reward_major_progress_3
		sp_naval_generic_reward_test_failure_1
		sp_naval_generic_reward_test_failure_2
		sp_naval_generic_reward_test_failure_3
	}

	unique_prototype_rewards = {
		sp_naval_rocket_launching_submarine_unique_reward_a = {
			fire_only_once = yes

			threshold = {
				min = 40
				max = 90
			}

			weight = {
				base = 100
			}

			option = {
				token = sp_naval_rocket_launching_submarine_preference_a

				iteration_output = {
					country_effects = {
						if = {
							limit = { has_dlc = "Man the Guns"}
								add_equipment_bonus = {
									name = sp_rocket_submarine_eq_bonus_range_increase
									bonus = {
										rocket_submarine = {
											naval_range = 0.1
											sub_visibility = 0.05
											build_cost_ic = 0.07
										}
									}
								}
							}
						else = {
							add_equipment_bonus = {
								name = sp_rocket_submarine_eq_bonus_range_increase
								bonus = {
									rocket_submarine = {
										naval_range = 0.1
										sub_visibility = 0.05
										build_cost_ic = 0.07
									}
								}
							}
						}
					}
				}
			}

			option = {
				token = sp_naval_rocket_launching_submarine_preference_b
				default = yes
				iteration_output = {
					country_effects = {
						if = {
							limit = { has_dlc = "Man the Guns"}
								add_equipment_bonus = {
									name = sp_rocket_submarine_eq_bonus_reliability
									bonus = {
										rocket_submarine = {
											reliability = 0.03
										}
									}
								}
							}
						else = {
							add_equipment_bonus = {
								name = sp_rocket_submarine_eq_bonus_reliability
								bonus = {
									rocket_submarine = {
										reliability = 0.05
									}
								}
							}
						}
					}



				}
			}

			option = {
				token = sp_naval_rocket_launching_submarine_preference_c

				iteration_output = {
					country_effects = {
						if = {
							limit = { has_dlc = "Man the Guns"}
								add_equipment_bonus = {
									name = sp_rocket_submarine_eq_bonus_stealth
									bonus = {
										rocket_submarine = {
											sub_visibility = -0.05
											naval_range = -0.05
											build_cost_ic = 0.1
										}
										rocket_submarine = {
											sub_visibility = -0.05
											naval_range = -0.05
											build_cost_ic = 0.1
										}
									}
								}
							}
						else = {
							add_equipment_bonus = {
								name = sp_rocket_submarine_eq_bonus_stealth
								bonus = {
									rocket_submarine = {
										sub_visibility = -0.15
										naval_range = -0.05
										build_cost_ic = 0.1
									}
								}
							}
						}
					}
				}
			}
		}
	}

}

# Nuclear Missile Submarine
sp_naval_nuclear_missile_submarine = {
	specialization = specialization_naval

	# ai_will_do = {
		# base = 0
		# modifier = {
			# ROOT = { is_major = yes }
			# add = 1
		# }
	# }

	project_tags = {
		sp_tag_nuclear_warfare
		sp_tag_submarine
	}

	resource_cost = {
		resources = {
			steel = 16
			chromium = 16
		}
	}
	complexity = sp_complexity.large
	prototype_time = sp_time.prototype.long
	allowed = {
		has_dlc = "Gotterdammerung"
	}

	special_project_parent = {
		sp_naval_nuclear_submarine
		sp_naval_rocket_launching_submarine
	}

	available = {

	}

	breakthrough_cost = {
		specialization_naval = 2
	}

	project_output = {
		country_effects = {
			set_technology = {
				sp_slbm_1 = 1
				popup = no
			}
      hidden_effect = {
  set_technology = {
    ship_hull_missile_submarine = 1
    popup = no
  }
}
		}
		facility_state_effects = {

		}
		scientist_effects = {

		}
		enable_equipments = {
			limit = {
				NOT = { has_dlc = "Man the Guns" }
			}
			nuclear_missile_submarine
		}
		enable_equipment_modules = {
			limit = {
				 has_dlc = "Man the Guns"
			}
			slbm_launcher
		}
	}

	generic_prototype_rewards = {
		sp_naval_generic_reward_scientist_xp_1
		sp_naval_generic_reward_scientist_xp_2
		sp_naval_generic_reward_scientist_xp_3
		sp_naval_generic_reward_navy_xp_1
		sp_naval_generic_reward_navy_xp_2
		sp_naval_generic_reward_navy_xp_3
		sp_naval_generic_reward_major_progress_1
		sp_naval_generic_reward_major_progress_2
		sp_naval_generic_reward_major_progress_3
		sp_naval_generic_reward_test_failure_1
		sp_naval_generic_reward_test_failure_2
		sp_naval_generic_reward_test_failure_3
		sp_naval_generic_failure_nuclear_accident
	}

	unique_prototype_rewards = {
		sp_naval_nuclear_missile_submarine_unique_reward_a = {
			fire_only_once = yes

			threshold = {
				min = 40
				max = 90
			}

			weight = {
				base = 100
			}

			option = {
				token = sp_naval_nuclear_missile_submarine_preference_a

				iteration_output = {
					country_effects = {
						if = {
							limit = { has_dlc = "Man the Guns"}
							add_equipment_bonus = {
								name = sp_nuclear_missile_submarine_eq_bonus_stealth
								bonus = {
									nuclear_missile_submarine = {
										sub_visibility = -0.05
										surface_detection = 0.02
										build_cost_ic = 0.05
									}
								}
							}
						}
						else = {
							add_equipment_bonus = {
								name = sp_nuclear_missile_submarine_eq_bonus_stealth
								bonus = {
									nuclear_missile_submarine = {
										sub_visibility = -0.1
										surface_detection = 0.05
										build_cost_ic = 0.1
									}
								}
							}
						}
					}
				}
			}

			option = {
				token = sp_naval_nuclear_missile_submarine_preference_b
				default = yes
				iteration_output = {
					country_effects = {

					}

				}
			}

			option = {
				token = sp_naval_nuclear_missile_submarine_preference_c

				iteration_output = {
					country_effects = {
						if = {
							limit = { has_dlc = "Man the Guns"}
							add_equipment_bonus = {
								name = sp_nuclear_missile_submarine_eq_bonus_strength
								bonus = {
									nuclear_missile_submarine = {
										max_strength = 0.02
										naval_weather_penalty_factor = -0.2
										build_cost_ic = 0.05
									}
								}
							}
						}
						else = {
							add_equipment_bonus = {
								name = sp_nuclear_missile_submarine_eq_bonus_strength
								bonus = {
									nuclear_missile_submarine = {
										max_strength = 0.05
										naval_weather_penalty_factor = -0.2
										build_cost_ic = 0.1
									}
								}
							}
						}
					}
				}
			}
		}
	}

}

# #Nuclear Torpedo
# sp_naval_nuclear_torpedo = {
	# specialization = specialization_naval


	# project_tags = {
		# sp_tag_submarine
		# sp_tag_nuclear_warfare
	# }

	# resource_cost = {
		# resources = {
			# steel = 8
			# chromium = 12
			# tungsten = 12
		# }
	# }

	# complexity = sp_complexity.large
	# prototype_time = sp_time.prototype.long

	# allowed = {
		# AND = {
			# has_dlc= "Gotterdammerung"
			# has_dlc = "Man the Guns"
		# }
	# }

	# available = {
		# FROM = { has_tech = modern_ship_torpedo_launcher }
	# }

	# special_project_parent = {
		# sp_naval_nuclear_submarine
	# }

	# breakthrough_cost = {
		# specialization_naval = 1
	# }

	# project_output = {
		# country_effects = {

		# }
		# facility_state_effects = {

		# }
		# scientist_effects = {

		# }
		# enable_equipments = {

		# }
		# enable_equipment_modules = {
			# ship_torpedo_sub_nuclear
		# }

	# }

	# generic_prototype_rewards = {
		# sp_naval_generic_reward_scientist_xp_1
		# sp_naval_generic_reward_scientist_xp_2
		# sp_naval_generic_reward_scientist_xp_3
		# sp_naval_generic_reward_navy_xp_1
		# sp_naval_generic_reward_navy_xp_2
		# sp_naval_generic_reward_navy_xp_3
		# sp_naval_generic_reward_major_progress_1
		# sp_naval_generic_reward_major_progress_2
		# sp_naval_generic_reward_major_progress_3
		# sp_naval_generic_reward_test_failure_1
		# sp_naval_generic_reward_test_failure_2
		# sp_naval_generic_reward_test_failure_3
		# sp_naval_generic_failure_nuclear_accident
	# }

	# unique_prototype_rewards = {
		# sp_naval_nuclear_torpedo_unique_reward_a = {
			# fire_only_once = yes

			# threshold = {
				# min = 40
				# max = 90
			# }

			# weight = {
				# base = 100
			# }

			# option = {
				# token = sp_naval_nuclear_torpedo_preference_a

				# iteration_output = {
					# country_effects = {

					# }

					# equipment_bonus = {
						# ship_hull_submarine = {
							# naval_torpedo_hit_chance_factor = 0.02
							# torpedo_attack = 0.1
							# reliability = -0.1
							# instant = yes
						# }
					# }

				# }
			# }

			# option = {
				# token = sp_naval_nuclear_torpedo_preference_b

				# iteration_output = {
					# country_effects = {

					# }
					# equipment_bonus = {
						# ship_hull_submarine = {
							# reliability = 0.1
							# build_cost_ic = 0.1
							# instant = yes
						# }

					# }

				# }
			# }
		# }
	# }

# }

#Midget Submarine
sp_naval_midget_submarine = {
	specialization = specialization_naval

	ai_will_do = {
		base = 1
	}

	project_tags = {
		sp_tag_submarine
	}

	allowed = {
		FROM = {
			if = { limit = { is_ai = yes }
				sp_naval_midget_submarine_trigger = yes
			}
		}
	}

	available = {
		FROM = {
			if = {
				limit = {
					has_dlc = "Man the Guns"
				}
				has_tech = early_ship_hull_submarine
			}
			else = {
				has_tech = early_submarine
			}

		}
	}

	complexity = sp_complexity.medium
	prototype_time = sp_time.prototype.short


	resource_cost = {
		resources = {
			steel = 6
		}
	}

	breakthrough_cost = {
		specialization_naval = 1
	}
	project_output = {
		enable_equipments = {
			limit = {
				has_dlc = "Man the Guns"
			}
			ship_hull_midget_submarine
		}
		enable_equipments = {
			limit = {
				not = {has_dlc = "Man the Guns"}
			}
			midget_submarine
		}

		country_effects = {
			if = {
				limit = {
					has_dlc = "Man the Guns"
				}
				add_design_template_bonus = {
					name = sp_naval_midget_submarine_free_design
					uses = 1
					cost_factor = 1
					equipment = ship_hull_midget_submarine
				}
			}

			if = { #Italian content from Midget Submarines focus moved here (focus now completes this SP)
				limit = {
					original_tag = ILD
				}
				if = {
					limit = {
						has_dlc = "Man the Guns"
					}
					create_equipment_variant = {
						name = "CB Class"
						type = ship_hull_midget_submarine
						allow_without_tech = yes # Display tooltip as if we have the tech.
						name_group = ITA_SS_HISTORICAL
						parent_version = 0
						allow_without_tech = yes # Display tooltip as if we have the tech.
						mark_older_equipment_obsolete = yes
						modules = {
							fixed_ship_torpedo_slot = ship_torpedo_sub_2
							fixed_ship_engine_slot = sub_ship_engine_2
						}
					}
					add_equipment_production = {
						equipment = {
							type = ship_hull_midget_submarine
							creator = "ILD"
							version_name = "CB Class"
						}
						name = "Ammiraglio Millo"
						requested_factories = 1
						progress = 0.35
						amount = 2
					}
				}
				else = {
					create_equipment_variant = {
						name = "CB Class"
						type = midget_submarine
						allow_without_tech = yes # Display tooltip as if we have the tech.
						name_group = ITA_SS_HISTORICAL
						parent_version = 0
						allow_without_tech = yes # Display tooltip as if we have the tech.
						mark_older_equipment_obsolete = yes
						upgrades = {
							sub_torpedo_upgrade = 2
							sub_engine_upgrade = 2
						}
					}
					add_equipment_production = {
						equipment = {
							type = midget_submarine
							creator = "ILD"
							version_name = "CB Class"
						}
						name = "Ammiraglio Millo"
						requested_factories = 1
						progress = 0.35
						amount = 2
					}
				}
			}
			hidden_effect = {
				set_technology = {
					midget_submarine = 1
					popup = no
				}
			}
		}
	}

	generic_prototype_rewards = {
		sp_naval_generic_reward_scientist_xp_1
		sp_naval_generic_reward_scientist_xp_2
		sp_naval_generic_reward_scientist_xp_3
		sp_naval_generic_reward_navy_xp_1
		sp_naval_generic_reward_navy_xp_2
		sp_naval_generic_reward_navy_xp_3
		sp_naval_generic_reward_major_progress_1
		sp_naval_generic_reward_major_progress_2
		sp_naval_generic_reward_major_progress_3
		sp_naval_generic_reward_test_failure_1
		sp_naval_generic_reward_test_failure_2
		sp_naval_generic_reward_test_failure_3
		sp_naval_generic_failure_torpedo_accident
	}

	unique_prototype_rewards = {
		sp_naval_midget_submarine_unique_reward_a = {
			fire_only_once = yes

			threshold = {
				min = 40
				max = 90
			}

			weight = {
				base = 100
			}

			option = {
				token = sp_naval_midget_submarine_preference_a

				iteration_output = {
					country_effects = {
						if = {
							limit = { has_dlc = "Man the Guns"}

							add_equipment_bonus = {
								name = sp_midget_submarine_eq_bonus_stealth
								bonus = {
									ship_hull_midget_submarine = {
										naval_range = -0.2
										sub_visibility = -0.1
									}
								}
							}
						}
						else = {
							add_equipment_bonus = {
								name = sp_midget_submarine_eq_bonus_stealth
								bonus = {
									midget_submarine = {
										naval_range = -0.2
										sub_visibility = -0.1
									}
								}
							}
						}
					}
				}
			}

			option = {
				token = sp_naval_midget_submarine_preference_b
				default = yes
				iteration_output = {
					country_effects = {
						if = {
							limit = { has_dlc = "Man the Guns"}

							add_equipment_bonus = {
								name = sp_midget_submarine_eq_bonus_reliability
								bonus = {
									ship_hull_midget_submarine = {
										reliability = 0.1
									}
								}
							}
						}
						else = {
							add_equipment_bonus = {
								name = sp_midget_submarine_eq_bonus_reliability
								bonus = {
									midget_submarine = {
										reliability	= 0.1
									}
								}
							}
						}
					}
				}
			}

			option = {
				token = sp_naval_midget_submarine_preference_c

				iteration_output = {
					country_effects = {
						if = {
							limit = { has_dlc = "Man the Guns"}

							add_equipment_bonus = {
								name = sp_midget_submarine_eq_bonus_range
								bonus = {
									ship_hull_midget_submarine = {
										naval_range = 0.2
										sub_visibility = 0.1
									}
								}
							}
						}
						else = {
							add_equipment_bonus = {
								name = sp_midget_submarine_eq_bonus_range
								bonus = {
									midget_submarine = {
										naval_range = 0.2
										sub_visibility = 0.1
									}
								}
							}
						}
					}
				}
			}
		}
	}
}

#Air-Independent Propulsion
sp_naval_aip_engine = {
	specialization = specialization_naval

	resource_cost = {
		resources = {
			steel = 8
			chromium = 8
		}
	}

	project_tags = {
		sp_tag_surface_ship
		sp_tag_submarine
	}

	ai_will_do = {
		base = 1
		modifier = {
			factor = 0.2
			ROOT = {
				original_tag = JAP
				OR = {
					has_government = fascism
					has_government = neutrality
				}
			}
		}
	}

	allowed = {
		has_dlc = "Gotterdammerung"
	}

	available = {
		FROM = {
			if = { limit = { is_ai = yes }
				sp_naval_aip_engine_trigger = yes
			}
		}
		FROM = {
			if = {
				limit = {
					has_dlc = "Man the Guns"
				}
				has_tech = basic_ship_hull_submarine
			}
			else = {
				has_tech = basic_submarine
			}

		}
	}

	breakthrough_cost = {
		specialization_naval = 2
	}

	complexity = sp_complexity.large
	prototype_time = sp_time.prototype.medium

	project_output = {
		country_effects = {
			if = {
				limit = {
				NOT = {has_dlc = "Man the Guns"}
			}
			custom_effect_tooltip = {
					localization_key = sp_naval_aip_engine_non_mtg_tt
				}
			}

		}

		country_effects = {
			if = {
				limit = {
					has_dlc = "Man the Guns"
				}
				custom_effect_tooltip = {
					localization_key = SP_UNLOCK_TECH
					TECH = sp_aip_engine_improved_tech
				}
			}

		}
		enable_equipment_modules = {
			limit = {
				has_dlc = "Man the Guns"
			}
			open_cycle_aip
		}

		enable_subunits = {

		}
	}

	generic_prototype_rewards = {
		sp_naval_generic_reward_scientist_xp_1
		sp_naval_generic_reward_scientist_xp_2
		sp_naval_generic_reward_scientist_xp_3
		sp_naval_generic_reward_navy_xp_1
		sp_naval_generic_reward_navy_xp_2
		sp_naval_generic_reward_navy_xp_3
		sp_naval_generic_reward_major_progress_1
		sp_naval_generic_reward_major_progress_2
		sp_naval_generic_reward_major_progress_3
		sp_naval_generic_reward_test_failure_1
		sp_naval_generic_reward_test_failure_2
		sp_naval_generic_reward_test_failure_3
	}

	unique_prototype_rewards = {
		sp_naval_aip_engine_unique_reward_a = {
			fire_only_once = yes

			threshold = {
				min = 40
				max = 90
			}

			weight = {
				base = 100
			}

			option = {
				token = sp_naval_aip_engine_preference_a

				iteration_output = {
					country_effects = {

					}

					equipment_bonus = {
						ship_hull_submarine = {
							sub_visibility = -0.1
							fuel_consumption = 0.1
							instant = yes
						}
					}

				}
			}

			option = {
				token = sp_naval_aip_engine_preference_b

				iteration_output = {
					country_effects = {

					}
					equipment_bonus = {
						ship_hull_submarine = {
							naval_speed = 0.1
							fuel_consumption = 0.1
							instant = yes
						}

					}

				}
			}

			option = {
				token = sp_naval_aip_engine_preference_c
				default = yes
				iteration_output = {
					country_effects = {

					}
					equipment_bonus = {
						ship_hull_submarine = {
							fuel_consumption = -0.05
							instant = yes
						}

					}

				}
			}

		}
	}

}

#ANECHOIC TILES
sp_naval_anechoic_tiles = {
	specialization = specialization_naval


	project_tags = sp_tag_submarine

	ai_will_do = {
		base = 1
		modifier = {
			factor = 0.2
			ROOT = {
				original_tag = JAP
				OR = {
					has_government = fascism
					has_government = neutrality
				}
			}
		}
	}

	allowed = {
		has_dlc = "Gotterdammerung"
	}

	available = {
		FROM = {
			if = { limit = { is_ai = yes }
				sp_naval_anechoic_tiles_trigger = yes
			}
		}
		FROM = {
			if = {
				limit = {
					has_dlc = "Man the Guns"
				}
				has_tech = basic_ship_hull_submarine
				has_tech = improved_rubber_processing
			}
			else = {
				has_tech = basic_submarine
				has_tech = improved_rubber_processing
			}

		}
	}

	breakthrough_cost = {
		specialization_naval = 1
	}

	resource_cost = {
		resources = {
			rubber = 12
			steel = 8
		}
	}

	complexity = sp_complexity.small
	prototype_time = sp_time.prototype.short

	project_output = {
		country_effects = {
			if = {
				limit = {
				NOT = {has_dlc = "Man the Guns"}
			}
			custom_effect_tooltip = {
					localization_key = sp_naval_anechoic_tiles_non_mtg_tt
				}
			}
		}
		enable_equipment_modules = {
			limit = {
				has_dlc = "Man the Guns"
			}
			anechoic_tiles_1
		}



		enable_subunits = {

		}
	}

	generic_prototype_rewards = {
		sp_naval_generic_reward_scientist_xp_1
		sp_naval_generic_reward_scientist_xp_2
		sp_naval_generic_reward_scientist_xp_3
		sp_naval_generic_reward_navy_xp_1
		sp_naval_generic_reward_navy_xp_2
		sp_naval_generic_reward_navy_xp_3
		sp_naval_generic_reward_major_progress_1
		sp_naval_generic_reward_major_progress_2
		sp_naval_generic_reward_major_progress_3
		sp_naval_generic_reward_test_failure_1
		sp_naval_generic_reward_test_failure_2
		sp_naval_generic_reward_test_failure_3
	}

	unique_prototype_rewards = {
		# sp_naval_anechoic_tiles_unique_reward_a = {
			# fire_only_once = yes

			# threshold = {
				# min = 40
				# max = 90
			# }

			# weight = {
				# base = 100
			# }

			# option = {
				# token = sp_naval_anechoic_tiles_preference_a

				# iteration_output = {
					# country_effects = {

					# }

					# equipment_bonus = {
						# ship_hull_submarine = {
							# build_cost_ic = 0.05
							# surface_detection = 0.1
							# instant = yes
						# }
					# }

				# }
			# }

			# option = {
				# token = sp_naval_anechoic_tiles_preference_b

				# iteration_output = {
					# country_effects = {

					# }
					# equipment_bonus = {
						# ship_hull_submarine = {
							# build_cost_ic = 0.1
							# sub_visibility = -0.05
							# instant = yes
						# }

					# }

				# }
			# }

			# option = {
				# token = sp_naval_anechoic_tiles_preference_c
				# default = yes
				# iteration_output = {
					# country_effects = {

					# }

					# equipment_bonus = {
						# ship_hull_submarine = {
							 # build_cost_ic = -0.05
							 # instant = yes
						# }
					# }

				# }
			# }

		# }
	}

}


#SUBMARINE CARRIER
sp_naval_submarine_carrier = {
specialization = specialization_naval

	project_tags = sp_tag_submarine

	ai_will_do = {
		base = 1
		modifier = {
			factor = 2
			ROOT = {
				original_tag = JAP
				OR = {
					has_government = fascism
					has_government = neutrality
				}
			}
		}
	}

	allowed = {
		has_dlc = "No Compromise, No Surrender"
	}

	available = {
		FROM = {
			has_tech = basic_ship_hull_carrier
			has_tech = improved_ship_hull_submarine
		}
	}

	resource_cost = {
		resources = {
			steel = 12
			chromium = 6
		}
	}

	breakthrough_cost = {
		specialization_naval = 2
	}

	complexity = sp_complexity.large
	prototype_time = sp_time.prototype.medium
	project_output = {
		country_effects = {
			add_design_template_bonus = {
				name = sp_naval_submarine_carrier_free_design
				uses = 1
				cost_factor = 1
				equipment = ship_hull_carrier_submarine
			}
			custom_effect_tooltip = {
				localization_key = SP_UNLOCK_TECH
				TECH = ship_hull_carrier_submarine
			}
			hidden_effect = {
				set_technology = {
					ship_hull_carrier_submarine = 1
					popup = no
				}
			}
		}

		enable_equipments = {
			ship_hull_carrier_submarine
		}

		enable_equipment_modules = {
			 ship_submarine_deck_space
		}

		enable_subunits = {

		}
	}
	generic_prototype_rewards = {
		sp_naval_generic_reward_scientist_xp_1
		sp_naval_generic_reward_scientist_xp_2
		sp_naval_generic_reward_scientist_xp_3
		sp_naval_generic_reward_navy_xp_1
		sp_naval_generic_reward_navy_xp_2
		sp_naval_generic_reward_navy_xp_3
		sp_naval_generic_reward_major_progress_1
		sp_naval_generic_reward_major_progress_2
		sp_naval_generic_reward_major_progress_3
		sp_naval_generic_reward_test_failure_1
		sp_naval_generic_reward_test_failure_2
		sp_naval_generic_reward_test_failure_3
	}

	unique_prototype_rewards = {
		sp_naval_submarine_carrier_unique_reward_a = {
			fire_only_once = yes

			threshold = {
				min = 40
				max = 90
			}

			weight = {
				base = 100
			}

			option = {
				token = sp_naval_submarine_carrier_preference_a

				iteration_output = {
					country_effects = {
						add_equipment_bonus = {
							name = sp_naval_submarine_carrier_eq_bonus_range
							bonus = {
								ship_hull_carrier_submarine = {
									naval_range = 0.1
									sub_visibility = 0.05
								}
							}
						}
					}
				}
			}
			option = {
				token = sp_naval_submarine_carrier_preference_b
				default = yes
				iteration_output = {
					country_effects = {
						add_equipment_bonus = {
							name = sp_naval_submarine_carrier_eq_bonus_strength
							bonus = {
								ship_hull_carrier_submarine = {
									max_strength = 0.05
									naval_weather_penalty_factor = -0.1
								}
							}
						}
					}
				}
			}
			option = {
				token = sp_naval_submarine_carrier_preference_c
				iteration_output = {
					country_effects = {
						add_equipment_bonus = {
							name = sp_naval_submarine_carrier_eq_bonus_stealth
							bonus = {
								ship_hull_carrier_submarine = {
									sub_visibility = -0.1
								}
							}
						}
					}
				}
			}
		}
	}
}

#########################################################

 ## #  # ###  ###  ##   ##  ###      ## #  # ### ###   ##
#   #  # #  # #   #  # #  # #       #   #  #  #  #  # #
 #  #  # ###  ##  #### #    ##       #  ####  #  ###   #
  # #  # #  # #   #  # #  # #         # #  #  #  #      #
##   ##  #  # #   #  #  ##  ###     ##  #  # ### #    ##

#########################################################
#Torpedo Cruiser
sp_naval_torpedo_cruiser = {
	specialization = specialization_naval


	project_tags = sp_tag_surface_ship

	ai_will_do = {
		base = 1
		modifier = {
			factor = 2
			ROOT = {
				original_tag = JAP
				OR = {
					has_government = fascism
					has_government = neutrality
				}
			}
		}
	}

	allowed = {
		#FREE
	}
	available = {
		FROM = {
			if = { limit = { is_ai = yes }
				sp_naval_torpedo_cruiser_trigger = yes
			}
		}
		FROM = {
			if = {
				limit = {
					has_dlc = "Man the Guns"
				}
				has_tech = early_ship_hull_cruiser
				has_tech = basic_torpedo
			}
			else = {
				has_tech = early_light_cruiser
			}

		}

	}

	complexity = sp_complexity.small
	prototype_time = sp_time.prototype.short

	resource_cost = {
		resources = {
			steel = 8
			tungsten = 2
			chromium = 2
		}
	}

	breakthrough_cost = {
		specialization_naval = 1
	}
	project_output = {
		country_effects = {
			if = {
				limit = {
					has_dlc = "Man the Guns"
				}
				add_design_template_bonus = {
					name = sp_naval_torpedo_cruiser_free_design
					uses = 1
					cost_factor = 1
					equipment = ship_hull_torpedo_cruiser
				}
			}
		}



		enable_equipments = {
			limit = {
				has_dlc = "Man the Guns"
			}
			ship_hull_torpedo_cruiser
		}


		enable_equipments = {
			limit = {
				not = {has_dlc = "Man the Guns"}
			}
				torpedo_cruiser
			}

		enable_equipment_modules = {

		}

		enable_subunits = {

		}

	}
	generic_prototype_rewards = {
		sp_naval_generic_reward_scientist_xp_1
		sp_naval_generic_reward_scientist_xp_2
		sp_naval_generic_reward_scientist_xp_3
		sp_naval_generic_reward_navy_xp_1
		sp_naval_generic_reward_navy_xp_2
		sp_naval_generic_reward_navy_xp_3
		sp_naval_generic_reward_major_progress_1
		sp_naval_generic_reward_major_progress_2
		sp_naval_generic_reward_major_progress_3
		sp_naval_generic_reward_test_failure_1
		sp_naval_generic_reward_test_failure_2
		sp_naval_generic_reward_test_failure_3
		sp_naval_generic_reward_armor_tech_1
		sp_naval_generic_reward_armor_tech_2
		sp_naval_generic_reward_armor_tech_3
		sp_naval_generic_reward_artillery_tech_1
		sp_naval_generic_reward_artillery_tech_2
		sp_naval_generic_reward_artillery_tech_3
		sp_naval_generic_failure_torpedo_accident
	}

	unique_prototype_rewards = {
		sp_naval_torpedo_cruiser_unique_reward_a = {
			fire_only_once = yes

			threshold = {
				min = 40
				max = 90
			}

			weight = {
				base = 100
			}

			option = {
				token = sp_naval_torpedo_cruiser_preference_a

				iteration_output = {
					country_effects = {
						if = {
							limit = { has_dlc = "Man the Guns"}

							add_equipment_bonus = {
								name = sp_torpedo_cruiser_eq_bonus_torpedo
								bonus = {
									ship_hull_torpedo_cruiser = {
										naval_torpedo_hit_chance_factor = 0.1
										torpedo_attack = 0.15
									}
								}
							}
						}
						else = {
							add_equipment_bonus = {
								name = sp_torpedo_cruiser_eq_bonus_torpedo
								bonus = {
									torpedo_cruiser = {
										naval_torpedo_hit_chance_factor = 0.1
										torpedo_attack = 0.15
									}
								}
							}
						}
					}
				}
			}

			option = {
				token = sp_naval_torpedo_cruiser_preference_b

				iteration_output = {
					country_effects = {
						if = {
							limit = { has_dlc = "Man the Guns"}

							add_equipment_bonus = {
								name = sp_torpedo_cruiser_eq_bonus_light_attack
								bonus = {
									ship_hull_torpedo_cruiser = {
										naval_light_gun_hit_chance_factor = 0.15
										lg_attack = 0.1
										lg_armor_piercing = 0.1
									}
								}
							}
						}
						else = {
							add_equipment_bonus = {
								name = sp_torpedo_cruiser_eq_bonus_light_attack
								bonus = {
									torpedo_cruiser = {
										naval_light_gun_hit_chance_factor = 0.15
										lg_attack = 0.1
										lg_armor_piercing = 0.1
									}
								}
							}
						}
					}
				}
			}
		}
	}
}

#Panzerschiff
sp_panzerschiff = {
	specialization = specialization_naval


	project_tags = sp_tag_surface_ship

	ai_will_do = {
		base = 1
		modifier = {
			factor = 0
			AND = {
				ROOT = { is_major = no } # Pointless unless we are big enough to do this
				ROOT = { has_government = democratic }# Don't spend the tax payers' money on this, then they won't vote for you again
			}
		}
		modifier = {
			factor = 0.3
			AND = {
				ROOT = { is_major = no } # Pointless unless we are big enough to do this
			}
		}
		modifier = {
			factor = 5
			ROOT = {
				original_tag = JAP
				OR = {
					has_government = fascism
					has_government = neutrality
				}
			}
		}
	}

	allowed = {
		#FREE
	}

	available = {
		FROM = {
			if = { limit = { is_ai = yes }
				sp_panzerschiff_trigger = yes
			}
		}
		FROM = {
			if = {
				limit = {
					has_dlc = "Man the Guns"
				}
				has_tech = early_ship_hull_cruiser
				has_tech = early_ship_hull_heavy
				has_tech = basic_heavy_battery
			}
			else = {
				has_tech = early_light_cruiser
			}
		}
	}

	complexity = sp_complexity.small
	prototype_time = sp_time.prototype.medium

	resource_cost = {
		resources = {
			steel = 9
			tungsten = 3
			chromium = 2
		}
	}

	breakthrough_cost = {
		specialization_naval = 2
	}

	project_output = {
  country_effects = {
  hidden_effect = {
    set_technology = {
      panzerschiffe = 1
      popup = no
    }
  }
}

		enable_equipments = {
			limit = {
				has_dlc = "Man the Guns"
			}
			ship_hull_cruiser_panzerschiff
		}


		enable_equipments = {
			limit = {
				not = {has_dlc = "Man the Guns"}
			}
			torpedo_cruiser
		}

		enable_equipment_modules = {

		}

		enable_subunits = {

		}

	}

	generic_prototype_rewards = {
		sp_naval_generic_reward_scientist_xp_1
		sp_naval_generic_reward_scientist_xp_2
		sp_naval_generic_reward_scientist_xp_3
		sp_naval_generic_reward_navy_xp_1
		sp_naval_generic_reward_navy_xp_2
		sp_naval_generic_reward_navy_xp_3
		sp_naval_generic_reward_major_progress_1
		sp_naval_generic_reward_major_progress_2
		sp_naval_generic_reward_major_progress_3
		sp_naval_generic_reward_test_failure_1
		sp_naval_generic_reward_test_failure_2
		sp_naval_generic_reward_test_failure_3
		sp_naval_generic_reward_armor_tech_1
		sp_naval_generic_reward_armor_tech_2
		sp_naval_generic_reward_armor_tech_3
		sp_naval_generic_reward_artillery_tech_1
		sp_naval_generic_reward_artillery_tech_2
		sp_naval_generic_reward_artillery_tech_3
		sp_naval_generic_failure_torpedo_accident
	}

	unique_prototype_rewards = {
		# sp_naval_torpedo_cruiser_unique_reward_a = {
			# fire_only_once = yes

			# threshold = {
				# min = 40
				# max = 90
			# }

			# weight = {
				# base = 100
			# }

			# option = {
				# token = sp_naval_torpedo_cruiser_preference_a

				# iteration_output = {
					# country_effects = {
						# if = {
							# limit = { has_dlc = "Man the Guns"}

							# add_equipment_bonus = {
								# name = sp_torpedo_cruiser_eq_bonus_torpedo
								# bonus = {
									# ship_hull_torpedo_cruiser = {
										# naval_torpedo_hit_chance_factor = 0.1
										# torpedo_attack = 0.15
									# }
								# }
							# }
						# }
						# else = {
							# add_equipment_bonus = {
								# name = sp_torpedo_cruiser_eq_bonus_torpedo
								# bonus = {
									# torpedo_cruiser = {
										# naval_torpedo_hit_chance_factor = 0.1
										# torpedo_attack = 0.15
									# }
								# }
							# }
						# }
					# }
				# }
			# }

			# option = {
				# token = sp_naval_torpedo_cruiser_preference_b

				# iteration_output = {
					# country_effects = {
						# if = {
							# limit = { has_dlc = "Man the Guns"}

							# add_equipment_bonus = {
								# name = sp_torpedo_cruiser_eq_bonus_light_attack
								# bonus = {
									# ship_hull_torpedo_cruiser = {
										# naval_light_gun_hit_chance_factor = 0.15
										# lg_attack = 0.1
										# lg_armor_piercing = 0.1
									# }
								# }
							# }
						# }
						# else = {
							# add_equipment_bonus = {
								# name = sp_torpedo_cruiser_eq_bonus_light_attack
								# bonus = {
									# torpedo_cruiser = {
										# naval_light_gun_hit_chance_factor = 0.15
										# lg_attack = 0.1
										# lg_armor_piercing = 0.1
									# }
								# }
							# }
						# }
					# }
				# }
			# }
		# }
	}
}

#Super Heavy Battleship
sp_naval_super_heavy_battleship = {
	specialization = specialization_naval

	project_tags = sp_tag_surface_ship

	ai_will_do = {
		base = 1
	}

	allowed = {
		#FREE
	}

	available = {
		FROM = {
			if = { limit = { is_ai = yes }
				sp_naval_super_heavy_battleship_trigger = yes
			}
		}
		FROM = {
			if = {
				limit = {
					has_dlc = "Man the Guns"
					}
			has_tech = early_ship_hull_heavy

			}
			else = {
				has_tech = early_battleship
			}
		}
	}

	complexity = sp_complexity.medium
	prototype_time = sp_time.prototype.medium


	resource_cost = {
		resources = {
			steel = 12
			chromium = 6
			tungsten = 6
		 }
	}

	breakthrough_cost = {
		specialization_naval = 1
	}
	project_output = {
		country_effects = {
			if = {
				limit = {
				NOT = {has_dlc = "Man the Guns"}
			}
			custom_effect_tooltip = {
				localization_key = SP_UNLOCK_TECH
				TECH = heavy_battleship2
				}
			}
			else = {
				add_design_template_bonus = {
					name = sp_naval_super_heavy_battleship_free_design
					uses = 1
					cost_factor = 1
					equipment = ship_hull_super_heavy_1
				}
        hidden_effect = {
  set_technology = {
    ship_hull_super_heavy = 1
    popup = no
  }
}
			}
		}

		enable_equipments = {
			limit = {
				has_dlc = "Man the Guns"
			}
			ship_hull_super_heavy_1
		}
		enable_equipments = {
			limit = {
				not = {has_dlc = "Man the Guns"}
			}
			SH_battleship_1
		}

		enable_equipment_modules = {
			limit = { has_dlc = "Man the Guns" }
			ship_armor_shbb
		}

		enable_subunits = {

		}


	}
	generic_prototype_rewards = {
		sp_naval_generic_reward_scientist_xp_1
		sp_naval_generic_reward_scientist_xp_2
		sp_naval_generic_reward_scientist_xp_3
		sp_naval_generic_reward_navy_xp_1
		sp_naval_generic_reward_navy_xp_2
		sp_naval_generic_reward_navy_xp_3
		sp_naval_generic_reward_major_progress_1
		sp_naval_generic_reward_major_progress_2
		sp_naval_generic_reward_major_progress_3
		sp_naval_generic_reward_test_failure_1
		sp_naval_generic_reward_test_failure_2
		sp_naval_generic_reward_test_failure_3
		sp_naval_generic_reward_armor_tech_1
		sp_naval_generic_reward_armor_tech_2
		sp_naval_generic_reward_armor_tech_3
		sp_naval_generic_reward_artillery_tech_1
		sp_naval_generic_reward_artillery_tech_2
		sp_naval_generic_reward_artillery_tech_3
	}

	unique_prototype_rewards = {
		sp_naval_super_heavy_battleship_unique_reward_a = {
			fire_only_once = yes

			threshold = {
				min = 10
				max = 50
			}

			weight = {
				base = 100
			}

			option = {
				token = sp_naval_super_heavy_battleship_preference_a_a

				iteration_output = {
					country_effects = {
						if = {
							limit = { has_dlc = "Man the Guns"}

							add_equipment_bonus = {
								name = sp_super_heavy_battleship_eq_bonus_heavy_attack
								bonus = {
									ship_hull_super_heavy_1 = {
										naval_heavy_gun_hit_chance_factor = 0.15
										hg_attack = 0.15
										hg_armor_piercing = 0.1
									}
									ship_hull_super_heavy_2 = {
										naval_heavy_gun_hit_chance_factor = 0.15
										hg_attack = 0.15
										hg_armor_piercing = 0.1
									}
								}
							}
						}
						else = {
							add_equipment_bonus = {
								name = sp_super_heavy_battleship_eq_bonus_heavy_attack
								bonus = {
									SH_battleship_1 = {
										naval_heavy_gun_hit_chance_factor = 0.15
										hg_attack = 0.15
										hg_armor_piercing = 0.1
									}
								}
							}
						}
					}

				}
			}

			option = {
				token = sp_naval_super_heavy_battleship_preference_b_a
				default = yes
				iteration_output = {
					country_effects = {
						if = {
							limit = { has_dlc = "Man the Guns"}

							add_equipment_bonus = {
								name = sp_super_heavy_battleship_eq_bonus_speed
								bonus = {
									ship_hull_super_heavy_1 = {
										naval_speed = 0.1
										surface_detection = 0.15
										surface_visibility = -0.05
									}
									ship_hull_super_heavy_2 = {
										naval_speed = 0.1
										surface_detection = 0.15
										surface_visibility = -0.05
									}
								}
							}
						}
						else = {
							add_equipment_bonus = {
								name = sp_super_heavy_battleship_eq_bonus_speed
								bonus = {
									SH_battleship_1 = {
										naval_speed = 0.1
										surface_detection = 0.15
										surface_visibility = -0.05
									}
								}
							}
						}
					}
				}
			}

			option = {
				token = sp_naval_super_heavy_battleship_preference_c_a

				iteration_output = {
					country_effects = {
						if = {
							limit = { has_dlc = "Man the Guns"}

							add_equipment_bonus = {
								name = sp_super_heavy_battleship_eq_bonus_light_attack
								bonus = {
									ship_hull_super_heavy_1 = {
										naval_light_gun_hit_chance_factor = 0.1
										lg_attack = 0.1
										lg_armor_piercing = 0.1
									}
									ship_hull_super_heavy_2 = {
										naval_light_gun_hit_chance_factor = 0.1
										lg_attack = 0.1
										lg_armor_piercing = 0.1
									}
								}
							}
						}
						else = {
							add_equipment_bonus = {
								name = sp_super_heavy_battleship_eq_bonus_light_attack
								bonus = {
									SH_battleship_1 = {
										naval_light_gun_hit_chance_factor = 0.1
										lg_attack = 0.1
										lg_armor_piercing = 0.1
									}
								}
							}
						}
					}
				}
			}

		}

		sp_naval_super_heavy_battleship_unique_reward_b = {
			fire_only_once = yes

			threshold = {
				min = 55
				max = 95
			}

			weight = {
				base = 100
			}

			option = {
				token = sp_naval_super_heavy_battleship_preference_a_b

				iteration_output = {
					country_effects = {
						if = {
							limit = { has_dlc = "Man the Guns"}

							add_equipment_bonus = {
								name = sp_super_heavy_battleship_eq_bonus_armor
								bonus = {
									ship_hull_super_heavy_1 = {
										armor_value = 0.1
										max_strength = 0.1
									}
									ship_hull_super_heavy_2 = {
										armor_value = 0.1
										max_strength = 0.1
									}
								}
							}
						}
						else = {
							add_equipment_bonus = {
								name = sp_super_heavy_battleship_eq_bonus_armor
								bonus = {
									SH_battleship_1 = {
										armor_value = 0.1
										max_strength = 0.1
									}
								}
							}
						}
					}

				}
			}

			option = {
				token = sp_naval_super_heavy_battleship_preference_b_b

				iteration_output = {
					country_effects = {
						if = {
							limit = { has_dlc = "Man the Guns"}

							add_equipment_bonus = {
								name = sp_super_heavy_battleship_eq_bonus_anti_air
								bonus = {
									ship_hull_super_heavy_1 = {
										anti_air_attack = 0.25
										reliability = 0.05
									}
									ship_hull_super_heavy_2 = {
										anti_air_attack = 0.25
										reliability = 0.05
									}
								}
							}
						}
						else = {
							add_equipment_bonus = {
								name = sp_super_heavy_battleship_eq_bonus_anti_air
								bonus = {
									SH_battleship_1 = {
										anti_air_attack = 0.25
										reliability = 0.05
									}
								}
							}
						}
					}
				}
			}

			option = {
				token = sp_naval_super_heavy_battleship_preference_c_b

				iteration_output = {
					country_effects = {
						if = {
							limit = { has_dlc = "Man the Guns"}

							add_equipment_bonus = {
								name = sp_super_heavy_battleship_eq_bonus_anti_torpedo
								bonus = {
									ship_hull_super_heavy_1 = {
										naval_torpedo_enemy_critical_chance_factor = 0.15
										naval_torpedo_damage_reduction_factor = 0.15
									}
									ship_hull_super_heavy_2 = {
										naval_torpedo_enemy_critical_chance_factor = 0.15
										naval_torpedo_damage_reduction_factor = 0.15
									}
								}
							}
						}
						else = {
							add_equipment_bonus = {
								name = sp_super_heavy_battleship_eq_bonus_anti_torpedo
								bonus = {
									SH_battleship_1 = {
										naval_torpedo_enemy_critical_chance_factor = 0.15
										naval_torpedo_damage_reduction_factor = 0.15
									}
								}
							}
						}
					}
				}
			}

		}

	}

}

#Advanced Modern Super Battleship
sp_naval_modern_battleship = {
	specialization = specialization_naval


	project_tags = sp_tag_surface_ship

	ai_will_do = {
		base = 1
	}

	allowed = {
	has_dlc = "Gotterdammerung"
	}

	available = {
		FROM = {
			if = { limit = { is_ai = yes }
				sp_naval_modern_battleship_trigger = yes
			}
		}
		FROM = {
			if = {
				limit = {
					has_dlc = "Man the Guns"
					}
				has_tech = advanced_ship_hull_heavy
				or = {
					has_tech = ship_asm_battery_1_tech
					has_tech = ship_sam_missile_battery_1_tech
				}
			}
			else = {
				has_tech = advanced_battleship
			}
		}
	}

		complexity = sp_complexity.large
	prototype_time = sp_time.prototype.long


	resource_cost = {
		resources = {
			steel = 24
			chromium = 18
			tungsten = 12
		 }
	}

	breakthrough_cost = {
		specialization_naval = 2
	}

	project_output = {
		country_effects = {
			if = {
				limit = {
					has_dlc = "Man the Guns"
				}
				add_design_template_bonus = {
					name = sp_naval_modern_battleship_free_design
					uses = 1
					cost_factor = 1
					equipment = ship_hull_heavy_5
				}
			}
			hidden_effect = {
				set_technology = {
					ship_hull_heavy_5 = 1
				}
			}
		}

		enable_equipments = {
			limit = {
				has_dlc = "Man the Guns"
			}
				ship_hull_heavy_5
		}
		enable_equipments = {
			limit = {
				not = {has_dlc = "Man the Guns"}
			}
				modern_battleship
		}
		enable_equipment_modules = {

		}

		enable_subunits = {

		}


	}

	generic_prototype_rewards = {
		sp_naval_generic_reward_scientist_xp_1
		sp_naval_generic_reward_scientist_xp_2
		sp_naval_generic_reward_scientist_xp_3
		sp_naval_generic_reward_navy_xp_1
		sp_naval_generic_reward_navy_xp_2
		sp_naval_generic_reward_navy_xp_3
		sp_naval_generic_reward_major_progress_1
		sp_naval_generic_reward_major_progress_2
		sp_naval_generic_reward_major_progress_3
		sp_naval_generic_reward_test_failure_1
		sp_naval_generic_reward_test_failure_2
		sp_naval_generic_reward_test_failure_3
		sp_naval_generic_reward_armor_tech_1
		sp_naval_generic_reward_armor_tech_2
		sp_naval_generic_reward_armor_tech_3
		sp_naval_generic_reward_artillery_tech_1
		sp_naval_generic_reward_artillery_tech_2
		sp_naval_generic_reward_artillery_tech_3
	}

	unique_prototype_rewards = {
		sp_naval_modern_battleship_unique_reward_a = {
			fire_only_once = yes

			threshold = {
				min = 10
				max = 50
			}

			weight = {
				base = 100
			}

			option = {
				token = sp_naval_modern_battleship_preference_a_a

				iteration_output = {
					country_effects = {
						if = {
							limit = { has_dlc = "Man the Guns"}

							add_equipment_bonus = {
								name = sp_modern_battleship_eq_bonus_heavy_attack
								bonus = {
									ship_hull_heavy_5 = {
										naval_heavy_gun_hit_chance_factor = 0.2
										hg_attack = 0.15
										hg_armor_piercing = 0.15
									}
								}
							}
						}
						else = {
							add_equipment_bonus = {
								name = sp_modern_battleship_eq_bonus_heavy_attack
								bonus = {
									ship_hull_heavy_5 = {
										naval_heavy_gun_hit_chance_factor = 0.2
										hg_attack = 0.15
										hg_armor_piercing = 0.15
									}
								}
							}
						}
					}

				}
			}

			option = {
				token = sp_naval_modern_battleship_preference_b_a
				default = yes
				iteration_output = {
					country_effects = {
						if = {
							limit = { has_dlc = "Man the Guns"}

							add_equipment_bonus = {
								name = sp_modern_battleship_eq_bonus_speed
								bonus = {
									ship_hull_heavy_5 = {
										naval_speed = 0.1
										surface_detection = 0.15
										surface_visibility = -0.07
									}
								}
							}
						}
						else = {
							add_equipment_bonus = {
								name = sp_modern_battleship_eq_bonus_speed
								bonus = {
									ship_hull_heavy_5 = {
										naval_speed = 0.1
										surface_detection = 0.15
										surface_visibility = -0.07
									}
								}
							}
						}
					}
				}
			}

			option = {
				token = sp_naval_modern_battleship_preference_c_a

				iteration_output = {
					country_effects = {
						if = {
							limit = { has_dlc = "Man the Guns"}

							add_equipment_bonus = {
								name = sp_modern_battleship_eq_bonus_light_attack
								bonus = {
									ship_hull_heavy_5 = {
										naval_light_gun_hit_chance_factor = 0.1
										lg_attack = 0.1
										lg_armor_piercing = 0.15
									}
								}
							}
						}
						else = {
							add_equipment_bonus = {
								name = sp_modern_battleship_eq_bonus_light_attack
								bonus = {
									ship_hull_heavy_5 = {
										naval_light_gun_hit_chance_factor = 0.1
										lg_attack = 0.1
										lg_armor_piercing = 0.15
									}
								}
							}
						}
					}
				}
			}

		}

		sp_naval_modern_battleship_unique_reward_b = {
			fire_only_once = yes

			threshold = {
				min = 55
				max = 95
			}

			weight = {
				base = 100
			}

			option = {
				token = sp_naval_modern_battleship_preference_a_b

				iteration_output = {
					country_effects = {
						if = {
							limit = { has_dlc = "Man the Guns"}

							add_equipment_bonus = {
								name = sp_modern_battleship_eq_bonus_armor
								bonus = {
									ship_hull_heavy_5 = {
										armor_value = 0.15
										max_strength = 0.1
									}
								}
							}
						}
						else = {
							add_equipment_bonus = {
								name = sp_modern_battleship_eq_bonus_armor
								bonus = {
									ship_hull_heavy_5 = {
										armor_value = 0.15
										max_strength = 0.1
									}
								}
							}
						}
					}
				}
			}

			option = {
				token = sp_naval_modern_battleship_preference_b_b

				iteration_output = {
					country_effects = {
						if = {
							limit = { has_dlc = "Man the Guns"}

							add_equipment_bonus = {
								name = sp_modern_battleship_eq_bonus_anti_air
								bonus = {
									ship_hull_heavy_5 = {
										anti_air_attack = 0.25
										reliability = 0.07
									}
								}
							}
						}
						else = {
							add_equipment_bonus = {
								name = sp_modern_battleship_eq_bonus_anti_air
								bonus = {
									modern_battleship = {
										anti_air_attack = 0.25
										reliability = 0.07
									}
								}
							}
						}
					}
				}
			}

			option = {
				token = sp_naval_modern_battleship_preference_c_b

				iteration_output = {
					country_effects = {
						if = {
							limit = { has_dlc = "Man the Guns"}

							add_equipment_bonus = {
								name = sp_modern_battleship_eq_bonus_anti_torpedo
								bonus = {
									ship_hull_heavy_5 = {
										naval_torpedo_enemy_critical_chance_factor = 0.15
										naval_torpedo_damage_reduction_factor = 0.2
									}
								}
							}
						}
						else = {
							add_equipment_bonus = {
								name = sp_modern_battleship_eq_bonus_anti_torpedo
								bonus = {
									modern_battleship = {
										naval_torpedo_enemy_critical_chance_factor = 0.15
										naval_torpedo_damage_reduction_factor = 0.2
									}
								}
							}
						}
					}
				}
			}

		}

	}
}

#Super Naval Carrier
sp_naval_modern_carrier = {
	specialization = specialization_naval

	project_tags = sp_tag_surface_ship

	ai_will_do = {
		base = 1
		# modifier = {
			# ROOT = { is_major = yes }
			# add = 1
		# }
	}

	allowed = {
		has_dlc = "Gotterdammerung"
	}

	available = {
		FROM = {
			if = {
				limit = {
					has_dlc = "Man the Guns"
				}
				has_tech = advanced_ship_hull_carrier
			}
			else = {
				has_tech = advanced_carrier
			}

		}

	}

	breakthrough_cost = {
		specialization_naval = 2
	}


	resource_cost = {
		resources = {
			steel = 24
			chromium = 16
		}
	}

	complexity = sp_complexity.large
	prototype_time = sp_time.prototype.long

	project_output = {
		country_effects = {
			if = {
				limit = {
					has_dlc = "Man the Guns"
				}
				add_design_template_bonus = {
					name = sp_naval_modern_carrier_free_design
					uses = 1
					cost_factor = 1
					equipment = ship_hull_carrier_4
				}
			}
			hidden_effect = {
				set_technology = {
					ship_hull_carrier_4 = 1
				}
			}
		}

		enable_equipments = {
			limit = {
				has_dlc = "Man the Guns"
			}
			ship_hull_carrier_4
		}

		enable_equipments = {
			limit = {
				not = {has_dlc = "Man the Guns"}
			}
			modern_carrier
		}

		enable_equipment_modules = {
			modern_deck_space
		}

		enable_subunits = {

		}
	}

	generic_prototype_rewards = {
		sp_naval_generic_reward_scientist_xp_1
		sp_naval_generic_reward_scientist_xp_2
		sp_naval_generic_reward_scientist_xp_3
		sp_naval_generic_reward_navy_xp_1
		sp_naval_generic_reward_navy_xp_2
		sp_naval_generic_reward_navy_xp_3
		sp_naval_generic_reward_major_progress_1
		sp_naval_generic_reward_major_progress_2
		sp_naval_generic_reward_major_progress_3
		sp_naval_generic_reward_test_failure_1
		sp_naval_generic_reward_test_failure_2
		sp_naval_generic_reward_test_failure_3
		sp_naval_generic_reward_armor_tech_1
		sp_naval_generic_reward_armor_tech_2
		sp_naval_generic_reward_armor_tech_3
	}

unique_prototype_rewards = {
		sp_naval_modern_carrier_unique_reward_a = {
			fire_only_once = yes

			threshold = {
				min = 10
				max = 50
			}

			weight = {
				base = 100
			}

			option = {
				token = sp_naval_modern_carrier_preference_a_a

				iteration_output = {
					country_effects = {
						if = {
							limit = { has_dlc = "Man the Guns"}

							add_equipment_bonus = {
								name = sp_modern_carrier_eq_bonus_detection
								bonus = {
									ship_hull_carrier_4 = {
										surface_detection = 0.2
										sub_detection = 0.2
									}
									ship_hull_carrier_5 = {
										surface_detection = 0.2
										sub_detection = 0.2
									}
									ship_hull_carrier_6 = {
										surface_detection = 0.2
										sub_detection = 0.2
									}
								}
							}
						}
						else = {
							add_equipment_bonus = {
								name = sp_modern_carrier_eq_bonus_detection
								bonus = {
									modern_carrier = {
										surface_detection = 0.2
										sub_detection = 0.2
									}
								}
							}
						}
					}
				}
			}

			option = {
				token = sp_naval_modern_carrier_preference_b_a
				default = yes
				iteration_output = {
					country_effects = {
						if = {
							limit = { has_dlc = "Man the Guns"}

							add_equipment_bonus = {
								name = sp_modern_carrier_eq_bonus_speed
								bonus = {
									ship_hull_carrier_4 = {
										naval_speed = 0.1
										naval_weather_penalty_factor = -0.25
									}
									ship_hull_carrier_5 = {
										naval_speed = 0.1
										naval_weather_penalty_factor = -0.25
									}
									ship_hull_carrier_6 = {
										naval_speed = 0.1
										naval_weather_penalty_factor = -0.25
									}
								}
							}
						}
						else = {
							add_equipment_bonus = {
								name = sp_modern_carrier_eq_bonus_speed
								bonus = {
									modern_carrier = {
										naval_speed = 0.1
										naval_weather_penalty_factor = -0.25
									}
								}
							}
						}
					}
				}
			}

			option = {
				token = sp_naval_modern_carrier_preference_c_a

				iteration_output = {
					country_effects = {
						if = {
							limit = { has_dlc = "Man the Guns"}

							add_equipment_bonus = {
								name = sp_modern_carrier_eq_bonus_light_attack
								bonus = {
									ship_hull_carrier_4 = {
										naval_light_gun_hit_chance_factor = 0.1
										lg_attack = 0.15
										lg_armor_piercing = 0.15
									}
									ship_hull_carrier_5 = {
										naval_light_gun_hit_chance_factor = 0.1
										lg_attack = 0.15
										lg_armor_piercing = 0.15
									}
									ship_hull_carrier_6 = {
										naval_light_gun_hit_chance_factor = 0.1
										lg_attack = 0.15
										lg_armor_piercing = 0.15
									}
								}
							}
						}
						else = {
							add_equipment_bonus = {
								name = sp_modern_carrier_eq_bonus_light_attack
								bonus = {
									modern_carrier = {
										naval_light_gun_hit_chance_factor = 0.1
										lg_attack = 0.15
										lg_armor_piercing = 0.15
									}
								}
							}
						}
					}
				}
			}

		}

		sp_naval_modern_carrier_unique_reward_b = {
			fire_only_once = yes

			threshold = {
				min = 55
				max = 95
			}

			weight = {
				base = 100
			}

			option = {
				token = sp_naval_modern_carrier_preference_a_b

				iteration_output = {
					country_effects = {
						if = {
							limit = { has_dlc = "Man the Guns"}

							add_equipment_bonus = {
								name = sp_modern_carrier_eq_bonus_armor
								bonus = {
									ship_hull_carrier_4 = {
										armor_value = 0.15
										max_strength = 0.1
									}
									ship_hull_carrier_5 = {
										armor_value = 0.15
										max_strength = 0.1
									}
									ship_hull_carrier_6 = {
										armor_value = 0.15
										max_strength = 0.1
									}
								}
							}
						}
						else = {
							add_equipment_bonus = {
								name = sp_modern_carrier_eq_bonus_armor
								bonus = {
									modern_carrier = {
										armor_value = 0.15
										max_strength = 0.1
									}
								}
							}
						}
					}
				}
			}

			option = {
				token = sp_naval_modern_carrier_preference_b_b

				iteration_output = {
					country_effects = {
						if = {
							limit = { has_dlc = "Man the Guns"}

							add_equipment_bonus = {
								name = sp_modern_carrier_eq_bonus_anti_air
								bonus = {
									ship_hull_carrier_4 = {
										anti_air_attack = 0.25
										reliability = 0.07
									}
									ship_hull_carrier_5 = {
										anti_air_attack = 0.25
										reliability = 0.07
									}
									ship_hull_carrier_6 = {
										anti_air_attack = 0.25
										reliability = 0.07
									}
								}
							}
						}
						else = {
							add_equipment_bonus = {
								name = sp_modern_carrier_eq_bonus_anti_air
								bonus = {
									modern_carrier = {
										anti_air_attack = 0.25
										reliability = 0.07
									}
								}
							}
						}
					}
				}
			}

			option = {
				token = sp_naval_modern_carrier_preference_c_b

				iteration_output = {
					country_effects = {
						if = {
							limit = { has_dlc = "Man the Guns"}

							add_equipment_bonus = {
								name = sp_modern_carrier_eq_bonus_anti_torpedo
								bonus = {
									ship_hull_carrier_4 = {
										naval_torpedo_enemy_critical_chance_factor = 0.15
										naval_torpedo_damage_reduction_factor = 0.2
									}
									ship_hull_carrier_5 = {
										naval_torpedo_enemy_critical_chance_factor = 0.15
										naval_torpedo_damage_reduction_factor = 0.2
									}
									ship_hull_carrier_6 = {
										naval_torpedo_enemy_critical_chance_factor = 0.15
										naval_torpedo_damage_reduction_factor = 0.2
									}
								}
							}
						}
						else = {
							add_equipment_bonus = {
								name = sp_modern_carrier_eq_bonus_anti_torpedo
								bonus = {
									modern_carrier = {
										naval_torpedo_enemy_critical_chance_factor = 0.15
										naval_torpedo_damage_reduction_factor = 0.2
									}
								}
							}
						}
					}
				}
			}

		}

	}
}

#HELICOPTER CARRIER
sp_naval_ice_carrier = {
	specialization = specialization_naval

	project_tags = sp_tag_surface_ship

	ai_will_do = {
		base = 1
		# modifier = {
			# ROOT = { is_major = yes }
			# add = 1
		# }
	}

	allowed = {
		has_dlc = "Gotterdammerung"
	}

	available = {
		FROM = {
				has_tech = early_ship_hull_carrier
				OR = {
					has_tech = jump_jet_1
					has_tech = naval_helicopter_1
				}
			}
	}

	resource_cost = {
		resources = {
			steel = 20
		}
	}

	complexity = sp_complexity.medium
	prototype_time = sp_time.prototype.long

	breakthrough_cost = {
		specialization_naval = 2
	}

	project_output = {
		country_effects = {
			if = {
				limit = {
					has_dlc = "Man the Guns"
				}
				add_design_template_bonus = {
					name = sp_naval_ice_carrier_free_design
					uses = 1
					cost_factor = 0.5
					equipment = ship_hull_mega_carrier
				}
				hidden_effect = {
					set_technology = {
						ship_hull_helicopter_carrier = 1
						popup = no
					}
				}
				#SP_create_variant_of_habakkuk_for_production_line = yes
				# custom_effect_tooltip = {
					# localization_key = SP_UNLOCK_TECH
					# TECH = sp_refined_pykrete
				# }
				# add_equipment_production =	{
					# equipment = {
						# type = ship_hull_mega_carrier
						# #version_name = "Habakkuk"
					# }
					# requested_factories = 1
					# progress = 0.95
					# amount = 1
				# }
			}
			else = {
				add_equipment_production =	{
					equipment = {
						type = mega_carrier
					}
					requested_factories = 1
					progress = 0.95
					amount = 1
				}
			}
		}

		enable_equipments = {
			limit = {
				has_dlc = "Man the Guns"
			}
			ship_hull_mega_carrier
		}
		enable_equipments = {
			limit = {
				not = {has_dlc = "Man the Guns"}
			}
			mega_carrier
		}

		# enable_equipment_modules = {
			# limit = { has_dlc = "Man the Guns" }
			# big_ship_deck_space
			# ship_armor_ice_carrier_deck_1
		# }


	}

	generic_prototype_rewards = {
		sp_naval_generic_reward_scientist_xp_1
		sp_naval_generic_reward_scientist_xp_2
		sp_naval_generic_reward_scientist_xp_3
		sp_naval_generic_reward_navy_xp_1
		sp_naval_generic_reward_navy_xp_2
		sp_naval_generic_reward_navy_xp_3
		sp_naval_generic_reward_major_progress_1
		sp_naval_generic_reward_major_progress_2
		sp_naval_generic_reward_major_progress_3
		sp_naval_generic_reward_test_failure_1
		sp_naval_generic_reward_test_failure_2
		sp_naval_generic_reward_test_failure_3
	}

	unique_prototype_rewards = {
		sp_naval_ice_carrier_unique_reward_a = {
			fire_only_once = yes

			threshold = {
				min = 40
				max = 90
			}

			weight = {
				base = 100
			}

			option = {
				token = sp_naval_ice_carrier_preference_a

				iteration_output = {
					country_effects = {
						if = {
							limit = { has_dlc = "Man the Guns"}

							add_equipment_bonus = {
								name = sp_mega_carrier_eq_bonus_weather
								bonus = {
									ship_hull_mega_carrier = {
										naval_weather_penalty_factor = -0.15
										instant = yes
									}
								}
							}
						}
						else = {
							add_equipment_bonus = {
								name = sp_mega_carrier_eq_bonus_weather
								bonus = {
									mega_carrier = {
										naval_weather_penalty_factor = -0.2
										instant = yes
									}
								}
							}
						}
					}
				}
			}

			option = {
				token = sp_naval_ice_carrier_preference_b

				iteration_output = {
					country_effects = {
						if = {
							limit = { has_dlc = "Man the Guns"}

							add_equipment_bonus = {
								name = sp_mega_carrier_eq_bonus_strength
								bonus = {
									ship_hull_mega_carrier = {
										build_cost_ic = 0.05
										max_strength = 0.1
										instant = yes
									}
								}
							}
						}
						else = {
							add_equipment_bonus = {
								name = sp_mega_carrier_eq_bonus_strength
								bonus = {
									mega_carrier = {
										build_cost_ic = 0.05
										max_strength = 0.1
										instant = yes
									}
								}
							}
						}
					}
				}
			}
		}
	}

}

#Underway Replenishment
sp_naval_underway_replenishment = {
	specialization = specialization_naval

	project_tags = sp_tag_surface_ship

	ai_will_do = {
		base = 1
	}

	allowed = {
		has_dlc = "Gotterdammerung"
	}

	available = {
		FROM = {
			OR = {
				has_doctrine = new_base_strike
				has_doctrine = new_fleet_in_being
			}
			has_tech = tech_fleet_oiler_1
		}

	}

	resource_cost = {
		resources = {
			steel = 8
		}
	}

	breakthrough_cost = {
		specialization_naval = 2
	}

	complexity = sp_complexity.large
	prototype_time = sp_time.prototype.medium

	project_output = {
		country_effects = {
			custom_effect_tooltip = {
				localization_key = SP_UNLOCK_TECH
				TECH = sp_multi_product_supply_ships
				}
			set_rule = {
				can_use_underway_replenishment = yes
			}

		}

		enable_equipment_modules = {

		}

		enable_subunits = {

		}
	}

	generic_prototype_rewards = {
		sp_naval_generic_reward_scientist_xp_1
		sp_naval_generic_reward_scientist_xp_2
		sp_naval_generic_reward_scientist_xp_3
		sp_naval_generic_reward_navy_xp_1
		sp_naval_generic_reward_navy_xp_2
		sp_naval_generic_reward_navy_xp_3
		sp_naval_generic_reward_major_progress_1
		sp_naval_generic_reward_major_progress_2
		sp_naval_generic_reward_major_progress_3
		sp_naval_generic_reward_test_failure_1
		sp_naval_generic_reward_test_failure_2
		sp_naval_generic_reward_test_failure_3
	}

	unique_prototype_rewards = {
		sp_naval_underway_replenishment_unique_reward_a = {
			fire_only_once = yes

			threshold = {
				min = 40
				max = 90
			}

			weight = {
				base = 100
			}

			option = {
				token = sp_naval_underway_replenishment_preference_a

				iteration_output = {
					country_effects = {
						custom_effect_tooltip = tech_effect|sp_naval_underway_replenishment_pick_a
						hidden_effect = {
							set_technology = {
								sp_naval_underway_replenishment_pick_a = 1
								popup = no
							}
						}
					}
				}
			}

			option = {
				token = sp_naval_underway_replenishment_preference_c
				default = yes
				iteration_output = {
					country_effects = {
						#BASE UNDERWAY REPLENISHMENT
					}

				}
			}

			option = {
				token = sp_naval_underway_replenishment_preference_b

				iteration_output = {
					country_effects = {
						custom_effect_tooltip = tech_effect|sp_naval_underway_replenishment_pick_b
						hidden_effect = {
							set_technology = {
								sp_naval_underway_replenishment_pick_b = 1
								popup = no
							}
						}
					}

				}
			}


		}
	}
}

#PROXIMITY FUZE

sp_naval_proximity_fuze = {
	specialization = specialization_naval


	project_tags = sp_tag_surface_ship

	ai_will_do = {
		base = 1
	}

	allowed = {
		has_dlc = "Gotterdammerung"
	}

	available = {
		FROM = {
			has_tech = improved_radio
		}
	}

	resource_cost = {
		resources = {
			steel = 12
			chromium = 4
			tungsten = 12
		}
	}

	complexity = sp_complexity.large
	prototype_time = sp_time.prototype.medium

	breakthrough_cost = {
		specialization_naval = 2
	}

	project_output = {
		country_effects = {
			custom_effect_tooltip = sp_naval_proximity_fuze_custom_tt
			custom_effect_tooltip = {
				localization_key = SP_UNLOCK_TECH
				TECH = sp_shock_hardening_techniques
			}
			hidden_effect = {
				set_technology = {
					sp_naval_proximity_fuze_tech = 1
					popup = no
				}
			}

		}

		enable_equipment_modules = {

		}

		enable_subunits = {

		}
	}

	generic_prototype_rewards = {
		sp_naval_generic_reward_scientist_xp_1
		sp_naval_generic_reward_scientist_xp_2
		sp_naval_generic_reward_scientist_xp_3
		sp_naval_generic_reward_navy_xp_1
		sp_naval_generic_reward_navy_xp_2
		sp_naval_generic_reward_navy_xp_3
		sp_naval_generic_reward_major_progress_1
		sp_naval_generic_reward_major_progress_2
		sp_naval_generic_reward_major_progress_3
		sp_naval_generic_reward_test_failure_1
		sp_naval_generic_reward_test_failure_2
		sp_naval_generic_reward_test_failure_3
	}

	unique_prototype_rewards = {
		sp_naval_proximity_fuzes_unique_reward_a = {
			fire_only_once = yes

			threshold = {
				min = 40
				max = 90
			}

			weight = {
				base = 100
			}

			option = {
				token = sp_naval_proximity_fuzes_preference_a

				iteration_output = {
					country_effects = {

					}

					equipment_bonus = {
						anti_air_equipment = {
							build_cost_ic = -0.05
							instant = yes
						}

					}

				}
			}

			option = {
				token = sp_naval_proximity_fuzes_preference_b

				iteration_output = {
					country_effects = {

					}
					equipment_bonus = {
						anti_air_equipment = {
							air_attack = 0.15
							build_cost_ic = 0.05
							instant = yes
						}
					}

				}
			}
		}
	}

}

#PACV CARRIER
sp_air_cushion_vehicles = {
	specialization = specialization_naval

	project_tags = sp_tag_surface_ship

	ai_will_do = {
		base = 1
		modifier = {
			ROOT = { is_major = no }
			add = -1
		}
	}

	allowed = {
		has_dlc = "Gotterdammerung"
	}

	available = {
		FROM = {
			has_tech = adv_tank_landing_craft
			has_tech = second_gen_jet_engines
		}

	}

	resource_cost = {
		resources = {
			aluminium = 10
			rubber = 16
		}
	}

	complexity = sp_complexity.medium
	prototype_time = sp_time.prototype.short

	breakthrough_cost = {
		specialization_naval = 2
	}

	project_output = {

		enable_equipments = {
			pacv_equipment_1
		}
		enable_subunits = {
			pacv_support
		}

		# enable_equipment_modules = {
			# limit = { has_dlc = "Man the Guns" }
			# big_ship_deck_space
			# ship_armor_ice_carrier_deck_1
		# }


	}

	generic_prototype_rewards = {
		sp_naval_generic_reward_scientist_xp_1
		sp_naval_generic_reward_scientist_xp_2
		sp_naval_generic_reward_scientist_xp_3
		sp_naval_generic_reward_navy_xp_1
		sp_naval_generic_reward_navy_xp_2
		sp_naval_generic_reward_navy_xp_3
		sp_naval_generic_reward_major_progress_1
		sp_naval_generic_reward_major_progress_2
		sp_naval_generic_reward_major_progress_3
		sp_naval_generic_reward_test_failure_1
		sp_naval_generic_reward_test_failure_2
		sp_naval_generic_reward_test_failure_3
	}

	unique_prototype_rewards = {

	}

}

sp_naval_support_ships = {
	specialization = specialization_naval

	project_tags = sp_tag_surface_ship

	ai_will_do = {
		base = 1
	}

	allowed = {
		has_dlc = "No Compromise, No Surrender"
	}

	available = {
		FROM = {
			if = {
				limit = {
					has_dlc = "Man the Guns"
				}
			has_tech = mtg_transport
			}
			else = {
				has_tech = transport
			}
		}
	}

	resource_cost = {
		resources = {
			steel = 6
		}
	}

	breakthrough_cost = {
		specialization_naval = 1
	}

	complexity = sp_complexity.medium
	prototype_time = sp_time.prototype.medium
	project_output = {
		country_effects = {
			hidden_effect = {
				set_technology = {
					repair_ship_tech_1 = 1
					popup = no
				}
				set_technology = {
					support_ship_tech_1 = 1
					popup = no
				}
			}
		}

		enable_equipments = {
			support_ship_1
			repair_ship_1
		}

		enable_equipment_modules = {

		}

		enable_subunits = {

		}
	}
	generic_prototype_rewards = {
		sp_naval_generic_reward_scientist_xp_1
		sp_naval_generic_reward_scientist_xp_2
		sp_naval_generic_reward_scientist_xp_3
		sp_naval_generic_reward_navy_xp_1
		sp_naval_generic_reward_navy_xp_2
		sp_naval_generic_reward_navy_xp_3
		sp_naval_generic_reward_major_progress_1
		sp_naval_generic_reward_major_progress_2
		sp_naval_generic_reward_major_progress_3
		sp_naval_generic_reward_test_failure_1
		sp_naval_generic_reward_test_failure_2
		sp_naval_generic_reward_test_failure_3
	}

	unique_prototype_rewards = {
		sp_naval_support_ships_unique_reward_a = {
			fire_only_once = yes

			threshold = {
				min = 10
				max = 50
			}

			weight = {
				base = 100
			}

			option = {
				token = sp_naval_support_ships_preference_a_a

				iteration_output = {
					country_effects = {
						custom_effect_tooltip = tech_effect|sp_naval_support_ships_pick_a
						hidden_effect = {
							set_technology = {
								sp_naval_support_ships_pick_a = 1
								popup = no
							}
						}
					}
				}
			}

			option = {
				token = sp_naval_support_ships_preference_b_a
				default = yes
				iteration_output = {
					country_effects = {
						custom_effect_tooltip = tech_effect|sp_naval_support_ships_pick_b
						hidden_effect = {
							set_technology = {
								sp_naval_support_ships_pick_b = 1
								popup = no
							}
						}
					}
				}
			}

			option = {
				token = sp_naval_support_ships_preference_c_a

				iteration_output = {
					country_effects = {
						custom_effect_tooltip = tech_effect|sp_naval_support_ships_pick_c
						hidden_effect = {
							set_technology = {
								sp_naval_support_ships_pick_c = 1
								popup = no
							}
						}
					}
				}
			}

		}

		sp_naval_support_ships_unique_reward_b = {
			fire_only_once = yes

			threshold = {
				min = 55
				max = 95
			}

			weight = {
				base = 100
			}

			option = {
				token = sp_naval_support_ships_preference_a_b

				iteration_output = {
					country_effects = {
						custom_effect_tooltip = tech_effect|sp_naval_repair_ships_pick_a
						hidden_effect = {
							set_technology = {
								sp_naval_repair_ships_pick_a = 1
								popup = no
							}
						}
					}
				}
			}

			option = {
				token = sp_naval_support_ships_preference_b_b
				default = yes
				iteration_output = {
					country_effects = {
						custom_effect_tooltip = tech_effect|sp_naval_repair_ships_pick_b
						hidden_effect = {
							set_technology = {
								sp_naval_repair_ships_pick_b = 1
								popup = no
							}
						}
					}
				}
			}

			option = {
				token = sp_naval_support_ships_preference_c_b

				iteration_output = {
					country_effects = {
						custom_effect_tooltip = tech_effect|sp_naval_repair_ships_pick_c
						hidden_effect = {
							set_technology = {
								sp_naval_repair_ships_pick_c = 1
								popup = no
							}
						}
					}
				}
			}

		}

	}
}

sp_naval_escort_carrier = {
specialization = specialization_naval

	project_tags = sp_tag_surface_ship

	ai_will_do = {
		base = 1
	}

	allowed = {
		has_dlc = "No Compromise, No Surrender"
	}

	available = {
		FROM = {
			if = {
				limit = {
					has_dlc = "Man the Guns"
				}
			has_tech = basic_ship_hull_carrier
			}
			else = {
				has_tech = basic_carrier
			}
		}
	}

	resource_cost = {
		resources = {
			steel = 9
		}
	}

	breakthrough_cost = {
		specialization_naval = 1
	}

	complexity = sp_complexity.medium
	prototype_time = sp_time.prototype.medium
	project_output = {
		country_effects = {
			add_design_template_bonus = {
				name = sp_naval_escort_carrier_free_design
				uses = 1
				cost_factor = 1
				equipment = ship_hull_escort_carrier
			}
			hidden_effect = {
				set_technology = {
					ship_hull_escort_carrier = 1
					popup = no
				}
			}
		}

		enable_equipments = {
			limit = {
				has_dlc = "Man the Guns"
			}
			ship_hull_escort_carrier
		}
		enable_equipments = {
			limit = {
				not = {has_dlc = "Man the Guns"}
			}
			escort_carrier
		}
		enable_equipment_modules = {
			 ship_escort_deck_space
		}

		enable_subunits = {

		}
	}
	generic_prototype_rewards = {
		sp_naval_generic_reward_scientist_xp_1
		sp_naval_generic_reward_scientist_xp_2
		sp_naval_generic_reward_scientist_xp_3
		sp_naval_generic_reward_navy_xp_1
		sp_naval_generic_reward_navy_xp_2
		sp_naval_generic_reward_navy_xp_3
		sp_naval_generic_reward_major_progress_1
		sp_naval_generic_reward_major_progress_2
		sp_naval_generic_reward_major_progress_3
		sp_naval_generic_reward_test_failure_1
		sp_naval_generic_reward_test_failure_2
		sp_naval_generic_reward_test_failure_3
	}

	unique_prototype_rewards = {
		sp_naval_escort_carrier_unique_reward_a = {
			fire_only_once = yes

			threshold = {
				min = 10
				max = 50
			}

			weight = {
				base = 100
			}

			option = {
				token = sp_naval_escort_carrier_preference_a_a

				iteration_output = {
					country_effects = {
						add_equipment_bonus = {
							name = sp_naval_escort_carrier_eq_bonus_range
							bonus = {
								ship_hull_escort_carrier = {
									naval_range = 0.15
									build_cost_ic = 0.05
								}
							}
						}
					}
				}
			}
			option = {
				token = sp_naval_escort_carrier_preference_b_a
				default = yes
				iteration_output = {
					country_effects = {
						add_equipment_bonus = {
							name = sp_naval_escort_carrier_eq_bonus_strength
							bonus = {
								ship_hull_escort_carrier = {
									max_strength = 0.05
									reliability = 0.1
								}
							}
						}
					}
				}
			}
			option = {
				token = sp_naval_escort_carrier_preference_c_a
				iteration_output = {
					country_effects = {
						add_equipment_bonus = {
							name = sp_naval_escort_carrier_eq_bonus_speed
							bonus = {
								ship_hull_escort_carrier = {
									naval_speed = 0.15
									build_cost_ic = 0.025
								}
							}
						}
					}
				}
			}
		}

		sp_naval_escort_carrier_unique_reward_b = {
			fire_only_once = yes

			threshold = {
				min = 55
				max = 95
			}

			weight = {
				base = 100
			}

			option = {
				token = sp_naval_escort_carrier_preference_a_b

				iteration_output = {
					country_effects = {
						add_equipment_bonus = {
							name = sp_naval_escort_carrier_eq_bonus_sub_detection
							bonus = {
								ship_hull_escort_carrier = {
									sub_detection = 0.125
								}
							}
						}
					}
				}
			}
			option = {
				token = sp_naval_escort_carrier_preference_b_b
				default = yes
				iteration_output = {
					country_effects = {
						add_equipment_bonus = {
							name = sp_naval_escort_carrier_eq_bonus_compromise
							bonus = {
								ship_hull_escort_carrier = {
									sub_detection = 0.05
									surface_detection = 0.05
								}
							}
						}
					}
				}
			}
			option = {
				token = sp_naval_escort_carrier_preference_c_b
				iteration_output = {
					country_effects = {
						add_equipment_bonus = {
							name = sp_naval_escort_carrier_eq_bonus_surface_detection
							bonus = {
								ship_hull_escort_carrier = {
									surface_detection = 0.125
								}
							}
						}
					}
				}
			}
		}
	}
}

#EARLY CIWS
sp_early_ciws = {
	specialization = specialization_naval

	project_tags = sp_tag_surface_ship

	ai_will_do = {
		base = 1
		modifier = {
			ROOT = { is_major = no }
			add = -1
		}
	}

	allowed = {
		has_dlc = "Gotterdammerung"
	}

	available = {
		FROM = {
			OR = {
				has_tech = aa_cannon_5
				has_tech = antiair_e
			}
			has_tech = fire_control_radar_2
		}

	}

	resource_cost = {
		resources = {
			aluminium = 10
		}
	}

	complexity = sp_complexity.medium
	prototype_time = sp_time.prototype.medium

	breakthrough_cost = {
		specialization_naval = 2
	}

	project_output = {

		enable_equipment_modules = {
			limit = { has_dlc = "Man the Guns" }
			early_ciws
		}
	}

	generic_prototype_rewards = {
		sp_naval_generic_reward_scientist_xp_1
		sp_naval_generic_reward_scientist_xp_2
		sp_naval_generic_reward_scientist_xp_3
		sp_naval_generic_reward_navy_xp_1
		sp_naval_generic_reward_navy_xp_2
		sp_naval_generic_reward_navy_xp_3
		sp_naval_generic_reward_major_progress_1
		sp_naval_generic_reward_major_progress_2
		sp_naval_generic_reward_major_progress_3
		sp_naval_generic_reward_test_failure_1
		sp_naval_generic_reward_test_failure_2
		sp_naval_generic_reward_test_failure_3
	}

	unique_prototype_rewards = {

	}

}
