# Copyright (c) 2022 by warp-core
#
# 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 "Flagship Attribute Autoconditions Save"
	category "savegame"
	contents
		pilot Bobbi Bughunter
		date 11 7 3014
		system Pantica
		planet Aventine
		clearance
		# What you own:
		ship Peregrine
			name "Greyshrike"
			sprite ship/peregrine/peregrine
				"frame rate" 3
				rewind
			thumbnail thumbnail/peregrine
			attributes
				category "Medium Warship"
				cost 41627000
				mass 350
				bunks 25
				"cargo space" 59
				cloak 0.04
				"cloaking energy" 2.5
				"cloaking fuel" 0.05
				drag 4.3
				"engine capacity" 171
				"fuel capacity" 1100
				gaslining 1
				"gun ports" 5
				"heat dissipation" 0.85
				hull 10600
				"hull energy" 0.9
				"hull repair rate" 2.5
				"ion protection" 0.25
				"scramble protection" 0.25
				"outfit scan power" 18
				"outfit scan efficiency" 22
				"outfit space" 552
				ramscoop 2.5
				"remnant node" 5
				"required crew" 9
				"shield energy" 3
				"shield generation" 4.9
				shields 16400
				"slowing protection" 0.25
				"tactical scan power" 50
				"turret mounts" 2
				"weapon capacity" 220
			outfits
				"Aeon Cell"
				"Bellows-Class Afterburner"
				"Crucible-Class Thruster"
				"Crystal Capacitor" 2
				Hyperdrive
				"Inhibitor Cannon" 5
				"Jump Drive"
				"NDR-114 Android" 5
				"Point Defense Turret"
				"Quantum Key Stone"
				"Salvage Scanner"
				"Smelter-Class Steering"
				"Smelter-Class Thruster"
				"Thrasher Turret"
				"Void Rifle"
			crew 5
			fuel 1100
			shields 16400
			hull 10600
			engine 0 120.5
				zoom 1.5
				angle 0
				under
			engine -26 126
				zoom 1.1
				angle 0
				under
			engine 25 123.5
				zoom 1.1
				angle 0
				under
			gun 0 -133.5 "Inhibitor Cannon"
				under
			gun -12.5 -105 "Inhibitor Cannon"
				under
			gun 12.5 -105 "Inhibitor Cannon"
				under
			gun -17.5 -83 "Inhibitor Cannon"
				under
			gun 17.5 -83 "Inhibitor Cannon"
				under
			turret 0 -44 "Point Defense Turret"
				over
			turret 0 21 "Thrasher Turret"
				over
			leak leak 50 50
			leak flame 50 80
			leak "big leak" 90 30
			explode "large explosion" 10
			explode "medium explosion" 25
			explode "small explosion" 25
			explode "tiny explosion" 10
			"final explode" "final explosion medium" 1
			system Pantica
			planet Aventine
		account
			credits 131000
			score 400
			history
		visited Pantica
		"visited planet" Aventine


test "Flagship Attribute Autoconditions"
	status active
	description `Tests the "flagship attribute: <attribute>" and "flagship base attribute: <attribute>" autoconditions.`
	sequence
		inject "Flagship Attribute Autoconditions Save"
		call "Load First Savegame"
		assert
			"flagship base attribute: cost" == 41627000
			"flagship base attribute: mass" == 350000
			"flagship base attribute: bunks" == 25000
			"flagship base attribute: cargo space" == 59000
			"flagship base attribute: cloak" == 40
			"flagship base attribute: cloaking energy" == 2500
			"flagship base attribute: cloaking fuel" == 50
			"flagship base attribute: drag" == 4300
			"flagship base attribute: engine capacity" == 171000
			"flagship base attribute: fuel capacity" == 1100000
			"flagship base attribute: gaslining" == 1000
			"flagship base attribute: gun ports" == 5000
			"flagship base attribute: heat dissipation" == 850
			"flagship base attribute: hull" == 10600000
			"flagship base attribute: hull energy" == 900
			"flagship base attribute: hull repair rate" == 2500
			"flagship base attribute: ion protection" == 250
			"flagship base attribute: scramble protection" == 250
			"flagship base attribute: outfit scan power" == 18000
			"flagship base attribute: outfit scan efficiency" == 22000
			"flagship base attribute: outfit space" == 552000
			"flagship base attribute: ramscoop" == 2500
			"flagship base attribute: remnant node" == 5000
			"flagship base attribute: required crew" == 9000
			"flagship base attribute: shield energy" == 3000
			"flagship base attribute: shield generation" == 4900
			"flagship base attribute: shields" == 16400000
			"flagship base attribute: slowing protection" == 250
			"flagship base attribute: tactical scan power" == 50000
			"flagship base attribute: turret mounts" == 2000
			"flagship base attribute: weapon capacity" == 220000
			"flagship base attribute: heat generation" == 0
			"flagship attribute: cost" == 56584000
			"flagship attribute: mass" == 902100
			"flagship attribute: drag" == 4300
			"flagship attribute: engine capacity" == 13000
			"flagship attribute: gun ports" == 0
			"flagship attribute: heat generation" == 32300
			"flagship attribute: outfit space" == 0
			"flagship attribute: weapon capacity" == 58000


