Back to Index Page generated: Dec 20, 2024, 7:22:09 AM

Expansion Taxi Galactica

Content

Manifest

from Expansion Manager's OXP list from Expansion Manifest
Description Taxi Stations in corporate systems offers exotic passenger contracts. Taxi Stations in corporate systems offers exotic passenger contracts.
Identifier oolite.oxp.Pleb.TaxiGalactica oolite.oxp.Pleb.TaxiGalactica
Title Taxi Galactica Taxi Galactica
Category Missions Missions
Author Pleb Pleb
Version 2.1 2.1
Tags
Required Oolite Version
Maximum Oolite Version
Required Expansions
Optional Expansions
Conflict Expansions
Information URL http://wiki.alioth.net/index.php/Taxi_Galactica n/a
Download URL https://wiki.alioth.net/img_auth.php/8/81/Taxi_Galactica_2.1.oxz n/a
License CC BY-NC-SA 3 CC BY-NC-SA 3
File Size n/a
Upload date 1610873346

Documentation

Also read http://wiki.alioth.net/index.php/Taxi%20Galactica

readme.txt

########################
###TAXI GALACTICA OXP###
########################
##########v2.1##########
########################



VERSION HISTORY:

v2.1 - (from phkb) Included YellOo cabs from Amah's "Z-Groovy's No-Shader Variety Packs" (if installed). 
Taxi Cabs will now get a random ship name (if randomshipnames OXP is installed).

v2.0 - (from phkb) Small tweaks to station AI to avoid mass taxi launches. 
Updated subentity definitions in shipdata.plist to use new style. 
Updated population methods to use new system populator, to allow saving the game at Taxi Stations.
BGS docking tunnel texture added.
Passenger berths can now be purchased at all Taxi Stations (it makes in-game sense that a taxi station could supply them).
Added an F4 interface screen option to allow for players to re-enter the Taxi Galactica bulletin board without needing to launch and re-dock.
Jumping to a new galaxy while carrying a taxi contract will terminate the contract at the first docking opportunity, rather than immediately after arriving in system (as it makes more sense for a wronged passenger to jump ship at that point).
The colour of the Adder model shown on mission screen will now be the same on all mission screens shown at the Taxi station. A new colour will be picked the next time the system is populated.
Added "screenID" properties to all mission screens.

v1.0 - Changed models for Taxi Adder and Taxi Station to ones Griff designed with textures by dertian. Also moved Taxi Station to planet and added billboard buoy. Also when leaving galaxy script will check to see if on a contract and if so will now cancel contract and remove passenger. Removed Frigate from this release due to formatting issues. Also rewritten script to conform to stock script layout and merged scripts into one file for ease of editing/viewing, also commented lines of script to give detail on what does what.

v0.6 - Fixed bug where fuel was not awarded at end of mission and also fixed bug where redocking with Taxi Station would display "Welcome blah blah... supposed to be delivering Enitno Thmaat to the 2 system". Now displays correct system name not just a number. Also added first special mission which is available after five normal missions have been completed.

v0.5 - Complete overhaul of OXP, Taxi Station available in corporate systems in all galaxies. Changed the scripting to JavaScript to make OXP compatible with newer version of Oolite. Changed mission requirements back to delivering passengers from the Taxi Station to the Main Station, but will now select any system within 40 light years. Rankings have been removed for now, may add them back in at later stage. Each mission has a difficulty setting which relates to how many pirates will be waiting for you.

v0.4 - Changed mission requirements: you now take passengers to the Taxi Station in the required system. It made more sense this way, as you have to start at the Taxi Station anyway. Also added Taxi Cabs to the traffic in Galaxy 1. Rankings have been added, as well as a Pilot Stats board viewable a the Taxi Station. The more contracts you complete, you eventually go up a level. Each level determines how many pirates may be waiting for you. Also added the excellent logo designed and created by Disembodied to the Taxi Station.

v0.301 - Fix added for multiple destinations appearing all over the place. The mission intro text, the objective text and the system locator all match, as does the passenger name in both the intro and obective texts. Also added a fix for multiple Taxi Stations being created everytime the player launches from a station in a corporate system in Galaxy 1.

v0.3 - Complete restart, Taxi Station now only in corporate systems in Galaxy 1. Rebel Frigate and Rebel Viper removed from OXP, inlcuding mission. Taxi missions are now offered at the station, to take passengers to the Main Station in other corporate systems in Galaxy 1. 2000 credits per journey, provided you make it there in less than 50 jumps.

v0.201 - Fix for Rebel AI causing mass jamming of the comms. Also improved on minor script errors/mishaps.

v0.2 - Mission added to take a war criminal of the Galactic Navy to naval captivity, without getting blasted by the Rebel Frigates and Rebel Vipers.

v0.1 - Taxi Station and Taxi Cab ingame. Taxi Station in every Corporate, Democratic and Confederate systems.




HOW TO INSTALL:

Extract folder 'Taxi Galactica.oxp' to the follwoing location:

	C:\Program Files\Oolite\AddOns

(Note - where C: is might be a different drive location for yourself - check where you installed Oolite FIRST!)

*** IF YOU HAD A PREVIOUS VERSION OF THIS OXP INSTALLED PLEASE REMOVE BEFORE INSTALLING THIS VERSION OF THE OXP ***




CREDITS:

Taxi Station model - Griff

Taxi Station textures - Griff/dertian

Taxi Cab model - Griff

Taxi Cab textures - Griff

Taxi Galactica logo - Disembodied

Taxi Station Billboard - Your Ad Here! OXP

*** And everyone else who has supported me on the Oolite Forums (http://www.aegidian.org/bb/index.php)!***


Equipment

Name Visible Cost [deci-credits] Tech-Level
Passenger Berth - takes up 5t of cargo space yes 8250 1+

Ships

Name
extra_taxi_1
extra_taxi_2
Taxi Cab
Taxi Station Buoy
taxi_leaving
Asp
Cobra Mark III
Cobra Mark I
Krait
Mamba
Python
Separatist Krait
Separatist Mamba
Taxi Station
taxi_station_adring
taxi_station_antenna
taxi_station_baydoor_flashers
taxi_station_dockingbay
taxi_station_roof_billboard

Models

This expansion declares no models.

Scripts

Path
Scripts/taxi_galactica_conditions.js
"use strict";
this.name        = "Taxi_Galactica_Conditions";
this.author      = "phkb";
this.copyright   = "2018 phkb";
this.description = "Condition script for controlling sale of special passenger berth";
this.licence     = "CC BY-NC-SA 3.0";

//-------------------------------------------------------------------------------------------------------------
this.allowAwardEquipment = function(equipment, ship, context) {

	// always return true for scripted install
	if (context === "scripted") return true;
    if (context != "purchase") return false;
	var p = player.ship;
	var stn = p.dockedStation;
    return stn.hasRole("taxi_station");
}
Scripts/taxi_galactica_main.js
"use strict";

this.name        = "taxi_galactica_main"; 
this.author      = "Pleb"; 
this.copyright   = "(C) Copyright 2012 Pleb Inc."; 
this.license     = "CC BY-NC-SA 3.0"; 
this.description = "This is the main script for the Taxi Galactica OXP."; 
this.version     = "2.0"; 

/**** Functions ****/

this._addTaxiStatIfPossible = function () 
{ 
	// Check if current system is a Corporate system that hasn't gone Nova and make sure Player is not in Interstellar Space:
	if (system.government === 7 && !system.isInterstellarSpace && !system.sun.isGoingNova) { 
		// Add Taxi Station to current system near planet and angle toward planet:
		var posTaxi = Vector3D(0, 0, 0.1).fromCoordinateSystem("psu");
		system.setPopulator("taxi_station", {
			callback: function(pos) {
				if (system.countShipsWithRole("taxi_station") == 0) {
					var taxistat = system.addShips("taxi_station", 1, pos, 1)[0];
					if (!taxistat) {
						log(this.name, "!!ERROR - Taxi Station not spawned");
						return;
					}
					var targetVector = system.mainPlanet.position.subtract(taxistat.position).direction();
					var angle = taxistat.heading.angleTo(targetVector);
					var cross = taxistat.heading.cross(targetVector).direction();
					taxistat.orientation = taxistat.orientation.rotate(cross,-angle);
					worldScripts.taxi_galactica_main._addShipsNoRings("taxi_billboard", 1, taxistat.position.add(taxistat.heading.multiply(10E3)), 1);
				}
			},
			location:"COORDINATES",
			coordinates:posTaxi,
			deterministic:true
		});
	}
}

this._addShipsNoRings = function (role,count,position,radius) 
{ 
	var offset =new Vector3D(0,50000,0);
	var ships=system.addShips(role, count, offset,radius); 
	offset=new Vector3D(position).subtract(offset); 
	var i=0; 
	while (i < ships.length) 
	{ 
		ships[i].position=ships[i].position.add(offset); 
		i++; 
	} 
	return ships; 
}

this._generateTaxiJobs = function ()
{
	// Generate names for passenger contracts:
	missionVariables.taxi_job_name_1 = randomName() + " " + randomName();
	missionVariables.taxi_job_name_2 = randomName() + " " + randomName();
	missionVariables.taxi_job_name_3 = randomName() + " " + randomName();
	// Generate destinations for passenger contracts:
	missionVariables.taxi_job_dest_1 = this._generateTaxiDest(40); // these three functions are identical, but I'm no sure why we need three versions of it. Random number generator problems, maybe?
	missionVariables.taxi_job_dest_2 = this._generateTaxiDest(40);
	missionVariables.taxi_job_dest_3 = this._generateTaxiDest(40);
	missionVariables.taxi_job_dest_name_1 = System.systemNameForID(missionVariables.taxi_job_dest_1);
	missionVariables.taxi_job_dest_name_2 = System.systemNameForID(missionVariables.taxi_job_dest_2);
	missionVariables.taxi_job_dest_name_3 = System.systemNameForID(missionVariables.taxi_job_dest_3);
	// Generate time limits for passenger contracts:
	missionVariables.taxi_job_time_1 = Math.floor(Math.random() * (20 - 10 + 1) + 10);
	missionVariables.taxi_job_time_2 = Math.floor(Math.random() * (20 - 10 + 1) + 10);
	missionVariables.taxi_job_time_3 = Math.floor(Math.random() * (20 - 10 + 1) + 10);
	// Generate difficulty levels for passenger contracts and use that and distance to determine the fee:
	missionVariables.taxi_job_diff_1 = Math.floor(Math.random() * (2 - 0 + 1) + 0);
	var taxi_mission_distance_1 = Math.round(system.info.distanceToSystem(System.infoForSystem(galaxyNumber, missionVariables.taxi_job_dest_1)));
	var taxi_mission_distance_2 = Math.round(system.info.distanceToSystem(System.infoForSystem(galaxyNumber, missionVariables.taxi_job_dest_2)));
	var taxi_mission_distance_3 = Math.round(system.info.distanceToSystem(System.infoForSystem(galaxyNumber, missionVariables.taxi_job_dest_3)));
	if (missionVariables.taxi_job_diff_1 === 0)
	{
		missionVariables.taxi_job_diff_name_1 = "Easy";
		missionVariables.taxi_job_pay_1 = Math.floor(Math.random() * (300 - 100 + 1) + 100);
		missionVariables.taxi_job_pay_1 = missionVariables.taxi_job_pay_1 * taxi_mission_distance_1 / 2;
	}
	else if (missionVariables.taxi_job_diff_1 === 1)
	{
		missionVariables.taxi_job_diff_name_1 = "Medium";
		missionVariables.taxi_job_pay_1 = Math.floor(Math.random() * (500 - 300 + 1) + 300);
		missionVariables.taxi_job_pay_1 = missionVariables.taxi_job_pay_1 * taxi_mission_distance_1 / 2;
	}
	else if (missionVariables.taxi_job_diff_1 === 2)
	{
		missionVariables.taxi_job_diff_name_1 = "Hard";
		missionVariables.taxi_job_pay_1 = Math.floor(Math.random() * (800 - 500 + 1) + 500);
		missionVariables.taxi_job_pay_1 = missionVariables.taxi_job_pay_1 * taxi_mission_distance_1 / 2;
	}
	missionVariables.taxi_job_diff_2 = Math.floor(Math.random() * (2 - 0 + 1) + 0);
	if (missionVariables.taxi_job_diff_2 === 0)
	{
		missionVariables.taxi_job_diff_name_2 = "Easy";
		missionVariables.taxi_job_pay_2 = Math.floor(Math.random() * (300 - 100 + 1) + 100);
		missionVariables.taxi_job_pay_2 = missionVariables.taxi_job_pay_2 * taxi_mission_distance_2 / 2;
	}
	else if (missionVariables.taxi_job_diff_2 === 1)
	{
		missionVariables.taxi_job_diff_name_2 = "Medium";
		missionVariables.taxi_job_pay_2 = Math.floor(Math.random() * (500 - 300 + 1) + 300);
		missionVariables.taxi_job_pay_2 = missionVariables.taxi_job_pay_2 * taxi_mission_distance_2 / 2;
	}
	else if (missionVariables.taxi_job_diff_2 === 2)
	{
		missionVariables.taxi_job_diff_name_2 = "Hard";
		missionVariables.taxi_job_pay_2 = Math.floor(Math.random() * (800 - 500 + 1) + 500);
		missionVariables.taxi_job_pay_2 = missionVariables.taxi_job_pay_2 * taxi_mission_distance_2 / 2;
	}
	missionVariables.taxi_job_diff_3 = Math.floor(Math.random() * (2 - 0 + 1) + 0);
	if (missionVariables.taxi_job_diff_3 === 0)
	{
		missionVariables.taxi_job_diff_name_3 = "Easy";
		missionVariables.taxi_job_pay_3 = Math.floor(Math.random() * (300 - 100 + 1) + 100);
		missionVariables.taxi_job_pay_3 = missionVariables.taxi_job_pay_3 * taxi_mission_distance_3 / 2;
	}
	else if (missionVariables.taxi_job_diff_3 === 1)
	{
		missionVariables.taxi_job_diff_name_3 = "Medium";
		missionVariables.taxi_job_pay_3 = Math.floor(Math.random() * (500 - 300 + 1) + 300);
		missionVariables.taxi_job_pay_3 = missionVariables.taxi_job_pay_3 * taxi_mission_distance_3 / 2;
	}
	else if (missionVariables.taxi_job_diff_3 === 2)
	{
		missionVariables.taxi_job_diff_name_3 = "Hard";
		missionVariables.taxi_job_pay_3 = Math.floor(Math.random() * (800 - 500 + 1) + 500);
		missionVariables.taxi_job_pay_3 = missionVariables.taxi_job_pay_3 * taxi_mission_distance_3 / 2;
	}
}

this._generateTaxiDest = function (maxDist)
{
	// Generate destination for passenger contract within maxDist light years of current system:
	var thisSystem = system.info;
	var targetSystems = SystemInfo.systemsInRange(maxDist);
	if (!targetSystems) return system.ID;
	var count = targetSystems.length;
	targetSystems.sort(function(a, b) { return Math.random() - 0.5; });
	var i = -1; // start here, so the first interation is 0, which is the real first index
	var targetSystem = null;
	var realDistance = 0;
	while ((!realDistance || realDistance > maxDist) && i<count)
	{
		targetSystem = targetSystems[i++];
		if (targetSystem) {
			// make sure there's a route to this system
			var routeSystem = System.infoForSystem(galaxyNumber, targetSystem.systemID).routeToSystem(thisSystem);
			if (routeSystem) realDistance = System.infoForSystem(galaxyNumber, targetSystem.systemID).routeToSystem(thisSystem).distance;
		}
	}
	return targetSystem.systemID;
}

// all these functions are identical, except the SpecMis1 function is limited to 20ly. 
// all have been combined into the above function that accepts a maxDist parameter
/*
this._generateTaxiDest1 = function ()
{
	// Generate destination for passenger contract #1 within 40 light years of current system:
	var thisSystem = system.info;
	var targetSystems = SystemInfo.systemsInRange(40);
	if (!targetSystems) return system.ID;
	var count = targetSystems.length;
	var targetSystem = targetSystems[Math.floor(Math.random()*count)];
	var realDistance = System.infoForSystem(galaxyNumber, targetSystem.systemID).routeToSystem(thisSystem).distance;
	var i = 0;
	while ((!realDistance || realDistance > 40) && i<count)
	{
		targetSystem = targetSystems[i++];
		realDistance = System.infoForSystem(galaxyNumber, targetSystem.systemID).routeToSystem(thisSystem).distance;
	}
	return targetSystem.systemID;
}

this._generateTaxiDest2 = function ()
{
	// Generate destination for passenger contract #2 within 40 light years of current system:
	var thisSystem = system.info;
	var targetSystems = SystemInfo.systemsInRange(40);
	if (!targetSystems) return system.ID;
	var count = targetSystems.length;
	var targetSystem = targetSystems[Math.floor(Math.random()*count)];
	var realDistance = System.infoForSystem(galaxyNumber, targetSystem.systemID).routeToSystem(thisSystem).distance;
	var i = 0;
	while ((!realDistance || realDistance > 40) && i<count)
	{
		targetSystem = targetSystems[i++];
		realDistance = System.infoForSystem(galaxyNumber, targetSystem.systemID).routeToSystem(thisSystem).distance;
	}
	return targetSystem.systemID;
}

this._generateTaxiDest3 = function ()
{
	// Generate destination for passenger contract #3 within 40 light years of current system:
	var thisSystem = system.info;
	var targetSystems = SystemInfo.systemsInRange(40);
	if (!targetSystems) return system.ID;
	var count = targetSystems.length;
	var targetSystem = targetSystems[Math.floor(Math.random()*count)];
	var realDistance = System.infoForSystem(galaxyNumber, targetSystem.systemID).routeToSystem(thisSystem).distance;
	var i = 0;
	while ((!realDistance || realDistance > 40) && i<count)
	{
		targetSystem = targetSystems[i++];
		realDistance = System.infoForSystem(galaxyNumber, targetSystem.systemID).routeToSystem(thisSystem).distance;
	}
	return targetSystem.systemID;
}

this._generateTaxiSpecMis1Dest = function ()
{
	// Generate destination for special mission #1 within 20 light years of current system:
	var thisSystem = system.info;
	var targetSystems = SystemInfo.systemsInRange(20);
	if (!targetSystems) return system.ID;
	var count = targetSystems.length;
	var targetSystem = targetSystems[Math.floor(Math.random()*count)];
	var realDistance = System.infoForSystem(galaxyNumber, targetSystem.systemID).routeToSystem(thisSystem).distance;
	var i = 0;
	while ((!realDistance || realDistance > 20) && i<count)
	{
		targetSystem = targetSystems[i++];
		realDistance = System.infoForSystem(galaxyNumber, targetSystem.systemID).routeToSystem(thisSystem).distance;
	}
	return targetSystem.systemID;
}
*/

this._initInterface = function(station) 
{
	if (!station) return;
	if (station.hasRole("taxi_station")) {
		station.setInterface(this.name,{
			title:"Taxi Galactica bulletin board",
			category:"Contracts",
			summary:"Views any Taxi Galactica passenger contracts available from this station.",
			callback:this._showBB.bind(this)
		});
	} else {
		station.setInterface(this.name, null);
	}
}

this._showBB = function() 
{
	missionVariables.taxistat = "REVISIT";
	this.missionScreenOpportunity();
}

/**** Event handlers ****/

this.startUp = function ()
{
	// Make sure that the variable used for the Taxi Station mission screens is reset every time:
	missionVariables.taxistat = "REVISIT";
	this._newGalaxy = false;
}

this.startUpComplete = function() 
{
	this._initInterface(player.ship.dockedStation);
}

this.systemWillPopulate = function() 
{
	this._modelPersonality  = Math.floor(Math.random() * 32767);
	if (!missionVariables.taxi_station_contact || missionVariables.taxi_station_contact == "")
		missionVariables.taxi_station_contact = randomName() + " " + randomName();

	// Try to add Taxi Station to current system:
	this._addTaxiStatIfPossible();
	// Random chance (%) for pirate encounters:
	this._piraterandomnumber = Math.floor(Math.random() * (100 - 1 + 1) + 1);
	// If current contract is Easy difficulty then 20% chance pirates will be spawned:
	if (missionVariables.taxi_diff === 0)
	{
		if (system.ID === missionVariables.taxi_dest)
		{
			// If current system is contract destination spawn 3 pirates:
			if (this._piraterandomnumber > 80) system.addShipsToRoute("taxi_pirate", 3, null, "wp");
		}
		else
		{
			// If current system is not contract destination spawn 1 pirate:
			if (this._piraterandomnumber > 80) system.addShipsToRoute("taxi_pirate", 1, null, "wp");
		}
	}
	// If current contract is Medium difficulty then 40% chance pirates will be spawned:
	else if (missionVariables.taxi_diff === 1)
	{
		if (system.ID === missionVariables.taxi_dest)
		{
			// If current system is contract destination spawn 4 pirates:
			if (this._piraterandomnumber > 60) system.addShipsToRoute("taxi_pirate", 4, null, "wp");
		}
		else
		{
			// If current system is not contract destination spawn 2 pirates:
			if (this._piraterandomnumber > 60) system.addShipsToRoute("taxi_pirate", 2, null, "wp");
		}
	}
	// If current contract is Hard difficulty then 60% chance pirates will be spawned:
	else if (missionVariables.taxi_diff === 2)
	{
		if (system.ID === missionVariables.taxi_dest)
		{
			// If current system is contract destination spawn 5 pirates:
			if (this._piraterandomnumber > 40) system.addShipsToRoute("taxi_pirate", 5, null, "wp");
		}
		else
		{
			// If current system is contract destination spawn 3 pirates:
			if (this._piraterandomnumber > 40) system.addShipsToRoute("taxi_pirate", 3, null, "wp");
		}
	}
	// If on special mission #1 then separatist ships might be spawned:
	else if (missionVariables.taxi_diff === 3)
	{
		// If current system is mission destination spawn 8 separatist fighters:
		if (system.ID === missionVariables.taxi_dest)
		{
			system.addShipsToRoute("taxi_separatist", 8, null, "wp");
		}
		// If current system is not mission destination there is 70% chance to spawn 4 separatist fighters:
		else
		{
			if (this._piraterandomnumber > 30) system.addShipsToRoute("taxi_separatist", 4, null, "wp");
		}
	}
}

this.shipWillLaunchFromStation = function () 
{ 
	// Try to add Taxi Station to current system:
	//this._addTaxiStatIfPossible(); // handled in systemWillPopulate now
	// Reset the variable used for the Taxi Station mission screens:
	missionVariables.taxistat = "REVISIT";
}

this.shipWillDockWithStation = function(station) 
{
	if (this._newGalaxy === true) {
		// Inform Player that contract has expired due to leaving previous galaxy:
		player.addMessageToArrivalReport("Taxi Galactica: As you have left the galaxy you were in, your passenger contract has expired. Your passenger has departed your ship in protest!");
		// Remove passenger from manifest:
		var name = missionVariables.taxi_passenger;
		player.ship.removePassenger(name);
		// Change variables to reflect Player no longer having passenger contract:
		missionVariables.taxistatus = "NOT_ON_JOB";
		missionVariables.taxi_diff = -1;
		this._newGalaxy = false;
	}
	this._initInterface(station);
}

this.shipWillEnterWitchspace = function(cause, destination) {
	missionVariables.taxi_station_contact = "";
}

this.playerBoughtEquipment = function(equipmentKey) 
{
	if (equipmentKey === "EQ_PASSENGER_BERTH_TAXI") {
		// swap out our dummy one for the real one.
		player.ship.removeEquipment("EQ_PASSENGER_BERTH_TAXI");
		player.ship.awardEquipment("EQ_PASSENGER_BERTH");
	}
}

this.missionScreenOpportunity = function ()
{
	// If Player is not docked do nothing:
	if (!player.ship.docked) 
	{
		return;
	}
	// Mission text screen choices are below:
	function choiceEvaluation(choice)
	{
		// Welcome screen choices:
		if (missionVariables.taxistat === "REVISIT_1")
		{
			if (choice === "1BOARD")
			{
				// Display the bulletin board screen:
				missionVariables.taxistat = "BOARD";
			}
			else if (choice === "2EXPLORE")
			{
				// Return to the manifest screen:
				missionVariables.taxistat = "EXPLORE";
			}
		}
		// 'On The Job' screen choices:
		if (missionVariables.taxistat === "ON_THE_JOB_1")
		{
			if (choice === "1EXPLORE")
			{
				// Return to the manifest screen:
				missionVariables.taxistat = "EXPLORE";
			}
			else if (choice === "2LAUNCH")
			{
				// Leave the station:
				player.ship.launch();
			}
		}
		// Bulletin Board screen choices:
		if (missionVariables.taxistat === "BOARD_1")
		{
			if (choice === "1JOB1")
			{
				// Display passenger contract #1 details:
				missionVariables.taxistat = "JOB1";
			}
			else if (choice === "2JOB2")
			{
				// Display passenger contract #2 details:
				missionVariables.taxistat = "JOB2";
			}
			else if (choice === "3JOB3")
			{
				// Display passenger contract #3 details:
				missionVariables.taxistat = "JOB3";
			}
			else if (choice === "4EXPLORE")
			{
				// Return to the manifest screen:
				missionVariables.taxistat = "EXPLORE";
			}
		}
		// Passenger Contract #1 screen choices:
		if (missionVariables.taxistat === "JOB1_1")
		{
			if (choice === "1ACCEPT")
			{
				// Store passenger contract #1 details into variables and add passenger to ship & manifest:
				missionVariables.taxi_passenger = missionVariables.taxi_job_name_1;
				missionVariables.taxi_dest = missionVariables.taxi_job_dest_1;
				missionVariables.taxi_dest_name = missionVariables.taxi_job_dest_name_1;
				missionVariables.taxi_diff = missionVariables.taxi_job_diff_1;
				missionVariables.taxi_pay = missionVariables.taxi_job_pay_1;
				missionVariables.taxi_time = missionVariables.taxi_job_time_1;
				missionVariables.taxistatus = "ON_THE_JOB";
				var name = missionVariables.taxi_passenger;
				var curloc = system.ID;
				var dest = missionVariables.taxi_dest;
				var time = missionVariables.taxi_time;
				var pay = missionVariables.taxi_pay;
				player.ship.addPassenger(name, curloc, dest, clock.seconds+time*24*3600, pay);
				missionVariables.taxistat = "ACCEPTED";
			}
			else if (choice === "2DECLINE")
			{
				// Return to bulletin board screen:
				missionVariables.taxistat = "BOARD";
			}
		}
		// Passenger Contract #2 screen choices:
		if (missionVariables.taxistat === "JOB2_1")
		{
			if (choice === "1ACCEPT")
			{
				// Store passenger contract #3 details into variables and add passenger to ship & manifest:
				missionVariables.taxi_passenger = missionVariables.taxi_job_name_2;
				missionVariables.taxi_dest = missionVariables.taxi_job_dest_2;
				missionVariables.taxi_dest_name = missionVariables.taxi_job_dest_name_2;
				missionVariables.taxi_diff = missionVariables.taxi_job_diff_2;
				missionVariables.taxi_pay = missionVariables.taxi_job_pay_2;
				missionVariables.taxi_time = missionVariables.taxi_job_time_2;
				missionVariables.taxistatus = "ON_THE_JOB";
				var name = missionVariables.taxi_passenger;
				var curloc = system.ID;
				var dest = missionVariables.taxi_dest;
				var time = missionVariables.taxi_time;
				var pay = missionVariables.taxi_pay;
				player.ship.addPassenger(name, curloc, dest, clock.seconds+time*24*3600, pay);
				missionVariables.taxistat = "ACCEPTED";
			}
			else if (choice === "2DECLINE")
			{
				// Return to bulletin board screen:
				missionVariables.taxistat = "BOARD";
			}
		}
		// Passenger Contract #3 screen choices:
		if (missionVariables.taxistat === "JOB3_1")
		{
			if (choice === "1ACCEPT")
			{
				// Store passenger contract #3 details into variables and add passenger to ship & manifest:
				missionVariables.taxi_passenger = missionVariables.taxi_job_name_3;
				missionVariables.taxi_dest = missionVariables.taxi_job_dest_3;
				missionVariables.taxi_dest_name = missionVariables.taxi_job_dest_name_3;
				missionVariables.taxi_diff = missionVariables.taxi_job_diff_3;
				missionVariables.taxi_pay = missionVariables.taxi_job_pay_3;
				missionVariables.taxi_time = missionVariables.taxi_job_time_3;
				missionVariables.taxistatus = "ON_THE_JOB";
				var name = missionVariables.taxi_passenger;
				var curloc = system.ID;
				var dest = missionVariables.taxi_dest;
				var time = missionVariables.taxi_time;
				var pay = missionVariables.taxi_pay;
				player.ship.addPassenger(name, curloc, dest, clock.seconds+time*24*3600, pay);
				missionVariables.taxistat = "ACCEPTED";
			}
			else if (choice === "2DECLINE")
			{
				// Return to bulletin board screen:
				missionVariables.taxistat = "BOARD";
			}
		}
		// Special Mission #1 screen choices:
		if (missionVariables.taxistat === "SPEC_MIS_01_1")
		{
			if (choice === "1ACCEPT")
			{
				// Store special mission #1 details into variables and add passenger to ship & manifest:
				missionVariables.taxi_passenger = missionVariables.taxi_specmis_1_ambassador;
				missionVariables.taxi_dest = missionVariables.taxi_specmis1_dest;
				missionVariables.taxi_dest_name = missionVariables.taxi_specmis1_dest_name;
				missionVariables.taxi_diff = 3;
				missionVariables.taxi_pay = 10000;
				missionVariables.taxi_time = missionVariables.taxi_specmis1_time;
				missionVariables.taxistatus = "ON_THE_JOB";
				var name = missionVariables.taxi_passenger;
				var curloc = system.ID;
				var dest = missionVariables.taxi_dest;
				var time = missionVariables.taxi_time;
				var pay = missionVariables.taxi_pay;
				player.ship.addPassenger(name, curloc, dest, clock.seconds+time*24*3600, pay);
				missionVariables.taxistat = "ACCEPTED";
			}
			else if (choice === "2DECLINE")
			{
				// Return to bulletin board screen:
				missionVariables.taxistat = "BOARD";
			}
		}
		return;
	}
	// Check if Player is currently docked at the main station:
	if (player.ship.dockedStation.isMainStation)
	{
		// Check if Player is doing a contract and is at the contract mission destination:
		if (missionVariables.taxistatus === "ON_THE_JOB" && system.ID === missionVariables.taxi_dest)
		{
			// Change variable to reflect no longer doing contract:
			missionVariables.taxistatus = "NOT_ON_JOB";
			// Increase variable to reflect another contract completed:
			missionVariables.taxijobstotal += 1;
			// Refuel Player ship:
			player.ship.fuel = 7.0;
			// Check if Player was doing special mission #1:
			if (missionVariables.taxi_diff === 3) 
			{
				// Change variable to reflect special mission #1 complete:
				missionVariables.taxi_specmiss_1 = "MISSION_COMPLETE";
				// Check if Snoopers OXP is installed and if so insert news story about events of special mission #1:
				if (worldScripts.snoopers) worldScripts.snoopers.insertNews({ID: this.name, Agency: 1, Message: expandDescription("[taxi_snoopers_specmiss_1]")});
			}
		}
	}
	// Check if Player is current docked at a Taxi Station:
	if (player.ship.dockedStation.hasRole("taxi_station"))
	{
		if (missionVariables.taxistat === "REVISIT")
		{
			// Check if Player is currently doing a contract and if so prompt Player that they need to complete contract:
			if (missionVariables.taxistatus === "ON_THE_JOB")
			{
				mission.runScreen(
				{
					title: "Welcome to the Taxi Galactica Station", 
					screenID: "taxi_galactica_welcome",
					messageKey: "mission_taxi_on_job", 
					model: "taxi_adder", 
					modelPersonality: this._modelPersonality,
					choicesKey: "mission_taxi_on_job_choices"
				}, 
				choiceEvaluation);
				missionVariables.taxistat = "ON_THE_JOB_1";
				return;
			}
			else
			{
				// Check if Player has completed 5 or more contracts, has not yet completed special mission #1 and has a free passenger berth:
				if (missionVariables.taxijobstotal >= 5 && missionVariables.taxi_specmiss_1 !== "MISSION_COMPLETE" && player.ship.passengerCount < player.ship.passengerCapacity)
				{
					// Generate name for ambassador for special mission #1 briefing:
					missionVariables.taxi_specmis_1_ambassador = randomName() + " " + randomName();
					// Generate special mission #1 destination:
					missionVariables.taxi_specmis1_dest = this._generateTaxiDest(20);
					missionVariables.taxi_specmis1_dest_name = System.systemNameForID(missionVariables.taxi_specmis1_dest);
					// Get special mission #1 destination government type and assign name to variable: 
					missionVariables.taxi_specmis1_dest_gov = System.infoForSystem(galaxyNumber, missionVariables.taxi_specmis1_dest).government;
					if (missionVariables.taxi_specmis1_dest_gov === 0) missionVariables.taxi_specmis1_dest_gov_name = "Anarchy";
					if (missionVariables.taxi_specmis1_dest_gov === 1) missionVariables.taxi_specmis1_dest_gov_name = "Feudal";
					if (missionVariables.taxi_specmis1_dest_gov === 2) missionVariables.taxi_specmis1_dest_gov_name = "Multi-Governmental";
					if (missionVariables.taxi_specmis1_dest_gov === 3) missionVariables.taxi_specmis1_dest_gov_name = "Dictatorship";
					if (missionVariables.taxi_specmis1_dest_gov === 4) missionVariables.taxi_specmis1_dest_gov_name = "Communist";
					if (missionVariables.taxi_specmis1_dest_gov === 5) missionVariables.taxi_specmis1_dest_gov_name = "Confederacy";
					if (missionVariables.taxi_specmis1_dest_gov === 6) missionVariables.taxi_specmis1_dest_gov_name = "Democracy";
					if (missionVariables.taxi_specmis1_dest_gov === 7) missionVariables.taxi_specmis1_dest_gov_name = "Corporate State";
					// Generate time limit for special mission #1:
					missionVariables.taxi_specmis1_time = Math.floor(Math.random() * (20 - 10 + 1) + 10);
					// Determine special mission #1 destination distance and assign to variable:
					missionVariables.taxi_specmis1_dist = Math.round(system.info.distanceToSystem(System.infoForSystem(galaxyNumber, missionVariables.taxi_specmis1_dest)) * 5) / 5;
					// Display special mission #1 briefing screen:
					mission.runScreen(
					{
						title: "Taxi Galactica Contract Offer", 
						screenID: "taxi_galactica_intro",
						messageKey: "mission_taxi_spec_mis_1_intro", 
						model: "taxi_adder", 
						modelPersonality: this._modelPersonality,
						choicesKey: "mission_taxi_spec_mis_1_intro_choices"
					}, choiceEvaluation);
					missionVariables.taxistat = "SPEC_MIS_01_1";
					return;
				}
				else
				{
					// Display welcome screen for Taxi Station and generate new contract destinations:
					mission.runScreen(
					{
						title: "Welcome to the Taxi Galactica Station", 
						screenID: "taxi_galactica_mission_intro",
						messageKey: "mission_taxi_intro", 
						model: "taxi_adder", 
						modelPersonality: this._modelPersonality,
						choicesKey: "mission_taxi_intro_choices"
					}, choiceEvaluation);
					this._generateTaxiJobs();
					missionVariables.taxistat = "REVISIT_1";
					return;
				}
			}
		}
		if (missionVariables.taxistat === "BOARD")
		{
			// Check Player has free passenger berth:
			if (player.ship.passengerCount >= player.ship.passengerCapacity)
			{
				// If no free passenger berth then cannot display bulletin board:
				mission.runScreen(
				{
					title: "Taxi Galactica Bulletin Board", 
					screenID: "taxi_galactica_no_room",
					messageKey: "mission_taxi_no_room", 
					model: "taxi_adder", 
					modelPersonality: this._modelPersonality,
					choicesKey: "mission_taxi_on_job_choices"
				}, choiceEvaluation);
				missionVariables.taxistat = "ON_THE_JOB_1";
				return;
			}
			else
			{
				// If free passenger berth available then display bulletin board:
				mission.runScreen(
				{
					title: "Taxi Galactica Bulletin Board", 
					screenID: "taxi_galactica_bb",
					messageKey: "mission_taxi_bulletin_board", 
					model: "taxi_adder", 
					modelPersonality: this._modelPersonality,
					choicesKey: "mission_taxi_bulletin_board_choices"
				}, choiceEvaluation);
				missionVariables.taxistat = "BOARD_1";
				return;
			}
		}
		if (missionVariables.taxistat === "JOB1")
		{
			// Calculate passenger contract #1 distance and store to variable:
			missionVariables.taxi_mission_distance_1 = Math.round(system.info.distanceToSystem(System.infoForSystem(galaxyNumber, missionVariables.taxi_job_dest_1)) * 5) / 5;
			// Display passenger contract #1 details:
			mission.runScreen(
			{
				title: "Taxi Galactica Contract Offer", 
				screenID: "taxi_galactica_job_1",
				messageKey: "mission_taxi_job_1", 
				model: "taxi_adder", 
				modelPersonality: this._modelPersonality,
				choicesKey: "mission_taxi_job_1_choices"
			}, choiceEvaluation);
			missionVariables.taxistat = "JOB1_1";
			return;
		}
		if (missionVariables.taxistat === "JOB2")
		{
			// Calculate passenger contract #2 distance and store to variable:
			missionVariables.taxi_mission_distance_2 = Math.round(system.info.distanceToSystem(System.infoForSystem(galaxyNumber, missionVariables.taxi_job_dest_2)) * 5) / 5;
			// Display passenger contract #2 details:
			mission.runScreen(
			{
				title: "Taxi Galactica Contract Offer", 
				screenID: "taxi_galactica_job_2",
				messageKey: "mission_taxi_job_2", 
				model: "taxi_adder", 
				modelPersonality: this._modelPersonality,
				choicesKey: "mission_taxi_job_2_choices"
			}, choiceEvaluation);
			missionVariables.taxistat = "JOB2_1";
			return;
		}
		if (missionVariables.taxistat === "JOB3")
		{
			// Calculate passenger contract #3 distance and store to variable:
			missionVariables.taxi_mission_distance_3 = Math.round(system.info.distanceToSystem(System.infoForSystem(galaxyNumber, missionVariables.taxi_job_dest_3)) * 5) / 5;
			// Display passenger contract #3 details:
			mission.runScreen(
			{
				title: "Taxi Galactica Contract Offer", 
				screenID: "taxi_galactica_job_3",
				messageKey: "mission_taxi_job_3", 
				model: "taxi_adder", 
				modelPersonality: this._modelPersonality,
				choicesKey: "mission_taxi_job_3_choices"
			}, choiceEvaluation);
			missionVariables.taxistat = "JOB3_1";
			return;
		}
		if (missionVariables.taxistat === "ACCEPTED")
		{
			// Display contract accepted screen:
			mission.runScreen(
			{
				title: "Taxi Galactica Contract Accepted", 
				screenID: "taxi_galactica_accepted",
				messageKey: "mission_taxi_accepted", 
				model: "taxi_adder", 
				modelPersonality: this._modelPersonality,
				choicesKey: "mission_taxi_on_job_choices"
			}, choiceEvaluation);
			missionVariables.taxistat = "ON_THE_JOB_1";
			return;
		}
		if (missionVariables.taxistat === "EXPLORE")
		{
			// Leave mission screen and return to manifest screen:
			return;
		}
	}
}

this.playerEnteredNewGalaxy = function()
{
	// Check if Player had a passenger contract in progress:
	if (missionVariables.taxistatus === "ON_THE_JOB") {
		// set a flag we can check the next time we dock
		this._newGalaxy = true;
	}
}