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

Expansion Enhanced Vipers

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 This OXP adds enhanced Viper Patrols, Viper Pursuits, and Viper Interceptors, to richer stable systems; GalCop Deputies to stable poor/average systems; and Bounty Hunters to unstable/dangerous systems. They are not über ships - far from it - but with the advent of heavy pirates and heavy assassins into the core game, some toughening of GalCop Vipers seemed appropriate. This OXP adds enhanced Viper Patrols, Viper Pursuits, and Viper Interceptors, to richer stable systems; GalCop Deputies to stable poor/average systems; and Bounty Hunters to unstable/dangerous systems. They are not über ships - far from it - but with the advent of heavy pirates and heavy assassins into the core game, some toughening of GalCop Vipers seemed appropriate.
Identifier oolite.oxp.zzz.Montana05.FdL_enhanced_vipers oolite.oxp.zzz.Montana05.FdL_enhanced_vipers
Title Enhanced Vipers Enhanced Vipers
Category Ships Ships
Author Montana05, Cody Montana05, Cody
Version 0.52 0.52
Tags police ships police 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/1/10/Oolite.oxp.zzz.Montana05.FdL_enhanced_vipers.OXZ n/a
License CC BY-NC-SA 4.0 CC BY-NC-SA 4.0
File Size n/a
Upload date 1638498259

Documentation

Also read http://wiki.alioth.net/index.php/Enhanced%20Vipers

read_me.txt

Overview
========

This OXP adds enhanced Viper Patrols, Viper Pursuits, and Viper Interceptors, to richer, stable systems; GalCop Deputies to 
stable poor/average systems; and Bounty Hunters to unstable/dangerous systems. They are not über ships - far from it - but with the 
advent of heavy pirates and heavy assassins into the core game, some toughening of GalCop Vipers seemed appropriate.

Hopefully, the sight of a squad of Vipers being trounced by a gang of bandits, or getting slaughtered by a bunch of assassins, 
will become less common. Some of the enhanced Vipers have highly skilled pilots, so any players acting as bandits should beware.

History
=======
In a dangerous Ooniverse, the richer stable systems had traditionally been safe havens for traders. However, in the poorer, 
less well-policed systems, piracy was increasing. When tougher ships became available, pirate clans grew bolder, and those 
safe havens became the target of increasingly frequent raids. GalCop Vipers bore the brunt of these raids, and their losses 
began to mount. When trade started to suffer, the wealthy merchant guilds got together, and decided something had to be done. 
After much haggling, they struck a deal with GalCop, Faulcon de Lacy, and Griff Industries, to finance the building of enhanced 
replacements for the ageing Vipers. With a view to spreading the potential benefits to poorer systems, the Bounty Hunters Guild 
was brought onboard. As is often the case though, budgetary constraints - brought about by spiraling costs and pocket-lining 
by unscrupulous bureaucrats - limited the scope of the enhancements.

Nevertheless, GalCop's enhanced Vipers are now starting to make their presence felt, and this it is hoped will eventually 
turn the tide, and perhaps restore some semblance of normality. The improved performance and durability of the enhanced Vipers 
has also attracted the more skillful pilots, and recruitment - which had been declining - is on the up.

Credits
=======

Cody (concept and lore)
Griff (models and basic textures)
another_commander (basic specular map escape capsule)

Remarks
=======

Additional to the enhanced Vipers the GalCop police emblem and individual escape capsules are added to all core-vipers. 
Viper Pursuit, in the core-game just shown as Viper, is now correctly named.

The package is adjusted to Illicit Unlock OXP, Sniper Gun OXP, Carriers.OXP and Carriers_with_turrets.OXP.

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

Oolite V 1.88 or higher.

Details
=======

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

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

V 0.51
removed a test routine in the script

V 0.52
small tweaks to adjust better with other OXP's

Equipment

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

Ships

Name
escape capsule
FdL_viper_E_escape_capsule_bhg_pirate
escape capsule
GalCop Viper-E Interceptor
GalCop Viper-E Patrol
GalCop Viper-E Pursuit
BHG Viper-E Pursuit
Deputy BHG Viper-E Pursuit
FdL_viper_E_pursuit_bhg_team_01
viper-carrier-player-neutral
viper-carrier-player-neutral-turret
viper-carrier-viper-neutral

Models

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

Scripts

Path
Scripts/FdL_viper_E_conditions.js
this.name			= "FdL_viper_E_conditions";
this.author			= "Montana05";
this.description	= "condition script for Viper-E ships";
this.version		= "0.52";
this.copyright		= "2021 Montana05";
this.licence		= "CC BY-NC-SA 4.0";
"use strict";

this.allowSpawnShip = function(shipKey) 
{
	var systemEco = system.economy;
	var systemGov = system.government;
	
	if(system.isInterstellarSpace || system.sun.isGoingNova || system.sun.hasGoneNova)
	{
		return false;
	};
	
	switch(shipKey) 
	{
		case "FdL_viper_E_patrol":
		case "FdL_viper_E_pursuit":
		case "FdL_viper_E_interceptor":	
			
			// GalCop space police in rich, stable governments	
			if(systemGov > 4 && systemEco <= 3)
			{
				return true;
			};
			break;

		// GalCop deputies in average or poor stable governments
		case "FdL_viper_E_pursuit_bhg_deputy":
			
			if(systemGov > 4 && systemEco > 3)
			{
				return true;
			};
			break;

		// bounty hunters in unstable and dangerous systems
		case "FdL_viper_E_pursuit_bhg":
		case "FdL_viper_E_pursuit_bhg_team_01":
		
			if(systemGov <= 2)
			{
				return true;
			};
			break;
			
		default:
			break;	
	};
	return false;
};
Scripts/FdL_viper_E_events.js
this.name			= "FdL_viper_E_events";
this.author			= "Montana05";
this.description	= "event handler for Viper-E ships";
this.version		= "0.52";
this.copyright		= "2021 Montana05";
this.licence   		= "CC BY-NC-SA 4.0";
"use strict";

this.shipSpawned = function(ship)
{
	this.FdL_viper_shipType = this.ship.dataKey;
		
	if(this.ship.hasRole("escape-capsule"))
	{
		// neutral inits first
		var crewName = expandDescription("[nom]");
		var crewDescription = "a crew member of an evacuated ship";
		var crewRole = "police";  // most of the time
		var crewRank = "Space Lieutenant";  // most common rank
		var crewRace = expandDescription("[FdL_viper_E_GalCop_races_scientific]");  // add a race to the crew members
		var crewBounty = 0;
		var crewInsurance = 0;
				
		// now it's time to be more specific, based on an crew of 1 to 2 person
		// insurance or bounty are defined so there shouldn't be slaves

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

		switch(this.FdL_viper_shipType) 
		{
			case "FdL_viper_E_escape_capsule_police":
			
				this.$FdL_viper_ranks_array = 
				["Ensign", "Space Junior Lieutenant", "Space Lieutenant", "Lt. Commander"];
				crewRank = 
				$FdL_viper_ranks_array[Math.floor(Math.random() * $FdL_viper_ranks_array.length)];
			
				crewName = ("the " + crewRace + " " + crewRank + " " + crewName);
				crewDescription = "an officer of GalCop Space Police";
				crewInsurance = (this.$getRndInteger(90, 450) + (15 * system.government));  // stable governments pay extra bonus
				crewRole = "police";	
				break;

			case "FdL_viper_E_escape_capsule_bhg":

				crewName = ("the " + crewRace + " " + crewRank + " " + crewName);
				crewDescription = "a member of the Bounty Hunter Guild";
				crewInsurance = (this.$getRndInteger(90, 450) * 1.10);  // BHG got better insurance conditions
				crewRole = "hunter";	
				break;
						
			case "FdL_viper_E_escape_capsule_bhg_pirate":
				
				crewName = ("the " + crewRace + " " + crewRank + " " + crewName);
				crewDescription = "a rouge member of the Bounty Hunter Guild";
				crewBounty = (this.$getRndInteger(90, 450) * 1.10) + (15 * system.government);  // stable governments pay extra bonus
				crewRole = "pirate";
				break;	
			
			default: 
				break;
		};

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

		// remove individual roles
		this.ship.primaryRole = "escape-capsule";
	}
	else
	{
		var shipRole = this.ship.primaryRole;
		
		// if the ship got no cargo there is a 50% chance that some is added
		if(this.ship.cargoSpaceCapacity > 0 && this.ship.cargoSpaceUsed === 0 && this.$getRndInteger(1, 2) > 1)
		{
			this.ship.adjustCargo("firearms", 1);
		};
		
		// individual role of the ship, will only be called from other OXP's
		switch(shipRole) 
		{
			case "viper":
			case "viper-pursuit":
			case "viper-interceptor":
			case "FdL_viper_E_patrol":
			case "FdL_viper_E_pursuit":
			case "FdL_viper_E_pursuit_bhg_deputy":
			case "FdL_viper_E_interceptor":	
				
				this.ship.primaryRole = "police";
				break;
				
			case "FdL_viper_E_pursuit_bhg":
			case "FdL_viper_E_pursuit_bhg_team_01":

				this.ship.primaryRole = "hunter";
				break;
			
			default: 
				break;
		};
	};
};

this.shipDied = function(whom, why)
{
	if(this.ship.hasRole("escape-capsule"))
	{
		return;
	}
	else
	{
		// neutral inits first
		var podType = "escape-capsule";
		var cargoSpace = this.ship.cargoSpaceCapacity;
		var cargoLoad = this.ship.cargoSpaceUsed;
		
		// remove existing pods first
		if(this.ship.equipmentStatus("EQ_ESCAPE_POD") != "EQUIPMENT_UNAVAILABLE")
		{
			this.ship.removeEquipment("EQ_ESCAPE_POD");
		};

		// prepare relevant pod type
		switch(this.FdL_viper_shipType) 
		{
			case "viper":
			case "viper-pursuit":
			case "viper-interceptor":
			case "FdL_viper_E_patrol":
			case "FdL_viper_E_pursuit":
			case "FdL_viper_E_interceptor":

				podType = "FdL_viper_E_escape_capsule_police";
				break;

			case "FdL_viper_E_pursuit_bhg_deputy":
			case "FdL_viper_E_pursuit_bhg":
			case "FdL_viper_E_pursuit_bhg_team_01":
				
				if(this.ship.bounty > 7)
				{
					podType = "FdL_viper_E_escape_capsule_bhg_pirate";
				}
				else
				{
					podType = "FdL_viper_E_escape_capsule_bhg";
				};
				break;
				
			default: 
				break;	
		};	
		
		// 75% chance that the pilot could eject
		if(this.$getRndInteger(1, 100) > 25)
		{
			system.addShips(podType, 1, this.ship.position);
		};

		// small chance that the ship had prisoners on board (Montanas Ressource Pack 01)
		if(worldScripts["MRP01_ressource_spawn"] && cargoSpace > 0 && cargoLoad == 0 && this.$getRndInteger(1, 10) > 8)
		{
			system.addShips("MRP01_container_prisoners", 1, this.ship.position);
		};	
	};
};	

this.$getRndInteger = function(min, max)
{
	return Math.floor(Math.random() * (max - min + 1) ) + min;
};
Scripts/FdL_viper_carrier_conditions.js
this.name			= "FdL_viper_carrier_conditions";
this.author			= "Montana05";
this.description	= "condition script for Viper Carriers";
this.version		= "0.52";
this.copyright		= "2021 Montana05";
this.licence		= "CC BY-NC-SA 4.0";
"use strict";

this.allowSpawnShip = function(shipKey)
{
	if(shipKey == "viper-carrier-player-neutral" && worldScripts["carriers"] && !worldScripts["carriers_with_turrets"])
	{
		return true;
	};

	if(shipKey == "viper-carrier-player-neutral-turret" && worldScripts["carriers"] && worldScripts["carriers_with_turrets"])
	{
		return true;
	};

	return false;
	
};