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

Expansion Adder Mark II

Content

Manifest

from Expansion Manager's OXP list from Expansion Manifest
Description 2 remakes of the legendary Adder Mk II. The Adder Mark II-R is a racer while the Adder Mark II-F is a fast, light fighter. 2 remakes of the legendary Adder Mk II. The Adder Mark II-R is a racer while the Adder Mark II-F is a fast, light fighter.
Identifier oolite.oxp.zzz.Montana05.Adder_Mark_II oolite.oxp.zzz.Montana05.Adder_Mark_II
Title Adder Mark II Adder Mark II
Category Ships Ships
Author Ramon, Montana05 Ramon, Montana05
Version 0.50 0.50
Tags Marett Space Corporation Marett Space Corporation
Required Oolite Version
Maximum Oolite Version
Required Expansions
Optional Expansions
Conflict Expansions
Information URL https://wiki.alioth.net/index.php/Adder_Mk_II n/a
Download URL https://wiki.alioth.net/img_auth.php/1/12/Oolite.oxp.zzz.Montana05.Adder_Mark_II.OXZ n/a
License CC BY-NC-SA 4.0 CC BY-NC-SA 4.0
File Size n/a
Upload date 1664283760

Documentation

Also read http://wiki.alioth.net/index.php/Adder%20Mark%20II

read_me.txt

Overview
========

2 remakes of the legendary Adder Mk II:

The Adder Mark II-R (Racer) is a fast ship with enhanced injectors, used by couriers and professional racers alike. Some
commanders keep them as a secondary craft and use them for interplanetary trips.

The Adder Mark II-F is a light fighter, swift enough to outrun most other ships and therefore favored by 
hunters and assassins. 

History
=======

Marett Space Corporation was a small ship production company but blessed with a creative designer-team under the lead of
maestro Rufernus. Ruferenus, a former project-manager, left Benulobiweed Inc. in bad blood, rumors have it that he took 
some blueprints on his way out. His Adder MK II certainly had uncommon technology included, and the clients stood in line to
get one of this ships.

Business boomed until the ship factory became collateral damage in one of the endless civil wars. Unfortunately, this damage
included Ruferenus, parts of his team and the main database. There were whispers that the destruction of the shipyard and 
the death of Ruferenus were somehow arranged by Benulobiweed Inc. Security Department, but neither GalCop nor local 
authorities ever started even an investigation.

However, the production of the Adder Mk II ended for good and while sometimes you still could find a used 
Adder Mk II for sale, they became pretty rare and expensive.

The remaining members of the designer-team were tasked with the creation of a remake. Some months later 2 prototypes 
were introduced to the management, the Adder Mark II-R as a racer and the Adder Mark II-F as a fast, light fighter. 
With many key-data missing, it proved to be impossible to merge both versions into one.

Remarks
=======

The Adder Mark II is inspired by the Adder Mk II from Ramons Marett Space Corporation OXP. Since sadly there is no
license available, a remake and some adaption of the history were necessary.

Both ships are equipped with boosted injectors which offer higher speed, using more fuel and increase the maintenance costs.

The Adder Mark II-R focuses on speed, therefore the only standard weapon fit in the fore mount is a pulse laser.

Credits
=======

Ramon (original author, basic model and textures)
Griff (model and basic textures of the standard escape capsule)
another_commander (basic specular map of the standard escape capsule)

Requirements
============

Oolite V 1.88 or higher and a video card capable of supporting Oolite shaders.

Compatibility
=============

Ramons Marett Space Corporation OXP and Adder Mark II OXP could be installed together. However, the Adder Mk II
will become rare and more expensive.

Details
=======

For additional details, please check the wiki-page: https://wiki.alioth.net/index.php/Adder_Mark_II

License
=======

This work is licensed under Creative Commons Attribution Non-Commercial Share Alike 4.0 International (CC BY-NC-SA 4.0).
To view a copy of this license, visit https://creativecommons.org/licenses/by-nc-sa/4.0

Version History
===============

V 0.50 (Montana05, 2022/09/27)

    initial release

Equipment

This expansion declares no equipment.

Ships

Name
Adder Mark II-F
Adder Mark II-F
MSC_adder_mark_IIF_player
Adder Mark II-R
MSC_adder_mark_IIR_player
escape capsule
escape capsule
escape capsule
escape capsule
escape capsule
escape capsule
escape capsule
escape capsule
escape capsule

Models

This expansion declares no models.

Scripts

Path
Scripts/MSC_adder_mark_II.js
this.name			= "MSC_adder_mark_II";
this.author			= "Montana05";
this.description	= "event handler for the Addder Mark II OXP";
this.version		= "0.50";
this.copyright		= "2022 Montana05";
this.licence		= "CC BY-NC-SA 4.0";
"use strict";

this.shipSpawned = function(ship)
{
	if(ship.dataKey.search(/MSC_adder_mark_II/i) < 0 || ship.isPlayer)
	{
		return;
	}
	else
	{
		var shipType = ship.dataKey;
		var shipRole = ship.primaryRole;
		var cargoLoad = ship.cargoSpaceUsed;

		// setup escape pods
		if(ship.hasRole("escape-capsule"))
		{
			let crewName = expandDescription("[nom]");
			let crewDescription = "a crew member of an evacuated ship";
			let crewRole = "hunter";  // the role is not particular important anymore, all data will be added by the script
			let crewRace = expandDescription("[MSC_adder_mark_II_races_scientific]");  // add a race to the crew members
			let crewRank = expandDescription("[MSC_adder_mark_II_crew_civil_small]");
			let crewInsurance = this.$getRndInteger(90, 450);
			let crewBounty = 0;
			
			switch(shipType) 
			{
				case "MSC_adder_mark_II_escape_capsule_std_red":
				case "MSC_adder_mark_II_escape_capsule_std_blue":

					crewName = ("the " + crewRace + " " + crewRank + " " + expandDescription("[nom]"));
					crewDescription = "a ship crew member";
					crewRole = "trader";
					crewInsurance = this.$getRndInteger(90, 450);
					break;

				case "MSC_adder_mark_II_escape_capsule_std_red_racer":
					
					crewName = ("the " + crewRace + " Pilot " + expandDescription("[nom]"));
					crewDescription = "a professional space racer";
					crewRole = "trader";
					crewInsurance = this.$getRndInteger(135, 675);  // higher insurance for racers
					break;
				
				case "MSC_adder_mark_II_escape_capsule_std_red_criminal":
				case "MSC_adder_mark_II_escape_capsule_std_blue_criminal":
				
					crewName = ("the " + crewRace + " " + expandDescription("[nom]"));
					crewDescription = "a " + expandDescription("[MSC_adder_mark_II_criminals]") +  "wanted by GalCop police";
					crewRole = "pirate";
					crewBounty = crewInsurance + (15 * system.government);  // stable governments pay extra bonus
					crewInsurance = 0;
					break;

				case "MSC_adder_mark_II_escape_capsule_std_red_racer_criminal":
			
					crewName = ("the " + crewRace + " Pilot " + expandDescription("[nom]"));
					crewDescription = "a criminal space racer wanted by GalCop police";
					crewRole = "pirate";
					crewInsurance = this.$getRndInteger(135, 675);  // higher insurance for racers
					crewBounty = crewInsurance + (15 * system.government);  // stable governments pay extra bonus
					crewInsurance = 0;

					if(shipRole == "racer")
					{
						crewName = ("the " + crewRace + " Pilot " + expandDescription("[nom]"));
					};
					break;	

				case "MSC_adder_mark_II_escape_capsule_std_red_pirate":	
				case "MSC_adder_mark_II_escape_capsule_std_blue_pirate":
				
					crewName = ("the " + crewRace + " " + expandDescription("[MSC_adder_mark_II_pirate_nicknames]") + expandDescription("[nom]"));
					crewDescription = "a " + expandDescription("[MSC_adder_mark_II_criminals]") +  "wanted by GalCop police";
					crewRole = "pirate";
					crewBounty = (crewInsurance * 1.25) + (25 * system.government);  // stable governments pay extra bonus
					crewInsurance = 0;
					break;

				case "MSC_adder_mark_II_escape_capsule_std_blue_assassin":

				crewName = ("the " + crewRace + " " + expandDescription("[nom]"));
				crewDescription = "a " + expandDescription("[MSC_adder_mark_II_assassins_01]") + expandDescription("[MSC_adder_mark_II_assassins_02]") +  "sought by Galactic Navy Intelligence";
				crewRole = "pirate";
				crewBounty = (crewInsurance * 1.50) + (25 * system.government);  // stable governments pay extra bonus
				crewInsurance = 0;
				break;	
					
				default: 
	
					break;
			};

			ship.setCrew
			(
				{
					name: crewName,
					short_description: crewDescription,
					role: crewRole,
					species: crewRace,
					insurance: crewInsurance,
					bounty: crewBounty
				}
			);
			
			// removes individual roles
			ship.primaryRole = "escape-capsule";
		}
		else
		{
			switch(shipRole) 
			{
				case "trader-courier":
				case "MSC_adder_mark_IIR":
				
					ship.primaryRole = "trader-courier";
				
					if(cargoLoad == 0)
					{
						ship.adjustCargo(this.$KW_adder_mark_III_rare_cargo(), 1);
					};
					break;	
				
				case "racer":
				case "hunter-medium":
				case "assassin-light":
				case "pirate":
				case "pirate-light-fighter":
				case "MSC_adder_mark_IIF":
				case "MSC_adder_mark_IIF_pirate":
				
					if(shipRole == "MSC_adder_mark_IIF")
					{
						ship.primaryRole = "hunter-medium";
					};

					if(shipRole == "MSC_adder_mark_IIF_pirate")
					{
						ship.primaryRole = "pirate";
					};
					
					if(cargoLoad == 0)
					{
						ship.adjustCargo(this.$KW_adder_mark_III_space_jockey_cargo(), 1);
					};
					break;

				default: 
	
					break;
			};
		};
		
		// if there is an existing script in shipDied time to move it
		ship.script.$MSC_adder_mark_II_shipDied_old = ship.script.shipDied;
		ship.script.shipDied = this.$MSC_adder_mark_II_shipDied;	
	};
};	

this.$MSC_adder_mark_II_shipDied = function $MSC_adder_mark_II_shipDied(whom, why) 
{
	if(this.ship.dataKey.search(/MSC_adder_mark_II/i) < 0 || this.ship.hasRole("escape-capsule") || this.ship.isPlayer)
	{
		return;
	}
	else
	{
		this.name = "MSC_adder_mark_II";
		let dice = worldScripts.KW_adder_mark_III;
		let diceRoll = dice.$getRndInteger;
				
		let shipRole = this.ship.primaryRole;
		let shipBounty = this.ship.bounty;
		let shipPos = this.ship.position;
		let MRP01 = 0;
		let criminalCrew = 0;
		let pirateCrew = 0;

		if(worldScripts["MRP01_ressource_spawn"])  // Montanas Ressource Pack 01 OXP
		{
			MRP01 = 1;
		};
		
		if(shipBounty > 7 && shipBounty < 15)
		{
			criminalCrew = 1;
		};

		if(shipBounty > 14 || this.ship.isPirate)
		{
			pirateCrew = 1;
		};

		// if Montanas Ressource Pack 01 OXP is installed the containers from there are used, otherwise let the core-game handle it
		if(MRP01 == 1 && this.ship.cargoSpaceUsed > 0)
		{
			for(let i = this.ship.cargoList.length - 1 ; i >= 0 ; --i)
			{
				let cargoType = this.ship.cargoList[i].commodity;
				let cargoPod = ("MRP01_container_" + cargoType);
				let cargoCount = this.ship.cargoList[i].quantity;
				
				system.addShips(cargoPod, cargoCount, shipPos);
			};
		};

		switch(shipRole) 
		{
			case "trader-courier":
			
				if(criminalCrew == 1)
				{
					system.addShips("MSC_adder_mark_II_escape_capsule_std_red_criminal", 1, shipPos);
				}
				else if(pirateCrew == 1)
				{
					system.addShips("MSC_adder_mark_II_escape_capsule_std_red_pirate", 1, shipPos);
				}
				else
				{
					system.addShips("MSC_adder_mark_II_escape_capsule_std_red", 1, shipPos);
				};
			
				if(MRP01 == 1 && diceRoll(1, 10) > 8)
				{
					system.addShips("MRP01_container_cash", 1, shipPos);
				};
				break;

			case "racer":
				
				if(criminalCrew == 1 || pirateCrew == 1)
				{
					system.addShips("MSC_adder_mark_II_escape_capsule_std_red_racer_criminal", 1, shipPos);
				}
				else
				{
					system.addShips("MSC_adder_mark_II_escape_capsule_std_red_racer", 1, shipPos);
				};

				case "hunter-medium":
			
				if(criminalCrew == 1)
				{
					system.addShips("MSC_adder_mark_II_escape_capsule_std_blue_criminal", 1, shipPos);
				}
				else if(pirateCrew == 1)
				{
					system.addShips("MSC_adder_mark_II_escape_capsule_std_blue_pirate", 1, shipPos);
				}
				else
				{
					system.addShips("MSC_adder_mark_II_escape_capsule_std_blue", 1, shipPos);
				};

				if(MRP01 == 1 && diceRoll(1, 10) > 8)
				{
					system.addShips("MRP01_container_prisoners", 1, shipPos)
				};
				break;
			
			case "pirate":
			case "pirate-light-fighter":	

				system.addShips("MSC_adder_mark_II_escape_capsule_std_blue_pirate", 1, shipPos);
				
				if(MRP01 == 1 && diceRoll(1, 10) > 9)
				{
					system.addShips("MRP01_container_cash", 1, shipPos);
				};
				break;

			case "assassin-light":

				system.addShips("MSC_adder_mark_II_escape_capsule_std_blue_assassin", 1, shipPos);
				
				if(MRP01 == 1 && diceRoll(1, 10) > 9)
				{
					system.addShips("MRP01_container_cash", 1, shipPos);
				};
				break;
	
			default:
				
				break;
		};
	};

	if(this.ship.script.$MSC_adder_mark_II_shipDied_old)
	{
		this.ship.script.$MSC_adder_mark_II_old(whom, why);
	};
};

this.$KW_adder_mark_III_rare_cargo = function()
{
	const rare_cargo_array = ["gold", "platinum", "gem_stones"];

	// medicine is part of several OXP's therefore a check of the market is required
	let goods = system.mainStation.market;
	for(let i in goods) 
	{
		if(goods[i].key == ["medicine"] && rare_cargo_array.indexOf("medicine") < 0)
		{
			rare_cargo_array.push("medicine");
		};
	}; 
	
	// Montanas Ressource Pack 01 OXP
	if(worldScripts["MRP01_ressource_spawn"] && rare_cargo_array.indexOf("quirium_crystal") < 0)
	{
		rare_cargo_array.push("quirium_crystal");
	};

	// Dictators OXP 2.0
	if(worldScripts["dictators_clergy_artifacts"] && rare_cargo_array.indexOf("quirium_crystal") < 0)
	{
		rare_cargo_array.push("holy_artifacts");
	};
	
	let rare_cargo = 
	rare_cargo_array[Math.floor(Math.random() * rare_cargo_array.length)];
		
	return (rare_cargo);
};

// food, medicine, booze and guns, what else you need for your trip ? :P
this.$KW_adder_mark_III_space_jockey_cargo = function()
{
	const space_jockey_cargo_array = ["firearms", "food", "liquor_wines"];

	 // Darkside Moonshine Distillery OXP
	if(worldScripts["witchfire-populator"] && space_jockey_cargo_array.indexOf("witchfire_whiskey") < 0)
	{
		space_jockey_cargo_array.push("witchfire_whiskey");
	};
	
	// medicine is part of several OXP's therefore a check of the market is required
	if(system.mainStation)
	{
		let goods = system.mainStation.market;
		for(let i in goods) 
		{
			if(goods[i].key == ["medicine"] && space_jockey_cargo_array.indexOf("medicine") < 0)
			{
				space_jockey_cargo_array.push("medicine");
			};
		};
	}; 

	let space_jockey_cargo = 
	space_jockey_cargo_array[Math.floor(Math.random() * space_jockey_cargo_array.length)];

	return (space_jockey_cargo);
};

this.$getRndInteger = function(min, max)
{
	return (Math.floor(Math.random() * (max - min + 1) ) + min);
};