*label smart

*if sector = 0
	*goto_scene sector_zero

*if credits >= 1000000
	*check_achievements
	*if choice_achieved_money = false
		*achieve money
		
*if credits >= 100000
	*check_achievements
	*if choice_achieved_businessperson = false
		*achieve businessperson
		
*if (credits > 9999) and (story_mode = false)
	*check_achievements
	*if choice_achieved_arcade = false
		*achieve arcade

*if move_counter >= 999999
	*set move_counter 0
	
*if move_counter >= payday_counter
	*set asteroid_payday true
	*set payday_counter (move_counter + 7)
	
*gosub_scene ship_status_check
*gosub_scene ship_status_check warning

🌌  [b]Current Location[/b]: Quadrant ${quadrant}, Sector ${sector}

*gosub chocolate_cakes

*if planet = true
	*goto planet_menu
*elseif starbase = true
	*goto starbase_menu
*elseif asteroid = true
	*goto asteroid_menu
*elseif blackhole = true
	*goto blackhole_menu
*else
	*goto nav_menu

*label blackhole_menu

*temp mark 1
*temp bearing 1

*rand mark 1 24
*rand bearing 1 365
*rand dieroll 5001 8961

*if sound
	*sound warning.wav

🔅 Navigation has identified a ⚫ [b]Black Hole[/b], bearing ${bearing}, mark ${mark}, range ${dieroll} kilometers.

The immense gravitational force of the Black Hole is too powerful for the ${ship_name}'s impulse thrusters to escape!

*if (rp = true) and (rp_quiet = false)
	${rp_emoji} "I think we should ask for help, ${name}."

[b]:::[/b] What do you want to do, Captain?

*fake_choice
	#🧯 Call for assistance
	*selectable_if (fuel > 19) #💫  Make an emergency warp jump
		*set oppo_name "⚫ Black Hole"
		*check_achievements
		*if choice_achieved_black_hole = false
			*achieve black_hole
		*goto_scene ship_fight warp
	
*label mayday

🌌  [b]Current Location[/b]: Quadrant ${quadrant}, Sector ${sector}

*if sound
	*sound stcommunicator.wav

You open the emergency communications channel.

📶 "This is Captain ${name} of the ${ship_name}, hailing anyone receiving this transmission.  My ship has been caught in the pull of a Black Hole in quadrant ${quadrant}, sector ${sector}.  Mayday!  Mayday!  I am urgently in need of assistance!"

*rand dieroll 1 7

*if dieroll = 1
	*goto answer
*else
	*goto no_answer

*label answer

A moment later, you get a response.

📶🧑‍🚒 "[i]Mayday received, ${ship_name}!  We are on our way to your location.[/i]"

*page_break 😌

🌌  [b]Current Location[/b]: Quadrant ${quadrant}, Sector ${sector}

*if sound
	*sound firetruck.mp3
	
*temp mark 1
*temp bearing 1

*rand mark 1 24
*rand bearing 1 365
*rand dieroll 5001 8961

🔅 Navigation has identified a 🚒  [b]Galactic Search and Rescue[/b] vessel, bearing ${bearing}, mark ${mark}, range ${dieroll} kilometers.

📶🧑‍🚒 "[i]Stand by, ${ship_name}.  We will have you out of here in a moment.[/i]"

*if rp
	${rp_emoji} "We're saved, thank the Galactic Spirit!"

The 🚒  [b]Galactic Search and Rescue[/b] vessel then engages its tractor beam.

Slowly and inexorably, you feel your ship being dragged away from the Black Hole and into the next sector.

*page_break 😌

*set sector +1
*if sector = 5
	*set sector 1
	
🌌  [b]Current Location[/b]: Quadrant ${quadrant}, Sector ${sector}

*if sound
	*sound stcommunicator.wav
	
*set blackhole false

*check_achievements
*if choice_achieved_black_hole = false
	*achieve black_hole

📶🧑‍🚒 "[i]All right, it looks like you're clear of the Black Hole, ${ship_name}.[/i]"

After scanning the console, you are happy to see that your ship did not sustain any damage.

📶 "Thank you!" you reply over the communications channel.

*if rp
	${rp_emoji} "Yes, thank you so much for saving our lives!"

*temp cost 0

*if credits < 51
	*set cost 0

*if credits >= 51
	*set cost (credits / 2)
	*set cost round(cost)
	*set credits - cost

*if cost > 1
	📶🧑‍🚒 "[i]Your bill for this emergency tow is ${cost} credits, Captain ${name}.[/i]"
	
	Realizing that you have no choice, you transfer the credits over to the [b]Search and Rescue[/b] ship.
	
*if cost = 0
	📶🧑‍🚒 "[i]Please try to be more careful when navigating this quadrant of space in the future, ${ship_name}.[/i]"
	
*temp polemoji ""

*rand dieroll 1 2

*if dieroll = 1
	*set polemoji "🙋‍♀️"
	
*if dieroll = 2
	*set polemoji "🙋‍♂️"
	
*page_break ${polemoji}

*goto smart

*label no_answer

Unfortunately, you do not receive any response.

*if (rp = true) and (rp_quiet = false)
	${rp_emoji} "Try again, ${name}!"

[b]:::[/b] What do you want to do, Captain?

*fake_choice
	#🧯 Call again for assistance
		*goto mayday
	#💫  Make an emergency warp jump
		*goto_scene ship_fight warp

*label starbase_menu

*temp mark 1
*temp bearing 1

*rand mark 1 24
*rand bearing 1 365
*rand dieroll 5001 8961

*temp plum ""
*set plum "q${quadrant}s${sector}_visited"

*if sound
		*sound tannoy.wav

🔅 Navigation has identified ✴️ [b]${starbase_name}[/b], bearing ${bearing}, mark ${mark}, range ${dieroll} kilometers.

*if (move_counter >= brother_msg_counter) and (story_mode = true)
	*set brother_msg_counter 999999
	*if sound
		*sound spacehailer.wav
		
	📟 Communications has received an incoming tight-beam message from an unidentified transponder:
	
	[i]$!{myrel}, it's me.  I have discovered that the only way to get to Sector Zero is with a special quantum drive that's gold-plated, so some people refer it to as a 'Golden Key'.  Hurry up and find it so you can rescue me and salvage our families' honor![/i]

	[i]Love, your big ${brother}, ${brother_name}.[/i]

*gosub ship_scan

*if police_alerted = true
	*goto_scene police alerted

*if trader_present = true
	*goto_scene traders encounter

*if (passengers_carrying > 0) and (police_alerted = false)
	*gosub_scene passenger_remarks
	
*if (rp = true) and (rp_quiet = false)
	*gosub_scene rp_remarks starbase
	
*label lozenge
	
[i]${ship_name}[/i] status: ${ship_status}

[b]:::[/b] What do you want to do, Captain ${name}?

*fake_choice
	#🛥️ Explore another sector
		*goto impulse
	#💫 Warp to another quadrant
		*goto warp
	#📶 Request permission to dock at the starbase
		*goto hail_starbase
	
*label golden_key

[i]${ship_name}[/i] status: ${ship_status}

[b]:::[/b] What do you want to do, Captain ${name}?

*fake_choice
	#🛠️ Agree to the passenger's offer
	#🛥️ Explore another sector
		*goto impulse
	#💫 Warp to another quadrant
		*goto warp
	#📶 Request permission to dock at the starbase
		*goto hail_starbase
	
🌌  [b]Current Location[/b]: Quadrant ${quadrant}, Sector ${sector}

🧑‍🚀 "Okay, I'll get right on it!  Since the design of that golden warp drive is so unusual, I'll have to work slowly and carefully."

"You just do what you need to do," you say.

*set drive_goal (move_counter + 20)

*goto lozenge

*label planet_menu

*temp mark 1
*temp bearing 1

*rand mark 1 24
*rand bearing 1 365
*rand dieroll 5001 8961

*temp plum ""
*set plum "q${quadrant}s${sector}_visited"

*if {plum} = false
	*set {plum} true
	*if sound
		*sound bing.wav

🔅 Navigation has identified the planet 🪐 [b]${planet_name}[/b], bearing ${bearing}, mark ${mark}, range ${dieroll} kilometers.

*if (move_counter >= brother_msg_counter) and (story_mode = true)
	*set brother_msg_counter 999999
	*if sound
		*sound spacehailer.wav
		
	📟 Communications has received an incoming tight-beam message from an unidentified transponder:
	
	[i]$!{myrel}, it's me.  I have discovered that the only way to get to Sector Zero is with a special quantum drive that's gold-plated, so some people refer it to as a 'Golden Key'.  Hurry up and find it so you can rescue me and salvage our families' honor![/i]

	[i]Love, your big ${brother}.[/i]

*gosub ship_scan

*if police_alerted = true
	*goto_scene police alerted

*if pirate_present = true
	*goto_scene pirate encounter

*if trader_present = true
	*goto_scene traders encounter

*if passengers_carrying > 0
	*gosub_scene passenger_remarks
	
*if (rp = true) and (rp_quiet = false)
	*gosub_scene rp_remarks planet
	
[i]${ship_name}[/i] status: ${ship_status}

[b]:::[/b] What do you want to do, Captain ${name}?

*fake_choice
	#🛥️ Explore another sector
		*goto impulse
	#💫 Warp to another quadrant
		*goto warp
	*selectable_if (planet_scanned = false) #🛰️ Scan the planet
		*goto planet_scan
	#📶 Request permission to land on the planet
		*goto hail_planet
	
*label asteroid_menu

*temp mark 1
*temp bearing 1

*rand mark 1 24
*rand bearing 1 365
*rand dieroll 5001 8961

*temp plum ""
*set plum "q${quadrant}s${sector}_visited"

*if {plum} = false
	*set {plum} true
	*if sound
		*sound winner2.wav

🔅 Navigation has identified 🥔 [b]${asteroid_name}[/b], bearing ${bearing}, mark ${mark}, range ${dieroll} kilometers.

*check_achievements
*if choice_achieved_asteroid_discover = false
	*achieve asteroid_discover

*if (move_counter >= brother_msg_counter) and (story_mode = true)
	*set brother_msg_counter 999999
	*if sound
		*sound spacehailer.wav
		
	📟 Communications has received an incoming tight-beam message from an unidentified transponder:
	
	[i]$!{myrel}, it's me.  I have discovered that the only way to get to Sector Zero is with a special quantum drive that's gold-plated, so some people refer it to as a 'Golden Key'.  Hurry up and find it so you can rescue me and salvage our families' honor![/i]

	[i]Love, your big ${brother}.[/i]

*if (passengers_carrying > 0) and (police_alerted = false)
	*gosub_scene passenger_remarks
	
*if (rp = true) and (rp_quiet = false)
	*gosub_scene rp_remarks asteroid
	
[i]${ship_name}[/i] status: ${ship_status}

[b]:::[/b] What do you want to do, Captain ${name}?

*fake_choice
	#🛥️ Explore another sector
		*goto impulse
	#💫 Warp to another quadrant
		*goto warp
	#🛰️ Scan the asteroid
		*goto scan_asteroid
	*selectable_if (fuel >= 2) #🚀 Land on the asteroid
		*goto_scene asteroid
	
*label planet_scan

*gosub_scene resource_scan {planet_level}

*if sound
	*sound scanning.wav

Scans show that 🪐 [b]${planet_name}[/b] is a Class ${planet_level} planet.

📈 [i]Latest market data[/i]:
*line_break
*line_break
[b]For sale[/b]:
*line_break
*if (resource1_level > 0) and (resource1_level  > 1)
	$!{resource1}: ${resource1_level} units
	*line_break
*if (resource1_level > 0) and (resource1_level = 1)
	$!{resource1}: ${resource1_level} unit
	*line_break
*if (resource2_level > 0) and (resource2_level > 1)
	$!{resource2}	: ${resource2_level} units
	*line_break
*if (resource2_level > 0) and (resource2_level = 1)
	$!{resource2}	: ${resource2_level} unit
	*line_break
*if (resource3_level > 0) and (resource3_level > 1)
	$!{resource3}: ${resource3_level} units	
	*line_break
*if resource3_level = 1
	$!{resource3}: ${resource3_level} units
	*line_break
*if resource4_level > 1
	$!{resource4} : ${resource4_level} units
	*line_break
*if resource4_level = 1
	$!{resource4} : ${resource4_level} unit
	*line_break
*if resource5_level > 1
	$!{resource5}: ${resource5_level} units	
	*line_break
*if resource5_level = 1
	$!{resource5}: ${resource5_level} units
	*line_break
*if resource6_level > 1
	$!{resource6} : ${resource6_level} units
	*line_break
*if resource6_level = 1
	$!{resource6} : ${resource6_level} unit
	*line_break
*if resource7_level > 1
	$!{resource7}: ${resource7_level} units
	*line_break
*if resource7_level = 1
	$!{resource7}: ${resource7_level} unit
	*line_break
*if resource8_level > 1
	$!{resource8}: ${resource8_level} units
	*line_break
*if resource8_level = 1
	$!{resource8}: ${resource8_level} unit
	*line_break
*if resource9_level > 1
	$!{resource9}: ${resource9_level} units
	*line_break
*if resource9_level = 1
	$!{resource9}: ${resource9_level} unit
	*line_break
*if resource10_level > 1
	$!{resource10} : ${resource10_level} units
	*line_break
*if resource10_level = 1
	$!{resource10} : ${resource10_level} unit
	*line_break
*if resource11_level > 1
	$!{resource11} : ${resource11_level} cubes
*if resource11_level = 1
	$!{resource11} : ${resource11_level} cube
	
[b]Want to buy[/b]:
*line_break
*if (resource1_buyprice > 0) and (resource1_buyvolume > 1)
	$!{resource1}: ${resource1_buyvolume} units
	*line_break
*if (resource1_buyprice > 0) and (resource1_buyvolume = 1)
	$!{resource1}: ${resource1_buyvolume} unit
	*line_break
*if (resource2_buyprice > 0) and (resource2_buyvolume > 1)
	$!{resource2} : ${resource2_buyvolume} units
	*line_break
*if (resource2_buyprice > 0) and (resource2_buyvolume = 1)
	$!{resource2} : ${resource2_buyvolume} unit
	*line_break
*if (resource3_buyprice > 0) and (resource3_buyvolume > 1)
	$!{resource3}: ${resource3_buyvolume} units
	*line_break
*if (resource3_buyprice > 0) and (resource3_buyvolume = 1)
	$!{resource3}: ${resource3_buyvolume} unit
	*line_break
*if (resource4_buyprice > 0) and (resource4_buyvolume > 1)
	$!{resource4} : ${resource4_buyvolume} units
	*line_break
*if (resource4_buyprice > 0) and (resource4_buyvolume = 1)
	$!{resource4} : ${resource4_buyvolume} unit
	*line_break
*if (resource5_buyprice > 0) and (resource5_buyvolume > 1)
	$!{resource5}: ${resource5_buyvolume} units	
	*line_break
*if (resource5_buyprice > 0) and (resource5_buyvolume = 1)
	$!{resource5}: ${resource5_buyvolume} unit
	*line_break
*if (resource6_buyprice > 0) and (resource6_buyvolume > 1)
	$!{resource6}: ${resource6_buyvolume} units
	*line_break
*if (resource6_buyprice > 0) and (resource6_buyvolume = 1)
	$!{resource6}: ${resource6_buyvolume} unit
	*line_break
*if (resource7_buyprice > 0) and (resource7_buyvolume > 1)
	$!{resource7}: ${resource7_buyvolume} units
	*line_break
*if (resource7_buyprice > 0) and (resource7_buyvolume = 1)
	$!{resource7}: ${resource7_buyvolume} unit
	*line_break
*if (resource8_buyprice > 0) and (resource8_buyvolume > 1)
	$!{resource8}: ${resource8_buyvolume} units
	*line_break
*if (resource8_buyprice > 0) and (resource8_buyvolume = 1)
	$!{resource8}: ${resource8_buyvolume} units
	*line_break
*if (resource9_buyprice > 0) and (resource9_buyvolume > 1)
	$!{resource9}: ${resource9_buyvolume} units
	*line_break
*if (resource9_buyprice > 0) and (resource9_buyvolume = 1)
	$!{resource9}: ${resource9_buyvolume} unit
	*line_break
*if (resource10_buyprice > 0) and (resource10_buyvolume > 1)
	$!{resource10} : ${resource10_buyvolume} units
	*line_break
*if (resource10_buyprice > 0) and (resource10_buyvolume = 1)
	$!{resource10} : ${resource10_buyvolume} unit
	*line_break
*if (resource11_buyprice > 0) and (resource11_buyvolume > 1)
	$!{resource11}: ${resource11_buyvolume} cubes
*if (resource11_buyprice > 0) and (resource11_buyvolume = 1)
	$!{resource11}: ${resource11_buyvolume} cube
	
	
*set planet_scanned true
	
[b]:::[/b] What do you want to do, Captain ${name}?
	
*fake_choice
	#🛥️ Explore another sector
		*goto impulse
	#💫 Warp to another quadrant
		*goto warp
	#🛃 Land at the planet's spaceport
		*goto hail_planet
		
*label hail_starbase

*if starbases_visited > 5
	*goto_scene starbase

*check_achievements
*if choice_achieved_starbase_hail = false
	*achieve starbase_hail

*if sound
	*sound stcommunicator.wav

🌌  [b]Current Location[/b]: Quadrant ${quadrant}, Sector ${sector}

📶 You hail the Starbase on the public frequency:

"${starbase_name}, by voice ID, I am Captain ${name} of the ${ship_name}.  My vessel registration number is ${regnumber}-Alpha. Requesting permission to dock."

*if (rp = true) and (rp_quiet = false)
	${rp_emoji} "I love visiting starbases, ${name}."

A few moments later comes the automated reply:

*temp b ""

*rand dieroll 1 5

*if dieroll = 1
	*set b "A"
	
*if dieroll = 2
	*set b "B"
	
*if dieroll = 3
	*set b "C"
	
*if dieroll = 4
	*set b "D"
	
*if dieroll = 5
	*set b "E"

*rand dieroll 7 89

🛂 [i]"Voice ID confirmed.  Vessel ${regnumber}-Alpha, you are cleared for docking at Gate ${dieroll}/${b}."[/i]

*fake_choice
	#✴️ Dock at the starbase
		*set move_counter +1
		*set starbases_visited +1
	#📵 Cancel docking request
		*if sound
			*sound stcommunicator.wav
			
		📶		"Uh, something has, uh, suddenly come up, Starbase Control.  You can cancel my clearance for Gate ${dieroll}/${b}," you say.
		
		A moment later comes the automated reply:
		
		🛂 [i]"Docking permission withdrawn."[/i]
		
		*if (rp = true) and (rp_quiet = false)
			${rp_emoji} "You're acting weird, ${name}."
		
		*page_break 🌠 Explore the galaxy
		*goto smart
	
🌌  [b]Current Location[/b]: Quadrant ${quadrant}, Sector ${sector}
	
*if sound
	*sound starbasedocking.wav

Leaning back in your captain's chair, you close the communications channel.

*check_achievements

*if choice_achieved_market_trader = false
	*goto lemon_drops

*if (story_mode = true) and (move_counter > 41)
	Taking advantage of the excellent lasercast signal from ${starbase_name}, you tune your view screen to the news channel.
	
	*page_break 📺
	
	🌌  [b]Current Location[/b]: Quadrant ${quadrant}, Sector ${sector}
	
	*gosub news

	📺 [i]"${news}"[/i]

	*if (rp = true) and (rp_quiet = false)
		${rp_emoji} "Unbelievable."
		
*label lemon_drops
		
*if rp_leaving
	*set rp false
	*set rp_leaving false
	*set rp_quiet false
	${rp_emoji} "Okay, I'm out of here as soon as we dock at the starbase.  Goodbye forever, ${name}."
	
	"I guess this is it," you say.

⏩ A few minutes later, you execute a successful docking procedure at Gate ${dieroll}/${b} and exit your ship.

*page_break Enter Starbase

*goto_scene starbase
	
*label hail_planet

*if sound
	*sound stcommunicator.wav
	
*check_achievements
*if choice_achieved_planet_hail = false
	*achieve planet_hail

*if (visit_counter > 1) and (visit_counter < 3)
	*gosub_scene planet_culture {planet_culture}
	🌌  [b]Current Location[/b]: Quadrant ${quadrant}, Sector ${sector}
	
	📶 You hail ${planet_name} Planetary Control.

	"This is Captain ${name} of the ${ship_name}, requesting permission to land," you say.
	
	*goto cleared

*if (visit_counter >= 11) and (passengers_carrying = 0)
	*goto permission_rejected

*gosub_scene planet_culture {planet_culture}

🌌  [b]Current Location[/b]: Quadrant ${quadrant}, Sector ${sector}

📶 You hail ${planet_name} Planetary Control.

"Planetary Control, this is ${ship_name} requesting permission to land," you say.

*if landing_cleared = true
	*goto cleared

A moment later comes the reply:

🛂 "[i]${greeting}[/i]"

*if (rp = true) and (rp_quiet = false)
	${rp_emoji} "What a strange way to talk."

[b]:::[/b] What do you want to do, Captain ${name}?

*fake_choice
	#🗣️ Give a culturally appropriate response
		*set planet_scanned false
	*selectable_if (planet_scanned = false) #🛰️ Scan the planet
		📶 "One moment, Planetary Control," you say before closing the communication channel.
		*goto planet_scan
	#📵 Break off communications
		"Cancel inbound approach," you tell Planetary Control before closing the communication channel.
		*goto nav_menu2
	
*if sound
	*sound stcommunicator.wav
	
🌌  [b]Current Location[/b]: Quadrant ${quadrant}, Sector ${sector}
	
📶 "${response}" you reply over the communications channel.

*label cleared

*set move_counter +1

A moment later comes the response from ${planet_name}:

🛂 [i]"${clearance}"[/i]

*if planet_scanned = false
	*gosub_scene resource_scan {planet_level}

*set landing_cleared true

*if planet_level = 1
	*rand dieroll 1 3
	
*if planet_level = 2
	*rand dieroll 1 10
	
*if planet_level = 3
	*rand dieroll 1 35
	
*if planet_level = 4
	*rand dieroll 1 75
	
*if planet_level = 5
	*rand dieroll 76 219
	
*label landing

Leaning back in your captain's chair, you close the communications channel.

*if rp_leaving
	*set rp false
	*set rp_leaving false
	*set rp_quiet false
	${rp_emoji} "Okay, I'm out of here as soon as we land.  Goodbye forever, ${name}."
	
	"I guess this is it," you say.

⏬  A few minutes later, you make a successful landing at the spaceport and dock at Platform ${dieroll}.

*check_achievements
*if choice_achieved_planet_land = false
	*achieve planet_land

*if (rp = true) and (rp_quiet = false)
	*if (planet_level = 2) or (planet_level = 4)
		${rp_emoji} "I think I'm just going to stay on the ship, ${name}."
		
	"Suit yourself, ${rp_name}," you say.

*page_break 🧭 Explore ${planet_name}

*set planet_scanned false

*goto_scene spaceport


*label nav_menu

*gosub ship_scan

*if police_alerted = true
	*goto_scene police alerted

*if pirate_present = true
	*goto_scene pirate encounter

*if trader_present = true
	*goto_scene traders encounter

*temp plum ""
*set plum "q${quadrant}s${sector}_visited"

*if {plum} = false
	*set {plum} true
	
*if story_mode = true
	*rand dieroll 1 11
	*if dieroll = 1
		*rand dieroll 201 1799
		*if sound
			*sound teleport.wav
		
		✨ Forward scanners have identified the remains of a recent space battle.
		
		Searching the debris, you discover ${dieroll} credits' worth of salvageable material.
		
		*set credits + dieroll
		
		*check_achievements
		*if choice_achieved_scavenger = false
			*achieve scavenger
			
		*goto shark
	
*if story_mode = false
	*rand dieroll 1 111
	*if dieroll = 111
		⚠️ The ship has entered a meteor field and has sustained minor damage to the hull.
		
		*set ship_hp - 1
		*if ship_hp = 0
			*set ship_hp 1
		
		*goto shark

This sector appears to be empty.

*if (move_counter >= drive_goal) and (passengers_carrying < 1)
	*set drive_goal 999999

*if (move_counter >= drive_goal) and (passengers_carrying = 1)
	*set drive_goal 999999
	*set passengers_bid_price 0
	*set qdrive_installed true
	*check_achievements
	*if choice_achieved_drive_installed = false
		*achieve drive_installed
	
	At long last, your passenger reappears on the bridge.
	
	🧑‍🚀 "Wow, that was quite an interesting engine.  I've heard of golden quantum drives, but I never thought I'd get to work with one.  Okay, Captain name, your new engine is ready to go!"
	
	🧑‍🚀 "Thank you," you reply.
	
	"You can repay me by taking me to the planet ${passenger_destination} for free."
	
	*if rp
		${rp_emoji} "It's the least we can do, kind passenger."
		
	*goto shark

*if move_counter >= food_goal
	*set food_goal 999999
	*set rp_quiet false
	${rp_name} appears on the bridge with a tray of food.
	
	${rp_emoji} "Piping hot, so watch out!"
	
	With a smile, you proceed to eat your fair share.
	
	*goto shark
	
*if move_counter >= kissy_goal
	*set kissy_goal 999999
	*set rp_quiet false
	*goto sexy_menu
	
*if (golden_key = true) and (police_alerted = false)
	*if (passengers_carrying = 1) and (qdrive_installed = false)
		*if (drive_goal - move_counter) > 25
			*gosub_scene passenger_remarks golden_key
			*goto golden_key

*if passengers_carrying > 0
	*gosub_scene passenger_remarks
	
*if (rp = true) and (rp_quiet = false)
	*goto rp_empty

*label shark

[i]${ship_name}[/i] status: ${ship_status}
	
[b]:::[/b] What do you want to do, Captain ${name}?

*fake_choice
	#🛥️ Explore another sector
		*goto impulse
	#💫 Warp to another quadrant
		*goto warp
	
*label sexy_menu

${rp_emoji} "It's time to join me in the bedroom, ${name}."
	
[b]:::[/b] What do you want to do, Captain ${name}?

*fake_choice
	#💋 Join ${rp_name} in the bedroom
	#🛥️ Explore another sector
		${rp_emoji} "Are you freaking kidding me, ${name}?"
		*goto impulse
	#💫 Warp to another quadrant
		${rp_emoji} "Are you freaking kidding me, ${name}?"
		*goto warp
	
🌌  [b]Current Location[/b]: Quadrant ${quadrant}, Sector ${sector}

You engage the autopilot for the ${ship_name} and quickly make your way to your bunk.

${rp_name} is there, waiting for you.

Together, the two of you partake in many intimate delights.

Without saying a word, you find a way to communicate with your bodies, and soon, pleasure begins to course through you both.

${rp_emoji} "You're a wonderful lover, ${name}."

It is only when you are utterly spent that you can lie back on the bed and reflect on what has just taken place.

*page_break ${rp_emoji}

*goto_scene startrip_main
	
*label rp_empty

*rand dieroll 1 3

*if (dieroll = 1) and (rp_quiet = false)
	*gosub_scene rp_remarks empty_sector
	
	[i]${ship_name}[/i] status: ${ship_status}
	
	[b]:::[/b] What do you want to do, Captain ${name}?

	*fake_choice
		#🗣️ Talk to ${rp_name}
			*goto_scene rp_remarks long
		#🛥️ Explore another sector
			*goto impulse
		#💫 Warp to another quadrant
			*goto warp

[i]${ship_name}[/i] status: ${ship_status}
	
[b]:::[/b] What do you want to do, Captain ${name}?

*fake_choice
	#🛥️ Explore another sector
		*goto impulse
	#💫 Warp to another quadrant
		*goto warp
		
*label nav_menu2

*goto smart

🌌  [b]Current Location[/b]: Quadrant ${quadrant}, Sector ${sector}

[i]${ship_name}[/i] status: ${ship_status}
	
[b]:::[/b] What do you want to do, Captain ${name}?

*fake_choice
	*selectable_if (battery >= 5) #🛥️ Use impulse engines to move to another sector
		*goto impulse
	*selectable_if (fuel > 0) #💫 Warp to another quadrant
		*goto warp
	#↩️ Explore other options
		*goto smart
	
*label impulse

🌌  [b]Current Location[/b]: Quadrant ${quadrant}, Sector ${sector}

*if battery < 5
	*goto dead_battery

*rand trader1_quadrant 1 111
*rand trader2_quadrant 1 111
*rand trader3_quadrant 1 111
*rand trader4_quadrant 1 111
*rand trader5_quadrant 1 111

*rand trader1_sector 1 4
*rand trader2_sector 1 4
*rand trader3_sector 1 4
*rand trader4_sector 1 4
*rand trader5_sector 1 4

*set trader_present false

*temp bongo 0
*if story_mode = true
	*set bongo 1

*if story_mode = false
	*set bongo 3

*if qdrive_installed = true
	*goto qmenu

[b]:::[/b] Which sector do you want to move to, Captain ${name}?

*fake_choice
	*selectable_if (sector != 1) #Sector 1
		*set sector 1
		*set battery - bongo
		[i]Impulse engines firing...[/i]
		*set planet_scanned false
		*goto fired_up
	*selectable_if (sector != 2) #Sector 2
		*set sector 2
		*set battery - bongo
		[i]Impulse engines firing...[/i]
		*set planet_scanned false
		*goto fired_up
	*selectable_if (sector != 3) #Sector 3
		*set sector 3
		*set battery - bongo
		[i]Impulse engines firing...[/i]
		*set planet_scanned false
		*goto fired_up
	*selectable_if (sector != 4) #Sector 4
		*set sector 4
		*set battery - bongo
		[i]Impulse engines firing...[/i]
		*set planet_scanned false
		*goto fired_up
	#Belay the last order
		*goto nav_menu2
	
*label qmenu

[b]:::[/b] Which sector do you want to move to, Captain ${name}?

*fake_choice
	*selectable_if (battery > 49) #Sector 0
		*set sector 0
		*set battery - bongo
		[i]Impulse engines firing...[/i]
		*set planet_scanned false
		*goto fired_up
	*selectable_if (sector != 1) #Sector 1
		*set sector 1
		*set battery - bongo
		[i]Impulse engines firing...[/i]
		*set planet_scanned false
		*goto fired_up
	*selectable_if (sector != 2) #Sector 2
		*set sector 2
		*set battery - bongo
		[i]Impulse engines firing...[/i]
		*set planet_scanned false
		*goto fired_up
	*selectable_if (sector != 3) #Sector 3
		*set sector 3
		*set battery - bongo
		[i]Impulse engines firing...[/i]
		*set planet_scanned false
		*goto fired_up
	*selectable_if (sector != 4) #Sector 4
		*set sector 4
		*set battery - bongo
		[i]Impulse engines firing...[/i]
		*set planet_scanned false
		*goto fired_up
	#Belay the last order
		*goto nav_menu2
	
*label fired_up

*check_achievements
*if choice_achieved_impulse = false
	*achieve impulse

*set move_counter +1

*if sector = 0
	*goto_scene sector_zero

*goto smart
	
*label warp

🌌  [b]Current Location[/b]: Quadrant ${quadrant}, Sector ${sector}

[i]Firing up warp engines...[/i]

[b]:::[/b] Which quadrant do you want to move to, Captain ${name}?

*temp temp_quadrant 0

*input_number temp_quadrant 1 111

*if temp_quadrant = quadrant
	*if sound
		*sound warningbleep.wav
		
	You're already in quadrant ${quadrant}!
	*goto nav_menu2

*temp difference 0

*if temp_quadrant > quadrant
	*set difference (temp_quadrant - quadrant)
	
*if temp_quadrant < quadrant
	*set difference (quadrant - temp_quadrant)
	
*temp fuel_usage 0
*temp fuel_burn 0

*set fuel_usage (1 / speed)
*set fuel_burn fuel_usage * difference

*if fuel_burn > fuel
	*goto battery_warp

*if fuel_burn < 1
	*set fuel_burn 1

Course set for Quadrant ${temp_quadrant}.

*set planet_scanned false

*page_break 💫 Engage!

*check_achievements
*if choice_achieved_warp = false
	*achieve warp

*if sound
	*sound fuelburn.mp3

*set quadrant temp_quadrant
*rand sector 1 4

*set fuel_burn round(fuel_burn)
*set fuel  (fuel - fuel_burn)

*gosub_scene ship_status_check

*set move_counter +1

[i]The ${ship_name} travels at ${speed} times the speed of light until you arrive at quadrant ${quadrant}...[/i]

🔥 Fuel burned: ${fuel_burn}
*line_break
🔥 Fuel remaining: ${fuel}

*rand trader1_quadrant 1 111
*rand trader2_quadrant 1 111
*rand trader3_quadrant 1 111
*rand trader4_quadrant 1 111
*rand trader5_quadrant 1 111

*rand trader1_sector 1 4
*rand trader2_sector 1 4
*rand trader3_sector 1 4
*rand trader4_sector 1 4
*rand trader5_sector 1 4

*set trader_present false
*set pirate_present false
*set police_alerted false

*if story_mode = false
	*page_break 🌌

*goto smart

*label battery_warp

You don't have enough fuel to reach Quadrant ${temp_quadrant}!

*if (rp = true) and (rp_quiet = false)
	${rp_emoji} "That's not good."

*if fuel >= 5
	*goto nav_menu2

*fake_choice
	*selectable_if (battery >= 50) #🪫 Use emergency battery power to leave this quadrant
	#↩️ Try something else
		*goto smart
		
🔋 [i]Using emergency battery power, you begin the long slow journey to a new quadrant...[/i]

*if (rp = true) and (rp_quiet = false)
	${rp_emoji} "This is going to take forever.  If you need me, I'll be in my bunk."

*rand dieroll 1 2

*if dieroll = 1
	*set quadrant (quadrant + 1)
	
*if dieroll = 2
	*set quadrant (quadrant - 1)
	
*if quadrant = 112
	*set quadrant 1
	
*if quadrant < 1
	*set quadrant 111
	
*page_break Engage

*set battery 1
*goto smart

*label dead_battery

*if sound
	*sound warning.wav

⚠️ Ship's battery requires emergency recharging before you can power the impulse engines.

[b]:::[/b] What do you want to do, Captain ${name}?

*fake_choice
	#☀️ Deploy solar collectors
		*set battery round(battery)
		*goto trickle
	#↩️ Explore other options
		*goto smart
	
*label trickle

🌌  [b]Current Location[/b]: Quadrant ${quadrant}, Sector ${sector}

[i]A trickle of electrical energy begins refilling your ship's battery.[/i]

*set battery (battery + 0.25)
*if battery > battery_max
	*set battery battery_max

🔋 Current charge: ${battery}

[b]:::[/b] What do you want to do, Captain ${name}?

*fake_choice
	#☀️ Continue recharging battery
		*goto trickle
	#↩️ Explore other options
		*set battery round(battery - 0.9)
		*goto smart
	
*label permission_rejected

🌌  [b]Current Location[/b]: Quadrant ${quadrant}, Sector ${sector}

*if sound
	*sound stcommunicator.wav

📶 You hail ${planet_name} Planetary Control.

"Planetary Control, this is ${ship_name} requesting permission to land," you say.

*gosub_scene planet_culture {planet_culture}

🛂 "[i]${rejection}[/i]"

A moment later, Planetary Control closes the communications channel.

*if rp
	${rp_emoji} "Looks like you need to find somewhere else to go, ${name}."

[b]:::[/b] What do you want to do, Captain?

*fake_choice
	#🛥️ Explore another sector
		*goto impulse
	#💫 Warp to another quadrant
		*goto warp

*label ship_scan

*gosub_scene police presence

*gosub_scene pirate presence

*gosub_scene traders presence

*return

*label scan_asteroid

🌌  [b]Current Location[/b]: Quadrant ${quadrant}, Sector ${sector}

*if sound
	*sound scan.wav
	
Your scans of the asteroid reveal:
	
📈 Development level: ${asteroid_level}
*line_break
🧑‍🏭 Colonists: ${asteroid_colonists}
*line_break
*if asteroid_name != "an unclaimed asteroid"
	📛 Name: ${asteroid_name}
	*line_break
🚩 Owner: ${asteroid_owner}

*if asteroid_level = 0
	This asteroid is available for claiming!
	
	*if (rp = true) and (rp_quiet = false)
		${rp_emoji} "It would be so cool if you had your own asteroid, ${name}."

[b]:::[/b] What do you want to do, Captain?

*fake_choice
	#🛥️ Explore another sector
		*goto impulse
	#💫 Warp to another quadrant
		*goto warp
	*selectable_if (fuel >= 2) #🚀 Land on the asteroid
		*set fuel -2
		*goto_scene asteroid
	
*label news

*temp news ""

*rand dieroll 1 21

*if dieroll = 1
	*set news "The Syndicate has taken one step closer towards control of the Galactic Council after gaining control of three more planetary parliaments.  Political analysts say that, if nothing changes soon, the Syndicate could have an absolute majority on the Galactic Council in just a few months."
	
*if dieroll = 2
	*set news "Two more anti-Syndicate mayors on the outer rim have been reported dead under mysterious circumstances.  Chelsea Lucia Flowers, the recently elected mayor of Klitra, the third largest city on ${planet17_name}, was found dead in her bathtub just hours after giving an anti-Syndicate speech to the Rock Hoppers Guild.  Mayor Genaro Valentin Moses of Ygra on the planet ${planet24_name}, who was also attendance, was rushed from the scene after suffering an apparent bout of food poisoning and was later pronounced dead at Galactic Mercy Hospital on ${starbase3_name}. "
	
*if dieroll = 3
	*set news "According to the latest financial news, weapons purchases are up an astonishing twenty-four percent on the outer planets.  As most of these planets are now controlled by the group known as the Syndicate, some experts are warning of an armed rebellion against the Galactic Council.  However, a spokesperson for the Syndicate dismissed the reports as nonsense and stated that the Syndicate is a law-abiding enterprise with full respect for the Galactic Constitution."
	
*if dieroll = 4
	*set news "A new scientific study has conclusively proven that Sector Zero does not exist.  A research team at Galactic University ${planet33_name} used their large hadron collider to demonstrate that particles decay in three dimensions.  Therefore, there is no hidden sector in the fourth dimension that some popular legends have termed Sector Zero.  'It's time to put this myth to bed once and for all,' said Ice Banegriffon, the lead researcher on the project."
	
*if dieroll = 5
	*temp dic ""
	*set dic (move_counter + 3) 
	*set news "The search is on for a missing Heir.  One prominent family of the central planets has filed a lawsuit at the Galactic Court for the return of their eldest child, whom they say was kidnapped ${dic} days ago by the Syndicate while attending the Club of 50 Games.  A spokesperson for the Syndicate denied the allegations and said, 'We look forward to putting these baseless rumors to rest in court.'"
	
*if dieroll = 6
	*set news "More reports of unrest on the outer planets.  The governments of ${planet99_name}, ${planet77_name}, and ${planet55_name} have reported widespread looting and violents protests following the election of pro-Syndicate parliamentarians."
	
*if dieroll = 7
	*set news "A spokesperson for the Galactic Council has described the Sector Zero movement as 'A fake news cult that preys on the young and the naive.'  The official position of the Galactic Council remains that traveling to the fourth dimension would violate the laws of nature, and is, therefore, impossible for a so-called Sector Zero to exist."
	
*if dieroll = 8
	*set news "The Intergalactic Police have reported a two point four percent increase in crime across the outer planets in the last eight months.  According to the IGP's latest figures, human trafficking is up one point two percent, weapons smuggling eight percent, and rioting is up an astonishing eleven percent."
	
*if dieroll = 9
	*set news "A controversial lasercase personality has been found dead.  Wolf Aeon, who has recently become famous for his lasercast Dirty Secrets of the Syndicate, was reported missing by his partner Melody two days ago.  After an extensive manhunt by the Intergalactic Police, Wolf Aeon's remains were found in a forested area near his home.  The initial report from the coroner is that Wolf Aeon died of dehydration and exposure."
	
*if dieroll = 10
	*set news "According to the latest polls, pro-Syndicate politicians on ${planet13_name} and ${planet53_name} are poised to gain control of their respective planetary parliaments.  If the Syndicate does pick up these two wins, that will bring their share of Electorates to 48.2%, bringing them a step closer to absolute control of the Galactic Council."
	
*if dieroll = 11
	*set news "Another trading ship has been reported missing on the outer planets.  The vessel Tiger Talon was last seen visiting a market on the planet ${planet45_name}, taking on a cargo of ${resource11}.  One witness told the Intergalactic Police that the captain of Tiger Talon got into an argument about the Syndicate at the spaceport bar.  The captain of Tiger Talon then fled the scene and managed to blast off from the planet before an arrest warrant could be issued."
	
*if dieroll = 12
	*set news "The owners of Pigeon class starships have reported an uptick in harassment claims by the IGP.  According to the latest figures, the Intergalactic Police have issued forty-seven citations to Pigeon class captains in the last month, an increase of twenty-four percent compared to last year.  A spokesperson for the IGP dismissed this as a 'statistical anomaly' and that there was no policy in place that singled out Pigeon class vessels for additional security checks."
	
*if dieroll = 13
	*set news "Another report of pirate attacks in the outer planets.  Several viewers of this channel reported seeing an unregistered vessel drifting along the traffic lanes of ${planet101_name}.  The ship would then wait for departing traders to lift off before attacking them and seizing their cargo.  The Intergalactic Police say that they have not yet received an official complaint."
	
*if dieroll = 14
	*set news "An auction will be held tomorrow on the planet ${planet111_name}.  Attendees can bid on some extremely rare and priceless items, including the legendary Golden Key of Direseraph as well as an original copy of the Galactic Constitution.  The valuable collection being auctioned off tomorrow was put together by one of the central planets' most powerful families."
	
*if dieroll = 15
	*set news "Scientists warn that the Red Rot is spreading, threatening the Galaxy's food supply.  First identified on ${planet41_name}, Red Rot is a blight that destroys dry cereals in interplanetary transit.  Four more planetary markets have reported cases of Red Rot, and the race is now on to produce a vaccine before more dry cereals crops are lost."
	
*if dieroll = 16
	*set news "Another planet has announced that it will be joining the entrepreneurial alliance known as the Syndicate.  After lengthy negotiations, the Emir of ${planet64_name} announced that his planet will be joining the Syndicate.  'What can I say?  The Syndicate made me an offer I couldn't refuse,' said the Emir during a press conference."
	
*if dieroll = 17
	*set news "The spaceport on the planet ${planet71_name} will be closed for the next two weeks in order to complete repairs.  A large-scale riot broke out after the arrival of a trading ship there, although it is unclear what sparked the initial confrontation.  One witness claimed that the trader captain was actually an Heir of one of the Great Families in disguise, while another witness claimed that it was a dry cereals shortage that provoked the unrest."
	
*if dieroll = 18
	*set news "In a shocking turn of events, one of the central planets' most powerful families is on the verge of declaring bankruptcy.  According to an anonymous source, the family is deeply in debt to an association known as the Syndicate.  Political experts have noted that the Constitution says that any family unable to pay their debts must relinquish their seats on the Galactic Council."
	
*if dieroll = 19
	*set news "The association known as the Syndicate has announced that it has created a fully autonomous Virtual Trader.  According to the Syndicate's press release, the Virtual Trader will give the Syndicate instant access to market data on all of the outer planets and the ability to arbitrage large volumes of cargo.  The Association of Free Traders condemned the announcement, saying that it will lead to increased prices for consumers."
	
*if dieroll = 20
	*set news "The Supreme Court on the planet ${planet89_name} has ruled that defaming the association known as the Syndicate is now punishable by up to five years in jail.  The case involved an off-worlder trading ship captain who was arrested at the ${planet89_name} spaceport bar after making several derogatory comments about the Syndicate.  The Association of Free Traders released a statement condemning the court ruling, saying that it was a clear example of free speech being stifled."
	
*if dieroll = 21
	*set news "Unlicensed tin miners will now face fines of up to ten thousand credits and six months in prison after a new law was passed by the Galactic Council.  A bloc of lawmakers headed up by pro-Syndicate parties declared that the new law would generate millions of credits in tax revenue.  'Unlicensed tin miners have been acting like they are above the law for too long,' said a spokesperson for the Syndicate."

*return

*label chocolate_cakes

*gosub_scene starmap
*gosub_scene basemap
*gosub_scene asteroidmap
*gosub_scene blackholemap

*return