Back to Index Page generated: May 8, 2024, 6:16:03 AM

Expansion Extra Fuel Tanks

Content

Manifest

from Expansion Manager's OXP list from Expansion Manifest
Description Additional Reserve (1LY) and Auxiliary (3LY) fuel tanks. These are fitted internally and can be re-filled. Additional Reserve (1LY) and Auxiliary (3LY) fuel tanks. These are fitted internally and can be re-filled.
Identifier oolite.oxp.smivs.ExtraFuelTanks oolite.oxp.smivs.ExtraFuelTanks
Title Extra Fuel Tanks Extra Fuel Tanks
Category Equipment Equipment
Author Smivs Smivs
Version 1.8 1.8
Tags
Required Oolite Version
Maximum Oolite Version
Required Expansions
Optional Expansions
Conflict Expansions
Information URL http://wiki.alioth.net/index.php/ExtraFuelTanks n/a
Download URL https://wiki.alioth.net/img_auth.php/9/90/ExtraFuelTanks-v1.8.oxz n/a
License CC-BY-NC-SA 4.0 CC-BY-NC-SA 4.0
File Size n/a
Upload date 1610873369

Documentation

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

readme.rtf

ExtraFuelTanks OXP V1.8

This OXP adds buyable extra fuel tanks. These are primable equipment - 'Shift-n' to prime, and 'n' to activate. There are two types of tank available.

The Reserve Tank holds 1LY of Liquified Quirium Gas.

The Auxiliary Tank holds 3LY of Liquified Quirium Gas.

You may only fit one type of tank, so decide which will be the best for you. The 'Reserve' is an emergency top-up for when you are almost out of fuel. The 'Auxiliary' is much more of a game-changer allowing you to be much more flexible in terms of refuelling by docking or sunskimming.

You can buy a Full Tank (Cr 10 000 for the 'Reserve' and Cr 50 000 for the Auxiliary) from any TL10+ station. This will appear on the F5 screen as 'Reserve Fuel Tank' or 'Auxiliary Fuel Tank'. 

The fuel can be moved into the main tank when the main tank is empty. The F5 screen will then show the Reserve or Auxiliary tank to be 'Empty'.

After use you can refill the tank. 'Refill Reserve Tank' for Cr 10 or 'Refill Auxiliary Tank' for Cr 30. The tanks can be refilled at any Main Station.

If you have a Reserve Tank, you can upgrade to an Auxiliary Tank. The Reserve Tank must be empty, and the cost of the conversion is Cr 40 000. The new Auxiliary Tank will be full and ready for use.

License:-
This work is licensed under the Creative Commons Attribution-Noncommercial-Share Alike 4.0 Unported License.

Author:-
The OXP was developed by Smivs.




Equipment

Name Visible Cost [deci-credits] Tech-Level
Refill Reserve Fuel Tank no 100 1+
Refill Auxiliary Fuel Tank no 300 1+
Auxiliary Fuel Tank -Full yes 500000 10+
Auxiliary Fuel Tank - Empty yes 500000 17+
Reserve Fuel Tank - Full yes 100000 10+
Reserve Fuel Tank - Empty yes 100000 17+
Upgrade Reserve Fuel Tank to Auxiliary Fuel Tank no 400000 10+

Ships

This expansion declares no ships.

Models

This expansion declares no models.

Scripts

Path
Scripts/extra_tanks_script.js
"use strict";

// Standard attributes 
this.name           = "extra_tanks_script.js"; 
this.author         = "Smivs"; 
this.copyright      = "(C) Smivs";
this.licence        = "Creative Commons Attribution - Non-Commercial - Share Alike 4.0";
this.version        = "1.8"; 
this.description    = "Script to control tanks and refills, and upgrade reserve to auxiliary tank."; 


this.startUp = function()
// check for old-version variables at start
{
  if (missionVariables.TL_FOR_EQ_RESERVE_TANK_EMPTY || missionVariables.TL_FOR_EQ_AUX_TANK_EMPTY)
    {
// set mission flag
      this.missionFlag = "NO";
      this.startUpComplete;
      delete this.startUp;
  }
}
this.missionScreenOpportunity = function()
// check for old-version variables 
{
  if (missionVariables.TL_FOR_EQ_RESERVE_TANK_EMPTY || missionVariables.TL_FOR_EQ_AUX_TANK_EMPTY)
    {
// Do nothing now if tank is damaged
      if (player.ship.docked && player.ship.equipmentStatus("EQ_RESERVE_TANK" || "EQ_RESERVE_TANK_EMPTY" || "EQ_AUX_TANK" || "EQ_AUX_TANK_EMPTY") == "EQUIPMENT_DAMAGED") 
        {
          return;
        }
// otherwise clean up and replace old status variables from previous versions and run mission screen
      if (player.ship.docked && player.ship.equipmentStatus("EQ_RESERVE_TANK") == "EQUIPMENT_OK")
        {
          delete missionVariables.TL_FOR_EQ_RESERVE_TANK_EMPTY;
          missionVariables.extra_tank_status = "RESERVE_TANK_FULL";
          mission.runScreen({title: "!!! Fuel Tank Safety Notice !!!", messageKey: "extraTank_B_C_Update"}); 
          this.missionFlag = "DONE";
        }
      if (player.ship.docked && player.ship.equipmentStatus("EQ_RESERVE_TANK_EMPTY") == "EQUIPMENT_OK")
        {
          delete missionVariables.TL_FOR_EQ_RESERVE_TANK_EMPTY;
          missionVariables.extra_tank_status = "RESERVE_TANK_EMPTY";
          mission.runScreen({title: "!!! Fuel Tank Safety Notice !!!", messageKey: "extraTank_B_C_Update"}); 
          this.missionFlag = "DONE";
        }
      if (player.ship.docked && player.ship.equipmentStatus("EQ_AUX_TANK") == "EQUIPMENT_OK")
        {
          delete missionVariables.TL_FOR_EQ_AUX_TANK_EMPTY;
          missionVariables.extra_tank_status = "AUX_TANK_FULL";
          mission.runScreen({title: "!!! Fuel Tank Safety Notice !!!", messageKey: "extraTank_B_C_Update"}); 
          this.missionFlag = "DONE";
        }
      if (player.ship.docked && player.ship.equipmentStatus("EQ_AUX_TANK_EMPTY") == "EQUIPMENT_OK")
        {
          delete missionVariables.TL_FOR_EQ_AUX_TANK_EMPTY;
          missionVariables.extra_tank_status = "AUX_TANK_EMPTY";
          mission.runScreen({title: "!!! Fuel Tank Safety Notice !!!", messageKey: "extraTank_B_C_Update"}); 
          this.missionFlag = "DONE";
        }
    } 
}
// handle purchase of tanks and refills
this.playerBoughtEquipment = function(equipment)
{
  if (equipment == "EQ_RESERVE_TANK")
    {
      missionVariables.extra_tank_status = "RESERVE_TANK_FULL";
    }
  if (equipment == "EQ_AUX_TANK")
    {
      missionVariables.extra_tank_status = "AUX_TANK_FULL";
    }
  if (equipment == "EQ_1LY_CHARGE")
    {
      player.ship.removeEquipment("EQ_1LY_CHARGE");
      player.ship.removeEquipment("EQ_RESERVE_TANK_EMPTY");
      player.ship.awardEquipment("EQ_RESERVE_TANK");
      missionVariables.extra_tank_status = "RESERVE_TANK_FULL";
    }
  if (equipment == "EQ_3LY_CHARGE")
    {
      player.ship.removeEquipment("EQ_3LY_CHARGE");
      player.ship.removeEquipment("EQ_AUX_TANK_EMPTY");
      player.ship.awardEquipment("EQ_AUX_TANK");
      missionVariables.extra_tank_status = "AUX_TANK_FULL";
    }
  if (equipment== "EQ_UPGRADE_TANK")
    {
      player.ship.removeEquipment("EQ_RESERVE_TANK_EMPTY");
      player.ship.removeEquipment("EQ_UPGRADE_TANK");
      player.ship.awardEquipment("EQ_AUX_TANK");
      missionVariables.extra_tank_status = "AUX_TANK_FULL";
    }
}
this.activated = function()
{
// if reserve tank activated
  if (player.ship.fuel === 0 && player.ship.equipmentStatus ("EQ_RESERVE_TANK") == "EQUIPMENT_OK" && missionVariables.extra_tank_status == "RESERVE_TANK_FULL")
     {
       this.ship.fuel += 1.0;
       player.ship.removeEquipment("EQ_RESERVE_TANK");
       player.ship.awardEquipment("EQ_RESERVE_TANK_EMPTY");
       missionVariables.extra_tank_status = "RESERVE_TANK_EMPTY";
       player.consoleMessage("Fuel transferred to Main Tank");
     }
// unless the main tank is too full
  else if (player.ship.fuel > 0 && player.ship.equipmentStatus ("EQ_RESERVE_TANK") == "EQUIPMENT_OK" && missionVariables.extra_tank_status == "RESERVE_TANK_FULL")
     {
       player.consoleMessage("Fuel transfer cancelled - Main Tank must be empty");
       return;
     }
// or the reserve tank is empty
  else if (player.ship.fuel > 0 && player.ship.equipmentStatus ("EQ_RESERVE_TANK_EMPTY") == "EQUIPMENT_OK" && missionVariables.extra_tank_status == "RESERVE_TANK_EMPTY")
     {
       player.consoleMessage("Fuel transfer un-available - Reserve Tank is empty.");
       return;
     }
// if auxiliary tank activated
  else if (player.ship.fuel === 0 && player.ship.equipmentStatus ("EQ_AUX_TANK") == "EQUIPMENT_OK" && missionVariables.extra_tank_status === "AUX_TANK_FULL")
     {
        this.ship.fuel += 3.0;
        player.ship.removeEquipment("EQ_AUX_TANK");
        player.ship.awardEquipment("EQ_AUX_TANK_EMPTY");
	missionVariables.extra_tank_status = "AUX_TANK_EMPTY";
        player.consoleMessage("Fuel transferred to Main Tank");
      }
// unless the main tank is too full
  else if (player.ship.fuel > 0 && player.ship.equipmentStatus ("EQ_AUX_TANK") == "EQUIPMENT_OK" && missionVariables.extra_tank_status === "AUX_TANK_FULL")
      {
        player.consoleMessage("Fuel transfer cancelled - Main Tank must be empty");
        return;
      }
// or the auxiliary tank is empty
  else if (player.ship.fuel > 0 && player.ship.equipmentStatus ("EQ_AUX_TANK_EMPTY") == "EQUIPMENT_OK" && missionVariables.extra_tank_status == "AUX_TANK_EMPTY")
      {
        player.consoleMessage("Fuel transfer un-available - Auxiliary Tank is empty.");
        return;
      }
}
this.allowAwardEquipment = function(equipment, ship, context)
// condition scripting for Refills and Upgrade to control availability
{
  if (equipment == "EQ_1LY_CHARGE")
    {
      if (context == "purchase" && player.ship.equipmentStatus("EQ_RESERVE_TANK_EMPTY") == "EQUIPMENT_OK" && missionVariables.extra_tank_status == "RESERVE_TANK_EMPTY")
	{
	  return true;
	}
    }
 if (equipment == "EQ_3LY_CHARGE")
    {
      if (context == "purchase" && player.ship.equipmentStatus("EQ_AUX_TANK_EMPTY") == "EQUIPMENT_OK" && missionVariables.extra_tank_status == "AUX_TANK_EMPTY")
	{
	  return true;
	}
    }
  if (equipment == "EQ_UPGRADE_TANK")
    {
      if (context == "purchase" && player.ship.equipmentStatus("EQ_RESERVE_TANK_EMPTY") == "EQUIPMENT_OK" && missionVariables.extra_tank_status == ("RESERVE_TANK_EMPTY"))
	{
	  return true;
	}
    }
}