# 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.

outfit "Pug Zapper"
	category "Guns"
	cost 290000
	thumbnail "outfit/pug zapper"
	"mass" 25
	"outfit space" -25
	"weapon capacity" -25
	"gun ports" -1
	weapon
		sprite "projectile/lightning"
			"frame rate" 60
			"random start frame"
			"delay" 6
		sound "zapper"
		"hit effect" "skylance impact"
		"inaccuracy" .3
		"velocity" 320
		"lifetime" 1
		"reload" 1
		"firing energy" 2.7
		"firing heat" 1.4
		"shield damage" 3.7
		"hull damage" 2.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 860000
	thumbnail "outfit/pug zapper turret"
	"mass" 66
	"outfit space" -66
	"weapon capacity" -66
	"turret mounts" -1
	"required crew" 1
	weapon
		sprite "projectile/lightning"
			"frame rate" 60
			"random start frame"
		"hardpoint sprite" "hardpoint/pug zapper turret"
		"hardpoint offset" 7.
		sound "zapper"
		"hit effect" "skylance impact"
		"inaccuracy" .3
		"turret turn" 2.5
		"velocity" 320
		"lifetime" 1
		"reload" 1
		"firing energy" 5.4
		"firing heat" 2.8
		"shield damage" 7.4
		"hull damage" 5.8
	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/pug seeker"
	"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" 13
		"lifetime" 200
		"reload" 10
		"firing energy" 25
		"firing heat" 20
		"acceleration" 1.3
		"drag" .1
		"turn" 4
		"homing" 5
		"tracking" .5
		"shield damage" 24
		"hull damage" 13
		"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."

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


outfit "Pug Anti-Missile"
	category "Turrets"
	cost 350000
	thumbnail "outfit/pug anti-missile"
	"mass" 41
	"outfit space" -41
	"weapon capacity" -41
	"turret mounts" -1
	weapon
		"hardpoint sprite" "hardpoint/pug anti-missile"
		"hardpoint offset" 6.
		"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."

effect "pug anti-missile"
	sprite "effect/large anti missile"
		"no repeat"
		"frame rate" 6
	sound "pug anti-missile"
	"lifetime" 11
	"velocity scale" 1


outfit "Tier 3 Anti-Missile"
	category "Turrets"
	cost 12000000
	thumbnail "outfit/t3 anti missile"
	"mass" 67
	"outfit space" -67
	"weapon capacity" -67
	"turret mounts" -1
	weapon
		"hardpoint sprite" "hardpoint/t3 anti missile"
		"fire effect" "tier 3 anti-missile fire"
		"die effect" "tier 3 anti-missile die" 2
		"anti-missile" 100
		"velocity" 570
		"lifetime" 1
		"reload" 6
		"firing energy" 80
		"firing heat" 10
	description "This powerful anti-missile turret is capable of destroying even the strongest of missiles."

effect "tier 3 anti-missile fire"
	sprite "effect/anti-missile 3 fire"
		"no repeat"
		"frame rate" 20
	"lifetime" 3
	"random angle" 360
	"velocity scale" 1

effect "tier 3 anti-missile die"
	sprite "effect/anti-missile 3 die"
		"no repeat"
		"frame rate" 10
	"lifetime" 31
	"random angle" 360
	"velocity scale" .4


outfit "Pug Gridfire Turret"
	category "Turrets"
	cost 24000000
	thumbnail "outfit/pug gridfire turret"
	"mass" 83
	"outfit space" -83
	"weapon capacity" -83
	"turret mounts" -1
	weapon
		"hardpoint sprite" "hardpoint/pug gridfire turret"
		"fire effect" "gridfire fire"
		"hit effect" "gridfire hit" 2
		"hit effect" "gridfire cloud"
		"phasing"
		"velocity" 1440
		"lifetime" 1
		"reload" 20
		"turret turn" 20
		"firing energy" 800
		"firing heat" 400
		"firing force" 150
		"shield damage" 600
		"hull damage" 600
		"blast radius" 40
		"piercing" .3
	description "No one understands how the Gridfire Turret works, and the Pug aren't interested in explaining."

effect "gridfire fire"
	sprite "effect/gridfire fire"
		"no repeat"
		"frame rate" 20
	"lifetime" 7
	"random angle" 360
	"random spin" 20
	"velocity scale" 1

effect "gridfire hit"
	sprite "effect/gridfire hit"
		"no repeat"
		"frame rate" 10
	"lifetime" 25
	"random angle" 360
	"velocity scale" .00001

effect "gridfire cloud"
	sprite "effect/gridfire cloud"
		"no repeat"
		"frame rate" 2
	"lifetime" 61
	"random angle" 360
	"random spin" 10
	"velocity scale" .00001



outfit "Pug Akfar Thruster"
	category "Engines"
	"cost" 608000
	thumbnail "outfit/pug akfar thruster"
	"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/pug akfar steering"
	"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/pug cormet thruster"
	"mass" 60
	"outfit space" -60
	"engine capacity" -60
	"thrust" 44.0
	"thrusting energy" 3.3
	"thrusting heat" 4.6
	"flare sprite" "effect/ion flare/large"
		"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/pug cormet steering"
	"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/pug lohmar thruster"
	"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/pug lohmar steering"
	"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"
	plural "Pug Biodefenses"
	category "Hand to Hand"
	cost 100000
	thumbnail "outfit/pug biodefenses"
	"capture defense" 250
	"unplunderable" 1
	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"
	thumbnail "thumbnail/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 capacity" 1000
		"energy generation" 10
		"heat generation" 20
		"shield generation" 6
		"shield energy" 6
		weapon
			"blast radius" 100
			"shield damage" 400
			"hull damage" 200
			"hit force" 600
	outfits
		"Pug Zapper" 2
		
		"Pug Biodefenses" 4
		
		"Pug Akfar Thruster"
		"Pug Akfar Steering"
		"Jump Drive"
		
	engine -7 35
	engine 7 35
	gun -15 -42 "Pug Zapper"
	gun 15 -42 "Pug Zapper"
	explode "pug tiny explosion" 10
	explode "pug small explosion" 15
	explode "pug medium explosion" 20
	explode "pug large explosion" 10
	"final explode" "final explosion small"
	description "The Zibruka is the smallest Pug ship that you know of."


ship "Pug Enfolta"
	sprite "ship/pug enfolta"
	thumbnail "thumbnail/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 capacity" 2000
		"energy generation" 22
		"heat generation" 32
		"shield generation" 8
		"shield energy" 8
		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
		
		"Pug Cormet Thruster"
		"Pug Cormet Steering"
		"Jump Drive"
		
	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 "pug tiny explosion" 5
	explode "pug small explosion" 20
	explode "pug medium explosion" 25
	explode "pug large explosion" 15
	"final explode" "final explosion medium"
	description "This is a medium-sized Pug warship."


ship "Pug Maboro"
	sprite "ship/pug maboro"
	thumbnail "thumbnail/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 capacity" 4000
		"energy generation" 32
		"heat generation" 48
		"shield generation" 10
		"shield energy" 10
		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
		
		"Pug Lohmar Thruster"
		"Pug Lohmar Steering"
		"Jump Drive"
		
	engine -20 136
	engine 20 136
	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 "pug small explosion" 25
	explode "pug medium explosion" 30
	explode "pug large explosion" 20
	explode "pug huge explosion" 5
	"final explode" "final explosion large"
	description "This is the largest Pug warship."


ship "Pug Arfecta"
	sprite "ship/pug arfecta"
	thumbnail "thumbnail/pug arfecta"
	attributes
		category "Medium Warship"
		"cost" 90000000
		"shields" 98000
		"hull" 80000
		"required crew" 36
		"bunks" 46
		"mass" 670
		"drag" 7.5
		"heat dissipation" .8
		"fuel capacity" 1200
		"cargo space" 64
		"outfit space" 640
		"weapon capacity" 390
		"engine capacity" 220
		"energy capacity" 10000
		"energy generation" 200
		"heat generation" 10
		"shield generation" 32
		"shield energy" 32
		"hull repair rate" 5
		"hull energy" 5
		"cloaking fuel" -.2
		"reverse thrust" 66
		"reverse thrusting energy" 4.9
		"reverse thrusting heat" 6.9
		weapon
			"blast radius" 320
			"shield damage" 9000
			"hull damage" 4500
			"hit force" 7000
	outfits
		"Tier 3 Anti-Missile" 2
		"Pug Gridfire Turret" 3
		
		"Cloaking Device"
		"Pug Biodefenses" 12
		
		"Pug Lohmar Thruster"
		"Pug Lohmar Steering" 2
		"Jump Drive"
	
	engine -15 164
	engine 15 164
	turret -50 -29 "Tier 3 Anti-Missile"
	turret 50 -29 "Tier 3 Anti-Missile"
	turret 0 40 "Pug Gridfire Turret"
	turret -73 84 "Pug Gridfire Turret"
	turret 73 84 "Pug Gridfire Turret"
	explode "pug tiny explosion" 100
	explode "pug small explosion" 60
	explode "pug medium explosion" 30
	explode "pug large explosion" 10
	"final explode" "final explosion large"
	description `This is a Pug "tier 3" warship, intended for use in combat against either a species on par with the Quarg, or a lesser species that has decided to be particularly meddlesome.`



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 "Pug Wormhole"

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
	invisible
	to offer
		has "main plot completed"
	on offer
		"reputation: Pug" >?= 1
		fail

mission "Pug in Wanderer Space"
	landing
	to offer
		has "main plot completed"
		not "Wanderers Invaded 3C: offered"
	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

mission "Pug Angry at Being Farmed"
	landing
	invisible
	to offer
		or
			has "Pug Cease Hostilities: offered"
			not "chosen sides"
		"reputation: Pug" < -100
	npc kill
		government "Pug"
		personality nemesis unconstrained staying
		system "Pug Iyik"
		ship "Pug Arfecta" "Ayee Eee Eek"
