Compare commits

..

11 Commits
1.8.1 ... 1.8.3

Author SHA1 Message Date
Colin McLeod
45b6dabcd2 Bumping version to 1.8.3 2015-10-10 11:47:46 -07:00
Colin McLeod
d476c58a9c Workaround for UI-router bug for build with slash in the name. Fixes #105 2015-10-09 18:29:04 -07:00
Colin McLeod
e837bb68fb Bumping version to 1.8.2 2015-10-09 15:48:54 -07:00
Colin McLeod
e2adc7bdc4 Tweak AFMU for explorer build 2015-10-09 15:44:10 -07:00
Colin McLeod
22716517c5 Remove A-rated build type, now redundant 2015-10-09 15:23:59 -07:00
Colin McLeod
8b82965c12 Fix section quick-fit menu z-index / overlap 2015-10-09 15:23:43 -07:00
Colin McLeod
65cf975a35 Merge pull request #104 from sf302/master
Hull reinforcement auto-fill, hardpoint clobber behavior tweak
2015-10-09 15:09:10 -07:00
Kevin Chang
1c78fea48f Fix behavior for hull reinforcement max at 5D 2015-10-08 22:51:00 -07:00
Kevin Chang
08f49c8339 Fix SCB internal clobber 2015-10-08 19:29:46 -07:00
Kevin Chang
bed81d26b2 Alter auto-fill clobbering behavior for hardpoints 2015-10-08 19:20:17 -07:00
Kevin Chang
38b13fca27 Add armor autofill, prevent internal fill clobber 2015-10-08 18:06:01 -07:00
5 changed files with 29 additions and 36 deletions

View File

@@ -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 {

View File

@@ -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;
}

View File

@@ -53,9 +53,10 @@
.section-menu {
position: relative;
z-index: 1;
z-index: 0;
&.selected {
z-index: 1;
h1 {
background-color: @primary;
}

View File

@@ -108,7 +108,6 @@
</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>

View File

@@ -1,6 +1,6 @@
{
"name": "coriolis_shipyard",
"version": "1.8.1",
"version": "1.8.3",
"repository": {
"type": "git",
"url": "https://github.com/cmmcleod/coriolis"