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

Expansion SKS Plasma Mark I

Content

Manifest

from Expansion Manager's OXP list from Expansion Manifest
Description From Silver Knight Shipyards on Diqudi in chart 3 comes the Plasma Mark I, a small multi-roll craft designed primarily for a pilot who is trying to make a living in the business of passenger carrying, and who, to be able to get contracts, must take the ones through more dangerous systems than most pilots would be willing to. From it's speed of 0.4 LM to it's patented SpaceCamo(tm), it is a craft that, wherever you go, assassins would have a hard time spotting you. From Silver Knight Shipyards on Diqudi in chart 3 comes the Plasma Mark I, a small multi-roll craft designed primarily for a pilot who is trying to make a living in the business of passenger carrying, and who, to be able to get contracts, must take the ones through more dangerous systems than most pilots would be willing to. From it's speed of 0.4 LM to it's patented SpaceCamo(tm), it is a craft that, wherever you go, assassins would have a hard time spotting you.
Identifier oolite.oxp.sirarian.sks-plasma-mk-1 oolite.oxp.sirarian.sks-plasma-mk-1
Title SKS Plasma Mark I SKS Plasma Mark I
Category Ships Ships
Author SirArian SirArian
Version 2.0 2.0
Tags
Required Oolite Version
Maximum Oolite Version
Required Expansions
Optional Expansions
Conflict Expansions
Information URL http://aegidian.org/bb/viewtopic.php?f=4&t=16380 n/a
Download URL https://wiki.alioth.net/img_auth.php/0/04/Oolite.oxp.SirArian.SKS-Plasma-Mk1.oxz n/a
License CC-BY-NC-SA 4.0 CC-BY-NC-SA 4.0
File Size n/a
Upload date 1610873211

Documentation

Also read http://wiki.alioth.net/index.php/SKS%20Plasma%20Mark%20I

readme.txt

From Silver Knight Shipyards on Diqudi in chart 3 comes the Plasma Mark I, a small multi-roll craft designed primarily for a pilot who is trying to make a living in the business of passenger carrying, and who, to be able to get contracts, must take the ones through more dangerous systems than most pilots would be willing to. From it's speed of 0.4 LM to it's patented SpaceCamo(tm), it is a craft that, wherever you go, assassins would have a hard time spotting you.

Special thanks to Smivs for helping me out on this OXP. Without his help, it would not have been possible.

I would also like to thank Nyarlatothep and Smivs for writing the JavaScript needed for the passenger berth control. (And thanks also to Paradox for putting it in his D.T.T Atlas so I could find it and use it in my OXP.)

*LICENSE*
This work is licensed under the Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International (CC BY-NC-SA 4.0)
For more information, please visit: http://creativecommons.org/licenses/by-nc-sa/4.0/

Equipment

Name Visible Cost [deci-credits] Tech-Level
Passenger Berth - takes up 5t of cargo space yes 8250 6+
Remove Passenger Berth - reclaims 5t of cargo space yes 1000 2+

Ships

Name
SKS Plasma Mark I
sks_plasma_mk1_player

Models

This expansion declares no models.

Scripts

Path
Scripts/berthControl-conditions.js
/*jslint white: true, undef: true, eqeqeq: true, bitwise: true, regexp: true, newcap: true, immed: true */
/*global missionVariables, player*/


"use strict";


this.name			= "berthControl-conditions";
this.author			= "Nyarlatothep";
this.copyright		= "This script is hereby placed in the public domain.";
this.version		= "1.2";


/* contexts: npc, purchase, scripted, newShip, (loading), (damage), (portable) */
this.allowAwardEquipment = function(equipment, ship, context)
{

	// OXP hook to allow stations to forbid specific equipment
	if (context == "purchase" && player.ship.dockedStation && player.ship.dockedStation.scriptInfo["oolite-barred-equipment"])
	{
		if (player.ship.dockedStation.scriptInfo["oolite-barred-equipment"].indexOf(equipment) != -1)
		{
			return false;
		}
	}

	// fixed berthts?
	var fixedBerths = ship.scriptInfo.fixedBerths;
	if (context == "purchase" && (fixedBerths === "Yes" || fixedBerths === "Y"))
	{
		player.consoleMessage(missionVariables.berthControl_marketMessage, 1.5);
		return false;
	}
	
	if (context == "purchase" && equipment == "EQ_PASSENGER_BERTH_REMOVAL")
	{
		//var removableBerths = parseInt(missionVariables.berthControl_removableBerths);
		if (missionVariables.berthControl_removableBerths === 0)
		{
			player.consoleMessage(missionVariables.berthControl_marketMessage, 1.5);
			return false;
		}
	}


	// otherwise allowed
	return true;
}
Scripts/berthControl.js
/*jslint white: true, undef: true, eqeqeq: true, bitwise: true, regexp: true, newcap: true, immed: true */

"use strict";

// Standard attributes
this.name           = "BerthControl";
this.author         = "Smivs, Nyarlatothep";
this.copyright      = "This script is hereby placed in the public domain.";
this.version        = "1.2";
this.description    = "Passenger berths management script.";


this.playerBoughtNewShip = function(ship)
// set removable berth count when ship is bought
{
	missionVariables.berthControl_removableBerths = null;
	missionVariables.berthControl_marketMessage = null;
	
	var msg = "";
	var berths = ship.passengerCapacity;  // !
	var fixedBerths = ship.scriptInfo.fixedBerths;
	// get bool value from string
	fixedBerths = (fixedBerths === "Yes" || fixedBerths === "Y");
	
	if (fixedBerths)
	{
		msg = "This ship cannot be equipped with standard Passenger Berths.";
	}
	
	var minBerths = parseInt(ship.scriptInfo.minBerths);
	// ensure minBerth is a valid integer & it's > 0
	if (fixedBerths || (!isNaN(minBerths) && minBerths > 0))
	{
		// no berths to start with? no need for minBerths!
		if (berths > 0)
		{
			//  calculate the actual number of permanent berths
			if (fixedBerths || minBerths > berths) minBerths = berths;
			//  compose a nice formatted message...
			msg = (minBerths ===  berths ? "The " + minBerths : minBerths + " of the" ) + " Passenger Berth" + (berths === 1 ? "" : "s");
			msg += " that came with the ship cannot be " + (fixedBerths? "modified" : "removed") + " at this shipyard.";
			// save the number of removable berths for later
			missionVariables.berthControl_removableBerths =  berths - minBerths;
		}
	}
	
	if (msg !== "")
	{
		player.consoleMessage(msg, 5);
		//  save a message for later
		if (berths > 0 && minBerths > 0)
		{
			msg = minBerths + " Passenger Berths cannot be modified at this shipyard."
		}
		missionVariables.berthControl_marketMessage = msg;
	}
}

this.playerBoughtEquipment = function(equipment)
{
  if (missionVariables.berthControl_removableBerths === null)
	{
		// no berthControl mission variable? do nothing
		return;
	}
 
  if (equipment == "EQ_PASSENGER_BERTH")
    {
		missionVariables.berthControl_removableBerths++;  // update counter
    }

  if (equipment == "EQ_PASSENGER_BERTH_REMOVAL")
    {
		missionVariables.berthControl_removableBerths--;  // update counter
    }
}