mirror of
https://github.com/EDCD/coriolis.git
synced 2025-12-10 07:05:35 +00:00
Compare commits
3 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
c98a73c6a8 | ||
|
|
0116523c63 | ||
|
|
c1afa7c385 |
@@ -211,13 +211,14 @@ angular.module('app').controller('OutfitController', ['$window', '$rootScope', '
|
||||
ship.hardpoints.forEach(function(slot) { ship.use(slot, null, null); });
|
||||
ship.internal.forEach(function(slot) { ship.use(slot, null, null); });
|
||||
ship.useBulkhead(0);
|
||||
ship.use(common[1], common[1].maxClass + 'D', Components.common(1, common[1].maxClass + 'D')); // Thrusters
|
||||
ship.use(common[2], common[2].maxClass + 'A', Components.common(2, common[2].maxClass + 'A')); // FSD
|
||||
ship.use(common[3], common[3].maxClass + 'D', Components.common(3, common[3].maxClass + 'D')); // Life Support
|
||||
ship.use(common[5], common[5].maxClass + 'D', Components.common(5, common[5].maxClass + 'D')); // Sensors
|
||||
|
||||
var pd = $scope.availCS.lightestPowerDist(ship.boostEnergy); // Find lightest Power Distributor that can still boost
|
||||
ship.use(ship.common[4], pd, Components.common(4, pd));
|
||||
var th = $scope.availCS.lightestThruster(ship.ladenMass); // Find lightest Thruster that still works for the ship at max mass
|
||||
ship.use(ship.common[1], th, Components.common(1, th));
|
||||
var pp = $scope.availCS.lightestPowerPlant(ship.powerRetracted); // Find lightest Power plant that can power the ship
|
||||
ship.use(ship.common[0], pp, Components.common(0, pp));
|
||||
|
||||
|
||||
@@ -105,6 +105,18 @@ angular.module('shipyard').factory('ComponentSet', ['lodash', function(_) {
|
||||
return pd.class + pd.rating;
|
||||
};
|
||||
|
||||
ComponentSet.prototype.lightestThruster = function(ladenMass) {
|
||||
var ths = this.common[1];
|
||||
var th = ths[0];
|
||||
|
||||
for (var i = 1; i < ths.length; i++) {
|
||||
if (ths[i].mass < th.mass && ths[i].maxmass >= ladenMass) {
|
||||
th = ths[i];
|
||||
}
|
||||
}
|
||||
return th.class + th.rating;
|
||||
};
|
||||
|
||||
ComponentSet.prototype.lightestPowerPlant = function(powerUsed) {
|
||||
var pps = this.common[0];
|
||||
var pp = null;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "coriolis_shipyard",
|
||||
"version": "1.4.0",
|
||||
"version": "1.4.1",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/cmmcleod/coriolis"
|
||||
|
||||
Reference in New Issue
Block a user