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

Expansion Fruit 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, somewhat manouvreable fighter/escort, often used by pirates, hunters and escorts alike. For more details please check the wiki page. A, somewhat manouvreable fighter/escort, often used by pirates, hunters and escorts alike. For more details please check the wiki page.
Identifier oolite.oxp.zzz.Montana05.MassTrans_FruitBat oolite.oxp.zzz.Montana05.MassTrans_FruitBat
Title Fruit Bat Fruit Bat
Category Ships Ships
Author Rorschachhamster, Montana05 Rorschachhamster, Montana05
Version 1.10 1.10
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/4/45/Oolite.oxp.zzz.Montana05.MassTrans_FruitBat.OXZ n/a
License CC BY-NC-SA 3.0 CC BY-NC-SA 3.0
File Size n/a
Upload date 1637640304

Documentation

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

read_me.txt

Overview
========

The "Fruit Bat" is a, somewhat maneuverable fighter/escort, often used by pirates, 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, the "Mega Bat Mark I", was accepted and the production and profits were split between both companies.

Credits
=======

Rorschachhamster (original author)

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

Oolite V 1.88 or higher. 

Details
=======

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

License
=======

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

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

Version 1.00 / 2013-02-04 / Rorschachhamster:

    initial release

Version 1.01 / 2013-03-20 / Rorschachhamster:

    The MT Sec Flying Fox is now outfitted with an aft laser as well, and made a little tougher

Version 1.10 / 2021-11-23 / Montana05:

    overhaul of the complete OXP, including fixing existing bugs
    adjusted roles
    rearranged or added weapon positions
    added flashers for the position lights
    modified the models
    tweaked the emission map
    added normal map
    added "gloss"
    outsourced the role of pirate to an individual ship with tweaked diffuse map and weapons
    added a small ship-script for escape pods and cargo (includes new entities and textures)
    added shiplibrary.plist

    
Original ReadMe from Rorschachhamster
=====================================

The Fruit Bat Ship(s) OXP.
By Rorschachhamster

Made some time ago, never thought about releasing it, because of issues, that I could finally solve, 
and now a recomended part of my coming freighttrain oxp.

INSTALLATION
Unzip the fruitbat1.00.oxp into your addons folder. 

Version 1.01
The MT Sec Flying Fox is now outfitted with an aft laser as well, and made a little tougher...

Version 1.00
Original release. 

Equipment

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

Ships

Name
MT SEC Flying Fox
Fruit Bat
MassTrans_FruitBat_cargo_firearms
Cargo container
MassTrans_FruitBat_cargo_liquor_wines
MassTrans_FruitBat_cargo_witchfire_whiskey
escape capsule
escape capsule
escape capsule
escape capsule
Fruit Bat
Fruit Bat

Models

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

Scripts

Path
Scripts/MassTrans_FruitBat_events.js
this.name			= "MassTrans_FruitBat_events";
this.author			= "Montana05";
this.description	= "Event handler for Fruit Bat and Flying Fox";
this.version		= "1.10";
this.copyright		= "2021 Montana05";
this.licence		= "CC BY-NC-SA 3.0";
"use strict";

this.shipSpawned = function(ship)
{
	this.$MassTrans_FruitBat_shipType = this.ship.dataKey;
	this.$MassTrans_FruitBat_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 crewRace = expandDescription("[MassTrans_FruitBat_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.$MassTrans_FruitBat_crew_ranks_array = 
		["Gunner", "Co-Pilot", "Pilot", "Commander"];
		crewRank = 
		$MassTrans_FruitBat_crew_ranks_array[Math.floor(Math.random() * $MassTrans_FruitBat_crew_ranks_array.length)];

		switch(this.$MassTrans_FruitBat_shipType) 
		{
			case "MassTrans_FruitBat_escape_capsule_std":

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

			case "MassTrans_FruitBat_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 "MassTrans_FruitBat_escape_capsule_pirate":
				
				crewName = ("the " + crewRace + " " + expandDescription("[MassTrans_FruitBat_pirate_nicknames]") + expandDescription("[nom]"));
				crewDescription = "a " + expandDescription("[MassTrans_FruitBat_criminals]") +  "wanted by GalCop police";
				crewRole = "pirate";
				crewBounty = crewInsurance + (15 * system.government);  // stable governments pay extra bonus
				crewInsurance = 0;
				break;
	
			case "MassTrans_FruitBat_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;
				
			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.$MassTrans_FruitBat_shipRole) 
		{
			case "MassTrans_FruitBat":
			case "MassTrans_FlyingFox_MT":
			
				this.ship.primaryRole = "escort-medium";
				break;

			case "MassTrans_FruitBat_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.$MassTrans_FruitBat_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.$MassTrans_FruitBat_shipType == "MassTrans_FruitBat_pirate")
		{
			criminalCrew = "Y";
		};
					
		switch(this.$MassTrans_FruitBat_shipType) 
		{
			case "MassTrans_FruitBat":
			case "MassTrans_FruitBat_pirate":
			
				if(criminalCrew == "Y")
				{
					podType = "MassTrans_FruitBat_escape_capsule_pirate";
				}	
				else
				{
					podType = "MassTrans_FruitBat_escape_capsule_std";
				};
				break;
			
			case "MassTrans_FlyingFox_MT":
			
				if(criminalCrew == "Y")
				{
					podType = "MassTrans_FruitBat_escape_capsule_MT_pirate";
				}	
				else
				{
					podType = "MassTrans_FruitBat_escape_capsule_MT";
				};
				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 = ("MassTrans_FruitBat_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.$MassTrans_FruitBat_space_jockeyCargo = function()
{
	this.$MassTrans_FruitBat_space_jockey_cargo_array = ["firearms", "food", "liquor_wines"];

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

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

	return (space_jockey_cargo);
};

this.$getRndInteger = function(min, max)
{
	return Math.floor(Math.random() * (max - min + 1) ) + min;
};
Scripts/MassTrans_FruitBat_resources.js
this.name			= "MassTrans_FruitBat_resources";
this.author			= "Montana05";
this.description	= "adjusts containers";
this.version		= "1.10";
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("MassTrans_FruitBat_cargo") != -1)
		this.ship.primaryRole = "cargopod";
};