mirror of
https://github.com/EDCD/coriolis.git
synced 2025-12-08 22:33:24 +00:00
Compare commits
5 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
25020293ec | ||
|
|
4e7f1d3e8b | ||
|
|
e6ba0a14e8 | ||
|
|
b285a433b2 | ||
|
|
f19c786f64 |
@@ -6,11 +6,11 @@
|
||||
|
||||
The Coriolis project was inspired by [E:D Shipyard](http://www.edshipyard.com/) and, of course, [Elite Dangerous](http://www.elitedangerous.com). The ultimate goal of Coriolis is to provide rich features to support in-game play and planning while engaging the E:D community to support its development.
|
||||
|
||||
Coriolis was created for non-commercial purposes. It is not endorsed by nor reflects the views or opinions of Frontier Developments.
|
||||
Coriolis was created for non-commercial purposes. Coriolis was created using assets and imagery from Elite: Dangerous, with the permission of Frontier Developments plc, for non-commercial purposes. It is not endorsed by nor reflects the views or opinions of Frontier Developments and no employee of Frontier Developments was involved in the making of it.
|
||||
|
||||
## Contributing
|
||||
|
||||
Please [submit issues](https://github.com/cmmcleod/coriolis/issues), or better yet [pull requests](http://www.elitedangerous.com) for any corrections or additions to the database or the code.
|
||||
Please [submit issues](https://github.com/cmmcleod/coriolis/issues), or better yet [pull requests](https://github.com/cmmcleod/coriolis/pulls) for any corrections or additions to the database or the code.
|
||||
|
||||
### Feature Requests, Suggestions & Bugs
|
||||
|
||||
@@ -31,7 +31,8 @@ See [Data wiki](https://github.com/cmmcleod/coriolis/wiki/Database) for details
|
||||
All Data and [associated JSON](https://github.com/cmmcleod/coriolis/tree/master/data) files are intellectual property and copyright of Frontier Developments plc ('Frontier', 'Frontier Developments') and are subject to their
|
||||
[terms and conditions](https://www.frontierstore.net/terms-and-conditions/).
|
||||
|
||||
The code specificially for Coriolis.io is released under the MIT License.
|
||||
The code (Javascript, CSS, HTML, and SVG files only) specificially for Coriolis.io is released under the MIT License.
|
||||
|
||||
Copyright (c) 2015 Coriolis.io, Colin McLeod
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
|
||||
@@ -66,7 +66,7 @@
|
||||
<a href="https://github.com/cmmcleod/coriolis/releases/" target="_blank" title="Coriolis Github Project">Version <%= version %> - <%= date %></a>
|
||||
</div>
|
||||
<div style="max-width:50%" class="l">
|
||||
Coriolis Shipyard was created for non-commercial purposes. It is not endorsed by nor reflects the views or opinions of Frontier Developments.
|
||||
Coriolis was created using assets and imagery from Elite: Dangerous, with the permission of Frontier Developments plc, for non-commercial purposes. It is not endorsed by nor reflects the views or opinions of Frontier Developments and no employee of Frontier Developments was involved in the making of it.
|
||||
</div>
|
||||
</footer>
|
||||
|
||||
|
||||
@@ -164,11 +164,11 @@ angular.module('shipyard').factory('Ship', ['Components', 'calcShieldStrength',
|
||||
Ship.prototype.use = function(slot, id, component, preventUpdate) {
|
||||
if (slot.id != id) { // Selecting a different component
|
||||
// Slot is an internal slot, is not being emptied, and the selected component group/type must be of unique
|
||||
if (slot.cat != 2 && component && _.includes(['sg', 'rf', 'fs'], component.grp)) {
|
||||
if (slot.cat == 2 && component && _.includes(['sg', 'rf', 'fs'], component.grp)) {
|
||||
// Find another internal slot that already has this type/group installed
|
||||
var similarSlot = this.findInternalByGroup(component.grp);
|
||||
// If another slot has an installed component with of the same type
|
||||
if (similarSlot && similarSlot !== slot) {
|
||||
if (!preventUpdate && similarSlot && similarSlot !== slot) {
|
||||
this.updateStats(similarSlot, null, similarSlot.c, true); // Update stats but don't trigger a global update
|
||||
similarSlot.id = similarSlot.c = null; // Empty the slot
|
||||
}
|
||||
|
||||
@@ -44,6 +44,7 @@
|
||||
border-right: 1px solid @primary-disabled;
|
||||
box-sizing: border-box;
|
||||
padding-top: 0.2em;
|
||||
padding-left: 0.1em;
|
||||
}
|
||||
|
||||
.empty {
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
"boost": 320,
|
||||
"agility": 8,
|
||||
"shields": 60,
|
||||
"armour": 90,
|
||||
"armour": 162,
|
||||
"fuelcost": 50,
|
||||
"mass": 35
|
||||
},
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
"boost": 240,
|
||||
"agility": 2,
|
||||
"shields": 350,
|
||||
"armour": 525,
|
||||
"armour": 945,
|
||||
"fuelcost": 50,
|
||||
"mass": 400
|
||||
},
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
"boost": 340,
|
||||
"agility": 6,
|
||||
"shields": 140,
|
||||
"armour": 210,
|
||||
"armour": 378,
|
||||
"fuelcost": 50,
|
||||
"mass": 280
|
||||
},
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
"boost": 400,
|
||||
"agility": 6,
|
||||
"shields": 80,
|
||||
"armour": 120,
|
||||
"armour": 216,
|
||||
"fuelcost": 50,
|
||||
"mass": 180
|
||||
},
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
"boost": 350,
|
||||
"agility": 10,
|
||||
"shields": 60,
|
||||
"armour": 40,
|
||||
"armour": 72,
|
||||
"fuelcost": 50,
|
||||
"mass": 50
|
||||
},
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
"boost": 300,
|
||||
"agility": 0,
|
||||
"shields": 200,
|
||||
"armour": 300,
|
||||
"armour": 540,
|
||||
"fuelcost": 50,
|
||||
"mass": 580
|
||||
},
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
"boost": 350,
|
||||
"agility": 6,
|
||||
"shields": 300,
|
||||
"armour": 225,
|
||||
"armour": 405,
|
||||
"fuelcost": 50,
|
||||
"mass": 250
|
||||
},
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
"boost": 300,
|
||||
"agility": 6,
|
||||
"shields": 50,
|
||||
"armour": 50,
|
||||
"armour": 90,
|
||||
"fuelcost": 50,
|
||||
"mass": 14
|
||||
},
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
"boost": 380,
|
||||
"agility": 2,
|
||||
"shields": 180,
|
||||
"armour": 270,
|
||||
"armour": 486,
|
||||
"fuelcost": 50,
|
||||
"mass": 400
|
||||
},
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
"boost": 380,
|
||||
"agility": 2,
|
||||
"shields": 220,
|
||||
"armour": 220,
|
||||
"armour": 396,
|
||||
"fuelcost": 50,
|
||||
"mass": 580
|
||||
},
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
"boost": 280,
|
||||
"agility": 6,
|
||||
"shields": 260,
|
||||
"armour": 260,
|
||||
"armour": 468,
|
||||
"fuelcost": 50,
|
||||
"mass": 350
|
||||
},
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
"boost": 320,
|
||||
"agility": 8,
|
||||
"shields": 40,
|
||||
"armour": 60,
|
||||
"armour": 108,
|
||||
"fuelcost": 50,
|
||||
"mass": 25
|
||||
},
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
"boost": 350,
|
||||
"agility": 3,
|
||||
"shields": 90,
|
||||
"armour": 90,
|
||||
"armour": 162,
|
||||
"fuelcost": 50,
|
||||
"mass": 155
|
||||
},
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
"boost": 300,
|
||||
"agility": 2,
|
||||
"shields": 120,
|
||||
"armour": 120,
|
||||
"armour": 216,
|
||||
"fuelcost": 50,
|
||||
"mass": 420
|
||||
},
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
"boost": 200,
|
||||
"agility": 0,
|
||||
"shields": 240,
|
||||
"armour": 240,
|
||||
"armour": 432,
|
||||
"fuelcost": 50,
|
||||
"mass": 1000
|
||||
},
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
"boost": 400,
|
||||
"agility": 6,
|
||||
"shields": 105,
|
||||
"armour": 70,
|
||||
"armour": 126,
|
||||
"fuelcost": 50,
|
||||
"mass": 60
|
||||
},
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
"boost": 340,
|
||||
"agility": 9,
|
||||
"shields": 240,
|
||||
"armour": 160,
|
||||
"armour": 288,
|
||||
"fuelcost": 50,
|
||||
"mass": 230
|
||||
},
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "coriolis_shipyard",
|
||||
"version": "0.13.1",
|
||||
"version": "0.13.3",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/cmmcleod/coriolis"
|
||||
|
||||
@@ -1,10 +1,12 @@
|
||||
describe("Ship Factory", function() {
|
||||
|
||||
var Ship;
|
||||
var Components;
|
||||
|
||||
beforeEach(module('shipyard'));
|
||||
beforeEach(inject(['Ship', function (_Ship_) {
|
||||
beforeEach(inject(['Ship', 'Components', function (_Ship_, _Components_) {
|
||||
Ship = _Ship_;
|
||||
Components = _Components_;
|
||||
}]));
|
||||
|
||||
it("can build all ships", function() {
|
||||
@@ -32,39 +34,89 @@ describe("Ship Factory", function() {
|
||||
});
|
||||
|
||||
it("resets and rebuilds properly", function() {
|
||||
var id = 'cobra_mk_iii';
|
||||
var cobra = DB.ships[id];
|
||||
var shipA = new Ship(id, cobra.properties, cobra.slots);
|
||||
var shipB = new Ship(id, cobra.properties, cobra.slots);
|
||||
var testShip = new Ship(id, cobra.properties, cobra.slots);
|
||||
var id = 'cobra_mk_iii';
|
||||
var cobra = DB.ships[id];
|
||||
var shipA = new Ship(id, cobra.properties, cobra.slots);
|
||||
var shipB = new Ship(id, cobra.properties, cobra.slots);
|
||||
var testShip = new Ship(id, cobra.properties, cobra.slots);
|
||||
|
||||
var buildA = cobra.defaults;
|
||||
var buildB = {
|
||||
common:['4A', '4A', '4A', '3D', '3A', '3A', '4C'],
|
||||
hardpoints: ['0s', '0s', '2d', '2d', 0, '04'],
|
||||
internal: ['45', '03', '2b', '2o', '27', '53']
|
||||
};
|
||||
var buildA = cobra.defaults;
|
||||
var buildB = {
|
||||
common:['4A', '4A', '4A', '3D', '3A', '3A', '4C'],
|
||||
hardpoints: ['0s', '0s', '2d', '2d', 0, '04'],
|
||||
internal: ['45', '03', '2b', '2o', '27', '53']
|
||||
};
|
||||
|
||||
shipA.buildWith(buildA); // Build A
|
||||
shipB.buildWith(buildB);// Build B
|
||||
testShip.buildWith(buildA);
|
||||
shipA.buildWith(buildA); // Build A
|
||||
shipB.buildWith(buildB);// Build B
|
||||
testShip.buildWith(buildA);
|
||||
|
||||
for(var p in testShip) {
|
||||
expect(testShip[p]).toEqual(shipA[p], p + ' does not match');
|
||||
}
|
||||
for(var p in testShip) {
|
||||
expect(testShip[p]).toEqual(shipA[p], p + ' does not match');
|
||||
}
|
||||
|
||||
testShip.buildWith(buildB);
|
||||
testShip.buildWith(buildB);
|
||||
|
||||
for(var p in testShip) {
|
||||
expect(testShip[p]).toEqual(shipB[p], p + ' does not match');
|
||||
}
|
||||
for(var p in testShip) {
|
||||
expect(testShip[p]).toEqual(shipB[p], p + ' does not match');
|
||||
}
|
||||
|
||||
testShip.buildWith(buildA);
|
||||
testShip.buildWith(buildA);
|
||||
|
||||
for(var p in testShip) {
|
||||
expect(testShip[p]).toEqual(shipA[p], p + ' does not match');
|
||||
}
|
||||
for(var p in testShip) {
|
||||
expect(testShip[p]).toEqual(shipA[p], p + ' does not match');
|
||||
}
|
||||
});
|
||||
|
||||
it("enforces a single shield generator", function() {
|
||||
var id = 'anaconda';
|
||||
var anacondaData = DB.ships[id];
|
||||
var anaconda = new Ship(id, anacondaData.properties, anacondaData.slots);
|
||||
anaconda.buildWith(anacondaData.defaults);
|
||||
|
||||
expect(anaconda.internal[2].c.grp).toEqual('sg', 'Anaconda default shield generator slot');
|
||||
|
||||
anaconda.use(anaconda.internal[1], '4j', Components.internal('4j')); // 6E Shield Generator
|
||||
|
||||
expect(anaconda.internal[2].c).toEqual(null, 'Anaconda default shield generator slot is empty');
|
||||
expect(anaconda.internal[2].id).toEqual(null, 'Anaconda default shield generator slot id is null');
|
||||
expect(anaconda.internal[1].id).toEqual('4j', 'Slot 1 should have SG 4j in it');
|
||||
expect(anaconda.internal[1].c.grp).toEqual('sg','Slot 1 should have SG 4j in it');
|
||||
|
||||
});
|
||||
|
||||
});
|
||||
it("enforces a single shield fuel scoop", function() {
|
||||
var id = 'anaconda';
|
||||
var anacondaData = DB.ships[id];
|
||||
var anaconda = new Ship(id, anacondaData.properties, anacondaData.slots);
|
||||
anaconda.buildWith(anacondaData.defaults);
|
||||
|
||||
anaconda.use(anaconda.internal[4], '32', Components.internal('32')); // 4A Fuel Scoop
|
||||
expect(anaconda.internal[4].c.grp).toEqual('fs', 'Anaconda fuel scoop slot');
|
||||
|
||||
anaconda.use(anaconda.internal[3], '32', Components.internal('32'));
|
||||
|
||||
expect(anaconda.internal[4].c).toEqual(null, 'Anaconda original fuel scoop slot is empty');
|
||||
expect(anaconda.internal[4].id).toEqual(null, 'Anaconda original fuel scoop slot id is null');
|
||||
expect(anaconda.internal[3].id).toEqual('32', 'Slot 1 should have FS 32 in it');
|
||||
expect(anaconda.internal[3].c.grp).toEqual('fs','Slot 1 should have FS 32 in it');
|
||||
});
|
||||
|
||||
it("enforces a single refinery", function() {
|
||||
var id = 'anaconda';
|
||||
var anacondaData = DB.ships[id];
|
||||
var anaconda = new Ship(id, anacondaData.properties, anacondaData.slots);
|
||||
anaconda.buildWith(anacondaData.defaults);
|
||||
|
||||
anaconda.use(anaconda.internal[4], '23', Components.internal('23')); // 4E Refinery
|
||||
expect(anaconda.internal[4].c.grp).toEqual('rf', 'Anaconda refinery slot');
|
||||
|
||||
anaconda.use(anaconda.internal[3], '23', Components.internal('23'));
|
||||
|
||||
expect(anaconda.internal[4].c).toEqual(null, 'Anaconda original refinery slot is empty');
|
||||
expect(anaconda.internal[4].id).toEqual(null, 'Anaconda original refinery slot id is null');
|
||||
expect(anaconda.internal[3].id).toEqual('23', 'Slot 1 should have RF 23 in it');
|
||||
expect(anaconda.internal[3].c.grp).toEqual('rf','Slot 1 should have RF 23 in it');
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user