########################
# BEHEMOTH TITAN LANCE
########################

weapon_component_template = {
	key = "BEHEMOTH_TITAN_WEAPON"
	size = titanic
	type = instant
	prio_projectile = yes
	hidden = yes

	icon = "GFX_mutation_laser_1"
	icon_frame = 1

	potential = {
		OR = {
			is_ship_size = behemoth_01
			is_ship_size = behemoth_02
			is_ship_size = behemoth_03
			is_ship_size = behemoth_04
		}
	}

	firing_arc = 15.0
	min_range = 5 #30.0

	tags = { weapon_type_energy weapon_type_space_fauna }
	component_set = "BEHEMOTH_TITAN_WEAPON"
	projectile_gfx = "behemoth_titan_laser"
}

########################
# BEHEMOTH LIGHTNING BREATH
########################

weapon_component_template = {
	key = "BEHEMOTH_LIGHTNING_WEAPON"
	size = extra_large
	type = instant
	icon = "GFX_mutation_lightning_breath_1"
	icon_frame = 1
	hidden = yes

	firing_arc = 35.0
	min_range = 2 #10.0
	use_ship_main_target = no

	potential = {
		OR = {
			is_ship_size = behemoth_01
			is_ship_size = behemoth_02
			is_ship_size = behemoth_03
			is_ship_size = behemoth_04
		}
	}

	component_set = "BEHEMOTH_LIGHTNING_WEAPON"
	projectile_gfx = "behemoth_lightning_breath_laser"
	tags = { weapon_type_energy weapon_type_space_fauna weapon_role_artillery x_slot }
	ai_tags = { weapon_role_artillery artillery }
	ai_tag_weight = 0

	target_weights = {
		titan = 3
		battleship = 2
		stinger_stage_1 = 1.5
		stinger_stage_2 = 2
		stinger_stage_3 = 2
	}
}

########################
# BEHEMOTH ARMOR
########################

utility_component_template = {
	key = "LARGE_BEHEMOTH_ARMOR"
	size = large
	icon = "GFX_ship_part_behemoth_armor"
	icon_frame = 1
	power = 0
	hidden = yes

	potential = {
		OR = {
			is_ship_size = behemoth_01
			is_ship_size = behemoth_02
			is_ship_size = behemoth_03
			is_ship_size = behemoth_04
		}
	}

	modifier = {
		ship_armor_add = @armor_L6
	}

	ship_modifier = {
		ship_armor_regen_add_static = @bio_ship_armor_regen_l_6
	}

	component_set = "BEHEMOTH_ARMOR"
	resources = {
		category = ship_components
		cost = {
			alloys = @l_t6_cost
		}
		upkeep = {
			food = @l_t6_upkeep_energy
			alloys = @l_t6_upkeep_alloys
		}
	}
}

########################
# BEHEMOTH THRUSTERS
########################

utility_component_template = {
	key = "BEHEMOTH_PROPULSION_1"
	size = small
	icon = "GFX_ship_part_bio_thruster_1"
	icon_frame = 1
	power = 0
	hidden = yes

	potential = {
		is_ship_size = behemoth_01
	}
	
	triggered_ship_modifier = {
 		potential = {
			has_global_flag = sustained_ship_acceleration
			is_in_combat = no
 		}
 		modifier = {
			ship_base_speed_mult = 6.00
		}
	}
		
	triggered_ship_modifier = {
 		potential = {
			NOT = { has_global_flag = sustained_ship_acceleration }
			is_in_combat = no
 		}
 		modifier = {
			ship_base_speed_mult = 2.50
		}
	}
	
	triggered_ship_modifier = {
 		potential = {
			is_in_combat = yes
 		}
 		modifier = {
			ship_speed_reduction = 0.5
		}
	}

	upgrades_to = "BEHEMOTH_PROPULSION_2"

	component_set = "thruster_components_bio"
}

utility_component_template = {
	key = "BEHEMOTH_PROPULSION_2"
	size = small
	icon = "GFX_ship_part_bio_thruster_2"
	icon_frame = 1
	power = 0
	hidden = yes

	potential = {
		is_ship_size = behemoth_02
	}
	
	triggered_ship_modifier = {
 		potential = {
			has_global_flag = sustained_ship_acceleration
			is_in_combat = no
 		}
 		modifier = {
			ship_base_speed_mult = 6.00
		}
	}
	
	triggered_ship_modifier = {
 		potential = {
			NOT = { has_global_flag = sustained_ship_acceleration }
			is_in_combat = no
 		}
 		modifier = {
			ship_base_speed_mult = 3.00
		}
	}
	
	triggered_ship_modifier = {
 		potential = {
			is_in_combat = yes
 		}
 		modifier = {
			ship_speed_reduction = 0.5
		}
	}

	modifier = {
		ship_base_speed_mult = 0.25
		ship_evasion_add = 1
	}

	upgrades_to = "BEHEMOTH_PROPULSION_3"

	component_set = "thruster_components_bio"
}

utility_component_template = {
	key = "BEHEMOTH_PROPULSION_3"
	size = small
	icon = "GFX_ship_part_bio_thruster_3"
	icon_frame = 1
	power = 0
	hidden = yes

	potential = {
		is_ship_size = behemoth_03
	}

	modifier = {
		ship_base_speed_mult = 0.50
		ship_evasion_add = 2
	}
	
	triggered_ship_modifier = {
 		potential = {
			has_global_flag = sustained_ship_acceleration
			is_in_combat = no
 		}
 		modifier = {
			ship_base_speed_mult = 6.00
		}
	}
	
	triggered_ship_modifier = {
 		potential = {
			NOT = { has_global_flag = sustained_ship_acceleration }
			is_in_combat = no
 		}
 		modifier = {
			ship_base_speed_mult = 3.50
		}
	}
	
	triggered_ship_modifier = {
 		potential = {
			is_in_combat = yes
 		}
 		modifier = {
			ship_speed_reduction = 0.5
		}
	}

	upgrades_to = "BEHEMOTH_PROPULSION_4"

	component_set = "thruster_components_bio"
}

utility_component_template = {
	key = "BEHEMOTH_PROPULSION_4"
	size = small
	icon = "GFX_ship_part_bio_thruster_4"
	icon_frame = 1
	power = 0
	hidden = yes

	potential = {
		is_ship_size = behemoth_04
	}
	
	triggered_ship_modifier = {
 		potential = {
			has_global_flag = sustained_ship_acceleration
			is_in_combat = no
 		}
 		modifier = {
			ship_base_speed_mult = 6.00
		}
	}
	
	triggered_ship_modifier = {
 		potential = {
			NOT = { has_global_flag = sustained_ship_acceleration }
			is_in_combat = no
 		}
 		modifier = {
			ship_base_speed_mult = 4.25
		}
	}
	
	triggered_ship_modifier = {
 		potential = {
			is_in_combat = yes
 		}
 		modifier = {
			ship_speed_reduction = 0.5
		}
	}

	modifier = {
		ship_base_speed_mult = 0.75
		ship_evasion_add = 3
	}

	component_set = "thruster_components_bio"
}

###########################
# BEHEMOTH PLANET CRACKER
###########################

weapon_component_template = { # World Cracker
	key = "PLANET_KILLER_MAW"
	size = planet_killer
	type = planet_killer
	use_ship_main_target = no

	valid_for_country = {
		has_menace_perk = menp_behemoth_hatchling_2
	}

	icon = GFX_ship_part_preying_maw
	icon_frame = 1

	potential = {
		OR = {
			is_ship_size = behemoth_03
			is_ship_size = behemoth_04
		}
	}
	component_set = "PLANET_KILLER_CRACKER"

	planet_destruction_gfx = "gobble_planet_gfx"

	ai_weight = {
		factor = 100
	}
}

########################
# BEHEMOTH ACTIONS
########################

utility_component_template = {
	key = "SHIP_BEHEMOTH_GROWTH"
	size = large
	icon = GFX_mutation_combat_synapses
	icon_frame = 1
	power = 0

	custom_tooltip = SHIP_BEHEMOTH_GROWTH_TT

	inline_script = ship_components/behemoth_stage_1_mutations
	inline_script = ship_components/behemoth_stage_2_mutations
	inline_script = ship_components/behemoth_stage_3_mutations
	inline_script = ship_components/behemoth_stage_4_mutations
	inline_script = ship_components/behemoth_stage_5_mutations
	inline_script = ship_components/behemoth_stage_6_mutations
	inline_script = ship_components/behemoth_stage_7_mutations
	inline_script = ship_components/behemoth_stage_8_mutations
	inline_script = ship_components/behemoth_superweapon

	ai_weight = {
		factor = 2
	}
}

utility_component_template = {
	key = "SHIP_BEHEMOTH_GROWTH_CLOAKING"
	size = large
	icon = GFX_mutation_combat_synapses
	icon_frame = 1
	power = 0

	custom_tooltip = SHIP_BEHEMOTH_GROWTH_TT

	inline_script = ship_components/behemoth_stage_1_mutations
	inline_script = ship_components/behemoth_stage_2_mutations
	inline_script = ship_components/behemoth_stage_3_mutations
	inline_script = ship_components/behemoth_stage_4_mutations
	inline_script = ship_components/behemoth_stage_5_mutations
	inline_script = ship_components/behemoth_stage_6_mutations
	inline_script = ship_components/behemoth_stage_7_mutations
	inline_script = ship_components/behemoth_stage_8_mutations
	inline_script = ship_components/behemoth_superweapon

	modifier = {
		ship_cloaking_strength_add = @cloaking_high_strength
	}

	ai_weight = {
		factor = 2
	}
}

utility_component_template = {
	key = "SHIP_BEHEMOTH_RAGE"
	size = large
	icon = GFX_mutation_berserker_glands
	icon_frame = 1
	power = 0

	scripted_action = { behemoth_rage }
	ai_weight = {
		factor = 2
	}
}
