Back to Index Page generated: Sep 15, 2026, 9:03:40 PM

Expansion Fer-de-Lance 3G

Content

Warnings

  1. Wiki check failed: org.apache.http.conn.ConnectTimeoutException: Connect to wiki.alioth.net:443 [wiki.alioth.net/109.70.41.29] failed: Connection timed out
  2. Wiki check failed: org.apache.http.conn.ConnectTimeoutException: Connect to wiki.alioth.net:443 [wiki.alioth.net/109.70.41.29] failed: Connection timed out
  3. Wiki check failed: org.apache.http.conn.ConnectTimeoutException: Connect to wiki.alioth.net:443 [wiki.alioth.net/109.70.41.29] failed: Connection timed out
  4. Wiki check failed: org.apache.http.conn.ConnectTimeoutException: Connect to wiki.alioth.net:443 [wiki.alioth.net/109.70.41.29] failed: Connection timed out
  5. Wiki check failed: org.apache.http.conn.ConnectTimeoutException: Connect to wiki.alioth.net:443 [wiki.alioth.net/109.70.41.29] failed: Connection timed out
  6. Wiki check failed: org.apache.http.conn.ConnectTimeoutException: Connect to wiki.alioth.net:443 [wiki.alioth.net/109.70.41.29] failed: Connection timed out
  7. Wiki check failed: org.apache.http.conn.ConnectTimeoutException: Connect to wiki.alioth.net:443 [wiki.alioth.net/109.70.41.29] failed: Connection timed out
  8. Wiki check failed: org.apache.http.conn.ConnectTimeoutException: Connect to wiki.alioth.net:443 [wiki.alioth.net/109.70.41.29] failed: Connection timed out
  9. Wiki check failed: org.apache.http.conn.ConnectTimeoutException: Connect to wiki.alioth.net:443 [wiki.alioth.net/109.70.41.29] failed: Connection timed out
  10. Wiki check failed: org.apache.http.conn.ConnectTimeoutException: Connect to wiki.alioth.net:443 [wiki.alioth.net/109.70.41.29] failed: Connection timed out
  11. Wiki check failed: org.apache.http.conn.ConnectTimeoutException: Connect to wiki.alioth.net:443 [wiki.alioth.net/109.70.41.29] failed: Connection timed out
  12. Wiki check failed: org.apache.http.conn.ConnectTimeoutException: Connect to wiki.alioth.net:443 [wiki.alioth.net/109.70.41.29] failed: Connection timed out
  13. Wiki check failed: org.apache.http.conn.ConnectTimeoutException: Connect to wiki.alioth.net:443 [wiki.alioth.net/109.70.41.29] failed: Connection timed out

Manifest

from Expansion Manager's OXP list from Expansion Manifest
Description Adds a line of Fer-de-Lance ships. Player buyable. Adds a line of Fer-de-Lance ships. Player buyable.
Identifier oolite.oxp.UK_Eliter.Ferdelance_3G oolite.oxp.UK_Eliter.Ferdelance_3G
Title Fer-de-Lance 3G Fer-de-Lance 3G
Category Ships Ships
Author UK_Eliter UK_Eliter
Version 7.0 7.0
Tags ships ships
Required Oolite Version
Maximum Oolite Version
Required Expansions
Optional Expansions
  • oolite.oxp.UK_Eliter.ExtraThargoids:6.5
  • oolite.oxp.UK_Eliter.InterstellarTweaks:6.5
  • oolite.oxp.UK_Eliter.ExtraThargoids:6.5
  • oolite.oxp.UK_Eliter.InterstellarTweaks:6.5
  • Conflict Expansions
    Information URL https://wiki.alioth.net/index.php/Fer-de-Lance_3G_OXP n/a
    Download URL https://wiki.alioth.net/img_auth.php/d/da/Oolite.oxp.UK_Eliter.Ferdelance_3G.oxz http://wiki.alioth.net/img_auth.php/d/da/Oolite.oxp.UK_Eliter.Ferdelance_3G.oxz
    License Creative Commons Attribution - Non-Commercial - Share Alike 4.0 license Creative Commons Attribution - Non-Commercial - Share Alike 4.0 license
    File Size n/a
    Upload date 1789431311

    Relationships Diagram

    Documentation

    Also read http://wiki.alioth.net/index.php/Fer-de-Lance%203G

    Ferdelance3G Readme & License.txt

    ================================================================
    'Fer-de-Lance 3G' OXP by (the unimaginatively named) 'UK_Eliter'
    ================================================================
    
    -------------
    GENERAL NOTES
    -------------
    
    � This OXP does not depend on any other OXP. Yet, it does work better when various other OXPs are installed, including these ones: Armoury; Missiles & Bombs; Nexus Missile; Thargoid Carrier.
    
    � For details of (most of . .) the ships, please see the accompanying PDF brochure.
    
    � This ship needs Oolite version >= 1.82.
    
    
    � PLEASE DELETE OLD VERSION OF THE OXP FROM YOUR ADDONS FOLDER BEFORE COPYING-IN THIS ONE.
    
    ----------------
    ACKNOWLEDGEMENTS
    ----------------
    
    The graphics in this OXP are adapted from the ferdelance model built into Oolite.
    
    My thanks to the following for help with this OXP.
    
    'cim'
    'Commander McLane' (from whose Anarchies OXP I have somewhat adapted some message descriptions)
    'Diziet Sma'
    'Eric Walch' (who provided some javascript routines)
    'fronclynne'
    'Killer Wolf'
    'Rustem'
    'Smivs' (for help with graphics)
    'Svengali'
    'Thargoid' (from whose 'Vortex' OXP the turrets in this my OXP are adapted - and adapted, indeed, mainly *by* Thargoid; I've borrowed some material from his Aquatics and Armoury OXPs too)
    
    
    ------------
    GENERAL INFO
    ------------
    
    The 'Config' folder contains a script that can be used to see - in form of non-player-characters - some of the ships contained in this OXP. See within that folder itself for further instructions.
    
    Please see the PDF for the specifications of the '3G' ships.
    
    -------
    LICENSE
    -------
    
    This OXP is released under the Creative Commons Attribution - Non-Commercial - Share Alike 3.0 license.
    
    This work is licensed under the Creative Commons Attribution-NonCommercial-ShareAlike License. To view a copy of this license, visit http://creativecommons.org/licenses/by-nc-sa/2.0/ or send a letter to Creative Commons, 559 Nathan Abbott Way, Stanford, California 94305, USA. 
    
    You are free:
    
    � to copy, distribute, display, and perform the work;
    � to make derivative works. 
    
    But only under the following conditions.
    
    � Attribution: you must give the original author credit. 
    � Non-commercial use: you may not use this work for commercial purposes. 
    � Share Alike: if you alter, transform, or build upon this work, you may distribute the resulting work only under a license materially identical to this one. 
    
    Your fair use right and other rights are in no way affected by the above.
    
    ----------------- END ----------------- 
    

    Equipment

    Name Visible Cost [deci-credits] Tech-Level
    Sweeper-resistant navy missile yes 14000 13+

    Ships

    Name
    ferdelance3-player
    ferdelance3-playerPlusModel
    ferdelance3-playerPlusModelWithTurrets
    ferdelance3-playerPlusModelWithTurretsPoliceDecomissioned
    ferdelance3-playerVariant
    Fer-de-Lance 3G+(t)
    ferdelance3G_+(t)TemplateNPC
    ferdelance3G_+HardPirate
    ferdelance3G_+T_HardPirate
    ferdelance3G_+T_HardPiratePoliceDecomissioned
    Fer-de-Lance 3G+
    ferdelance3G_+TemplateNPC
    Sweeper-resistant navy missile
    ferdelance3G_escortTo_1
    ferdelance3G_escortTo_2
    ferdelance3G_escortTo_3
    ferdelance3G_escortTo_4
    ferdelance3G_escortTo_5
    ferdelance3G_escortTo_6
    ferdelance3G_escortTo_7
    ferdelance3G_escortTo_8
    ferdelance3G_hardHunter
    ferdelance3G_hardPirate
    ferdelance3G_hardPirateAlt
    ferdelance3G_hardTrader
    ferdelance3G_hardTrader3G+
    ferdelance3G_hardTrader3G+Escorted
    ferdelance3G_hardTrader3G+EscortedVariant
    ferdelance3G_hardTraderEscorted
    ferdelance3G_hardTraderEscortedVariant
    ferdelance3G_hardTraderEscortedVariant2
    ferdelance3G_hardTraderVariant
    ferdelance3G_hardestHunter
    ferdelance3G_hardestHunterEscorted
    ferdelance3G_hardestHunterPoliceDecomissioned
    ferdelance3G_hunter
    ferdelance3G_hunterVariant
    Fer-de-Lance 3G+(t) (military interstellar)
    Fer-de-Lance 3G+(t) (military Bugblatter)
    ferdelance3G_milInterstellarTurret
    ferdelance3G_milInterstellarTurret2
    ferdelance3G_pirate
    ferdelance3G_pirateAlt
    Fer-de-Lance 3G+(t) (Pirate King)
    ferdelance3G_player
    ferdelance3G_playerPlusModel
    ferdelance3G_playerPlusModelWithTurrets
    ferdelance3G_playerPlusModelWithTurretsPoliceDecomissioned
    Fer-de-Lance 3G (Delux-o-Tank variant)
    ferdelance3G_playerVariant
    ferdelance3G_polTurret
    Fer-de-Lance 3G+(t) (police)
    Fer-de-Lance 3G+(t) (ex-police)
    Fer-de-Lance 3G
    ferdelance3G_templateNPC
    ferdelance3G_trader
    ferdelance3G_traderVariant
    3G Turret
    Fer-de-Lance 3G
    ferdelance3G_variantTemplateNPC

    Models

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

    Scripts

    Path
    Scripts/ferdelance3G_antiSweeper.js
    /*
    //////////////////////////////////////////////////////////////////////////////////
    
    This file:          ferdelance3G_antiSweeper.js
    Part of:            Fer-de-Lance 3G OXP
    Associated AI		ferdelance3G_antiSweeper.plist
    Author:             UK_Eliter
    License:            2017 Creative Commons: attribution, non-commercial, sharealike
    
    //////////////////////////////////////////////////////////////////////////////////
    */
    
    
    /*
    ==============
    LINTER OPTIONS
    ==============
    */
    
    /* jshint esversion: 6 */
    /* jshint -W030 */
    
    
    /*
    ======
    HEADER
    ======
    */
    
    this.name = 'ferdelance3G_antiSweeper';
    this.author = 'UK_Eliter';
    this.copyright = '';
    this.description = 'Script for anti-Sweeper missile ';
    this.license = 'CC-by-nc-sa 3.0';
    
    
    
    /*
    ------------------
    DEBUGGING SWITCHES
    ------------------
    */
    
    // this.logging = true;
    
    
    /*
    ------------------------
    JSLINT: start of wrapper
    ------------------------
    */
    
    (function () {
    	'use strict';
    
    
    	/*
    	--------------------
    	ROUTINE CALLED BY AI
    	The second parameter of dealEnergyDamage is the 'ideal range'; it should match the desiredRange in the AI.
    	See: http://wiki.alioth.net/index.php/Oolite_JavaScript_Reference:_Ship#dealEnergyDamage
    	--------------------
    	*/
    
    	this.$_detonate = function () {
    		if (this.ship.target && this.ship.target.isThargoid) {
    			this.ship.dealEnergyDamage(
    				660,
    				35,
    				0.1
    			);
    		} else {
    			this.ship.dealEnergyDamage(
    				300,
    				35,
    				0.15
    			);
    		}
    		this.ship.explode();
    	};
    
    
    	/*
    	----------------------
    	JSLINT: end of wrapper
    	----------------------
    	*/
    
    }).call(this);
    
    
    // EOF
    Scripts/ferdelance3G_conditions.js
    /*
    //////////////////////////////////////////////////////////////////////////////////
    
    This file:          ferdelance3G_conditions.js
    Part of:            Fer-de-Lance 3G OXP
    Author:             UK_Eliter
    License:            2017 Creative Commons: attribution, non-commercial, sharealike
    
    //////////////////////////////////////////////////////////////////////////////////
    */
    
    
    /*
    ==============
    LINTER OPTIONS
    ==============
    */
    
    /* jshint esversion: 6 */
    /* jshint -W030 */
    
    
    /*
    ======
    HEADER
    ======
    */
    
    this.name = 'ferdelance3G_conditionsScript';
    this.author = 'UK_Eliter';
    this.description = 'ferdelance3G_conditionsScript.js';
    this.copyright = '2014 Creative Commons: attribution, non-commercial, sharealike.';
    this.licence = 'CC-NC-SA 3';
    
    
    /*
    ==================
    DEBUGGING SWITCHES
    ==================
    */
    
    //this.logging = true; // THIS SHOULD BE COMMENTED OUT WHEN NOT TESTING
    //this.dbg = false;
    
    
    /*
    ========================
    JSLINT: start of wrapper
    ========================
    */
    
    (function() {
    	'use strict';
    
    
    	/*
    	------------------
    	CONDITION ROUTINES
    	------------------
    	*/
    
    	this.allowAwardEquipment = function(eqKey, ship, context) {
    		if ( eqKey !== 'EQ_F3G_ANTISWEEP_MISSILE' ) {
    			return;
    		}
    
    		if (system.techLevel < 9) {
    			return false;
    		}
    
    		var c;
    		if (player.ship.dockedStation === 'Navy SecCom Station') {
    			c = 0.87;
    		} else if (system.techLevel > 10) {
    			c = 0.7;
    		} else {
    			c = 0.45;
    		}
    			
    		// Make it likely that some systems consistently have, or lack, the missiles.
    		const r = Math.random();
    		return r < 0.85 ? system.scrambledPseudoRandomNumber(6921) <= c : (r <= c);
    	};
    
    	this.updateEquipmentPrice = function(eqKey, currentPrice) {
    		var myPrice;
    		switch (eqKey) {
    			case 'EQ_F3G_ANTISWEEP_MISSILE':
    				if (player.ship.dockedStation === 'Navy SecCom Station') {
    					myPrice = 1000;
    					return (myPrice);
    				}
    				// Otherwise
    				if (system.techLevel > 10) {
    					if (Math.random() < 0.95) {
    						myPrice = 13000 + ((Math.ceil(system.scrambledPseudoRandomNumber(3420) * 10)) * 1000);
    					} else {
    						myPrice = 13000 + ((Math.ceil(Math.random() * 10)) * 1000);
    					}
    					return (myPrice);
    				}
    				// Otherwise
    				if (system.techLevel > 8) {
    					if (Math.random() < 0.95) {
    						myPrice = 10000 + ((Math.ceil(system.scrambledPseudoRandomNumber(3420) * 18)) * 1000);
    					} else {
    						myPrice = 10000 + ((Math.ceil(Math.random() * 18)) * 1000);
    					}
    					return (myPrice);
    				}
    		}
    	};
    
    
    	/*
    	======================
    	JSLINT: end of wrapper
    	======================
    	*/
    
    }).call(this);
    
    
    // EOF
    Scripts/ferdelance3G_hunter.js
    /*
    //////////////////////////////////////////////////////////////////////////////////
    
    This file:          ferdelance3G_hunter.js
    Associated AI: 		none / auto_AI
    Part of:            Fer-de-Lance 3G OXP
    Author:             UK_Eliter
    License:            2017 Creative Commons: attribution, non-commercial, sharealike
    
    //////////////////////////////////////////////////////////////////////////////////
    */
    
    
    /*
    ==============
    LINTER OPTIONS
    ==============
    */
    
    /* jshint esversion: 6 */
    /* jshint -W030 */
    
    
    /*
    ======
    HEADER
    ======
    */
    
    this.name = 'ferdelance3G_hunter';
    this.author = 'UK_Eliter';
    this.copyright = '';
    this.description = 'ferdelance3G_hunter.js (for NPCs)';
    this.license = '2014 CC-by-nc-sa 3.0';
    
    
    /*
    ==================
    DEBUGGING SWITCHES
    ==================
    */
    
    // this.logging = true;
    this.dbg = false;
    
    if (this.dbg) {
    	this.ship.reportAIMessages = true;
    }
    
    
    /*
    ========================
    JSLINT: start of wrapper
    ========================
    */
    
    (function () {
    	'use strict';
    
    	/*
    	==============
    	EVENT HANDLERS
    	==============
    	*/
    
    	this.shipSpawned = function () {
    
    		const
    			r = Math.random(),
    			r2 = Math.random();
    
    		if (r > 0.45) {
    			var
    				i,
    				l,
    				ordinance_available = [
    					'EQ_MISSILE',
    					'EQ_MISSILE',
    					'EQ_MISSILE'
    				],
    				ordinance_capacity = this.ship.missileCapacity,
    				ordinance_giveLev2_bool,
    				ordinance_giveLev3_prob;
    
    			/*
    			----------------------------------
    			Determine ordinance we might award
    			----------------------------------
    			*/
    
    			if (this.ship.hasRole('ferdelance3G_+T')) {
    				ordinance_giveLev2_bool = true;
    				ordinance_giveLev3_prob = 0.15;
    			} else if (r > 0.7) {
    				ordinance_giveLev2_bool = true;
    				ordinance_giveLev3_prob = 0.11;
    			} else {
    				ordinance_giveLev2_bool = false;
    				ordinance_giveLev3_prob = 0.11;
    			}
    
    			if (ordinance_giveLev2_bool) {
    				if (worldScripts['Missiles & Bombs']) {
    					ordinance_available.push(
    						'EQ_RMB_FRAG_MISSILE',
    						'EQ_RMB_OVERRIDE_MISSILE',
    						'EQ_RMB_LAW_MISSILE',
    						'EQ_RMB_INTERCEPT_MISSILE',
    						'EQ_RMB_INTERCEPT_MISSILE',
    						'EQ_RMB_INTERCEPT_MISSILE'
    					);
    				}
    				if (EquipmentInfo.infoForKey('EQ_TORPEDO_MISSILE')) {
    					ordinance_available.push(
    						'EQ_TORPEDO_MISSILE'
    					);
    				}
    				if (EquipmentInfo.infoForKey('EQ_HARPOON_NUKE1_MISSILE')) {
    					ordinance_available.push(
    						'EQ_HARPOON_NUKE1_MISSILE'
    					);
    				}
    				if (worldScripts['armoury_trackerWorldScript.js']) {
    					ordinance_available.push(
    						'EQ_ARMOURY_STUNBOMB_MINE'
    					);
    					if (this.ship.equipmentStatus('EQ_CLOAKING_DEVICE') != 'EQUIPMENT_OK') {
    						ordinance_available.push(
    							'EQ_KDRONE_LAUNCHER_MINE',
    							'EQ_CDRONE_LAUNCHER_MINE'
    						);
    					}
    				}
    				if (EquipmentInfo.infoForKey('EQ_NEXUS_BUG_MISSILE')) {
    					ordinance_available.push(
    						'EQ_NEXUS_PREMIUM_MISSILE'
    					);
    					if (r > 0.9) {
    						ordinance_available.push(
    							'EQ_NEXUS_PREMIUM_MISSILE'
    						);
    					} else {
    						ordinance_available.push(
    							'EQ_NEXUS_BASIC_MISSILE'
    						);
    					}
    				}
    			}
    			i = ordinance_available.length;
    			while (i--) {
    				ordinance_available.push(
    					'EQ_HARDENED_MISSILE'
    				);
    			}
    
    
    			/*
    			---------------
    			Award ordinance
    			---------------
    			*/
    
    			if (Math.random() <= ordinance_giveLev3_prob) {
    				this.ship.awardEquipment(
    					'EQ_QC_MINE'
    				);
    				--ordinance_capacity;
    			}
    
    			i = ordinance_capacity - 1;
    			do {
    				this.ship.awardEquipment(
    					ordinance_available[~~(Math.random() * l)]
    				);
    			}
    			while (i--);
    		}
    
    		/*
    		-------------------------------------------------------------------
    		BOUNTY
    		NB: This script is used not only for hunters but also for assassins.
    		-------------------------------------------------------------------
    		*/
    
    		if (r2 > 0.7) {
    			if (r < 0.9) {
    				this.ship.bounty += ~~1 + (r * 32);
    				// _Sic_ - 'r', not 'r2'.
    			} else {
    				this.ship.bounty += ~~2 + (r * 120);
    			}
    		}
    
    		/*
    		--------
    		CLEAN UP
    		--------
    		*/
    		delete this.shipSpawned;
    	};
    
    
    
    	/*
    	----------------------
    	JSLINT: end of wrapper
    	----------------------
    	*/
    
    }).call(this);
    
    
    // EOF
    Scripts/ferdelance3G_milInterstellar.js
    /*
    //////////////////////////////////////////////////////////////////////////////////
    
    This file:          ferdelance3G_milInterstellar.js
    Associated AI: 		ferdelance3G_milInterstellarAI.plist
    Part of:            Fer-de-Lance 3G OXP
    Author:             UK_Eliter
    License:            2017 Creative Commons: attribution, non-commercial, sharealike
    
    //////////////////////////////////////////////////////////////////////////////////
    */
    
    
    /*
    ==============
    LINTER OPTIONS
    ==============
    */
    
    /* jshint esversion: 6 */
    /* jshint -W030 */
    /* jshint -W069 */
    
    
    /*
    ======
    HEADER
    ======
    */
    
    this.name = 'ferdelance3G_milInterstellar.js';
    this.author = 'UK_Eliter';
    this.copyright = '';
    this.description = 'A script for NPCs';
    this.license = 'CC-by-nc-sa 3.0';
    
    
    /*
    ==================
    DEBUGGING SWITCHES
    ==================
    */
    
    this.dbg = false; // NB
    
    if (this.dbg) {
    	this.ship.reportAIMessages = true;
    }
    
    
    /*
    ========================
    JSLINT: start of wrapper
    ========================
    */
    
    (function() {
    	'use strict';
    
    	/*
    	--------------
    	EVENT HANDLERS
    	--------------
    	*/
    
    	this.shipSpawned = function() {
    
    		/*
    		----------------------------------
    		Determine ordinance we might award
    		----------------------------------
    		*/
    
    		const
    			oxp = {
    				armoury: !!worldScripts['armoury_trackerWorldScript'],
    				extraBugs: !!worldScripts['extraThargoids_populator'],
    				missilesAndBombs: !!worldScripts['Missiles & Bombs'],
    				nexus: !!EquipmentInfo.infoForKey('EQ_NEXUS_BUG_MISSILE'),
    				TCAT: !!worldScripts['TCAT_masterScript']
    			};
    
    		var
    			ordinance_available = [],
    			ordinance_shipSlots = this.ship.missileordinance_shipSlots;
    			
    
    		if ( this.ship.hasRole('ferdelance3Bugblatter') ) {
    			/*
    			BUGBLATTER
    			*/
    			ordinance_available = [
    				'EQ_F3G_ANTISWEEP_MISSILE',
    				'EQ_F3G_ANTISWEEP_MISSILE',
    				'EQ_HARDENED_MISSILE'
    			];
    			if (oxp.nexus) {
    				ordinance_available.push(
    					'EQ_NEXUS_BUG_MISSILE',
    					'EQ_NEXUS_BUG_MISSILE'
    				);
    			} else if (oxp.missilesAndBombs) {
    				ordinance_available.push(
    					'EQ_RMB_THARGOID_MISSILE',
    					'EQ_RMB_THARGOID_MISSILE'
    				);
    			}
    			if (oxp.armoury) {
    				ordinance_available.push(
    					'EQ_ARMOURY_SCREAMER_MINE'
    				);
    			}
    			if (oxp.TCAT) {
    				ordinance_available.push(
    					'EQ_TCAT_JAMMER_MINE'
    				);
    			}
    		} else {
    			/*
    			NORMAL
    			*/
    			ordinance_available = 
    			[
    				'EQ_F3G_ANTISWEEP_MISSILE', 
    				'EQ_F3G_ANTISWEEP_MISSILE', 
    				'EQ_HARDENED_MISSILE', 
    				'EQ_HARDENED_MISSILE'
    			];
    			if (oxp.extraBugs) {
    				ordinance_available.push(
    					'EQ_F3G_ANTISWEEP_MISSILE'
    				);
    			}
    			if (oxp.nexus === true) {
    				ordinance_available.push(
    					'EQ_NEXUS_BUG_MISSILE',
    					'EQ_NEXUS_BUG_MISSILE'
    				);
    				if (oxp.missilesAndBombs) {
    					ordinance_available.push(
    						'EQ_RMB_THARGOID_MISSILE'
    					);
    				}
    			} else if (oxp.missilesAndBombs) {
    				ordinance_available.push(
    					'EQ_RMB_THARGOID_MISSILE', 
    					'EQ_RMB_THARGOID_MISSILE'
    				);
    			} else if ( EquipmentInfo.infoForKey('EQ_MILITARY_MISSILE') ) {
    				ordinance_available.push(
    					'EQ_MILITARY_MISSILE', 
    					'EQ_MILITARY_MISSILE', 
    					'EQ_MILITARY_MISSILE'
    				);
    			}
    		}
    
    		/*
    		----------------------------
    		Allocate available ordinance
    		----------------------------
    		*/
    
    		ordinance_shipSlots = this.ship.missileordinance_shipSlots;
    		const l = ordinance_available.length;
    		var i = ordinance_shipSlots - 1;
    		do {
    			this.ship.awardEquipment(ordinance_available[~~(Math.random() * l)]);
    		}
    		while (i--);
    
    	};
    
    
    	/*
    	-------------
    	ENTITY PICKER
    	-------------
    	*/
    
    	this.$isSuitableNavy = function(e) {
    		return e.isShip &&
    		(e.scanClass === 'CLASS_MILITARY') &&
    		(e.mass > 20000000);
    	};
    
    	/*
    	---------------------
    	ROUTINES CALLED BY AI
    	---------------------
    	*/
    
    	this.$_seekAttackTarget = function() {
    
    		if (!this.ship || !this.ship.isPiloted) return;
    
    		const s = this.ship.checkScanner(true);
    
    		if (s.length === 0) return;
    
    		var
    			i,
    			targets_primary = [],
    			targets_quaternary = [],
    			targets_secondary = [],
    			targets_tertiary = [];
    
    		while (i--) {
    			if (
    				s[0] &&
    				s[0].isValid &&
    				e.isShip && (
    					( e.isThargoid && e.primaryRole !== 'thargoidRebel' ) ||
    					e.primaryRole === scorpax
    				) 
    			) {
    				if ( s[i].hasRole('extraThargoids_sweeper') || s[i].mass > 4600000 ) {
    					targets_primary.push(s[i]);
    				} else if ( s[i].mass > 900000 ) {
    					targets_secondary.push(s[i]);
    				} else if ( s[i].mass > 75000 ) {
    					targets_tertiary.push(s[i]);
    				} else {
    					targets_quaternary.push(s[i]);
    				}
    			}
    		}
    
    		const targets = targets_primary + targets_secondary + targets_tertiary + targets_quaternary;
    		if ( targets.length === 0 ) {
    			this.ship.reactToAIMessage('NOTHING_FOUND');
    			return;
    		}
    
    		if ( targets.length === 1 || (Math.random() < 0.6) ) {
    			this.ship.target = targets[0];
    			this.ship.reactToAIMessage('TARGET_FOUND');
    			return;
    		}
    		if ( targets.length === 2 || (Math.random() < 0.7) ) {
    			this.ship.target = targets[1];
    			this.ship.reactToAIMessage('TARGET_FOUND');
    			return;
    		}
    		this.ship.target = targets[3];
    		this.ship.reactToAIMessage('TARGET_FOUND');
    	};
    
    	this.$_seekNavy = function() {
    		const s = system.filteredEntities(
    			this,
    			this.$isSuitableNavy,
    			this.ship,
    			50000
    		);
    		if (s.length > 0) {
    			if ((s.length === 1) || (Math.random() < 0.7)) {
    				this.ship.target = s[0];
    			} else {
    				this.ship.target = s[1];
    			}
    			this.ship.reactToAIMessage('TARGET_FOUND');
    		} else {
    			this.ship.reactToAIMessage('NOTHING_FOUND');
    		}
    	};
    
    	// Called, only, by ferdelance3G_milInterstellarAI.
    	this.$_setMisJump = function() {
    		const r = Math.random();
    		this.ship.scriptedMisjump = true;
    		if (r < 0.4) {
    			this.ship.scriptedMisjumpRange = r * 2;
    		}
    	};
    
    
    	/*
    	---------
    	DEBUGGING
    	---------
    	*/
    
    	//this.messagePlayerIfPlayerWithinScannerRangeOfShip = function(text)
    	//{
    	//	if (!this.ship.isValid) {return;}
    	//	if (!player.ship.isValid) {return;}
    	//	if ( this.ship.position.distanceTo(player.ship.position) < 23000 ) {player.consoleMessage(text, 6);}
    	//}
    	//
    	//
    	//this.message = function(text) {player.consoleMessage(text, 6);}
    
    
    	/*
    	----------------------
    	JSLINT: end of wrapper
    	----------------------
    	*/
    
    }).call(this);
    
    
    // EOF
    Scripts/ferdelance3G_pirate.js
    /*
    //////////////////////////////////////////////////////////////////////////////////
    
    This file:          ferdelance3G_pirate.js
    Associated AI: 		None / auto_ai
    Part of:            Fer-de-Lance 3G OXP
    Author:             UK_Eliter
    License:            2017 Creative Commons: attribution, non-commercial, sharealike
    
    //////////////////////////////////////////////////////////////////////////////////
    */
    
    
    /*
    ===================
    JSLINT: set options
    ===================
    */
    
    /*jshint esversion: 6*/
    /*jshint sub:true*/
    
    
    this.name = 'ferdelance3G_pirate';
    this.author = 'UK_Eliter';
    this.copyright = '';
    this.description = 'ferdelance3G_pirate.js (for NPCs)';
    this.license = 'CC-by-nc-sa 3.0';
    
    /*
    ==================
    DEBUGGING SWITCHES
    ==================
    */
    
    
    // this.logging = true;
    
    this.dbg = false;
    
    if (this.dbg) {
    	this.ship.reportAIMessages = true;
    }
    
    
    /*
    ========================
    JSLINT: start of wrapper
    ========================
    */
    
    (function() {
    	'use strict';
    
    
    	/*
    	==============
    	EVENT HANDLERS
    	==============
    	*/
    
    	this.shipSpawned = function()
    	{
    		/*
    		----------------------------------
    		Determine ordinance we might award
    		----------------------------------
    		*/
    		var
    			i,
    			l,
    			ordinance_available = [],
    			ordinance_available_lev2_bool = false,
    			ordinance_available_lev3_prob = 0.11;
    
    		if (this.ship.hasRole('ferdelance3G_+T')) {
    			ordinance_available_lev2_bool = true;
    			if (this.ship.hasRole('ferdelance3G_pirateKing')) {
    				this.ship.bounty += 50 + ~~((Math.random() * 120) + 1);
    				ordinance_available_lev3_prob = 0.8;
    			}
    		} else if (Math.random() > 0.6) {
    			ordinance_available_lev2_bool = true;
    		}
    
    		if (ordinance_available_lev2_bool) {
    			if (worldScripts['Missiles & Bombs']) {
    				ordinance_available.push(
    					'EQ_RMB_FRAG_MISSILE', 
    					'EQ_RMB_OVERRIDE_MISSILE', 
    					'EQ_RMB_INTERCEPT_MISSILE', 
    					'EQ_RMB_INTERCEPT_MISSILE');
    			}
    
    			if (worldScripts['armoury_trackerWorldScript.js']) {
    				ordinance_available.push('EQ_ARMOURY_STUNBOMB_MINE');
    				if (this.ship.equipmentStatus('EQ_CLOAKING_DEVICE') != 'EQUIPMENT_OK') {
    					ordinance_available.push(
    						'EQ_KDRONE_LAUNCHER_MINE', 
    						'EQ_CDRONE_LAUNCHER_MINE');
    				}
    			}
    
    			if (EquipmentInfo.infoForKey('EQ_TORPEDO_MISSILE')) {
    				ordinance_available.push('EQ_TORPEDO_MISSILE');
    			}
    
    			if (EquipmentInfo.infoForKey('EQ_HARPOON_NUKE1_MISSILE')) {
    				ordinance_available.push('EQ_HARPOON_NUKE1_MISSILE');
    			}
    
    			if (EquipmentInfo.infoForKey('EQ_NEXUS_BUG_MISSILE')) {
    				if (Math.random() > 0.25) {
    					ordinance_available.push('EQ_NEXUS_BASIC_MISSILE');
    				} else {
    					ordinance_available.push('EQ_NEXUS_PREMIUM_MISSILE');
    				}
    			}
    
    			if (Math.random() < ordinance_available_lev3_prob) {
    				ordinance_available.push('EQ_QC_MINE');
    			}
    		}
    		// Ensure there is at least one item in the ordinance list (so that we can triple the list and not get zero).
    		ordinance_available.push('EQ_HARDENED_MISSILE');
    
    		// Triple the size of ordinance_available by adding, for every entry present already, a normal missile and a hardhead. 
    		i = ordinance_available.length;
    		while (i--) {
    			ordinance_available.push('EQ_MISSILE');
    			ordinance_available.push('EQ_HARDENED_MISSILE');
    		}
    
    		/*
    		---------------
    		Award ordinance
    		---------------
    		*/
    
    		l = ordinance_available.length;
    		i = this.ship.missileCapacity;
    		do {
    			this.ship.awardEquipment(ordinance_available[~~(Math.random() * l)]);
    		}
    		while (i--);
    
    		/*
    		--------
    		Clean up
    		--------
    		*/
    		delete this.shipSpawned;
    	};
    
    
    	/*
    	======================
    	JSHINT: end of wrapper
    	======================
    	*/
    
    }).call(this);
    
    // EOF
    Scripts/ferdelance3G_populator.js
    /*
    ///////////////////////////////////////////////////////////////////////////////////
    
    This file:          ferdelance3G_populator.js
    Part of:            Fer-de-Lance 3G OXP
    Author:             UK_Eliter
    License:            2017 Creative Commons: attribution, non-commercial, sharealike.
    NB: 				This script requires a world-scripts.plist file.
    
    ///////////////////////////////////////////////////////////////////////////////////
    */
    
    
    /*
    ===================
    JSLINT: set options
    ===================
    */
    
    /*jshint esversion: 6*/
    /*jshint sub:true*/
    
    
    this.name = 'ferdelance3G_populator';
    this.author = 'UK_Eliter';
    this.copyright = '2014 Creative Commons: attribution, non-commercial, sharealike.';
    this.licence = 'CC-NC-SA 4';
    this.description = 'Fer-de-Lance 3G populator script';
    
    
    /*
    ==================
    DEBUGGING SWITCHES
    ==================
    */
    
    // this.logging = true;
    this.consoleDebugMessages = false; // to disable this, set it to false. DO NOT comment it out. EDIT: er, why?
    
    
    /*
    =======
    GLOBALS
    =======
    */
    
    this.militaryInterstellar_threeG_radius = 2200;
    
    
    /*
    ========================
    JSLINT: start of wrapper
    ========================
    */
    
    (function () {
    	'use strict';
    
    	/*
    	---------------------------
    	INTERSTELLAR (re)population
    	---------------------------
    	*/
    
    	this.interstellarSpaceWillPopulate = function () {
    		if (Math.random() < 0.9) {
    			return;
    		}
    
    		system.setPopulator('ferdelance3G_interstellar', {
    			priority: 300,
    			callback: this._addinterstellar3Gs.bind(this)
    		});
    	};
    
    	this._addinterstellar3Gs = function () {
    
    		const
    			farPosition = new Vector3D([500000, 500000, 500000]),
    			num_threeG = ~~(1 + (Math.random() * 8)),
    			witchpoint = new Vector3D(); // This initialises the vector to [0, 0, 0].
    
    		var i;
    
    		// First: create far from witchpoint - in order to avoid rings.
    		const s = system.addShips(
    			'ferdelance3G_interstellar',
    			num_threeG,
    			farPosition,
    			this.militaryInterstellar_threeG_radius
    		);
    
    		// Now move
    		if (s) {
    			const offset = new Vector3D(witchpoint).subtract(farPosition);
    			i = s.length;
    			while (i--)
    				if (s[i].isValid) s[i].position = s[i].position.add(offset);
    		}
    
    	};
    
    	this.interstellarSpaceWillRepopulate = function () {
    
    		/*
    
    		It is important for smooth gameplay that this function runs very quickly. If calculations are needed, run as many as possible in the populator function to save the result.
    
    		Note re Interstellar Tweaks OXP: that function will stop this routine being called, except in 'unchanged# or 'modified' scenarios. For 'new' scenarios, InterstellarTweaks can itself spawn 3Gs.
    		
    		*/
    
    		if (this.threeG_addNoMore === true) {
    			return;
    		}
    		if (!player.ship.isValid) {
    			return;
    		}
    
    		const num_thargoids = system.countShipsWithRole('thargoid');
    		if (num_thargoids < 5) {
    			return;
    			/*
    				Crude, but the player is unlikely to notice the crudity.
    				Having an absolute limit also makes it less likely that, in Interstellar Tweak's 'novel scenario', this OXP adds ships to a witchpoint area that the player will very likely never enter.
    			*/
    		}
    
    		const military = system.entitiesWithScanClass('CLASS_MILITARY');
    		var num_military = military.length;
    		if (num_military > num_thargoids) {
    			return;
    		}
    
    		var threeG_chanceAdd;
    		if (num_military < 15) {
    			threeG_chanceAdd = 0.02;
    		} else {
    			threeG_chanceAdd = 0.06;
    		}
    		const num_thargoidCarriers = system.countShipsWithRole('thargoid_carrier');
    		if (num_thargoidCarriers > 2) threeG_chanceAdd = threeG_chanceAdd * (num_thargoidCarriers - 1);
    		if (threeG_chanceAdd > 0.4) threeG_chanceAdd = 0.4;
    		if (Math.random() > threeG_chanceAdd) {
    			return;
    		}
    
    		const num_threeG = 3 + ~~((Math.random() * 6) + 1);
    		system.addGroup(
    			'ferdelance3G_interstellar',
    			num_threeG,
    			[0, 0, 0],
    			this.militaryInterstellar_threeG_radius
    		);
    		if (Math.random() < 0.6) {
    			this.threeG_addNoMore = true;
    		}
    	};
    
    	/*
    	----------------------
    	POPULATION - STELLAR
    	Can add, only, hunters
    	----------------------
    	*/
    
    	this.systemWillPopulate = function () {
    
    		if (
    			!(
    				(system.government < 3) && (Math.random() < 0.2)
    			)
    		) return;
    
    		switch (
    			~~(1 + (Math.random() * 8))
    		) {
    		case 1:
    			system.setPopulator('ferDeLance3G-huntersPO', {
    				groupCount: 1,
    				priority: 150,
    				location: 'PLANET_ORBIT',
    				callback: this._addHunter.bind(this)
    			});
    			break;
    		case 2:
    			system.setPopulator('ferDeLance3G-huntersLWP', {
    				groupCount: 1,
    				priority: 111,
    				location: 'LANE_WP',
    				callback: this._addHunter.bind(this)
    			});
    			break;
    		case 3:
    			system.setPopulator('ferDeLance3G-huntersOS', {
    				groupCount: 1,
    				priority: 150,
    				location: 'OUTER_SYSTEM',
    				callback: this._addHunter.bind(this)
    			});
    			break;
    		case 4:
    			system.setPopulator('ferDeLance3G-huntersSA', {
    				groupCount: 1,
    				priority: 150,
    				location: 'STATION_AEGIS',
    				callback: this._addHunter.bind(this)
    			});
    			break;
    		case 5:
    			system.setPopulator('ferDeLance3G-huntersWP', {
    				groupCount: 1,
    				priority: 110,
    				location: 'WITCHPOINT',
    				callback: this._addHunter.bind(this)
    			});
    			break;
    		case 6:
    			system.setPopulator('ferDeLance3G-huntersSOL', {
    				groupCount: 1,
    				priority: 150,
    				location: 'STAR_ORBIT_LOW',
    				callback: this._addHunter.bind(this)
    			});
    			break;
    		default:
    			system.setPopulator('ferDeLance3G-huntersLWPS', {
    				groupCount: 1,
    				priority: 111,
    				location: 'LANE_WPS',
    				callback: this._addHunter.bind(this)
    			});
    		}
    	};
    
    	this._addHunter = function (pos) {
    		const s = system.addShips('ferdelance3G_hunter', 1, pos, 35000);
    	};
    
    
    	/*
    	----------------------
    	JSLINT: end of wrapper
    	----------------------
    	*/
    
    }).call(this);
    
    
    // EOF
    Scripts/ferdelance3G_trader.js
    /*
    //////////////////////////////////////////////////////////////////////////////////
    
    This file:          ferdelance3G_trader.js
    Associated AI:      None / auto_ai
    Part of:            Fer-de-Lance 3G OXP
    Author:             UK_Eliter
    License:            2017 Creative Commons: attribution, non-commercial, sharealike
    
    //////////////////////////////////////////////////////////////////////////////////
    */
    
    
    /*
    ===================
    JSLINT: set options
    ===================
    */
    
    /*jshint esversion: 6*/
    /*jshint sub:true*/
    
    
    this.name = "ferdelance3G_trader";
    this.author = "UK_Eliter";
    this.copyright = "";
    this.description = "ferdelance3G_hunter.js (for NPCs)";
    this.license = "CC-by-nc-sa 3.0";
    
    
    /*
    ==================
    DEBUGGING SWITCHES
    ==================
    */
    
    // this.logging = true;
    
    this.dbg = false;
    
    if (this.dbg) {
        this.ship.reportAIMessages = true;
    }
    
    
    /*
    ========================
    JSLINT: start of wrapper
    ========================
    */
    
    (function () {
        "use strict";
    
        /*
        -------------------------
        EVENT HANDLERS
        (except incoming missile)
        -------------------------
        */
    
        this.shipSpawned = function () {
            /*
            ----------------------------------
            Determine ordinance we might award
            ----------------------------------
            */
            var
                ordinance_available = [
                    "EQ_MISSILE",
                    "EQ_MISSILE",
                    "EQ_MISSILE", "EQ_HARDENED_MISSILE",
                    "EQ_HARDENED_MISSILE"
                ],
                ordinance_giveLev2_bool = false,
                ordinance_giveLev3_prob = 0.1;
    
            if (this.ship.hasRole("ferdelance3G_+T")) {
                ordinance_giveLev2_bool = true;
                ordinance_giveLev3_prob = 0.17;
            } else if (Math.random() > 0.8) {
                ordinance_giveLev2_bool = true;
            }
            if (ordinance_giveLev2_bool) {
                if (worldScripts["Missiles & Bombs"]) {
                    ordinance_available.push(
                        "EQ_RMB_FRAG_MISSILE",
                        "EQ_RMB_OVERRIDE_MISSILE",
                        "EQ_RMB_LAW_MISSILE",
                        "EQ_RMB_INTERCEPT_MISSILE",
                        "EQ_RMB_INTERCEPT_MISSILE",
                        "EQ_RMB_INTERCEPT_MISSILE"
                    );
                }
                if (EquipmentInfo.infoForKey("EQ_TORPEDO_MISSILE")) {
                    ordinance_available.push("EQ_TORPEDO_MISSILE");
                }
                if (EquipmentInfo.infoForKey("EQ_HARPOON_NUKE1_MISSILE")) {
                    ordinance_available.push("EQ_HARPOON_NUKE1_MISSILE");
                }
    
                if (worldScripts["armoury_trackerWorldScript.js"]) {
                    ordinance_available.push("EQ_ARMOURY_STUNBOMB_MINE");
                    if (this.ship.equipmentStatus("EQ_CLOAKING_DEVICE") != "EQUIPMENT_OK") {
                        ordinance_available.push(
                            "EQ_KDRONE_LAUNCHER_MINE",
                            "EQ_CDRONE_LAUNCHER_MINE"
                        );
                    }
                }
    
                if (EquipmentInfo.infoForKey("EQ_NEXUS_BUG_MISSILE")) {
                    ordinance_available.push(
                        "EQ_NEXUS_PREMIUM_MISSILE"
                    );
                    if (Math.random() > 0.2) {
                        ordinance_available.push(
                            "EQ_NEXUS_BASIC_MISSILE");
                    } else {
                        ordinance_available.push(
                            "EQ_NEXUS_PREMIUM_MISSILE");
                    }
                }
    
                if (Math.random() <= ordinance_giveLev3_prob) {
                    ordinance_available.push("EQ_QC_MINE");
                }
            }
    
            /*
            ---------------
            Award ordinance
            ---------------
            */
    
            var
                i = this.ship.missileCapacity - 1,
                l = ordinance_available.length;
            do {
                this.ship.awardEquipment(ordinance_available[~~(Math.random() * l)]);
            }
            while (i--);
    
            /*
            --------
            CLEAN UP
            --------
            */
            delete this.shipSpawned;
        };
    
    
        /*
        ======================
        JSLINT: end of wrapper
        ======================
        */
    
    }).call(this);
    
    
    // EOF