#reloadable with 'reload stats'
# This file is where you start when you want to configure something new, then go to sections

####################
# NOTE FOR MODDERS #
####################
# modifier = { }					# Modifiers for values shown in the ship designer. For starbases, also supports modifiers shown in some other UIs.
# ship_modifier = { }				# Modifiers not shown in the ship designer.
# use_shipnames_from = other_size	# allows a ship size to use names from another size
# icon = ship_size_military_1
#ship_size_military_1 is default. The following sprite keys are generated from it:
#GFX_text_<key>
#GFX_<key>
#GFX_<key>_top
#GFX_<key>_top_damaged
# icon_frame: now only used for starbases. Value of 2 or more means it shows up on the galaxy map, 1-5 denote which icon it uses on starbase sprite sheets (e.g. gfx/interface/icons/starbase_ship_sizes.dds)
# ship_class_icon_frame = 21				# Determines which frame on the ship class sprite sheets this ship uses (e.g. gfx/interface/icons/ship_classes.dds). Only shown for non-mobile fleets by default.
# force_show_ship_class_icon_frame = yes	# If yes, the ship_class_icon_frame icon is shown on the galactic map even when the fleet is mobile. Default: no.
# ai_ship_data = {					#For determining how many ships the AI wants. Ships it can't recruit (i.e. missing tech prereqs or fails potential_country or possible_country) are pre-filtered out.
# 	fraction = { }					#As standard, base, modifier = { factor }, etc. The AI will want this divided by the total fraction it is able to recruit. Note: it is the fraction of the naval cap, so the final value is divided by size_multiplier
#									#Note: if the fraction is > 0, the following lines will not be applied
#	min = 1							#Sets a minimum absolute number the country will aim to have
#	system_mult/planet_mult = 0.1	#Adds this amount for each system/colony the country owns. I.e. min + ( num colonies * planet_mult ) + ( num systems * system_mult )
#	max = 5							#Sets a maximum absolute number the country will aim to have. Note that it will still want only the minimum unless you define a system_mult or planet_mult
#}
# ship_roles = { name1 name2 } # Show up as selectable roles in the ship designer
# never_lost = <yes/no> # Removes the chance for the ship size to instantly get killed by emergency ftl. It can still be killed by the random Emergency FTL damage effect.
# triggered_ship_roles = { { name = test1 trigger = {} } { name = test1 trigger = {} } } # List of triggered ship roles, show up in the ship designer when the trigger is true, executes on country scope
# evaluation_resource = food # strategic resource to evaluate the cost of a ship design associated with this size
# default is energy
# this is used to determine if a ship design is more advanced than another:
#  the one that costs more is considered an upgrade compared to the cheaper one
#
# is_bio_ship = yes					# this indicates that this ship uses bioship mechanic
# is_entropy_conduit = yes			# this indicates that this ship is a type of entropy conduit ship used in the galactic hyperthermia crisis
# upgrades_to = mauler_stage_2		# the next stage of the bioship growth
#
# bioship_growth_progress_required  = 150	# for bioships: growth threshold at which the ship will grow into its next stage
#                                 			# for hero ships that are NOT bioships: if > 0 this activates the manual growth interface. threshold at which the manual growth is enabled
#											# if manual growth interface is shown on the fleet UI, leader portrait and info will be hidden
#
# hero_ship = yes/no		# If yes, enables hero ship behavior (special UI, can't be merged or disbanded)
#							# If its combat computer allows it to unlock from combat, it also exposes its actions during combat in the combat view
#							# default: no
# hero_ship = {				# Setting it this way sets it to yes and allows to specify parameters
#
# 	capabilities = {		# All of these capabilities are blocked for hero ships by default
#							# Include them in this list to enable them (other not hero-ship related restrictions may still apply)
#		can_repair
#		can_upgrade
#		can_turn_into_mercenary_enclave
#		can_transfer
#		can_split
#		can_reinforce
# 	}
#
#	custom_state_loc_prefix = "STATUS_LOC_KEY_PREFIX"	# for single-ship fleets with a single hero ship, if not empty this activates the status bar on the fleet UI
#														# if status bar is shown on the fleet UI, leader portrait and info will be hidden
#														# the status bar consists of two scripted localization driven strings (scope: selected fleet)
#														# the localization keys for those two strings result from appending to this prefix "_title" or "_value"
#														# (in this example, "STATUS_LOC_KEY_PREFIX_title" and "STATUS_LOC_KEY_PREFIX_value")
#
#	custom_class_text_color = "Color Code Key"			# Accepts a text color code for displaying the color of the ship class.
#
#	hero_ship_fleet_background = "GFX_fleet_view_behemoth_stage_4"	# Name of sprite to use as a background for Fleet UI for single-ship hero-ship fleets.
#																	# default: empty (uses default background)
# }
#
# can_lead_armada = yes		# If yes, a fleet containing a single ship of this size will be able to command fleet armadas
#							# default: no
#
# on_click_sound = "sound_clip_name"		# Sound clip to play when selecting a single fleet that contains exclusively a single ship of this size
# family_name = "bioship_family"			# root for the name used to described the whole set (so "mauler" for bantam mauler, absolute mauler, etc). This is also used to localize the variant (ie mauler_cap, mauler_pluralized, etc) through localization
# growth_stage_descriptor = "ship_growth_stage_1"	# localization for the growth stage of the current ship size (so "bantam", "absolute", etc.)
#
# # Note: These variables only apply to ships collecting from other ships'/starbases' stockpiles, not to waystations collecting from the system (waystations ignore these variables).
# # To transfer resources to this ship, if it is not a waystation, collects_stockpile_from must be non-empty and collects_stockpile_to_country must be false.
# collects_stockpile_from = {}				# List of ship classes that this ship can collect stockpiles from
# collects_stockpile_to_country = yes/no	# If yes, resources collected from a stockpile go directly to the country; otherwise to this ship's own stockpile (default: no)
# ship_stockpile_capacity = 1000.0			# Maximum total resources in this ship's stockpile
#
# construction_capabilities = {	# If class is shipclass_constructor, determines which construction orders are available and if the AI economic minister should use this ship size for the construction order.
#								# ai_ship_data should be set appropriately to ensure the AI has sufficient ships for their construction orders.
#	starbase
#	mining_station
#	research_station
#	observation_station
#	automated_construction
#	automated_collection
#	megastructure
# }
#
# scripted_action = { scripted_action_1 scripted_action_2 ... } # list of scripted actions enabled by this ship size
# automation_icon = GFX_fleet_order_auto_construct	# GFX sprite key for the automation button icon. The selected state uses <key>_selected automatically.
#													# default: GFX_fleet_order_automate / GFX_fleet_order_automate_selected
#
# carries_colony = <planet_class>			# default: empty. If filled, ship is able to carry a colony of that class and a colony is created by default when the ship is created
#								  			# (see create_ship effect for special case). Ships that are not carrying a colony when supposed to are killed on a daily basis.
#								  			# The ship size must also have "class = shipclass_starbase".
# arkship_picture = "arkship_civilian"		# Image from gfx/portraits/arkships/ships used in portrait background for arkships
#
# encampment_required_progress: 50.0	# default: 100.0. Base required progress for arkship encampment/going mobile transition.
# display_attack_neutral_fleet_button = no	# Default yes, if yes show attack neutral fleet button on military fleet UI
# construction_offset_mult = 1.0		# distance multiplier for construction ships, will multiply the default construction distance between construction ship and construction site to adapt it to the size of the ship.
# base_ship_size = "civilian_arkship_tier_1" # will set a base ship size for a ship size; it is used for ark ships so higher tier ark ships can be downgraded to the base version in empire creation


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

planetmega_defence_ship = {
	formation_priority = @destroyer_formation_priority
	max_speed = @speed_fast
	acceleration = 0.3
	rotation_speed = 0.1
	collision_radius = @destroyer_collision_radius
	max_hitpoints = @destroyer_hp
	modifier = {
		ship_evasion_add = @destroyer_evasion
		#ship_hull_regen_add_static = 1
	}
	size_multiplier = 15
	fleet_slot_size = 3
	section_slots = { "mid" = { locator = "part1" } }
	num_target_locators = 2
	icon = ship_size_military_1
	use_shipnames_from = destroyer
	entity = crisis_destroyer_entity
	graphical_culture = no

	uses_name_prefix = no
	can_be_inspected = yes
	can_have_federation_design = no
	enable_default_design = yes	#if yes, countries will have an auto-generated design at start
	enable_3dview_in_ship_browser = no #if yes, ship design will have a 3d view in the ship browser

	default_behavior = swarm
	role_background = GFX_role_selection_frigate
	ship_roles = { screen gunship brawler }
	# triggered_ship_roles = {
	# 	{
	# 		name = brawler_stealth
	# 		trigger = { has_technology = tech_cloaking_1 }
	# 	}
	# }

	never_lost = yes
	never_mia = yes
	combat_disengage_chance = -10

	class = shipclass_military
	construction_type = starbase_shipyard
	required_component_set = "power_core"
	required_component_set = "thruster_components"
	required_component_set = "sensor_components"
	required_component_set = "combat_computers"

	prerequisites = { tech_planetmega_active_defense }
	#potential_country = { country_uses_bio_ships = no }
	potential_construction = { always = no }

	base_buildtime = 90
	components_add_to_cost = no
	resources = {
		category = ships
		cost = {
			minerals = 500
		}
		upkeep = {
			energy = @destroyer_upkeep_energy
			minerals = @destroyer_upkeep_alloys
		}
	}
	min_upgrade_cost = { minerals = 1 }
	ai_ship_data = {
		min = 0
		#planet_mult = value:plnmg_defence_ships_per_planet
		max = 0
	}

	available_to_everyone = yes
}

plnmg_plntmatter_carrier = { #gsd NAME_plnmg_pmcar_20
	formation_priority = @colossus_formation_priority
	max_speed = @speed_slow
	acceleration = 0.22
	rotation_speed = 0.163
	collision_radius = @colossus_collision_radius
	max_hitpoints = @colossus_hp
	modifier = {
		ship_evasion_add = @colossus_evasion
		ship_hull_regen_add_perc = 0.01
		ships_energy_upkeep_mult = -0.5
		#ship_weapon_damage = 1
	}
	ship_modifier = {
		ship_disengage_chance_mult = -0.5
		megastructure_build_speed_mult = 0.25 #does it really work?
		#ship_fire_rate_mult = 1
	}
	combat_size_multiplier = 100 #只用于以下介绍的场景
	#该参数视为战斗平面上的距离，即导弹在多远的平方距离上被认为进入了目标，同时影响舰队锚点，其最大者作为舰队的根节点
	size_multiplier = 100
	fleet_slot_size = 32
	icon = ship_size_military_32
	hull_scale = 1.25

	enable_default_design = yes

	combat_disengage_chance = 1

	base_buildtime = 1800 #@colossus_build_time
	resources = {
		category = ships
		cost = { minerals = 1000 }
	}

	section_slots = { "ship" = { locator = "frame_ship" } }
	num_target_locators = 4

	use_shipnames_from = colossus
	graphical_culture = no
	entity = lithoid_01_colossus_entity
	is_space_object = yes
	uses_name_prefix = no
	is_space_station = no

	role_background = GFX_role_selection_colossus
	ship_roles = { artillery carrier }

	can_be_inspected = yes
	can_have_federation_design = no
	enable_3dview_in_ship_browser = yes #if yes, ship design will have a 3d view in the ship browser

	construction_type = starbase_shipyard
	required_component_set = "power_core"
	required_component_set = "ftl_components"
	required_component_set = "thruster_components"
	required_component_set = "sensor_components"
	required_component_set = "combat_computers"

	default_behavior = artillery
	class = shipclass_military_special
	never_lost = yes
	hero_ship = {
		capabilities = { can_repair can_upgrade }
		#custom_state_loc_prefix = "PLNMG_PC_STATE" #_title #_value #_tt #will override leader portrait
		custom_class_text_color = "r"
		hero_ship_fleet_background = GFX_fleet_view_main_military_bg
	}
	available_to_everyone = yes

	potential_country = {
		is_ai = no
		can_build_plnmg_world_shaper = yes
	}

	potential_construction = {
		or = {
			and = {
				is_scope_type = starbase
				exists = ship.colony
				owner? = { is_nomadic = yes }
			}
			and = {
				is_scope_type = starbase
				is_orbital_ring = yes
				owner? = { is_nomadic = no }
			}
		}
	}
	possible_construction = {
		if = {
			limit = {
				is_scope_type = starbase
				exists = ship.colony
			}
			custom_tooltip = {
				fail_text = need_colony_plnmg_world_shaper
				ship.colony = { has_deposit = d_plnmg_world_shaper }
			}
		}
		else_if = {
			limit = {
				is_scope_type = starbase
				is_orbital_ring = yes
			}
			custom_tooltip = {
				fail_text = need_colony_plnmg_world_shaper
				planet? = { has_deposit = d_plnmg_world_shaper }
			}
		}
		else = {
			custom_tooltip = {
				fail_text = planetmega_illegally_executed
				always = no
			}
		}
	}

	resources = {
		category = ships
		cost = { alloys = 1000 }
		upkeep = {
			energy = @colossus_upkeep_energy
			alloys = @colossus_upkeep_alloys
		}
		upkeep = {
			trigger = { fleet = { is_variable_set = planet_sizes_carried } } #this = ship, from = country
			energy = 5
			mult = fleet.planet_sizes_carried
		}
		logistics = { trade = @colossus_logistic_upkeep_trade }
	}

	scripted_action = {
		plnmg_pmcar_split
		plnmg_pmcar_append
		arkship_build_megastructure
	}

	ai_ship_data = {
		min = 0
		max = 0
	}
}
