# Copyright (c) 2015 by Michael Zahniser
#
# 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.

effect "seeker impact"
	sprite "effect/seeker impact"
		"no repeat"
		"frame rate" 10
	"lifetime" 31
	"random angle" 360
	"velocity scale" 0.
	"random spin" 360


outfit "Pug Zapper"
	category "Guns"
	cost 170000
	thumbnail "outfit/unknown"
	"mass" 25
	"outfit space" -25
	"weapon capacity" -25
	"gun ports" -1
	weapon
		sprite "projectile/lightning"
			"frame rate" 60
			"random start frame"
		sound "zapper"
		"hit effect" "skylance impact"
		"inaccuracy" .3
		"velocity" 320
		"lifetime" 1
		"reload" 2
		"firing energy" 5.4
		"firing heat" 2.9
		"shield damage" 7.4
		"hull damage" 8.9
	description "This is a formidable beam weapon, more damaging than even the most advanced energy beams that humanity has developed. Pug ships have integrated power plants that produce the considerable amount of energy that is needed to drive weapons like this one."

outfit "Pug Zapper Turret"
	category "Turrets"
	cost 420000
	thumbnail "outfit/unknown"
	"mass" 66
	"outfit space" -66
	"weapon capacity" -66
	"turret mounts" -1
	"required crew" 1
	weapon
		sprite "projectile/lightning"
			"frame rate" 60
			"random start frame"
		sound "zapper"
		"hit effect" "skylance impact"
		"inaccuracy" .3
		"velocity" 320
		"lifetime" 1
		"reload" 1
		"firing energy" 5.4
		"firing heat" 2.9
		"shield damage" 7.4
		"hull damage" 8.9
	description "Mounted on a turret, this Pug weapon becomes even more devastatingly powerful. However, its energy requirements are higher than most human ships can support."

outfit "Pug Seeker"
	category "Guns"
	cost 540000
	thumbnail "outfit/unknown"
	"mass" 34
	"outfit space" -34
	"weapon capacity" -34
	"gun ports" -1
	weapon
		sprite "projectile/seeker"
			"frame rate" 20
			"random start frame"
		sound "seeker"
		"hit effect" "seeker impact"
		"die effect" "seeker impact"
		"inaccuracy" 2
		"velocity" 15
		"lifetime" 200
		"reload" 10
		"firing energy" 25
		"firing heat" 20
		"acceleration" 1.5
		"drag" .1
		"turn" 4
		"homing" 5
		"shield damage" 24
		"hull damage" 19
		"hit force" 2
		"missile strength" 40
	description "You have no idea how this weapon works. It requires no ammunition, but its energy-based projectiles have the ability to home in on a target ship."

outfit "Pug Anti-Missile"
	category "Turrets"
	cost 350000
	thumbnail "outfit/unknown"
	"mass" 41
	"outfit space" -41
	"weapon capacity" -41
	"turret mounts" -1
	weapon
		"hit effect" "pug anti-missile"
		"anti-missile" 5
		"velocity" 200
		"lifetime" 1
		"reload" 2
		"firing energy" 8
		"firing heat" 2
	description "This anti-missile system designed by the Pug draws a lot of energy, but its fast firing rate makes it twice as effective as anything that Lovelace Labs has been able to come up with. A ship with one of these turrets will be very difficult to hit with missiles."


outfit "Pug Akfar Thruster"
	category "Engines"
	"cost" 608000
	thumbnail "outfit/unknown"
	"mass" 43
	"outfit space" -43
	"engine capacity" -43
	"thrust" 28.0
	"thrusting energy" 2.2
	"thrusting heat" 3.1
	"flare sprite" "effect/ion flare/medium"
		"frame rate" 8
	"flare sound" "ion medium"
	description "This is a small thruster designed by the Pug. It is not quite as powerful as a similarly sized atomic engine, but it makes up for that by being almost as energy efficient as ion engines."

outfit "Pug Akfar Steering"
	category "Engines"
	"cost" 472000
	thumbnail "outfit/unknown"
	"mass" 33
	"outfit space" -33
	"engine capacity" -33
	"turn" 750
	"turning energy" 1.3
	"turning heat" 2.1
	description "This is a small steering system designed by the Pug. It is not quite as powerful as a similarly sized atomic engine, but it makes up for that by being almost as energy efficient as ion engines."

outfit "Pug Cormet Thruster"
	category "Engines"
	"cost" 1050000
	thumbnail "outfit/unknown"
	"mass" 60
	"outfit space" -60
	"engine capacity" -60
	"thrust" 44.0
	"thrusting energy" 3.3
	"thrusting heat" 4.6
	"flare sprite" "effect/ion flare/big"
		"frame rate" 9
	"flare sound" "ion large"
	description "This is a medium-sized thruster designed by the Pug. It is not quite as powerful as a similarly sized atomic engine, but it makes up for that by being almost as energy efficient as ion engines."

outfit "Pug Cormet Steering"
	category "Engines"
	"cost" 880000
	thumbnail "outfit/unknown"
	"mass" 46
	"outfit space" -46
	"engine capacity" -46
	"turn" 1130
	"turning energy" 1.9
	"turning heat" 3.1
	description "This is a medium-sized steering system designed by the Pug. It is not quite as powerful as a similarly sized atomic engine, but it makes up for that by being almost as energy efficient as ion engines."

outfit "Pug Lohmar Thruster"
	category "Engines"
	"cost" 1740000
	thumbnail "outfit/unknown"
	"mass" 84
	"outfit space" -84
	"engine capacity" -84
	"thrust" 66.0
	"thrusting energy" 4.9
	"thrusting heat" 6.9
	"flare sprite" "effect/ion flare/huge"
		"frame rate" 9
	"flare sound" "ion huge"
	description "This is a large thruster designed by the Pug. It is not quite as powerful as a similarly sized atomic engine, but it makes up for that by being almost as energy efficient as ion engines."

outfit "Pug Lohmar Steering"
	category "Engines"
	"cost" 1580000
	thumbnail "outfit/unknown"
	"mass" 64
	"outfit space" -64
	"engine capacity" -64
	"turn" 1700
	"turning energy" 2.8
	"turning heat" 4.7
	description "This is a large steering system designed by the Pug. It is not quite as powerful as a similarly sized atomic engine, but it makes up for that by being almost as energy efficient as ion engines."


outfit "Pug Biodefenses"
	category "Hand to Hand"
	cost 100000
	thumbnail "outfit/unknown"
	"capture defense" 250
	description "This defense system is designed to release a suite of toxins that are lethal to human beings (and probably to some other species, as well) but which have no effect at all on the Pug."


ship "Pug Zibruka"
	sprite "ship/pug zibruka"
	attributes
		category "Light Warship"
		"cost" 1900000
		"shields" 4000
		"hull" 1000
		"required crew" 4
		"bunks" 6
		"mass" 240
		"drag" 3.1
		"heat dissipation" .8
		"fuel capacity" 600
		"cargo space" 20
		"outfit space" 180
		"weapon capacity" 68
		"engine capacity" 76
		"energy generation" 10
		"shield generation" 6
		"heat generation" 20
		"energy capacity" 1000
		weapon
			"blast radius" 100
			"shield damage" 400
			"hull damage" 200
			"hit force" 600
	outfits
		"Pug Zapper" 2
		"Pug Biodefenses" 4
		"Jump Drive"
		"Pug Akfar Thruster"
		"Pug Akfar Steering"
	engine -7 35
	engine 7 35
	gun -15 -42 "Pug Zapper"
	gun 15 -42 "Pug Zapper"
	explode "tiny explosion" 10
	explode "small explosion" 15
	explode "medium explosion" 20
	explode "big explosion" 10
	description "The Zibruka is the smallest Pug ship that you know of."

ship "Pug Enfolta"
	sprite "ship/pug enfolta"
	attributes
		category "Medium Warship"
		"cost" 6300000
		"shields" 6800
		"hull" 1700
		"required crew" 19
		"bunks" 27
		"mass" 410
		"drag" 5.9
		"heat dissipation" .7
		"fuel capacity" 600
		"cargo space" 40
		"outfit space" 360
		"weapon capacity" 184
		"engine capacity" 106
		"energy generation" 22
		"shield generation" 8
		"heat generation" 32
		"energy capacity" 2000
		weapon
			"blast radius" 180
			"shield damage" 720
			"hull damage" 360
			"hit force" 1080
	outfits
		"Pug Zapper" 2
		"Pug Seeker" 2
		"Pug Zapper Turret"
		"Pug Biodefenses" 6
		"Jump Drive"
		"Pug Cormet Thruster"
		"Pug Cormet Steering"
	engine -11 68
	engine 11 68
	gun -11 -85 "Pug Zapper"
	gun 11 -85 "Pug Zapper"
	gun -11 -85 "Pug Seeker"
	gun 11 -85 "Pug Seeker"
	turret 0 7 "Pug Zapper Turret"
	explode "tiny explosion" 5
	explode "small explosion" 20
	explode "medium explosion" 25
	explode "big explosion" 15
	description "This is a medium-sized Pug warship."

ship "Pug Maboro"
	sprite "ship/pug maboro"
	attributes
		category "Heavy Warship"
		"cost" 9500000
		"shields" 12600
		"hull" 2700
		"required crew" 54
		"bunks" 87
		"mass" 940
		"drag" 9.8
		"heat dissipation" .6
		"fuel capacity" 600
		"cargo space" 70
		"outfit space" 560
		"weapon capacity" 309
		"engine capacity" 148
		"energy generation" 32
		"shield generation" 10
		"heat generation" 48
		"energy capacity" 4000
		weapon
			"blast radius" 300
			"shield damage" 1200
			"hull damage" 600
			"hit force" 1800
	outfits
		"Pug Seeker" 4
		"Pug Zapper Turret" 2
		"Pug Anti-Missile"
		"Pug Biodefenses" 8
		"Jump Drive"
		"Pug Lohmar Thruster"
		"Pug Lohmar Steering"
	engine -11 68
	engine 11 68
	gun -20 -150 "Pug Seeker"
	gun 20 -150 "Pug Seeker"
	gun -10 -150 "Pug Seeker"
	gun 10 -150 "Pug Seeker"
	turret 0 -50 "Pug Anti-Missile"
	turret -15 -35 "Pug Zapper Turret"
	turret 15 -35 "Pug Zapper Turret"
	explode "small explosion" 25
	explode "medium explosion" 30
	explode "big explosion" 20
	explode "huge explosion" 5
	description "This is the largest Pug warship."



galaxy "pug empty galaxy"
	pos 10000 7000
	sprite ui/pleiades

system "Over the Rainbow"
	pos 9904 7176
	government Uninhabited
	link "Terra Incognita"
	habitable 1215
	asteroids "small rock" 1 3.3098
	asteroids "medium rock" 8 3.3345
	asteroids "large rock" 2 2.1242
	asteroids "small metal" 5 2.9887
	asteroids "medium metal" 11 3.6556
	asteroids "large metal" 7 2.0007
	object "Pug Wormhole"
		sprite planet/wormhole
	object
		sprite star/k5
		distance 1455.1
		period 875.481048
		offset 180
		object
			sprite star/m4
			distance 75
			period 12.179969
	object
		sprite star/g0
		distance 544.9
		period 875.481048
		object
			sprite star/m4
			distance 107
			period 12.701281

system "Terra Incognita"
	pos 9921.5 7086.5
	government Uninhabited
	link "Over the Rainbow"
	habitable 455.625
	asteroids "small rock" 8 1.8432
	asteroids "medium rock" 1 1.8144
	asteroids "large rock" 31 3.2544
	asteroids "small metal" 1 4.1472
	asteroids "medium metal" 24 3.9744
	asteroids "large metal" 11 4.2624
	object
		sprite star/k0
		period 10
	object
		sprite planet/lava4
		distance 174.59
		period 43.230003
	object Ruin
		sprite planet/ocean9
		distance 461.84
		period 185.99169
	object
		sprite planet/cloud8
		distance 862.65
		period 474.79721
	object
		sprite planet/gas2
		distance 2203.49
		period 1938.3083
		object
			sprite planet/ganymede
			distance 280
			period 12.134831
		object
			sprite planet/dust5
			distance 439
			period 23.822836
		object
			sprite planet/oberon
			distance 543
			period 32.771508

system "World's End"
	pos 9966.5 7017.5
	government Uninhabited
	habitable 700
	object
		sprite star/g5
		period 10
	object
		sprite "planet/ringworld right"
		distance 812
		period 360
		offset 0
	object
		sprite "planet/ringworld left"
		distance 812
		period 360
		offset 20
	object
		sprite "planet/ringworld right"
		distance 812
		period 360
		offset 50
	object
		sprite "planet/ringworld left"
		distance 812
		period 360
		offset 70
	object
		sprite "planet/ringworld right"
		distance 812
		period 360
		offset 140
	object
		sprite "planet/ringworld left"
		distance 812
		period 360
		offset 160
	object
		sprite "planet/ringworld right"
		distance 812
		period 360
		offset 180
	object
		sprite "planet/ringworld left"
		distance 812
		period 360
		offset 200
	object
		sprite "planet/ringworld right"
		distance 812
		period 360
		offset 270
	object
		sprite "planet/ringworld left"
		distance 812
		period 360
		offset 290

planet Ruin
	attributes uninhabited
	landscape land/hills3
	description `This is a stormy, cloud-covered planet, where fog banks flow through the valleys like dark, cold, slow-moving rivers, and the sun is seldom visible. Aside from some dull blue-grey moss and lichen, there are few living things here. The ground is warmer than the air above it, due to an abundance of radioactive elements in the planet's crust.`
	description `	Most of the surface is ocean, but atop one of the higher mountains is an odd, abandoned spaceport.`
	spaceport `Perhaps the oddest thing about this planet is this spaceport: a ring of landing pads surrounding a collection of fuel tanks. The landing pads are not cement or any other material humans customarily use, but monolithic slabs of basalt. One of the fuel tanks has a human-style connector on it, but there are a dozen other connectors branching off from it as well.`
	spaceport `	A few insectoid robots scuttle slowly across the tanks and landing pads, removing ice and rust and lichen and polishing the surfaces of the tanks. No living creatures are present.`
	security 0

mission "Ruin: Landing"
	landing
	source Ruin
	
	on offer
		conversation
			`You scan this planet's surface and pick up only a single, faint energy source. Cautiously, you approach it, and find an abandoned fueling depot: a ring of landing pads around a cluster of tanks of all different shapes and sizes. Some of the tanks must be cryogenic, because they are covered in ice. A few slow-moving insectoid robots are busy clearing off the ice and cleaning the tanks, but they do not appear to be armed and you see no sign of any other creatures or of any defense systems.`
			`	You land your ship. Your sensors say the air is safe to breathe, but you wear a respirator just in case as you step off your ship and explore the depot. The spider robots pay no attention to you. From the fact that some of the tanks are covered in frost and others are not, you would guess that each one contains a different fuel, and each tank has dozens of different connectors branching off from it. With surprise, you discover that one of those connectors is the style used in human space, and you are able to use it to refuel your ship.`
			`	Other than the robots and the fog swirling in the valley below you, there is no sign of life or motion here, and the air is uncomfortably moist and cold despite the hot steam rising up from a few nearby vents in the ground.`
				decline

mission "Pug Cease Hostilities"
	landing
	to offer
		has "main plot completed"
	on offer
		"reputation: Pug" >?= 1
		fail

mission "Pug in Wanderer Space"
	landing
	to offer
		has "main plot completed"
	source "Vara Pug"
	on offer
		conversation
			`This world is populated by the Pug, the same enigmatic species that recently invaded human space - and left without giving you any clear answers about why they did so. Here, they appear peaceful enough, but they are ignoring you completely. Do you want to try to talk to one of them?`
			choice
				`	(Yes.)`
				`	(No, don't risk it.)`
					goto ship
			`	You try to talk to several of the Pug who are walking by, but they do not respond or even look at you. If you stand to block their path, they step around you, and you determine by intentionally bumping into one of them that they are real and not just a holographic projection. From the brief eye contact that a few of them make before looking away from you, you get the feeling that they are intentionally ignoring you.`
			`	The Pug are not terribly strong. You could probably grab one of them and demand that it answer your questions, without much risk of it hurting you.`
			choice
				`	(Grab one of them.)`
				`	(Give up and leave.)`
					goto ship
			`	You grab one of the Pug by the arm. "You need to give me some answers," you say. It begins to babble in a language you do not know, and a crowd of Pug gather around you. Eventually a few more of them arrive holding some sort of staff that they point at you menacingly, while shouting commands at you, again in their own language. It is possible that none of the Pug here actually speak the human language, in which case trying to communicate with them will be fruitless.`
			choice
				`	(Let the Pug go, and walk away.)`
					goto ship
				`	(Threaten to shoot them.)`
			`	The moment you reach for your gun, one of the armed Pug fires a burst of light from its staff, and a warm, pleasant feeling washes over you - the most wonderful feeling you have ever experienced. In a daze, you begin to wander back to your ship, stopping occasionally to marvel at the things around you that you had not noticed before: the glittering of sunlight on the water, the sparkling drops of ocean spray hanging from the tips of sea marsh grass, the sky that has the bluest blueness of all the blues you have ever seen. It is all so beautiful that you start to cry. Once you reach your ship, you sit in the cockpit fascinated by the blinking lights on the control panel and unable to remember what any of them are for.`
			`	A few hours later, the wonderful feeling is replaced by a wave of nausea and a pounding headache.`
				decline
			
			label ship
			`	You decide to play it safe and return to your ship. The Pug remain as enigmatic as ever.`
				decline
