"use strict";
this.name        = "Escort_Contracts_Rep"; 
this.version     = "1.7.1"; 
this.author      = "capt murphy"; 
this.copyright   = "2011 capt murphy";
this.licence     = "CC BY-NC-SA 3.0"; // see http://creativecommons.org/licenses/by-nc-sa/3.0/ for more info.
this.description = "Escort Contracts - worldscript to display reputation."; 

// This is an event handler driven function that updates the manifest escort reputation text.
this.guiScreenWillChange = function(to, from)
{
	if (to !=="GUI_SCREEN_MANIFEST" || player.ship.equipmentStatus("EQ_ESCORTCONTRACTS") !== "EQUIPMENT_OK")
		{return;}

	var escortrepstring = "Your I.T.H.A. escort reputation is ";  
	if (worldScripts["Escort_Contracts"].ec_escortrep < -5)
		{escortrepstring += "very poor.";}
	else if (worldScripts["Escort_Contracts"].ec_escortrep < 0)
		{ escortrepstring += "poor.";}
	else if (worldScripts["Escort_Contracts"].ec_escortrep > 10)
		{escortrepstring += "excellent.";}
	else if (worldScripts["Escort_Contracts"].ec_escortrep > 5)
		{ escortrepstring += "very good.";}
	else if (worldScripts["Escort_Contracts"].ec_escortrep > 0)
		{ escortrepstring += "good.";}
	else
		{escortrepstring += "neutral.";}

	mission.setInstructions(escortrepstring, "Escort_Contracts_Rep");
}