Back to Index Page generated: May 8, 2024, 6:16:03 AM

Expansion Missiles and Bombs

Content

Manifest

from Expansion Manager's OXP list from Expansion Manifest
Description Adds a wide variety of missiles & bombs that are are available to player & NPCs alike. Adds a wide variety of missiles & bombs that are are available to player & NPCs alike.
Identifier oolite.oxp.Ramirez.MissilesandBombs oolite.oxp.Ramirez.MissilesandBombs
Title Missiles and Bombs Missiles and Bombs
Category Weapons Weapons
Author Ramirez Ramirez
Version 2.8 2.8
Tags
Required Oolite Version
Maximum Oolite Version
Required Expansions
Optional Expansions
Conflict Expansions
Information URL http://wiki.alioth.net/index.php/Missiles_and_Bombs n/a
Download URL https://wiki.alioth.net/img_auth.php/c/c3/Missiles_and_Bombs_2.8.oxz n/a
License CC BY-NC-SA 3 CC BY-NC-SA 3
File Size n/a
Upload date 1625120979

Documentation

Also read http://wiki.alioth.net/index.php/Missiles%20and%20Bombs

readme.txt

Missiles and Bombs v2.7
by Ramirez
Requires Oolite v1.80

Overview
========
This OXP contains a collection of exotic weapons for players to use in their space-faring adventures.  Some are extremely expensive and are only available in high tech worlds, while others are cheaper alternatives to the standard set of weapons found in shipyards.  A full description of the various equipment can be found on the Oolite Wiki.

Instructions
============
Chaff Dispenser
---------------
To use the dispenser, you must first buy the equipment from the shipyard. Once installed, you can then buy bundles of chaff which are stored on an available missile pylon. To release the chaff, activate the pylon by pressing 'T' and then press 'M' to release. The dispenser will be reloaded automatically until your store of chaff is exhausted. You can buy further refills for the dispenser at the shipyard.

Remote Detonation Bomb
----------------------
Deploy the bomb as you would do for a mine.  When you receive the signal stating that is is armed, press 'E' to send an ECM pulse that will detonate the bomb.

Acknowledgements
================
Big thanks to Eric Walch, Cmr Maegil and Commander McLane for help with the Javascript and to LittleBear for help with the AI routines.
The EMP missile is loosely based on a suggestion by Dr Nil, while the flare launcher came out of a suggestion by NHMick. 

All the models were created by me, with textures based on, and using some elements of, an image of the Blue Steel stand-off nuclear missile by Andy Arthur (http://en.wikipedia.org/wiki/Blue_Steel_missile). 

License
=======
This OXP is released under the Creative Commons Attribution - Non-Commercial - Share Alike 3.0 license. To view a copy of this license, visit http://creativecommons.org/licenses/by-nc-sa/3.0/

Version History
===============
2.8, July 2021 (by phkb)
- Made Intercept missile susceptible to ECM.

2.7, July 2018 (by phkb)
- Added unique missile icon for Intercept missile.

2.6, March 2018 (by phkb)
- Updated to avoid deprecated AI methods.

2.5, December 2011
- fixed a problem with errors caused when missiles have no target

2.4, December 2009
- fixed a problem with chaff refills not being available after removing pylon-mounted weapons (compatibility with Oolite v1.73.4)

2.3, October 2009
- fixed problem with AI stack overflow on the Override and Lawmaker missiles 

2.2, September 2009
- minor correction to the equipment.plist to make the Cascade Missile available to all

2.1, February 2009
- re-engineered the chaff launcher to avoid having overwrite original missile AIs

2.0, January 2009
- fixed the override missile, which was incorrectly damaging players' systems when used against NPCs
- revised the two EMP weapons so that they do not affect stations or asteroids
- made some minor game balancing tweaks
- general renaming of entities for consistency
- use of javascript to manage the chaff launcher more efficiently

1.2, December 2008
- incorporated Commander McLane's Status Quo Q-Bomb OXP, which prevents cascade weapons from detonating close to planets and suns
- modified the warning message used with by the electronic override missile shows which system has been damaged
- implemented compatibility changes for Oolite v1.72

1.1, September 2008
- electronic override missile now causes random failure of a ship's systems.  Note that the weapon can be used against the player as well as NPC ships.
- defence mine has been modified so that once again it targets incoming missiles.  The new missile interception code used in Oolite v1.71.2 makes this more effective than in previous versions of Oolite
- anti-thargoid missile will target any thargoid or thargon ships in the area

1.0, May 2008
- full release version to include compatibility with latest Oolite version (1.71.2)
- introduced javascript to manage the fragmentation weapons.  Each one is now fitted with a proper Strike Enable Facility to ensure that they can only be activated when given the correct instruction.  In previous versions, weapons such as the frag missile and frag bomb were liable to detonate in the event of a collision or explosion
- chaff refills are now only available from the shipyard if the player has a chaff dispenser fitted.

0.5, March 2008
- modified chaff so that it is no longer 100% effective and not as persistent.  

0.4, November 2007
- added a multi-use chaff dispenser.  The flares in v0.3 have been modified so that missiles (both standard and ECM-hardened) will lock onto them.  The system has then been transformed into a multi-use chaff launcher
- interception missiles now make more use of fuel injection as originally intended
- added the Purple Strand ECM-activated remote detonation bomb.

0.3, September 2007
- added the Violet Flax Electronic Override Missile
- added the Distress Beacon
- altered the EMP Immobilisation Missile to have only a temporary effect on targets; ships will now be out of action for only 15 seconds
- further minor tweaks to various stats

0.2, March 2007
- altered the Defence Mine so that its missiles target pirate ships rather than other missiles.  This makes it much more useful in combat.
- minor tweaks to various stats.

0.1, February 2007
- Initial package containing the following:
    - Cascade Missile
    - Anti-Thargoid Missile
    - EMP Immobilisation Missile
    - Fragmentation Missile and Bomb
    - Interception Missile
    - Anti-Missile Defence Mine
    - Flare Dispenser

Equipment

Name Visible Cost [deci-credits] Tech-Level
Cascade Missile yes 100000 13+
Chaff Dispenser yes 50000 8+
Chaff Refill yes 5000 5+
Defence Mine yes 7000 10+
Distress Beacon yes 7000 10+
Fragmentation Bomb yes 6500 8+
Fragmentation Missile yes 7500 9+
Interception Missile yes 500 7+
Lawmaker Missile yes 20000 10+
Override Missile yes 85000 13+
Radio Mine yes 20000 10+
Anti-Thargoid Missile yes 80000 10+

Ships

Name
Cascade Missile
Chaff Particle
Chaff Launcher
Defence Missile
Defence Missile Launcher
Distress Beacon
Distress Beacon Launcher
Fragmentation Bomb
Fragmentation Missile
Fragmentary Particle
Intercept Missile
Lawmaker Missile
Override Missile
Remote Detonation Mine
Remote Launcher
Anti-Thargoid Missile
Anti-Thargoid Warhead

Models

This expansion declares no models.

Scripts

Path
Scripts/Missiles & Bombs.js
"use strict";
this.name = "Missiles & Bombs";
this.author = "Ramirez";
this.copyright = "January 2009";
this.description = "Script to reload the chaff launcher";
this.version = "1.0";

this.playerBoughtEquipment = function(equipment) {
    if (equipment == "EQ_RMB_CHAFF_LAUNCHER" && missionVariables.rmb_chaff_count == undefined) {
		missionVariables.rmb_chaff_count = 0;
    }

    if (equipment == "EQ_RMB_CHAFF_MINE") {
		missionVariables.rmb_chaff_count = 5;
    }
}
Scripts/rmb-cascade-missile-script.js
"use strict";
this.name = "rmb-cascade-missile-script";
this.author = "Ramirez";
this.copyright = "December 2008";
this.description = "Checks for mass before successfully detonating a Blue Steel cascade missile.  If mass is present, missile explodes harmlessly";
this.version = "1.0";

this.checkForPlanetProximity = function() { 
   function isAPlanet(entity) { 
      return entity.isPlanet || entity.isSun;
   } 
   var closestPlanet = system.filteredEntities(this, isAPlanet, this.ship)[0];
   if (closestPlanet == null) this.ship.reactToAIMessage("DETONATE");
   else if (this.ship.position.distanceTo(closestPlanet) < closestPlanet.radius * 1.33) this.ship.reactToAIMessage("DEFUSE");
   else this.ship.reactToAIMessage("DETONATE");
}
Scripts/rmb-chaff-launcher-script.js
"use strict";
this.name = "rmb-chaff-launcher-script.js";
this.author = "Ramirez";
this.copyright = "January 2009";
this.description = "Ship script for the chaff launcher";
this.version = "1.0";


this.decrementChaff = function() {// when chaff is released by the launcher, decrement the chaff count and reload if bundles are available
	function isHostileMissile(entity) { 
		return (entity.isShip && entity.scanClass == "CLASS_MISSILE");
	}

	if (player.ship.equipmentStatus("EQ_RMB_CHAFF_LAUNCHER") != "EQUIPMENT_OK") {
		player.consoleMessage("Chaff launched without launcher. You have " + --missionVariables.rmb_chaff_count + " bundle(s) remaining.", 6);
		return;
	}
	if (--missionVariables.rmb_chaff_count > 0) {
		player.ship.awardEquipment("EQ_RMB_CHAFF_MINE");
		player.consoleMessage("Chaff reloaded. You have " + missionVariables.rmb_chaff_count + " bundle(s) remaining.", 6);
	} else {
		player.consoleMessage("Chaff exhausted.", 6);
	}

	var chaff = this.ship.spawn("rmb-chaff", 30);
	var missiles = system.filteredEntities(this, isHostileMissile, this.ship, this.ship.scannerRange);

	for (var i = 0; i < missiles.length; i++) {
		var chance
		switch (missiles[i].name) {
			case "Missile": chance = 0.95 ;break;
			case "ECM Hardened Missile": chance = 0.8 ;break;
			case "Fragmentation Missile": chance = 0.9 ;break;
			case "Lawmaker Missile": chance = 0.0 ;break;
			case "Cascade Missile": chance = 0.0 ;break;
			case "Intercept Missile": chance = 0.7 ;break;
			case "Anti-Thargoid Missile": chance = 0.0 ;break;
			case "Anti-Thargoid Warhead": chance = 0.0 ;break;
			case "Defence Missile": chance = 0.0 ;break;
			case "Override Missile": chance = 0.0 ;break;
			default: chance = 0.75; break; // used for non listed missiles (from other oxp's).
		}

		if (Math.random() < chance) missiles[i].target = chaff[i];
	}
}
Scripts/rmb-defence-missile.js
"use strict";
this.name = "rmb-defence-missile-script";
this.author = "phkb";
this.copyright = "2017";
this.description = "Runs deal energy damage function";
this.version = "1.0";

this.perform_damage_missile = function() {
    // converted weapon_damage value from 3500 to 132
    // based on standard missile having 4500 weapon damage and a value 170 in code
    this.ship.dealEnergyDamage(132, 25.0, 0.25);
}
Scripts/rmb-frag-script.js
"use strict";
this.name = "rmb-frag-script";
this.author = "phkb";
this.copyright = "2017";
this.description = "Runs deal energy damage function";
this.version = "1.0";

this.perform_damage_missile = function() {
    // converted weapon_damage value from 5000 to 188
    // based on standard missile having 4500 weapon damage and a value 170 in code
    this.ship.dealEnergyDamage(188, 25.0, 0.2);
}

this.perform_damage_bomb = function() {
    // converted weapon_damage value from 6000 to 226
    // based on standard missile having 4500 weapon damage and a value 170 in code
    this.ship.dealEnergyDamage(226, 50.0, 0.35);
}

this.perform_damage_particle = function() {
    // converted weapon_damage value from 3000 to 113
    // based on standard missile having 4500 weapon damage and a value 170 in code
    this.ship.dealEnergyDamage(113, 50.0, 0.25);
}

Scripts/rmb-intercept-missile-script.js
"use strict";
this.name = "rmb-intercept-missile-script";
this.author = "phkb";
this.copyright = "2017";
this.description = "Runs deal energy damage function";
this.version = "1.0";

this.perform_damage_missile = function() {
    // converted weapon_damage value from 3000 to 113
    // based on standard missile having 4500 weapon damage and a value 170 in code
    this.ship.dealEnergyDamage(113, 25, 0.5);
}
Scripts/rmb-law-missile-script.js
"use strict";
this.name = "rmb-law-missile-script";
this.author = "Ramirez";
this.copyright = "December 2011";
this.description = "Prevents an Orange Tear lawmaker missile from being used against stations and other stationary objects";
this.version = "3.0";

this.checkTargetVulnerability = function() {
    if (!this.ship || !this.ship.isValid || !this.ship.target || !this.ship.target.isValid) return;
    if ((this.ship.target.isStation && this.ship.target.maxSpeed == 0) || this.ship.target.scanClass == "CLASS_ROCK" || this.ship.target.scanClass == "CLASS_BUOY") return;
    if (this.ship.target.isPlayer) return;
    if (this.ship.target.AI == "rmb-stunnedAI.plist") 
        return;
    else 
        this.ship.target.setAI("rmb-stunnedAI.plist");
}
Scripts/rmb-override-missile-script.js
"use strict";
this.name = "rmb-override-missile-script";
this.author = "Ramirez";
this.copyright = "December 2011";
this.description = "Prevents a Violet Flax override missile from being effective against stations and other stationary objects.  If player is the target, a random piece of equipment is damaged";
this.version = "4.0";

this.damageSystems = function() {
    if (!this.ship || !this.ship.isValid || !this.ship.target || !this.ship.target.isValid) {
        return;
    }

    if ((this.ship.target.isStation && this.ship.target.maxSpeed == 0) || this.ship.target.scanClass == "CLASS_ROCK" || this.ship.target.scanClass == "CLASS_BUOY") return;
    if (this.ship.target.isPlayer) {
        var list = ["EQ_ADVANCED_COMPASS", "EQ_DOCK_COMP", "EQ_ECM", "EQ_FUEL_INJECTION", "EQ_TARGET_MEMORY", 	"EQ_SCANNER_SHOW_MISSILE_TARGET"];
        let equipment = list[Math.floor(Math.random() * list.length)];
        if (player.ship.equipmentStatus(equipment) == "EQUIPMENT_OK") {
            player.ship.setEquipmentStatus(equipment, "EQUIPMENT_DAMAGED");
            player.commsMessage("Warning: Missile detonation caused failure of " + EquipmentInfo.infoForKey(equipment).name, 5);
            this.ship.reactToAIMessage("DETONATE");
        }
    } else {
        if (this.ship.target.AI == "rmb-overrideAI.plist") return ;
        else 
            this.ship.target.setAI("rmb-overrideAI.plist");
    }
}
Scripts/rmb-remote-mine-script.js
"use strict";
this.name = "rmb-remote-mine-script";
this.author = "phkb";
this.copyright = "2017";
this.description = "Runs deal energy damage function";
this.version = "1.0";

this.perform_damage_mine = function() {
    // converted weapon_damage value from 70000 to 2644
    // based on standard missile having 4500 weapon damage and a value 170 in code
    this.ship.dealEnergyDamage(2644, 500.0);
}
Scripts/rmb-thargoid-warhead-script.js
"use strict";
this.name = "rmb-thargoid-warhead-script";
this.author = "phkb";
this.copyright = "2017";
this.description = "Runs deal energy damage function";
this.version = "1.0";

// not sure if this is correct - according to the shipdata entry, there is no special weapon_energy defined, 
// meaning it uses the default missile value of 4500, which then translates to 170 in this function
// I would've expected a thargoid warhead to deal more damage
this.perform_damage_warhead = function() {
    this.ship.dealEnergyDamage(170, 25.0, 0.25);
}