Scripts/naval_galdrive_programmer.js |
"use strict";
this.name = "Naval-GalDrive-Programmer";
this.copyright = "(C) 2011, 2012, 2024, Wildeblood";
this.description = "A larger selection of programmed destinations for the Galactic Hyper-drive.";
this.version = "1.3";
/* ====================================================================================
DESTINATIONS ARRAY
This assumes Oolite's default galaxy seeds, copied from Elite.
Destinations are the 14 SecCom stations in each galaxy.
======================================================================================= */
this.destinations = [[["Ceinzala (SecCom 1)",[7.2,4,0]],["Orrere (SecCom 2)",[2.4,28.6,0]],["Isinor (SecCom 3)",[18.8,38.2,0]],["Tibionis (SecCom 4)",[26,21.6,0]],["Encereso (SecCom 5)",[34,37.8,0]],["Usatqura (SecCom 6)",[38.8,7.8,0]],["Maxeedso (SecCom 7)",[42,21.8,0]],["Xeer (SecCom 8)",[56.4,23.2,0]],["Xeaan (SecCom 9)",[67.6,13.4,0]],["Oresle (SecCom 10)",[76,42,0]],["Aerater (SecCom 11)",[83.6,15.6,0]],["Aleusqu (SecCom 12)",[86,24.4,0]],["Inines (SecCom 13)",[95.6,3.2,0]],["Ceedra (SecCom 14)",[98,44,0]]],[["Aanteso (SecCom 1)",[6.8,11.4,0]],["Laraisso (SecCom 2)",[7.6,40.8,0]],["Gexein (SecCom 3)",[15.2,11.2,0]],["Vezaaes (SecCom 4)",[20.8,43.2,0]],["Xeatxe (SecCom 5)",[31.2,19.4,0]],["Texebi (SecCom 6)",[41.2,6,0]],["Diti (SecCom 7)",[42,32.6,0]],["Atzaxe (SecCom 8)",[55.6,14.2,0]],["Ratite (SecCom 9)",[57.6,48.6,0]],["Anusa (SecCom 10)",[68.4,25.8,0]],["Ceinerxe (SecCom 11)",[76,8,0]],["Isonza (SecCom 12)",[92,5.4,0]],["Titequ (SecCom 13)",[91.6,31.8,0]],["Onmate (SecCom 14)",[96.4,43.6,0]]],[["Teceinre (SecCom 1)",[4,18.6,0]],["Edxeri (SecCom 2)",[14,1.2,0]],["Maceceve (SecCom 3)",[20.4,45.8,0]],["Leentima (SecCom 4)",[26.8,28.2,0]],["Birera (SecCom 5)",[25.2,14.4,0]],["Rimaedxe (SecCom 6)",[44,6,0]],["Rigebi (SecCom 7)",[52.8,38.4,0]],["Inbiti (SecCom 8)",[65.6,10.8,0]],["Tizabea (SecCom 9)",[73.2,23.4,0]],["Rainle (SecCom 10)",[76.8,43.2,0]],["Rilalela (SecCom 11)",[94.8,8,0]],["Dianed (SecCom 12)",[95.6,31.6,0]],["Bezaed (SecCom 13)",[42,46.4,0]],["Lebied (SecCom 14)",[6.8,42.2,0]]],[["Encegequ (SecCom 1)",[4.4,39.6,0]],["Quzaarar (SecCom 2)",[4.4,25.2,0]],["Oronceri (SecCom 3)",[5.2,5,0]],["Biesin (SecCom 4)",[23.6,33.4,0]],["Tiveorso (SecCom 5)",[30,10.4,0]],["Raeddi (SecCom 6)",[39.2,29,0]],["Arama (SecCom 7)",[45.2,16.8,0]],["Cequququ (SecCom 8)",[48.8,43.8,0]],["Beesed (SecCom 9)",[62,24.6,0]],["Riceatra (SecCom 10)",[69.2,11.2,0]],["Cearmate (SecCom 11)",[74.8,46.6,0]],["Diriceen (SecCom 12)",[86.8,11,0]],["Geonerbe (SecCom 13)",[94.8,34.8,0]],["Onramaon (SecCom 14)",[98.4,6,0]]],[["Gesolaon (SecCom 1)",[4,11.2,0]],["Usorbela (SecCom 2)",[20,6,0]],["Issodien (SecCom 3)",[16,32.2,0]],["Ririqu (SecCom 4)",[24.4,45.4,0]],["Xevera (SecCom 5)",[36.4,30.4,0]],["Usaorer (SecCom 6)",[38.8,7.4,0]],["Atenrile (SecCom 7)",[48.8,46,0]],["Onrace (SecCom 8)",[58,13.4,0]],["Bisoge (SecCom 9)",[60,34,0]],["Veedri (SecCom 10)",[70,22.8,0]],["Tiusriri (SecCom 11)",[76.4,9.8,0]],["Rareat (SecCom 12)",[82,47,0]],["Qulecele (SecCom 13)",[93.2,18.6,0]],["Diis (SecCom 14)",[95.6,31.2,0]]],[["Teesso (SecCom 1)",[4.8,9.4,0]],["Atquti (SecCom 2)",[4.4,25,0]],["Oresmaa (SecCom 3)",[15.6,33.6,0]],["Azara (SecCom 4)",[26,48.8,0]],["Ormadi (SecCom 5)",[29.2,27.2,0]],["Engean (SecCom 6)",[27.6,8.8,0]],["Soamaxe (SecCom 7)",[46.8,3.6,0]],["Orbequso (SecCom 8)",[43.6,47,0]],["Celaan (SecCom 9)",[53.2,27.6,0]],["Usquat (SecCom 10)",[69.6,19.8,0]],["Anenbi (SecCom 11)",[73.6,44.2,0]],["Orgete (SecCom 12)",[76,2.2,0]],["Ariqu (SecCom 13)",[94.4,7,0]],["Isaanus (SecCom 14)",[94.8,39.2,0]]],[["Riareror (SecCom 1)",[3.2,32.8,0]],["Aislaxe (SecCom 2)",[16.4,45.6,0]],["Xeorusge (SecCom 3)",[4.8,14.6,0]],["Qulearbi (SecCom 4)",[18.8,4.6,0]],["Edoned (SecCom 5)",[28,6.4,0]],["Atuszais (SecCom 6)",[29.6,34.4,0]],["Erarrior (SecCom 7)",[39.6,17.2,0]],["Tiarice (SecCom 8)",[48,44.6,0]],["Enarines (SecCom 9)",[56.8,27.2,0]],["Agebi (SecCom 10)",[58.8,6.4,0]],["Diusace (SecCom 11)",[74,12.8,0]],["Teed (SecCom 12)",[74.8,44.6,0]],["Ceraxete (SecCom 13)",[92.4,33.4,0]],["Ribior (SecCom 14)",[97.2,10.4,0]]],[["Titiridi (SecCom 1)",[5.6,3.4,0]],["Xeoresce (SecCom 2)",[5.6,20.8,0]],["Leater (SecCom 3)",[11.6,42.2,0]],["Atmabe (SecCom 4)",[21.6,13.4,0]],["Inzaan (SecCom 5)",[29.6,9,0]],["Esusale (SecCom 6)",[37.6,19.2,0]],["Inisbi (SecCom 7)",[49.2,42.6,0]],["Leesusen (SecCom 8)",[50,2,0]],["Maarabi (SecCom 9)",[61.2,20.2,0]],["Teteus (SecCom 10)",[69.6,3.4,0]],["Belabia (SecCom 11)",[88,26.4,0]],["Vebixe (SecCom 12)",[91.6,15,0]],["Laorlaza (SecCom 13)",[92,44.2,0]],["Getiusza (SecCom 14)",[69.2,39.6,0]]]];
/* ====================================================================================
STEPS THROUGH THE CO-ORDINATE ARRAYS WHEN ACTIVATED
======================================================================================= */
this._activationCounter = -1;
this.activated = function () {
"use strict";
if (player.ship.equipmentStatus("EQ_GAL_DRIVE") === "EQUIPMENT_OK") {
player.consoleMessage("Naval Hyperdrive Programmer", 3);
var nextGalaxy = galaxyNumber + 1;
if (galaxyNumber === 7) {
nextGalaxy = 0;
}
this._activationCounter++;
if (this._activationCounter === this.destinations[nextGalaxy].length) {
this._activationCounter = 0;
}
player.ship.galacticHyperspaceBehaviour = "BEHAVIOUR_FIXED_COORDINATES";
var destinationName = this.destinations[nextGalaxy][this._activationCounter][0];
player.ship.galacticHyperspaceFixedCoordsInLY = Vector3D(this.destinations[nextGalaxy][this._activationCounter][1]);
// Only call _saveDestination AFTER setting co-ordinates.
worldScripts.galdrive_worldscript._saveDestination(destinationName);
} else {
player.consoleMessage("Galactic™ hyperdrive is not available.", 6);
}
}
/* ====================================================================================
STOWING THE NAVAL HYPERDRIVE PROGRAMMER WHEN USELESS
This prevents the programmer appearing as primable equipment while there is no
galdrive installed.
======================================================================================= */
this.playerEnteredNewGalaxy = function () {
"use strict";
if (player.ship.equipmentStatus("EQ_NAVAL_GALDRIVE_PROGRAMMER") === "EQUIPMENT_OK") {
player.ship.setEquipmentStatus("EQ_NAVAL_GALDRIVE_PROGRAMMER", "EQUIPMENT_DAMAGED");
missionVariables.galDrive_ProgrammerStowed = "true";
}
this._activationCounter = -1;
}
/* ====================================================================================
EVENT HANDLERS FOR DOCKING & LAUNCHING
======================================================================================= */
this.startUpComplete = function () {
"use strict";
if (player.ship.equipmentStatus("EQ_GAL_DRIVE") === "EQUIPMENT_OK" &&
player.ship.equipmentStatus("EQ_NAVAL_GALDRIVE_PROGRAMMER") === "EQUIPMENT_OK") {
this._applyNavalInterface();
}
delete this.startUpComplete;
}
this.shipDockedWithStation = function () {
"use strict";
if (player.ship.equipmentStatus("EQ_GAL_DRIVE") === "EQUIPMENT_OK" &&
player.ship.equipmentStatus("EQ_NAVAL_GALDRIVE_PROGRAMMER") === "EQUIPMENT_OK") {
this._applyNavalInterface();
}
if (missionVariables.galDrive_ProgrammerStowed === "true") {
player.ship.setEquipmentStatus("EQ_NAVAL_GALDRIVE_PROGRAMMER","EQUIPMENT_OK");
}
}
/* ====================================================================================
WHEN THE PLAYER BUYS EQUIPMENT
======================================================================================= */
this.playerBoughtEquipment = function (equipment) {
"use strict";
if (equipment === "EQ_GAL_DRIVE" &&
player.ship.equipmentStatus("EQ_NAVAL_GALDRIVE_PROGRAMMER") === "EQUIPMENT_OK") {
this._applyNavalInterface();
delete missionVariables.galDrive_ProgrammerStowed;
}
if (equipment === "EQ_NAVAL_GALDRIVE_PROGRAMMER") {
if (player.ship.equipmentStatus("EQ_GAL_DRIVE") === "EQUIPMENT_OK") {
this._applyNavalInterface();
} else {
missionVariables.galDrive_ProgrammerStowed = "true";
}
}
}
/* ====================================================================================
STATION INTERFACE
======================================================================================= */
this._applyNavalInterface = function () {
"use strict";
if (player.ship.dockedStation) {
player.ship.dockedStation.setInterface("naval_galdrive", {
title: "Naval hyperdrive programmer",
category: expandDescription("[interfaces-category-ship-systems]"),
summary: "Activate this to reset the destination programmed into your ultra-long-range Galactic™ hyperdrive.",
callback: this.activated.bind(this)
});
}
}
/* ====================================================================================
THE END
======================================================================================= */
|
Scripts/new_galdrive_programmer.js |
"use strict";
this.name = "New-GalDrive-Programmer";
this.copyright = "(C) 2011, 2012, 2024, Wildeblood";
this.description = "A limited selection of programmed destinations for the Galactic Hyper-drive.";
this.version = "1.3";
/* ====================================================================================
DESTINATIONS ARRAY
Add any interesting destinations found to the appropriate sub-array.
This assumes Oolite's default galaxy seeds, copied from Elite.
======================================================================================= */
this.destinations = new Array(8);
this.destinations[0] = new Array(
["Lave (Old Worlds)",[8, 34.6, 0]],
["Sori (Ascension)",[100.4, 50.4, 0]],
["Tianve (Pulsar Worlds)",[90.8, 0, 0]],
["Usralaat",[73.6, 35.8, 0]],
["Vetitice (Galcentre G1)",[42, 30.4, 0]]
);
this.destinations[1] = new Array(
["Ramaan",[100.4, 50.2, 0]],
["Reenus",[2.8, 24.8, 0]],
["Riardi",[1.6, 46.2, 0]],
["Sosole",[70.8, 47.6, 0]]
);
this.destinations[2] = new Array(
["Ditere (Prodigal Suns)",[27.2, 2, 0]],
["Enata",[68.4, 35.8, 0]],
["Ingece",[8.4, 25.8, 0]],
["Oninriar",[97.2, 11.6, 0]]
);
this.destinations[3] = new Array(
["Anerined",[89.6, 17, 0]],
["Ensoza",[42, 40.6, 0]],
["Esarqure",[53.6, 24.4, 0]],
["Laisxela",[6.4, 17.4, 0]]
);
this.destinations[4] = new Array(
["Atredi (Tetiri Conclave)",[4.8, 48, 0]],
["Engeatso (Galcentre G5)",[62.4, 29.6, 0]],
["Inmaarxe",[7.6, 21.4, 0]],
["Qulecele",[93.2, 18.6, 0]]
);
this.destinations[5] = new Array(
["Diraonle (Isaanus Syndicate)",[100.8, 46.6, 0]],
["Estebiin (Lost Worlds)",[89.2, 48.6, 0]],
["Qutius (Lost Worlds)",[85.2, 39.8, 0]],
["Ririso (Rabian Spur)",[68, 4.4, 0]]
);
this.destinations[6] = new Array(
["Articeso (Rift Worlds)",[1.2, 27.4, 0]],
["Esvesoso",[41.2, 26.6, 0]],
["Isdilaon",[68, 26.6, 0]],
["Xeonar (Rift Worlds)",[15.6, 36.2, 0]]
);
this.destinations[7] = new Array(
["Maarabi (Galcentre G8)",[61.2, 20.2, 0]],
["Maatxeri",[15.2, 25.4, 0]],
["Oresrati (Lost Worlds)",[6.4, 51, 0]],
["Teescear (Far Arm)",[102, 40.8, 0]]
);
/* ====================================================================================
STEPS THROUGH THE CO-ORDINATE ARRAYS WHEN ACTIVATED
======================================================================================= */
this._activationCounter = -1;
this.activated = function () {
"use strict";
player.consoleMessage("Galactic Hyperdrive", 3);
var nextGalaxy = galaxyNumber + 1;
if (galaxyNumber === 7) {
nextGalaxy = 0;
}
this._activationCounter++;
if (this._activationCounter === this.destinations[nextGalaxy].length) {
player.ship.galacticHyperspaceBehaviour = "BEHAVIOUR_STANDARD";
player.consoleMessage("Automatic navigation to GalCop recommended destination.", 3);
// Only call _saveDestination AFTER setting co-ordinates.
worldScripts.galdrive_worldscript._saveDestination();
return;
}
if (this._activationCounter > this.destinations[nextGalaxy].length) {
this._activationCounter = 0;
}
player.ship.galacticHyperspaceBehaviour = "BEHAVIOUR_FIXED_COORDINATES";
var destinationName = this.destinations[nextGalaxy][this._activationCounter][0];
player.ship.galacticHyperspaceFixedCoordsInLY = Vector3D(this.destinations[nextGalaxy][this._activationCounter][1]);
// Only call _saveDestination AFTER setting co-ordinates.
worldScripts.galdrive_worldscript._saveDestination(destinationName);
}
/* ====================================================================================
PERFORMING A GALACTIC JUMP
======================================================================================= */
// this.playerEnteredNewGalaxy = function () {
// this._activationCounter = -1;
// }
/* ====================================================================================
EVENT HANDLERS FOR SETTING THE STATION INTERFACE
======================================================================================= */
this.startUpComplete = function () {
"use strict";
if (player.ship.equipmentStatus("EQ_GAL_DRIVE") === "EQUIPMENT_OK") {
this._applyNewInterface();
}
delete this.startUpComplete;
}
this.playerBoughtEquipment = function (equipment) {
"use strict";
if (equipment === "EQ_GAL_DRIVE") {
this._applyNewInterface();
}
}
this.shipDockedWithStation = function () {
"use strict";
if (player.ship.equipmentStatus("EQ_GAL_DRIVE") === "EQUIPMENT_OK") {
this._applyNewInterface();
}
}
/* ====================================================================================
STATION INTERFACE
======================================================================================= */
this._applyNewInterface = function () {
"use strict";
if (player.ship.dockedStation) {
player.ship.dockedStation.setInterface("new_galdrive", {
title: "Galactic™ hyperdrive",
category: expandDescription("[interfaces-category-ship-systems]"),
summary: "Activate this to reset the destination programmed into your ultra-long-range Galactic™ hyperdrive.",
callback: this.activated.bind(this)
});
}
}
/* ====================================================================================
THE END
======================================================================================= */
|