# Copyright (c) 2020 by Peter van der Meer
#
# Endless Sky is free software: you can redistribute it and/or modify it under the
# terms of the GNU General Public License as published by the Free Software
# Foundation, either version 3 of the License, or (at your option) any later version.
#
# Endless Sky is distributed in the hope that it will be useful, but WITHOUT ANY
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
# PARTICULAR PURPOSE. See the GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License along with
# this program. If not, see <https://www.gnu.org/licenses/>.

test-data "burning flyers save"
	category "savegame"
	contents
		pilot Bobbi Bughunter
		date 16 11 3013
		system "Terra Incognita"
		planet Ruin
		clearance
		ship "Star Barge"
			name "Buggy Barge"
			sprite "ship/star barge"
			attributes
				category "Light Freighter"
				cost 190000
				mass 70
				bunks 3
				"cargo space" 50
				drag 2.1
				"engine capacity" 400
				"fuel capacity" 300
				"heat dissipation" 0.8
				hull 1000
				"outfit space" 1300
				"required crew" 1
				shields 600
				"turret mounts" 1
				"weapon capacity" 200
			outfits
				"Afterburner"
				"X1200 Ion Steering"
				Hyperdrive
				"nGVF-BB Fuel Cell"
				"LP036a Battery Pack"
			crew 1
			fuel 300
			shields 600
			hull 1000
			position 0 0
			engine -9 38 1
			engine 9 38 1
			turret 0 -8
			leak leak 60 50
			explode "tiny explosion" 10
			explode "small explosion" 10
			system "Terra Incognita"
			planet Ruin
		ship "Star Barge"
			name "Critical Container"
			sprite "ship/star barge"
			attributes
				category "Light Freighter"
				cost 190000
				mass 70
				bunks 3
				"cargo space" 50
				drag 2.1
				"engine capacity" 400
				"fuel capacity" 300
				"heat dissipation" 0.8
				hull 1000
				"outfit space" 1300
				"required crew" 1
				shields 600
				"turret mounts" 1
				"weapon capacity" 200
			outfits
				"Afterburner"
				"X1200 Ion Steering"
				Hyperdrive
				"nGVF-BB Fuel Cell"
				"LP036a Battery Pack"
			crew 1
			fuel 300
			shields 600
			hull 1000
			position 0 0
			engine -9 38 1
			engine 9 38 1
			turret 0 -8
			leak leak 60 50
			explode "tiny explosion" 10
			explode "small explosion" 10
			system "Terra Incognita"
			planet Ruin
		account
			credits 131000
			score 400
			history
		visited "Terra Incognita"
		"visited planet" Ruin

test "Afterburner-flight - Simple depart land"
	status active
	description "Tests if the AI can use the afterburner as regular thruster for departure and landing."
	sequence
		inject "burning flyers save"
		call "Load First Savegame"
		watchdog 12000
		call "Depart"
		# Wait for 10 seconds to drift away from the planet.
		apply
			"test: steps to wait" = 10 * 60
		label "floating"
		# empty input to make time pass
		input
		apply
			"test: steps to wait" = "test: steps to wait" - 1
		branch "floating"
			"test: steps to wait" > 0
		call "Land"
