Marvellous replacement and cool video!

Moderators: winston, another_commander
I Had a feeling that was the case with a lot of people. Hopefully this update will create a bit of fun with fuel.Cholmondely wrote: ↑Mon Apr 14, 2025 10:34 pmI'd never realised that we were supposed to tweak the innards of this one.
Code: Select all
"use strict";
this.name = "II_conditions";
this.author = "Killer Wolf";
this.copyright = "(C) 2023 Killer Wolf.";
this.license = "CC-NC-by-SA 3.0";
this.description = "Condition script for equipment.";
this.allowAwardEquipment = function (equipment, ship, context) {
return worldScripts["oolite-II"].II_allowAwardEquipment(equipment, ship, context);
}
this.updateEquipmentPrice = function (equipment, currentPrice) {
return worldScripts["oolite-II"].II_updateEquipmentPrice(equipment, currentPrice);
}
Code: Select all
"use strict";
// here we establish the position of the station. this needs to be the same every time the system is populated
// you can use the system.pseudoRandomNumber property to add "randomness" to the location if you want
// in this instance, we're just going to use the main station position, and put our station 5000m directly in front of it.
//var stationPos = system.mainStation.position.add(system.mainStation.vectorForward.multiply(5000));
// next, we use the system.setPopulator to create the actual station using a callback
// "create_my_station" is a text string that uniquely identifies this populator function
this.name = "oolite-II";
this.author = "Killer Wolf";
this.copyright = "(C) 2023 Killer Wolf.";
this.license = "CC-NC-by-SA 3.0";
this.systemWillPopulate = function() {
if (galaxyNumber === 1 && system.ID === 195) {
var stationPos = Vector3D(266700, 61250, 15235).fromCoordinateSystem("pwm");
system.setPopulator("II_station", {
callback: function (pos) {
system.addShips("KWii", 1, pos, 0);
},
location: "COORDINATES",
coordinates: stationPos,
deterministic:true // < this is important
});
}
}
this.II_allowAwardEquipment = function(equipment, ship, context) {
if (context == "scripted") return true; // you should always do this at the top of this function.
if ((equipment == "EQ_WEAPON_NEITH_LASER" || equipment == "EQ_WEAPON_KATHOS_LASER") && ship.isPlayer) {
if (player.ship.dockedStation.dataKey == "KW_II") {
return true;
}
return false;
}
return true;
}
this.II_updateEquipmentPrice = function(equipment, currentPrice) {
var newprice = currentPrice;
switch (equipment) {
case "EQ_MISSILE":
case "EQ_CARGO_BAY":
case "EQ_FUEL":
case "EQ_ECM":
case "EQ_HARDENED_MISSILE":
case "EQ_ENERGY_UNIT":
if (player.ship.dockedStation.dataKey == "KW_II") {
newprice = parseInt(newprice * 0.66);
}
break;
case "EQ_DOCK_COMP":
case "EQ_GAL_DRIVE":
if (player.ship.dockedStation.dataKey == "KW_II") {
newprice = parseInt(newprice * 0.75);
}
break;
}
return newprice;
}
Code: Select all
worldScripts.FuelTweaks_FuelEconomy.$reset()