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