Back to Index | Page generated: Dec 20, 2024, 7:22:09 AM |
from Expansion Manager's OXP list | from Expansion Manifest | |
---|---|---|
Description | Four new ships plus the Kiota station variants. | Four new ships plus the Kiota station variants. |
Identifier | oolite.oxp.Thargoid.Wildships | oolite.oxp.Thargoid.Wildships |
Title | Wildships | Wildships |
Category | Dockables | Dockables |
Author | Thargoid | Thargoid |
Version | 1.11.4 | 1.11.4 |
Tags | ||
Required Oolite Version | ||
Maximum Oolite Version | ||
Required Expansions | ||
Optional Expansions | ||
Conflict Expansions | ||
Information URL | http://wiki.alioth.net/index.php/Wildships_OXP | n/a |
Download URL | https://wiki.alioth.net/img_auth.php/c/c1/Wild_ships_1.11.4.oxz | n/a |
License | CC-BY-NC-SA 4.0 | CC-BY-NC-SA 4.0 |
File Size | n/a | |
Upload date | 1610873459 |
Also read http://wiki.alioth.net/index.php/Wildships
WildShips OXP by Thargoid. New ships from the Aquarian Shipbuilding Corporation of Aqualina in Galaxy 3, plus the Kiota class stations. Stations: The Kiota is a new modular design of station, allowing customers to quickly commission a variety of custom-made stations for a variety of purposes. Each is based around a central "Wanyama" hub module with a simplified bi-directional central docking area. The hub area has spacious areas which can be used for either spaceship hangar and maintenance, an extensive machine area or central low-gravity work or recreational space. The hub is linked as standard by a transportation system out to whichever modules are attached to it, or optionally a solid strut array if additional occupiable space is required. Standard varieties of the Kiota include: * Habitat - These huge stations can accomodate several hundreds of thousands of people in their spaceous ring design. If this is insufficient, then the double-ringed mega-habitat variant can accomodate and sustain the needs of a million inhabitants. * Research - The research Kiota offers a wide range of laboratory and investigation environments, in either two or four isolated modules. * Manufacturing - Offering either two or four distinct factory zones, these stations offer a hugely flexible and economic route to mass production to fulfil the needs of all bar the largest mega-corporate entity. * Bio - What the manufacturing station offers to the industrial worlds, the bio variant offers to the agricultural. Each of the two or four zones is an entirely isolated and distinct ecosystem, suitable for the growth of almost anything natural to any world. * Communications - A relatively cheap and powerful communications array. Suitable for system-wide coverage and boosting of galactic signals. Massive signal processor arrays are fitted as standard in place of the shipyard areas of the central station hub. * Solar - Often used for solar research, fuel harvesting and power generation. This station model features additional heat shielding, at the expense of the shipyard areas available in most of the above variants. Ships: All of the ships feature a new and more efficient quirium plasma drive system. This enables greater fuel efficiency by replacing the normal quirium reaction "burn" with a plasma reaction. This gives not only the improved thrust rates and speeds, but is better for the space environment as no unreacted exhaust trails are given off by the vessels. * Duma - These fast multi-purpose ships are designed for the similar multi-role usage as the common and popular Cobra 3. From trader to bounty hunter to military and police applications, these versatile ships are masters of all. * Tembo - Bulk haulage is the role of these vessels. Rugged and simple, their sole purpose is to move as much cargo as possible with the minimum of fuss and cost. The base ship can carry up to 500 tons at a time, and the optional trailer unit can double that capacity. Lightly armed and armoured, they depend on escorts to ensure they get through safely, but when it comes to carrying they are second to none. * Chatu - A large jump-capable combat ship designed for military, naval and general system protection roles. It has limited cargo capacity, but makes up for it in speed and all-round fighting capability. * Nyoka - The little brother of the Chatu, this short-range escort fighter packs a similar punch to its big brother, but lacks the jump capability and cargo space. This OXP requires at least Oolite v1.77, and will not run on lower versions. -------------------------------------------------------------- License: CC-BY-NC-SA 4.0 -------------------------------------------------------------- Instructions: Unzip the file, and then move the folder "WildShips 1.08.oxp" to the AddOns directory of your Oolite installation. Then start the game up and the ships should be added. -------------------------------------------------------------- Version history: 25/03/2012 - First release, version 1.00 04/04/2012 - Version 1.01 - smaller textures, plus adjustments on kiota script, shader script and turrets. 09/04/2012 - Version 1.02 - further fine tuning of the OXP due to CTD issues 10/04/2012 - Version 1.03 - final tweak to shader code to remove log error. 18/04/2012 - Version 1.04 - minor script correction plus addition of specific police version of the Duma. 27/05/2012 - Version 1.05 - heat insulation increase for solar station, plus adjustments to the lift/callback code 08/01/2013 - Version 1.06 - up'd min version to 1.77, and added multiple docks and a tweak to the lift scripting. Also adds some tanker craft which fly between the system main station and solar stations where they exist. 19/02/2014 - Version 1.07 - added normal and diffuse maps, plus two tribal reskins for the Chatu and the Duma. All thanks to Keeper 20/02/2014 - Version 1.08 - adding and tweaking a couple of textures missing/wrong in 1.07 25/06/2014 - Version 1.09 - updated for 1.80, with populator script and a few other tweaks. Thanks to Spara 09/05/2015 - Version 1.10 - updated for 1.82, with market script. -spara- 10/05/2015 - Version 1.10.1 - some textures were corrupted in 1.10. -spara- 14/09/2015 - Version 1.11 - roles recasted, weapons set to auto, license updated. -spara- 04/04/2016 - Version 1.11.1 - chatu circular escort references fixed. -spara- 24/07/2017 - Version 1.11.2 - obsolete turret ranges removed, custom turret shaders removed, subtle glow added to turrets, glow added to the dock.-spara- 06/10/2018 - Version 1.11.3 - non existential function reference fixed in wildShips_kiota.js. (on line 142 this.shipDied -> this.stopTimers). Spotted by Svengali -spara- 24/09/2020 - Version 1.11.4 - bugfixed addition of manufactoring stations to industrial worlds in populator. Spotted by dybal -spara- -------------------------------------------------------------- Acknowledgements: V1.00 - With thanks to Griff for shader advice. V1.01/2 - With thanks to cim, Gimbal Locke and Gimi for the (ongoing) efforts to sort out the CTD issues V1.03 - With thanks to Ahruman for the guru advice. V1.04 - Nod to Capt Murphy. V1.05 - Credits to Eric Walch and Commander McLane. V1.07 - Thanks to Keeper for the normal and diffuse maps, plus the two new skins for the tribal duma and chatu. V1.09 - Thanks to Spara for the 1.80 populator tweaks.
Path | |
---|---|
Scripts/wildShips_kiota.js | this.name = "wildShips_kiota.js"; this.author = "Thargoid with bits from Eric Walch"; this.description = "Script for Kiota stations"; "use strict"; this.shipSpawned = function() { if(!this.ship.scriptInfo.stationOrientation) { this.stationOrientation = "random" } else { this.stationOrientation = this.ship.scriptInfo.stationOrientation.toLowerCase() } switch(this.ship.scriptInfo.stationOrientation) { default: case "random": // random orientation { this.rotateStation(Vector3D.randomDirection()); break; } case "planet": // main planet { if(system.mainPlanet) { this.rotateStation(system.mainPlanet.position.subtract(this.ship.position).direction()) } else { this.rotateStation(Vector3D.randomDirection()); } break; } case "sun": // system sun (pointing away from the sun rather than towards it) { if(system.sun) { this.rotateStation(this.ship.position.subtract(system.sun.position).direction()) } else { this.rotateStation(Vector3D.randomDirection()); } break; } case "station": // system main station { if(system.mainStation) { this.rotateStation(system.mainStation.position.subtract(this.ship.position).direction()) } else { this.rotateStation(Vector3D.randomDirection()); } break; } case "witchpoint": // witchpoint { this.rotateStation(this.ship.position.multiply(-1).direction()); break; } } this.liftArray = []; this.liftHomeArray = []; this.liftStatusArray = []; this.subArray = this.ship.subEntities; if(this.subArray.length > 0) { var listCounter = 0 ; // reset the counter for(listCounter = 0;listCounter<this.subArray.length;listCounter++) { if(this.subArray[listCounter].hasRole("wildShips_kiotaLift")) { this.liftArray.push(this.subArray[listCounter]); this.liftHomeArray.push(this.subArray[listCounter].position); this.liftStatusArray.push("down"); } } this.distanceTimer = new Timer(this, this.distanceCheck, 0, 10); } if(this.ship && this.ship.hasRole("wildShips_solar")) { this.tankerTimer = new Timer(this, this.launchTanker, 150, 300); } } this.launchTanker = function() { if(Math.random() > 0.9) { this.tanker = this.ship.launchShipWithRole("wildShips_tanker"); this.tanker.switchAI("route1traderAI.plist"); this.tanker.AIState = "HEAD_FOR_PLANET"; } if(Math.random() > 0.9 && system.mainStation) { this.tanker = system.mainStation.launchShipWithRole("wildShips_tanker"); this.tanker.switchAI("wildShips_solarAI.plist"); } } this.distanceCheck = function() { if(this.checkDistance()) { if(!this.callbackID) { this.callbackID = addFrameCallback(this.moveLifts.bind(this)); } if(!this.liftTimer) { this.liftTimer = new Timer(this, this.triggerLifts, 0, 10); } if(!this.missileTimer) { this.missileTimer = new Timer(this, this.awardMissile, 0, 30); } return; } else { this.stopTimers(); } } this.checkDistance = function () { if(!this.ship || ! player.ship || !this.ship.isValid || !player.ship.isValid) { return false; } return (this.ship.position.distanceTo(player.ship) < 256E3); } this.rotateStation = function (targetVector) { var angle = this.ship.heading.angleTo(targetVector); var cross = this.ship.heading.cross(targetVector).direction(); this.ship.orientation = this.ship.orientation.rotate(cross,-angle); } this.awardMissile = function() { if(this.ship.missiles.length < this.ship.missileCapacity) { this.ship.awardEquipment(this.ship.selectNewMissile()); } } this.triggerLifts = function() { var listCounter = 0 ; // reset the counter for(listCounter = 0;listCounter<this.liftArray.length;listCounter++) { if(this.liftStatusArray[listCounter] === "down" && Math.random() < (0.1 * Math.random())) { this.liftStatusArray[listCounter] = "rising"; } if(this.liftStatusArray[listCounter] === "up" && Math.random() < (0.1 * Math.random())) { this.liftStatusArray[listCounter] = "falling"; } } } this.moveLifts = function(delta) { if(!this.ship.isValid || !this.ship.status) { this.stopTimers(); return; } var listCounter = 0 ; // reset the counter var distance = delta * 60; // 60 meter per second for(listCounter = 0;listCounter<this.liftArray.length;listCounter++) { if(this.liftStatusArray[listCounter] === "rising") { this.liftArray[listCounter].position = this.liftArray[listCounter].position.add(this.liftArray[listCounter].vectorUp.multiply(distance)); if(this.liftArray[listCounter].position.distanceTo(this.liftHomeArray[listCounter]) >= 1145) { this.liftArray[listCounter].position = this.liftHomeArray[listCounter].add(this.liftArray[listCounter].vectorUp.multiply(1150)); this.liftStatusArray[listCounter] = "up"; } } if(this.liftStatusArray[listCounter] === "falling") { this.liftArray[listCounter].position = this.liftArray[listCounter].position.subtract(this.liftArray[listCounter].vectorUp.multiply(distance)); if((this.liftArray[listCounter].position.distanceTo(this.liftHomeArray[listCounter]) <= 5) || (this.liftArray[listCounter].position.subtract(this.liftHomeArray[listCounter]).direction().angleTo(this.liftArray[listCounter].vectorUp) < 0.1)) { this.liftArray[listCounter].position = this.liftHomeArray[listCounter]; this.liftStatusArray[listCounter] = "down"; } } } } this.playerWillEnterWitchspace = this.entityDestroyed = this.stopTimers = function() { if(this.callbackID) { removeFrameCallback(this.callbackID); delete this.callbackID; } if(this.missileTimer && this.missileTimer.isRunning) { this.missileTimer.stop(); delete this.missileTimer; } if(this.liftTimer && this.liftTimer.isRunning) { this.liftTimer.stop(); delete this.liftTimer; } } this.shipFiredMissile = function(missile, target) { if(missile && target && this.ship.heading.angleTo(target.position.subtract(this.ship.position).direction()) > (Math.PI / 2)) { missile.orientation = missile.orientation.rotate(missile.vectorUp, Math.PI); missile.position = this.ship.position.subtract(this.ship.vectorForward.multiply(this.ship.position.distanceTo(missile.position))); } } |
Scripts/wildShips_populator.js | this.name = "wildShips_populator.js"; this.author = "Thargoid"; this.description = "Script to add Kiota stations to certain systems"; "use strict"; //1.09 updated to use the core populator -spara- //1.11.4 bugfixing missing manufacturing stations -spara- this.systemWillPopulate = function (){ this.addedCount = 0; //calculate distances var planetToSun = system.sun.position.distanceTo(system.mainPlanet.position); var wpToSun = system.sun.position.magnitude(); //habitats if(system.scrambledPseudoRandomNumber(127) > 0.25) { // add habitat stations between the planet and sun, based on population size this.addedCount += 0.1; if (system.population < 30) var hab_station = "wildShips_kiota2Ring"; else { if (system.population > 45) { if (system.scrambledPseudoRandomNumber(319) > 0.5) var hab_station = "wildShips_kiota8Ring"; else var hab_station = "wildShips_kiota8RingV"; } else { if(system.scrambledPseudoRandomNumber(319) > 0.5) var hab_station = "wildShips_kiota4Ring"; else var hab_station = "wildShips_kiota4RingV"; } } var distanceFromPlanetSurface = 0.1 * (planetToSun - system.sun.radius - system.mainPlanet.radius); //randomize the position a bit var x_coord = system.scrambledPseudoRandomNumber(598) * 25E3; var y_coord = system.scrambledPseudoRandomNumber(482) * 25E3; var z_coord = system.mainPlanet.radius + distanceFromPlanetSurface; var exactPosition = Vector3D(x_coord, y_coord, z_coord).fromCoordinateSystem("psm"); system.setPopulator("wild_ships_habitat", { callback: function(pos) { system.addShips(hab_station, 1, pos, 0); }.bind(this), location: "COORDINATES", coordinates: exactPosition, deterministic: true }) } //comms stations if(system.scrambledPseudoRandomNumber(891) > (0.5 + this.addedCount)) { // add comms stations this.addedCount += 0.1; if(system.population > 40) var comms_station = "wildShips_kiota4Comms"; else var comms_station = "wildShips_kiota2Comms"; var distanceFromWp = 0.3 * (wpToSun - system.sun.radius); //randomize the position a bit var x_coord = system.scrambledPseudoRandomNumber(599) * 25E3; var y_coord = system.scrambledPseudoRandomNumber(483) * 25E3; var z_coord = distanceFromWp; var exactPosition = Vector3D(x_coord, y_coord, z_coord).fromCoordinateSystem("wsm"); system.setPopulator("wild_ships_comms", { callback: function(pos) { system.addShips(comms_station, 1, pos, 0); }.bind(this), location: "COORDINATES", coordinates: exactPosition, deterministic: true }) } //solar stations if(system.scrambledPseudoRandomNumber(189) > (0.5 + this.addedCount)) { // add solar stations this.addedCount += 0.1; if(system.population > 40) var solar_station = "wildShips_kiota4Solar"; else var solar_station = "wildShips_kiota2Solar"; var distanceFromPlanetSurface = 0.9 * (planetToSun - system.sun.radius - system.mainPlanet.radius); //randomize the position a bit var x_coord = system.scrambledPseudoRandomNumber(600) * 25E3; var y_coord = system.scrambledPseudoRandomNumber(484) * 25E3; var z_coord = system.mainPlanet.radius + distanceFromPlanetSurface; var exactPosition = Vector3D(x_coord, y_coord, z_coord).fromCoordinateSystem("psm"); system.setPopulator("wild_ships_solar", { callback: function(pos) { system.addShips(solar_station, 1, pos, 0); }.bind(this), location: "COORDINATES", coordinates: exactPosition, deterministic: true }) } //research stations if(system.techLevel > 6 && system.scrambledPseudoRandomNumber(713) > (0.5 + this.addedCount)) { // add research stations to higher tech systems this.addedCount += 0.1; if(system.techLevel > 11) var research_station = "wildShips_kiota4Spur"; else var research_station = "wildShips_kiota2Spur"; var distanceFromWp = 0.6 * (wpToSun - system.sun.radius); //randomize the position a bit var x_coord = system.scrambledPseudoRandomNumber(601) * 25E3; var y_coord = system.scrambledPseudoRandomNumber(485) * 25E3; var z_coord = distanceFromWp; var exactPosition = Vector3D(x_coord, y_coord, z_coord).fromCoordinateSystem("wsm"); system.setPopulator("wild_ships_research", { callback: function(pos) { system.addShips(research_station, 1, pos, 0); }.bind(this), location: "COORDINATES", coordinates: exactPosition, deterministic: true }) } //manufacturing stations if (system.scrambledPseudoRandomNumber(301) > (0.5 + this.addedCount)) { // add manufacturing stations to industrial systems if (system.economy < 3) { if(system.productivity > (30000 - (system.economy * 2500))) var man_station = "wildShips_kiota4Disc"; else var man_station = "wildShips_kiota2Disc"; } // add bio stations to agricultural systems else if (system.economy > 4) { if(system.productivity > (30000 - ((system.economy - 5) * 2500))) var man_station = "wildShips_kiota4Sphere"; else var man_station = "wildShips_kiota2Sphere"; } else return; this.addedCount += 0.1; var distanceFromPlanetSurface = 0.5 * (planetToSun - system.sun.radius - system.mainPlanet.radius); //randomize the position a bit var x_coord = system.scrambledPseudoRandomNumber(602) * 25E3; var y_coord = system.scrambledPseudoRandomNumber(486) * 25E3; var z_coord = system.mainPlanet.radius + distanceFromPlanetSurface; var exactPosition = Vector3D(x_coord, y_coord, z_coord).fromCoordinateSystem("psm"); system.setPopulator("wild_ships_manufacturing", { callback: function(pos) { system.addShips(man_station, 1, pos, 0); }.bind(this), location: "COORDINATES", coordinates: exactPosition, deterministic: true }) } } |
Scripts/wildShips_tembo.js | this.name = "wildShips_tembo.js"; this.author = "Thargoid with stuff from Kaks"; this.description = "Script for Tembo hauler/trader"; "use strict"; this.shipSpawned = function() { if(Math.random() > 0.6 && this.ship && this.ship.subEntities && this.ship.subEntities.length > 0) { this.ship.subEntities[0].remove(); this.ship.lightsActive = false; return; } let subs = this.ship.subEntities; subs.items = function(){for (let loop = 0; loop < this.length; loop++) yield this[loop];} for (let loop in subs.items()) { loop.script.owner = this.ship; loop.script.shipDied = function(whom, why) { if(why && why === "removed") { return; } this.owner.spawn('cargopod', Math.ceil(Math.random()*20)); this.owner.lightsActive = false; }; } } this.shipDied = function (whom, why) { if(why && why === "removed") { return; } this.ship.spawn('cargopod', Math.ceil(Math.random()*20)); }; |
Scripts/wildships-market.js | "use strict"; this.name = "wildships-market"; this.author = "spara"; this.$originalResearch = { "food" : [0, 0, 17, -2, -2, 2, 1, 1, 0], "textiles" : [0, 0, 18, -1, -1, 3, 3, 3, 0], "radioactives" : [0, 0, 85, -3, -3, 5, 7, 7, 0], "slaves" : [0, 0, 40, -5, -5, 0, 31, 31, 0], "liquor_wines" : [0, 0, 90, -5, -5, 251, 15, 15, 0], "luxuries" : [0, 0, 170, 8, 8, 10, 3, 3, 0], "narcotics" : [0, 0, 245, 29, 8, 0, 10, 120, 0], "computers" : [0, 0, 170, 14, 14, 60, 3, 3, 0], "machinery" : [0, 0, 130, 6, 6, 40, 7, 7, 0], "alloys" : [0, 0, 85, 1, 1, 30, 31, 31, 0], "firearms" : [0, 0, 85, 13, 13, 5, 7, 7, 0], "furs" : [0, 0, 80, -9, -9, 100, 63, 63, 0], "minerals" : [0, 0, 32, -1, -1, 60, 3, 3, 0], "gold" : [0, 0, 105, -1, -1, 66, 7, 7, 1], "platinum" : [0, 0, 190, -2, -2, 55, 31, 31, 1], "gem_stones" : [0, 0, 55, -1, -1, 250, 15, 15, 2], "alien_items" : [0, 0, 95, 15, 0, 0, 7, 0, 0] } this.$originalManufacturing = { "food" : [0, 0, 23, -2, -2, 3, 1, 1, 0], "textiles" : [0, 0, 25, -1, -1, 6, 3, 3, 0], "radioactives" : [0, 0, 55, -3, -3, 2, 7, 7, 0], "slaves" : [0, 0, 45, -5, -5, 226, 31, 31, 0], "liquor_wines" : [0, 0, 83, -5, -5, 245, 15, 15, 0], "luxuries" : [0, 0, 165, 8, 8, 58, 3, 3, 0], "narcotics" : [0, 0, 235, 29, 8, 0, 10, 120, 0], "computers" : [0, 0, 130, 14, 14, 60, 3, 3, 0], "machinery" : [0, 0, 100, 6, 6, 55, 7, 7, 0], "alloys" : [0, 0, 85, 1, 1, 25, 31, 31, 0], "firearms" : [0, 0, 124, 13, 13, 29, 7, 7, 0], "furs" : [0, 0, 180, -9, -9, 220, 63, 63, 0], "minerals" : [0, 0, 35, -1, -1, 53, 3, 3, 0], "gold" : [0, 0, 100, -1, -1, 66, 7, 7, 1], "platinum" : [0, 0, 180, -2, -2, 55, 31, 31, 1], "gem_stones" : [0, 0, 48, -1, -1, 250, 15, 15, 2], "alien_items" : [0, 0, 53, 15, 0, 0, 7, 0, 0] } this.$originalBio = { "food" : [0, 0, 16, -2, -2, 12, 1, 1, 0], "textiles" : [0, 0, 24, -1, -1, 12, 3, 3, 0], "radioactives" : [0, 0, 69, -3, -3, 3, 7, 7, 0], "slaves" : [0, 0, 40, -5, -5, 226, 31, 31, 0], "liquor_wines" : [0, 0, 83, -5, -5, 251, 15, 15, 0], "luxuries" : [0, 0, 199, 8, 8, 50, 3, 3, 0], "narcotics" : [0, 0, 235, 29, 6, 2, 10, 120, 0], "computers" : [0, 0, 159, 14, 14, 45, 3, 3, 0], "machinery" : [0, 0, 123, 6, 6, 30, 7, 7, 0], "alloys" : [0, 0, 82, 1, 1, 12, 31, 31, 0], "firearms" : [0, 0, 124, 13, 13, 29, 7, 7, 0], "furs" : [0, 0, 176, -9, -9, 220, 63, 63, 0], "minerals" : [0, 0, 32, -1, -1, 53, 3, 3, 0], "gold" : [0, 0, 97, -1, -1, 66, 7, 7, 1], "platinum" : [0, 0, 171, -2, -2, 55, 31, 31, 1], "gem_stones" : [0, 0, 45, -1, -1, 250, 15, 15, 2], "alien_items" : [0, 0, 53, 15, 0, 0, 7, 0, 0] } this.$originalOther = { "food" : [0, 0, 19, -2, -2, 2, 1, 1, 0], "textiles" : [0, 0, 20, -1, -1, 4, 3, 3, 0], "radioactives" : [0, 0, 65, -3, -3, 1, 7, 7, 0], "slaves" : [0, 0, 40, -5, -5, 226, 31, 31, 0], "liquor_wines" : [0, 0, 83, -5, -5, 245, 15, 15, 0], "luxuries" : [0, 0, 196, 8, 8, 48, 3, 3, 0], "narcotics" : [0, 0, 235, 29, 8, 1, 10, 120, 0], "computers" : [0, 0, 154, 14, 14, 47, 3, 3, 0], "machinery" : [0, 0, 117, 6, 6, 35, 7, 7, 0], "alloys" : [0, 0, 78, 1, 1, 14, 31, 31, 0], "firearms" : [0, 0, 124, 13, 13, 12, 7, 7, 0], "furs" : [0, 0, 176, -9, -9, 200, 63, 63, 0], "minerals" : [0, 0, 32, -1, -1, 33, 3, 3, 0], "gold" : [0, 0, 97, -1, -1, 43, 7, 7, 1], "platinum" : [0, 0, 171, -2, -2, 35, 31, 31, 1], "gem_stones" : [0, 0, 45, -1, -1, 230, 15, 15, 2], "alien_items" : [0, 0, 53, 15, 0, 0, 7, 0, 0] } this.$originalDefault = { "food" : [0, 0, 19, -2, -2, 6, 1, 1, 0], "textiles" : [0, 0, 20, -1, -1, 10, 3, 3, 0], "radioactives" : [0, 0, 65, -3, -3, 2, 7, 7, 0], "slaves" : [0, 0, 40, -5, -5, 226, 31, 31, 0], "liquor_wines" : [0, 0, 83, -5, -5, 251, 15, 15, 0], "luxuries" : [0, 0, 196, 8, 8, 54, 3, 3, 0], "narcotics" : [0, 0, 235, 29, 29, 8, 120, 120, 0], "computers" : [0, 0, 154, 14, 14, 56, 3, 3, 0], "machinery" : [0, 0, 117, 6, 6, 40, 7, 7, 0], "alloys" : [0, 0, 78, 1, 1, 17, 31, 31, 0], "firearms" : [0, 0, 124, 13, 13, 29, 7, 7, 0], "furs" : [0, 0, 176, -9, -9, 220, 63, 63, 0], "minerals" : [0, 0, 32, -1, -1, 53, 3, 3, 0], "gold" : [0, 0, 97, -1, -1, 66, 7, 7, 1], "platinum" : [0, 0, 171, -2, -2, 55, 31, 31, 1], "gem_stones" : [0, 0, 45, -1, -1, 250, 15, 15, 2], "alien_items" : [0, 0, 53, 15, 0, 0, 7, 0, 0] } this.updateLocalCommodityDefinition = function(goodDefinition, station) { var commodity = goodDefinition.key; goodDefinition.capacity = 63; //Research stations if (station.hasRole("wildShips_kiota2Spur") || station.hasRole("wildShips_kiota4Spur")) { var oldDefs = this.$originalResearch[commodity]; } //Manufacturing stations else if (station.hasRole("wildShips_kiota2Disc") || station.hasRole("wildShips_kiota4Disc")) { var oldDefs = this.$originalManufacturing[commodity]; } //Biosphere stations else if (station.hasRole("wildShips_kiota2Sphere") || station.hasRole("wildShips_kiota4Sphere")) { var oldDefs = this.$originalBio[commodity]; } //Other stations else if (station.hasRole("wildShips_kiota2Comms") || station.hasRole("wildShips_kiota4Comms") || station.hasRole("wildShips_kiota2Solar") || station.hasRole("wildShips_kiota4Solar")) { var oldDefs = this.$originalOther[commodity]; } //Stations with the default market else { var oldDefs = this.$originalDefault[commodity]; } //old style definition found for the good. calculate it the old way if (oldDefs) { var market_base_price = oldDefs[2]; var market_eco_adjust_price = oldDefs[3]; var market_eco_adjust_quantity = oldDefs[4]; var market_base_quantity = oldDefs[5]; var market_mask_price = oldDefs[6]; var market_mask_quantity = oldDefs[7]; var market_rnd = Math.floor(Math.random() * 256); var economy = system.economy; var price = (market_base_price + (market_rnd & market_mask_price) + (economy * market_eco_adjust_price)) & 255; price *= 0.4; var quantity = (market_base_quantity + (market_rnd & market_mask_quantity) - (economy * market_eco_adjust_quantity)) & 255; if (quantity > 127) quantity = 0; quantity &= 63; goodDefinition.quantity = quantity; goodDefinition.price = price * 10; } //no definition found. just add some variance to the system market (+/-5%) else { goodDefinition.price = goodDefinition.price * (1.05 - Math.random() * 0.1); goodDefinition.quantity = Math.floor(goodDefinition.quantity * (1.05 - Math.random() * 0.1)); } //scale down if quantity too high if (goodDefinition.quantity > goodDefinition.capacity) goodDefinition.quantity = Math.floor(goodDefinition.quantity / 127 * goodDefinition.capacity); return goodDefinition; }; |