Back to Index Page generated: Nov 12, 2024, 11:02:04 PM

Expansion Star Fuel

Content

Warnings

  1. Information URL mismatch between OXP Manifest and Expansion Manager string length at character position 0

Manifest

from Expansion Manager's OXP list from Expansion Manifest
Description Script to produce superior injector fuel at some stars Script to produce superior injector fuel at some stars
Identifier oolite.oxp.redspear.star_fuel oolite.oxp.redspear.star_fuel
Title Star Fuel Star Fuel
Category Mechanics Mechanics
Author Redspear Redspear
Version 1.0 1.0
Tags
Required Oolite Version
Maximum Oolite Version
Required Expansions
Optional Expansions
Conflict Expansions
Information URL n/a
Download URL https://wiki.alioth.net/img_auth.php/4/4d/Oolite.oxp.redspear.star_fuel.oxz n/a
License CC-BY-NC-SA 4.0 CC-BY-NC-SA 4.0
File Size n/a
Upload date 1610873299

Documentation

Also read http://wiki.alioth.net/index.php/Star%20Fuel

Equipment

Name Visible Cost [deci-credits] Tech-Level
Star Fuel no 1 101+

Ships

This expansion declares no ships. This may be related to warnings.

Models

This expansion declares no models. This may be related to warnings.

Scripts

Path
Scripts/star-fuel.js
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;
}