# Copyright (c) 2014 by Michael Zahniser
# Copyright (c) 2025 by Anarchist2
#
# 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/>.

conversation "intro mission"
	branch deep
		has "start: deep"
	branch paradise
		has "start: paradise"
	branch syndicate
		has "start: syndicate"
	
	`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 deep
	`With some trepidation, you hand one of the salespeople your money, and they give you the passcode to your starship, along with the number of the docking bay your ship is being transported to. By the time you arrive, your <model> is already there, beckoning you aboard. You spend a minute admiring your ship until a man walks up to you. You recognize him as the old man who rode the train with you, and you wave.`
	`	He waves back, turns to look at your ship and says, "Nothing quite like buying your first starship, is there?"`
	choice
		`	"Yeah, it's a real beauty."`
			goto beauty
		`	"I'm hoping to fly a much better ship, honestly."`
			goto bigger
		`	"Sorry, but I'd like to be left alone."`
			decline
	label beauty
	`	He grins. "And I'm sure you'll be modifying it for days on end to make it even more beautiful. God knows how long I spent tuning my own ships."`
		goto captain
	
	label paradise
	`With some trepidation, you hand over your money and take your new ship for a test drive, piloting it out of the shipyard and onto a spare landing pad in the spaceport. You disembark and spend a minute admiring your ship until an old man in grease-stained coveralls walks up to you.`
	`	"Nothing quite like buying your first starship," he says.`
	choice
		`	"I can't wait to explore the galaxy!"`
		`	"Just you wait; I'll be flying an entire fleet soon."`
			goto bigger
		`	"If I wanted to talk, I would have said something. Beat it."`
			decline
	`	He grins. "Well, don't be too hasty. The galaxy is a big and dangerous place, and not for the fainthearted. It'll be quite a while until you can make the universe your oyster. Took me decades."`
		goto captain
	
	label syndicate
	branch jackal
		has "Intro [0 Jackal]: offered"
		has "ship model: Jackal"
	`With a strange sense of relief, you give the salesman your money and jump into your new ship. The flight from the shipyard to the landing bays has you navigate through tunnels with only centimeters of clearance in all directions. After setting your ship down and disembarking, an old man in grease-stained coveralls approaches you.`
	`	"Nothing quite like buying your first starship," he says.`
	choice
		`	"I'm just glad to be free from working for someone else."`
		`	"And there's nothing quite like going six hundred thousand credits into debt."`
			goto money
		`	"If I wanted to talk with you, I'd have said something. Leave me alone."`
			decline
	`	He grins. "Well, I wouldn't be so sure yet. Often, the quickest way to fame and fortune is to curry favor with the big players. I always preferred to work by myself, though."`
		goto captain
	
	label jackal
	`Sure enough, you find your new Jackal waiting in one of the port's landing bays. You start to examine the <ship>, and your worst fears are realized. Of the ship's outfits, the only one to pass any safety tests is the battery; you'll have to completely replace everything else. As you rip out broken components and throw them in the nearest dumpster, an old man in grease-stained coveralls approaches you.`
	`	"Looks like you've landed yourself a real lemon, haven'tcha?" he says.`
	choice
		`	"Yep."`
		`	"Look, I'm having a really bad day today. Bother someone else."`
			decline
	`	"Well, there's no point crying over jettisoned cargo. Mind if I give you a hand?"`
	`	With the old man's help, you manage to clear out the Jackal before nightfall. "Haven't had to do this to a ship in a long time. Still, it's nice to have a blank slate when you're outfitting your fleet."`
	
	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?"`
		`	"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.`
	`	"I'm looking forward to traveling with you, Captain <last>," says James.`
		to display
			not "name: Michael Zahniser"
	`	"<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."`
		to display
			has "name: Michael Zahniser"
	
	`	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 <trade>; we can sell those for a good profit on <planet>.`
	`	"Also make sure to visit the local outfitter. <while>, 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


conversation "mission intro end"
	`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.)`



conversation "intro earth offer"
	`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 <they'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
	branch paradise
		has "start: paradise"
	`	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
	label paradise
	`	Once again you walk back to your ship with James. You've heard of <planet> before; one of the Paradise Worlds terraformed from a lifeless ice planet to the largest and most luxurious retirement home in the galaxy. As you look at his utilitarian outfit and modest luggage, something seems off about the idea of James living in such a place.`
		accept



conversation "freighter 1 end"
	`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?"`
		`	"But what if I want to earn money more quickly than I can by trading?"`
			goto quick
	`	"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."`
	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 higher profit margin this time."`
	``
	`	(As before, click the "Spaceport" button to continue this mission.)`



conversation "freighter 2 end"
	`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>.`
		to display
			or
				has "start: default"
				has "start: deep"
	`Your cargo has loomed silently in your hold for the last few days, but as far as you can tell, the samples are still safely contained. The dock workers on <planet> offload it without comment, and give you your payment of <payment>.`
		to display
			has "start: paradise"
	`Your cargo has loomed silently in your hold for the last few days, but the radiation alarms in your ship's hold haven't let out a squeak. The dock workers on <planet> offload it quickly onto several waiting trains, and give you your payment of <payment>.`
		to display
			has "start: syndicate"
	
	`	"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?"`
		`	"Did you do that for your whole career?"`
			goto career
	`	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."`
	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."`



conversation "intro ingot"
	`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
		`	"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



conversation "interceptor escort end"
	`The captain of the <npc> hands you <payment> and thanks you for your escort services. From the expression on <their> face, you'd guess that <they're> feeling lucky to still be alive after entrusting the safety of <their> fleet to a rookie pilot like yourself.`
	`	After <they are> 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.`
		to display
			has "start: default"
	`	"Anyway, I'll stop rambling." James pauses for a moment, then says, "I've got an idea for something you might want to try. Meet me in the spaceport bar in a little while."`
		to display
			has "start: deep"
	``
		to display
			or
				has "start: default"
				has "start: paradise"
				has "start: syndicate"
	`	(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 10 tons of space free.)`
		to display
			or
				has "start: default"
				has "start: syndicate"
	`	(The next mission will involve carrying a passenger, so it will only show up if you have all your bunks free.)`
		to display
			has "start: paradise"



conversation "interceptor evade intro"
	branch deep
		has "start: deep"
	branch paradise
		has "start: paradise"
	branch syndicate
		has "start: syndicate"
	`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."`
		goto leave
	
	label deep
	`You end up finding James in a bar talking to a woman in a military uniform. "Nice to see you, <first>," he says. "I've been talking to Lieutenant Engberg over here, and I think we have a job on our hands."`
	choice
		`	"What is it?"`
			goto job
		`	"You haven't drafted me into the Navy, have you?"`
		`	"Actually, I want to go out on my own now."`
			decline
	`	Engberg chuckles. "Firstly, I'm not part of the Navy, I'm with Deep Security. And secondly, not to disparage your abilities, but we only recruit experienced captains into our ranks."`
	label job
	`	James says, "Deep Security mainly acts as the Deep equivalent of the Navy, protecting merchants from pirates. However, they also deal with the transport of confidential documents and equipment, for both the private and government sector."`
	`	Engberg continues. "Recently, one of our logistics ships was attacked and damaged by a merchant warship named the Arm of Odin. We now believe that ship to be a pirate vessel in disguise, specifically targeting the cargo onboard. We're looking for a replacement ship capable of avoiding the threat while we track down the warlord. How fast would you say the <ship> is?"`
	choice
		`	"It'll outspeed anything short of a fighter."`
		`	"Not fast enough. You'll have to find someone else for the job."`
			decline
	`	"Good," she says. "We'll have the cargo loaded onto your ship by sundown."`
		goto leave

	label paradise
	`For a planet so close to the Paradise Worlds, <origin> could not be any more different. Where the Paradise Worlds have meticulously preplanned cities, <origin> was designed by immediate needs. Where the Paradise Worlds cover themselves with nature and sculptures, <origin> bares itself to the galaxy, indulging in concrete pillars and steel trusses. Where the Paradise Worlds believe themselves to be untouchable utopias, <origin> is hardly afraid to show the scars of battle, its turrets and Navy garrisons in full display.`
	`	You end up finding James in one of the cleaner bars, talking to a man in a Navy uniform. "Nice to see you, <first>," he says. "I've been talking to Lieutenant Armen over here, and I think we have a job on our hands."`
	choice
		`	"What is it?"`
			goto "job 2"
		`	"You haven't drafted me into the Navy, have you?"`
		`	"Actually, I want to go out on my own now."`
			decline
	`	Armen grins. "You would have a lot more to do if you were joining the Navy."`
	label "job 2"
	`	James says, "More than ever, the Republic Navy is struggling to hold off the threat of piracy. While they are able to keep the Paradise Worlds safe, on the edges of the known galaxy, pirates readily outnumber Navy forces. There are more ways to stop piracy than sheer force, however."`
	`	Armen continues. "Which is where you come in. Recently, we've come into contact with someone claiming to have information on pirate activity in the North. If they're telling the truth, their knowledge could open the way for preemptive strikes against the pirates, freeing ships to be deployed elsewhere. However, the informant's existence has leaked, and a hired ship named the Eye of Loki is trying to cover up this loose end. We're looking for a ship able to outspeed the Eye and bring the informant safely to Pearl; we can handle transport from there. How fast would you say the <ship> is?"`
	choice
		`	"It'll outspeed anything short of a fighter."`
		`	"Not fast enough. You'll have to find someone else for the job."`
			decline
	`	"Good," he says. "I'll have the informant on your ship by sundown."`
		goto leave

	label syndicate
	`You find James in the spaceport bar, talking with a man wearing a business suit. The expression on James' face is growing increasingly concerned as he speaks. Seeing you come in, he waves to you and you join them at the table.`
	`	"Hello <first>," says James. "This is Miguel, an independent mine owner on <origin>." Miguel smiles at you.`
	`	"Here's the deal," says Miguel. "Most of the mining companies on <origin> have ties to the Syndicate, whether that be through direct ownership or indirect influence. Not us, though; my company's been resistant to any attempts of a takeover. One of their controlling techniques is preventing us from shipping our minerals to refineries within the Syndicate. However, there's nothing stopping us from shipping materials elsewhere in the galaxy, like magnetic elements for Lovelace's particle accelerators."`
	`	"But in the past few months, every shipment we've sent has been attacked by a pirate ship, the Spear of Heimdall. I doubt Syndicated Security would be keen on helping a rival company, so instead we're going to pay you to outrun it. Can you do that for us?"`
	choice
		`	"If you're willing to pay, I'm willing to fly."`
		`	"I got into the starship business to get away from people like you. Count me out."`
			decline
	`	"Great," he says. "My people will load up your ship immediately. Good luck, Captain."`

	label leave
	`	After <person> leaves, James says to you, "Now, get one thing clear. This is not your David and Goliath moment. The <enemy>'s shields are <magnitude> 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 <enemy> 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 <model> 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. 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 <model>. 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



conversation "interceptor evade end"
	`As you land on <planet>, 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."`
		to display
			not "flagship model: Jackal"
	`	"I've got an idea for something you might want to try," says James. "Meet me in the spaceport bar in a little while. And make sure you have a weapon installed; you should be able to buy one in <planet>'s outfitter."`
		to display
			has "flagship model: Jackal"



conversation "mining intro"
	branch glory
		has "start: paradise"
	`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."`
		to display
			not "start: syndicate"
	`Similar to Delve, <origin>'s spaceport is embedded in solid rock, but that is where the similarities end. Where Delve's spaceport was utilitarian, Ada finds space to flex its wealth by turning the industrial elements of rock and metal into elegant architecture. The nightmarish take-off and landing angles one might expect from a spaceport set in a canyon wall are missing, replaced by spacious and well-marked flight paths. The smell of oil and steel pervasive in many Syndicate ports is suppressed by crisp air supplied by the local environmental control systems.`
		to display
			has "start: syndicate"
	`	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."`
		goto choice

	label glory
	`The world of <origin> is in full bloom; the fields that the spaceport overlooks are filled with flowers of every color of the rainbow, and a sweet smell rests in the air. You end up finding James in one of the spaceport's gardens, and he waves you over to a table with a woman who is finishing off a steak. On the far side of the table is a map covered in annotations. As you get closer, the woman notices your arrival, wipes her mouth, and offers her hand.`
	`	"<first>, this is Captain Hwang," James says as you shake her hand. "Rather than throwing you into the deep end of space combat, I figure you should try your hand at something a little safer. Hwang mines asteroids in this part of space and says there's a good system nearby if you're willing to give it a try."`

	label choice
	choice
		`	"Mining sounds interesting. I'll give it a shot."`
		`	"I think I'm ready to head out on my own."`
			decline
	`	"That's good to hear," Captain <captain> 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," <they> 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."`

	branch paradise
		has "start: paradise"
	branch syndicate
		has "start: syndicate"
	`	You and James chat with <captain> a while longer, and <they> 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. The easiest asteroids to get there are the silicon ones; you can spot them by their slightly-green tint."`
	`	"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

	label paradise
	`	You and James chat with Hwang a while longer, and she 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. The easiest asteroids to get there are the lead ones; you can spot them by their light gray, rounded appearance."`
	`	"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 lead before landing on <planet> and we can call it a day."`
		accept

	label syndicate
	`	You and James chat with August a while longer, and he suggests trying your hand at mining in Procyon. "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. Just watch out for getting stranded; the only landable planet in Procyon is Cassandra, which is uninhabited. Still, merchant and Navy ships should come frequently enough that you can just hail one of them for a refuel."`
	`	"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 in Procyon before jumping to <system> and landing on <planet>."`
		accept


conversation "mining intro end"
	`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."`
		`	"That was great!"`
	`	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?"`
			to display
				not "mining intro: equipment"
		`	"How do you deal with pirates?"`
			to display
				not "mining intro: pirates"
			goto pirates
		`	"How can I check the value of minerals?"`
			to display
				not "mining intro: value"
			goto value
		`	"I think I have enough information."`
			goto end

	action
		set "mining intro: equipment"
	`	"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!"`
			goto fit
		`	"That all makes sense."`
	`	"Anything else you want to ask me?" says James.`
		goto choices
	label fit
	`	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 <model> 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 choices

	label pirates
	action
		set "mining intro: 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 choices

	label value
	action
		set "mining intro: value"
	`	"You will learn this by experience, but if the planet has an outfitter, you can check the price there before you sell."`
		goto choices
		
	label end
	action
		clear "mining intro: equipment"
		clear "mining intro: pirates"
		clear "mining intro: value"
	branch first
		has "start: paradise"
	`	"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."`
		decline
	label first
	`	"If you'd rather whet your teeth with some starfighting, 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.)`


conversation "mining intro new sahara"
	`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 <home planet>.`
	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


conversation "intro relic"
	`You find James talking with a group of dock workers, 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. "Even after all my years as a captain," says James, "I still feel a little sad visiting this world. <origin> was meant to be the future; an evergreen rest station for ships seeking to conquer the great cosmos. But then ships were able to travel for longer and further, and they discovered bigger, greener, more valuable planets, and suddenly the 'future' became little more than a ghost town. Can you imagine spending your life here?"`
	choice
		`	"It's better than living in poverty on an urban planet."`
		`	"No."`
			goto no
	`	"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."`
		goto final
	label no
	`	James cracks a smile at your frankness. "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."`
	label final
	choice
		`	"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



# Missions when the player attempts to use an invalid starting ship.


mission "Intro [0 Fighter]"
	non-blocking
	invisible
	shipyard
	to offer
		"days since start" == 0
	to accept
		"ships: Fighter" == "total ships"
	on offer
		conversation
			`As you check over the specs of your brand new <flagship model> one last time, you realize it lacks the hyperdrive necessary for interstellar travel! Unless you're happy to spend the rest of your life flying past the same few planets, you'll need to sell the <flagship model> and buy a proper spacefaring vessel.`
				decline


mission "Intro [0 Drone]"
	non-blocking
	invisible
	shipyard
	to offer
		"days since start" == 0
	to accept
		"ships: Drone" == "total ships"
	on offer
		conversation
			`You prepare to board your new ship and take it for a test flight, only to find it is an automated drone that lacks a crew compartment entirely! Unless you want to try strapping yourself on the outside of the hull, you'll need to sell off your drone and buy a proper spacefaring vessel.`
				decline



mission "Intro [0 Jackal]"
	non-blocking
	invisible
	shipyard
	to offer
		"days since start" == 0
	to accept
		"ship model: Mining Drone" >= 3
		"outfit: Mining Laser" >= 3
		"outfit: X1200 Ion Steering" >= 3
		"outfit: X1700 Ion Thruster" >= 3
		"outfit: Supercapacitor" >= 3
		"outfit: nGVF-AA Fuel Cell" >= 3
		has "start: syndicate"
		not "Delve Intro [0]: offered"
	on offer
		conversation
			`For reasons known only to yourself, you have spent your mortgage on three Mining Drones that are completely useless to you. As you bask in the economic genius of your decision, you hear a merchant haggling with a ship reseller.`
			`	"Look, you'd have to be looking real close to tell that she's a pre-loved ship. Plus, she isn't 'outdated,' she's an antique! Ship collectors will be throwing their wallets at you just to get a photo of the ship."`
			`	The reseller is unamused by the merchant's arguments and takes his leave when it becomes clear neither side is willing to compromise. Exhausted, the merchant slumps onto a nearby bench.`
			choice
				`	(Approach the merchant.)`
				`	(Ignore the merchant so I can appreciate my Mining Drones more.)`
					decline
			`	You take a seat on the bench and ask, "What was that all about?"`
			`	The merchant turns his head to face you. "That whole kerfuffle? Tried to cheat me out of a fair deal, he did." Seeing your confusion, he elaborates. "I'm a space miner by trade. A few days ago, I got caught in a nasty pirate ambush - lost all my Mining Drones in the blink of an eye. The pirates weren't doing so hot either, though. I got lucky and managed to disable and capture a Jackal, one of those old, Caravan-era interceptors. I thought I'd sell it off and replace my drones, but the shipyards here are running a racket; I can't even buy half a Mining Drone with the credits they're offering." He lets out a sigh.`
			choice
				`	"Actually, I have some spare Mining Drones."`
					goto deal
				`	"Thanks for the story, but I have places to be."`
			`	"Well, thanks for listening." The merchant bids you farewell as you stand up and leave.`
				decline
			label deal
			`	The merchant's head perks up. "Really? That's fantastic!" He quietly mutters some numbers to himself, then says, "How about two Mining Drones for the Jackal? You think that's a fair deal?"`
			choice
				`	"Sounds good."`
					goto jackal
				`	"What about just one drone?"`
				`	"I can't take that deal."`
					goto refuse
			`	He shakes his head. "It's got to be two drones, or no drones."`
			choice
				`	"Alright, you'll have your drones."`
					goto jackal
				`	"No deal."`
			label refuse
			`	"Darn. Well, at least you've given me an idea; there's got to be a captain out there willing to hand me a couple of Mining Drones for my Jackal!" The merchant hops up from the bench and jauntily walks away.`
				decline
			label jackal
			action
				give ship "Jackal (Empty)" "Exemplar"
				take ship "Mining Drone"
					count 2
			`	You shake hands with the merchant. "Thanks for the deal, partner." He hands you the license to the Jackal and walks off towards the loading bays to claim his new Mining Drones.`
				decline


ship "Jackal" "Jackal (Empty)"
	outfits
		"LP036a Battery Pack"



# Missions for the New Boston start

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"
	to offer
		has "start: default"
	to accept
		"total ships" > "ships: Fighter" + "ships: Drone"
	substitutions
		"<trade>" "stock up on medical goods"
		"<while>" "While they don't sell much here compared to on the big manufacturing worlds"
	
	on offer
		conversation "intro mission"
	
	on accept
		log "Getting some basic instructions on making a living as a merchant from an old captain named James."
		log "Minor People" "James" `An old man who accompanied you on your first few jobs as a starship captain.`
	
	on complete
		payment 10000
		conversation "mission intro end"



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"
			has "ships: Utility"
			has "ships: Superheavy"
		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 three 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 triple 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 eight people including yourself, but if they're willing to squeeze into the available five bunks you've got no reason to discourage them.`
			choice
				`	"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 4
	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, 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."`
				accept
	
	on complete
		payment 20000
		conversation
			`As you make the final landing descent to the surface of <planet>, 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 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 have one final mission for you, but 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"
	substitutions
		"<they've>" "you've"
	
	on offer
		conversation "intro earth offer"
	
	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."
		log "Minor People" "James" `He currently resides on Hestia, having retired from life as a merchant captain.`
		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
				`	"I'd be glad to help!"`
				`	"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 "freighter 1 end"



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!"`
				`	"No way am I loading up my shiny new starship with smelly fish. Count me out."`
					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 "freighter 2 end"



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 have one final mission for you, but 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 "intro ingot"
	
	on complete
		payment 30000
		log "Dropped James off on Hestia after running a few missions with him. Ship still smells like fish."
		log "Minor People" "James" `He currently resides on Hestia, having retired from life as a merchant captain.`
		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
		government Pirate
		personality entering plunders
		ship "Sparrow" "Bloodletter"
		ship "Fury" "Hand of Fate"
	npc save
		government Merchant
		personality timid escort
		ship "Freighter" "Horn of Plenty"
		ship "Freighter" "Morning Light"
	substitutions
		"<their>" "his"
		"<they're>" "he's"
		"<they are>" "he is"
	
	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 visit
		dialog phrase "generic arrived-without-npc dialog"
	on complete
		payment 35000
		conversation "interceptor escort end"



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"
	substitutions
		"<person>" "she"
		"<enemy>" "Hammer"
		"<magnitude>" "ten"
	
	on offer
		conversation "interceptor evade intro"
	
	on complete
		payment 45000
		conversation "interceptor evade end"



mission "Intro [2.1 Interceptor]"
	priority
	name "Mine asteroids in <system>"
	description "Go to the <system> system and mine five 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"
	substitutions
		"<captain>" "Marshall"
		"<they>" "he"
	
	on offer
		conversation "mining intro"
	
	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 "mining intro end"



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 have one final mission for you, but 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 "mining intro new sahara"
	
	on complete
		payment 30000
		log "Dropped James off on Hestia after running a few missions with him. Escort duty is a risky business."
		log "Minor People" "James" `He currently resides on Hestia, having retired from life as a merchant captain.`
		conversation "end of intro missions"



# Missions for the Midgard start

mission "Midgard 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 "Midgard"
	destination "Asgard"
	to offer
		has "start: deep"
	to accept
		"total ships" > "ships: Fighter" + "ships: Drone"
	substitutions
		"<trade>" "load some bundles of clothing onto your ship"
		"<while>" "While most of the outfits will be far outside your price range"
	
	on offer
		conversation "intro mission"
	
	on accept
		log "Getting some basic instructions on making a living as a merchant from an old captain named James."
		log "Minor People" "James" `An old man who accompanied you on your first few jobs as a starship captain.`
	
	on complete
		payment 10000
		conversation "mission intro end"



mission "Midgard Intro [1 Transport]"
	priority
	name "Transport scientists to <planet>"
	description "Bring your new friend James, along with a team of scientists, 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 "Asgard"
	destination "Nifel"
	passengers 5
	to offer
		has "Midgard Intro [0]: done"
		or
			has "ships: Transport"
			has "ships: Space Liner"
			has "ships: Utility"
			has "ships: Superheavy"
		"passenger space" >= 5
		not "Midgard Intro [1 Freighter]: offered"
		not "Midgard Intro [1 Interceptor]: offered"
		not "Midgard Intro [1 Transport Alt]: offered"
	
	on offer
		conversation
			`You find James with four middle-aged people in tow. "Captain <last>!" he says. "Wonderful to see you again. I was just talking to these scientists. They've been having trouble finding a ship that's willing to stopover on a low-profile world like <planet>. They can pay you <payment> to take them there. What do you say?"`
			choice
				`	"Welcome aboard!"`
				`	"Sorry, I think I'd rather go off in my own direction from here."`
					decline
			`	You and James direct the team to your ship. Looks like you're about to set off on your first real job...`
				accept
	
	on complete
		payment 45000
		conversation
			`Along the journey, you learned that the team of scientists you are transporting are studying indigenous life on sub-arctic worlds. <planet> is of particular interest to them, as it hosts a variety of colorful organisms, from the six-winged albatross to the all-consuming Ice-Slug. "<planet> is also a planet of great historical importance," one of the scientists says. "A bacterium living in its wilderness was able to bring the Rigellian Plague to an end four centuries ago. Before then, entire colonies could be wiped out by a single infected ship."`
			`	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 "Midgard 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 4
	source "Nifel"
	destination "Calda"
	to offer
		has "Midgard Intro [1 Transport]: done"
	
	on offer
		conversation
			`<origin>'s spaceport is far colder than anything you've experienced; you try to insulate yourself with what you have as nearby vendors peddle overpriced coats. Despite its size, the port is almost completely empty. Many storefronts have been shuttered, and the provided seating looks brand-new and outdated at the same time.`
			`	By the time you see James, 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 Chai, Simon, and their son Kamon. 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.`
			`	"Make sure your jobs go to the same planet, though; there's two habitable planets in the system of <system>, and landing on <planet> won't complete any missions with Vail as a destination."`
				accept
	
	on complete
		payment 30000
		conversation
			`Calda is everything Nifel is not. The planet is warm, wet, and filled to the brim with obnoxious tourists. Shortly after you disembark, you are approached by half a dozen salespeople talking over each other as they promote their company's luxury hotels and hot springs. When Chai, Simon, and Kamon step off, the marketeers realize their mistake and begin harassing them instead.`
			`	While Chai is busy handling them, Simon hands you the payment for the trip. As they walk away, you see a spaceport cleaner accidentally back into Kamon while wiping down a bench. A nearby couple in swimsuits spots the incident and starts chewing out the cleaner.`
			`	After the commotion clears, James shakes his head and says, "Some people don't have the first clue about how good they have it." Then, he turns to you and says, "Same deal as before. If you want to keep traveling together, meet me in the spaceport."`




mission "Midgard 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 have one final mission for you, but 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 "Calda"
	destination "Hestia"
	to offer
		has "Midgard Intro [2 Transport]: done"
	
	on offer
		conversation
			`By the time you find James, it is already night. You find him overlooking a cliff face covered with hot tubs. A number of the pools are coated in shimmering platinum; the rest must settle with mere gold. The patrons enjoying the tubs range from old couples enjoying their retirement to inebriated teenagers wildly swinging their heads. Overhead, an aerobatics show leaves trails of light in the air, forming shapes and names. Below, in one of the tubs, you spot cleaners in drenched overalls draining a pool stained puke-yellow. In another, you see a waitress accosted by a red-faced man in a red business suit.`
			`	"It's hardly a wonder why they call them the 'Paradise Worlds,'" James says. "Nine planets, including Calda, each terraformed to perfection. Life on one of these worlds is the most sought-after commodity in the galaxy. But behind each of these worlds, millions of workers toil night and day to maintain a utopia that they will never enjoy."`
			`	After taking one last glance at the cliff, he says, "But that's enough of an old man's hypocritical ramblings. 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 another member of the "Paradise Worlds," and a retirement home for some of the richest people in the Republic. You wonder whether James is going to be able to fit in there.`
				accept
	
	on complete
		payment 50000
		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."
		log "Minor People" "James" `He currently resides on Hestia, having retired from life as a merchant captain.`
		conversation "end of intro missions"



mission "Midgard Intro [1 Transport Alt]"
	priority
	name "Transport family to <planet>"
	description "Bring your new friend James, along with a spacediver, 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 "Asgard"
	destination "Norn"
	passengers 2
	to offer
		has "Midgard Intro [0]: done"
		or
			has "ships: Transport"
			has "ships: Space Liner"
			has "ships: Utility"
			has "ships: Superheavy"
		"passenger space" < 5
		not "Midgard Intro [1 Freighter]: offered"
		not "Midgard Intro [1 Interceptor]: offered"
		not "Midgard Intro [1 Transport]: offered"
	
	on offer
		conversation
			`You find James conversing with another person. "Captain <last>!" he says. "Wonderful to see you again. Chen here is willing to pay <payment> if you bring them to <planet> so that they can skydive from the edge of space."`
			`	Chen says, "Norn has a thick enough atmosphere and low enough gravity that you can get away with aerial stunts you wouldn't be able to on any other world. Don't worry about handling the procedure for the space jump; I've done it before."`
			choice
				`	"Welcome aboard!"`
				`	"Sorry, I think I'd rather go off in my own direction from here."`
					decline
			`	You and James direct Chen to your ship. After they board, James turns to you and says, "Make sure to pay attention to where you're landing. The system of <system> has two inhabited planets, Muspel and <planet>, and you don't want to land on the wrong planet when trying to finish a job."`
				accept
	
	on complete
		payment 18000
		conversation
			`Just before you enter <planet>'s atmosphere, you open your loading bay ramp, as directed by Chen. Shortly afterward, they appear on your cargo hold camera in full skydiving garb. They take a running start and launch themself into space, quickly vanishing from your vision.`
			`	Several minutes after your ship touches down, Chen approaches you in the spaceport, thanks you, and hands 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 "Midgard Intro [2 Transport Alt]"
	priority
	name "Tourist to <planet>"
	description "This returning tourist 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 2
	source "Norn"
	destination "Earth"
	to offer
		has "Midgard Intro [1 Transport Alt]: done"
	
	on offer
		conversation
			`The smell of brine permeates <origin>'s spaceport. By the time you find James, it seems unlikely that you'll ever eat seafood without gagging again. "Hi there, Captain <last>!" he says. "Interested in carrying a returning tourist to <planet>?" Behind him is a young man in red sunglasses.`
			choice
				`	"Sure!"`
				`	"No thanks, I think I'll strike off on my own now."`
					decline
			`	"Great," he says. "This is Van. Let's help him carry his 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, especially if you're low on bunk space. 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."`
				accept
	
	on complete
		payment 22000
		conversation
			`As you make the final landing descent to the surface of Earth, Van looks down on its cluttered surface and begins listing off places he recognizes. James joins in by bringing up the history of the cities you fly over, and the two of them begin making jokes about the worst places to live on <planet>.`
			`	As he steps off, Van hands you <payment>. "Thanks for the fun times, but I'd best be going. I've got work first thing in the morning."`
			`	After he leaves, James says, "I haven't met too many people from Earth during my time. Even today, billions of people grow up and die on this planet without taking a single step on another world." 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 "Midgard Intro [3 Transport Alt]"
	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 have one final mission for you, but 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 "Midgard Intro [2 Transport Alt]: done"
	substitutions
		"<they've>" "they've"
	
	on offer
		conversation "intro earth offer"
	
	on complete
		payment 90000
		log "Dropped James off on Hestia after running a few missions with him. Met a skydiver and a tourist, and got to visit Earth along the way."
		log "Minor People" "James" `He currently resides on Hestia, having retired from life as a merchant captain.`
		conversation "end of intro missions"



mission "Midgard 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 "outfit parts" 40
	passengers 1
	source "Asgard"
	destination "Valhalla"
	to offer
		has "Midgard Intro [0]: done"
		or
			has "ships: Light Freighter"
			has "ships: Heavy Freighter"
		not "Midgard Intro [1 Transport]: offered"
		not "Midgard Intro [1 Transport Alt]: offered"
		not "Midgard Intro [1 Interceptor]: offered"
	
	on offer
		conversation
			`You find James talking with a man wearing a business suit. "Captain <last>!" says James. "Glad you could join us. One of the most prominent manufacturers of starship outfits, Deep Sky, is headquartered on <origin>. Usually, they use a company fleet to deliver their equipment to other outfitters. However, a pirate attack has left that fleet out of commission, so they're asking merchants to assist where possible. Are you willing to help out?"`
			choice
				`	"I'll help."`
				`	"Sorry, but I think I'm going to head out on my own."`
					decline
			`	"Great!" says James. "They'll be loading up your ship shortly."`
				accept
	
	on complete
		payment 35000
		conversation "freighter 1 end"



mission "Midgard 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 bass" 34
	passengers 1
	source "Valhalla"
	destination "Ingot"
	deadline
	to offer
		has "Midgard Intro [1 Freighter]: done"
	
	on offer
		conversation
			`The landscape of <origin> beats even the urban sprawls of Midgard and Asgard. Beyond the spaceport's glass walls is a vast forest of skyscrapers reaching out to the edge of your vision. Far away, the lights of distant buildings blend together, as though the horizon is ablaze.`
			`	James sees you from a distance and waves you over. As you walk over, you are treated to the overwhelming smell of raw fish, sticking out like a sore thumb in the industrial environment. "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!"`
				`	"No way am I loading up my shiny new starship with smelly fish. Count me out."`
					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.`
			`	"We're also leaving Deep space soon; pirate attacks are a lot more frequent outside of the Deep or the Paradise Worlds, so watch out."`
				accept
	
	on complete
		payment 45000
		conversation "freighter 2 end"



mission "Midgard 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 have one final mission for you, but 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 "Midgard Intro [2 Freighter]: done"
	
	on offer
		conversation "intro ingot"
	
	on complete
		payment 50000
		log "Dropped James off on Hestia after running a few missions with him. Ship still smells like fish."
		log "Minor People" "James" `He currently resides on Hestia, having retired from life as a merchant captain.`
		conversation "end of intro missions"



mission "Midgard Intro [1 Interceptor]"
	priority
	name "Delivery to <planet>"
	description "Deliver <commodity>, along with your new friend James, to <destination>, while avoiding a pirate warship."
	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 "confidential documents" 2
	source "Asgard"
	destination "Valhalla"
	to offer
		has "Midgard 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 "Midgard Intro [1 Transport]: offered"
		not "Midgard Intro [1 Transport Alt]: offered"
		not "Midgard Intro [1 Freighter]: offered"
	npc
		government "Merchant (Hostile)"
		personality entering nemesis plunders
		ship "Leviathan" "Arm of Odin"
	substitutions
		"<person>" "she"
		"<enemy>" "Arm"
		"<magnitude>" "a hundred"
	
	on offer
		conversation "interceptor evade intro"
	
	on complete
		payment 50000
		conversation
			`As you touch down on <planet>, a team of uniformed workers are ready to unload the confidential cargo. One of them thanks you and hands you a credit chip worth <payment>. James asks, "How was that, <first>?"`
			choice
				`	"Easy peasy. What's next?"`
				`	"I was hoping to do some shooting, not get shot at."`
					goto shooting
			`	James lets out a laugh. "Now that's the spirit! Most Sparrow pilots get the wind knocked out of them after their first taste of danger, and decide to do some asteroid mining instead. It takes some time to find a system with good enough materials, but the lower risk is worth it. Anyway, I'll see if there's another mission in the spaceport for you. Meet me there."`
				goto end
			label shooting
			`	"That's just how it is," James says. "Don't forget you're in a <model>; the very bottom of the food chain. You've got to respect any and all opponents, no matter how weak you think they are. Some Sparrow pilots realize how vulnerable their ship is, and decide to take up asteroid mining instead. It takes some time to find a system with good enough materials, but the lower risk is worth it. Anyway, meet me in the spaceport if you want to do another job."`
			label end
			``
			`	(As before, click the "Spaceport" button to continue this mission.)`



mission "Midgard Intro [2 Interceptor]"
	priority
	name "Escort convoy to <planet>"
	description "Escort a merchant convoy to <destination>, along with 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 "Valhalla"
	destination "Ingot"
	to offer
		has "Midgard Intro [1 Interceptor]: done"
	npc
		government Pirate
		system "Tania Australis"
		personality plunders
		ship "Sparrow" "Beast of Brass"
		ship "Berserker" "Bootlegger"
	npc save
		government Merchant
		personality timid escort
		ship "Freighter" "Conagher's Porter"
		ship "Freighter" "Solemn Vow"
	substitutions
		"<their>" "their"
		"<they're>" "they're"
		"<they are>" "they are"
	
	on offer
		conversation
			`The landscape of <origin> beats even the urban sprawls of Midgard and Asgard. Beyond the spaceport's glass walls is a vast forest of skyscrapers reaching out to the edge of your vision. Far away, the lights of distant buildings blend together, as though the horizon is ablaze.`
			`	You find James standing on a landing pad underneath a large freighter, chatting with a person you assume is the captain. "There you are!" he says. "Captain McLain here says their two ships have always had troubles with pirates when venturing outside of the Deep, and they're 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, "While the Deep is well guarded against pirates, most of human space is clamoring with bandits and other ruffians. 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.`
			`	"Also, make sure to refuel your ship in Zosma before jumping into Algieba; if you run out of fuel there, you'll be a sitting duck unless you can get another ship to help you."`
				accept
	
	on visit
		dialog phrase "generic arrived-without-npc dialog"
	on complete
		payment 50000
		conversation "interceptor escort end"



mission "Midgard Intro [2.1 Interceptor]"
	priority
	name "Mine asteroids in <system>"
	description "Go to the <system> system and mine five 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 "Midgard Intro [2 Interceptor]: done"
	substitutions
		"<captain>" "Marshall"
		"<they>" "he"
	
	on offer
		conversation "mining intro"
	
	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 "mining intro end"



mission "Midgard 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 have one final mission for you, but 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 "Midgard Intro [2.1 Interceptor]: done"
	
	on offer
		conversation "mining intro new sahara"
	
	on complete
		payment 50000
		log "Dropped James off on Hestia after running a few missions with him. Escort duty is a risky business."
		log "Minor People" "James" `He currently resides on Hestia, having retired from life as a merchant captain.`
		conversation "end of intro missions"



# Missions for the Mainsail start

mission "Mainsail 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 "Mainsail"
	destination "Glory"
	to offer
		has "start: paradise"
	to accept
		"total ships" > "ships: Fighter" + "ships: Drone"
	substitutions
		"<trade>" "load some electronic goods onto your ship"
		"<while>" "While they don't sell much here compared to on the big manufacturing worlds"
	
	on offer
		conversation "intro mission"
	
	on accept
		log "Getting some basic instructions on making a living as a merchant from an old captain named James."
		log "Minor People" "James" `A old man who accompanied you on your first few jobs as a starship captain.`
	
	on complete
		payment 10000
		conversation "mission intro end"



mission "Mainsail Intro [1 Transport]"
	priority
	name "Transport family to <planet>"
	description "Bring your new friend James, along with a team of engineers, 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 "Glory"
	destination "Tinker"
	passengers 5
	to offer
		has "Mainsail Intro [0]: done"
		or
			has "ships: Transport"
			has "ships: Space Liner"
			has "ships: Utility"
			has "ships: Superheavy"
		"passenger space" >= 5
		not "Mainsail Intro [1 Freighter]: offered"
		not "Mainsail Intro [1 Interceptor]: offered"
		not "Mainsail Intro [1 Transport Alt]: offered"
	
	on offer
		conversation
			`The world of <origin> is in full bloom; the gardens the spaceport overlooks are filled with a spectrum of flowers, and a sweet smell rests in the air. Eventually you find James with a small group in tow: four young-looking men and women.`
			`	"Captain <last>!" he says. "Wonderful to see you again. I was just talking to this group of engineers. Their original transport has been delayed, and they're looking for another ship to take them to <planet>. They can pay you <payment> to take them there. What do you say?"`
			choice
				`	"Welcome aboard!"`
				`	"Sorry, I think I'd rather go off in my own direction from here."`
					decline
			`	You and James direct the team to your ship. Looks like you're about to set off on your first real job...`
				accept
	
	on complete
		payment 40000
		conversation
			`Along the journey, you learned that the team of engineers you are transporting are working on replacing one of their automated terraforming controllers. "We all graduated from the same class on Chiron," one of the engineers says while grinning. "One of us managed to land a job on Glory thanks to a relative, and from there, we were able to form our team. There's been ups and downs over the last few decades, but we always managed to figure things out in the end." He looks barely a day over twenty-five.`
			`	You say goodbye to them and wish them well, and as agreed they pay you <payment>. You have just completed your first proper job as a starship captain!`
			`	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 "Mainsail 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 4
	source "Tinker"
	destination "Earth"
	to offer
		has "Mainsail Intro [1 Transport]: done"
	
	on offer
		conversation
			`It is raining.`
			`	A deep fog envelops the spaceport city on <origin>. In the distance, you can see the faded lights of distant starships drifting like phantoms. On the streets below, harsh rain whips against the congested traffic, blurring it into a muddy mess of red light.`
			`	By the time you see James, he's already got a small group of people with him: a young 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 Chiyo, Salim, and their son Khalil. 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."`
				accept
	
	on complete
		payment 20000
		conversation
			`As you make the final landing descent to the surface of Earth, Chiyo and Salim 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. Khalil, meanwhile, has spent the entire journey playing a 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 Vinci and visited the holo-arcades; 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 "Mainsail 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 have one final mission for you, but 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 "Mainsail Intro [2 Transport]: done"
	substitutions
		"<they've>" "they've"
	
	on offer
		conversation "intro earth offer"
	
	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."
		log "Minor People" "James" `He currently resides on Hestia, having retired from life as a merchant captain.`
		conversation "end of intro missions"



mission "Mainsail Intro [1 Transport Alt]"
	priority
	name "Transport family to <planet>"
	description "Bring your new friend James, along with a passenger, 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 "Glory"
	destination "Tinker"
	passengers 2
	to offer
		has "Mainsail Intro [0]: done"
		or
			has "ships: Transport"
			has "ships: Space Liner"
			has "ships: Utility"
			has "ships: Superheavy"
		"passenger space" < 5
		not "Mainsail Intro [1 Freighter]: offered"
		not "Mainsail Intro [1 Interceptor]: offered"
		not "Mainsail Intro [1 Transport]: offered"
	
	on offer
		conversation
			`The world of <origin> is in full bloom; the gardens the spaceport overlooks are filled with a spectrum of flowers, and a sweet smell rests in the air. Eventually you find James, with someone else in tow.`
			`	"Captain <last>!" he says. "Wonderful to see you again. I was just talking to Jan over here. His original transport has been delayed, and he's looking for another ship to take him to <planet>. He can pay you <payment> to take him there. What do you say?"`
			choice
				`	"Welcome aboard!"`
				`	"Sorry, I think I'd rather go off in my own direction from here."`
					decline
			`	You and James direct Jan to your ship. Looks like you're about to set off on your first real job...`
				accept
	
	on complete
		payment 20000
		conversation
			`Along the journey, you learned that Jan is a terraforming engineer traveling to <planet> to meet with his colleagues. "We all graduated from the same class on Chiron," he says. "One of us managed to land a job on Glory thanks to a relative, and from there, we were able to form our team. There's been ups and downs across our decades of work, but we always managed to figure things out in the end." He looks barely a day over twenty-five.`
			`	You say goodbye to Jan and wish him well, and as agreed he pays you <payment>. You have just completed your first proper job as a starship captain!`
			`	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 "Mainsail Intro [2 Transport Alt]"
	priority
	name "Tourist to <planet>"
	description "This tourist will pay you <payment> to take him 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 2
	source "Tinker"
	destination "Earth"
	to offer
		has "Mainsail Intro [1 Transport Alt]: done"
	
	on offer
		conversation
			`It is raining.`
			`	A deep fog envelops the spaceport city on <origin>. In the distance, you can see the faded lights of distant starships drifting like phantoms. On the streets below, harsh rain whips against the congested traffic, blurring it into a muddy mess of red light.`
			`	"Hi there, Captain <last>!" James says as he approaches you. "Interested in carrying a tourist to <planet>?" Behind him is a young-looking man wearing a floral shirt.`
			choice
				`	"Sure!"`
				`	"No thanks, I think I'll strike off on my own now."`
					decline
			`	"Great," he says. "This is Mecit. Let's help him carry his luggage to your ship." As you begin walking back, slightly ahead of him, James whispers to you, "Tourists are always a good way to make money, especially if you're low on bunk space. 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."`
				accept
	
	on complete
		payment 10000
		conversation
			`As you make the final landing descent to the surface of Earth, Mecit looks down on Earth's cluttered surface, his eyes wide open. In an attempt to lighten the mood, James begins telling the both of you some of the history of the cities you are flying over, but Mecit wears a dour expression on his face up until he picks up his luggage and prepares to disembark.`
			`	As you collect your payment, James pulls Mecit 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 he leaves, James shakes his head ruefully. "He probably expected Earth to be a relaxing holiday planet, like Caldra or Farseer. I just hope that he's able to see past his preconceptions and appreciate <planet>'s legacy." 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 "Mainsail Intro [3 Transport Alt]"
	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 have one final mission for you, but 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 "Mainsail Intro [2 Transport Alt]: done"
	substitutions
		"<they've>" "they've"
	
	on offer
		conversation "intro earth offer"
	
	on complete
		payment 65000
		log "Dropped James off on Hestia after running a few missions with him. Met a skydiver and a hapless tourist, and got to visit Earth along the way."
		log "Minor People" "James" `He currently resides on Hestia, having retired from life as a merchant captain.`
		conversation "end of intro missions"



mission "Mainsail 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 "climbing equipment" 37
	passengers 1
	source "Glory"
	destination "Maelstrom"
	to offer
		has "Mainsail Intro [0]: done"
		or
			has "ships: Light Freighter"
			has "ships: Heavy Freighter"
		not "Mainsail Intro [1 Transport]: offered"
		not "Mainsail Intro [1 Transport Alt]: offered"
		not "Mainsail Intro [1 Interceptor]: offered"
	
	on offer
		conversation
			`The world of <origin> is in full bloom; the fields that the spaceport overlooks are filled with flowers of every color of the rainbow, and a sweet smell rests in the air. You find James talking with a man wearing dusty, rugged clothing, completely unlike the world around him. "Captain <last>!" says James. "Glad you could join us. Raphael here runs a tourism company centered around rock climbing. He's looking to expand his operations to <planet>, but he needs <cargo> delivered there in advance. Are you willing to help out?"`
			choice
				`	"I'd be glad to help out!"`
				`	"Sorry, but I think I'm going to head out on my own."`
					decline
			`	"Great!" says James. "They'll be loading up your ship shortly."`
				accept
	
	on complete
		payment 30000
		conversation "freighter 1 end"



mission "Mainsail 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 "viral samples" 32
	passengers 1
	source "Maelstrom"
	destination "Hermes"
	clearance
	deadline
	to offer
		has "Mainsail 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, you see several people in hazmat suits working behind him. "I've found another job for you," he says.`
			choice
				`	"I hope it isn't related to those workers."`
				`	"Sorry, I think I'll head off on my own now."`
					decline
			`	"As long as you don't do anything stupid," James says, "like open up the cargo yourself, you'll be safe. <cargo> need to get to the refrigeration vaults on <planet> before they decay, and that means they 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!"`
				`	"I'm not loading diseases onto my shiny new starship. Count me out."`
					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 canisters full of pathogens no one wants filling up your cargo hold."`
				accept
	
	on complete
		payment 35000
		conversation "freighter 2 end"



mission "Mainsail 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 have one final mission for you, but 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 "Hermes"
	destination "Hestia"
	to offer
		has "Mainsail Intro [2 Freighter]: done"
	
	on offer
		conversation
			`You find James talking with a group of scientists and dock workers, 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. "Even after all my years as a captain," says James, "I still feel uncomfortable every time I land on <origin>. Every day, scientists on this planet work with pathogens capable of wiping out a planet within months. The danger of infection is such that you need a permit just to live here. Can you imagine spending your life on this planet?"`
			choice
				`	"Somebody has to do the dangerous stuff so that the rest of humanity can prosper."`
				`	"It does seem awfully isolated. But some people might enjoy the solitude."`
			`	"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
				`	"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. You've heard of <planet> before; one of the Paradise Worlds terraformed from a lifeless ice planet to the largest and most luxurious retirement home in the galaxy. As you look at his utilitarian outfit and modest luggage, something seems off about the idea of James living in such a place.`
				accept
	
	on complete
		payment 30000
		log "Dropped James off on Hestia after running a few missions with him. Still not convinced that my hold isn't a biohazard."
		log "Minor People" "James" `He currently resides on Hestia, having retired from life as a merchant captain.`
		conversation "end of intro missions"



mission "Mainsail Intro [0.1 Interceptor]"
	priority
	name "Mine asteroids in <system>"
	description "Go to the <system> system and mine five tons of lead, 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 "Glory"
	destination "Pearl"
	to offer
		has "Mainsail 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 "Mainsail Intro [1 Transport]: offered"
		not "Mainsail Intro [1 Transport Alt]: offered"
		not "Mainsail Intro [1 Freighter]: offered"
	substitutions
		"<captain>" "Hwang"
		"<they>" "she"
	
	on offer
		conversation "mining intro"
	
	on visit
		dialog `You've reached <destination>, but you don't have at least five tons of lead in your cargo hold. Locate and mine lead asteroids in this system before returning.`
	
	on complete
		require "Lead" 5
		conversation "mining intro end"



mission "Mainsail Intro [1 Interceptor]"
	priority
	name "Escort convoy to <planet>"
	description "Escort a merchant convoy to <destination>, along with 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 "Pearl"
	destination "Prime"
	to offer
		has "Mainsail Intro [0.1 Interceptor]: done"
	npc
		government Pirate
		system "Mirzam"
		personality plunders
		ship "Sparrow" "Old Adam"
		ship "Fury" "Trojan"
	npc save
		government Merchant
		personality timid escort
		ship "Freighter" "Paradise Doll"
		ship "Freighter" "Strange Dream"
	substitutions
		"<their>" "his"
		"<they're>" "he's"
		"<they are>" "he is"
	
	on offer
		conversation
			`<origin>'s spaceport is located on the least biodiverse island on the planet; a necessity, given that contaminants introduced by outsiders pose the greatest threat to <origin>'s wildlife sanctuaries. That has not stopped the port's architects from making it as extravagant as possible. Walking over the bridge between the landing peninsula and the main port, you are greeted by a verdant plaza, filled with some of the more resilient species of exotic life present on <origin>. Directly ahead, in the center of the spaceport, is a giant holographic globe showing the origins of the flora and fauna on each island.`
			`	Before you can get closer, you are knocked aside by several classes of students pouring out of a Star Queen. They seem to be in primary school, excitedly marching behind their teachers while clutching plushies depicting the animals on this planet.`
			`	You find James standing on a landing pad underneath a large freighter, chatting with a person you assume is the captain. "There you are!" he says. "Captain Donald here says his two ships have always had troubles with pirates when venturing outside of the Deep, and he's looking for an escort to get them safely to <planet>. 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, "While the Paradise Worlds are well guarded against pirates, most of human space, especially the far north, is clamoring with bandits and other ruffians. 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 40000
		conversation "interceptor escort end"



mission "Mainsail Intro [2 Interceptor]"
	priority
	name "Transport to <planet>"
	description "Transport an informant, along with James, to <destination>, while avoiding a pirate warship."
	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 2
	source "Prime"
	destination "Pearl"
	to offer
		has "Mainsail Intro [1 Interceptor]: done"
	npc
		government Pirate
		personality entering plunders nemesis
		ship "Corvette (Speedy)" "Eye of Loki"
	substitutions
		"<person>" "he"
		"<enemy>" "Eye"
		"<magnitude>" "ten"
	
	on offer
		conversation "interceptor evade intro"
	
	on complete
		payment 40000
		conversation
			`As you touch down on <planet>, a team of Navy troopers are ready to escort the informant, who has diligently hidden their appearance in a brown cloak for the entire trip, out of your ship. One of the officers hands you a credit chip worth <payment> before turning back to command their squad. From behind, 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. "Remember that you can always make a living as an asteroid miner, if the interceptor life proves too much for you.`
			`	"If you're willing to take me on one more journey," James says, "meet me in the spaceport bar in a little while.`



mission "Mainsail 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 have one final mission for you, but 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 "Pearl"
	destination "Hestia"
	to offer
		has "Mainsail Intro [2 Interceptor]: done"
	
	on offer
		conversation
			`Even though barely more than a week has passed since the last time you were on <origin>, something about the planet feels off. Maybe it's because the spaceport is quieter today. Maybe it's because you've sensed a pattern in the way the trees have been planted and grown that isn't dissimilar to the metal supports of Prime's spaceport. Or maybe it's because the bridge acting as the sole connection between the landing pads and the main port would break just as easily as your own ship against the fire of a pirate warship.`
			`	"Something on your mind?" James asks from behind you.`
			choice
				`	"No, nothing."`
					goto nothing
				`	"Is this place really any better than Prime?"`
			`	"Better?" James raises an eyebrow. "I'd be lying if I said one of the largest shipyards in the galaxy was worth less than a glorified petting zoo. There's plenty of people out there who'd agree with me too, and plenty who'd consider my words as nothing short of blasphemy.`
			`	"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, on <planet>."`
				goto end
			label nothing
			`	"Then," says James, "would you be willing to take me on one more journey? It's time for me to head for that retirement home, on <planet>."`
			label end
			choice
				`	"Of course."`
				`	"Sorry, I think I'll go hunt some pirates instead."`
					decline
			`	Once again you walk back to your ship with James. You've heard of <planet> before; one of the Paradise Worlds terraformed from a lifeless ice planet to the largest and most luxurious retirement home in the galaxy. As you look at his utilitarian outfit and modest luggage, something seems off about the idea of James living in such a place.`
				accept
	
	on complete
		payment 30000
		log "Dropped James off on Hestia after running a few missions with him. Escort duty is a risky business."
		log "Minor People" "James" `He currently resides on Hestia, having retired from life as a merchant captain.`
		conversation "end of intro missions"



# Missions for the Delve start

mission "Delve 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 "Delve"
	destination "Burthen"
	to offer
		has "start: syndicate"
	to accept
		"total ships" > "ships: Fighter" + "ships: Drone"
	substitutions
		"<trade>" "stock up on medical goods"
		"<while>" "While most of the outfits will be far outside your price range"
	
	on offer
		conversation "intro mission"
	
	on accept
		log "Getting some basic instructions on making a living as a merchant from an old captain named James."
		log "Minor People" "James" `A old man who accompanied you on your first few jobs as a starship captain.`
	
	on complete
		payment 10000
		conversation "mission intro end"



mission "Delve Intro [1 Transport]"
	priority
	name "Transport family to <planet>"
	description "Bring your new friend James, along with a 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 "Burthen"
	destination "Tinker"
	passengers 5
	to offer
		has "Delve Intro [0]: done"
		or
			has "ships: Transport"
			has "ships: Space Liner"
			has "ships: Utility"
			has "ships: Superheavy"
		not "Delve Intro [1 Freighter]: offered"
		not "Delve Intro [1 Interceptor]: offered"
	
	on offer
		conversation
			`Every step on <origin> is a struggle. By the time you reach the spaceport cafe, you have just enough energy to slump into a chair with steel legs as thick as its cushions. After you have waited for a few minutes, James comes up. Following him is a family of four: a couple pushing along a pram, with a young child following close behind. While James would be below-average height back on Earth, he easily towers over the Burthen natives.`
			`	"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. 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?"`
			`	The husband chimes in. "We were afraid that if we were split across multiple ships, we wouldn't be able to keep an eye on Faiza." He gestures towards the child in the pram. "She hasn't been taking Burthen's gravity well."`
			choice
				`	"Welcome aboard!"`
				`	"Sorry, I think I'd rather go off in my own direction from here."`
					decline
			`	You and James direct the family to your ship. Looks like you're about to set off on your first real job...`
				accept
	
	on complete
		payment 30000
		conversation
			`Along the journey, you learned more about the family you are transporting and why they are moving to <planet>. "There's Faiza's condition, of course, but we've always wanted to move offworld since before our first child was born," says the mother, Carlijn. "My husband and I constantly moved between different mining towns as we grew up. We didn't want our children to go through the same thing."`
			`	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 "Delve 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 4
	source "Tinker"
	destination "Earth"
	to offer
		has "Delve Intro [1 Transport]: done"
	
	on offer
		conversation
			`It is raining.`
			`	A deep fog envelops the spaceport city on <origin>. In the distance, you can see the faded lights of distant starships drifting like phantoms. On the streets below, harsh rain whips against the congested traffic, blurring it into a muddy mess of red light.`
			`	By the time you see James, he's accompanied by three others. "Hi there, Captain <last>!" says James. "Interested in carrying some tourists?"`
			choice
				`	"Where are you headed?"`
				`	"No thanks, I think I'll strike off on my own now."`
					decline
			`	"To <planet>," one of them eagerly replies.`
			choice
				`	"I can take you there."`
				`	"Sorry, but I'd like to avoid <planet> right now."`
					decline
			`	"Great," he says. "This is Chiaki, Sarika, and Catrina. 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."`
				accept
	
	on complete
		payment 14000
		conversation
			`As you make the final landing descent to the surface of Earth, Sarika is on the edge of her seat as she rattles off all the landmarks you pass over, of which you recognize surprisingly few. James tries to show off his own knowledge of the planet's history, but for every story he offers, Sarika responds with five more.`
			`	Catrina lets out a laugh. "Give it a rest, old man. Sarika's been obsessed with the homeworld since she was in diapers." Then, she leans on Chiaki's shoulder. "The real question I wanna ask is why you of all people haven't said a word since re-entry. I mean, isn't seeing Earth again bringing up any memories?"`
			`	Chiaki's reply is pointed. "I left this place for a reason." When she sees Catrina's cheeky smile fade, she quickly adds, "It's nothing serious. I'd just prefer making new memories with the two of you than dwelling on the past."`
			`	You carefully follow the instructions from the air traffic controller to a landing pad halfway up the spaceport and bring your ship to rest. After all you've done for the Syndicate to escape this planet, you've returned.`
			`	As your passengers disembark and you collect your payment, James pulls the trio 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 chuckles. "Can't say I've ever seen an Earth fanatic and an Earth native in the same group before, let alone be on good terms. That's one of the perks of being a starship captain, though: you get to have the most unique experiences in the galaxy." 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 "Delve 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 have one final mission for you, but 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 "Delve Intro [2 Transport]: done"
	
	on offer
		conversation
			`<origin> is the same as it's always been. 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, driving the beggars to hide behind trashcans or do their best impressions of respectable citizens until they pass. Starship captains haggle with merchants, speaking of sums greater than the income of some neighborhoods. Flashes of light come from various landing bays as poorly-protected welders risk their health to repair ships destined for places they can only dream of.`
			`	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. "You're from Earth, aren't you?" You nod.`
			`	"Thought so," James replies. "I've seen all manner of reactions to experiencing <origin> in person for the first time. Awe. Surprise. Respect. Disgust. Their second reactions are just as varied. Some take it as a reminder of humanity's ever-present base nature; others see it as an inexcusable failure of the Republic and its predecessors." He smirks. "Only ever seen one kind of reaction from an Earth native. Maybe you folk know something the rest of us don't."`
			`	After taking one last look 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 10000
		log "Dropped James off on Hestia after running a few missions with him. Met a few tourists and revisited Earth along the way."
		log "Minor People" "James" `He currently resides on Hestia, having retired from life as a merchant captain.`
		conversation "end of intro missions"



mission "Delve 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 "lithium" 27
	passengers 1
	source "Burthen"
	destination "Tinker"
	to offer
		has "Delve Intro [0]: done"
		or
			has "ships: Light Freighter"
			has "ships: Heavy Freighter"
		not "Delve Intro [1 Transport]: offered"
		not "Delve Intro [1 Interceptor]: offered"
	
	on offer
		conversation
			`Every step on <origin> is a struggle. By the time you reach the spaceport cafe, you have just enough energy to slump into a chair with steel legs as thick as its cushions. After taking a rest, you find James talking with a woman who is an offworlder just like you, judging by her height and how labored her movements are. "Captain <last>!" says James. "Glad you could join us. Mayumi is a visiting representative of one of <origin>'s largest mining companies, and she's looking for a captain to help move <cargo> to <destination> for processing. Are you willing to help out? They'll pay for the work, of course."`
			choice
				`	"If they're paying, then I'm in."`
				`	"Sorry, but I think I'm going to head out on my own."`
					decline
			`	"Great!" says James. "They'll be loading up your ship shortly."`
				accept
	
	on complete
		payment 22000
		conversation "freighter 1 end"



mission "Delve 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 "thorium" 33
	passengers 1
	source "Tinker"
	destination "Relic"
	clearance
	deadline
	to offer
		has "Delve Intro [1 Freighter]: done"
	
	on offer
		conversation
			`It is raining.`
			`	A deep fog envelops the spaceport city on <origin>. In the distance, you can see the faded lights of distant starships drifting like phantoms. On the streets below, harsh rain whips against the congested traffic, blurring it into a muddy mess of red light.`
			`	As you walk through the spaceport, James sees you from a distance and waves you over. As you approach, you see several people in radiation suits working behind him. "I've found another job for you," he says.`
			choice
				`	"I hope it isn't related to those workers."`
				`	"Sorry, I think I'll head off on my own now."`
					decline
			`	"As long as you don't do anything stupid," James says, "like open up the cargo yourself, you'll be safe. <cargo> needs to get to <planet> to help with an urgent reactor fuel shortage, 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!"`
				`	"No way am I loading up my shiny new starship with radioactive rocks. Count me out."`
					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 nuclear fuel no one wants filling up your cargo hold."`
				accept
	
	on complete
		payment 27000
		conversation "freighter 2 end"



mission "Delve 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 have one final mission for you, but 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 "Relic"
	destination "Hestia"
	to offer
		has "Delve Intro [2 Freighter]: done"
	
	on offer
		conversation "intro relic"
	
	on complete
		payment 10000
		log "Dropped James off on Hestia after running a few missions with him. Still not convinced that my hold isn't radioactive."
		log "Minor People" "James" `He currently resides on Hestia, having retired from life as a merchant captain.`
		conversation "end of intro missions"



mission "Delve 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 "Burthen"
	destination "Lodestone"
	to offer
		has "Delve 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 "Delve Intro [1 Transport]: offered"
		not "Delve Intro [1 Freighter]: offered"
	npc
		government Pirate
		personality entering plunders
		ship "Sparrow" "Vain Butcher"
		ship "Fury" "Rotten Clout"
	npc save
		government Merchant
		personality timid escort
		ship "Freighter" "Spring Coming"
		ship "Freighter" "Paparazzi Party"
	substitutions
		"<their>" "her"
		"<they're>" "she's"
		"<they are>" "she is"
	
	on offer
		conversation
			`Every step on <origin> is a struggle. By the time you reach the spaceport cafe, you have just enough energy to slump into a chair with steel legs as thick as its cushions. After taking a rest, you find James standing on a landing pad underneath a large freighter, chatting with a woman you assume is the captain. "There you are!" he says. "Captain Rawda here says her two ships have always had trouble with pirates in the Core, and she's looking for an escort to get them safely to <planet>. 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 visit
		dialog phrase "generic arrived-without-npc dialog"
	on complete
		payment 27000
		conversation "interceptor escort end"



mission "Delve 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 "niobium" 10
	source "Lodestone"
	destination "Ada"
	to offer
		has "Delve Intro [1 Interceptor]: done"
	npc
		government Pirate
		personality entering plunders
		ship "Splinter" "Spear of Heimdall"
	substitutions
		"<person>" "he"
		"<enemy>" "Spear"
		"<magnitude>" "ten"
	
	on offer
		conversation "interceptor evade intro"
	
	on complete
		payment 35000
		conversation "interceptor evade end"



mission "Delve Intro [2.1 Interceptor]"
	priority
	name "Mine asteroids in Procyon"
	description "Go to the Procyon system and mine five 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
	mark "Procyon"
	source "Ada"
	destination "Relic"
	to offer
		has "Delve Intro [2 Interceptor]: done"
	substitutions
		"<captain>" "August"
		"<they>" "he"
	
	on offer
		conversation "mining intro"

	on enter "Procyon"
		unmark "Procyon"
	
	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 Procyon or another system before returning.`
	
	on complete
		require "Silicon" 5
		conversation "mining intro end"



mission "Delve 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 have one final mission for you, but 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 "Relic"
	destination "Hestia"
	to offer
		has "Delve Intro [2.1 Interceptor]: done"
	
	on offer
		conversation "intro relic"
	
	on complete
		payment 10000
		log "Dropped James off on Hestia after running a few missions with him. Escort duty is a risky business."
		log "Minor People" "James" `He currently resides on Hestia, having retired from life as a merchant captain.`
		conversation "end of intro missions"



substitutions
	"<intro end suit>" ""
	"<intro end 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."
		has "start: default"
	"<intro end suit>" " You recognize a logo on the collar of the suit that belongs to a famous - and expensive - brand."
		has "start: paradise"

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.<intro end suit> 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.`
	
	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?"`
			to display
				not "intro end: pirates"
		`	"Have you ever met any aliens?"`
			to display
				not "intro end: aliens"
			goto aliens
		`	"Are there any good trade routes you can give me?"`
			to display
				not "intro end: trade"
			goto trade
		`	"Where can I find well-paying jobs?"`
			to display
				not "intro end: jobs"
			goto jobs
		`	"I'm ready to go out on my own."`
			goto end
	action
		set "intro end: pirates"
	`	"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.`
	`	"If you do end up in pirate space, then sometimes the best defense is no defense at all. Pirates will prioritize fighting armed threats over unarmed transports, so if you don't install any weapons, you might be able to sneak away."`
		goto choices
	
	label aliens
	action
		set "intro end: 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 choices
	
	label trade
	action
		set "intro end: 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 choices
	
	label jobs
	action
		set "intro end: 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."`
		goto choices
		
	label end
	action
		clear "intro end: pirates"
		clear "intro end: aliens"
		clear "intro end: trade"
		clear "intro end: jobs"
	`	James 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."`
