| this.name        = "star-fuel"; 
this.author      = "Redspear"; 
this.copyright   = "2018 Redspear";
this.licence     = "CC BY-NC-SA 4.0"; 
this.description = "Script to boost injectors with fuel scooped rather than bought"; 
this.version     = "1.0";
"use strict";
//	set injector bonus and test for last source of fuel
this.startUpComplete = this.playerBoughtNewShip = function()
{
	this._SFfalse = player.ship.injectorSpeedFactor;
	this._SFtrue = player.ship.injectorSpeedFactor *2;
	
	if (player.ship.equipmentStatus("EQ_STAR_FUEL") == "EQUIPMENT_OK") {
		player.ship.injectorSpeedFactor = _SFtrue;
		}
		else {
		player.ship.injectorSpeedFactor = _SFfalse;
		}
}
//	check if scooped fuel grants bonus
this.shipScoopedFuel = function()
{
	if (system.info.radius > 6000) {	//	based on planet rather than sun radius (former visible on galactic chart)
		player.ship.awardEquipment("EQ_STAR_FUEL");
		player.ship.injectorSpeedFactor = _SFtrue;
		player.consoleMessage ("Now Scooping PREMIUM Fuel");
		}
		else{
		player.ship.removeEquipment("EQ_STAR_FUEL");
		player.ship.injectorSpeedFactor = _SFfalse;
		}
}
//	remove bonus and equipment marker for saved games
this.playerBoughtEquipment = function(equipment)
{
    if (equipment === "EQ_FUEL"){
		player.ship.injectorSpeedFactor = _SFfalse;
		player.ship.removeEquipment("EQ_STAR_FUEL");
		}
}
//	ensure no 'save stacking' of bonus
this.playerWillSaveGame = function()
{
     player.ship.injectorSpeedFactor = _SFfalse;
}
 |