# Copyright (c) 2014 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.

mission "Immigrant Workers"
	description "This young couple wants to start a new life on <destination>."
	minor
	passengers 2
	cargo "luggage and furniture" 2
	to offer
		random < 50
	source "New Iceland"
	destination
		attributes core
		attributes factory textile
	on complete
		payment
		payment 10000
		dialog "The young couple from <origin> pays you and thanks you profusely as they gather up their goods and depart. You wish them the best of luck in their new life on <planet>."
	on offer
		conversation
			"As you leave your ship and walk toward the cafeteria at the center of the spaceport, you notice a young couple standing near the edge of the landing area next to a cart loaded high with a jumble of boxes and furniture. Like many of the locals, they are both wearing dust masks over their mouths, and the woman is also wearing goggles."
			choice
				"	(Talk to them.)"
				"	(Ignore them.)"
					decline
			"	The couple introduces themselves as George and Samantha. As you shake hands with them, you notice that Samatha's eyes under the goggles are rimmed in red, and she keeps coughing quietly: a dry, careful cough. George explains that they came here several years ago to take jobs in the factories, but the volcanic fumes have been giving Samantha trouble ever since they arrived. They will pay for transport for themselves and their household goods to <destination>."
			choice
				"	(Accept.)"
				"	(Decline.)"
					decline
			"	They thank you for your assistance, and you give them a hand pushing the heavy cart into your cargo bay."
				accept



mission "Pookie, Part 1"
	name "Pookie"
	description "Travel to <destination> and meet Pookie, who is staying with her aunt and may be scared of flying."
	minor
	to offer
		random < 50
	source "Hestia"
	destination "Shroud"
	on offer
		conversation
			`As you walk through the spaceport, you hear a voice behind you, saying, "Excuse me, captain." You turn around and see a woman trying to flag you down. Her hairdo is tall and somewhat confusing; her high heels are also tall and are giving her considerable trouble as she walks towards you.`
			`	"You look like the sort of captain I can trust," she says. "My darling Pookie has been visiting her aunt on Shroud, and it's time for her to come home, but she's not used to space travel and it scares her. I would feel so much better if you could go pick her up and bring her back here. Can you do that for me?" You can't help noticing that the jewelry she's wearing probably costs as much as a small fighter craft. This job sounds easy, and has the potential to be quite lucrative.`
			choice
				"	(Accept.)"
				"	(Decline.)"
					decline
			"	You tell her that you would be glad to assist, and that you can personally assure her that no harm will come to Pookie while on board your ship. She thanks you, and gives you contact information for her aunt in the <system> system."
				accept



mission "Pookie, Part 2"
	name "Pookie"
	landing
	description "Return Pookie the poodle to <destination>."
	source "Shroud"
	destination "Hestia"
	passengers 1
	cargo "chew toys" 1
	to offer
		has "Pookie, Part 1: done"
	on offer
		conversation
			`You called ahead while your ship was landing and agreed to meet Pookie's aunt at the spaceport. She told you, "Meet me outside the shop with the ridiculous sheepskin coats." The shop is not hard to find; the mannequins in the window look like feral sheep with overgrown wool in bad need of grooming.`
			"	The only person standing outside the shop is a tall woman in a suit who is busy making furious marks on some sort of document with a red pen. She has a small poodle on a leash; it is busy nipping the heels of everyone who walks by."
			choice
				"	(Interrupt her.)"
					goto interrupt
				"	(Wait to see if someone else shows up.)"
					goto wait
		
			label interrupt
			`	"Excuse me," you say. She looks up at you with a withering glare. "I'm looking for someone named Pookie."`
				goto response
		
			label wait
			`	Eventually she looks up from the paper and sees you standing there. "Are you Captain <last>?" she asks. You nod.`
				goto response
		
			label response
			`	"Thank heavens," she says. "She's all yours." She hands you the leash and a large bag that appears to be full of chew toys. "Here are her toys, her food, and her... outfits. Which she hates. Feed her twice a day, or she will go berserk. Do not feed her more than twice a day, or she will throw up..."`
			`	As she continues rattling off instructions, you ask, "Wait, Pookie is the dog?"`
			`	"Short for 'Pocahontas,"' she explains. "Good luck, and I hope my sister pays you well." She walks away. There's nothing else you can do but bring Pookie back to your ship, where she immediately lifts her leg against the landing strut.`
				accept
	on complete
		payment 80000
		dialog "In the past few days, Pookie has barked incessantly and thrown up several times despite being fed perfectly on schedule, and the room you've been keeping her in will likely smell like dog urine for months. You are all too happy to return her to her owner, who pays you <payment>."



mission "Smuggler's Den, Part 1"
	name "Refugees to <planet>"
	description "You met Joe and Maria, a young couple with a newborn baby, on the Smuggler's Den station. They want to start a new life on <destination>."
	minor
	source "Smuggler's Den"
	destination "Arabia"
	passengers 2
	on offer
		conversation
			`You wander into one of several dimly lit, smoke-filled bars near your docking bay and sit down at an empty table. As you scan the room, you notice a pair of hooded figures who stand up and begin moving toward you. They aren't carrying any visible weapons, but on a station like this one there's a good chance that everyone you meet has a concealed gun. One of them is carrying a bundle wrapped in cloth. You can't see their faces.`
			choice
				`	(Get out of here.)`
				`	(Wait and see what they want.)`
					goto meet
			
			`	You've heard too many stories of kidnappings and murders on this station to be willing to take any risks. You quickly get up and leave the bar, and walk down the passageway back toward your ship. Glancing behind you, you see that the hooded figures have decided not to follow you.`
				decline
			
			label meet
			`	You decide to wait and see what they want from you. They sit down at your table, and turn out to be a boy and a girl, perhaps thirteen or fourteen year old. The bundle in her arms is a baby. "Are you a captain?" he asks.`
			`	"Yes," you say.`
			`	"We're looking for passage off-world," he says. "My cousin works in the refineries on Arabia, and I'm hoping he can get me a job there."`
			choice
				`	"I don't want to be involved in anything illegal. Are you in some sort of trouble with the law?"`
					goto legal
				`	"Well, how much would you be able to pay me?"`
					goto payment
			
			label legal
			`	You ask, "Are you in some sort of trouble with the law?"`
			`	The boy grins. "No, not at all. I mean, aside from the fact that we're pirates."`
			`	Seeing the incredulous look on your face, she says, "Members of a pirate gang. Crew on a pirate ship. Captains are usually older, but most of the pirate ships you see out there are crewed by kids like us. It's a hard place to grow up. We want something better for our daughter."`
				goto search
			
			label payment
			`	You ask, "How much can you pay?"`
			`	They are silent for a long moment, looking down at the table. Finally, the boy says, "We're crew on a pirate ship, hardly better than slaves. The captain keeps our wages. We don't get paid anything unless they agree to let us go. Which isn't going to happen. But if you help us start a new life, we'll work hard and some day we'll pay you back. That's the best we can offer."`
			`	She adds, "You don't know what it's like for a little girl to grow up on a pirate ship. We want something better than that for our daughter."`
				goto search
			
			label search
			`	As you are conversing, someone else walks into the bar: a bearded man, and a rough-looking teenage boy. They stand in the doorway, scanning the room. "That's our captain," she says. "Please, you have to help us. There's a service tunnel that connects to the back entrance of the bar. We can escape through there."`
			`	You've heard of these service passageways: the most dangerous part of this lawless station, dimly lit and seldom travelled, except by drug addicts and prostitutes. This whole thing might just be a ruse to lure you into one, where they can attack you without anyone interfering. "No," says the boy, "if we head for the service tunnel, they'll be sure to notice us. Let's just stay at the table until they go away."`
			`	The baby begins to cry, softly, and she bounces it gently, trying desperately to quiet it. "Shh. Shh." For the moment, it falls silent.`
			choice
				`	(Try the service tunnel.)`
					goto tunnel
				`	(Wait.)`
					goto outside
				`	"I'm sorry, this isn't worth risking my life for. I'm leaving."`
	
			`	You stand up and leave. The men in the doorway make no effort to stop you.`
				decline
			
			label `tunnel`
			`	"Let's try the tunnel," you say.`
			`	The boy stands up. "Wait ten seconds, then head to the tunnel," he says. He walks into the bathroom, which is right next to back entrance that she pointed out. You wait for a few seconds, then stand up and head for the service tunnel. "Don't run," says the girl. "Walk slowly. Pretend. You've had a bit too much to drink. We're headed out back to find some privacy." You don't dare look behind you to see if the men in the doorway are watching you.`
			`	Finally, you reach the back entrance. It's an old-fashioned airtight door, in case the service tunnel depressurizes. She spins the wheel to unlock it, and then gives it a yank. The hinges squeal, but it opens enough for you to squeeze through. You find yourselves in a narrow corridor lit only by flickering sodium lamps. In the yellow lamplight her face and hands look pale, jaundiced. The floor of the corridor is littered with beer bottles and discarded hypodermic needles. To one side of the door are several over-stuffed trash cans. As you step into the corridor, a rat scurries away into the darkness.`
			`	A few second later, watching through the open airlock, you see the boy walk out of the bathroom. He can't help stealing a quick glance towards the men in the doorway, after which he quickly ducks through the airlock and slams the door shut. "Run!" he whispers.`
			`	You begin running down the corridor, in the direction of your ship. You pass a man, slumped over in a corner; there is no time to see if he is dead, or just sleeping. In places the lights have gone out, and it is so dim that you can barely see the floor beneath you. Your footsteps pounding on the metal decking ring terribly loud up and down the empty hallway. You cannot tell if the sound of more footsteps behind you is just an echo, or someone following you.`
			`	Eventually the passageway widens out into some sort of maintenance room, with large tanks and humming equipment lining the walls. There are also several small, windowless sheds. You duck behind one of them and listen for sounds of pursuit. You hear nothing. "I think we're safe," says the boy. He walks over to another airlock door on the opposite wall and tugs it open. Light pours in, almost blinding at first. You are looking out into the rimway, the main passage in this ring of the station. Crowds of people are walking past, paying no attention to you. He glances quickly in both directions, then gestures for you to follow.`
				goto ship
			
			label outside
			`	You wait at the table, playing with the computer terminal at the center of it, pretending that you are busy placing a drink order. The men at the door do not leave. Instead, they step into the room and begin circling around the edge of it. Fortunately, right now they are headed away from you. "What berth is your ship in?" asks the boy. You tell him. "Wait ten seconds, then follow," he says. He stands up and walks through the door. The searchers glance at him as he leaves, but they must be looking for two people together, because they ignore him.`
			`	The searchers approach the bar and begin talking to one of the bartenders. You and the girl stand up. "Walk slowly," she hisses under her breath. "Saunter. Don't run." You put an arm around her shoulders and do your best to act like an ordinary bar patron headed home with a new friend after having a bit too much to drink. You don't dare to glance at the bar to see if you are being watched.`
			`	Finally you reach the door. You are in the rimway, the main passage in this ring of the station. It is crowded and brightly lit. You quicken your pace slightly and begin walking toward your ship, still afraid that if you break into a run, you will attract attention. The girl keeps glancing at the shop windows that you pass by: checking the reflection for anyone following you. "They're leaving the bar," she says. And then, "They're walking in the other direction. I think we're safe."`
			`	You pass a narrow doorway, probably an entrance to one of the service tunnels. The boy is standing there, holding a gun by his side. His grim expression softens somewhat when he sees you approaching. He looks out behind you, scanning the crowd, then steps out of the doorway to follow you.`
				goto ship
			
			label ship
			`	You quickly make your way back to your ship. As soon as the door has closed behind you, all three of you breathe a sigh of relief. A second later, the baby begins to wail, loudly. As you show them to their bunks, they introduce themselves as Joe and Maria; the baby's name is Jesse. "I don't know how to thank you," says Maria.`
			`	"Please don't take too long leaving the station," adds Joe. "But, I think we'll be safe here until you're ready to leave. There's no way they can search all the ships on the dock."`
				accept



mission "Smuggler's Den, Part 2"
	landing
	name "Refugees to <planet>"
	description "Joe and Maria were unable to find work on <origin>. Take them to <destination>, to see if they can get a job there."
	destination "Millrace"
	passengers 2
	to offer
		has "Smuggler's Den, Part 1: done"
	on offer
		conversation
			`	As soon as you have landed, Joe finds a computer terminal and tries to look up his cousin who works here, but with no success. You go with him to the company office, where after a short wait you are ushered in to meet with a foreman. After Joe introduces himself, the man says, "I'm really sorry to tell you this, but Leroy died in a refinery fire several months ago."`
			`	Joe is crestfallen. After a long silence, you say, "Sir, do you have any work available for Joe? He and his family were hoping to be able to put down roots here."`
			`	"I'm sorry," says the foreman, "but we've had a ton of immigrants recently. The waiting list for new jobs is about five months long. They could stay here and hope for the best, but if they need work right away, they would be better off going to one of the Syndicate worlds, like <planet>."`
			choice
				`	(Volunteer to take them on another journey.)`
				`	(Leave them here and hope for the best.)`
					decline
			
			`	"Well Joe," you say, "do you want me to bring you to <planet>? It's not too far out of my way."`
			`	Despite his shock and grief, Joe is quite grateful. "You know we can't pay you, right?"`
			`	"Don't worry about it," you say. You return to your ship and tell the bad news to Maria.`
				accept
	on complete
		event "smuggler's den: payment" 365
		conversation
			`	You help Joe and Maria, and their daughter Jesse, to carry their few belongings down to the immigration desk, where a clerk lists the job openings available and asks them each to fill out a skill survey. Maria says, "Captain <last>, I don't know how to thank you, but I promise you that once we've got steady jobs, we'll save up and pay you our fare for transporting us here."`
			`	You wish them the best of luck, and return to your ship.`

event "smuggler's den: payment"



mission "Smuggler's Den: Payment"
	landing
	source
		government "Republic" "Free Worlds" "Syndicate" "Quarg" "Neutral"
	to offer
		has "event: smuggler's den: payment"
	
	on offer
		payment 35000
		conversation
			`When you land, you are surprised to find a message waiting for you from Joe and Maria, the young couple you transported from Smuggler's Den to Millrace a year ago to help them and their baby escape their lives as pirate crew members. "Dear Captain <last>," they write, "we promised you we would save up enough money to pay you back for transporting us. Attached is <payment>. Thank you for giving us a chance at a new life." They've also enclosed a picture of themselves and their baby Jesse, who is now more than a year old.`
				decline



mission "Smuggler's Den: Follow Up"
	landing
	source Millrace
	to offer
		has "Smuggler's Den: Payment: offered"
	
	on offer
		conversation
			`As you're coming in for a landing, you realize that Millrace is where Joe and Maria live, the couple you transported from Smuggler's Den. They recently wrote to you thanking you for helping them to begin a new life. Do you want to stop by and see how they are doing?`
			choice
				`	(Yes.)`
				`	(No.)`
					decline
			`	You contact Joe and Maria and they say they would definitely enjoy seeing you. On your way to the workers' barracks where they live, you stop by a small store buy some chocolate, plus bread and fresh fruit and some canned goods you think they would be able to use. They are both very glad to see you. Jesse is continuing to grow up, and they have another baby too, now. Joe says the work in the factories is exhausting, and the hours are long, but they never need to worry about where their next meal will come from, or what they'll be required to do to earn it. You leave feeling very glad that you have been able to make such a difference in someone's life.`
				decline



mission "Expedition to Hope 1"
	name "Expedition to Hope"
	description "Transport a team of scientists to the abandoned world of <planet>, where they will be placing some meteorological equipment."
	minor
	source
		near Wei 2 8
		attributes "dirt belt"
	destination Hope
	to offer
		random < 40
	cargo "scientific equipment" 4
	passengers 4
	
	on offer
		conversation
			`A group of scientists approaches you and asks if you would be willing to take them to the abandoned planet of Hope, and then back home from there. "The transport we'd arranged for bailed out on us at the last moment," says their leader, a middle-aged man wearing thick-rimmed glasses.`
			choice
				`	"Sure, I'd be glad to help."`
					goto yes
				`	"What sort of research are you doing?"`
				`	"Sorry, I don't have space for you."`
					decline
			`	"You probably know about the supervolcano that forced the evacuation of Hope two decades ago," he says. "My family lived on Hope back then. We want to measure how much ash is still in the air, to see how long it will be before the glaciers recede and the planet is habitable again."`
			choice
				`	"That sounds like a worthy cause. I'd be glad to transport you."`
					goto yes
				`	"Sorry, I'm not going to be headed in that direction any time soon."`
					decline
			label yes
			`	"Thank you," he says. You help them to load their meteorological equipment onto your ship.`
				accept
	
	on complete
		payment 40000



mission "Expedition to Hope 2"
	landing
	name "Expedition to Hope"
	description "Transport the team of scientists home to <destination>."
	source
		Hope
	destination
		distance 2 5
	to offer
		has "Expedition to Hope 1: done"
	passengers 4
	
	on offer
		conversation
			`You fly around the planet to several different sites that the scientists have identified as good places for their equipment. They also make some deep radar scans of the glaciers. "That's my old house, down there," says one of the scientists, pointing to the radar picture of one of the buried villages. "Under thirty meters of ice, now."`
			`	The lead scientist hands you forty thousand credits, and says, "Here's the first part of your payment. Now we need to get home to <planet>. I'll pay you the rest once we get there."`
				accept
	
	on complete
		payment 40000
		dialog `You drop the team of scientists off on <planet>. They thank you for helping them out, and pay you <payment>.`



mission "Transport Workers A"
	name "Transport Family"
	description "Transport this family to <destination>, where they hope that steady work will be more easy to come by."
	minor
	source
		attributes "dirt belt"
	destination
		government "Syndicate"
		attributes "factory"
	to offer
		random < 5
	passengers 4
	cargo "household goods" 2
	
	on offer
		dialog `In one of the corners of the spaceport, you meet a family with two kids, and a pile of trunks and boxes spread out next to them. They tell you that they are trying to book passage to <planet>. "Work has gotten way too hard to come by here," explains the father. "I've had seven different jobs in the past year, and none of them lasted more than a month. So we thought we'd try our luck on a Syndicate world."`
	
	on complete
		payment
		payment 20000
		dialog `You drop off the family from <origin>, and wish them the best of luck on <planet>. They seem optimistic, and their kids are still quite excited about having taken their first ever space journey. You're sure that they will be remembering this trip for years to come. Their parents thank you, and pay you <payment>.`



mission "Transport Workers B"
	name "Transport Worker"
	description `This young man is headed to the factories on <destination>. He says he wants to save enough money to be able to ask his "true love" to marry him.`
	minor
	source
		attributes "dirt belt"
	destination
		government "Syndicate"
		attributes "factory"
	to offer
		random < 5
	passengers 1
	
	on offer
		conversation
			`As you are walking through the spaceport, a young man approaches you and says, "Excuse me, Captain. Is there any chance you're traveling towards the Core?" He's probably in his late teens, barely more than a kid.`
			choice
				`	"I'm sure I could work that into my plans. Where are you headed?"`
				`	"You're traveling all by yourself? You aren't in any trouble, I hope?"`
				`	"Sorry, I don't expect to be headed that way any time soon."`
					decline
			`	"Well, here's the story," he says. "My girlfriend's father won't let us get married until I have some money saved up. They say there's plenty of jobs to be had on <planet>. So I'm headed there to put down roots and get myself established, then in a year or two she can come and join me."`
			choice
				`	"I'd be glad to take you there."`
					goto thanks
				`	"Are you sure about that? I've heard some bad things about the Syndicate's company towns."`
					goto towns
				`	"Do you really think she's going to wait around for you?"`
					goto wait
			label towns
			`	"Me too," he says, "but it's a lifetime of steady work, and you know how hard that is to come by in this part of the galaxy. Can you help me out?"`
				goto choice
			label wait
			`	"She'll be true to me," he says, with absolute confidence.`
				goto choice
			label choice
			choice
				`	"Okay, I'll take you to <planet>."`
					goto thanks
				`	"Sorry, I'm not headed in that direction."`
					decline
			label thanks
			`	"Thank you, Captain," he says, shaking your hand. You bring him aboard your ship and show him to one of the empty bunks.`
				accept
	
	on complete
		payment
		payment 10000
		dialog `You drop off the young man from <origin> who is hoping to find work and save enough money for his girlfriend to join him. "Good luck," you say. "Be wise. Don't let yourself get into debt." He thanks you, and pays you <payment>.`



mission "Transport Workers C"
	name "Farming Family"
	description "Transport this family of farmers, and their livestock, to <destination>."
	minor
	source
		attributes "dirt belt"
		attributes "farming"
	destination
		government "Syndicate"
		attributes "farming"
	to offer
		random < 15
	passengers 5
	cargo "farm animals" 10
	
	on offer
		conversation
			`On the dirt near your landing pad is parked a large wagon, hitched to a draft horse and loaded down with furniture and various farming implements. A family is gathered in the shade of the cart, and several goats and sheep are tied up behind it. Do you approach them and find out where they are headed?`
			choice
				`	(Yes.)`
				`	(No, I'm not interested in carrying livestock in my shiny new space ship.)`
					defer
			`	The farmers introduce themselves as Cory and Annette Patterson; their kids are Erin, Kyle, and Sarah. "Any chance you've got space for some livestock?" asks Jim. "The droughts the last few years have been fierce, and we're hoping to start a new homestead on <planet>."`
			choice
				`	"Sure, I'd be glad to take you there."`
					accept
				`	"Sorry, that's way too far from here."`
					decline
	
	on complete
		payment
		payment 10000
		dialog `You drop off the Pattersons, the farm family from <origin>, and help them to unload their wagon and cattle from your cargo hold. They thank you, and Jim pays you <payment>.`



mission "WR Star 1"
	name "Star Research"
	description "Fly through the Ildaria system with this team of scientists, then return them to <destination>."
	minor
	source
		attributes deep
		attributes urban research
	waypoint Ildaria
	to offer
		random < 20
	passengers 3
	cargo "sensors" 2
	
	on offer
		dialog `A group of scientists approaches you and asks if you will be headed to the Rim any time soon. "We're doing research on Wolf-Rayet stars," they explain, "and we're hoping to find a captain who can do a fly-by of Ildaria." Scientific research in the Deep is notoriously well-funded, so they will probably pay you quite well.`
	
	on complete
		payment 250000
		dialog `The team of scientists thanks you for bringing them to Ildaria and back, and pays you <payment>. They seem eager to get back to their lab and start analyzing their measurements.`



mission "Deep Archaeology 1"
	name "Deep Archaeology"
	description "Drop this archaeologist off on <destination>, before making a trip to Midgard in the Deep to collect some samples."
	source
		attributes paradise north "near earth"
		near Miaplacidus 1 20
	destination Vinci
	to offer
		random < 15
		"combat rating" > 15
	passengers 1
	
	on offer
		conversation
			`As you are walking through the spaceport, a man in an expensive suit approaches you. "Pardon me, Captain," he says. "I wonder if you would be willing to talk privately about a very lucrative job opportunity."`
			choice
				`	"Is this something illegal?"`
				`	"Sure, let's return to my ship and talk there."`
					goto ship
			`	"Not illegal," he says, "but it could help to uncover a secret with enormous ramifications. A secret that certain people do not want known."`
			`	"Okay," you say, "let's return to my ship, and I'll hear you out."`
			label ship
			`	You lead him back to your ship. "I'm an archaeologist," he explains, "studying the early history of the space era. And in particular, a set of persistent folk tales about contact with alien species. Many of these tales have to do with the region of the galaxy we call the Deep. I need someone to travel to Midgard and retrieve some samples from an ancient site there."`
			choice
				`	"Why can't you travel there yourself?"`
				`	"What sort of samples? Will this get me in trouble?"`
					goto samples
			`	"Well, let's just say I've made myself somewhat unpopular in the Deep," he says. "Asking too many questions. If I were seen walking around on Midgard, they would probably ask me to leave immediately."`
			`	You say, "And, is the work you're asking me to do going to make me equally unpopular?"`
			label samples
			`	"Not if you are circumspect," he says. "I need two samples from a certain village. One is simple: wood from a living or recently deceased tree. Any tree will do."`
			`	He pauses for a minute, then continues. "The other is more... sensitive. There is a historical site on Midgard, an ancient church. Not something they publish in the official tourist guides, mind you. I need a small sample of the wood that the church is built with. A small splinter would suffice."`
			choice
				`	"Sure, if it's in the interest of science, I can do that."`
					goto yes
				`	"You're asking me to vandalize a historical site?"`
			`	"I need only the tiniest of samples," he says, "maybe a splinter of wood that is already peeling off, or from a place where the wood is worn and cracked. And what we discover from that sample could be of immense importance."`
			choice
				`	"Sorry, that sounds a bit too shady to me."`
					decline
				`	"Okay, I'm willing to do that."`
			label yes
			`	"Thank you," he says. "Trust me, this could give us some very important information. I'll need you to drop me off on Vinci first, to meet with some scientists. We can then meet up back on Vinci once you have the samples."`
				accept



mission "Deep Archaeology 2"
	landing
	name "Deep Archaeology"
	description "Travel to <destination>, and take wood fiber samples from an ancient church and from the trees that grow nearby."
	source Vinci
	destination Midgard
	to offer
		has "Deep Archaeology 1: done"
	
	on offer
		conversation
			`	You drop off the archaeologist (who still has not told you his name) on <origin>. "Remember," he says, "I only need a tiny splinter. Just make sure it really is from the building and not anything more recent."`
				accept



mission "Deep Archaeology 3"
	landing
	name "Deep Archaeology"
	description "Return to <destination>, with the wood samples that you retrieved from the church on <origin>."
	source Midgard
	destination Vinci
	to offer
		has "Deep Archaeology 2: done"
	
	on offer
		conversation
			`	Following the map that the archaeologist gave you, you make your way to a small village in the mountains on <origin>, with two envelopes in your pocket for samples. As you approach the church, you break a dead twig off one of the trees along the path, put it into the first envelope, and pocket it. One sample collected, one more to go.`
			`	The church itself is unlike any building you have seen before, clearly very ancient, build of roughly hewn wood, old and weathered. Surprisingly, the front doors are open, and you hear music coming from inside.`
			choice
				`	(Walk into the church.)`
					goto inside
				`	(Take a sample from the outside.)`
				`	(Give up on this mission and leave, before I get into trouble.)`
					decline
			`	You walk around the outside of the building until you find one corner where the wood has been recently scuffed, and a few hairs of it are hanging loose. You carefully pick the splinters off and put them in the second envelope. Then, you return to your ship. Although you see no one following you, you can't shake the feeling that you are being watched.`
				accept
			label inside
			`	This church must still be used for services: candles are lit up front, and a man in a white surplice is playing the organ. A few people sit in the pews with their heads bowed. Trying to be as unobtrusive as possible, you join them, and look around at the ornately carved pillars and wood panels. The air in here smells of incense and musty wood.`
			choice
				`	(Take a sample.)`
				`	(Give up on this mission, and leave.)`
					decline
			`	Pretending to pray, you kneel on the ground, take your pocket knife, and shave the tiniest sliver off the bottom corner of the pew in front of you. It leaves a small white scar in the dark weathered wood of the pew. You pocket the sample, wait a few more minutes, and then leave and walk back to the spaceport. Although you see no one following you, you cannot shake the feeling that you are being watched.`
				accept
	
	npc
		personality waiting
		government Republic
		ship "Raven (Afterburner)" "D.P.S. Wyrd"
	
	npc
		personality waiting
		system Aspidiske
		government Republic
		ship "Raven (Afterburner)" "D.P.S. Skuld"
	
	npc
		personality waiting
		system Gomeisa
		government Republic
		ship "Raven (Afterburner)" "D.P.S. Verthandi"
	
	on complete
		payment 200000
		conversation
			`You return to the lab where you dropped off the anonymous archaeologist. Soon after you arrive, he appears and eagerly collects the two samples, giving you a payment of <payment> for your troubles. "But please," he says, "stick around long enough to learn the results." He hands the two envelopes to a lab technologist, and says, "Here you go, John, Take a look and let us know what you find."`
			`	After the lab tech leaves, he explains, "You see, the ratio of Carbon 12 to Carbon 14 varies from world to world, so accurate dating can only be done if you have a control sample to compare against. Only a handful of archaeological studies have been done in the Deep, and those were sloppy - they used the standard tables of Earth's carbon ratios instead of determining the local concentrations."`
			choice
				`	(Wait and see what the results are.)`
			`	About thirty minutes later, John reappears, looking somewhat shaken. "Where did you get those samples?" he asks.`
			`	"Never mind that," says the archaeologist. "What are your results?"`
			`	"The second sample is infused with some sort of oil or tar," he says. "A varnish. And therefore it is from furniture or a building. A man-made artifact. The control sample has an isotopic ratio different from Earth, so unless you're playing games with me, these samples are not from Earth."`
			`	"Go on," says the archaeologist.`
			`	"However," says the lab tech, "again assuming the two samples are from the same planet, the second sample is between fifteen hundred and twenty-five hundred years old. Which means it predates the discovery of the hyperdrive by, at minimum, five centuries. So again I ask you, where did you get these samples?" His voice is raised.`
			`	"Intriguing, isn't it?" says the archaeologist. "Captain <last>, if you'd like to help us get to the bottom of this, make sure you've got space for us and some equipment, and meet us in the spaceport."`



mission "Deep Archaeology 4"
	name "Deep Archaeology"
	description "Return to <destination>, with some specialized equipment for subterranean mapping."
	source Vinci
	destination Midgard
	to offer
		has "Deep Archaeology 3: done"
	cargo "mapping equipment" 4
	passengers 2
	
	on offer
		conversation
			`You find John the lab tech in one of the spaceport bars, along with the archaeologist, who says, "I suppose I should introduce myself. Albert Foster. You may have heard of me." Indeed, you have: he made headlines about a decade ago by being driven out of Quarg space after trying unsuccessfully to collect an alloy sample from their ringworld.`
			`	"We've purchased some equipment for gravitational field mapping," he says, "in addition to a very sensitive radar array. We're hoping to map the area around the church, see if there are signs of any ancient settlements. Are you willing to help us?"`
			choice
				`	"Sure, I'd love to help solve this mystery."`
				`	"Sorry, I can't. I'm worried we're going to make people in the Deep angry."`
					decline
			`	"Excellent," says Albert. "We just need to do a flyover of <planet>, and see what our radar turns up."`
				accept



mission "Deep Archaeology 5"
	landing
	name "Deep Archaeology"
	description "Evade the ships that are chasing you and return to <destination>."
	source Midgard
	destination Vinci
	to offer
		has "Deep Archaeology 4: done"
	cargo "mapping equipment" 4
	passengers 2
	
	on offer
		conversation
			`You cruise high above the surface of <origin> as John calibrates his instruments. "Sorry it's taking so long," he says, "there's some sort of glitch in the gravitational sensors, messing up my measurements."`
			`	"What sort of glitch?" asks Albert.`
			`	"Just a sensor artifact," he says, "some sort of echo. No, wait..." He trails off and starts turning dials on the instrument, then turns very pale.`
			`	Albert looks over his shoulder at the monitor, but clearly doesn't understand what he's looking at. "What is it?" he asks.`
			`	"It's not a sensor glitch," says John. "It's an artificial singularity."`
			choice
				`	"Some sort of illegal research?"`
					goto illegal
				`	"A what?"`
					goto what
			label illegal
			`	"No, not illegal," says Albert. "No need to make laws against them, for the simple reason that no one knows how to make them. That's alien technology, very advanced."`
				goto attack
			label what
			`	"A miniature black hole," says John. "An alien power source. Far more sophisticated than anything human beings have ever created. That is, unless someone in the Deep has found a way to reverse engineer alien technology."`
			label attack
			`	Suddenly, a warning light flashes on your ship's radar. Three ships have taken off from the planet's surface and are headed straight towards you. "Let's get out of here," says Albert. "Head back to <planet>!"`
				launch
	
	npc
		personality heroic
		government Deep
		ship "Raven (Afterburner)" "D.P.S. Wyrd"
		ship "Raven (Afterburner)" "D.P.S. Skuld"
		ship "Raven (Afterburner)" "D.P.S. Verthandi"
	
	on complete
		payment 300000
		conversation
			`You breathe a sigh of relief as you land safely in the spaceport on <planet>. "Okay, what was that all about?" you ask.`
			`	I honestly don't know," says Albert. "I can tell you what I suspect, though. The history books don't actually say when the Deep was first settled. The first documented expedition to the Deep was in the 24th century, and they found several human colonies already established in the region, claiming to date back to the very dawn of space flight. But I think the first settlers were brought there long before that. Brought there on alien ships."`
			choice
				`	"For what purpose?"`
					goto purpose
				`	"What aliens? The Quarg?"`
					goto aliens
			label purpose
			`	"I'm not sure," he says. "But I first became interested in the Deep while researching the Alpha Wars. I'm sure you know the history, how humanity was nearly enslaved by psychopathic 'super' humans that we ourselves had created by dabbling in genetic engineering. At that time, the Deep made a sudden, improbable technological leap that allowed them to construct weapons and ships far more powerful than what the Alphas had, and the war against them was won."`
				goto end
			label aliens
			`	"There are popular folks tales in the Deep about 'elves,'" says Albert. "Thin, pale, graceful creatures, with blue blood."`
			`	John frowns. "Hemocyanic blood. Not the Quarg, then. Their lungs are odd, but their blood uses hemoglobin for oxygen transport, just like ours."`
			label end
			`	Albert continues, "What I think is that an unknown alien species has been involved in events in the Deep since the beginning, and is perhaps still involved there today. I think this is known to at least some of the Deep's inhabitants."`
			choice
				`	"So, what do we do now?"`
				`	"How can we find out more information?"`
			`	"Well," he says, "unfortunately, Captain, they're going to be watching you. I'll have to seek out someone else for the next stages of my research. But I will keep you notified if I discover anything further."`
			`	It is an unsatisfactory conclusion to your work, with so many questions unanswered. But to make up for that, Albert gives you <payment> as payment for your services. "You will hear from me again," he promises.`



mission "Drug Running 1"
	name "Drug Running"
	description "Bring a shipment of illegal drugs to <destination>. If you are caught with this cargo, you may be fined."
	minor
	repeat
	source
		attributes "near earth" "dirt belt" "north"
	destination
		attributes paradise
	cargo "illegal drugs" 5 2 .1
		illegal 40000
	to offer
		random < 10
		"said no to drugs" < 4
	
	on offer
		dialog `As you are walking through the spaceport, a man pulls you aside and asks if you would like to help transport some "recreational pharmaceuticals" to <planet>. (This sounds like an illegal mission, so you'll need to avoid getting scanned or landing on planets with high security.)`
	
	on accept
		"said no to drugs" --
	on decline
		"said no to drugs" ++
	
	on complete
		payment
		payment 80000
		dialog `Some disreputable-looking locals unload the illegal drugs from your cargo bay, and hand you your payment of <payment>.`



mission "Drug Running 2"
	name "Drug Running"
	description "Bring a shipment of illegal drugs to <destination>. If you are caught with this cargo, you may be fined."
	minor
	repeat
	source
		attributes "near earth" "dirt belt" "north"
	destination
		attributes rich
	cargo "illegal drugs" 5 2 .1
		illegal 50000
	to offer
		random < 10
		has "Drug Running 1: done"
	
	on offer
		dialog `When you walk into the local bar, a man sitting in the corner waves you over and says in a hushed voice, "Captain, we've got a shipment of the good stuff that needs to get to <planet>. I promise you this will be a very lucrative operation. What do you say?"`
	
	on complete
		payment
		payment 100000
		dialog `Immediately after you land, some workers show up to unload the "stuff." They give you <payment>.`



mission "Drug Running 3"
	name "Drug Running"
	description "Bring a shipment of illegal drugs to <destination>. If you are caught with this cargo, you may be fined."
	minor
	repeat
	source
		attributes "near earth" "dirt belt" "north"
	destination
		attributes urban
	cargo "illegal drugs" 5 2 .1
		illegal 70000
	to offer
		random < 10
		has "Drug Running 2: done"
	
	on offer
		dialog `A well-dressed woman approaches you as you are walking through the spaceport and asks quietly if you would be willing to help facilitate the transport of some "naughty substances" to a certain individual on <planet>.`
	
	on complete
		payment
		payment 120000
		dialog `You hand off the illegal "substances" to your contact on <planet>, who pays you <payment>.`



government "Bad Trip"
	swizzle 0
	"player reputation" -1000

effect "puff"
	sprite "effect/puff"
		"no repeat"
		"frame rate" 10
	"lifetime" 20
	"random angle" 360
	"velocity scale" -.005

outfit "Imaginary Weapon"
	category "Missiles"
	"gun ports" -1
	weapon
		sprite "projectile/rainbow"
			"frame rate" 12
			"random start frame"
		"hit effect" "puff"
		"die effect" "puff"
		"inaccuracy" 20
		"velocity" 12
		"lifetime" 60
		"reload" 10
		"acceleration" 1.2
		"drag" .1
		"turn" 3
		"homing" 4

ship "Hallucination"
	sprite "ship/hallucination"
		"frame rate" 1
		"random start frame"
	"never disabled"
	attributes
		"hull" 1000
		"mass" 180
		"drag" 2.1
		"heat dissipation" .7
		"fuel capacity" 100000
		"jump fuel" 100
		"jump speed" 1
		"jump drive" 1
		"thrust" 30
		"turn" 500
		"energy generation" 1
	outfits
		"Imaginary Weapon" 1
	gun 0 0

mission "Hallucination"
	invisible
	landing
	to offer
		has "Drug Running 2: active"
		random < 50
	
	on offer
		conversation
			`During your brief stop on <origin>, it occurs to you that it really is a shame to have a cargo hold full of the finest of illegal drugs, and not to take even a small sample for yourself. There is no way the loss of a tiny bit of drugs could be noticed. Give it a try?`
			choice
				`	(No, I never touch that stuff.)`
					defer
				`	(Sure, sounds like fun!)`
			`	The room begins to spin, and strange things happen...`
				launch
	
	npc kill
		government "Bad Trip"
		personality nemesis heroic
		ship "Hallucination" "Love"
		ship "Hallucination" "Peace"
		ship "Hallucination" "Happy"
		ship "Hallucination" "Shiny"



mission "Rescue Miners 1"
	description "Participate in the medical evacuation of some miners injured in a recent accident on <planet>."
	name "Rescue Miners"
	minor
	source
		attributes core
		attributes urban
	destination
		attributes core
		attributes mining
	passengers 15
	cargo "emergency supplies" 15
	to offer
		random < 60
	
	on offer
		dialog `You've just sat down in the spaceport bar and ordered a drink when someone in uniform runs into the room and shouts, "There's been a mine explosion on <planet>! We need all available ships to carry relief workers and supplies and to evacuate the injured to a world where there are better medical facilities." Do you volunteer?`



mission "Rescue Miners 2"
	landing
	description "Participate in the medical evacuation of some miners injured in a recent accident on <planet>."
	name "Rescue Miners"
	minor
	destination
		attributes core
		attributes urban
		distance 2 10
	passengers 15
	to offer
		has "Rescue Miners 1: done"
	
	on offer
		dialog `You drop off the medical personnel on <origin>. There are nearly a hundred injured miners waiting for medical evacuation to <planet>. Do you volunteer to carry some of them?`
	
	on complete
		payment 80000
		dialog `You drop off the injured miners at one of the medical facilities on <planet> that has agreed to care for the survivors. It's a somewhat chaotic process, but eventually someone thanks you for your help and pays you <payment>.`



mission "Courier 1"
	name "Rush delivery to <planet>"
	repeat
	deadline
	description "Deliver <cargo> to <destination> by <date>. Payment is <payment>."
	minor
	cargo random 5 2 .1
	to offer
		random < 5
	source
		government "Republic" "Free Worlds" "Syndicate" "Quarg" "Neutral"
	destination
		distance 4 10
		government "Republic" "Free Worlds" "Syndicate" "Quarg" "Neutral"
	on offer
		dialog `As you are walking through the spaceport, a man approaches you and says, "Excuse me, Captain. I took on a rush delivery to <planet>, but my ship needs repairs and there's no way I can make it there before <day>. Can you take this job for me?"`
	on complete
		payment
		payment 30000
		dialog "You drop off your cargo of <commodity> and collect your payment of <payment>."



mission "Courier 2"
	name "Package to <planet>"
	repeat
	deadline
	description "Deliver a package to <destination> by <date>. Payment is <payment>."
	minor
	cargo package 2
	to offer
		random < 5
	source
		government "Republic" "Free Worlds" "Syndicate" "Quarg" "Neutral"
	destination
		distance 7 14
		government "Republic" "Free Worlds" "Syndicate" "Quarg" "Neutral"
	on offer
		dialog `A woman in the spaceport flags you down and asks, "Excuse me, Captain. I have small package that needs to get to <planet> by <day>. Can you carry it for me?"`
	on complete
		payment
		payment 50000
		dialog "You drop off the package and collect your payment of <payment>."



mission "Courier 3"
	name "Papers to <planet>"
	deadline
	description "Deliver some legal papers to <destination> by <date>. Payment is <payment>."
	minor
	cargo "legal papers" 1
	to offer
		random < 5
	source
		government "Republic" "Free Worlds" "Syndicate" "Quarg" "Neutral"
	destination
		distance 7 14
		government "Republic" "Free Worlds" "Syndicate" "Quarg" "Neutral"
	on offer
		dialog `A woman in a suit walks up to you and says, "Pardon me, Captain. I represent a recently deceased client here on <origin> whose legal papers need to be delivered to his next of kin on <destination>. Would you be willing to do some courier work? The papers must be delivered by <day>."`
	on complete
		payment 100000
		dialog "You drop off the legal papers and collect your payment of <payment>."



mission "Courier 4"
	name "Lizard to <planet>"
	deadline
	description "Deliver an exotic pet to <destination> by <date>. Payment is <payment>."
	minor
	cargo "exotic lizard" 3
	to offer
		random < 5
	source
		government "Republic" "Free Worlds" "Syndicate" "Quarg" "Neutral"
	destination
		distance 7 14
		government "Republic" "Free Worlds" "Syndicate" "Quarg" "Neutral"
		attributes rich
	on offer
		conversation
			`A man wearing a very complicated hat waves to you from the other side of a landing pad. "Yoo-hoo, Captain!" he says. "I have a courier mission for you if you're interested."`
			choice
				`	(Find out what he wants.)`
				`	(Ignore him.)`
					decline
			`	"My name is Alphonse," he says. "I am a breeder of exotic lizards. A new client on <planet> has just ordered one, and will pay you quite handsomely to transport it. Naturally, being a live animal, it's a rush delivery; it needs to be done by <day>. What do you say?"`
			choice
				`	"I'd be glad to."`
				`	"Sorry, I'm not interested in that sort of work."`
					decline
			`	"Excellent!" he says. "Come, let me introduce you to your cargo." He leads you to a supply shed where an enormous lizard, taller than you and probably weighing several tons, is being held in a cage that looks far too flimsy for it. "I'll have my men load her aboard your ship at once," says the man, "along with some meat for her to eat on the journey. Watch out for your fingers when you feed her, by the way. Thank you!"`
				accept
	
	on complete
		payment
		payment 100000
		dialog `Somehow, you have managed to bring the large lizard to <planet> without it breaking loose and eating you. You unload it and wait for its new owner to come. When he does, he pays you <payment>.`



mission "Migrant Workers 1"
	name "Migrant Workers"
	description "Bring this group of migrant workers to <planet>."
	minor
	source
		attributes "dirt belt"
		attributes "farming"
	destination Rand
	to offer
		random < 5
	
	on offer
		conversation
			`In the spaceport, you can't help but notice a group of six or seven men in ragged farm clothing, sitting by the edge of one of the launch pads. They are probably migrant workers looking for a lift.`
			choice
				`	(Approach them.)`
				`	(Ignore them.)`
					defer
			`	You strike up a conversation with the workers. They say that they are tired of the seasonal fluctuations of farm work, and are looking for something a bit steadier and better paying. "We hear there's always work to be had in the mines on <planet>," they say. "Can you take us there?"`
			choice
				`	"Sure!"`
					accept
				`	"No, sorry, I'm not headed in that direction."`
					decline
	
	on complete
		payment
		payment 20000
		dialog `The migrant workers thank you for transporting them, and hand you <payment>. You hope that they will be able to find better work here than they had on <origin>.`



mission "Humanitarian 1"
	name "Vaccine to <planet>"
	description "Bring a shipment of flu vaccines to the lawless world of <planet>. Be sure the medicine gets into the right hands."
	minor
	cargo "vaccine" 20
	to offer
		random < 5
		"combat rating" > 0
	source
		government "Republic" "Free Worlds" "Syndicate" "Quarg" "Neutral"
	destination
		government "Pirate"
		distance 2 10
	clearance
	
	on offer
		conversation
			`While you are sitting at a table in a local cafe, a woman sits down across from you and says, "Pardon me, Captain. I wonder if you would be interested in helping with a humanitarian mission."`
			choice
				`	"Tell me more."`
				`	"Sorry, I'm too busy."`
					decline
			`	"There's a flu epidemic on <planet>," she says. "It's a lawless world, so they have not been able to find any merchants willing to bring them medicine. But if they don't get a shipment of vaccine soon, the epidemic could become much worse, and even spread to other worlds."`
			choice
				`	"I'd be glad to help."`
				`	"Sorry, I don't believe in helping pirates."`
					decline
			`	"Thank you," she says. "Your contact on <planet> will be a man named 'Raven Hunter.' Don't let anyone but him trick you into giving them the supplies."`
				accept
	
	on complete
		payment
		payment 50000
		dialog
			 `After several shady characters have offered to buy the vaccines off you, or threatened to rob you, "Raven Hunter" finally shows up and collects them. He thanks you, and pays you <payment>.`



mission "Humanitarian 2"
	name "Food to <planet>"
	description "Bring a shipment of food to the lawless world of <planet>, to help alleviate a famine."
	minor
	cargo "emergency rations" 50
	to offer
		random < 5
		"combat rating" > 0
	source
		government "Republic" "Free Worlds" "Syndicate" "Quarg" "Neutral"
	destination
		government "Pirate"
		distance 2 10
	clearance
	
	on offer
		conversation
			`As you are walking through the local market, a man says, "Captain, do you have room in your hold to bring food to a starving planet?"`
			choice
				`	"Yes, but I hadn't heard news of a famine recently."`
				`	"Sorry, not today."`
					decline
			`	"No, this one wouldn't be in the news," he says. "It's <planet>, a lawless world. They're desperately in need of food, although it's mostly due to corruption and mismanagement of resources."`
			choice
				`	"Well, it sounds like they're getting exactly what they deserve. And, I have no intention of risking my life to land on a pirate world."`
					decline
				`	"Well, even so, no one deserves to starve to death. I'll help them."`
					accept
	
	on complete
		payment
		payment 50000
		dialog
			 `It takes a while to figure out who exactly is in charge here. You sell off parts of your shipment of food to a few different local leaders, receiving <payment> in exchange.`



mission "Terraforming 1"
	name "Terraforming Rand"
	description "Bring a delegation from Rand to the Academy of Planetary Sciences on Glory."
	source Rand
	destination Glory
	passengers 2
	
	on offer
		conversation
			`	You stop in to the spaceport bar for a drink. The bar seems to be frequented mostly by the managers of the mining corporation; you suspect the workers don't earn enough to visit a bar very frequently. In one corner, two of the managers are having a very animated discussion. When they see you, they say, "Hello there, Captain! Interested in taking us on a business trip?"`
			choice
				`	"What sort of trip?"`
				`	"Sorry, I'm just in here for the drinks."`
					defer
			`	"To Glory, to the Academy of Planetary Sciences," he says. "This world is rich in resources, and we're thinking that if we could only cool down the deserts a bit and get more plants to grow here, it would be a decent place to live. We've been dreaming about this for years, and I think it's time to go pay a terraforming consultant to tell us whether it's actually possible or not."`
			choice
				`	"Sure, I'd be glad to take you there."`
					accept
				`	"Sorry, that's way too far away for me to travel right now."`
					decline



mission "Terraforming 2"
	landing
	name "Terraforming Rand"
	description "Return to Rand with a student who thinks she can terraform the planet cheaply."
	source Glory
	destination Rand
	passengers 2
	to offer
		has "Terraforming 1: done"
	
	on offer
		conversation
			`You drop off the two managers from Rand, whose names are Eric and Alaric, at the Academy. While you wait for their meeting to end, you look around the lobby. The students have apparently just had some sort of science symposium, and poster boards are on display all along the walls. One of them catches your eye: the title is "Affordable Terraforming through Equilibrium Mapping."`
			`	The basic concept of the poster seems to be that instead of altering the climate of a planet through brute force, it ought to instead be feasible to use a properly timed nudge in the right direction to cause the climate to shift toward a new equilibrium point that supports greater biological complexity. This student seems to think that planets naturally "want" to grow more complex and support more life, but that they sometimes get "stuck" in less optimum states.`
			`	It's an intriguing idea. On the other hand, at the bottom of the paper, the professor has written, "Very poor scholarship. Do not anthropomorphize planets."`
			`	Just then, Eric and Alaric return, looking disappointed.`
			choice
				`	"No luck?"`
			`	They shake their heads. "It would cost fifteen million just to bring a specialist out for an initial consultation," says Eric, "and besides, the cost of terraforming machinery and upkeep is prohibitive. I think this whole Academy is just a money-making racket."`
			choice
				`	"Have a look at this poster. Maybe this student would help us. We could bill it as a sort of internship for her."`
				`	"Indeed. They gave this student a failing grade just for suggesting it could be done more cheaply."`
			
			`	They look at the poster. "Sounds almost too good to be true," says Alaric. "Hang on, I'll look her up in the campus directory." A few minutes later, he is on the phone with the student who made the poster. Her name is Amy. It turns out she is about to flunk out anyway, and is more than willing to travel back to Rand with you when offered a tiny fraction of what the consultant would have received.`
			`	An hour later, you meet up with Amy, and arrange for her to join you on your ship before it takes off. Eric and Alaric are very excited, but you are a bit worried about the wisdom of entrusting their planet's future to someone so young and inexperienced.`
				accept
	
	on complete
		payment 140000
		dialog `On the entire return journey, Eric and Alaric have been busy showing Amy geological survey maps of Rand and asking her for ideas. The moment you land, they hurry out of the ship. "I'm going to show Amy around," says Eric, "but meet us in the spaceport bar later if you want to help out with whatever we do next." Alaric hands you <payment> as payment for your services, and then follows after them.`



mission "Terraforming 3"
	name "Terraforming Rand"
	description "Plant a thruster on an asteroid to guide it into a collision with the northern pole of Rand."
	source Rand
	to offer
		has "Terraforming 2: done"
	
	on offer
		conversation
			`Alaric, Eric, and Amy are having a heated conversation at a table in the bar. When they see you, Alaric says, "Okay, let's let Captain <last> be the tie breaker." He motions to you to join them.`
			`	Amy explains, "Based on my data, it appears that Rand once had a cooler, more moist climate. But the trouble is, it has almost no axial tilt."`
			`	"That means no changing seasons," explains Eric.`
			`	"The result is that much of the planet is very hot, but the poles are very cold. Nearly all the planet's water has migrated to the poles and ended up frozen into the ice caps. Because the weather is so unchanging here, nothing ever prompts that water to melt and rejoin the hydrological cycle."`
			choice
				`	"Well, that seems impossible to fix. It's not like you can rotate a planet's axis."`
					goto rotate
				`	"Are you suggesting melting the ice caps somehow?"`
					goto melting
			label rotate
			`	"Of course not," she says. But what we can do is introduce a sudden variation in the planet's climate that will allow water to be distributed more evenly across the surface again."`
				goto danger
			label melting
			`	"That would be the traditional terraforming approach," she says, "using orbital mirrors, or geothermal power, or something similar to evaporate the ice caps at a faster rate than new ice is being deposited. That approach would take a century or so."`
				goto danger
			label danger
			`	"This is where Amy's plan gets a bit scary," says Alaric.`
			`	"I'm proposing crashing a medium-sized asteroid into the ice cap," she says. "If we pick the right asteroid, we can control the amount of dust that is created. The result will be a sudden influx of variability, that may allow the planet to revert to a wetter, more biodiverse state."`
			choice
				`	"That is a stupid idea, and I want nothing to do with it."`
					decline
				`	"Well, if you think it will work, I'm willing to try it!"`
			`	"Great!" says Amy. "I'll mark the asteroid on your radar. You just need to board it, install a small ion thruster, and wait for it to land on the planet, then return here."`
				accept
	
	npc assist
		government Derelict
		personality derelict fleeing uninterested waiting pacifist
		ship Asteroid
			name "Target Asteroid"
			sprite "asteroid/medium rock/spin"
				"frame rate" 10
			attributes
				"hull" 10000
				"mass" 1000
				"drag" 10
				"heat dissipation" .1
				"required crew" 0
				"bunks" 0
				"thrust" 10
				"turn" 100
				"thrusting energy" 1
				"turning energy" 1
				"energy generation" 3
			explode "small explosion" 25
			explode "medium explosion" 35
			explode "big explosion" 45
			explode "huge explosion" 30
	
	on complete
		payment 20000
		dialog
			`When you land, the sky already seems noticeably darker than before. Eric runs up to your ship. "You did it!" he says, excited. "A perfect hit. Now we just have to wait and see what the results are. Meet us in the spaceport bar again in a few hours, and Amy will have her initial measurements ready." He hands you a credit chip for <payment>.`



mission "Terraforming 4"
	name "Terraforming Rand"
	description "Collect some hardy plants that can grow in a low-light environment from <destination>."
	source Rand
	destination "New Portland"
	to offer
		has "Terraforming 3: done"
	passengers 1
	
	on offer
		conversation
			`By the time you meet up with Eric, Alaric, and Amy, the cloud cover already seems to have visibly increased. Amy is very enthusiastic. "Atmospheric water vapor is on the rise," she says. "The impact vaporized enough ice to form a small ocean. I wouldn't be surprised if we get a rainstorm here in a day or two."`
			`	"What's next?" you ask.`
			`	She says, "I'd like to travel with you to <planet>, and collect some seeds and cuttings from plants that can handle a cooler world with dimmer light, since that's what we'll have here until the dust settles down. I'd say we'll need about ten tons of cargo space."`
			choice
				`	"I'd be glad to take you there."`
					accept
				`	"Sorry, I need to move on to some other work now."`
					decline
	
	on complete
		dialog `As soon as you land, Amy heads off to meet with some local biologists who she contacted during the trip over here. "We'll be back in the spaceport in two hours," she says. "Be sure to have ten tons of cargo space free."`



mission "Terraforming 5"
	name "Terraforming Rand"
	description "Bring some hardy plants that can grow in a low-light environment back to <destination>."
	source "New Portland"
	destination Rand
	to offer
		has "Terraforming 4: done"
	passengers 1
	cargo "seeds and plants" 10
	
	on offer
		conversation
			`You meet up with Amy, and load the seeds and plant cuttings onto your ship.`
			choice
				`	"Looks good, let's head back to Rand."`
					accept
				`	"So, how do you plan to seed the whole planet with these, anyway?"`
			`	She says, "My idea is to just disperse them in a few different locations, and trust that they will spread out over the next decade or so. We picked plants that are hardy and can spread very rapidly."`
			choice
				`	"Sounds good to me."`
					accept
				`	"What happens if the plants are too invasive, and choke out all the local wildlife?"`
			`	"Well," she says, "in order to keep the climate on <planet> dynamic, they're going to need regular asteroid impacts every few decades. If these plants are too invasive, they can just wait an extra decade or so in between impacts and let the desert creep back in and kill off the invasive plants."`
			choice
				`	"Okay, I guess that would work."`
					accept
				`	"Wait, they're going to have to keep smashing asteroids into their world in perpetuity to maintain the new environment?"`
			`	"For a century or so, yes," she says. "But that's a whole lot more economical than vaporizing the ice caps using traditional terraforming equipment. Come on, let's get back to <planet>."`
				accept
	
	on complete
		payment 60000
		conversation
			`When you get back to <planet>, Amy has you fly in a random path a few kilometers above the surface while she periodically dumps loads of seeds and plant material out the airlock. In the process, you fly through several rainstorms. This world's climate has indeed been altered. But you can't help wonder how a few tons of seed spread out over the entire surface of a planet is really going to help anything.`
			`	Then you meet up with Eric and Alaric. Eric is elated. "We just got a massive rainstorm here!" he says. "We haven't had that much precipitation in a decade!"`
			`	Alaric is less enthusiastic. "Flash floods washed out the road through the canyon," he says, "and very nearly flooded one of the mines, too."`
			`	Amy says, "It will take a year or two for things to begin to settle down. Then we can figure out what our next steps should be."`
			`	"I just hope we haven't made things worse than they were," says Alaric. He hands you your payment of <payment>. "Anyway, thanks for your help, <first>. It sounds like there's nothing more to be done here for the time being."`
		event "terraforming Rand"
