mirror of
https://github.com/EDCD/coriolis.git
synced 2025-12-09 06:43:24 +00:00
Compare commits
12 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
45b6dabcd2 | ||
|
|
d476c58a9c | ||
|
|
e837bb68fb | ||
|
|
e2adc7bdc4 | ||
|
|
22716517c5 | ||
|
|
8b82965c12 | ||
|
|
65cf975a35 | ||
|
|
1c78fea48f | ||
|
|
08f49c8339 | ||
|
|
bed81d26b2 | ||
|
|
38b13fca27 | ||
|
|
0869230b13 |
@@ -12,7 +12,7 @@ angular.module('app').controller('OutfitController', ['$window', '$rootScope', '
|
||||
ship.buildWith(data.defaults); // Populate with default components
|
||||
}
|
||||
|
||||
$scope.buildName = $p.bn;
|
||||
$scope.buildName = $p.bn ? $window.decodeURIComponent($p.bn) : null;
|
||||
$scope.ships = Ships;
|
||||
$rootScope.title = ship.name + ($scope.buildName ? ' - ' + $scope.buildName : '');
|
||||
$scope.ship = ship;
|
||||
@@ -192,26 +192,6 @@ angular.module('app').controller('OutfitController', ['$window', '$rootScope', '
|
||||
updateState(null);
|
||||
};
|
||||
|
||||
/**
|
||||
* Strip ship to A-class and biggest A-class shield generator with military bulkheads
|
||||
*/
|
||||
$scope.aRatedBuild = function() {
|
||||
ship
|
||||
.useBulkhead(2) // Military Composite
|
||||
.useCommon('A')
|
||||
.emptyHardpoints()
|
||||
.emptyInternal();
|
||||
|
||||
ship.internal.some(function(slot) {
|
||||
if (!slot.eligible || slot.eligible.sg) { // Assuming largest slot can hold an eligible shield
|
||||
var sg = Components.findInternal('sg', slot.maxClass, 'A');
|
||||
ship.use(slot, sg.id, sg);
|
||||
return true;
|
||||
}
|
||||
});
|
||||
updateState(Serializer.fromShip(ship));
|
||||
};
|
||||
|
||||
/**
|
||||
* Optimize for the lower mass build that can still boost and power the ship
|
||||
* without power management.
|
||||
@@ -232,12 +212,12 @@ angular.module('app').controller('OutfitController', ['$window', '$rootScope', '
|
||||
updateState(Serializer.fromShip(ship.useCommon(rating)));
|
||||
};
|
||||
|
||||
$scope.useHardpoint = function(group, mount, missile) {
|
||||
updateState(Serializer.fromShip(ship.useWeapon(group, mount, missile)));
|
||||
$scope.useHardpoint = function(group, mount, clobber, missile) {
|
||||
updateState(Serializer.fromShip(ship.useWeapon(group, mount, clobber, missile)));
|
||||
};
|
||||
|
||||
$scope.useUtility = function(group, rating) {
|
||||
updateState(Serializer.fromShip(ship.useUtility(group, rating)));
|
||||
$scope.useUtility = function(group, rating, clobber) {
|
||||
updateState(Serializer.fromShip(ship.useUtility(group, rating, clobber)));
|
||||
};
|
||||
|
||||
$scope.emptyInternal = function() {
|
||||
@@ -255,7 +235,9 @@ angular.module('app').controller('OutfitController', ['$window', '$rootScope', '
|
||||
$scope.fillWithCargo = function() {
|
||||
ship.internal.forEach(function(slot) {
|
||||
var id = Components.findInternalId('cr', slot.maxClass, 'E');
|
||||
ship.use(slot, id, Components.internal(id));
|
||||
if (!slot.c) {
|
||||
ship.use(slot, id, Components.internal(id));
|
||||
}
|
||||
});
|
||||
updateState(Serializer.fromShip(ship));
|
||||
};
|
||||
@@ -264,7 +246,7 @@ angular.module('app').controller('OutfitController', ['$window', '$rootScope', '
|
||||
var chargeCap = 0; // Capacity of single activation
|
||||
ship.internal.forEach(function(slot) {
|
||||
var id = Components.findInternalId('scb', slot.maxClass, 'A');
|
||||
if ((!slot.c || (slot.c.grp != 'sg' && slot.c.grp != 'psg')) && (!slot.eligible || slot.eligible.scb)) { // Check eligibility because of Orca, don't overwrite generator
|
||||
if (!slot.c && (!slot.eligible || slot.eligible.scb)) { // Check eligibility because of Orca, don't overwrite generator
|
||||
ship.use(slot, id, Components.internal(id));
|
||||
chargeCap += Components.internal(id).recharge;
|
||||
ship.setSlotEnabled(slot, chargeCap <= ship.shieldStrength); // Don't waste cell capacity on overcharge
|
||||
@@ -273,6 +255,16 @@ angular.module('app').controller('OutfitController', ['$window', '$rootScope', '
|
||||
updateState(Serializer.fromShip(ship));
|
||||
};
|
||||
|
||||
$scope.fillWithArmor = function() {
|
||||
ship.internal.forEach(function(slot) {
|
||||
var hr = Components.findInternal('hr', Math.min(slot.maxClass, 5), 'D'); // Hull reinforcements top out at 5D
|
||||
if (!slot.c && hr) {
|
||||
ship.use(slot, hr.id, hr);
|
||||
}
|
||||
});
|
||||
updateState(Serializer.fromShip(ship));
|
||||
};
|
||||
|
||||
/**
|
||||
* Fill all internal slots with Cargo Racks, and optmize internal components.
|
||||
* Hardpoints are not altered.
|
||||
@@ -318,8 +310,8 @@ angular.module('app').controller('OutfitController', ['$window', '$rootScope', '
|
||||
ship.setSlotEnabled(sgSlot, true);
|
||||
} else if (afmUnitCount > 0 && (!slot.eligible || slot.eligible.am)) {
|
||||
afmUnitCount--;
|
||||
var id = Components.findInternalId('am', slot.maxClass, 'A'); // Best AFM Unit for slot
|
||||
ship.use(slot, id, Components.internal(id));
|
||||
var am = Components.findInternal('am', slot.maxClass, afmUnitCount ? 'B' : 'A');
|
||||
ship.use(slot, am.id, am);
|
||||
ship.setSlotEnabled(slot, false); // Disabled power for AFM Unit
|
||||
|
||||
} else {
|
||||
|
||||
@@ -547,24 +547,24 @@ angular.module('shipyard').factory('Ship', ['Components', 'calcShieldStrength',
|
||||
return this;
|
||||
};
|
||||
|
||||
Ship.prototype.useUtility = function(group, rating) {
|
||||
Ship.prototype.useUtility = function(group, rating, clobber) {
|
||||
var component = Components.findHardpoint(group, 0, rating);
|
||||
for (var i = this.hardpoints.length; i--; ) {
|
||||
if (!this.hardpoints[i].maxClass) {
|
||||
if ((clobber || !this.hardpoints[i].c) && !this.hardpoints[i].maxClass) {
|
||||
this.use(this.hardpoints[i], component.id, component);
|
||||
}
|
||||
}
|
||||
return this;
|
||||
};
|
||||
|
||||
Ship.prototype.useWeapon = function(group, mount, missile) {
|
||||
Ship.prototype.useWeapon = function(group, mount, clobber, missile) {
|
||||
var hps = this.hardpoints;
|
||||
for (var i = hps.length; i--; ) {
|
||||
if (hps[i].maxClass) {
|
||||
var size = hps[i].maxClass, component;
|
||||
do {
|
||||
component = Components.findHardpoint(group, size, null, null, mount, missile);
|
||||
if (component) {
|
||||
if ((clobber || !hps[i].c) && component) {
|
||||
this.use(hps[i], component.id, component);
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -53,9 +53,10 @@
|
||||
|
||||
.section-menu {
|
||||
position: relative;
|
||||
z-index: 1;
|
||||
z-index: 0;
|
||||
|
||||
&.selected {
|
||||
z-index: 1;
|
||||
h1 {
|
||||
background-color: @primary;
|
||||
}
|
||||
|
||||
@@ -103,12 +103,11 @@
|
||||
<li class="c" ng-click="useCommon('E')">E</li>
|
||||
<li class="c" ng-click="useCommon('D')">D</li>
|
||||
<li class="c" ng-click="useCommon('C')">C</li>
|
||||
<li class="c" ng-click="useCommon('D')">B</li>
|
||||
<li class="c" ng-click="useCommon('B')">B</li>
|
||||
<li class="c" ng-click="useCommon('A')">A</li>
|
||||
</ul>
|
||||
<div class="select-group cap" translate="builds / roles"></div>
|
||||
<ul>
|
||||
<li class="lc" ng-click="aRatedBuild()" translate="A-Rated"></li>
|
||||
<li class="lc" ng-click="optimizeCargo()" translate="Trader"></li>
|
||||
<li class="lc" ng-click="optimizeExplorer()" translate="Explorer"></li>
|
||||
</ul>
|
||||
@@ -217,6 +216,7 @@
|
||||
<li class="lc" ng-click="emptyInternal()" translate="empty all"></li>
|
||||
<li class="lc" ng-click="fillWithCargo()" translate="cargo"></li>
|
||||
<li class="lc" ng-click="fillWithCells()" translate="scb"></li>
|
||||
<li class="lc" ng-click="fillWithArmor()" translate="hr"></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "coriolis_shipyard",
|
||||
"version": "1.8.0",
|
||||
"version": "1.8.3",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/cmmcleod/coriolis"
|
||||
|
||||
Reference in New Issue
Block a user