behemoth_rage = {
	user_scope = fleet
	scope = self

    finish_anim_state = "rage"

	possible = {
		always = yes
	}

	button_clickable = {
		custom_tooltip = {
			fail_text = BLANK_STRING
			always = yes
		}
	}

	on_completed = on_behemoth_rage_triggered
	tooltip = behemoth_rage_ship_button
	icon = GFX_scripted_action_behemoth_rage
	activity_key = behemoth_rage_activity_key
	context_menu_name = behemoth_rage_menu_title
	progress_activity_key = behemoth_rage_progress_activity_key
	required_progress = 1
	on_click_sound = "ui_kaiju_enrage"

	cooldown = 540
	cost = { food = 5000 exotic_gases = 150 }

	shortcut = "SHIFT+R"
}

behemoth_fast_egg = {
	user_scope = fleet
	scope = planet

	possible = {
		# Copied from megastructure entry
		custom_tooltip = {
			fail_text = "requires_gas_giant"
			is_planet_class = pc_gas_giant
		}
		custom_tooltip = {
			fail_text = "requires_no_anomaly"
			NOT = { has_anomaly = yes }
		}
		custom_tooltip = {
			fail_text = "requires_surveyed_planet"
			is_surveyed = {			# prevent leaking habitability information
				who = prev.from
				status = yes
			}
		}
		custom_tooltip = {
			fail_text = "requires_no_existing_megastructure"
			#can_build_megastructure_on_planet = yes
			NOR = {
				has_planet_flag = megastructure
				has_planet_flag = has_megastructure
				solar_system = {
					has_star_flag = ring_world_built
				}
				is_planet_class = pc_ringworld_habitable
				is_planet_class = pc_ringworld_habitable_damaged
				is_planet_class = pc_ringworld_tech
				is_planet_class = pc_ringworld_tech_damaged
				is_planet_class = pc_ringworld_seam
				is_planet_class = pc_ringworld_seam_damaged
				is_planet_class = pc_habitat
			}
		}
	}

	button_visible = {
		owner = {
			has_country_flag = behemoth_fast_egg
		}
	}

	button_clickable = {
		custom_tooltip = {
			fail_text = behemoth_fast_egg_fail_tt
			owner = {
				has_country_flag = behemoth_fast_egg
			}
		}
		custom_tooltip = {
			fail_text = behemoth_combat_egg_fail_tt
			is_in_combat = no
		}
	}

	on_completed = on_behemoth_fast_egg_planet_reached
	tooltip = behemoth_fast_egg_ship_button
	icon = GFX_fleet_action_button_behemoth_egg
	icon_selected = GFX_fleet_action_button_behemoth_egg
	activity_key = behemoth_fast_egg_activity_key
	context_menu_name = behemoth_fast_egg_menu_title
	progress_activity_key = behemoth_fast_egg_progress_activity_key
	required_progress = @behemoth_fast_egg_required_progress
	cooldown = @behemoth_fast_egg_cooldown

	cost = {
		food = @behemoth_fast_egg_cost
	}
	shortcut = "SHIFT+Z"
	slot = 1
}

behemoth_slow_egg = {
	user_scope = fleet
	scope = planet

	possible = {
		# Copied from megastructure entry
		custom_tooltip = {
			fail_text = "requires_gas_giant"
			is_planet_class = pc_gas_giant
		}
		custom_tooltip = {
			fail_text = "requires_no_anomaly"
			NOT = { has_anomaly = yes }
		}
		custom_tooltip = {
			fail_text = "requires_surveyed_planet"
			is_surveyed = {			# prevent leaking habitability information
				who = prev.from
				status = yes
			}
		}
		custom_tooltip = {
			fail_text = "requires_no_existing_megastructure"
			#can_build_megastructure_on_planet = yes
			NOR = {
				has_planet_flag = megastructure
				has_planet_flag = has_megastructure
				solar_system = {
					has_star_flag = ring_world_built
				}
				is_planet_class = pc_ringworld_habitable
				is_planet_class = pc_ringworld_habitable_damaged
				is_planet_class = pc_ringworld_tech
				is_planet_class = pc_ringworld_tech_damaged
				is_planet_class = pc_ringworld_seam
				is_planet_class = pc_ringworld_seam_damaged
				is_planet_class = pc_habitat
			}
		}
	}

	button_visible = {
		owner = {
			has_country_flag = behemoth_slow_egg
		}
	}

	button_clickable = {
		custom_tooltip = {
			fail_text = behemoth_slow_egg_fail_tt
			owner = {
				has_country_flag = behemoth_slow_egg
			}
		}
	}

	on_completed = on_behemoth_slow_egg_planet_reached
	tooltip = behemoth_slow_egg_ship_button
	icon = GFX_fleet_action_button_behemoth_egg
	icon_selected = GFX_fleet_action_button_behemoth_egg
	activity_key = behemoth_slow_egg_activity_key
	context_menu_name = behemoth_slow_egg_menu_title
	progress_activity_key = behemoth_slow_egg_progress_activity_key
	required_progress = @behemoth_slow_egg_required_progress
	cooldown = @behemoth_slow_egg_cooldown

	cost = {
		food = @behemoth_slow_egg_cost
	}
	shortcut = "SHIFT+Z"
	slot = 1
}

behemoth_strong_egg = {
	user_scope = fleet
	scope = planet

	possible = {
		# Copied from megastructure entry
		custom_tooltip = {
			fail_text = "requires_gas_giant"
			is_planet_class = pc_gas_giant
		}
		custom_tooltip = {
			fail_text = "requires_no_anomaly"
			NOT = { has_anomaly = yes }
		}
		custom_tooltip = {
			fail_text = "requires_surveyed_planet"
			is_surveyed = {			# prevent leaking habitability information
				who = prev.from
				status = yes
			}
		}
		custom_tooltip = {
			fail_text = "requires_no_existing_megastructure"
			#can_build_megastructure_on_planet = yes
			NOR = {
				has_planet_flag = megastructure
				has_planet_flag = has_megastructure
				solar_system = {
					has_star_flag = ring_world_built
				}
				is_planet_class = pc_ringworld_habitable
				is_planet_class = pc_ringworld_habitable_damaged
				is_planet_class = pc_ringworld_tech
				is_planet_class = pc_ringworld_tech_damaged
				is_planet_class = pc_ringworld_seam
				is_planet_class = pc_ringworld_seam_damaged
				is_planet_class = pc_habitat
			}
		}
	}

	button_visible = {
		owner = {
			has_country_flag = behemoth_strong_egg
		}
	}

	button_clickable = {
		custom_tooltip = {
			fail_text = behemoth_strong_egg_fail_tt
			owner = {
				has_country_flag = behemoth_strong_egg
			}
		}
	}

	on_completed = on_behemoth_strong_egg_planet_reached
	tooltip = behemoth_strong_egg_ship_button
	icon = GFX_fleet_action_button_behemoth_egg
	icon_selected = GFX_fleet_action_button_behemoth_egg
	activity_key = behemoth_strong_egg_activity_key
	context_menu_name = behemoth_strong_egg_menu_title
	progress_activity_key = behemoth_strong_egg_progress_activity_key
	required_progress = @behemoth_strong_egg_required_progress
	cooldown = @behemoth_strong_egg_cooldown

	cost = {
		food = @behemoth_strong_egg_cost
	}
	shortcut = "SHIFT+Z"
	slot = 1
}

behemoth_turbo = {
	user_scope = fleet
	scope = self

	button_visible = {
		owner = {
			has_country_flag = behemoth_turbo
		}
	}

	button_clickable = {
		custom_tooltip = {
			owner = {
				has_country_flag = behemoth_turbo
			}
		}
	}

	on_completed = on_behemoth_turbo_activated
	tooltip = behemoth_turbo_ship_button
	icon = GFX_fleet_action_button_behemoth_speed
	icon_selected = GFX_fleet_action_button_behemoth_speed
	activity_key = behemoth_turbo_activity_key
	context_menu_name = behemoth_turbo_menu_title
	cooldown = @behemoth_turbo_cooldown

	cost = {
		food = @behemoth_turbo_cost
	}
	shortcut = "SHIFT+X"
	slot = 2
}

behemoth_reflexes = {
	user_scope = fleet
	scope = self

	button_visible = {
		owner = {
			has_country_flag = behemoth_reflexes
		}
	}

	button_clickable = {
		custom_tooltip = {
			owner = {
				has_country_flag = behemoth_reflexes
			}
		}
	}

	on_completed = on_behemoth_reflexes_activated
	tooltip = behemoth_reflexes_ship_button
	icon = GFX_fleet_action_button_behemoth_speed
	icon_selected = GFX_fleet_action_button_behemoth_speed
	activity_key = behemoth_reflexes_activity_key
	context_menu_name = behemoth_reflexes_menu_title
	cooldown = @behemoth_reflexes_cooldown

	cost = {
		food = @behemoth_reflexes_cost
	}
	shortcut = "SHIFT+X"
	slot = 2
}

behemoth_drain = {
	user_scope = fleet
	scope = self

	button_visible = {
		owner = {
			has_country_flag = behemoth_drain
		}
	}

	button_clickable = {
		custom_tooltip = {
			owner = {
				has_country_flag = behemoth_drain
			}
		}
	}

	on_completed = on_behemoth_drain_activated
	tooltip = behemoth_drain_ship_button
	icon = GFX_fleet_action_button_behemoth_damage
	icon_selected = GFX_fleet_action_button_behemoth_damage
	activity_key = behemoth_drain_activity_key
	context_menu_name = behemoth_drain_menu_title
	cooldown = @behemoth_drain_cooldown

	wait = no

	cost = {
		food = @behemoth_drain_cost
	}
	shortcut = "SHIFT+C"
	slot = 3
}

behemoth_spike = {
	user_scope = fleet
	scope = self

	button_visible = {
		owner = {
			has_country_flag = behemoth_spike
		}
	}

	button_clickable = {
		custom_tooltip = {
			owner = {
				has_country_flag = behemoth_spike
			}
		}
	}

	on_completed = on_behemoth_spike_activated
	tooltip = behemoth_spike_ship_button
	icon = GFX_fleet_action_button_behemoth_damage
	icon_selected = GFX_fleet_action_button_behemoth_damage
	activity_key = behemoth_spike_activity_key
	context_menu_name = behemoth_spike_menu_title
	cooldown = @behemoth_spike_cooldown

	cost = {
		food = @behemoth_spike_cost
	}
	shortcut = "SHIFT+C"
	slot = 3
}

behemoth_burst = {
	user_scope = fleet
	scope = self

	button_visible = {
		owner = {
			has_country_flag = behemoth_burst
		}
	}

	button_clickable = {
		custom_tooltip = {
			owner = {
				has_country_flag = behemoth_burst
			}
		}
	}

	on_completed = on_behemoth_burst_activated
	tooltip = behemoth_burst_ship_button
	icon = GFX_fleet_action_button_behemoth_damage
	icon_selected = GFX_fleet_action_button_behemoth_damage
	activity_key = behemoth_burst_activity_key
	context_menu_name = behemoth_burst_menu_title
	cooldown = @behemoth_burst_cooldown

	cost = {
		food = @behemoth_burst_cost
	}
	shortcut = "SHIFT+C"
	slot = 3
}

behemoth_buff = {
	user_scope = fleet
	scope = self

	button_visible = {
		owner = {
			has_country_flag = behemoth_buff
		}
	}

	button_clickable = {
		custom_tooltip = {
			owner = {
				has_country_flag = behemoth_buff
			}
		}
	}

	on_completed = on_behemoth_buff_activated
	tooltip = behemoth_buff_ship_button
	icon = GFX_fleet_action_button_behemoth_buff
	icon_selected = GFX_fleet_action_button_behemoth_buff
	activity_key = behemoth_buff_activity_key
	context_menu_name = behemoth_buff_menu_title
	progress_activity_key = behemoth_buff_progress_activity_key
	cooldown = @behemoth_buff_cooldown

	cost = {
		exotic_gases = @behemoth_buff_cost
	}

	shortcut = "SHIFT+V"
	slot = 4
}

behemoth_heal = {
	user_scope = fleet
	scope = self

	button_visible = {
		owner = {
			has_country_flag = behemoth_healing
		}
	}

	button_clickable = {
		custom_tooltip = {
			owner = {
				has_country_flag = behemoth_healing
			}
		}
	}

	on_completed = on_behemoth_healing_activated
	tooltip = behemoth_healing_ship_button
	icon = GFX_fleet_action_button_behemoth_buff
	icon_selected = GFX_fleet_action_button_behemoth_buff
	activity_key = behemoth_healing_activity_key
	context_menu_name = behemoth_healing_menu_title
	progress_activity_key = behemoth_healing_progress_activity_key
	cooldown = @behemoth_healing_cooldown

	cost = {
		exotic_gases = @behemoth_healing_cost
	}

	shortcut = "SHIFT+V"
	slot = 4
}

behemoth_summon = {
	user_scope = fleet
	scope = self

	button_visible = {
		owner = {
			has_country_flag = behemoth_summon
		}
	}

	button_clickable = {
		custom_tooltip = {
			owner = {
				has_country_flag = behemoth_summon
			}
		}
	}

	on_completed = on_behemoth_summon_activated
	tooltip = behemoth_summon_ship_button
	icon = GFX_fleet_action_button_behemoth_buff
	icon_selected = GFX_fleet_action_button_behemoth_buff
	activity_key = behemoth_summon_activity_key
	context_menu_name = behemoth_summon_menu_title
	progress_activity_key = behemoth_summon_progress_activity_key
	required_progress = @behemoth_summon_required_progress
	cooldown = @behemoth_summon_cooldown

	cost = {
		food = @behemoth_summon_cost
	}

	shortcut = "SHIFT+V"
	slot = 4
}

behemoth_superweapon = {
	user_scope = fleet
	scope = self

	# Repeated while the weapon charges, so a world consecrated mid-charge stops it.
	possible = {
		custom_tooltip = {
			fail_text = "requires_no_consecrated_worlds"
			solar_system = {
				NOT = {
					any_system_planet = {
						has_planet_flag = consecrated@from.owner
					}
				}
			}
		}
	}

	button_visible = {
		owner = {
			has_country_flag = behemoth_superweapon
		}
	}

	button_clickable = {
		custom_tooltip = {
			owner = {
				has_country_flag = behemoth_superweapon
			}
		}
		custom_tooltip = {
			fail_text = "requires_no_consecrated_worlds"
			solar_system = {
				NOT = {
					any_system_planet = {
						has_planet_flag = consecrated@root.owner
					}
				}
			}
		}
	}

	on_completed = on_behemoth_superweapon_activated
	tooltip = behemoth_superweapon_ship_button
	icon = GFX_fleet_action_button_behemoth_superweapon
	icon_selected = GFX_fleet_action_button_behemoth_superweapon
	activity_key = behemoth_superweapon_activity_key
	context_menu_name = behemoth_superweapon_menu_title
	progress_activity_key = behemoth_superweapon_progress_activity_key
	required_progress = @behemoth_superweapon_required_progress
	cooldown = @behemoth_superweapon_cooldown
	on_click_sound = "ui_kaiju_thermoclastic_roar"

	cost = {
		food = @behemoth_superweapon_cost
	}

	shortcut = "SHIFT+B"
	slot = 5

	finish_anim_state = "superweapon"
}
