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);
}
|