*set on_asteroid true

*if sound
	*sound fuelburn.mp3

🥔 [b]$!{asteroid_name}[/b]

*label menu_spinner

*if asteroid_level = 0
	*goto menu0

*if asteroid_level = 1
	*goto menu1

*if asteroid_level > 1
	*goto menu2


*label menu0

Carefully, you use your engines to execute a perfect landing on the rotating target that is the asteroid.

Sensors inform you that there is no breathable atmosphere outside, so in order to explore the asteroid, you will have to put on your spacesuit.

Looking through the forward window, you see no indication that any human beings have ever landed on this asteroid.

*if passengers_carrying > 0
	*gosub_scene passenger_remarks asteroid_remarks

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

*fake_choice
	#🚩 Claim this asteroid for yourself
	#🛫 Blast off from the asteroid
		*goto blastoff
	
*label claim_asteroid

🥔 [b]$!{asteroid_name}[/b]

The asteroid is now yours!

*if sound
	*sound winner2.wav

[b]:::[/b] What shall you name, it Captain?

*input_text asteroid_name

*if (asteroid1_quadrant = quadrant) and (asteroid1_sector = sector)
	*set asteroid1_name asteroid_name
	*set asteroid1_owner "Captain ${name}"
	*set asteroid1_level +1
	*set asteroid_level +1
	
*if (asteroid2_quadrant = quadrant) and (asteroid2_sector = sector)
	*set asteroid2_name asteroid_name
	*set asteroid2_owner "Captain ${name}"
	*set asteroid2_level +1
	*set asteroid_level +1
	
*if (asteroid3_quadrant = quadrant) and (asteroid3_sector = sector)
	*set asteroid3_name asteroid_name
	*set asteroid3_owner "Captain ${name}"
	*set asteroid3_level +1
	*set asteroid_level +1

🥔 [b]$!{asteroid_name}[/b]

*check_achievements
*if choice_achieved_asteroid_claim = false
	*achieve asteroid_claim

You are now the proud owner of an asteroid.

*set asteroids_claimed +1
*set asteroid_owned_quad quadrant
*set asteroid_own_name asteroid_name


*goto undeveloped

*label menu1

Carefully, you use your engines to execute a perfect landing on the rotating target that is the asteroid.

Sensors inform you that there is no breathable atmosphere outside, so in order to explore the asteroid, you will have to put on your spacesuit.

*label undeveloped

*temp number 1
*temp pass true

Currently, this asteroid is in a completely undeveloped state.

In order to start building a profitable trading center on [i]${asteroid_name}[/i], you will need to import:

*gosub levelup_needed

🧑‍🏭 [b]Colonists[/b]: ${col_needed}

[b]Raw materials[/b]:

*if resource1_needed > 0
	$!{resource1}: ${resource1_needed} units
	*line_break
*if resource2_needed > 0
	$!{resource2}: ${resource2_needed} units
	*line_break
*if resource3_needed > 0
	$!{resource3}: ${resource3_needed} units
	*line_break
*if resource4_needed > 0
	$!{resource4}: ${resource4_needed} units
	*line_break
*if resource5_needed > 0
	$!{resource5}: ${resource5_needed} units
	*line_break
*if resource6_needed > 0
	$!{resource6}: ${resource6_needed} units
	*line_break
*if resource7_needed > 0
	$!{resource7}: ${resource7_needed} units
	*line_break
*if resource8_needed > 0
	$!{resource8}: ${resource8_needed} units
	*line_break
*if resource9_needed > 0
	$!{resource9}: ${resource9_needed} units
	*line_break
*if resource10_needed > 0
	$!{resource10}: ${resource10_needed} units
	*line_break
*if resource11_needed > 0
	$!{resource11}: ${resource11_needed} units
	*line_break
	
*gosub cargo_spinner
	
*if (pass = false) and (colonists_carrying = 1)
	🧑‍🏭 [i]"Captain, you can't expect me to work without the right materials!" [/i]
	
*if (pass = false) and (colonists_carrying > 1)
	🧑‍🏭 [i]"Captain, you can't expect us to work without the right materials!" [/i]
	
*if (pass = true) and (colonists_carrying = 1)
	🧑‍🏭 [i]"Time for me to get to work!" [/i]
	
*if (pass = true) and (colonists_carrying > 1)
	🧑‍🏭 [i]"Time for us to get to work!" [/i]

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

*fake_choice
	*selectable_if (pass = true) #🎁 Import cargo
		*temp number 1
		*temp pass true
	#🛫 Blast off from the asteroid
		*goto blastoff
	
*label unload_cargo

🥔 [b]$!{asteroid_name}[/b]

*if pass = false
	*if sound
		*sound warningbleep.wav
	[i]You do not have all of the requisite materials![/i]
	
	*goto undeveloped

*if sound
	*sound hammering.wav

Tapping your boot on the decking of your ship, you point at the pile of cargo that you wish to import.

*set resource1_carrying - resource1_needed
*set resource2_carrying - resource2_needed
*set resource3_carrying - resource3_needed
*set resource4_carrying - resource4_needed
*set resource5_carrying - resource5_needed
*set resource6_carrying - resource6_needed
*set resource7_carrying - resource7_needed
*set resource8_carrying - resource8_needed
*set resource9_carrying - resource9_needed
*set resource10_carrying - resource10_needed
*set resource11_carrying - resource11_needed

*set colonists_carrying - col_needed
*set berths_available + col_needed
*set asteroid_colonists + col_needed

*if col_needed = 1
	Your colonist quickly gets to work, unloading the goods and then putting everything into place.
	
*if col_needed > 1
	Your colonists quickly get to work, unloading the goods and then putting everything into place.

*gosub asteroid_progress

Within a few hours, ${asteroid_name} has a ${new_thing}.

*if (asteroid1_quadrant = quadrant) and (asteroid1_sector = sector)
	*set asteroid1_level +1
	*set asteroid_level +1
	*set asteroid1_colonists + col_needed
	
*if (asteroid2_quadrant = quadrant) and (asteroid2_sector = sector)
	*set asteroid2_level +1
	*set asteroid_level +1
	*set asteroid2_colonists + col_needed
	
*if (asteroid3_quadrant = quadrant) and (asteroid3_sector = sector)
	*set asteroid3_level +1
	*set asteroid_level +1
	*set asteroid3_colonists + col_needed
	
*temp asteroid_income 1

*gosub income_assess
	
Your asteroid should now be capable of producing ¢${asteroid_income} in trade profits per week.

*set payday_counter (move_counter + 7)


*temp number 1

*page_break 🧑‍🏭

🥔 [b]$!{asteroid_name}[/b]

*goto partially_developed

*label cargo_spinner

*if number > 11
	*return
	
*if col_needed > colonists_carrying
	*set pass false
	*return

*temp res_car ""
*temp res_need ""

*set res_car "resource${number}_carrying"
*set res_car {res_car}
*set res_need "resource${number}_needed"
*set res_need {res_need}

*if res_car < res_need
	*set pass false
	*return

*set number +1

*goto cargo_spinner

	
	
*label blastoff

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

*set on_asteroid false
*set battery -1
*if battery < 0
	*set battery 0


*if sound
	*sound leavestarbase.wav

Engaging forward thrusters, you gently release the ground clamps, and the ${ship_name} gently drifts away from the asteroid.

Through the forward view screen, you see the asteroid dwindle out of sight.

*page_break 🌌 Explore the galaxy

*goto_scene startrip_main

*label levelup_needed

*temp resource1_needed 0
*temp resource2_needed 0
*temp resource3_needed 0
*temp resource4_needed 0
*temp resource5_needed 0
*temp resource6_needed 0
*temp resource7_needed 0
*temp resource8_needed 0
*temp resource9_needed 0
*temp resource10_needed 0
*temp resource11_needed 0


*if asteroid_level = 1
	*set col_needed 1
	*set resource1_needed 3
	*set resource2_needed 2
	
*if asteroid_level = 2
	*set col_needed 1
	*set resource1_needed 3
	*set resource2_needed 3
	*set resource3_needed 1
	
*if asteroid_level = 3
	*set col_needed 2
	*set resource1_needed 2
	*set resource2_needed 1
	*set resource3_needed 2
	*set resource4_needed 1
	
*if asteroid_level = 4
	*set col_needed 2
	*set resource2_needed 1
	*set resource3_needed 3
	*set resource4_needed 1
	*set resource5_needed 1
	
*if asteroid_level = 5
	*set col_needed 2
	*set resource3_needed 1
	*set resource4_needed 3
	*set resource5_needed 1
	*set resource6_needed 2
	
*if asteroid_level = 6
	*set col_needed 3
	*set resource4_needed 1
	*set resource5_needed 5
	*set resource6_needed 1
	
*if asteroid_level = 7
	*set col_needed 3
	*set resource5_needed 3
	*set resource6_needed 1
	*set resource7_needed 2
	
*if asteroid_level = 8
	*set col_needed 3
	*set resource5_needed 1
	*set resource6_needed 5
	*set resource7_needed 3
	
*if asteroid_level = 9
	*set col_needed 4
	*set resource4_needed 5
	*set resource5_needed 4
	*set resource6_needed 4
	*set resource7_needed 4
	
*if asteroid_level = 10
	*set col_needed 5
	*set resource7_needed 5
	*set resource8_needed 5
	*set resource9_needed 5
	
*if asteroid_level = 11
	*set col_needed 7
	*set resource1_needed 1
	*set resource2_needed 1
	*set resource3_needed 1
	*set resource4_needed 1
	*set resource8_needed 3
	*set resource10_needed 3
	
*if asteroid_level = 12
	*set col_needed 10
	*set resource9_needed 2
	*set resource10_needed 2
	*set resource11_needed 1
	
*if asteroid_level = 13
	*set col_needed 25
	*set resource10_needed 3
	*set resource11_needed 5
	
*if asteroid_level = 14
	*set col_needed 30
	*set resource11_needed 10
	
*if asteroid_level = 15
	*set col_needed 50
	*set resource11_needed 20
	
*if asteroid_level = 16
	*set col_needed 75
	*set resource1_needed 10
	*set resource4_needed 10
	*set resource7_needed 10
	*set resource10_needed 10
	
*if asteroid_level = 17
	*set col_needed 100
	*set resource1_needed 20
	*set resource2_needed 20
	*set resource3_needed 20
	*set resource4_needed 20
	
*if asteroid_level = 18
	*set col_needed 150
	*set resource11_needed 50
	
*if asteroid_level = 19
	*set col_needed 200
	*set resource1_needed 50
	*set resource3_needed 50
	*set resource4_needed 50
	
*return

*label income_assess

*temp asteroid_income 1

*if asteroid_level = 2
	*set asteroid_income 25
	
*if asteroid_level = 3
	*set asteroid_income 34
	
*if asteroid_level = 4
	*set asteroid_income 52
	
*if asteroid_level = 5
	*set asteroid_income 76
	
*if asteroid_level = 6
	*set asteroid_income 189
	
*if asteroid_level = 7
	*set asteroid_income 378
	
*if asteroid_level = 8
	*set asteroid_income 756
	
*if asteroid_level = 9
	*set asteroid_income 1512
	
*if asteroid_level = 10
	*set asteroid_income 3024
	
*if asteroid_level = 11
	*set asteroid_income 6048
	
*if asteroid_level = 12
	*set asteroid_income 12096
	
*if asteroid_level = 13
	*set asteroid_income 24192
	
*if asteroid_level = 14
	*set asteroid_income 48384
	
*if asteroid_level = 15
	*set asteroid_income 96768
	
*if asteroid_level = 16
	*set asteroid_income 193536
	
*if asteroid_level = 17
	*set asteroid_income 387072
	
*if asteroid_level = 18
	*set asteroid_income 774144
	
*if asteroid_level = 19
	*set asteroid_income 1548288
	
*if asteroid_level = 20
	*set asteroid_income 3096576
		
*return

*label menu2

*gosub income_assess

Carefully, you use your engines to execute a perfect landing on the rotating target that is the asteroid.

*if asteroid_payday
	*set asteroid_payday false
	*if sound
		*sound cashregister.wav
		
	*set credits + asteroid_income
	*temp wages 0
	*set wages (asteroid_colonists * 3)
	*set credits - wages
	*if asteroid_income > 0
		As soon as you cut your thrusters, a colonist runs up to you and hands you this week's profit of [b]${asteroid_income}[/b] credits.
	
	🧑‍🏭 "Your Grace, ${name}, this week we produced ${asteroid_income} credits for you in trade profits, and I took out ${wages} credits for wages."
	
	*fake_choice
		#🗣️ "You need to quit fooling around!"
		#🗣️ "Thank you for your hard work."
		#🗣️ "This needs to become more profitable."
	
🥔 [b]$!{asteroid_name}[/b]

🧑‍🏭 "Your Grace."

*if asteroid_level > 19
	*goto menu3

*label partially_developed

Currently, ${asteroid_name} is in a partially developed state.

In order to make progress, you will need to import:

*gosub levelup_needed

[b]Colonists[/b]: ${col_needed}

[b]Raw materials[/b]:

*if resource1_needed > 0
	$!{resource1}: ${resource1_needed} units
	*line_break
*if resource2_needed > 0
	$!{resource2}: ${resource2_needed} units
	*line_break
*if resource3_needed > 0
	$!{resource3}: ${resource3_needed} units
	*line_break
*if resource4_needed > 0
	$!{resource4}: ${resource4_needed} units
	*line_break
*if resource5_needed > 0
	$!{resource5}: ${resource5_needed} units
	*line_break
*if resource6_needed > 0
	$!{resource6}: ${resource6_needed} units
	*line_break
*if resource7_needed > 0
	$!{resource7}: ${resource7_needed} units
	*line_break
*if resource8_needed > 0
	$!{resource8}: ${resource8_needed} units
	*line_break
*if resource9_needed > 0
	$!{resource9}: ${resource9_needed} units
	*line_break
*if resource10_needed > 0
	$!{resource10}: ${resource10_needed} units
	*line_break
*if resource11_needed > 0
	$!{resource11}: ${resource11_needed} units
	*line_break
	
*temp number 1
*temp pass true
	
*gosub cargo_spinner

*if (pass = false) and (colonists_carrying = 1)
	🧑‍🏭 [i]"Captain, you can't expect me to work without the right materials!" [/i]
	
*if (pass = false) and (colonists_carrying > 1)
	🧑‍🏭 [i]"Captain, you can't expect us to work without the right materials!" [/i]
	
*if (pass = true) and (colonists_carrying = 1)
	🧑‍🏭 [i]"Time for me to get to work!" [/i]
	
*if (pass = true) and (colonists_carrying > 1)
	🧑‍🏭 [i]"Time for us to get to work!" [/i]

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

*fake_choice
	*selectable_if (pass = true) #🎁 Import cargo
		*goto unload_cargo
	#🛫 Blast off from the asteroid
		*goto blastoff

🥔 [b]$!{asteroid_name}[/b]

*gosub cargo_spinner

*if pass = false
	*if sound
		*sound warningbleep.wav
	[i]You do not have all of the requisite materials![/i]
	
	*goto partially_developed

🥔 [b]$!{asteroid_name}[/b]

*if sound
	*sound hammering.wav

Tapping your boot on the decking of your ship, you point at the pile of cargo.

*set pass false

Your colonists quickly get to work, unloading the goods and then putting everything into place.
	
*gosub asteroid_progress

Within a few hours, [i]${asteroid_name}[/i] has a ${new_thing}.
	
*if (asteroid1_quadrant = quadrant) and (asteroid1_sector = sector)
	*set asteroid1_level +1
	*set asteroid_level +1
	
*if (asteroid2_quadrant = quadrant) and (asteroid2_sector = sector)
	*set asteroid2_level +1
	*set asteroid_level +1
	
*if (asteroid3_quadrant = quadrant) and (asteroid3_sector = sector)
	*set asteroid3_level +1
	*set asteroid_level +1
	
*gosub income_assess
	
Your asteroid should now be capable of producing ¢${asteroid_income} per week.

*page_break

*temp number 1
*gosub cargo_spinner

*goto partially_developed

*label menu3

${asteroid_name} is a top-of-the-line automated trading station.

*check_achievements
*if choice_achieved_asteroid_finished = false
	*achieve asteroid_finished
	
[b]:::[/b] What do you want to do, Captain?

*fake_choice
	#🛫 Blast off from the asteroid
		*goto blastoff
	

*label asteroid_progress

*temp new_thing ""

*if asteroid_level = 1
	*set new_thing "small cabin and a shed with some mining tools"
	
*if asteroid_level = 2
	*set new_thing "barn and some farming equipment"
	
*if asteroid_level = 3
	*set new_thing "intergalactic radio station"
	
*if asteroid_level = 4
	*set new_thing "barracks building and some horses"
	
*if asteroid_level = 5
	*set new_thing "a storage tower for dry cereals"
	
*if asteroid_level = 6
	*set new_thing "permanent landing pad"
	
*if asteroid_level = 7
	*set new_thing "phalanx of solar power collectors"
	
*if asteroid_level = 8
	*set new_thing "more than one dozen buildings"
	
*if asteroid_level = 9
	*set new_thing "a large open-air market"
	
*if asteroid_level = 10
	*set new_thing "a crude monorail system"
	
*if asteroid_level = 11
	*set new_thing "a large eating hall"
	
*if asteroid_level = 12
	*set new_thing "seven pre-fabricated industrial buildings"
	
*if asteroid_level = 13
	*set new_thing "large convention center"
	
*if asteroid_level = 14
	*set new_thing "traveler's rest facility"
	
*if asteroid_level = 15
	*set new_thing "a zero-G golf course"
	
*if asteroid_level = 16
	*set new_thing "advanced electronics repair shop"
	
*if asteroid_level = 17
	*set new_thing "latest-gen intergalactic laser wave relay tower"
	
*if asteroid_level = 18
	*set new_thing "a vast glass dome enclosing one entire side of the asteroid"
	
*if asteroid_level = 19
	*set new_thing "a gleaming metropolis where you are its beloved and eternal ruler"
	
*return