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

Expansion Fuel Generator

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 Fuel generator allows to synthesize fuel from energy. Fuel generator allows to synthesize fuel from energy.
Identifier oolite.oxp.SMax.FuelGenerator oolite.oxp.SMax.FuelGenerator
Title Fuel Generator Fuel Generator
Category Equipment Equipment
Author SMax SMax
Version 0.2 0.2
Tags Equipment, Fuel, Generator Equipment, Fuel, Generator
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/c/c2/FuelGenerator_0.2.oxz n/a
License CC-BY-NC-SA 4.0 CC-BY-NC-SA 4.0
File Size n/a
Upload date 1610873460

Documentation

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

README.md

Fuel Generator

By S Max

Fuel generator allows to synthesize fuel from energy.
Synthesizes 1LY fuel per 1 energy bank. Damage shields due subspace disturbances.

Available in [Oolite](http://www.oolite.org/) package manager (Equipment).

# License
This work is licensed under the Creative Commons Attribution-Noncommercial-Share Alike 4.0 Unported License. To view a copy of this license, visit http://creativecommons.org/licenses/by-nc-sa/4.0/

# Version History
## [0.2] - 2016-09-28

- Add sell generator option

## [0.1] - 2016-09-24

- Initial release

Equipment

Name Visible Cost [deci-credits] Tech-Level
Fuel Generator yes 200000 13+
Remove Fuel Generator yes 0 1+

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
Config/script.js
/* global log player*/

this.name = "FuelGenerator";
this.author = "SMax";
this.copyright = "2016 SMax";
this.licence = "CC-BY-NC-SA 4.0";
this.description = "Fuel generator allows to synthesize fuel from energy.";
this.version = "0.2";

"use strict";

this._DEBUG = false;

this._PRICE = 20000;
this._EQ_FG = "EQ_FUEL_GENERATOR";
this._EQ_REMOVE = "EQ_FUEL_GENERATOR_REMOVE";

this._logger = function(msg) {
	if (this._DEBUG) {
		log(this.name, msg);
	}
};

this.playerBoughtEquipment = function(equipmentKey) {
	if (equipmentKey == this._EQ_REMOVE) {
		player.ship.removeEquipment(this._EQ_FG);
		player.ship.removeEquipment(this._EQ_REMOVE);
		player.credits += this._PRICE / 2;
	}
};
Scripts/FGenerator.js
/* global log player*/

this.name = "FGenerator";
this.author = "SMax";
this.copyright = "2016 SMax";
this.licence = "CC-BY-NC-SA 4.0";
this.description = "Fuel generator allows to synthesize fuel from energy.";
this.version = "0.1";

"use strict";

this._DEBUG = false;

this._PREFIX = "Fuel Generator: ";

this._logger = function(msg) {
	if (this._DEBUG) {
		log(this.name, msg);
	}
};

this.activated = function() {
	if (player.ship.fuel == 7) {
		player.consoleMessage(this._PREFIX + "Fuel tanks are full!");
		return;
	}
	if (player.ship.energy < 64) {
		player.consoleMessage(this._PREFIX + "Not enough energy!");
		return;
	}

	var f = player.ship.fuel + 1;
	player.ship.fuel = (f > 7) ? 7 : f;

	var sA = player.ship.aftShield - Math.random() * player.ship.maxAftShield;
	player.ship.aftShield = (sA < 0) ? 0 : sA;

	var sF = player.ship.forwardShield - Math.random() * player.ship.maxForwardShield;
	player.ship.forwardShield = (sF < 0) ? 0 : sF;

	player.ship.energy -= 64;

	player.consoleMessage(this._PREFIX + "Done!");
};