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

Expansion Adder Mark III

Content

Manifest

from Expansion Manager's OXP list from Expansion Manifest
Description Isis Interstellar's upgrade of the old and maligned ship. Aimed at small-time and new traders, the ship has improved speed and cargo capacity. An ideal 'stepping stone' ship for those aspiring towards a big trader like a Cobra Mark III. Isis Interstellar's upgrade of the old and maligned ship. Aimed at small-time and new traders, the ship has improved speed and cargo capacity. An ideal 'stepping stone' ship for those aspiring towards a big trader like a Cobra Mark III.
Identifier oolite.oxp.Killer_Wolf.Adder_Mark_III oolite.oxp.Killer_Wolf.Adder_Mark_III
Title Adder Mark III Adder Mark III
Category Ships Ships
Author Killer_Wolf, Montana05 Killer_Wolf, Montana05
Version 1.52 1.52
Tags Isis Interstellar Isis Interstellar
Required Oolite Version
Maximum Oolite Version
Required Expansions
Optional Expansions
Conflict Expansions
Information URL https://wiki.alioth.net/index.php/Adder_Mark_III n/a
Download URL https://wiki.alioth.net/img_auth.php/9/94/Oolite.oxp.Killer_Wolf.Adder_Mark_III.oxz n/a
License CC BY-NC-SA 4.0 CC BY-NC-SA 4.0
File Size n/a
Upload date 1664033387

Documentation

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

original_read_me.txt

Installation : 
unzip, and place the OXP folder into your AddOns folder. Sometimes unzippy progs go stupid and split the folders 
up w/out making an overall OXP folder, if this happens just create one yourself called "Adder MkIII.OXP" and 
shove the unzipped folders into it.

Cheers to all on the boards who've helped out w/ my queries, and for all the kind words 
in response to this and past projects.

Licence: feel free to do what you like, but be respectful.

KW

read_me.txt

Overview
========

Isis Interstellar's upgrade of the old and maligned ship. Aimed at small-time and new traders, 
the ship has improved speed and cargo capacity. An ideal 'stepping stone' ship for those aspiring towards 
a big trader like a Cobra Mark III.

History
=======

While neither most of the different variants of the Adder nor the Adder Mark II ever had a proper license Isis Interstellar's 
Adder Mark III had all the necessary steps taken to register the ship design in the companies name.

To attract more clients soon the enhanced Adder Mark III-E was introduced to the market. This version offers better 
maneuverability and 1 additional pylon and mount in exchange for only 2 t of cargo space.

Remarks
=======

Inspired by cbr's imagery on the board (http://aegidian.org/bb/viewtopic.php?p=285753#p285753) Killer Wolf created the Adder Mark III based on the model of the Kings Cobra
Mark II escape capsule rather than the one of the original Adder. However, like all of his designs, the result is
certainly a esteemed addition to Oolite.

This ship fits nicely with the core-ships, no multiple lasers and definitely nothing "ueber".

Beginning with V 1.51 the Adder Mark III-E is featuring the HUD of the Vampire VI.


Credits
=======

Killer Wolf (author, model, basic textures and basic specifications)
tsoj (tweaked design of the model and for pointing out some confusion in the ships description)
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
=============

Version 1.01 and version 1.50 are fully compatible, you can run them simultaneously. However, in the
ship library you will find the Adder Mark III twice.

Details
=======

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

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 1.52 (Montana05, 2022/09/26)

    some small tweaks
    
V 1.51 (Montana05, 2022/09/23)

    removed a test routine
    added the HUD from the Vampire VI for the Adder Mark III-E

V 1.50 (Montana05, 2022/09/22)

    included 2 additional texture sets (blue and red)
    added an enhanced Adder Mark III-E (red set)
    now 5 NPC and 3 player variants are available
    replaced the model with tsoj's design
    some small tweaks to adjust better with other OXP's
    attached a small script for cargo and escape capsules
    
V 1.01 (Killer Wolf, 2022/07/23)

    corrected missile position

V 1.00 (Killer Wolf, 2022/07/19)

    KW's introduction of the Adder Mark III

Equipment

This expansion declares no equipment.

Ships

Name
Adder Mark III-E
Adder Mark III-E
Adder Mark III-E
Adder Mark III
Adder Mark III
Adder Mark III
Adder Mark III
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/KW_adder_mark_III-E_hud_switch.js
this.name			= "KW_adder_mark_III-E_hud_switch";
this.author			= "Thargoid, Montana05";
this.description	= "switches HUD's based on alert condition and ships energy";
this.version		= "1.51";
this.copyright		= "2022 Thargoid, Montana05";
this.licence		= "CC BY-NC-SA 4.0";
"use strict";

this.dockedCheck = function()
{
   if(player.ship.docked)
   {
      player.ship.hud = "KW_adder_mark_III-E_hud_station.plist";  // displays the station HUD
      return;
   };
};	 

this.alertConditionChanged = function(newCondition, oldCondition)
{
   switch(newCondition)
   {
      case 0:  // we're docked
      {
         player.ship.hud = "KW_adder_mark_III-E_hud_station.plist";  // set the station HUD
         break;
      }
      
      case 1:  // we're at green alert
      case 2:  // or we're at yellow alert
      {
         if(player.ship.energy > 128)  // if we're not using the damaged HUD
         {
            player.ship.hud = "KW_adder_mark_III-E_hud_standard.plist";  // set the standard HUD
         };
         break;
      }
   };
};

this.shipLaunchedFromStation = function()
{
   if(this.$energyCheckTimer)
   {
      this.$energyCheckTimer.start()
   }
   else
   {
      this.$energyCheckTimer = new Timer(this, this.$energyCheck, 0, 2)  // use a timer to keep an eye on the HUD state
   };
};


this.$energyCheck = function()
{
   if(player.ship.docked)
   {
      this.$energyCheckTimer.stop();
   }
   else
   {
      if(player.ship.energy < 128 )
      {
         player.ship.hud = "KW_adder_mark_III-E_hud_emergency.plist"; // display the emergency HUD
         return;
      };
      
      if(player.ship.energy >= 128 && player.ship.hud == "KW_adder_mark_III-E_hud_emergency.plist")
      {
         // if energy is > 128 and we're still displaying the emergency HUD, use other code to repair
         this.alertConditionChanged(player.alertCondition, 0);
      };
   }; 
};

this.shipDied = function()
{
   if(this.$energyCheckTimer)
	{
		if(this.$energyCheckTimer.isRunning) 
		{
			this.$energyCheckTimer.stop();
			delete this.$energyCheckTimer;
		};
	};
};
Scripts/KW_adder_mark_III.js
this.name			= "KW_adder_mark_III";
this.author			= "Montana05";
this.description	= "event handler for the Addder Mark III OXP";
this.version		= "1.51";
this.copyright		= "2022 Montana05";
this.licence		= "CC BY-NC-SA 4.0";
"use strict";

this.shipSpawned = function(ship)
{
	if(ship.dataKey.search(/KW_adder_mark_III/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("[KW_adder_mark_III_races_scientific]");  // add a race to the crew members
			let crewRank = expandDescription("[KW_adder_mark_III_crew_civil_small]");
			let crewInsurance = this.$getRndInteger(90, 450);
			let crewBounty = 0;
			
			switch(shipType) 
			{
				case "KW_adder_mark_III_escape_capsule_std_green":
				case "KW_adder_mark_III_escape_capsule_std_blue":

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

				case "KW_adder_mark_III_escape_capsule_std_red":
					
					crewName = ("the " + crewRace + " " + crewRank + " " + expandDescription("[nom]"));
					crewDescription = "a ship crew member";
					crewRole = "hunter";
					crewInsurance = this.$getRndInteger(90, 450);
					break;	
				
				case "KW_adder_mark_III_escape_capsule_std_green_criminal":
				case "KW_adder_mark_III_escape_capsule_std_blue_criminal":
				case "KW_adder_mark_III_escape_capsule_std_red_criminal":

					crewName = ("the " + crewRace + " " + expandDescription("[nom]"));
					crewDescription = "a " + expandDescription("[KW_adder_mark_III_criminals]") +  "wanted by GalCop police";
					crewRole = "pirate";
					crewBounty = crewInsurance + (15 * system.government);  // stable governments pay extra bonus
					crewInsurance = 0;
					break;

				case "KW_adder_mark_III_escape_capsule_std_green_pirate":
				case "KW_adder_mark_III_escape_capsule_std_blue_pirate":
				case "KW_adder_mark_III_escape_capsule_std_red_pirate":	

					crewName = ("the " + crewRace + " " + expandDescription("[KW_adder_mark_III_pirate_nicknames]") + expandDescription("[nom]"));
					crewDescription = "a " + expandDescription("[KW_adder_mark_III_criminals]") +  "wanted by GalCop police";
					crewRole = "pirate";
					crewBounty = (crewInsurance * 1.25) + (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":
				case "pirate":
				case "pirate-light-freighter":
				case "KW_adder_mark_III_01":
				case "KW_adder_mark_III-E_pirate":
								
					if(shipRole == "KW_adder_mark_III_01")
					{
						ship.primaryRole = "trader";
					};

					if(shipRole == "KW_adder_mark_III-E_pirate")
					{
						ship.primaryRole = "pirate";
					};
				
					while(ship.cargoSpaceUsed <= 1)  // makes sure that there is some cargo
					{
						if(this.$getRndInteger(1, 6) < 4)
						{
							ship.setCargoType("PLENTIFUL_GOODS");
						}
						else
						{
							ship.setCargoType("SCARCE_GOODS");
						};
					};	
					break;

				case "trader-courier":
								
					if(cargoLoad <= 1)
					{
						for(var i = this.$getRndInteger(5, 10) - 1 ; i >= 0 ; --i)
						{
							ship.adjustCargo(this.$KW_adder_mark_III_rare_cargo(), 1);
						};
					};
					break;	

				case "trader-smuggler":
				case "KW_adder_mark_III_02":
				
					ship.primaryRole = "trader-smuggler";
				
					while(ship.cargoSpaceUsed <= 1)  // makes sure that there is some cargo
					{
						if(this.$getRndInteger(1, 6) < 4)
						{
							ship.setCargoType("ILLEGAL_GOODS");
						}
						else
						{
							ship.setCargoType("PIRATE_GOODS");
						};
					};	
					break;
				
				case "scavenger":
				
					if(cargoLoad <= 1)
					{
						for(var i = this.$getRndInteger(5, 10) - 1 ; i >= 0 ; --i)
						{
							ship.adjustCargo(this.$KW_adder_mark_III_scavenger_cargo(), 1);
						};
					};
					break;

				case "hunter":
				case "KW_adder_mark_III-E_hunter":
											
					ship.primaryRole = "hunter";
									
					if(cargoLoad <= 1)
					{
						for(var i = this.$getRndInteger(3, 8) - 1 ; i >= 0 ; --i)
						{
							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.$KW_adder_mark_III_shipDied_old = ship.script.shipDied;
		ship.script.shipDied = this.$KW_adder_mark_III_shipDied;	
	};
};	

this.$KW_adder_mark_III_shipDied = function $KW_adder_mark_III_shipDied(whom, why) 
{
	if(this.ship.dataKey.search(/KW_adder_mark_III/i) < 0 || this.ship.hasRole("escape-capsule") || this.ship.isPlayer)
	{
		return;
	}
	else
	{
		this.name = "KW_adder_mark_III";
		let dice = worldScripts.KW_adder_mark_III;
		let diceRoll = dice.$getRndInteger;
				
		let shipType = this.ship.dataKey;
		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(shipType) 
		{
			case "KW_adder_mark_III_01":
			
				if(criminalCrew == 1)
				{
					system.addShips("KW_adder_mark_III_escape_capsule_std_green_criminal", 1, shipPos);
				}
				else if(pirateCrew == 1)
				{
					system.addShips("KW_adder_mark_III_escape_capsule_std_green_pirate", 1, shipPos);
				}
				else
				{
					system.addShips("KW_adder_mark_III_escape_capsule_std_green", 1, shipPos);
				};
			
				if(MRP01 == 1 && diceRoll(1, 10) > 8)
				{
					system.addShips("MRP01_container_cash", 1, shipPos);
				};
				break;

			case "KW_adder_mark_III_02":
			
				if(criminalCrew == 1)
				{
					system.addShips("KW_adder_mark_III_escape_capsule_std_blue_criminal", 1, shipPos);
				}
				else if(pirateCrew == 1)
				{
					system.addShips("KW_adder_mark_III_escape_capsule_std_blue_pirate", 1, shipPos);
				}
				else
				{
					system.addShips("KW_adder_mark_III_escape_capsule_std_blue", 1, shipPos);
				};

				if(MRP01 == 1 && diceRoll(1, 10) > 8)
				{
					system.addShips("MRP01_container_cash", 1, shipPos);
				};
				break;
			
			case "KW_adder_mark_III-E_hunter":
			
				if(criminalCrew == 1)
				{
					system.addShips("KW_adder_mark_III_escape_capsule_std_red_criminal", diceRoll(1, 2), shipPos);
				}
				else if(pirateCrew == 1)
				{
					system.addShips("KW_adder_mark_III_escape_capsule_std_red_pirate", diceRoll(1, 2), shipPos);
				}
				else
				{
					system.addShips("KW_adder_mark_III_escape_capsule_std_red", diceRoll(1, 2), shipPos);
				};
			
				if(MRP01 == 1 && diceRoll(1, 10) > 8)
				{
					system.addShips("MRP01_container_prisoners", 1, shipPos)
				};
				break;
				
			case "KW_adder_mark_III-E_pirate":

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

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

this.$KW_adder_mark_III_scavenger_cargo = function()
{
	const scavenger_cargo_array = ["alloys", "gold", "platinum", "computers", "machinery", "slaves"];

	// Montanas Ressource Pack 01 OXP
	if(worldScripts["MRP01_ressource_spawn"] && scavenger_cargo_array.indexOf("quirium_crystal") < 0)
	{
		scavenger_cargo_array.push("quirium_crystal");
	};
	
	let scavenger_cargo = 
	scavenger_cargo_array[Math.floor(Math.random() * scavenger_cargo_array.length)];
		
	return (scavenger_cargo);
};

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);
};