mirror of
https://github.com/EDCD/coriolis.git
synced 2025-12-11 00:33:03 +00:00
Compare commits
8 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
b850695715 | ||
|
|
d5af972272 | ||
|
|
8946f9b97c | ||
|
|
348339520d | ||
|
|
f0bdcd5557 | ||
|
|
b1ee0e44f3 | ||
|
|
c96e6afbd7 | ||
|
|
77334341ea |
@@ -52,7 +52,15 @@ angular.module('app').controller('ImportController', ['lodash', '$rootScope', '$
|
|||||||
throw 'builds must be an object!';
|
throw 'builds must be an object!';
|
||||||
}
|
}
|
||||||
if (importData.comparisons) {
|
if (importData.comparisons) {
|
||||||
// TODO: check ship/builds exist for comparison
|
for (var compName in importData.comparisons) {
|
||||||
|
var comparison = importData.comparisons[compName];
|
||||||
|
for (var i = 0, l = comparison.builds.length; i < l; i++) {
|
||||||
|
var build = comparison.builds[i];
|
||||||
|
if (!importData.builds[build.shipId] || !importData.builds[build.shipId][build.buildName]) {
|
||||||
|
throw build.shipId + ' build "' + build.buildName + '" data is missing!';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
$scope.comparisons = importData.comparisons;
|
$scope.comparisons = importData.comparisons;
|
||||||
}
|
}
|
||||||
if (importData.discounts instanceof Array && importData.discounts.length == 2) {
|
if (importData.discounts instanceof Array && importData.discounts.length == 2) {
|
||||||
|
|||||||
@@ -371,6 +371,10 @@ angular.module('app').controller('OutfitController', ['$window', '$rootScope', '
|
|||||||
$scope.costTab = tab;
|
$scope.costTab = tab;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
$scope.pdWarning = function(pd) {
|
||||||
|
return pd.enginecapacity < ship.boostEnergy;
|
||||||
|
};
|
||||||
|
|
||||||
// Hide any open menu/slot/etc if the background is clicked
|
// Hide any open menu/slot/etc if the background is clicked
|
||||||
$scope.$on('close', function() {
|
$scope.$on('close', function() {
|
||||||
$scope.selectedSlot = null;
|
$scope.selectedSlot = null;
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ angular.module('app').directive('componentSelect', function() {
|
|||||||
|
|
||||||
// Generting the HTML in this manner is MUCH faster than using an angular template.
|
// Generting the HTML in this manner is MUCH faster than using an angular template.
|
||||||
|
|
||||||
function appendGroup(list, opts, cid, mass) {
|
function appendGroup(list, opts, cid, mass, checkWarning) {
|
||||||
var prevClass = null, prevRating = null;
|
var prevClass = null, prevRating = null;
|
||||||
for (var i = 0; i < opts.length; i++) {
|
for (var i = 0; i < opts.length; i++) {
|
||||||
var o = opts[i];
|
var o = opts[i];
|
||||||
@@ -18,6 +18,10 @@ angular.module('app').directive('componentSelect', function() {
|
|||||||
list.push(' active');
|
list.push(' active');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (checkWarning && checkWarning(opts[i])) {
|
||||||
|
list.push(' warning');
|
||||||
|
}
|
||||||
|
|
||||||
list.push((o.maxmass && mass > o.maxmass) ? ' disabled"' : '" cpid="', id, '">');
|
list.push((o.maxmass && mass > o.maxmass) ? ' disabled"' : '" cpid="', id, '">');
|
||||||
|
|
||||||
if (o.mode) {
|
if (o.mode) {
|
||||||
@@ -47,7 +51,8 @@ angular.module('app').directive('componentSelect', function() {
|
|||||||
opts: '=', // Component Options object
|
opts: '=', // Component Options object
|
||||||
groups: '=', // Groups of Component Options
|
groups: '=', // Groups of Component Options
|
||||||
mass: '=', // Current ship unladen mass
|
mass: '=', // Current ship unladen mass
|
||||||
s: '=' // Current Slot
|
s: '=', // Current Slot
|
||||||
|
warning: '=' // Check warning function
|
||||||
},
|
},
|
||||||
link: function(scope, element) {
|
link: function(scope, element) {
|
||||||
var list = [];
|
var list = [];
|
||||||
@@ -64,12 +69,12 @@ angular.module('app').directive('componentSelect', function() {
|
|||||||
var grp = groups[g];
|
var grp = groups[g];
|
||||||
var grpCode = grp[Object.keys(grp)[0]].grp; // Nasty operation to get the grp property of the first/any single component
|
var grpCode = grp[Object.keys(grp)[0]].grp; // Nasty operation to get the grp property of the first/any single component
|
||||||
list.push('<div id="', grpCode, '" class="select-group">', g, '</div><ul>');
|
list.push('<div id="', grpCode, '" class="select-group">', g, '</div><ul>');
|
||||||
appendGroup(list, grp, cid, mass);
|
appendGroup(list, grp, cid, mass, scope.warning);
|
||||||
list.push('</ul>');
|
list.push('</ul>');
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
list.push('<ul>');
|
list.push('<ul>');
|
||||||
appendGroup(list, opts, cid, mass);
|
appendGroup(list, opts, cid, mass, scope.warning);
|
||||||
list.push('</ul>');
|
list.push('</ul>');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -6,6 +6,13 @@ angular.module('shipyard').factory('ComponentSet', ['lodash', function(_) {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function getKey(maxClass, eligible) {
|
||||||
|
if (eligible) {
|
||||||
|
return maxClass + Object.keys(eligible).join('-');
|
||||||
|
}
|
||||||
|
return maxClass;
|
||||||
|
}
|
||||||
|
|
||||||
function ComponentSet(components, mass, maxCommonArr, maxInternal, maxHardPoint) {
|
function ComponentSet(components, mass, maxCommonArr, maxInternal, maxHardPoint) {
|
||||||
this.mass = mass;
|
this.mass = mass;
|
||||||
this.common = {};
|
this.common = {};
|
||||||
@@ -36,33 +43,56 @@ angular.module('shipyard').factory('ComponentSet', ['lodash', function(_) {
|
|||||||
for (var g in components.internal) {
|
for (var g in components.internal) {
|
||||||
this.internal[g] = filter(components.internal[g], maxInternal, 0, mass);
|
this.internal[g] = filter(components.internal[g], maxInternal, 0, mass);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
ComponentSet.prototype.getHps = function(c) {
|
/**
|
||||||
if (!this.hpClass[c]) {
|
* Create a memoized function for determining the components that are
|
||||||
var o = this.hpClass[c] = {};
|
* eligible for an internal slot
|
||||||
for (var key in this.hardpoints) {
|
* @param {integer} c The max class component that can be mounted in the slot
|
||||||
var data = filter(this.hardpoints[key], c, c ? 1 : 0, this.mass);
|
* @param {Object} eligible) The map of eligible internal groups
|
||||||
if (data.length) { // If group is not empty
|
* @return {object} A map of all eligible components by group
|
||||||
o[key] = data;
|
*/
|
||||||
}
|
this.getInts = _.memoize(
|
||||||
}
|
function(c, eligible) {
|
||||||
}
|
var o = {};
|
||||||
return this.hpClass[c];
|
|
||||||
};
|
|
||||||
|
|
||||||
ComponentSet.prototype.getInts = function(c) {
|
|
||||||
if (!this.intClass[c]) {
|
|
||||||
var o = this.intClass[c] = {};
|
|
||||||
for (var key in this.internal) {
|
for (var key in this.internal) {
|
||||||
|
if (eligible && !eligible[key]) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
var data = filter(this.internal[key], c, 0, this.mass);
|
var data = filter(this.internal[key], c, 0, this.mass);
|
||||||
if (data.length) { // If group is not empty
|
if (data.length) { // If group is not empty
|
||||||
o[key] = data;
|
o[key] = data;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
return o;
|
||||||
|
},
|
||||||
|
getKey
|
||||||
|
);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Create a memoized function for determining the components that are
|
||||||
|
* eligible for an hardpoint slot
|
||||||
|
* @param {integer} c The max class component that can be mounted in the slot
|
||||||
|
* @param {Object} eligible) The map of eligible hardpoint groups
|
||||||
|
* @return {object} A map of all eligible components by group
|
||||||
|
*/
|
||||||
|
this.getHps = _.memoize(
|
||||||
|
function(c, eligible) {
|
||||||
|
var o = {};
|
||||||
|
for (var key in this.hardpoints) {
|
||||||
|
if (eligible && !eligible[key]) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
var data = filter(this.hardpoints[key], c, c ? 1 : 0, this.mass);
|
||||||
|
if (data.length) { // If group is not empty
|
||||||
|
o[key] = data;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return o;
|
||||||
|
},
|
||||||
|
getKey
|
||||||
|
);
|
||||||
|
|
||||||
}
|
}
|
||||||
return this.intClass[c];
|
|
||||||
};
|
|
||||||
|
|
||||||
return ComponentSet;
|
return ComponentSet;
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
angular.module('shipyard').factory('Ship', ['Components', 'calcShieldStrength', 'calcJumpRange', 'calcTotalRange', 'lodash', function(Components, calcShieldStrength, calcJumpRange, calcTotalRange, _) {
|
angular.module('shipyard').factory('Ship', ['Components', 'calcShieldStrength', 'calcJumpRange', 'calcTotalRange', 'lodash', 'ArmourMultiplier', function(Components, calcShieldStrength, calcJumpRange, calcTotalRange, _, ArmourMultiplier) {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the power usage type of a slot and it's particular component
|
* Returns the power usage type of a slot and it's particular component
|
||||||
@@ -36,9 +36,13 @@ angular.module('shipyard').factory('Ship', ['Components', 'calcShieldStrength',
|
|||||||
var slotGroup = slots[slotType];
|
var slotGroup = slots[slotType];
|
||||||
var group = this[slotType] = []; // Initialize Slot group (Common, Hardpoints, Internal)
|
var group = this[slotType] = []; // Initialize Slot group (Common, Hardpoints, Internal)
|
||||||
for (var i = 0; i < slotGroup.length; i++) {
|
for (var i = 0; i < slotGroup.length; i++) {
|
||||||
|
if (typeof slotGroup[i] == 'object') {
|
||||||
|
group.push({ id: null, c: null, incCost: true, maxClass: slotGroup[i].class, eligible: slotGroup[i].eligible });
|
||||||
|
} else {
|
||||||
group.push({ id: null, c: null, incCost: true, maxClass: slotGroup[i] });
|
group.push({ id: null, c: null, incCost: true, maxClass: slotGroup[i] });
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
// Make a Ship 'slot'/item similar to other slots
|
// Make a Ship 'slot'/item similar to other slots
|
||||||
this.c = { incCost: true, type: 'SHIP', discountedCost: this.hullCost, c: { name: this.name, cost: this.hullCost } };
|
this.c = { incCost: true, type: 'SHIP', discountedCost: this.hullCost, c: { name: this.name, cost: this.hullCost } };
|
||||||
|
|
||||||
@@ -84,10 +88,10 @@ angular.module('shipyard').factory('Ship', ['Components', 'calcShieldStrength',
|
|||||||
this.cargoCapacity = 0;
|
this.cargoCapacity = 0;
|
||||||
this.ladenMass = 0;
|
this.ladenMass = 0;
|
||||||
this.armourAdded = 0;
|
this.armourAdded = 0;
|
||||||
|
this.armourMultiplier = 1;
|
||||||
this.shieldMultiplier = 1;
|
this.shieldMultiplier = 1;
|
||||||
this.totalCost = this.c.incCost ? this.c.discountedCost : 0;
|
this.totalCost = this.c.incCost ? this.c.discountedCost : 0;
|
||||||
this.unladenMass = this.hullMass;
|
this.unladenMass = this.hullMass;
|
||||||
this.armour = this.baseArmour;
|
|
||||||
this.totalDps = 0;
|
this.totalDps = 0;
|
||||||
|
|
||||||
this.bulkheads.c = null;
|
this.bulkheads.c = null;
|
||||||
@@ -158,6 +162,7 @@ angular.module('shipyard').factory('Ship', ['Components', 'calcShieldStrength',
|
|||||||
this.bulkheads.id = index;
|
this.bulkheads.id = index;
|
||||||
this.bulkheads.c = Components.bulkheads(this.id, index);
|
this.bulkheads.c = Components.bulkheads(this.id, index);
|
||||||
this.bulkheads.discountedCost = this.bulkheads.c.cost * this.componentCostMultiplier;
|
this.bulkheads.discountedCost = this.bulkheads.c.cost * this.componentCostMultiplier;
|
||||||
|
this.armourMultiplier = ArmourMultiplier[index];
|
||||||
this.updateStats(this.bulkheads, this.bulkheads.c, oldBulkhead, preventUpdate);
|
this.updateStats(this.bulkheads, this.bulkheads.c, oldBulkhead, preventUpdate);
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -359,7 +364,7 @@ angular.module('shipyard').factory('Ship', ['Components', 'calcShieldStrength',
|
|||||||
}
|
}
|
||||||
|
|
||||||
this.ladenMass = this.unladenMass + this.cargoCapacity + this.fuelCapacity;
|
this.ladenMass = this.unladenMass + this.cargoCapacity + this.fuelCapacity;
|
||||||
this.armour = this.armourAdded + this.baseArmour;
|
this.armour = this.armourAdded + Math.round(this.baseArmour * this.armourMultiplier);
|
||||||
|
|
||||||
if (!preventUpdate) {
|
if (!preventUpdate) {
|
||||||
if (powerChange) {
|
if (powerChange) {
|
||||||
|
|||||||
@@ -10,6 +10,13 @@ angular.module('shipyard', ['ngLodash'])
|
|||||||
// Create 'angularized' references to DB.This will aid testing
|
// Create 'angularized' references to DB.This will aid testing
|
||||||
.constant('ShipsDB', DB.ships)
|
.constant('ShipsDB', DB.ships)
|
||||||
.constant('ComponentsDB', DB.components)
|
.constant('ComponentsDB', DB.components)
|
||||||
|
.value('ArmourMultiplier', [
|
||||||
|
1, // Lightweight
|
||||||
|
1.4, // Reinforced
|
||||||
|
1.945, // Military
|
||||||
|
1.945, // Mirrored
|
||||||
|
1.945 // Reactive
|
||||||
|
])
|
||||||
.value('commonArray', [
|
.value('commonArray', [
|
||||||
'Power Plant',
|
'Power Plant',
|
||||||
'Thrusters',
|
'Thrusters',
|
||||||
|
|||||||
@@ -90,7 +90,8 @@ angular.module('shipyard').service('Components', ['lodash', 'ComponentsDB', 'Shi
|
|||||||
*/
|
*/
|
||||||
this.forShip = function(shipId) {
|
this.forShip = function(shipId) {
|
||||||
var ship = Ships[shipId];
|
var ship = Ships[shipId];
|
||||||
return new ComponentSet(C, ship.minMassFilter || ship.properties.hullMass + 5, ship.slots.common, ship.slots.internal[0], ship.slots.hardpoints[0]);
|
var maxInternal = isNaN(ship.slots.internal[0]) ? ship.slots.internal[0].class : ship.slots.internal[0];
|
||||||
|
return new ComponentSet(C, ship.minMassFilter || ship.properties.hullMass + 5, ship.slots.common, maxInternal, ship.slots.hardpoints[0]);
|
||||||
};
|
};
|
||||||
|
|
||||||
}]);
|
}]);
|
||||||
|
|||||||
@@ -66,3 +66,7 @@
|
|||||||
color: @warning-disabled;
|
color: @warning-disabled;
|
||||||
fill: @warning-disabled;
|
fill: @warning-disabled;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.bg-warning-disabled {
|
||||||
|
background-color: @warning-disabled;
|
||||||
|
}
|
||||||
|
|||||||
@@ -77,18 +77,10 @@ select {
|
|||||||
stroke: @primary-disabled;
|
stroke: @primary-disabled;
|
||||||
|
|
||||||
&:hover {
|
&:hover {
|
||||||
|
border-color: @primary;
|
||||||
color: @primary;
|
color: @primary;
|
||||||
stroke: @primary;
|
stroke: @primary;
|
||||||
}
|
}
|
||||||
&.disabled {
|
|
||||||
cursor: not-allowed;
|
|
||||||
color: @disabled;
|
|
||||||
stroke: @disabled;
|
|
||||||
}
|
|
||||||
&.active {
|
|
||||||
color: @secondary;
|
|
||||||
stroke: @secondary;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.lc, .c {
|
.lc, .c {
|
||||||
@@ -96,15 +88,27 @@ select {
|
|||||||
padding: 0.1em 0.2em;
|
padding: 0.1em 0.2em;
|
||||||
margin: 0.3em;
|
margin: 0.3em;
|
||||||
|
|
||||||
|
&.warning {
|
||||||
|
border-color: @warning-disabled;
|
||||||
|
color: @warning-disabled;
|
||||||
|
stroke: @warning-disabled;
|
||||||
|
|
||||||
&:hover {
|
&:hover {
|
||||||
border:1px solid @primary;
|
border-color: @warning;
|
||||||
|
color: @warning;
|
||||||
|
stroke: @warning;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
&.disabled {
|
&.disabled {
|
||||||
border:1px solid @disabled;
|
border-color: @disabled;
|
||||||
|
color: @disabled;
|
||||||
|
stroke: @disabled;
|
||||||
}
|
}
|
||||||
&.active {
|
&.active {
|
||||||
border:1px solid @secondary;
|
border-color: @secondary;
|
||||||
|
color: @secondary;
|
||||||
|
stroke: @secondary;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -32,7 +32,7 @@
|
|||||||
<th rowspan="2">Size</th>
|
<th rowspan="2">Size</th>
|
||||||
<th rowspan="2">Agility</th>
|
<th rowspan="2">Agility</th>
|
||||||
<th rowspan="2">Speed</th>
|
<th rowspan="2">Speed</th>
|
||||||
<th rowspan="2">Boost</th>
|
<th rowspan="2" ng-class="{'bg-warning-disabled': pd.c.enginecapacity < ship.boostEnergy}">Boost</th>
|
||||||
<th rowspan="2">DPS</th>
|
<th rowspan="2">DPS</th>
|
||||||
<th rowspan="2">Armour</th>
|
<th rowspan="2">Armour</th>
|
||||||
<th rowspan="2">Shields</th>
|
<th rowspan="2">Shields</th>
|
||||||
@@ -60,9 +60,16 @@
|
|||||||
<td ng-bind="SZ[ship.class]"></td>
|
<td ng-bind="SZ[ship.class]"></td>
|
||||||
<td>{{ship.agility}}/10</td>
|
<td>{{ship.agility}}/10</td>
|
||||||
<td>{{fRound(ship.speed)}} <u>m/s</u></td>
|
<td>{{fRound(ship.speed)}} <u>m/s</u></td>
|
||||||
<td>{{fRound(ship.boost)}} <u>m/s</u></td>
|
<td>
|
||||||
|
<span ng-if="pd.c.enginecapacity >= ship.boostEnergy">{{fRound(ship.boost)}} <u>m/s</u></span>
|
||||||
|
<span class="warning" ng-if="pd.c.enginecapacity < ship.boostEnergy">0 <svg class="icon"><use xlink:href="#warning"></use></svg></span>
|
||||||
|
</td>
|
||||||
<td>{{fRound(ship.totalDps)}}</td>
|
<td>{{fRound(ship.totalDps)}}</td>
|
||||||
<td>{{ship.armour}} <span ng-if="ship.armourAdded">({{ship.baseArmour}} + {{ship.armourAdded}})</span></td>
|
<td>
|
||||||
|
{{ship.armour}}
|
||||||
|
<span ng-if="ship.armourAdded || ship.armourMultiplier > 1">(<span ng-if="ship.armourMultiplier > 1">{{fRPct(ship.armourMultiplier)}}</span>
|
||||||
|
<span ng-if="ship.armourAdded">+ {{ship.armourAdded}}</span>)</span>
|
||||||
|
</td>
|
||||||
<td>{{fRound(ship.shieldStrength)}} <u>MJ</u> <span ng-if="ship.shieldMultiplier > 1 && ship.shieldStrength > 0">({{fRPct(ship.shieldMultiplier)}})</span></td>
|
<td>{{fRound(ship.shieldStrength)}} <u>MJ</u> <span ng-if="ship.shieldMultiplier > 1 && ship.shieldStrength > 0">({{fRPct(ship.shieldMultiplier)}})</span></td>
|
||||||
<td>{{ship.hullMass}} <u>T</u></td>
|
<td>{{ship.hullMass}} <u>T</u></td>
|
||||||
<td>{{fRound(ship.unladenMass)}} <u>T</u></td>
|
<td>{{fRound(ship.unladenMass)}} <u>T</u></td>
|
||||||
@@ -144,7 +151,7 @@
|
|||||||
<div component-select class="select" s="ls" opts="availCS.common[3]" ng-if="selectedSlot==ls" ng-click="select('c',ls,$event)"></div>
|
<div component-select class="select" s="ls" opts="availCS.common[3]" ng-if="selectedSlot==ls" ng-click="select('c',ls,$event)"></div>
|
||||||
</div>
|
</div>
|
||||||
<div class="slot" ng-click="selectSlot($event, pd)" ng-class="{selected: selectedSlot==pd}">
|
<div class="slot" ng-click="selectSlot($event, pd)" ng-class="{selected: selectedSlot==pd}">
|
||||||
<div class="details">
|
<div class="details" ng-class="{warning: pd.c.enginecapacity < ship.boostEnergy}">
|
||||||
<div class="sz">{{::pd.maxClass}}</div>
|
<div class="sz">{{::pd.maxClass}}</div>
|
||||||
<div class="l">{{pd.id}} Power Distributor</div>
|
<div class="l">{{pd.id}} Power Distributor</div>
|
||||||
<div class="r">{{pd.c.mass}} <u>T</u></div>
|
<div class="r">{{pd.c.mass}} <u>T</u></div>
|
||||||
@@ -153,7 +160,7 @@
|
|||||||
<div class="l">SYS: {{pd.c.systemcapacity}} <u>MJ</u> / {{pd.c.systemrecharge}} <u>MW</u></div>
|
<div class="l">SYS: {{pd.c.systemcapacity}} <u>MJ</u> / {{pd.c.systemrecharge}} <u>MW</u></div>
|
||||||
<div class="l">ENG: {{pd.c.enginecapacity}} <u>MJ</u> / {{pd.c.enginerecharge}} <u>MW</u></div>
|
<div class="l">ENG: {{pd.c.enginecapacity}} <u>MJ</u> / {{pd.c.enginerecharge}} <u>MW</u></div>
|
||||||
</div>
|
</div>
|
||||||
<div component-select class="select" s="pd" opts="availCS.common[4]" ng-if="selectedSlot==pd" ng-click="select('c',pd,$event)"></div>
|
<div component-select class="select" s="pd" warning="pdWarning" opts="availCS.common[4]" ng-if="selectedSlot==pd" ng-click="select('c',pd,$event)"></div>
|
||||||
</div>
|
</div>
|
||||||
<div class="slot" ng-click="selectSlot($event, ss)" ng-class="{selected: selectedSlot==ss}">
|
<div class="slot" ng-click="selectSlot($event, ss)" ng-class="{selected: selectedSlot==ss}">
|
||||||
<div class="details">
|
<div class="details">
|
||||||
@@ -180,7 +187,7 @@
|
|||||||
<div class="slot" ng-repeat="i in ship.internal" ng-click="selectSlot($event, i)" context-menu="select('i', i, $event, 'empty')" ng-class="{selected: selectedSlot==i}">
|
<div class="slot" ng-repeat="i in ship.internal" ng-click="selectSlot($event, i)" context-menu="select('i', i, $event, 'empty')" ng-class="{selected: selectedSlot==i}">
|
||||||
<div slot-internal class="details" slot="i" lbl="GMAP[i.c.grp]" fuel="ship.fuelCapacity"></div>
|
<div slot-internal class="details" slot="i" lbl="GMAP[i.c.grp]" fuel="ship.fuelCapacity"></div>
|
||||||
<div class="select" ng-if="selectedSlot==i" ng-click="select('i',i,$event)">
|
<div class="select" ng-if="selectedSlot==i" ng-click="select('i',i,$event)">
|
||||||
<div component-select s="i" groups="availCS.getInts(i.maxClass)"></div>
|
<div component-select s="i" groups="availCS.getInts(i.maxClass, i.eligible)"></div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -6,6 +6,7 @@
|
|||||||
{ "id": "p3", "grp": "psg", "class": 4, "rating": "A", "cost": 2415120, "mass": 20, "power": 4.62, "minmass": 143, "optmass": 285, "maxmass": 713, "minmul": 2.04, "optmul": 1.44, "maxmul": 0.84 },
|
{ "id": "p3", "grp": "psg", "class": 4, "rating": "A", "cost": 2415120, "mass": 20, "power": 4.62, "minmass": 143, "optmass": 285, "maxmass": 713, "minmul": 2.04, "optmul": 1.44, "maxmul": 0.84 },
|
||||||
{ "id": "p2", "grp": "psg", "class": 5, "rating": "A", "cost": 7655930, "mass": 40, "power": 5.46, "minmass": 203, "optmass": 405, "maxmass": 1013, "minmul": 2.04, "optmul": 1.44, "maxmul": 0.84 },
|
{ "id": "p2", "grp": "psg", "class": 5, "rating": "A", "cost": 7655930, "mass": 40, "power": 5.46, "minmass": 203, "optmass": 405, "maxmass": 1013, "minmul": 2.04, "optmul": 1.44, "maxmul": 0.84 },
|
||||||
{ "id": "p1", "grp": "psg", "class": 6, "rating": "A", "cost": 24269297, "mass": 80, "power": 6.51, "minmass": 270, "optmass": 540, "maxmass": 1350, "minmul": 2.04, "optmul": 1.44, "maxmul": 0.84 },
|
{ "id": "p1", "grp": "psg", "class": 6, "rating": "A", "cost": 24269297, "mass": 80, "power": 6.51, "minmass": 270, "optmass": 540, "maxmass": 1350, "minmul": 2.04, "optmul": 1.44, "maxmul": 0.84 },
|
||||||
{ "id": "p0", "grp": "psg", "class": 7, "rating": "A", "cost": 76933668, "mass": 160, "power": 7.35, "minmass": 530, "optmass": 1060, "maxmass": 2650, "minmul": 2.04, "optmul": 1.44, "maxmul": 0.84 }
|
{ "id": "p0", "grp": "psg", "class": 7, "rating": "A", "cost": 76933668, "mass": 160, "power": 7.35, "minmass": 530, "optmass": 1060, "maxmass": 2650, "minmul": 2.04, "optmul": 1.44, "maxmul": 0.84 },
|
||||||
|
{ "id": "p7", "grp": "psg", "class": 8, "rating": "A", "cost": 243879729, "mass": 320, "power": 8.4, "minmass": 900, "optmass": 1800, "maxmass": 4500, "minmul": 2.04, "optmul": 1.44, "maxmul": 0.84 }
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -7,6 +7,7 @@
|
|||||||
"hullCost": 39993,
|
"hullCost": 39993,
|
||||||
"speed": 220,
|
"speed": 220,
|
||||||
"boost": 320,
|
"boost": 320,
|
||||||
|
"boostEnergy": 9,
|
||||||
"agility": 8,
|
"agility": 8,
|
||||||
"baseShieldStrength": 60,
|
"baseShieldStrength": 60,
|
||||||
"baseArmour": 162,
|
"baseArmour": 162,
|
||||||
|
|||||||
@@ -7,6 +7,7 @@
|
|||||||
"hullCost": 141889932,
|
"hullCost": 141889932,
|
||||||
"speed": 180,
|
"speed": 180,
|
||||||
"boost": 240,
|
"boost": 240,
|
||||||
|
"boostEnergy": 29,
|
||||||
"agility": 2,
|
"agility": 2,
|
||||||
"baseShieldStrength": 350,
|
"baseShieldStrength": 350,
|
||||||
"baseArmour": 945,
|
"baseArmour": 945,
|
||||||
|
|||||||
@@ -7,6 +7,7 @@
|
|||||||
"hullCost": 6135658,
|
"hullCost": 6135658,
|
||||||
"speed": 250,
|
"speed": 250,
|
||||||
"boost": 340,
|
"boost": 340,
|
||||||
|
"boostEnergy": 14,
|
||||||
"agility": 6,
|
"agility": 6,
|
||||||
"baseShieldStrength": 140,
|
"baseShieldStrength": 140,
|
||||||
"baseArmour": 378,
|
"baseArmour": 378,
|
||||||
|
|||||||
@@ -7,6 +7,7 @@
|
|||||||
"hullCost": 235787,
|
"hullCost": 235787,
|
||||||
"speed": 280,
|
"speed": 280,
|
||||||
"boost": 400,
|
"boost": 400,
|
||||||
|
"boostEnergy": 11,
|
||||||
"agility": 6,
|
"agility": 6,
|
||||||
"baseShieldStrength": 80,
|
"baseShieldStrength": 80,
|
||||||
"baseArmour": 216,
|
"baseArmour": 216,
|
||||||
|
|||||||
@@ -7,6 +7,7 @@
|
|||||||
"hullCost": 461341,
|
"hullCost": 461341,
|
||||||
"speed": 283,
|
"speed": 283,
|
||||||
"boost": 384,
|
"boost": 384,
|
||||||
|
"boostEnergy": 11,
|
||||||
"agility": 8,
|
"agility": 8,
|
||||||
"baseShieldStrength": 118,
|
"baseShieldStrength": 118,
|
||||||
"baseArmour": 216,
|
"baseArmour": 216,
|
||||||
|
|||||||
@@ -7,6 +7,7 @@
|
|||||||
"hullCost": 1635691,
|
"hullCost": 1635691,
|
||||||
"speed": 242,
|
"speed": 242,
|
||||||
"boost": 316,
|
"boost": 316,
|
||||||
|
"boostEnergy": 14,
|
||||||
"agility": 5,
|
"agility": 5,
|
||||||
"baseShieldStrength": 146,
|
"baseShieldStrength": 146,
|
||||||
"baseArmour": 270,
|
"baseArmour": 270,
|
||||||
|
|||||||
@@ -7,6 +7,7 @@
|
|||||||
"hullCost": 10446,
|
"hullCost": 10446,
|
||||||
"speed": 240,
|
"speed": 240,
|
||||||
"boost": 350,
|
"boost": 350,
|
||||||
|
"boostEnergy": 9,
|
||||||
"agility": 10,
|
"agility": 10,
|
||||||
"baseShieldStrength": 60,
|
"baseShieldStrength": 60,
|
||||||
"baseArmour": 72,
|
"baseArmour": 72,
|
||||||
|
|||||||
@@ -7,6 +7,7 @@
|
|||||||
"hullCost": 18969990,
|
"hullCost": 18969990,
|
||||||
"speed": 180,
|
"speed": 180,
|
||||||
"boost": 300,
|
"boost": 300,
|
||||||
|
"boostEnergy": 21,
|
||||||
"agility": 2,
|
"agility": 2,
|
||||||
"baseShieldStrength": 200,
|
"baseShieldStrength": 200,
|
||||||
"baseArmour": 540,
|
"baseArmour": 540,
|
||||||
|
|||||||
@@ -7,6 +7,7 @@
|
|||||||
"hullCost": 51232230,
|
"hullCost": 51232230,
|
||||||
"speed": 260,
|
"speed": 260,
|
||||||
"boost": 350,
|
"boost": 350,
|
||||||
|
"boostEnergy": 21,
|
||||||
"agility": 6,
|
"agility": 6,
|
||||||
"baseShieldStrength": 300,
|
"baseShieldStrength": 300,
|
||||||
"baseArmour": 405,
|
"baseArmour": 405,
|
||||||
|
|||||||
@@ -8,6 +8,7 @@
|
|||||||
"speed": 200,
|
"speed": 200,
|
||||||
"boost": 300,
|
"boost": 300,
|
||||||
"agility": 6,
|
"agility": 6,
|
||||||
|
"boostEnergy": 7,
|
||||||
"baseShieldStrength": 50,
|
"baseShieldStrength": 50,
|
||||||
"baseArmour": 90,
|
"baseArmour": 90,
|
||||||
"hullMass": 14,
|
"hullMass": 14,
|
||||||
|
|||||||
@@ -7,6 +7,7 @@
|
|||||||
"hullCost": 21077784,
|
"hullCost": 21077784,
|
||||||
"speed": 300,
|
"speed": 300,
|
||||||
"boost": 380,
|
"boost": 380,
|
||||||
|
"boostEnergy": 21,
|
||||||
"agility": 2,
|
"agility": 2,
|
||||||
"baseShieldStrength": 180,
|
"baseShieldStrength": 180,
|
||||||
"baseArmour": 486,
|
"baseArmour": 486,
|
||||||
|
|||||||
@@ -7,6 +7,7 @@
|
|||||||
"hullCost": 2481552,
|
"hullCost": 2481552,
|
||||||
"speed": 277,
|
"speed": 277,
|
||||||
"boost": 380,
|
"boost": 380,
|
||||||
|
"boostEnergy": 11,
|
||||||
"agility": 6,
|
"agility": 6,
|
||||||
"baseShieldStrength": 197,
|
"baseShieldStrength": 197,
|
||||||
"baseArmour": 144,
|
"baseArmour": 144,
|
||||||
|
|||||||
@@ -7,6 +7,7 @@
|
|||||||
"hullCost": 47798079,
|
"hullCost": 47798079,
|
||||||
"speed": 300,
|
"speed": 300,
|
||||||
"boost": 380,
|
"boost": 380,
|
||||||
|
"boostEnergy": 17,
|
||||||
"agility": 2,
|
"agility": 2,
|
||||||
"baseShieldStrength": 220,
|
"baseShieldStrength": 220,
|
||||||
"baseArmour": 396,
|
"baseArmour": 396,
|
||||||
@@ -34,8 +35,8 @@
|
|||||||
0
|
0
|
||||||
],
|
],
|
||||||
"internal": [
|
"internal": [
|
||||||
6,
|
{ "class": 6, "eligible": { "Cargo Rack": 1, "Hull Reinforcement Package": 1 } },
|
||||||
5,
|
{ "class": 5, "eligible": { "Cargo Rack": 1, "Hull Reinforcement Package": 1 } },
|
||||||
5,
|
5,
|
||||||
5,
|
5,
|
||||||
4,
|
4,
|
||||||
|
|||||||
@@ -7,6 +7,7 @@
|
|||||||
"hullCost": 55171395,
|
"hullCost": 55171395,
|
||||||
"speed": 230,
|
"speed": 230,
|
||||||
"boost": 280,
|
"boost": 280,
|
||||||
|
"boostEnergy": 24,
|
||||||
"agility": 6,
|
"agility": 6,
|
||||||
"baseShieldStrength": 260,
|
"baseShieldStrength": 260,
|
||||||
"baseArmour": 468,
|
"baseArmour": 468,
|
||||||
|
|||||||
@@ -7,6 +7,7 @@
|
|||||||
"hullCost": 12887,
|
"hullCost": 12887,
|
||||||
"speed": 220,
|
"speed": 220,
|
||||||
"boost": 320,
|
"boost": 320,
|
||||||
|
"boostEnergy": 7,
|
||||||
"agility": 8,
|
"agility": 8,
|
||||||
"baseShieldStrength": 40,
|
"baseShieldStrength": 40,
|
||||||
"baseArmour": 108,
|
"baseArmour": 108,
|
||||||
|
|||||||
@@ -7,6 +7,7 @@
|
|||||||
"hullCost": 865782,
|
"hullCost": 865782,
|
||||||
"speed": 220,
|
"speed": 220,
|
||||||
"boost": 350,
|
"boost": 350,
|
||||||
|
"boostEnergy": 11,
|
||||||
"agility": 3,
|
"agility": 3,
|
||||||
"baseShieldStrength": 90,
|
"baseShieldStrength": 90,
|
||||||
"baseArmour": 162,
|
"baseArmour": 162,
|
||||||
|
|||||||
@@ -7,6 +7,7 @@
|
|||||||
"hullCost": 16881511,
|
"hullCost": 16881511,
|
||||||
"speed": 180,
|
"speed": 180,
|
||||||
"boost": 300,
|
"boost": 300,
|
||||||
|
"boostEnergy": 11,
|
||||||
"agility": 2,
|
"agility": 2,
|
||||||
"baseShieldStrength": 120,
|
"baseShieldStrength": 120,
|
||||||
"baseArmour": 216,
|
"baseArmour": 216,
|
||||||
|
|||||||
@@ -7,6 +7,7 @@
|
|||||||
"hullCost": 73255168,
|
"hullCost": 73255168,
|
||||||
"speed": 130,
|
"speed": 130,
|
||||||
"boost": 200,
|
"boost": 200,
|
||||||
|
"boostEnergy": 21,
|
||||||
"agility": 0,
|
"agility": 0,
|
||||||
"baseShieldStrength": 240,
|
"baseShieldStrength": 240,
|
||||||
"baseArmour": 432,
|
"baseArmour": 432,
|
||||||
|
|||||||
@@ -7,6 +7,7 @@
|
|||||||
"hullCost": 95893,
|
"hullCost": 95893,
|
||||||
"speed": 320,
|
"speed": 320,
|
||||||
"boost": 400,
|
"boost": 400,
|
||||||
|
"boostEnergy": 11,
|
||||||
"agility": 6,
|
"agility": 6,
|
||||||
"baseShieldStrength": 105,
|
"baseShieldStrength": 105,
|
||||||
"baseArmour": 126,
|
"baseArmour": 126,
|
||||||
|
|||||||
@@ -7,6 +7,7 @@
|
|||||||
"hullCost": 4689629,
|
"hullCost": 4689629,
|
||||||
"speed": 210,
|
"speed": 210,
|
||||||
"boost": 340,
|
"boost": 340,
|
||||||
|
"boostEnergy": 17,
|
||||||
"agility": 9,
|
"agility": 9,
|
||||||
"baseShieldStrength": 240,
|
"baseShieldStrength": 240,
|
||||||
"baseArmour": 288,
|
"baseArmour": 288,
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "coriolis_shipyard",
|
"name": "coriolis_shipyard",
|
||||||
"version": "1.2.0",
|
"version": "1.3.1",
|
||||||
"repository": {
|
"repository": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://github.com/cmmcleod/coriolis"
|
"url": "https://github.com/cmmcleod/coriolis"
|
||||||
|
|||||||
@@ -188,6 +188,7 @@
|
|||||||
"hullCost": 141889932,
|
"hullCost": 141889932,
|
||||||
"speed": 180,
|
"speed": 180,
|
||||||
"boost": 240,
|
"boost": 240,
|
||||||
|
"boostEnergy": 29,
|
||||||
"agility": 2,
|
"agility": 2,
|
||||||
"baseShieldStrength": 350,
|
"baseShieldStrength": 350,
|
||||||
"baseArmour": 945,
|
"baseArmour": 945,
|
||||||
@@ -198,11 +199,12 @@
|
|||||||
"fuelCapacity": 32,
|
"fuelCapacity": 32,
|
||||||
"cargoCapacity": 128,
|
"cargoCapacity": 128,
|
||||||
"ladenMass": 1339.2,
|
"ladenMass": 1339.2,
|
||||||
|
"armour": 2078,
|
||||||
"armourAdded": 240,
|
"armourAdded": 240,
|
||||||
|
"armourMultiplier": 1.95,
|
||||||
"shieldMultiplier": 1.4,
|
"shieldMultiplier": 1.4,
|
||||||
"totalCost": 882362049,
|
"totalCost": 882362049,
|
||||||
"unladenMass": 1179.2,
|
"unladenMass": 1179.2,
|
||||||
"armour": 1185,
|
|
||||||
"totalDps": 29,
|
"totalDps": 29,
|
||||||
"powerAvailable": 36,
|
"powerAvailable": 36,
|
||||||
"powerRetracted": 23.93,
|
"powerRetracted": 23.93,
|
||||||
|
|||||||
@@ -85,6 +85,13 @@ describe('Import Controller', function() {
|
|||||||
expect(scope.jsonValid).toBeFalsy();
|
expect(scope.jsonValid).toBeFalsy();
|
||||||
expect(scope.errorMsg).toEqual('Imperial Clipper build "" must be a string at least 3 characters long!');
|
expect(scope.errorMsg).toEqual('Imperial Clipper build "" must be a string at least 3 characters long!');
|
||||||
|
|
||||||
|
invalidImportData = angular.copy(importData);
|
||||||
|
invalidImportData.builds.asp = null; // Remove Asp Miner build used in comparison
|
||||||
|
scope.importJSON = angular.toJson(invalidImportData);
|
||||||
|
scope.validateJson();
|
||||||
|
expect(scope.jsonValid).toBeFalsy();
|
||||||
|
expect(scope.errorMsg).toEqual('asp build "Miner" data is missing!');
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user