# 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.
#
# You should have received a copy of the GNU General Public License along with
# this program. If not, see <https://www.gnu.org/licenses/>.

mission "Intro [0]"
	name "Passenger to <planet>"
	description "This old-timer captain offered to ride along with you to <destination>, and to give you some tips along the way."
	landing
	passengers 1
	source "New Boston"
	destination "New Greenland"
	
	on offer
		log "Finally scraped together enough money for a down payment on a starship. The interest on the mortgage is exorbitant."
		log "Factions" "Republic" `Hundreds of years ago, the independent territories in different parts of human space agreed to join together into a single democratic government, with Earth as its capital. The rise of the Republic ushered in a long period of peace and prosperity in human history.`
			`Representation in the Republic Parliament is based on population. That means that some individual "Paradise Worlds" have more representatives than entire regions of space like the Dirt Belt that are more sparsely settled.`
		log "Factions" "Syndicate" `The Syndicate is a megacorporation, the largest employer in human space. People who cannot find steady work elsewhere flock to the Syndicate factory worlds, where they are almost guaranteed to find a job. Although the Syndicate is technically part of the Republic, Syndicate worlds are governed directly by the corporation.`
			`The Syndicate is a central part of the Republic's economy, but they are also well known for selling shoddy products and for doing damage to the environment on the worlds they control. Their treatment of workers is questionable, and their opposition to organized labor is legendary. Some Syndicate factory towns have even been accused of human rights abuses.`
		log "Factions" "Pirates" `In poorer and more remote star systems, where the Navy seldom patrols, pirate attacks on merchant ships are frequent. Pirates are also known to attack large, unguarded convoys of freighters even in more populated areas. Most pirate fleets come from lawless worlds on the outskirts of human space.`
		conversation
			`With some trepidation, you give the shipyard owner your money and take your new ship for a test drive, piloting it out of the shipyard and onto a spare landing pad by the spaceport. Then you get out and look the ship over a bit more closely. You are busy polishing out a few rust spots with a piece of steel wool when an old man in grease-stained coveralls walks up.`
			`	"Nothing quite like buying your very first starship," he says.`
			choice
				`	"Yeah, I'm still kind of in shock over how much money I spent."`
					goto money
				`	"Well, I don't plan to get too attached to this one. I'll be flying something much nicer before long."`
					goto bigger
				`	"Beat it, old-timer, I've got more important things to do than chat with you."`
					decline
			label money
			`	He grins. "I know the feeling. It's a crime how much interest the banks charge to first-timers. It's been that way ever since when I first started out."`
				goto captain
			label bigger
			`	He smiles. "I'm sure you will. But there's something nice to having a ship you can pilot all by yourself. Believe me, once you have to start managing crew and paying salaries, or keeping track of a whole fleet, you'll miss these days when everything was simple."`
				goto captain
			label captain
			`	"You're a captain?" you ask.`
			`	"Was," he says. "Sold off my fleet a few days ago, and I already miss it. But it was time. Time for me to retire." His voice trails off, then his face lights up. "Say, any chance I could hitch a ride with you, maybe show you the ropes, give you some pointers? I could pay you, of course."`
			choice
				`	"Sure, where are you trying to get to?"`
				`	"Sorry, I'd rather figure things out on my own."`
					decline
			`	"Well," he says, "I've got a spot reserved in a retirement home, but I don't mind taking a roundabout way to get there. For starters, how about you give me a lift to <planet>? It's just one jump away from here; I can mark it on your map."`
			choice
				`	"Sounds good!"`
					goto end
				`	"How much will you pay me?"`
			`	"That's kind of a rude question," he says, "but I'll pay you ten thousand credits. I guarantee you that's more than any captain ever gets for carrying one passenger for one day."`
			choice
				`	"That's really generous. Thank you."`
					goto end
				`	"You're treating me like a charity case? No thanks, I'll earn my money legitimately."`
					decline
			label end
			`	"Great," he says. "My name is James, by the way."`
			`	"<first> <last>," you say.`
			branch MZ
				has "name: Michael Zahniser"
			`	"I'm looking forward to traveling with you, Captain <last>," says James.`
				goto advice
			label MZ
			`	"<first> <last>?" he stops for a moment. "I've heard that name before. Reminds me of someone famous, I think," says James. "Anyways, I'm looking forward to traveling with you."`
			label advice
			`	As you're helping him wheel his luggage aboard and showing him his bunk, he says, "Before we take off, you might head on over to the trading center and stock up on medical goods; we can sell those for a good profit on <planet>. Also make sure to visit the local outfitter. While they don't sell much here compared to on the big manufacturing worlds, every world with an outfitter will at least carry a map with information on the neighboring systems. Buying them can help if you're not quite sure where you're going."`
				accept
	
	on accept
		log "Getting some basic instructions on making a living as a merchant from an old captain named James."
	
	on complete
		payment 10000
		conversation
			`As you land on <planet>, James says, "Congrats on your first trip through hyperspace! I'm impressed that you didn't throw up; most folks do, the first time."`
			`	"Including you?" you ask.`
			`	"Yeah, and then spent half an hour in orbit cleaning my cabin while hoping the passengers wouldn't come out of their bunk room and see the mess. Not my proudest moment. Anyway, here's your pay." He hands you <payment>.`
			`	Then he adds, "If you're okay with giving me a lift for a while longer, sell off any of that cargo you bought and then meet me in the spaceport. I'll see if I can rustle up any interesting work for you to do."`
			``
			`	(Click the "Spaceport" button to continue this mission.)`



mission "Intro [1 Transport]"
	priority
	name "Transport family to <planet>"
	description "Bring your new friend James, along with this large family, to <destination>. Payment will be <payment>."
	blocked `When you meet up with James in the spaceport, he says, "Hi there, <first>! I found you another mission, but it looks like you'll need <capacity> in order to take it on. So, you'll either have to cancel another mission, or come back here later to continue this one. Sorry!"`
	source "New Greenland"
	destination "New China"
	passengers 5
	to offer
		has "Intro [0]: done"
		or
			has "ships: Transport"
			has "ships: Space Liner"
		not "Intro [1 Freighter]: offered"
		not "Intro [1 Interceptor]: offered"
	
	on offer
		conversation
			`You begin strolling through the spaceport, walking briskly in order to keep warm and wondering if it might be worth investing in a good winter coat for visiting planets like this one. Eventually you find James. He has an entire family in tow: a young couple, an elderly woman, and four children who range in age from probably about three or four up to twelve or thirteen.`
			`	"Captain <last>!" he says. "Wonderful to see you again. I was just talking to this family. They've been having trouble finding a single ship that can give them all passage, but I told them that your shuttlecraft has plenty of bunks, at least if the kids double up. They can pay you <payment> to take them to <planet>, which is just a few jumps away from Earth, and is a planet well worth visiting in its own right. What do you say?"`
			`	You're absolutely sure that your shuttle was not designed to fit nine people including yourself, but if they're willing to squeeze into the available five bunks you've got no reason to discourage them.`
			choice
				`	"Sure, welcome aboard!"`
				`	"Sorry, I think I'd rather go off in my own direction from here."`
					decline
			`	James helps the older woman up the steps and into your ship while the younger family members carry the luggage. You are going to have quite a full ship for the next few days.`
				accept
	
	on complete
		payment 40000
		conversation
			`Along the journey, you learned that the family you are transporting are named the Hendersons, and that they are moving to <planet> mostly because they hope the urban setting will be better for their kids than <origin>, where there were hardly any children at all and their village had only a few thousand people in it. The grandmother, Olivia, has also been chattering nonstop about how excited she is about being on a world where she can actually go sunbathing: "I've gotten much too old for snowshoeing," she says.`
			`	You say goodbye to them and wish them well, and as agreed they pay you <payment>. You are already well on your way towards paying down your mortgage!`
			`	As James leaves the ship, he says, "Again, if you're okay with continuing to give me a ride, just meet me in the spaceport."`
			``
			`	(As before, click the "Spaceport" button to continue this mission.)`



mission "Intro [2 Transport]"
	priority
	name "Tourists to <planet>"
	description "These tourists will pay you <payment> to take them to <destination>. Your new friend James will also be tagging along for the ride."
	blocked `When you meet up with James in the spaceport, he says, "Hi there, <first>! I found you another mission, but it looks like you'll need <capacity> in order to take it on. So, you'll either have to cancel another mission, or come back here later to continue this one. Sorry!"`
	passengers 3
	source "New China"
	destination "Earth"
	to offer
		has "Intro [1 Transport]: done"
	
	on offer
		conversation
			`It doesn't take you long to find James in the <origin> spaceport. He's already got a small group of people with him: a middle-aged couple, and a teenage boy. "Hi there, Captain <last>!" says James. "Interested in carrying some tourists to <planet>?"`
			choice
				`	"Sure!"`
				`	"No thanks, I think I'll strike off on my own now."`
					decline
			`	"Great," he says. "This is Chuck, and Sarah, and their son Carl. Let's help them carry their luggage to your ship." As you begin walking back, slightly ahead of them, James whispers to you, "Tourists are always a good way to make money. They're on vacation, so they don't mind paying a bit extra. But no point in your cargo space going to waste, so take a look at the job board and see if there are any delivery missions we can run at the same time. And if you want to be a little safer should we come across any pirates, sell off any offensive weapons you might have. It might seem counterintuitive, but being unarmed makes you less of a target to pirates if there are others in the system that they could be defending themselves against."`
				accept
	
	on complete
		payment 15000
		conversation
			`As you make the final landing descent to the surface of Earth, Chuck and Sarah stare out the window in rapt attention, pointing out landmarks on the planet's surface. James joins in by telling you all about some of the history of the cities you are flying over. Carl, meanwhile, has spent the entire journey playing a handheld video game, and only glances out the window when the ship shakes from turbulence. As they all grab their luggage and step off your ship to explore humanity's homeworld, he is still immersed in the game.`
			`	As you collect your payment, James pulls the parents aside and says, "Watch out for pickpockets, okay? And take it from an experienced captain, you do not want to be out after dark here. Play it safe, and have a great time."`
			`	After they leave, James shakes his head ruefully. "It'll probably be a decade before that kid is old enough to realize what he's missing out on. Waste of money, doing a trip like this with a teenage boy. They should've gone to Skymoot and seen the dragons instead; I'm sure that would interest him a lot more than historical museums and ancient cities." Then, he picks up his luggage and adds, "Same deal as before. If you want to keep traveling together, meet me in the spaceport."`



mission "Intro [3 Transport]"
	priority
	name "Bring James to <planet>"
	description "Bring James to <destination>, where he has a spot reserved in a retirement home."
	blocked `When you meet up with James in the spaceport, he says, "Hi there, <first>! I found you another mission, but it looks like you'll need <capacity> in order to take it on. So, you'll either have to cancel another mission, or come back here later to continue this one. Sorry!"`
	passengers 1
	source "Earth"
	destination "Hestia"
	to offer
		has "Intro [2 Transport]: done"
	
	on offer
		conversation
			`The spaceport on <origin> is so big and crowded that it takes a long time to find James. The sheer number of people here is almost overwhelming. Homeless men wrapped in old army blankets beg money from well-dressed businessmen. Soldiers in Navy uniforms walk by in groups of ten or twenty, all marching in unison. Starship captains haggle with merchants over trade goods and jobs. Flashes of light come from various landing bays as welders make repairs.`
			`	When you find James, he's standing by a window, looking out at the city, watching the starships taking off and landing in a continuous stream. "This is it," he says, "where our race began. The world that all the tourists want to visit, and that no one wants to live on. Twenty billion people, more industry and exports than any other place in the galaxy. But underneath it all, poverty of a completely different sort from what you've got in the Dirt Belt."`
			`	After taking one last glance out the window, he says, "Anyway, we're nearing my destination. Are you willing to take me on one last trip? I need to get to <destination>, and of course I'll pay you quite well to take me there."`
			choice
				`	"Of course."`
				`	"Sorry, but I was planning on heading out in a different direction from here."`
					decline
			`	Once again you walk back to your ship with James. Once you get there, as he's stowing his luggage, you pull up the information your computer has on <planet>. It's one of the "Paradise Worlds," terraformed to have a perfect climate, accessible only to the very wealthy. You wonder whether James is going to be able to fit in there.`
				accept
	
	on complete
		payment 30000
		log "Dropped James off on Hestia after running a few missions with him. Met a few spoiled tourists and got to visit Earth along the way."
		conversation "end of intro missions"



mission "Intro [1 Freighter]"
	priority
	name "Delivery to <planet>"
	description "Travel with your new friend James to <destination>, and deliver <cargo>."
	blocked `When you meet up with James in the spaceport, he says, "Hi there, <first>! I found you another mission, but it looks like you'll need <capacity> in order to take it on. So, you'll either have to cancel another mission, or come back here later to continue this one. Sorry!"`
	cargo vaccines 48
	passengers 1
	source "New Greenland"
	destination "Heartland"
	to offer
		has "Intro [0]: done"
		or
			has "ships: Light Freighter"
			has "ships: Heavy Freighter"
			has "ships: Utility"
		not "Intro [1 Transport]: offered"
		not "Intro [1 Interceptor]: offered"
	
	on offer
		conversation
			`The spaceport on <origin> is small enough that it doesn't take long to find James. He's talking with a man wearing what looks like a doctor's lab coat. "Captain <last>!" says James. "Glad you could join us. It turns out there's been a flu outbreak on <planet>, and they're asking every captain with space to spare to carry some vaccines and other medical supplies over there. Are you willing to help out?"`
			choice
				`	"Sure, anything I can do to assist them!"`
				`	"Sorry, I've heard bad things about that region of space. I think I'm going to head in the other direction."`
					decline
			`	"Great!" says James. "They'll be loading up your ship shortly."`
				accept
	
	on complete
		payment 30000
		conversation
			`You drop off the shipment of <commodity> on <planet>, and collect your payment of <payment>. "Hauling freight," says James. "Not the most glamorous job, or the most interesting, but you're always guaranteed steady income. And once you know the galaxy a bit better, instead of taking missions you can find your own trade routes to follow. The only trouble is, build up a fleet with lots of cargo space and not enough defenses and the pirates begin to take notice."`
			choice
				`	"Did you have a lot of trouble with pirates when you were a captain?"`
					goto pirates
				`	"But what if I want to earn money more quickly than I can by trading?"`
					goto quick
			label pirates
			`	"Some. That's why you can't just go traipsing around the galaxy in a fleet of unarmed star barges; every pirate within a week's travel will hear you're coming through and come after you. In the long term, having a few heavy freighters with good defenses is more cost-effective than losing a star barge or two to the pirates on every journey."`
				goto port
			label quick
			`	"There's no quick road to riches, kid. The more something pays, the riskier it is. If you need to make lots of money in a hurry, bounty hunting is the way to go, but nine out of ten pilots who give bounty hunting a try end up dead. And, no one's going to give you those sorts of missions until you've proved yourself in combat, anyway."`
				goto port
			label port
			`	He picks up his suitcase. "If you want to run another mission with me, look for me in the spaceport. I'll see if I can find you something with a bit higher profit margin this time."`
			``
			`	(As before, click the "Spaceport" button to continue this mission.)`



mission "Intro [2 Freighter]"
	priority
	name "Rush delivery to <planet>"
	description "This shipment of <commodity> needs to get to <destination>, by <date>."
	blocked `When you meet up with James in the spaceport, he says, "Hi there, <first>! I found you another mission, but it looks like you'll need <capacity> in order to take it on. So, you'll either have to cancel another mission, or come back here later to continue this one. Sorry!"`
	cargo "raw eel" 34
	passengers 1
	source "Heartland"
	destination "Ingot"
	deadline
	to offer
		has "Intro [1 Freighter]: done"
	
	on offer
		conversation
			`As you walk through the spaceport, James sees you from a distance and waves you over. As you approach, the smell of raw fish overwhelms you. "I've found another job for you," he says.`
			choice
				`	"Is it by any chance an unusually smelly job?"`
				`	"Sorry, I think I'll head off on my own now."`
					decline
			`	"It is indeed," he says, "but a lucrative one. <cargo> needs to get to <planet> while it's still fresh, and that means it needs to be there no later than <day>. If we take a direct route, there should be no trouble making the delivery on time. What do you say?"`
			choice
				`	"Sounds good. Let's do it!"`
				`	"Sorry, no way am I loading up my shiny new starship with smelly fish."`
					decline
			`	"Great!" he says. "I mentioned this earlier, but you might want to stop by the outfitter and buy a local map. Hyperspace routes aren't always logical, and the last thing you want to do is get lost and end up with a pile of rotten fish that no one wants filling up your cargo hold."`
				accept
	
	on complete
		payment 35000
		conversation
			`By now, your entire ship smells like brine and raw fish, but as best you can tell the fish is still fresh enough to eat. The dock workers on <planet> offload it without comment, and give you your payment of <payment>.`
			`	"If you can line them up right," says James, "rush deliveries can be your best source of income as a freighter captain. And keep your eye out for missions with large amounts of cargo, too, because your barge's hold is definitely big enough to handle them. And if you've got any cargo space to spare and you know what the prices are going to be at your destination, be sure to stock up on something you can sell for a profit."`
			choice
				`	"What would you recommend if I want to do more than just carry cargo?"`
					goto more
				`	"Was that what you did for your whole career?"`
					goto career
			label more
			`	He pauses for a moment to think, then says, "Unless you want to do something really risky like hunting pirates, your best bet is to work with the Navy, or the Syndicate, or one of the local militias. Any of those would be a decent choice, although they've each got their own problems. If any of them offer you a mission, go ahead and take it; that's a good way to build connections and get to know the lay of the land."`
				goto end
			label career
			`	"Well," he says, "Back when I was a bit older than you, I piloted a Firebird for a while, escorting merchant convoys up and down the Rim. I used to hope we'd get attacked; I'd disable the pirate ships and rob them blind. Turnabout is fair play, after all.`
			`	"Then one day I got a bit too greedy and thought I'd try to capture a pirate ship or two, to add more firepower to my fleet. We boarded their ship, and I sent my crew through the airlock to kill off the pirates. And it turns out the pirates had grenades. Four of my men were dead before I even realized what was happening. We had to retreat, and then limp back to port without even enough crew left uninjured to pilot the ship right. After that I decided to stick to less risky jobs."`
				goto end
			label end
			`	He glances toward the spaceport and says, "Anyway, if you want to make one more trip with me, you know where to find me."`



mission "Intro [3 Freighter]"
	priority
	name "Bring James to <planet>"
	description "Drop James off on <destination>, where he has a spot reserved in a retirement home."
	blocked `When you meet up with James in the spaceport, he says, "Hi there, <first>! I found you another mission, but it looks like you'll need <capacity> in order to take it on. So, you'll either have to cancel another mission, or come back here later to continue this one. Sorry!"`
	passengers 1
	source "Ingot"
	destination "Hestia"
	to offer
		has "Intro [2 Freighter]: done"
	
	on offer
		conversation
			`You find James talking with a group of miners, who seem to be old acquaintances of his. As you approach, he says, "Well guys, here comes my ride. I should probably say goodbye." They head back off to do their work. "Every time I land here," says James, "I'm amazed that this station hasn't been wiped out yet by a meteorite. Can you imagine spending your life here?"`
			choice
				`	"It does seem awfully isolated. But some people might enjoy the solitude."`
				`	"Well, if you need the money, at least it's a steady job."`
			`	"I suppose," he says. "Anyway, I think it's time for the last leg of my journey. Do you think you can give me a lift to <planet>? I'll pay you quite well for your services, of course."`
			choice
				`	"Sure, I can take you there."`
				`	"Sorry, I was thinking of heading in a different direction from here."`
					decline
			`	Once again you walk back to your ship with James. Once you get there, as he's stowing his luggage, you pull up the information your computer has on <planet>. It's one of the "Paradise Worlds," terraformed to have a perfect climate, accessible only to the very wealthy. You wonder whether James is going to be able to fit in there.`
				accept
	
	on complete
		payment 30000
		log "Dropped James off on Hestia after running a few missions with him. Ship still smells like fish."
		conversation "end of intro missions"



mission "Intro [1 Interceptor]"
	priority
	name "Escort convoy to <planet>"
	description "Escort a merchant convoy to <destination>, along with your new friend James."
	blocked `When you meet up with James in the spaceport, he says, "Hi there, <first>! I found you another mission, but it looks like you'll need <capacity> in order to take it on. So, you'll either have to cancel another mission, or come back here later to continue this one. Sorry!"`
	passengers 1
	source "New Greenland"
	destination "Gemstone"
	to offer
		has "Intro [0]: done"
		or
			has "ships: Interceptor"
			has "ships: Drone"
			has "ships: Fighter"
			has "ships: Light Warship"
			has "ships: Medium Warship"
			has "ships: Heavy Warship"
			has "ships: Superheavy"
		not "Intro [1 Transport]: offered"
		not "Intro [1 Freighter]: offered"
	npc save
		government Merchant
		personality timid escort
		ship "Freighter" "Horn of Plenty"
		ship "Freighter" "Morning Light"
	npc
		government Pirate
		personality entering plunders
		ship "Sparrow" "Bloodletter"
		ship "Fury" "Hand of Fate"
	
	on offer
		conversation
			`You find James standing on a landing pad underneath a large freighter, chatting with a man you assume is the captain. "There you are!" he says. "Captain Eldred here says his two ships have been having trouble with pirates ever since they left the Rim ten days ago, and he's looking for an escort to get them safely to Gemstone. Are you interested?"`
			choice
				`	"Of course!"`
				`	"No, sounds a bit too risky for me."`
					decline
			`	"Great," he says. "Whenever we're ready to leave the planet, they'll take off behind us and follow us to <planet>." As you begin walking away together, he adds in a quieter voice, "Normally a fresh pilot like you with no combat reputation would never be offered a mission like this, so try not to mess things up. Remember that we don't have to kill the pirates, all we have to do is make sure the convoy isn't destroyed. But freighters are slow, so you can't just go skipping through hyperspace as fast as you want; you need to stick around and make sure they're behind you."`
				accept
	
	on complete
		payment 30000
		conversation
			`The captain of the Horn of Plenty hands you <payment> and thanks you for your escort services. From the expression on his face, you'd guess that he's feeling lucky to still be alive after entrusting the safety of his fleet to a rookie pilot like yourself.`
			`	After he is gone, James turns to you and says, "Not too bad for your first escort mission. I recognize that look on your face - it's the same one I had after my first job like this back when I was a beginner. If I recall, my first priority after touching down was replacing some of the ship's guns with missile launchers so I'd actually have a chance against pirates. It's a scandal how they sell interceptors with nothing but short-ranged energy weapons these days; trying to use them in combat on such a small ship is practically suicide. Keep your distance with some missiles and you can almost never go wrong. Anyway, I'll stop rambling. If you've still got a hankering for some dangerous missions, come and find me in the spaceport before you leave." He picks up his suitcase and heads outside.`
			``
			`	(As before, click the "Spaceport" button to continue this mission. The next mission will involve carrying cargo, so it will only show up if you have all 15 tons of space free.)`



mission "Intro [2 Interceptor]"
	priority
	name "Delivery to <planet>"
	description "Deliver <commodity> to <destination>, while avoiding pirate attacks."
	blocked `When you meet up with James in the spaceport, he says, "Hi there, <first>! I found you another mission, but it looks like you'll need <capacity> in order to take it on. So, you'll either have to cancel another mission, or come back here later to continue this one. Sorry!"`
	passengers 1
	cargo gemstones 15
	source "Gemstone"
	destination "Ingot"
	to offer
		has "Intro [1 Interceptor]: done"
	npc
		government Pirate
		personality entering plunders
		ship "Bastion" "Hammer of Thor"
	
	on offer
		conversation
			`You find James in the spaceport bar, talking with a woman wearing a business suit. The expression on James' face is growing increasingly concerned as she speaks. Seeing you come in, he waves to you and you join them at the table.`
			`	"Hello <first>," says James. "This is Marissa, a senior manager at the mines." You shake hands with her.`
			`	"Here's the deal," says Marissa. "Most of the gemstones we mine here are industrial grade, not pretty enough to be worth using as anything but sandpaper grit or drill bits. But every once in a while we happen on some higher quality gems. No one in this sector has the money to spend on jewelry, so we ship them north to the Paradise Worlds.`
			`	"But in the past few months, every shipment we've sent has been attacked by a pirate ship, the Hammer of Thor. We don't have the money to pay a bounty hunter to take out the Hammer, so instead we're going to pay you to outrun it. Is the <ship> a fast ship?"`
			choice
				`	"As fast as they come. Nothing bigger than a fighter could chase it down."`
				`	"Not fast enough. I don't think I can risk taking on this mission."`
					decline
			`	"Great," she says. "My people will load up your ship immediately. Good luck, Captain."`
			`	After she leaves, James says to you, "Now, get one thing clear. This is not your David and Goliath moment. The Hammer's shields are ten times as strong as yours, and if it's able to bring its weapons to bear, we'll be dead in two seconds. So, the moment we're in the sky, we head straight for hyperspace. Don't even wait around to see if the Hammer is coming or not. Got it?"`
			choice
				`	"Got it."`
					accept
				`	"I really shouldn't try to fight?"`
			`	"It just isn't feasible," he says. "If a ship has turrets, your Sparrow can't get close enough to hit it with your guns without being damaged, and then it's just a matter of whose weapons and shields are stronger. And one Heavy Rocket hit could nearly disable you. Also, if it has anti-missile turrets, you can't count on hanging back and bombarding it with missiles from long distances, or at least not with weapons that can fit in a Sparrow. So, don't risk it. It's like rock paper scissors; recognize what your enemy's strengths and weaknesses are, as well as your own."`
				accept
	
	on complete
		payment 40000
		conversation
			`As you land on Ingot, James says, "Well, you made it in one piece! Still think you want to be piloting an interceptor?"`
			choice
				`	"Sure, but I can't wait until I've got a ship big enough to stand up to pirates instead of running from them."`
				`	"Well, maybe I should've bought a freighter instead."`
			`	"Better start saving up then," he says. "I know a number of old Sparrow pilots who made their first million credits mining asteroids before they could afford a more combat-worthy ship. They had to look around for a while before finding a system with any asteroids worth mining, but it was worth it. Anyway, let's go get your payment." You walk out of the ship and sign the papers to hand off the <commodity> to the dock workers on <planet>. They hand you a credit chip worth <payment>.`
			`	"I've got an idea for something you might want to try," says James. "Meet me in the spaceport bar in a little while."`



mission "Intro [2.1 Interceptor]"
	priority
	name "Mine asteroids in <system>"
	description "Go to the <system> system and mine 5 tons of Silicon, then land on <planet>."
	blocked `When you meet up with James in the spaceport, he says, "Hi there, <first>! I think you'll find what I want to show you next very interesting, but you'll need to free up <capacity> first. So, you'll either have to cancel another mission, or come back here later to continue this one. Sorry!"`
	passengers 1
	source "Ingot"
	destination "New Sahara"
	to offer
		has "Intro [2 Interceptor]: done"
		not "Intro [3 Interceptor]: offered"
	
	on offer
		conversation
			`You find James waiting for you just outside the spaceport bar. Against the steady patter of micrometeorites against the roof he tells you, "Working here on <origin> is one of the few jobs in the galaxy more dangerous than fighting pirates. And worse, because if a big meteorite decides to strike this station, there's basically nothing the miners can do about it except hope they see it coming." He turns to you with a grin. "But nonetheless, I think you might be interested in this idea."`
			`	James leads you down the side of the bar to a booth where a man with a half-eaten hamburger and a plate of fries is sitting, busily examining a star map of the local sector. He notices your arrival and stands up to greet you. "<first>, this is Captain Marshall," James says as you shake his hand. "I told him about your new ship and how it'd be a good idea for you to get a taste of asteroid mining. He mines in this part of space and says there's a good system nearby if you're willing to give it a try."`
			choice
				`	"I'll give it a shot."`
					goto mining
				`	"I think I'm ready to head out on my own."`
					decline
	
			label "mining"
			`	"That's good to hear," Captain Marshall says with a smile. "But be warned that mining isn't as easy as one might think. Especially without an asteroid scanner, mining can be just as much a test of your piloting skills as combat.`
			`	"The first challenge," he continues, "will be finding which asteroids are valuable. The worthless asteroids are either brown and smooth or gray and spiky with no apparent orbit. It doesn't matter how long you shoot them, they won't be destroyed. Valuable asteroids will always orbit the star and have a range of colors and surface textures. If you're not sure which are which and you don't have an asteroid scanner to tell you, keep a look out for other miners to see what they're firing at.`
			`	"Generally speaking, the more valuable minerals are tougher to mine, either because they're harder to break apart, or they're less common and in more dangerous regions of the galaxy. Silicon breaks up quickly; you'll fill your hold in a hurry and the stuff is everywhere. Platinum or gold asteroids are more work; they're not as common in areas where the Navy watches your back, but you make several times the number of credits for the effort.`
			`	"I could go on, but I think you get the picture."`
			`	You and James chat with Marshall a while longer, and he suggests trying your hand at mining in <system>. "It's a great place. You could throw a dart in that system and half the time you'd hit an asteroid worth at least something, and I've never been bothered by pirates while I've been there."`
			`	"That does sound like a good place for a beginner pilot," James says. "How about we start small, <first>? Let's go mine at least five tons of silicon before landing on <planet> and we can call it a day."`
				accept
	
	on visit
		dialog `You've reached <destination>, but you don't have at least five tons of silicon in your cargo hold. Locate and mine silicon asteroids in this system before returning.`
	
	on complete
		require "Silicon" 5
		conversation
			`Once you've landed, you meet up with James and he asks you, "What did you think of mining?"`
			choice
				`	"I can't believe anyone would do that much work."`
				`	"I love flying like that."`
			`	James nods and says, "Chasing asteroids can be a challenge, but when you're starting off, mining can be a fast way to build cash for your next ship. It's also a great way to explore the galaxy. Jobs always follow the trade routes and settled areas. Mining makes it profitable to explore the nooks and crannies of the hyperlanes. If the place you end up landing has an economy, they'll buy the minerals in your hold. Mainly though, it's about how you like to spend your time. Some captains like managing a trading fleet while others like to strike out on their own.`
			`	"Mining can be complex compared to running jobs or trading commodities. I learned that first hand after pirates disabled my ship when I was starting out and I worked aboard a mining ship while it was being repaired. Now that was a while back so I might be a little rusty, but I could try at answering any other questions you might have about mining."`

			label choices
			choice
				`	"What equipment do I need to mine?"`
				`	"How do you deal with pirates?"`
					goto pirates
				`	"How can I check the value of minerals?"`
					goto value
				`	"I think I have enough information."`
					goto end

			`	"Well, you need a weapon that does hull damage," James says. "A Beam Laser will get the job done, but it will take a while. If you want to optimize your mining operations, however, you'll want a Mining Laser. Not only does it cut through asteroids faster, it's also more precise and preserves more minerals when the asteroid breaks apart. Some miners like to have a bit of combat flexibility by mining with Heavy Lasers, however.`
			`	"Aside from lasers, the most valuable tool is an asteroid scanner. They're expensive, but they connect into your navigation and targeting systems to point you towards minable asteroids. You can also set them to find the most valuable asteroids, which increases your profitability per run. After that, a tactical scanner will tell you how far away the asteroid is and show how much damage you're doing. An afterburner is good for chasing down fast moving asteroids or getting away from pirates without leaving the system. A ramscoop will let you refuel while mining, extend your exploration range, and allow you to be ready for a quick escape."`
			choice
				`	"I can't fit all that on my ship!"`
				`	"That all makes sense."`
					goto more

			`	James gives you a knowing smile as he answers, "Not in a factory build, you won't. But you'd be surprised how much space you can free up even in a Sparrow if you're willing to be flexible. Do you really need that much power? If you've got an outfitter on the planet where you're mining, do you need a hyperdrive, or even a shield generator? Maybe a cargo expansion would be of more use." He pauses briefly, perhaps considering what liability he's opened himself up for, then adds, "I'm not saying you should, of course, but you have options.`
				goto more

			label pirates
			`	"You can always bribe them to leave you alone. If the minerals are good enough and you have enough cargo capacity, you'll still turn a profit. Or if you have a fast ship, you can just run away. Of course, with enough of a fleet you just fight them off." He shakes his head. "Most pirates would be richer and live longer if they just mined instead of extorting merchants and plundering ships.`
				goto more
			
			label value
			`	"You will learn this by experience, but if the planet has an outfitter, you can check the price there before you sell.`

			label more
			`	"Anything else you want to ask me?"`
				goto choices
			
			label end
			`	"If you're willing to take me on one more journey," James says, "meet me in the spaceport bar in a little while. Don't forget to sell off your minerals at the trading post, or if there is one, the outfitter."`



mission "Intro [3 Interceptor]"
	priority
	name "Bring James to <planet>"
	description "Drop James off on <destination>, where he has a spot reserved in a retirement home."
	blocked `When you meet up with James in the spaceport, he says, "Hi there, <first>! I found you another mission, but it looks like you'll need <capacity> in order to take it on. So, you'll either have to cancel another mission, or come back here later to continue this one. Sorry!"`
	passengers 1
	source "New Sahara"
	destination "Hestia"
	to offer
		has "Intro [2.1 Interceptor]: done"
	
	on offer
		conversation
			`You find James sitting at the spaceport's tiny bar, sipping a beer while watching the large displays that show the landing pads and the irrigated fields beyond. The displays are supposed to make the underground building feel less claustrophobic.`
			`	"This is one of the least habitable planets in the galaxy. But if it doesn't kill us instantly, then someone's tried to settle it." He pauses for a moment while gazing at one of the displays. You spot a sandstorm picking up in the far distance as the workers in the fields hastily finish their work before it arrives.`
			`	"Care for a drink?" he asks.`
			choice
				`	"Sure."`
				`	"No thanks."`
					goto end
			`	He buys you a beer. It tastes a little stale, but it's not the worst beer you've ever had. You can't help but feel sorry for the people who work here, so isolated and cut off from even the basic amenities you took for granted on New Boston.`
			label end
			`	"Anyway," says James, "would you be willing to take me on one more journey? It's time for me to head for that retirement home."`
			choice
				`	"Of course."`
				`	"Sorry, I think I'll go hunt some pirates instead."`
					decline
			`	Once again you walk back to your ship with James. Once you get there, as he's stowing his luggage, you pull up the information your computer has on <planet>. It's one of the "Paradise Worlds," terraformed to have a perfect climate, accessible only to the very wealthy. You wonder whether James is going to be able to fit in there.`
				accept
	
	on complete
		payment 30000
		log "Dropped James off on Hestia after running a few missions with him. Escort duty is a risky business."
		conversation "end of intro missions"



conversation "end of intro missions"
	`	As you are piloting your ship down to land on <planet>, James disappears into his bunk room. After the ship has landed he comes out, no longer in the grease-stained coveralls he's been wearing up until now, but in a suit. As a lifelong textile worker, you automatically note that the suit is made of real wool, very finely woven, and that it has been tailored to fit him. He smooths down the front of the suit distractedly and then looks at his hands as if unsure of where to put them. "How do I look?" he asks.`
	choice
		`	"Like a millionaire."`
			goto millionaire
		`	"You look great."`
			goto great
	
	label millionaire
	`	"Well, that's the other thing about being a captain," he says. "You can get filthy rich."`
		goto next
	
	label great
	`	"Let's hope the locals think so," he says.`
		goto next
	
	label next
	`	There's an awkward pause. You're unsure of how to respond. Then he says, "Thing is, this here planet is one of the most exclusive retirement communities in the galaxy. Plenty of the locals are probably worth more than a billion credits. But they're mostly financial or business types, or old money. I'm rich enough to be here, but I just hope they're willing to socialize with someone who made his fortune flying a ship.`
	`	"Before you go, is there anything else you'd like to ask me about being a new pilot?"`
	label choices
	choice
		`	"Where should I go if I want to avoid pirates?"`
		`	"Have you ever met any aliens?"`
			goto aliens
		`	"Are there any good trade routes you can give me?"`
			goto trade
		`	"Where can I find well-paying jobs?"`
			goto jobs
		`	"I think I'll manage."`
			goto end
	`	"Stay near Sol and around the Paradise Worlds. The Navy stays there the most, so even if a pirate does show up, they won't last long. The Deep is also a pretty safe place, as they have their own security forces. Once you start moving farther south, things get riskier. The worlds down there don't bring in as much tax revenue as the Paradise Worlds do, so the Navy tends to ignore them. You'll find some local militia to back you up, but they're nothing compared to one of the Navy's Cruisers.`
		goto more
	
	label aliens
	`	"I've spoken with the Quarg a few times, but what captain hasn't? You'll find them down south by Tarazed. I haven't met any other aliens," he pauses for a moment, "as far as I'm aware, that is, but I'm sure they're out there if you go looking hard enough. I've explored all of Republic space in my many years, but there are far more systems out there that we don't even know how to reach.`
		goto more
	
	label trade
	`	"One of the most reliable trade routes is to bring food from the Dirt Belt to Earth or the other urban worlds around it. There are billions of mouths to feed on those worlds, and the Dirt Belt sells food for cheap, so it's a great place to get started. Just remember though that if you use the same trade route for too long, you might end up causing the prices to stabilize. The Dirt Belt can only produce food and people can only eat it so fast, so change up your trade routes if you notice the return getting worse.`
		goto more
	
	label jobs
	`	"Getting good jobs is more about having the space to accept the good jobs than it is finding them, but if you're looking for jobs that pay well for little effort, then you'll want to watch out around the holidays. There's always a big celebration on Earth every April 22nd, Earth Day, so pay attention to the job board in the months leading up to that. The people down in the Rim have some month-long celebration every August that you should look out for too.`
	
	label more
	`	"Anything else you want to ask me?"`
		goto choices
		
	label end
	`	He hands you a credit chip worth <payment>, and says, "Best of luck to you, Captain. Don't hesitate to look me up if you're ever in the area. And remember to check the spaceports wherever you land. You never know who you'll find wandering around there."`
