# Copyright (c) 2015 by Michael Zahniser
#
# Endless Sky is free software: you can redistribute it and/or modify it under the
# terms of the GNU General Public License as published by the Free Software
# Foundation, either version 3 of the License, or (at your option) any later version.
#
# Endless Sky is distributed in the hope that it will be useful, but WITHOUT ANY
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
# PARTICULAR PURPOSE.  See the GNU General Public License for more details.

mission "First Contact: Wanderer (Before Hai)"
	landing
	source
		attributes "wanderer"
	to offer
		not "First Contact: Hai: offered"
	on offer
		conversation
			`All the other worlds belonging to this species have appeared unwilling to let you land, but here you find a slightly warmer welcome. A cloud of small, highly maneuverable patrol ships takes off from the planet as you approach and herds you onto one particular landing pad where, after a few minutes, several of the aliens approach your ship.`
			`	This species is birdlike, but with bodies nearly as large as yours, and with wings that tower above you. They come swooping down from the sky, circle your ship to inspect it, and then land near the hatch and wait for you to open it. They do not appear to be armed, but their talons are three or four inches long.`
			`	Hesitantly, you open your hatch and greet them. One of the aliens speaks to you: a chirping, clicking noise. You have no idea what it is saying.`
			choice
				`	"Hello. I come in peace."`
				`	"My name is <first>. I am glad to meet you."`
			`	The alien leans forward as you speak, as if trying to decipher your words. "Iyik'ka'ak kareek elik, ek karu karai kavet," it says. You shake your head to indicate that you do not understand, and again try to speak to it in your own language. Again it leans forward as if deeply focused on what you are saying.`
			`	The other aliens standing beside it are inspecting you with equal curiosity. Finally, one of them says to the leader, "Ek kalek kiro suk i'hai, sek speru siyek ka'hai esek'ru fer'ek." The leader gestures in response, turning up open palms, and the second alien steps forward and addresses you in an entirely different language, one that does not sound like birdsong at all. In fact, you suspect that it is the language of a different species entirely, but unfortunately it is no more comprehensible to you than the bird's own language.`
			`	They make some further attempts to communicate with you, but without success. Eventually they give up and all but the leader leaves. The leader makes a sweeping gesture to the rest of the spaceport, apparently inviting you to explore.`
				decline

mission "First Contact: Wanderer"
	name "Hai Interpreter?"
	description "The aliens north of Hai space seem to speak the Hai language. If you can find one of the Hai who is willing to interpret, perhaps you can communicate with them."
	landing
	source
		attributes "wanderer"
	to offer
		has "First Contact: Hai: offered"
	to complete
		has "Wanderers: Diplomacy: offered"
	on offer
		conversation
			branch revisit
				has "First Contact: Wanderer (Before Hai): offered"
			`All the other worlds belonging to this species have appeared unwilling to let you land, but here you find a slightly warmer welcome. A cloud of small, highly maneuverable patrol ships takes off from the planet as you approach and herds you onto one particular landing pad where, after a few minutes, several of the aliens approach your ship.`
			`	This species is birdlike, but with bodies nearly as large as yours, and with wings that tower above you. They come swooping down from the sky, circle your ship to inspect it, and then land near the hatch and wait for you to open it. They do not appear to be armed, but their talons are three or four inches long.`
			`	Hesitantly, you open your hatch and greet them. One of the aliens speaks to you: a chirping, clicking noise. You have no idea what it is saying.`
			choice
				`	"Hello. I come in peace."`
				`	"My name is <first>. I am glad to meet you."`
			`	The alien leans forward as you speak, as if trying to decipher your words. "Iyik'ka'ak kareek elik, ek karu karai kavet," it says. You shake your head to indicate that you do not understand, and again try to speak to it in your own language. Again it leans forward as if deeply focused on what you are saying.`
				goto hai
			
			label revisit
			`As before, you are ushered to the ground by a flock of the small alien ships, and a few of them fly over to your ship and wait for your to come out and try to talk to them. Also as before, you do not recognize their language and they do not understand yours, although their leader seem to be focused intently on trying to understand you.`
			
			label hai
			`	The other aliens standing beside it are inspecting you with equal curiosity. Finally, one of them says to the leader, "Ek kalek kiro suk i'hai, sek speru siyek ka'hai esek'ru fer'ek." The leader gestures in response, turning up open palms, and the second alien steps forward and begins speaking in an entirely different language. After a moment, you are startled to realize that it is speaking the language of the Hai.`
			`	"Hai, You speak the Hai language?" you ask. You cup your hands above your ears to mimic the large, rodent-like ears of the Hai.`
			`	"Iy, ka'hai!" says the alien, rustling its wings in what you take as a gesture of excitement, "Speru ek ka'hai?" At the same time, though, one of the other aliens takes a step back and flexes its talons at you. It occurs to you that the Hai may or may not be viewed favorably here.`
			choice
				`	"Sorry, I don't speak their language."`
				`	"Are there any Hai here?"`
			`	The same alien speaks again, pantomiming your ship flying into the sky and then returning, and then points to your airlock and mimics your rodent-ear gesture for the Hai. You think it is telling you to go find one of the Hai who can serve as an interpreter, and bring them back here.`
				accept

mission "Wanderers: Hai Diplomat"
	description "Travel to Hai-home to pick up a diplomat who can help you communicate with the Wanderers."
	landing
	source
		near "Ya Hai" 1 100
		government Hai
	destination "Hai-home"
	clearance
	to offer
		has "First Contact: Wanderer: offered"
		not "Wanderers: Diplomacy: offered"
	on offer
		conversation
			`The aliens north of Hai space seem to speak the Hai language. Do you want to look for someone here who could serve as an interpreter?`
			choice
				`	(Yes.)`
				`	(Not right now.)`
					defer
			`	You manage to contact the local governor's office, but when you speak with the governor he says, "First contact? Human, this is not a task for just any Hai. You must go to our home world, where an official ambassador can join you. I will contact them and tell them to expect you."`
				accept
	on accept
		"reputation: Hai" >?= 20

mission "Wanderers: Diplomacy"
	description "Travel to the Wanderer homeworld with a Hai ambassador who can help communicate with them."
	landing
	source "Hai-home"
	destination "Vara K'chrai"
	clearance
	passengers 1
	to offer
		has "First Contact: Wanderer: offered"
	on offer
		conversation
			`As you are approaching Hai-home, you contact the Hai government and ask if they would be willing to provide an ambassador to help you communicate with the aliens to the north, who seem to speak the Hai language. They immediately direct you to a private government hangar, where a diplomat meets you. She holds out a paw to greet you, and says, "My name is Sayari. I was the envoy to the human government, a century ago." To the best of your knowledge, the Republic has never mentioned the Hai or publicly acknowledged receiving an envoy from them.`
			choice
				`	"Wait, the human Republic knows that the Hai exists? I had heard nothing but vague rumors of your existence before I found the wormhole."`
				`	"I'm pleased to meet you. Are you willing to travel with me?"`
					goto travel
			
			`	She laughs, in the Hai manner: a rapid chittering sound. "Yes, the humans and the Hai both worried that too many humans would emigrate all at once if they knew of our peaceful lands. So we agreed that the Hai would be a secret, always here for the adventurous to discover, but difficult to find, so that the human immigration would be slow enough for us to gradually adjust to it."`
			`	"Are you the translator who will travel with me?" you ask.`
			label travel
			`	"Yes," she says. "If these aliens will provide a place for me, I mean to live with them permanently, an ambassador between their people and ours. I am old, and in need of a great novelty like this to make my life interesting once more." You note that the fur on her face, especially on the snout, has turned from brown to silvery grey - a sign of age in terrestrial creatures, and perhaps in the Hai as well.`
			choice
				`	"I'm glad to have the company of such a distinguished ambassador. Let's go visit these aliens immediately!"`
					accept
				`	"What if the humans want our own envoy to these aliens?"`
			`	She says, "If they prove to be friendly, I will help you to find a way to communicate with them directly, so you need not use me as an intermediary. But our first step must be to speak with them." You help her aboard your ship, and get ready to return to the alien homeworld.`
				accept
	
	on accept
		fail "First Contact: Wanderer"

mission "Wanderers: Translation Machine"
	description "Sayari, the Hai ambassador, suggested that you visit <destination>, where Hai technologists are working on translation machines."
	landing
	source "Vara K'chrai"
	destination "Greenwater"
	to offer
		has "Wanderers: Diplomacy: done"
	on offer
		conversation
			`Once again, the Wanderers allow you to land, but with a large flock of of their light warships surrounding you to herd you into a particular landing zone. A small delegation of Wanderers meets you and Sayari, whom they greet hesitantly in the Hai language. She responds, and a heated exchange follows. You do not understand any of what they are saying.`
			choice
				`	(Ask her what they are talking about.)`
				`	(Wait for a break in the conversation.)`
			`	She holds up a paw to you while speaking a few more sentences to them, then says, "They are saying that the Hai are attacking them, and they want to know why. It must be the Unfettered who are raiding them, and I am trying to explain that the Unfettered do not represent the Hai people as a whole."`
			`	They continue talking for a while, and then the Wanderers ask you a question. Sayari translates, "They want to know what human beings want, and why you have come to their territory."`
			choice
				`	"I'm just an individual explorer. I don't represent my species or their governments."`
					goto explorer
				`	"My hope is that our species might both benefit from trading goods and technologies with each other."`
					goto trade
				`	"I believe that different species should communicate with each other rather than remaining in forced isolation."`
					goto communication
			
			label explorer
			`	They respond, and Sayari translates, "They say that like you, they are travelers, and this region of space is not their home, so they will gladly welcome other sojourners here. But they warn you that if you betray their trust, you will not find that trust easy to regain. They also say..." She pauses as the Wanderers speak again, then continues translating. "They say that in their travels, they have met few species truly capable of living in peace, and they hope that yours is one of them, because..." Again she pauses as the Wanderers speak, then says, "Because, they hate to make new friends only to lose them again."`
				goto end
			
			label trade
			`	They respond, and Sayari translates, "They say that they would perhaps be willing to trade with you, although to form a broader trade agreement with humans would be a serious decision and one they cannot make lightly." She pauses to listen again, and then continues, "They also say that they will discuss among themselves whether you should be given access to Wanderer technology, but again, that will not be a swiftly made decision." She pauses as the Wanderers speak again, then continues translating. "They say that in their travels, they have met few species truly capable of living in peace, and they hope that yours is one of them, because..." Again she pauses as the Wanderers speak, then says, "Because, they hate to make new friends only to lose them again."`
				goto end
			
			label communication
			`	They respond, and Sayari translates, "They say that their species has encountered many other species in the past, and always has found those encounters to be valuable. Although..." She pauses to listen as the Wanderers continue speaking. "Although, they say that in their travels, far more often than they encounter living species, they instead only find themselves sifting through the refuse of a species that has destroyed itself through war or carelessness. They hope that you are not such a species, because..." Again she pauses as the Wanderers speak, then says, "Because, they hate to make new friends only to lose them again."`
			
			label end
			`	Speaking through Sayari, you try to reassure the Wanderers that you have peaceful intentions. They speak with her for a while longer. She tells you, "They say that I will be allowed to stay here as an ambassador, and they will also let you land on most of their worlds. But they will not welcome any other Hai into their territory. I fear that they distrust the Hai because of the actions of the Unfettered, and being associated with me may harm your chances to win their favor. For your sake, we should find a different way for you to communicate with them."`
			choice
				`	"How can we do that?"`
			`	She says, "There are scientists on the Hai world of <planet> who develop speaking machines, to allow the Hai who do not know the human language to communicate with humans. I will write a letter asking them to give you one of these speaking machines, so that you may talk with the Wanderers without needing me as an intermediary."`
				accept
	on accept
		"reputation: Wanderer" >?= 10

mission "Human Cultural Archives"
	description "Eruk, the Hai technologist on <origin>, has agreed to give you a translation machine if you can somehow get him a copy of the human cultural data from <destination>."
	landing
	source "Greenwater"
	destination "Alexandria"
	to offer
		has "Wanderers: Translation Machine: done"
	on offer
		conversation
			`You land on <origin> and seek out the technologist that Sayari told you to contact: a Hai named Eruk. His eyes light up when you describe what you need from him, and why. "Contact with a new species! How very exciting," he says. "I am glad for Sayari that such an opportunity has been presented to her. But our speaking machines are very valuable. Before I give one to you, will you do a small favor for me?"`
			choice
				`	"Of course. What do you need?"`
					goto need
				`	"Can't I just pay you for one?"`
					goto money
			
			label need
			`	He says, "The human immigrants tell me that in the region of your space they call the Deep is a space station, a library that houses human cultural artifacts and a database of human literature and history. Bring me a copy of that database, and I will give you a speaking machine."`
				goto end
			
			label money
			`	"Money?" he says, with a dismissive gesture. "What use is money? No, from you I desire something far more valuable. The human immigrants tell me that in the region of your space they call the Deep is a space station, a library that houses human cultural artifacts and a database of human literature and history. Bring me a copy of that database, and I will give you a speaking machine."`
				goto end
			
			label end
			choice
				`	"No problem, I'll bring you a copy of the database as soon as I can."`
					accept
				`	"How will I convince them to give me a copy of their data?"`
			`	Your question seems to utterly confuse him. "Information," he says. "It is what you call a non-rival good, is it not? When I give information, I do not lose it. Sharing it costs me nothing. The librarians, surely they will understand this. Have no fear."`
				accept
	on complete
		payment -40

mission "Cultural Data to Greenwater"
	description "Bring a copy of the human cultural archives to <destination>, in exchange for a translation machine."
	landing
	source "Alexandria"
	destination "Greenwater"
	to offer
		has "Human Cultural Archives: done"
	on offer
		conversation
			`You had wondered how you would get a copy of the entire cultural archive, but it turns out to be easier than expected. The station has a small museum gift shop, which sells a copy of the archives on a data card. ("The perfect gift for the budding historian in your family! Hold all of human history in the palm of your hand. On sale now for only 39.99!") Given that a cheap data card costs a fraction of a credit, it's a bit of a rip-off, but you gladly buy one to take back to Eruk.`
				accept

mission "Visit Wanderers Again"
	description "Return to the Wanderer homeworld of <destination>, with a device that will allow you to converse with them more freely."
	landing
	source "Greenwater"
	destination "Vara K'chrai"
	to offer
		has "Human Cultural Archives: done"
	on offer
		conversation
			`You return to Eruk's workshop and give him the data card. His eyes light up with excitement. "I have spent my whole life studying human culture," he says. "This is a treasure to me. And now, here is your speaking machine." He hands you a small, spherical device, with speakers and microphones mounted on it, as well as what look like camera lenses. "The device is programmed with the human and Hai languages," he says. "It is not always possible to translate perfectly between our two languages, but it will try to give you a sense of the range of meanings in what is being said."`
			choice
				`	"Thank you. I'm eager to try it out!"`
					accept
				`	"Is there anything else I need to know?"`
			`	He humors you by demonstrating how the machine works, holding a conversation with you where he speaks in the Hai language, and the machine automatically translates for you and then translates your responses back into his language. It apparently uses its cameras to track who you are speaking to or listening to. It's an impressive piece of technology, and easy enough to use. You thank him for his help, and return to your ship.`
				accept
	
	on accept
		set "language: Wanderer"
		event "wanderer technology available"

event "wanderer technology available"
	planet "Vara K'chrai"
		outfitter "Wanderer Advanced"
	planet "Vara Rakak"
		outfitter "Wanderer Advanced"
	planet "Varu K'est"
		outfitter "Wanderer Advanced"
	planet "Varu Mer'ek"
		outfitter "Wanderer Advanced"
	planet "Var' Kayi"
		outfitter "Wanderer Advanced"
	planet "Vara Ke'stai"
		outfitter "Wanderer Basics"
	planet "Vara Kehi'ki"
		outfitter "Wanderer Basics"
	planet "Varu Ek'lak'lai"
		outfitter "Wanderer Basics"
	planet "Varu K'prai"
		outfitter "Wanderer Basics"
	planet "Varu Tek'kai"
		outfitter "Wanderer Basics"
	planet "Varu Tev'kei"
		outfitter "Wanderer Basics"
	planet "Var' Kar'i'i"
		outfitter "Wanderer Basics"
	government "Wanderer"
		"friendly hail" "friendly wanderer"

mission "Wanderers Conversation"
	landing
	source "Vara K'chrai"
	to offer
		has "Visit Wanderers Again: done"
	on offer
		conversation
			`With the help of your new translation device, you are able to contact the Wanderer government. They welcome you back and tell you that a Wanderer named "Iktat Rek" has been appointed as the official envoy to deal with human visitors, and he should be arriving at your landing pad shortly.`
			`	Rek is slightly larger than most of the Wanderers you have seen, with muted white and brown plumage and a calm, dignified bearing. "It is very [rare, exceptional] in our history that we have to [deal with, cope with] other species," he says, "and now we find ourselves dealing with two at once." He is speaking the Hai language, and the translation device does its best to render his words in your own language.`
			choice
				`	"How did you learn the Hai language?"`
					goto language
				`	"How long have you been fighting the Unfettered Hai?"`
			
			`	"It has been nearly twenty [years, cycles] now," he says. "At first only a single Hai ship [visited, invaded] us, but back then we had no defenses in place to stop it. For years the ship only [harvested, stole] food from our frontier worlds, and avoided combat. In our culture it is an [obligation, duty] to share our food with one who [asks for, demands] it, so we did not oppose the Hai ship. But then more Hai ships came, attacked one of our worlds and took it for themselves, and killed many of our people. We built warships and drove them back, and yet their [raids, attacks] still continue."`
				goto food
			
			label language
			`	"Recently we managed to [take, capture] some of them as prisoners," he says. "They have been [raiding, visiting] us for twenty [years, cycles]. At first they only stole unguarded stores of food, and fled if we approached. We allowed them to take it, because in our culture it is a [duty, obligation] to share our food with those who [ask for, demand] it. But recently they have become far more [aggressive, desperate]. They captured one of our worlds and killed many Wanderers, and we built warships  and drove them back. Some of them tried to hide on the planet, and we made them our [prisoners, guests] and slowly learned their language."`
			label food
			`	"Do you know what the Unfettered want?" you ask.`
			`	"They want food, and [land, elbowroom]," says Rek. "This we guessed when they first raided us, and the Hai named Sayari has confirmed this to me, that the Unfettered have [squandered, consumed] their own worlds and now make war to gain others."`
			choice
				`	"What is the history of your species?"`
					goto history
				`	"How long have the Wanderers been in this region of space?"`
			`	"It is now nearly ten thousand [years, cycles] since we passed through the Eye and entered this [region, territory]," he says.`
				goto eye
			label history
			`	"We are an ancient people," he says. "This [region, territory] is not our homeland. We came here through the Eye nearly ten thousand [years, cycles] ago."`
			label eye
			`	"The Eye?" you ask.`
			`	"A wormhole," he says. "Once in an [eon, era] the Eye opens, and the Wanderers journey through it to a new home. Since the time of our oldest [history, legends] it has been so. A hundred times, maybe a thousand, we have left one home and journeyed to another. Each new home the Eye brings us to is full of [devastation, destruction], and it takes many lifetimes to set things right. Then the Eye beckons again, and we move on. And each time we pass through the eye we become something new."`
			choice
				`	"Why would you travel through the wormhole, if you are leaving fruitful worlds you have worked hard to develop, and only ruined worlds await you on the other side?"`
					goto reason
				`	"What do you mean, you become something new?"`
			`	"The first generation of Wanderers that passes through the wormhole [receive, undergo] the Molt," says Iktat Rek. "They are altered in their [being, essence] and become [giants, people of renown]. Those who stay behind in the safety of the old worlds remain only themselves, and slowly diminish. So all Wanderers who have [courage, ambition] yearn for the Eye to open so our species may once again [grow, evolve]."`
				goto molt
			label reason
			`	"The reason we travel through the Eye is that those who [remain behind, settle] in the easy life on the worlds that need no further [healing, repair] are diminished. But those that pass through the Eye and face the challenge of new worlds undergo the Molt. They are altered in their [being, essence] and become [giants, people of renown]. So all Wanderers who have [courage, ambition] yearn for the Eye to open so our species may once again [grow, evolve]."`
			label molt
			choice
				`	"What makes the wormhole open? Who or what controls it?"`
				`	"Why does the Molt happen? How does it work?"`
			`	"Those are questions that we do not ask," he says. "It is a [taboo? religion? mystery?] for us."`
			`	You ask a few other questions, but do not gain much more information. He does mention that the other Wanderer worlds have agreed to sell you some of their technology, and that you will be allowed to "[view, admire, envy]" their ships, but not to purchase them. You thank him for his time and his willingness to trust a member of an entirely unknown species, and return to your ship.`
				decline

mission "Tell Wanderers about the Pug"
	landing
	source "Vara K'chrai"
	to offer
		has "Wanderers Conversation: offered"
		has "Pug in Wanderer Space: offered"
	on offer
		conversation
			`You have discovered that there is a Pug outpost north of Wanderer space. Since the Pug are known to be able to control wormholes, it is likely that they are the ones that control where and when the Wanderers travel to new worlds. Do you want to tell Iktat Rek about this?`
			choice
				`	(Yes.)`
				`	(No.)`
					decline
			`	You meet with Rek and explain that the Pug are a species known for interfering in the affairs of others, and that you suspect that they are the ones who open the wormhole that causes the whole Wanderer species to migrate. Rek seems unfazed by this information. "I hope you will do nothing to [anger, offend] them," he says.`
			choice
				`	"Of course, but doesn't it bother you that they are controlling your species?"`
				`	"They are manipulating your whole species, using you as a planetary cleanup crew. Don't you want to be free from their control?"`
			`	His feathers ruffle up a bit in response to your comment, but all he says is, "It is a great [gift, blessing] to our species that the Eye leads us to new lands and new challenges whenever we become [complacent, bored]. If another species gains some [advantage, benefit] from our work as well, should that not make us more [glad, eager] to do that work, rather than less?"`
			choice
				`	"But wouldn't you rather be free from their control, free to remain on these worlds you have worked so hard to restore?"`
				`	"If your species is being secretly controlled by another, doesn't that bother you?"`
			`	"Are we being controlled," he says, "or is it a partnership? We have gifts for making [ruined, corrupted] worlds bloom with new life. They give us worlds where our gifts can be [put to use, valuable]. We need new challenges to drive our species to greater [transformation, perfection]. They open new galaxies to us."`
			`	He pauses, and then says, "Of course we know that how the Eye works is too [convenient, tailor-made] to be a random phenomenon. But it is a [gift, blessing] to us, and you must do nothing to drive them away, or we will be [trapped, stranded] on these few worlds and will stagnate and decline."`
				decline

mission "Wanderers: Defend Vara Ke'sok"
	description "Defend <planet> from an Unfettered attack by driving off or destroying the Hai ships."
	landing
	source "Vara Ke'sok"
	to offer
		has "Wanderers Conversation: offered"
		random < 50
	on offer
		conversation
			`Soon after you land in the spaceport, there is a flurry of activity as many of the Wanderers fly to their ships, which begin to take off from the planet. In the sky, you see bright flashes that may be distant weapons fire or explosions.`
			`	You are buffeted by wind as one of the Wanderers lands next to your ship and says, in the Hai language, "Unfettered [raider, pirate] fleet comes. We have put food on freighter, hope they take [offering, gift] and leave. If not [appeased, satisfied] you help convince them to leave. Yes?"`
			choice
				`	"Yes, I will help drive the Unfettered away."`
					goto yes
				`	"No, I will not help you fight them."`
			`	The Wanderer flies off to join the defense effort. A few hours later, the flashes in the sky end; the Unfettered have either been destroyed, or have gotten what they wanted and left.`
				defer
			label yes
			`	The Wanderer leaves to join one of the ships that is taking off, and you quickly ready your own ship to follow...`
				launch
	on accept
		"reputation: Hai (Unfettered)" <?= -1
		event "Sich'ka'ara empty"
	on complete
		event "Sich'ka'ara restored"
	
	npc
		government "Wanderer"
		personality derelict fleeing uninterested waiting pacifist
		fleet
			names "wanderer"
			variant
				"Deep River"
				"Deep River 4"
				"Strong Wind" 2
	npc evade
		government "Hai (Unfettered)"
		personality coward waiting disables plunders
		fleet
			names "hai"
			variant
				"Shield Beetle (Jump)" 4
	npc
		government "Wanderer"
		personality waiting heroic uninterested
		fleet
			names "wanderer"
			variant
				"Strong Wind"
				"Summer Leaf" 2
	npc
		government "Wanderer"
		personality heroic uninterested
		fleet
			names "wanderer"
			variant
				"Summer Leaf" 4

event "Sich'ka'ara empty"
	system "Sich'ka'ara"
		fleet "Wanderer Drones" 3000

event "Sich'ka'ara restored"
	system "Sich'ka'ara"
		fleet "Wanderer Freight" 600
		fleet "Wanderer Drones" 3000
		fleet "Wanderer Defense" 2000

mission "Wanderers: Defended Vara Ke'sok"
	name "Report to <planet>"
	description "Report to the Wanderer elders on <destination> that the Unfettered attacks are intensifying and moving farther in from the front."
	landing
	source "Vara Ke'sok"
	destination "Vara K'chrai"
	to offer
		has "Wanderers: Defend Vara Ke'sok: done"
	on offer
		conversation
			`One of the Wanderers thanks you for your assistance. "These foes become more [dangerous, aggressive]," it says. "You will report to [leaders, elders] on <planet>. They must decide our [action, response]."`
				accept

mission "Wanderers: Unfettered Diplomacy 1"
	name "Unfettered Diplomacy"
	description "Pick up a shipment of food on the Wanderer planet <destination>, to be delivered to the Unfettered as a peace offering."
	landing
	source "Vara K'chrai"
	destination "Var' Kar'i'i"
	passengers 1
	to offer
		has "Wanderers: Defended Vara Ke'sok: done"
	on offer
		conversation
			`On <origin>, you meet up with Iktat Rek and the Hai ambassador Sayari, and tell them that you just helped to drive off an Unfettered raid on the Wanderer water world of Vara Ke'sok. "The situation is not [sustainable, livable]," says Rek. "Perhaps the Unfettered are the ones [chosen, intended] to [inherit, receive] the fruit of our labors here, but until the Eye beckons us to a new [home, place] we have nowhere else to go."`
			choice
				`	"You're saying that after working so hard to restore these worlds, you would give them to someone as destructive as the Unfettered?"`
				`	"That can't be right. The Unfettered wrecked their own worlds. They would wreck yours as well."`
			`	"That is the [way, calling] of the Wanderers," says Rek. "We [restore, repair] worlds and leave them to others, knowing that their new [caretakers, overseers] will squander their wealth."`
			`	"But why?" you ask. "Why do so much work for the sake of others who will waste what you have made?"`
			`	"Because we have tended the graveyards of a hundred failed species," says Rek, "who [spent, burned] all their resources before learning [wisdom, balance]. Put any creature in too small a cage, and it will [befoul, soil, defile] its own home and die. Give it more [space, opportunity] and it may flourish." He says to Sayari, "Ambassador, are we [foolish, simple] to have this hope?"`
			`	Sayari says, "The Unfettered did not make war with you or with us until recently, when their three worlds began to die. Give them a new frontier, and we may have peace again."`
			choice
				`	"But what can we do about their attacks?"`
					goto attacks
				`	"Rather than helping to expand and clean up those 'cages,' why not do something about the ones who built those cages in the first place?"`
			`	Sayari says, "Set every species loose to make war on each other? That would be foolishness. War favors the strong, not the wise."`
			`	Iktat Rek nods in agreement. "Life is too [prolific, creative]," he says. "New species are born too often, and new planets, too seldom, if each species were to take all that it [demands, covets]. So, there must be [limits, divisions]."`
			`	"Then what can we do about the Unfettered?" you ask, "Won't they eventually desire even more?"`
			label attacks
			`	Sayari says, "To buy time, you can offer them food in exchange for peace. Call it 'tribute,' not charity, or you will offend their pride."`
			`	Rek says, "This is the best [plan, option] I have heard. <last>, will you carry me to <planet> to arrange for a shipment of food?"`
			choice
				`	"Sure, I can do that."`
					accept
				`	"Sorry, I don't want to assist the Wanderers any more."`
					decline

ship "Deep River" "Deep River (Jump, Unarmed)"
	outfits
		"White Sun Reactor"
		"Dark Storm Shielding" 3
		"Fuel Pod"
		"Type 2 Radiant Thruster"
		"Type 4 Radiant Steering"
		"Jump Drive"

mission "Wanderers: Unfettered Diplomacy 1A"
	name "Unfettered Diplomacy"
	description `Escort a freighter carrying "tribute" to the Unfettered world of <destination>. You may need to bribe the Unfettered to keep them from attacking you.`
	landing
	source "Var' Kar'i'i"
	destination "Firelode"
	clearance
	passengers 1
	to offer
		has "Wanderers: Unfettered Diplomacy 1: done"
	on offer
		conversation
			`Once you arrive on <origin>, Iktat Rek explains, "We have [captured, salvaged] a few jump drives from the Unfettered, and installed one in a freighter. To avoid [provoking, threatening] the Unfettered, the freighter is unarmed. It would be a bad start to our [diplomacy, peacemaking] to strike the Unfettered with Wanderer weapons."`
			choice
				`	"Does that mean I should not fire on them either?"`
				`	"What should we do if they attack us, then?"`
			`	"I would prefer that you avoid combat," he says. "The Unfettered are said to be [greedy, eager] for bribes, if you are willing to spend money to buy peace. Or simply avoid returning fire; the freighter is well shielded."`
			`	It takes several hours for the massive Wanderer freighter to be loaded. Rek explains that they have kept track of which kinds of food the Unfettered prefer to steal, so they know what will be edible for them. He says, "Our destination is called <planet>. Sayari tells me that all Hai share a [custom, taboo] concerning guests, so once we land on their planet we will be able to [speak, parley] with them in safety."`
				accept
	npc accompany save
		government "Wanderer"
		personality timid escort
		ship "Deep River (Jump, Unarmed)" "Ayi'i Ki'ak'var"

mission "Wanderers: Unfettered Diplomacy 1B"
	name "Unfettered Diplomacy"
	description "Escort this Wanderer freighter safely back to <destination>."
	landing
	source "Firelode"
	destination "Var' Kar'i'i"
	passengers 1
	to offer
		has "Wanderers: Unfettered Diplomacy 1A: done"
	on offer
		conversation
			`The Unfettered make no attempt to attack you once you have landed on their planet. The Wanderer crew begins unloading the crates of food onto the landing pad, and eventually a small delegation of Unfettered leaders approaches. Itkat Rek explains that the food is a peace offering.`
			`	"It is far too little," says the Unfettered leader, "too little to pay us back for the ships you have destroyed and the worlds you have stolen. Until you give us back our worlds, we cannot have peace."`
			choice
				`	(Let Iktat Rek do the talking.)`
					goto rek
				`	"You mean the ships that were destroyed while they were pillaging the Wanderers? You expect them to pay you back for those?"`
			`	"Peace, human," says Iktat Rek. "We are not here to decide who is right." He gestures to you to step back and allow him to speak with the Hai alone.`
			label rek
			`	"This is indeed only a [token, foretaste]," says Iktat Rek. "We have plenty more to offer, and surely you see that for us to fight each other is wasteful."`
			`	They talk for a while longer. Eventually the Hai leader settles on a deal: "We will send you freighters. Whenever the freighter comes, you will fill it with food. If not, it is war. If you attack the freighter, it is war. And you must let us reclaim one of our worlds."`
			`	Iktat Rek says, "We will give you food, but I am not [authorized, permitted] to give you a world. I must speak to our [government, elders]." The Hai agree to that, and you get ready to return the freighter to <planet>.`
				accept
	on accept
		event "wanderer / unfettered peace"
	npc accompany save
		government "Wanderer"
		personality timid escort
		ship "Deep River (Jump, Unarmed)" "Ayi'i Ki'ak'var"

fleet "Unfettered Tribute"
	government "Hai (Unfettered)"
	names "hai"
	cargo 3
	variant
		"Water Bug (Jump)"

event "wanderer / unfettered peace"
	"reputation: Hai (Unfettered)" >?= 1
	government "Hai (Unfettered)"
		"attitude toward"
			"Hai" -.1
			"Wanderer" 0
			"Pug" -.1
	system "Ehma Ti"
		fleet "Small Unfettered" 500
		fleet "Large Unfettered" 500
		fleet "Unfettered Tribute" 1000
	system "Chy'chra"
		fleet "Wanderer Freight" 1500
		fleet "Wanderer Drones" 1000
		fleet "Wanderer Defense" 300
		fleet "Unfettered Tribute" 2000
	system "Prakacha'a"
		fleet "Wanderer Freight" 400
		fleet "Wanderer Drones" 400
		fleet "Wanderer Defense" 400
		fleet "Unfettered Tribute" 2000

mission "Wanderers: Unfettered Diplomacy 1C"
	name "Unfettered Diplomacy"
	description "Return Iktat Rek to <destination>."
	landing
	source "Var' Kar'i'i"
	destination "Vara K'chrai"
	passengers 1
	to offer
		has "Wanderers: Unfettered Diplomacy 1B: done"
	on offer
		conversation
			`You drop the freighter off safely on <origin>. Iktat Rek says, "Now I must return to our home, to [discuss, plan] with our elders. We cannot trust the Unfettered with a world in our space; they would build a [garrison, war fleet] there and attack us. But perhaps this [agreement, settlement] will give us peace for long enough to find a better solution."`
				accept
	on complete
		"reputation: Wanderer" >?= 20
		set "license: Wanderer"
		conversation
			`When you return to <planet>, Iktat Rek meets with ambassador Sayari and a few of the Wanderer elders. The elders thank you for the role that you played in negotiating a temporary peace, and Rek says, "We will [reward, honor] you by allowing you to purchase our ships, all but the [ship of war, battleship]."`
			`	The elders seem to agree that this is only a temporary solution. The Unfettered cannot be granted a base in Wanderer territory: they would use their few jump drives to move a few warships at a time to that base until they had a fleet too strong for the Wanderers to defeat. Sooner or later, the Unfettered will grow tired of demanding such a base and will return to open warfare.`
			`	In the meantime, the only way to defuse the situation would be to get all the jump drives out of the hands of the Unfettered - and that means discovering and stopping whoever is supplying those drives to them.`
