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

Expansion Mega Bat

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 A, based on the Fruit Bat and the Flying Fox, somewhat maneuverable medium fighter/escort. This ship is often used by pirates, assassins, hunters and escorts alike. For more details, please check the wiki page. A, based on the Fruit Bat and the Flying Fox, somewhat maneuverable medium fighter/escort. This ship is often used by pirates, assassins, hunters and escorts alike. For more details, please check the wiki page.
Identifier oolite.oxp.zzz.Montana05.BUS_MegaBat oolite.oxp.zzz.Montana05.BUS_MegaBat
Title Mega Bat Mega Bat
Category Ships Ships
Author Montana05 Montana05
Version 0.50 0.50
Tags ships ships
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/e/ed/Oolite.oxp.zzz.Montana05.BUS_MegaBat.OXZ n/a
License CC BY-NC-SA 4.0 CC BY-NC-SA 4.0
File Size n/a
Upload date 1637641163

Documentation

Also read http://wiki.alioth.net/index.php/Mega%20Bat

read_me.txt

Overview
========

The "Mega Bat Mark I" is a, rather maneuverable, medium fighter/escort. The design by Biarge United Shipyards is based 
on the "Fruit Bat" and the "Flying Fox" from SensimTrading.

This ship is often used by pirates, assassins, hunters and escorts alike.

History
=======

The "Fruit Bat" was designed for cheap mass production by the now defunct CLAN Ltd. from Erbiti. The production facilities 
were later bought by SensimTrading and relocated to Anisor.

The ship was not a very popular model, but when MASSTrans GLC bought into the traditional family business 
(holding 49.90 percent of the shares), the production of a slightly enhanced version under the name of "Flying Fox" started. 
This craft was exclusively sold to MASSTrans' subsidiary firm MT SEC. 

While sales of the standard model have been rising slightly, the demand for a customer version of the "Flying Fox"
are estimated to be even higher. When MT SEC, with allowance of their parent company, started to open their escort services 
to private traders, an enhanced model was needed. This time, the management contacted Biarge United Shipyards and asked for
a design.

The result was the "Mega Bat Mark I" with a larger hull, faster, more energy, a better recharge rate and 3 front lasers. 
This ship, partly produced at SensimTrading and partly at Biarge United Shipyards, is slowly replacing the "Flying Fox" 
at MT SEC but is also available on the open market and highly requested. 

Credits
=======

The Mega Bat Mark I is inspired by the Fruit Bat and the Flying Fox (Fruit Bat OXP), thanks a lot to Rorschachhamster.

Rorschachhamster (basic model and textures)

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

Oolite V 1.88 or higher. 

Details
=======

For additional details please check the wiki-page: http://wiki.alioth.net/index.php/Mega_Bat

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
initial release

Equipment

This expansion declares no equipment. This may be related to warnings.

Ships

Name
Mega Bat Mark I
Mega Bat Mark I
MT SEC Mega Bat Mark I
BHG Mega Bat Mark I
BUS_MegaBat_bhg_team_01
BUS_MegaBat_cargo_firearms
Cargo container
BUS_MegaBat_cargo_liquor_wines
BUS_MegaBat_cargo_witchfire_whiskey
escape capsule
escape capsule
escape capsule
escape capsule
escape capsule
escape capsule
Mega Bat Mark I
Mega Bat Mark I
Mega Bat Mark I

Models

This expansion declares no models. This may be related to warnings.

Scripts

Path
Scripts/BUS_MegaBat_events.js
this.name			= "BUS_MegaBat_events";
this.author			= "Montana05";
this.description	= "Event handler for Mega Bat Mark I";
this.version		= "0.50";
this.copyright		= "2021 Montana05";
this.licence		= "CC BY-NC-SA 4.0";
"use strict";

this.shipSpawned = function(ship)
{
	this.$BUS_MegaBat_shipType = this.ship.dataKey;
	this.$BUS_MegaBat_shipRole = this.ship.primaryRole;

	if(this.ship.hasRole("escape-capsule"))
	{
		var crewName = expandDescription("[nom]");
		var crewDescription = "a crew member of an evacuated ship";
		var crewRole = "hunter";  // not perfect but somewhere in the middle
		var crewRank = "Pilot";
		var bhgRank = "Hunter";  // middle rank
		var crewRace = expandDescription("[BUS_MegaBat_GalCop_races_scientific]");  // add a race to the crew members
		var crewBounty = 0;
		var crewInsurance = this.$getRndInteger(90, 450);

		// based on an crew of 1 to 2 person
		this.$BUS_MegaBat_crew_ranks_array = 
		["Gunner", "Co-Pilot", "Pilot", "Commander"];
		crewRank = 
		$BUS_MegaBat_crew_ranks_array[Math.floor(Math.random() * $BUS_MegaBat_crew_ranks_array.length)];

		// ranks for Bounty Hunter Guild taken from Random Hits OXP, all credits to LittleBear
		this.$BUS_MegaBat_bhg_ranks_array = 
		["Outsider", "Recruit", "Vigilante", "Bailiff", "Deputy", "Tracker", "Hunter", "Sheriff", "Provost", "Marshal", "Enforcer", "Executioner", "Judge"];
		bhgRank = 
		$BUS_MegaBat_bhg_ranks_array[Math.floor(Math.random() * $BUS_MegaBat_bhg_ranks_array.length)];

		switch(this.$BUS_MegaBat_shipType) 
		{
			case "BUS_MegaBat_escape_capsule_std":

				crewName = ("the " + crewRace + " " + crewRank + " " + expandDescription("[nom]"));
				crewDescription = "a ship crew member";
				crewInsurance = crewInsurance;
				crewRole = "hunter";
				break;

			case "BUS_MegaBat_escape_capsule_MT":

				crewName = ("the " + crewRace + " " + crewRank + " " + expandDescription("[nom]"));
				crewDescription = "a MT Sec ship crew member";
				crewInsurance = (crewInsurance * 1.20);  // MT Sec got better insurance conditions
				crewRole = "hunter";
				break;

			case "BUS_MegaBat_escape_capsule_bhg":

				crewName = ("the " + crewRace + " " + bhgRank + " " + expandDescription("[nom]"));
				crewDescription = "a member of the Bounty Hunter Guild";
				crewInsurance = (crewInsurance * 1.10);  // BHG got better insurance conditions
				crewRole = "hunter";
				break;

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

				crewName = ("the " + crewRace + " " + crewRank + " " + expandDescription("[nom]"));
				crewDescription = "a rouge MT Sec ship crew member";
				crewBounty = (crewInsurance * 1.20) + (15 * system.government);  // stable governments pay extra bonus
				crewInsurance = 0;
				crewRole = "pirate";
				break;
	
			case "BUS_MegaBat_escape_capsule_bhg_pirate":

				crewName = ("the " + crewRace + " " + bhgRank + " " + expandDescription("[nom]"));
				crewDescription = "a rouge member of the Bounty Hunter Guild";
				crewBounty = (crewInsurance * 1.10) + (15 * system.government);  // stable governments pay extra bonus
				crewInsurance = 0;
				crewRole = "pirate";
				break;
			
			default: 
				break;
		};

		this.ship.setCrew
		(
			{
				name: crewName,
				short_description: crewDescription,
				role: crewRole,
				species: crewRace,
				insurance: crewInsurance,
				bounty: crewBounty
			}
		);

		// removes individual roles
		this.ship.primaryRole = "escape-capsule";
	}
	else
	{
		var cargoSpace = this.ship.cargoSpaceCapacity;
		var cargoLoad = this.ship.cargoSpaceUsed;
		var cargoLeft = cargoSpace - cargoLoad;
		
		// removes individual roles of the ships, this roles will only be called from other OXP's
		// adds some cargo to all ships
		switch(this.$BUS_MegaBat_shipRole) 
		{
			case "BUS_MegaBat_01":
			case "BUS_MegaBat_MT":
			
				this.ship.primaryRole = "escort-medium";
				break;

			case "BUS_MegaBat_02":
			case "BUS_MegaBat_bhg":
			case "BUS_MegaBat_bhg_team_01":
			
				this.ship.primaryRole = "hunter-medium";
				break;

			case "BUS_MegaBat_pirate":

				this.ship.primaryRole = "pirate-medium-fighter";
				break;

			default: 
				break;
		};

		if(cargoLeft >= 3)
		{
			for(var i = this.$getRndInteger(1, 3) - 1 ; i >= 0 ; --i)
			{
				this.ship.adjustCargo(this.$BUS_MegaBat_space_jockeyCargo(), 1);
			};
		};
	};
};	

this.shipDied = function(whom, why)
{
	if(this.ship.hasRole("escape-capsule"))
	{
		return;
	}
	else
	{
		// neutral inits first
		var podType = "escape-capsule";
		var podCount = 1;
		var criminalCrew = "N";
		var cargoType = "";
		var cargoPod = "cargopod";
		var cargoCount = 0;

		if(this.ship.bounty > 7 || this.$BUS_MegaBat_shipType == "BUS_MegaBat_pirate")
		{
			criminalCrew = "Y";
		};
					
		switch(this.$BUS_MegaBat_shipType) 
		{
			case "BUS_MegaBat_01":
			case "BUS_MegaBat_02":
			case "BUS_MegaBat_pirate":
			
				if(criminalCrew == "Y")
				{
					podType = "BUS_MegaBat_escape_capsule_pirate";
				}	
				else
				{
					podType = "BUS_MegaBat_escape_capsule_std";
				};
				break;
			
			case "BUS_MegaBat_MT":
			
				if(criminalCrew == "Y")
				{
					podType = "BUS_MegaBat_escape_capsule_MT_pirate";
				}	
				else
				{
					podType = "BUS_MegaBat_escape_capsule_MT";
				};
				break;

				case "BUS_MegaBat_bhg":
				case "BUS_MegaBat_bhg_team_01":

				if(criminalCrew == "Y")
				{
					podType = "BUS_MegaBat_escape_capsule_bhg_pirate";
				}	
				else
				{
					podType = "BUS_MegaBat_escape_capsule_bhg";
				};
				break;

			default: 
				break;
		};

		// emergency crafts
		system.addShips(podType, podCount, this.ship.position);
		
		// cargopods
		if(this.ship.cargoSpaceUsed > 0)
		{
			for(var i = this.ship.cargoList.length - 1 ; i >= 0 ; --i)
			{
				cargoType = this.ship.cargoList[i].commodity;
				cargoPod = ("BUS_MegaBat_cargo_" + cargoType);
				cargoCount = this.ship.cargoList[i].quantity;
							
				if(cargoType == "firearms" || cargoType == "food" || cargoType == "liquor_wines" || cargoType == "witchfire_whiskey")
				{
					system.addShips(cargoPod, cargoCount, this.ship.position);
				};
			};
		};
	};
};

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

	if(worldScripts["witchfire-populator"])  // Darkside Moonshine Distillery OXP
	{
		this.$BUS_MegaBat_space_jockey_cargo_array.push("witchfire_whiskey");
	};

	var space_jockey_cargo = 
	$BUS_MegaBat_space_jockey_cargo_array[Math.floor(Math.random() * $BUS_MegaBat_space_jockey_cargo_array.length)];

	return (space_jockey_cargo);
};

this.$getRndInteger = function(min, max)
{
	return Math.floor(Math.random() * (max - min + 1) ) + min;
};
Scripts/BUS_MegaBat_resources.js
this.name			= "BUS_MegaBat_resources";
this.author			= "Montana05";
this.description	= "adjusts containers";
this.version		= "0.50";
this.copyright		= "2021 Montana05";
this.licence		= "CC BY-NC-SA 4.0";
"use strict";

this.shipSpawned = function(ship)
{
	// standard primary roles
	if(this.ship.dataKey.indexOf("BUS_MegaBat_cargo") != -1)
		this.ship.primaryRole = "cargopod";
};