*label presence

*temp polemoji ""

*rand dieroll 1 2

*if dieroll = 1
	*set polemoji "🙋‍♀️"
	
*if dieroll = 2
	*set polemoji "🙋‍♂️"
	
*set police_alerted false

*if move_counter < 21
	*return

*rand police1_quadrant 1 111
*rand police2_quadrant 1 111
*rand police3_quadrant 1 111
*rand police4_quadrant 1 111

*temp mark 1
*temp bearing 1

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

*if credits <= 1000
	*set police2_quadrant 0
	*set police3_quadrant 0
	*set police4_quadrant 0
	
*if (credits > 1000) and (credits <= 5000)
	*set police3_quadrant 0
	*set police4_quadrant 0
	
*if (credits > 5000) and (credits <= 15000)
	*set police4_quadrant 0


*if quadrant = police1_quadrant
	🚨 Navigation has identified an [b]Intergalactic Police Cruiser[/b], bearing ${bearing}, mark ${mark}, range ${dieroll} kilometers.
	
	*if rp
		${rp_emoji} "I'm scared, ${name}."
	
	*set police_alerted true
	*if sound
		*sound police.wav
		
	You currently have ${credits} credits on board your ship.
	
*if quadrant = police2_quadrant
	🚨 Navigation has identified an [b]Intergalactic Police Cruiser[/b], bearing ${bearing}, mark ${mark}, range ${dieroll} kilometers.
	
	*if rp
		${rp_emoji} "What did you do, ${name}?"
	
	*set police_alerted true
	*if sound
		*sound police.wav
		
	You currently have ${credits} credits on board your ship.

*if quadrant = police3_quadrant
	🚨 Navigation has identified an [b]Intergalactic Police Cruiser[/b], bearing ${bearing}, mark ${mark}, range ${dieroll} kilometers.
	*if rp
		${rp_emoji} "I'm frightened, ${name}."
	
	*set police_alerted true
	*if sound
		*sound police.wav
		
	You currently have ${credits} credits on board your ship.
	
*if quadrant = police4_quadrant
	🚨 Navigation has identified an [b]Intergalactic Police Cruiser[/b], bearing ${bearing}, mark ${mark}, range ${dieroll} kilometers.
	
	*if rp
		${rp_emoji} "Im scared."
	
	*set police_alerted true
	*if sound
		*sound police.wav
		
	You currently have ${credits} credits on board your ship.
	


*return

*label alerted

*temp polemoji ""

*rand dieroll 1 2

*if dieroll = 1
	*set polemoji "🙋‍♀️"
	
*if dieroll = 2
	*set polemoji "🙋‍♂️"

📶🚨 [i]Vessel ${regnumber}, this is the Intergalactic Police.  Shut down your engines and prepare to be boarded.[/i]

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

*fake_choice
	#📶  Give police permission to board
		*set police_alerted false
		*rand dieroll 2 7
		*temp bribe 0
		*set bribe (credits / dieroll)
		*set bribe round(bribe)
		*set police_alerted false
		*goto police_boarded
	*selectable_if (story_mode = false) #🛰️ Scan the police ship
		*goto scan_police
	*selectable_if (story_mode = false) #⚔️ Attack the police
		*goto attack_police
	*selectable_if (fuel > 20) #💫 Make an emergency warp jump
		*goto warp
	
*label scan_police

*if sound
	*sound scan.wav

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

Your scan reveals tactical information about the Intergalactic Police Cruiser:

🔋 Battery: 500
*line_break
🚇 Torpedoes: 5
*line_break

📶🚨 [i]Vessel ${regnumber}, if you do not cease hostile activity at once, we will be forced to fire.[/i]

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

*fake_choice
	#📶  Give police permission to board
		*set police_alerted false
		*rand dieroll 2 7
		*temp bribe 0
		*set bribe (credits / dieroll)
		*set bribe round(bribe)
		*goto police_boarded
	#⚔️ Attack the police
		*goto attack_police
	*selectable_if (fuel > 20) #💫 Make an emergency warp jump
		*goto warp
	
*label police_boarded

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

*if sound
	*sound police.wav

📶 "Intergalactic Police Cruiser, this is the ${ship_name}.  We are standing by for your arrival," you broadcast over the police channel.

A few minutes later, a contingent of IGP officers arrives on your vessel and begins a hard target search.

After the IGP turn over every square inch of your ship, the head officer turns to you:

*temp pretext ""

*if passengers_carrying > 0
	*gosub passenger_pretext
	*goto popsicle

*label latex

*rand dieroll 1 7

*if dieroll = 1
	*set pretext "was repeatedly caught on starbase sensors exceeding safe orbiting speed"
	
*if dieroll = 2
	*set pretext "was used to illegally transport cargo to a planet under sanction"
	
*if dieroll = 3
	*if story_mode = false
		*goto latex
	*set pretext "was used as part of a human trafficking network, ferrying underage passengers between planets"
	
*if dieroll = 4
	*set pretext "exceeds acceptable emissions limits for a vessel of this class"
	
*if dieroll = 5
	*set pretext "is carrying outdated registration documents"
	
*if dieroll = 6
	*set pretext "has an expired registration tag from the Galactic Bureau of Spacefaring Vessels"
	
*if dieroll = 7
	*set pretext "has been engaged in illegal economic activity on the outer planets"

	
*label popsicle

*temp polemoji ""

*rand dieroll 1 2

*if dieroll = 1
	*set polemoji "🙋‍♀️"
	
*if dieroll = 2
	*set polemoji "🙋‍♂️"
	
*if credits < 10
	*goto warning

*set credits (credits - bribe)

*if passengers_carrying = 0
	👮 [i]"We have determined that this ship ${pretext}.  For violating this ordinance, you have been fined ¢${bribe}.  Future violations may result in the seizure of your ship, Captain.  Have a good day now."[/i]
	
*if passengers_carrying = 1
	*set passengers_carrying 0
	*set berths_available passengers_max
	👮 [i]"We are arresting your passenger for ${pretext}.  For harboring a known criminal, you have been fined ¢${bribe}.  Future violations may result in the seizure of your ship, Captain.  Have a good day now."[/i]
	
	👨‍🚀 [i]"But I'm innocent!"[/i] cries the passenger as the IGP officers drag them off your ship.
	*goto salute
	 
*if passengers_carrying > 1
	*set passengers_carrying 0
	*set berths_available passengers_max
	👮 [i]"We are arresting your passengers for ${pretext}.  For harboring and abetting these criminals, you have been fined ¢${bribe}.  Future violations may result in the seizure of your ship, Captain.  Have a good day now."[/i]
	
	👨‍🚀 [i]"This is an injustice!"[/i] shout the passengers as the IGP officers drag them off your ship.
	*goto salute
	 
*label salute

*page_break ${polemoji} Salute the officer

*goto_scene startrip_main

*label warning

*if sound
	*sound police.wav

*if passengers_carrying = 0
	👮 [i]"We have determined that this ship ${pretext}.  For violating this ordinance, we would normally issue a substantial fine. But today, we are just giving you a warning.  However, future violations may result in the seizure of your ship, Captain.  Have a good day."[/i]
	
	*goto salute
	
*if passengers_carrying = 1
	*set passengers_carrying 0
	*set berths_available passengers_max
	👮 [i]"We are arresting your passenger for ${pretext}.  For harboring and abetting this criminal, you are being issued an official warning.  Future violations may result in the seizure of your ship, Captain.  Have a good day now."[/i]
	
	👨‍🚀 [i]"This is an injustice!"[/i] shout the passengers as the
	IGP officers drag them off your ship.
	*goto salute
	
*if passengers_carrying > 1
	*set passengers_carrying 0
	*set berths_available passengers_max
	👮 [i]"We are arresting your passengers for ${pretext}.  For harboring and abetting these criminals, you are being issued an official warning.  Future violations may result in the seizure of your ship, Captain.  Have a good day now."[/i]
	
	👨‍🚀 [i]"This is an injustice!"[/i] shout the passengers as the IGP officers drag them off your ship.
	*goto salute

*goto_scene startrip_main

*label attack_police

*set oppo_emoji "🚨"
*set oppo_battery 500
*set oppo_torpedoes 5
*set oppo_name "Intergalactic Police Cruiser"

*goto_scene ship_fight
	
*label warp

*if sound
	*sound emergency.wav

Without hesitating, you punch in the codes to execute an emergency warp jump in order to flee the Intergalactic Police.

*page_break 💫 Engage!

*if sound
	*sound fuelburn.mp3

*if story_mode = false
	*rand quadrant 1 111
	*rand sector 1 4
	
*if story_mode = true
	*rand dieroll 1 11
	*temp gringo ""
	*set gringo "starbase${dieroll}_quadrant"
	*set quadrant {gringo}
	*set gringo "starbase${dieroll}_sector"
	*set sector {gringo}

*set police_alerted false

*temp fuel_burn 0
*set fuel_burn fuel

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

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

*label passenger_pretext


*if dieroll = 1
	*set pretext "desecrating and insulting a house of worship on ${planet11_name}"
	
*if dieroll = 2
	*set pretext "manufacturing and selling counterfeit ${resource6}"
	
*if dieroll = 3
	*set pretext "getting into a fight and causing gross bodily injury in the bar on ${planet30_name}"
	
*if dieroll = 4
	*set pretext "intergalactic wire fraud"
	
*if dieroll = 5
	*set pretext "unauthorized possession of ${resource11}"
	
*if dieroll = 6
	*set pretext "participating in an insurrection against the government of ${planet3_name}"
	
*if dieroll = 7
	*set pretext "participating in an intergalactic human trafficking operation"

*return