diff --git a/DEV README.md b/DEV README.md new file mode 100644 index 00000000..e69de29b diff --git a/README.md b/README.md index 2ca4843a..cd603247 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,17 @@ +About + +License + +Development + + + +#Ship and Component Database + +See Data Readme for details on structure, etc. + +Please submit issues, or better yet pull requests for any corrections or additions to the database. + +Feature Requests and To Do List -To do \ No newline at end of file diff --git a/app/fonts/eurocaps-webfont.eot b/app/fonts/eurocaps-webfont.eot new file mode 100755 index 00000000..2b3d2316 Binary files /dev/null and b/app/fonts/eurocaps-webfont.eot differ diff --git a/app/fonts/eurocaps-webfont.svg b/app/fonts/eurocaps-webfont.svg new file mode 100755 index 00000000..a78ee3da --- /dev/null +++ b/app/fonts/eurocaps-webfont.svg @@ -0,0 +1,913 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/app/fonts/eurocaps-webfont.ttf b/app/fonts/eurocaps-webfont.ttf new file mode 100755 index 00000000..e3655504 Binary files /dev/null and b/app/fonts/eurocaps-webfont.ttf differ diff --git a/app/fonts/eurocaps-webfont.woff b/app/fonts/eurocaps-webfont.woff new file mode 100755 index 00000000..02d19df9 Binary files /dev/null and b/app/fonts/eurocaps-webfont.woff differ diff --git a/app/fonts/eurocaps-webfont.woff2 b/app/fonts/eurocaps-webfont.woff2 new file mode 100755 index 00000000..a1ab7f50 Binary files /dev/null and b/app/fonts/eurocaps-webfont.woff2 differ diff --git a/app/fonts/sintony-bold-webfont.eot b/app/fonts/sintony-bold-webfont.eot new file mode 100755 index 00000000..920e5d7c Binary files /dev/null and b/app/fonts/sintony-bold-webfont.eot differ diff --git a/app/fonts/sintony-bold-webfont.svg b/app/fonts/sintony-bold-webfont.svg new file mode 100755 index 00000000..3b2cf998 --- /dev/null +++ b/app/fonts/sintony-bold-webfont.svg @@ -0,0 +1,408 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/app/fonts/sintony-bold-webfont.ttf b/app/fonts/sintony-bold-webfont.ttf new file mode 100755 index 00000000..ed1ab017 Binary files /dev/null and b/app/fonts/sintony-bold-webfont.ttf differ diff --git a/app/fonts/sintony-bold-webfont.woff b/app/fonts/sintony-bold-webfont.woff new file mode 100755 index 00000000..b1e7cbfe Binary files /dev/null and b/app/fonts/sintony-bold-webfont.woff differ diff --git a/app/fonts/sintony-bold-webfont.woff2 b/app/fonts/sintony-bold-webfont.woff2 new file mode 100755 index 00000000..dfed6ffb Binary files /dev/null and b/app/fonts/sintony-bold-webfont.woff2 differ diff --git a/app/fonts/sintony-regular-webfont.eot b/app/fonts/sintony-regular-webfont.eot new file mode 100755 index 00000000..185fbec3 Binary files /dev/null and b/app/fonts/sintony-regular-webfont.eot differ diff --git a/app/fonts/sintony-regular-webfont.svg b/app/fonts/sintony-regular-webfont.svg new file mode 100755 index 00000000..b0e70197 --- /dev/null +++ b/app/fonts/sintony-regular-webfont.svg @@ -0,0 +1,411 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/app/fonts/sintony-regular-webfont.ttf b/app/fonts/sintony-regular-webfont.ttf new file mode 100755 index 00000000..187a1f87 Binary files /dev/null and b/app/fonts/sintony-regular-webfont.ttf differ diff --git a/app/fonts/sintony-regular-webfont.woff b/app/fonts/sintony-regular-webfont.woff new file mode 100755 index 00000000..661e19df Binary files /dev/null and b/app/fonts/sintony-regular-webfont.woff differ diff --git a/app/fonts/sintony-regular-webfont.woff2 b/app/fonts/sintony-regular-webfont.woff2 new file mode 100755 index 00000000..4ff7b7ee Binary files /dev/null and b/app/fonts/sintony-regular-webfont.woff2 differ diff --git a/app/images/crosshairs.svg b/app/images/crosshairs.svg deleted file mode 100644 index 404d66f2..00000000 --- a/app/images/crosshairs.svg +++ /dev/null @@ -1,148 +0,0 @@ - - - - - - - - - image/svg+xml - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/app/images/docking-bay.jpg b/app/images/docking-bay.jpg new file mode 100644 index 00000000..a6aea6a9 Binary files /dev/null and b/app/images/docking-bay.jpg differ diff --git a/app/images/github-mark.svg b/app/images/icons/github-mark.svg similarity index 100% rename from app/images/github-mark.svg rename to app/images/icons/github-mark.svg diff --git a/app/images/icons/logo.svg b/app/images/icons/logo.svg new file mode 100644 index 00000000..891daf63 --- /dev/null +++ b/app/images/icons/logo.svg @@ -0,0 +1,12 @@ + + + + Layer 1 + + + + + + + + \ No newline at end of file diff --git a/app/images/icons/mount-f.svg b/app/images/icons/mount-f.svg new file mode 100644 index 00000000..e0f58cf8 --- /dev/null +++ b/app/images/icons/mount-f.svg @@ -0,0 +1,12 @@ + + + + + Layer 1 + + + + + + + \ No newline at end of file diff --git a/app/images/icons/mount-g.svg b/app/images/icons/mount-g.svg new file mode 100644 index 00000000..d77e4129 --- /dev/null +++ b/app/images/icons/mount-g.svg @@ -0,0 +1,9 @@ + + + + + Layer 1 + + + + \ No newline at end of file diff --git a/app/images/icons/mount-t.svg b/app/images/icons/mount-t.svg new file mode 100644 index 00000000..1daf2b89 --- /dev/null +++ b/app/images/icons/mount-t.svg @@ -0,0 +1,10 @@ + + + + + Layer 1 + + + + + \ No newline at end of file diff --git a/app/images/reddit.svg b/app/images/icons/reddit.svg similarity index 100% rename from app/images/reddit.svg rename to app/images/icons/reddit.svg diff --git a/app/images/logo/android-chrome-144x144.png b/app/images/logo/android-chrome-144x144.png new file mode 100644 index 00000000..e1862dcd Binary files /dev/null and b/app/images/logo/android-chrome-144x144.png differ diff --git a/app/images/logo/android-chrome-192x192.png b/app/images/logo/android-chrome-192x192.png new file mode 100644 index 00000000..7064713b Binary files /dev/null and b/app/images/logo/android-chrome-192x192.png differ diff --git a/app/images/logo/android-chrome-72x72.png b/app/images/logo/android-chrome-72x72.png new file mode 100644 index 00000000..6a25c5d1 Binary files /dev/null and b/app/images/logo/android-chrome-72x72.png differ diff --git a/app/images/logo/android-chrome-96x96.png b/app/images/logo/android-chrome-96x96.png new file mode 100644 index 00000000..d1242e9f Binary files /dev/null and b/app/images/logo/android-chrome-96x96.png differ diff --git a/app/images/logo/apple-touch-icon-114x114.png b/app/images/logo/apple-touch-icon-114x114.png new file mode 100644 index 00000000..27b67606 Binary files /dev/null and b/app/images/logo/apple-touch-icon-114x114.png differ diff --git a/app/images/logo/apple-touch-icon-120x120.png b/app/images/logo/apple-touch-icon-120x120.png new file mode 100644 index 00000000..ddf4300e Binary files /dev/null and b/app/images/logo/apple-touch-icon-120x120.png differ diff --git a/app/images/logo/apple-touch-icon-144x144.png b/app/images/logo/apple-touch-icon-144x144.png new file mode 100644 index 00000000..0b81c09a Binary files /dev/null and b/app/images/logo/apple-touch-icon-144x144.png differ diff --git a/app/images/logo/apple-touch-icon-152x152.png b/app/images/logo/apple-touch-icon-152x152.png new file mode 100644 index 00000000..90177df4 Binary files /dev/null and b/app/images/logo/apple-touch-icon-152x152.png differ diff --git a/app/images/logo/apple-touch-icon-180x180.png b/app/images/logo/apple-touch-icon-180x180.png new file mode 100644 index 00000000..dfd4f3d7 Binary files /dev/null and b/app/images/logo/apple-touch-icon-180x180.png differ diff --git a/app/images/logo/apple-touch-icon-76x76.png b/app/images/logo/apple-touch-icon-76x76.png new file mode 100644 index 00000000..42f75610 Binary files /dev/null and b/app/images/logo/apple-touch-icon-76x76.png differ diff --git a/app/images/logo/apple-touch-icon-precomposed.png b/app/images/logo/apple-touch-icon-precomposed.png new file mode 100644 index 00000000..e7c8e768 Binary files /dev/null and b/app/images/logo/apple-touch-icon-precomposed.png differ diff --git a/app/images/logo/apple-touch-icon.png b/app/images/logo/apple-touch-icon.png new file mode 100644 index 00000000..dfd4f3d7 Binary files /dev/null and b/app/images/logo/apple-touch-icon.png differ diff --git a/app/images/logo/browserconfig.xml b/app/images/logo/browserconfig.xml new file mode 100644 index 00000000..affe1f0d --- /dev/null +++ b/app/images/logo/browserconfig.xml @@ -0,0 +1,12 @@ + + + + + + + + + #da532c + + + diff --git a/app/images/logo/favicon-194x194.png b/app/images/logo/favicon-194x194.png new file mode 100644 index 00000000..abf49469 Binary files /dev/null and b/app/images/logo/favicon-194x194.png differ diff --git a/app/images/logo/favicon-96x96.png b/app/images/logo/favicon-96x96.png new file mode 100644 index 00000000..125a80ab Binary files /dev/null and b/app/images/logo/favicon-96x96.png differ diff --git a/app/images/logo/favicon.ico b/app/images/logo/favicon.ico new file mode 100644 index 00000000..3ca02f2c Binary files /dev/null and b/app/images/logo/favicon.ico differ diff --git a/app/images/logo/manifest.json b/app/images/logo/manifest.json new file mode 100644 index 00000000..6cc4d886 --- /dev/null +++ b/app/images/logo/manifest.json @@ -0,0 +1,44 @@ +{ + "name": "Shipyard", + "icons": [ + { + "src": "images\/logo\/android-chrome-36x36.png", + "sizes": "36x36", + "type": "image\/png", + "density": "0.75" + }, + { + "src": "images\/logo\/android-chrome-48x48.png", + "sizes": "48x48", + "type": "image\/png", + "density": "1.0" + }, + { + "src": "images\/logo\/android-chrome-72x72.png", + "sizes": "72x72", + "type": "image\/png", + "density": "1.5" + }, + { + "src": "images\/logo\/android-chrome-96x96.png", + "sizes": "96x96", + "type": "image\/png", + "density": "2.0" + }, + { + "src": "images\/logo\/android-chrome-144x144.png", + "sizes": "144x144", + "type": "image\/png", + "density": "3.0" + }, + { + "src": "images\/logo\/android-chrome-192x192.png", + "sizes": "192x192", + "type": "image\/png", + "density": "4.0" + } + ], + "start_url": "http:\/\/coriolis.io", + "display": "standalone", + "orientation": "portrait" +} diff --git a/app/images/logo/mstile-144x144.png b/app/images/logo/mstile-144x144.png new file mode 100644 index 00000000..6915f3b4 Binary files /dev/null and b/app/images/logo/mstile-144x144.png differ diff --git a/app/images/logo/mstile-150x150.png b/app/images/logo/mstile-150x150.png new file mode 100644 index 00000000..309891bc Binary files /dev/null and b/app/images/logo/mstile-150x150.png differ diff --git a/app/images/logo/mstile-310x150.png b/app/images/logo/mstile-310x150.png new file mode 100644 index 00000000..b0e7a968 Binary files /dev/null and b/app/images/logo/mstile-310x150.png differ diff --git a/app/images/logo/mstile-310x310.png b/app/images/logo/mstile-310x310.png new file mode 100644 index 00000000..f4c7877c Binary files /dev/null and b/app/images/logo/mstile-310x310.png differ diff --git a/app/images/logo/mstile-70x70.png b/app/images/logo/mstile-70x70.png new file mode 100644 index 00000000..4df3eb02 Binary files /dev/null and b/app/images/logo/mstile-70x70.png differ diff --git a/app/index.html b/app/index.html index aa5d8db2..85108a4d 100644 --- a/app/index.html +++ b/app/index.html @@ -2,25 +2,38 @@ - Shipyard - + + Coriolis Shipyard + + + + + + + + + + + + + + + +
+ +
- - -
- - - - - + + + \ No newline at end of file diff --git a/app/js/app.js b/app/js/app.js index a57c80d8..bf1be2f5 100644 --- a/app/js/app.js +++ b/app/js/app.js @@ -1,12 +1,25 @@ -angular.module('app', ['ngRoute','shipyard','ngLodash','app.templates']) -.config(['$routeProvider', function($routeProvider) { - //$locationProvider.html5Mode(true); +angular.module('app', ['ngRoute', 'shipyard', 'ngLodash', 'n3-line-chart', 'app.templates']) +.config(['$routeProvider', '$locationProvider', function($routeProvider, $locationProvider) { + $locationProvider.html5Mode(true); $routeProvider .when('/:ship', { templateUrl: 'views/ship.html', controller: 'ShipController' }) + .when('/:ship/:code', { templateUrl: 'views/ship.html', controller: 'ShipController' }) .when('/', { templateUrl: 'views/ships.html', controller: 'ShipyardController' }); }]) -.run(['$rootScope','commonArray','shipPurpose', 'shipSize', 'hardPointClass', 'internalGroupMap', function ($rootScope, CArr, shipPurpose, sz, hpc, igMap) { +.run(['$rootScope','$document','$location','$route','commonArray','shipPurpose','shipSize','hardPointClass','internalGroupMap', function ($rootScope, $doc, $loc, $route, CArr, shipPurpose, sz, hpc, igMap) { + // Allow URL changes without reloading controllers/view + var original = $loc.path; + $loc.path = function (path, reload) { + if (reload === false) { + var lastRoute = $route.current; + var un = $rootScope.$on('$locationChangeSuccess', function () { + $route.current = lastRoute; + un(); + }); + } + return original.apply($loc, [path]); + }; // Global Reference variables $rootScope.CArr = CArr; @@ -19,19 +32,18 @@ angular.module('app', ['ngRoute','shipyard','ngLodash','app.templates']) // Formatters $rootScope.fCrd = d3.format(',.0f'); $rootScope.fPwr = d3.format(',.2f'); - $rootScope.fMass = d3.format(',.2r'); - $rootScope.fPct = d3.format(',.2%'); + $rootScope.fRound = function(d) { return d3.round(d, 2) }; + $rootScope.fPct = d3.format('.2%'); + $rootScope.fRPct = d3.format('%'); + $rootScope.fTime = function(d) { return Math.floor(d/60) + ":" + ("00" + (d%60)).substr(-2,2); }; - $rootScope.calcJumpRange = function(mass, fsd, fuel) { - return Math.pow( (fuel || fsd.maxfuel) / fsd.fuelmul, 1 / fsd.fuelpower ) * fsd.optmass / mass; - }; + // Global Event Listeners + $doc.bind('keyup', function (e) { + $rootScope.$broadcast('keyup', e); + }); - // TODO: Load Saved Ships List from Local Storage - - // TODO: Save Ship - - // TODO: Load Ship - - // TODO: Generate Link for Ship + $rootScope.bgClicked = function (e) { + $rootScope.$broadcast('bgClicked', e); + } }]); diff --git a/app/js/controllers/controller-ship.js b/app/js/controllers/controller-ship.js index e7055bb5..268f0e56 100644 --- a/app/js/controllers/controller-ship.js +++ b/app/js/controllers/controller-ship.js @@ -1,10 +1,61 @@ angular.module('app') -.controller('ShipController', ['$scope', '$routeParams','ShipFactory', 'components', function ($scope, $p, ShipFactory, Components) { +.controller('ShipController', ['$rootScope','$scope', '$routeParams', '$location', 'ShipFactory', 'components', function ($rootScope, $scope, $p, $loc, ShipFactory, Components) { $scope.shipId = $p.ship; - $scope.ship = ShipFactory($scope.shipId, DB.ships[$scope.shipId]); - $scope.availCS = Components.forShip($scope.shipId); + // TODO: show 404 if ship not found. + var ship = ShipFactory($scope.shipId, DB.ships[$scope.shipId], $p.code); + $scope.ship = ship; + $scope.pp = ship.common[0]; // Power Plant + $scope.th = ship.common[1]; // Thruster + $scope.fsd = ship.common[2]; // Frame Shrift Drive + $scope.ls = ship.common[3]; // Life Support + $scope.pd = ship.common[4]; // Power Distributor + $scope.ss = ship.common[5]; // Sensors + $scope.ft = ship.common[6]; // Fuel Tank + $scope.hps = ship.hardpoints; + $scope.internal = ship.internal; + $scope.availCS = Components.forShip($scope.shipId); + $scope.selectedSlot = null; // for debugging - //window.ship = $scope.ship; - //window.availcs = $scope.availCS; -}]); \ No newline at end of file + window.ship = ship; + window.availcs = $scope.availCS; + + $scope.selectSlot = function(e, slot) { + e.stopPropagation(); + if ($scope.selectedSlot == slot) { + $scope.selectedSlot = null; + } else { + $scope.selectedSlot = slot; + } + }; + + $scope.selectComponent = function(slot, id, component) { + ship.use(slot, id, component); + $scope.selectedSlot = null; + $loc.path(ship.id + '/' + ship.code, false).replace(); + } + + $scope.hideMenus = function() { + $scope.selectedSlot = null; + } + + $rootScope.$on('keyup', function (e, keyEvent) { + if(keyEvent.keyCode == 27) { // on Escape + $scope.hideMenus(); + $scope.$apply(); + } + // TODO: CTRL+S -> Save + }); + + $rootScope.$on('bgClicked', function (e, keyEvent) { + $scope.hideMenus(); + }); + + // TODO: Save build + // TODO: name build + save + // Push new url history in this case + // TODO: delete build + // TODO: reset to ship defaults + // TODO: revert to last save + +}]); diff --git a/app/js/directives/directive-component-select.js b/app/js/directives/directive-component-select.js index fcb2e0af..e6abb4c9 100644 --- a/app/js/directives/directive-component-select.js +++ b/app/js/directives/directive-component-select.js @@ -2,15 +2,14 @@ angular.module('app').directive('componentSelect', [ function() { return { restrict: 'A', scope:{ - opts: '=', - c: '=', - ship: '=' + opts: '=', // Component Options object + slot: '=', // Slot Object + selectComponent: '&sc' // Select Component function }, templateUrl: 'views/component_select.html', link: function (scope) { - scope.use = function(id, componentData) { - scope.ship.use(scope.c, id, componentData); - // hide this shit; + scope.use = function(id, component) { + scope.selectComponent({s: scope.slot, id: id, c: component}); }; } }; diff --git a/app/js/directives/directive-hardpoint.js b/app/js/directives/directive-hardpoint.js new file mode 100644 index 00000000..dfc6011e --- /dev/null +++ b/app/js/directives/directive-hardpoint.js @@ -0,0 +1,14 @@ +angular.module('app').directive('hardpoint', ['$rootScope', function ($r) { + return { + restrict: 'A', + scope:{ + hp: '=', + size: '=', + opts: '=' + }, + templateUrl: 'views/hardpoint.html', + link: function (scope) { + scope.$r = $r; + } + }; +}]); \ No newline at end of file diff --git a/app/js/directives/directive-list-cost.js b/app/js/directives/directive-list-cost.js index e2c23ae2..5f89474b 100644 --- a/app/js/directives/directive-list-cost.js +++ b/app/js/directives/directive-list-cost.js @@ -6,6 +6,7 @@ angular.module('app').directive('costList', ['$rootScope', function ($r) { }, templateUrl: 'views/costs.html', link: function (scope) { + scope.expanded = false; scope.$r = $r; scope.insuranceOptions = { Alpha: 0.975, @@ -14,6 +15,10 @@ angular.module('app').directive('costList', ['$rootScope', function ($r) { }; scope.insurance = scope.insuranceOptions.Standard; + scope.toggleExpand = function() { + scope.expanded = !scope.expanded; + } + scope.toggle = function(item) { item.incCost = !item.incCost; scope.ship.updateTotals(); diff --git a/app/js/directives/directive-list-power.js b/app/js/directives/directive-list-power.js index 00721158..11b74ee5 100644 --- a/app/js/directives/directive-list-power.js +++ b/app/js/directives/directive-list-power.js @@ -7,8 +7,13 @@ angular.module('app') }, templateUrl: 'views/power.html', link: function (scope) { + scope.expanded = false; scope.$r = $r; + scope.toggleExpand = function() { + scope.expanded = !scope.expanded; + } + scope.toggle = function(slot) { slot.enabled = !slot.enabled; scope.ship.updateTotals(); diff --git a/app/js/directives/directive-meter.js b/app/js/directives/directive-meter.js new file mode 100644 index 00000000..395b59f6 --- /dev/null +++ b/app/js/directives/directive-meter.js @@ -0,0 +1,77 @@ +angular.module('app').directive('meter', function () { + return { + restrict: 'A', + scope: { + labels: '=', + keys: '=', + obj: '=', + max: '=' + }, + link: function (scope, element) { + var max = scope.max, + w = 90, + pLeft = 1, + pBottom = 2, + labelWidth = 45, + bHeight = 16, + bWidth = ((w - labelWidth) / max) - pLeft, + h = bHeight * scope.keys.length; + + var data = []; + + for(var i = 0; i < scope.keys.length; i++) { + data.push({name:scope.labels[i], val: scope.obj[scope.keys[i]]}); + } + + var svg = d3.select(element[0]) + .append('svg') + .attr('width', w) + .attr('height', h) + .attr('viewBox', '0 0 ' + w + ' ' + h) + .attr('class', 'meter') + .attr('preserveAspectRatio', 'xMinYMin'); + + svg.selectAll("g").data(data) + .enter() + .append("g") + .attr('transform', function(d, i) { + return 'translate(' + labelWidth + ' ' + (i * bHeight) + ')'; + }) + .each(function(d, k) { + var g = d3.select(this); + for (var i = 0; i < max; i++) { + g.append('rect') + .attr("x", i * (bWidth + pLeft)) + .attr("y", 0) + .attr("width", bWidth) + .attr("height", bHeight - pBottom); + } + }); + + svg.selectAll("text").data(data) + .enter() + .append('text') + .text(function(d) { + return d.name; + }) + .attr("text-anchor", "end") + .attr("x", labelWidth - 3) + .attr("y", function(d, i) { + return (i * bHeight) + (bHeight) / 2; + }); + + function update() { + for(var i = 0; i < data.length; i++) { + data[i].val = scope.obj[scope.keys[i]]; + } + + svg.selectAll("g").data(data) + .selectAll('rect').attr('class', function(d, i) { + return (i + 1 <= d.val) ? 'active' : ''; + }); + } + + scope.$watch('obj',update); + } + }; +}); \ No newline at end of file diff --git a/app/js/directives/directive-ship-range.js b/app/js/directives/directive-ship-range.js new file mode 100644 index 00000000..3be79cdd --- /dev/null +++ b/app/js/directives/directive-ship-range.js @@ -0,0 +1,52 @@ +angular.module('app').directive('shipRange', ['$rootScope','CalcJumpRange', function ($r, calcJumpRange) { + + return { + restrict: 'A', + scope:{ + ship: '=' + }, + templateUrl: 'views/ship-range.html', + link: function(scope, element) { + scope.$r = $r; + scope.expanded = false; + var fsd = scope.ship.common[2].c; + + scope.toggleExpand = function() { + scope.expanded = !scope.expanded; + } + + function ranges(fsd, unladenMass, ladenMass) { + var ranges = []; + for(var m = unladenMass; m <= ladenMass; m++) { + ranges.push({x:m, y: calcJumpRange(m, fsd)}); + } + return ranges; + } + + //var fDist = d3.format(',.2f'); + + //scope.data = ranges(fsd, scope.ship.unladenMass, scope.ship.ladenMass); + /*scope.options = { + axes: { + x: {key: 'x', type: 'linear', ticks: 10}, + y: {type: 'linear', ticks: 5, } + }, + series: [ + {y: 'y', color: '#FF8C0D', thickness: '2px', type: 'area', striped: false, label: 'Range'} + ], + lineMode: 'basis', + tension: 0.7, + tooltip: { + mode: 'scrubber', + + formatter: function(x, y, series) { + return fDist(y) + ' Light Years'; + } + }, + drawLegend: false, + drawDots: false, + columnsHGap: 5 + };*/ + } + }; +}]); diff --git a/app/js/directives/directive-slot-details.js b/app/js/directives/directive-slot-details.js index 5759c0c3..5e8c39f5 100644 --- a/app/js/directives/directive-slot-details.js +++ b/app/js/directives/directive-slot-details.js @@ -1,4 +1,4 @@ -angular.module('app').directive('slotDetails', function () { +angular.module('app').directive('slotDetails', ['$rootScope', function ($r) { return { restrict: 'A', scope:{ @@ -6,6 +6,9 @@ angular.module('app').directive('slotDetails', function () { lbl: '=', opts: '=' }, - templateUrl: 'views/slot.html' + templateUrl: 'views/slot.html', + link: function(scope) { + scope.$r = $r; + } }; -}); \ No newline at end of file +}]); \ No newline at end of file diff --git a/app/js/shipyard/factory-components.js b/app/js/shipyard/factory-components.js index 1415bd61..33b68517 100644 --- a/app/js/shipyard/factory-components.js +++ b/app/js/shipyard/factory-components.js @@ -65,6 +65,12 @@ angular.module('shipyard').factory('components', ['lodash', function (_) { return { forShip: function (shipId) { return new ComponentSet(shipId); + }, + findInternal: function(id) { + var c = _.find(C.internal, function(o) { + return o[id]; + }) + return c[id]; } }; diff --git a/app/js/shipyard/factory-ship.js b/app/js/shipyard/factory-ship.js index 9606e960..638b5428 100644 --- a/app/js/shipyard/factory-ship.js +++ b/app/js/shipyard/factory-ship.js @@ -1,4 +1,4 @@ -angular.module('shipyard').factory('ShipFactory', ['components', 'lodash', function (Components, _) { +angular.module('shipyard').factory('ShipFactory', ['components', 'CalcShieldStrength', 'CalcJumpRange', 'lodash', function (Components, calcShieldStrength, calcJumpRange, _) { /** * Ship model used to track all ship components and properties. @@ -13,26 +13,23 @@ angular.module('shipyard').factory('ShipFactory', ['components', 'lodash', funct this.cargoScoop = { enabled: true, c: { name: 'Cargo Scoop', class: 1, rating: 'H', power: 0.6} }; this.sgSI = null; // Shield Generator Slot Index + // Copy all base properties from shipData angular.forEach(shipData,function(o,k){ if(typeof o != 'object') { this[k] = o; - } else if (k == 'slotCap') { - angular.forEach(o,function(arr,g){ - this[g] = []; - for(var i = 0; i < arr.length; i++){ - this[g].push({ - enabled: true, - incCost: true, - maxClass: arr[i] - }); - } - }.bind(this)); + } + }.bind(this)); + + angular.forEach(shipData.slotCap, function (slots, slotGroup) { // Initialize all slots + this[slotGroup] = []; // Initialize Slot group (Common, Hardpoints, Internal) + for(var i = 0; i < slots.length; i++){ + this[slotGroup].push({id: null, c: null, enabled: true, incCost: true, maxClass: slots[i]}); } }.bind(this)); } /** - * Reset the ship to the original purchase defaults. + * Reset the ship to the original 'manufacturer' defaults. */ Ship.prototype.clear = function() { this.buildWith(DB.ships[this.id].defaultComponents); @@ -58,7 +55,7 @@ angular.module('shipyard').factory('ShipFactory', ['components', 'lodash', funct var availInternal = DB.components.internal; var i,l; - this.bulkheads = { incCost: true, id: comps.bulkheads || 0, c: DB.components.bulkheads[this.id][comps.bulkheads || 0] }; + this.bulkheads = { incCost: true, maxClass: 8, id: comps.bulkheads || 0, c: DB.components.bulkheads[this.id][comps.bulkheads || 0] }; for(i = 0, l = comps.common.length; i < l; i++) { common[i].id = comps.common[i]; @@ -75,9 +72,13 @@ angular.module('shipyard').factory('ShipFactory', ['components', 'lodash', funct for(i = 0, l = comps.internal.length; i < l; i++) { if(comps.internal[i] !== 0) { internal[i].id = comps.internal[i]; - internal[i].c = availInternal[comps.internal[i]]; + internal[i].c = Components.findInternal(comps.internal[i]); + if(internal[i].c.group == 'sg') { + this.sgSI = i; + } } } + this.code = this.toCode(); this.updateTotals(); }; @@ -105,7 +106,7 @@ angular.module('shipyard').factory('ShipFactory', ['components', 'lodash', funct * @return {string} The id of the selected component or '-' if none selected */ function idToStr(slot) { - return slot.id === undefined? '-' : slot.id; + return (slot.id === null)? '-' : slot.id; } /** @@ -126,97 +127,53 @@ angular.module('shipyard').factory('ShipFactory', ['components', 'lodash', funct // TODO: improve... for (var i = 1, c = 0, l = code.length; i < l; i++) { - if(code.charAt(i) != '-') { - if (c < commonCount) { - comps.common[c] = code.substring(i, i + 2); - } else if (c < hpCount) { - comps.hardpoints[c - commonCount] = code.substring(i, i + 2); - } else { - comps.internal[c - hpCount] = code.substring(i, i + 2); - } + var isNull = code.charAt(i) == '-'; + if (c < commonCount) { + comps.common[c] = isNull? 0 : code.substring(i, i + 2); + } else if (c < hpCount) { + comps.hardpoints[c - commonCount] = isNull? 0 : code.substring(i, i + 2); + } else { + comps.internal[c - hpCount] = isNull? 0 : code.substring(i, i + 2); + } + if (!isNull) { i++; } c++; } - this.defaults = comps; - this.buildWidth(comps); + this.buildWith(comps); }; /** - * Updates the ship totals based on currently selected component in each slot. + * Updates the ship totals based on the components for every slot. */ Ship.prototype.updateTotals = function() { var c = _.reduce(this.common, optsSum, {cost: 0, power: 0, mass: 0, capacity: 0}); - var i = _.reduce(this.internal, optsSum, {cost: 0, power: 0, mass: 0, capacity: 0}); - var h = _.reduce(this.hardpoints, optsSum, {cost: 0, power: 0, mass: 0, capacity: 0}); + var i = _.reduce(this.internal, optsSum, {cost: 0, power: 0, mass: 0, capacity: 0, armouradd: 0}); + var h = _.reduce(this.hardpoints, optsSum, {cost: 0, power: 0, mass: 0, shieldmul: 1}); + var fsd = this.common[2].c; // Frame Shift Drive; this.totalCost = c.cost + i.cost + h.cost + (this.incCost? this.cost : 0) + (this.bulkheads.incCost? this.bulkheads.c.cost : 0); this.unladenMass = c.mass + i.mass + h.mass + this.mass + this.bulkheads.c.mass; this.powerAvailable = this.common[0].c.pGen; this.fuelCapacity = this.common[6].c.capacity; + this.maxMass = this.common[1].c.maxmass; this.cargoCapacity = i.capacity; this.ladenMass = this.unladenMass + this.cargoCapacity + this.fuelCapacity; this.powerRetracted = c.power + i.power + (this.cargoScoop.enabled? this.cargoScoop.c.power : 0); this.powerDeployed = this.powerRetracted + h.power; - - // TODO: range - this.calcShieldStrength = this.sgSI !== null? calcShieldStrength(this.mass, this.shields, this.internal[this.sgSI], 1) : 0; - this.armourAdded = 0; // internal.armoradd TODO: Armour (reinforcement, bulkheads) - this.armorTotal = this.armourAdded + this.armour; + this.armourAdded = i.armouradd; + this.shieldMultiplier = h.shieldmul; + this.unladenJumpRange = calcJumpRange(this.unladenMass + fsd.maxfuel, fsd); // Include fuel weight for jump + this.ladenJumpRange = calcJumpRange(this.ladenMass, fsd); + this.shieldStrength = this.sgSI !== null? calcShieldStrength(this.mass, this.shields, this.internal[this.sgSI].c, this.shieldMultiplier) : 0; + this.armourTotal = this.armourAdded + this.armour; + // TODO: shield recharge rate + // TODO: armor bonus / damage reduction for bulkheads + // TODO: thermal load and weapon recharge rate + this.code = this.toCode(); }; - /** - * Update a slot with a the component if the id is different from the current id for this slot. - * Frees the slot of the current component if the id matches the current id for the slot. - * - * @param {object} slot The component slot - * @param {string} id Unique ID for the selected component - * @param {object} component Properties for the selected component - */ - Ship.prototype.use = function(slot, id, component) { - if (slot.id != id) { // Selecting a different component - slot.id = id; - slot.c = component; - - // Selected componnent is a Shield Generator - if(component.group == 'sg') { - var slotIndex = this.internal.indexOf(slot); - // You can only have one shield Generator - if (this.sgSI !== null && this.sgSI != slotIndex) { - // A shield generator is already selected in a different slot - this.internal[this.sgSI].id = null; - this.internal[this.sgSI].c = null; - } - this.sgSI = slotIndex; - } - this.updateTotals(); - } - }; - - /** - * Calculate the a ships shield strength based on mass, shield generator and shield boosters used. - * - * @private - * @param {number} mass Current mass of the ship - * @param {number} shields Base Shield strength MJ for ship - * @param {object} sg The shield generator used - * @param {number} multiplier Shield multiplier for ship (1 + shield boosters if any) - * @return {number} Approximate shield strengh in MJ - */ - function calcShieldStrength (mass, shields, sg, multiplier) { - if (mass <= sg.minmass) { - return shields * multiplier * sg.minmul; - } - if (mass < sg.optmass) { - return shields * multiplier * (sg.minmul + (mass - sg.minmass) / (sg.optmass - sg.minmass) * (sg.optmul - sg.minmul)); - } - if (mass < sg.maxmass) { - return shields * multiplier * (sg.optmul + (mass - sg.optmass) / (sg.maxmass - sg.optmass) * (sg.maxmul - sg.optmul)); - } - return shields * multiplier * sg.maxmul; - } - /** * Utilify function for summing the components properties * @@ -226,15 +183,61 @@ angular.module('shipyard').factory('ShipFactory', ['components', 'lodash', funct * @return {object} The mutated sum object */ function optsSum(sum, slot) { - if (slot.c) { // The slot has a component selected - sum.cost += (slot.incCost && slot.c.cost)? slot.c.cost : 0; - sum.power += (slot.enabled && slot.c.power)? slot.c.power : 0; - sum.mass += slot.c.mass || 0; - sum.capacity += slot.c.capacity || 0; + var c = slot.c + if (c) { // The slot has a component mounted + sum.cost += (slot.incCost && c.cost)? c.cost : 0; + sum.power += (slot.enabled && c.power)? c.power : 0; + sum.mass += c.mass || 0; + sum.capacity += c.capacity || 0; + sum.shieldmul += c.shieldmul || 0; + sum.armouradd += c.armouradd || 0; } return sum; } + Ship.prototype.useBulkhead = function(index) { + this.bulkheads.id = index; + this.bulkheads.c = DB.components.bulkheads[this.id][index]; + this.updateTotals(); // Update mass, range, shield strength, armor + } + + /** + * Update a slot with a the component if the id is different from the current id for this slot. + * Frees the slot of the current component if the id matches the current id for the slot. + * + * @param {object} slot The component slot + * @param {string} id Unique ID for the selected component + * @param {object} component Properties for the selected component + */ + Ship.prototype.use = function(slot, id, component) { + // TODO: only single refinery allowed + if (slot.id != id) { // Selecting a different component + slot.id = id; + slot.c = component; + var slotIndex = this.internal.indexOf(slot); + if(slot.id == null) { // Slot has been emptied + if(this.sgSI == slotIndex) { // The slot containing the shield generator was emptied + this.sgSI = null; + } + } else { + // Selected component is a Shield Generator + if(component.group == 'sg') { + // You can only have one shield Generator + if (this.sgSI !== null && this.sgSI != slotIndex) { + // A shield generator is already selected in a different slot + this.internal[this.sgSI].id = null; + this.internal[this.sgSI].c = null; + } + this.sgSI = slotIndex; + // Replacing a shield generator with something else + } else if (this.sgSI == slotIndex) { + this.sgSI = null; + } + } + this.updateTotals(); + } + }; + /** * Ship Factory function. Created a new instance of a ship based on the ship type. * diff --git a/app/js/shipyard/module-shipyard.js b/app/js/shipyard/module-shipyard.js index 877de58c..1813b675 100644 --- a/app/js/shipyard/module-shipyard.js +++ b/app/js/shipyard/module-shipyard.js @@ -94,4 +94,40 @@ angular.module('shipyard', []) } return groupToLabel; - }); \ No newline at end of file + }) + .factory('CalcJumpRange', function() { + /** + * Calculate the maximum single jump range based on mass and a specific FSD + * @param {number} mass Mass of a ship: laden, unlanden, partially laden, etc + * @param {object} fsd The FDS object/component with maxfuel, fuelmul, fuelpower, optmass + * @param {number} fuel Optional - The fuel consumed during the jump (must be less than the drives max fuel per jump) + * @return {number} Distance in Light Years + */ + return function(mass, fsd, fuel) { + return Math.pow(Math.min(fuel || Infinity, fsd.maxfuel) / fsd.fuelmul, 1 / fsd.fuelpower ) * fsd.optmass / mass; + }; + }) + .factory('CalcShieldStrength', function() { + /** + * Calculate the a ships shield strength based on mass, shield generator and shield boosters used. + * + * @private + * @param {number} mass Current mass of the ship + * @param {number} shields Base Shield strength MJ for ship + * @param {object} sg The shield generator used + * @param {number} multiplier Shield multiplier for ship (1 + shield boosters if any) + * @return {number} Approximate shield strengh in MJ + */ + return function (mass, shields, sg, multiplier) { + if (mass <= sg.minmass) { + return shields * multiplier * sg.minmul; + } + if (mass < sg.optmass) { + return shields * multiplier * (sg.minmul + (mass - sg.minmass) / (sg.optmass - sg.minmass) * (sg.optmul - sg.minmul)); + } + if (mass < sg.maxmass) { + return shields * multiplier * (sg.optmul + (mass - sg.optmass) / (sg.maxmass - sg.optmass) * (sg.maxmul - sg.optmul)); + } + return shields * multiplier * sg.maxmul; + } + }); diff --git a/app/less/app.less b/app/less/app.less index 9b2dd712..3f6a4004 100644 --- a/app/less/app.less +++ b/app/less/app.less @@ -1,45 +1,83 @@ @import 'colors'; @import 'fonts'; @import 'utilities'; -@import 'logos'; +@import 'icons'; @import 'shipyard'; @import 'list'; -@import 'components'; +@import 'slot'; @import 'ship'; +@import 'charts'; +@import 'meters'; + html, body { min-height: 100%; } body { - color: #FFF; + color: @fg; background-color: #000; margin: 0; padding: 0; - font-family: @standardFamily; + font-family: @fStandard; overflow-x: hidden; } +#bg { + position: fixed; + top: 0; + left: 0; + width: 100%; + height: 100%; + z-index: -1; + opacity: 0.3; + //background-image: url(images/docking-bay.jpg); + //background-repeat: no-repeat; + //background-position: center; + //background-size: cover; +} + #main { - min-height: 90%; + margin: 10px; + min-height: 800px; + clear: both; +} + +.l { + float: left; +} + +.r { + float: right; +} + +.cl { + clear: left; +} + +.cr { + clear: right; +} + +.cb { clear: both; } header { - background-color: @fg; + background-color: @bg; margin: 0; - height: 40px; - line-height: 40px; - font-family: @titleFamily; + height: 55px; + line-height: 55px; + font-family: @fTitle; vertical-align: middle; a { vertical-align: middle; - color: @border; + color: @warning; &:visited { - color: @border; + color: @warning; } &:hover { color: teal; diff --git a/app/less/charts.less b/app/less/charts.less new file mode 100644 index 00000000..e87a040f --- /dev/null +++ b/app/less/charts.less @@ -0,0 +1,8 @@ + +svg { + .user-select-none(); + display: block; + width:100%; + height:100%; +} + diff --git a/app/less/colors.less b/app/less/colors.less index ba286f8e..8174b195 100644 --- a/app/less/colors.less +++ b/app/less/colors.less @@ -1,3 +1,20 @@ -@fg: #FF8C0D; // Light Orange +@fg: #fff; +@bg: #333; +@primary: #FF8C0D; // Light Orange +@secondary: #32DBDB; // Light blue @warning: #FF3B00; // Dark Orange -@border: rgba(201,34,2,0.50); // Dark Red \ No newline at end of file + +@bgDarken: 40%; +@disabledDarken: 15%; +@bgTransparency: 10%; + +@disabled: #888; +@primary-disabled: darken(@primary, @disabledDarken); +@secondary-disabled: darken(@primary, @disabledDarken); +@warning-disabled: darken(@primary, @disabledDarken); + +@bgBlack: rgba(0,0,0,0.6); + +@primary-bg: fadeout(darken(@primary, 45%), 30%); +@secondary-bg: fadeout(darken(@secondary, @bgDarken), @bgTransparency); // Brown background +@warning-bg: fadeout(darken(@warning, @bgDarken), @bgTransparency); // Dark Red diff --git a/app/less/components.less b/app/less/components.less deleted file mode 100644 index 6c085187..00000000 --- a/app/less/components.less +++ /dev/null @@ -1,118 +0,0 @@ - -.slot-group { - border: 2px solid @border; - .border-radius(5px); - margin: 5px; - float: left; - padding: 0 5px 5px; - user-select: none; - -moz-user-select: none; - -webkit-user-select: none; - -ms-user-select: none; - - legend { - text-transform: uppercase; - padding: 0 5px; - color: @warning; - } - - .slot { - text-transform: uppercase; - float: left; - margin: 1%; - border: 1px solid orange; - .border-radius(2px); - width: 250px; - position: relative; - padding: 3px; - - color: #BBB; - font-size: 0.8em; - - .lbl,.cla { - color: #666; - } - - .lbl { - float: left; - } - - .cla { - float: right; - } - - .clear { - clear: both; - } - - .select { - z-index: 1; - top: 100%; - padding-top: 10px; - display: none; - position: absolute; - width: 100%; - margin: 0; - padding: 0; - background-color: black; - border-left: 1px solid teal; - border-bottom: 1px solid teal; - border-right: 1px solid teal; - .border-bottom-radius(5px); - left: -1px; - max-height: 600px; - overflow-y: scroll; - } - - .select-group { - clear: both; - border-top: 1px solid grey; - border-bottom: 1px solid grey; - padding-left: 5px; - } - - .c { - cursor: pointer; - .border-radius(3px); - display: block; - float:left; - margin: 5px; - padding: 0; - height: 20px; - line-height: 20px; - background-color: #666; - color: #BBB; - - &:hover { - background-color: teal; - color: #FFF; - } - } - - li.c { - width: 25px; - text-align: center; - - &:nth-child(5n +1) { - clear: left; - } - } - - ul { - margin: 0; - list-style: none; - } - - &:hover { - border: 1px solid teal; - color: #FFF; - .lbl,.cla { - color: #999; - } - .select { - display: block; - } - } - - } -} \ No newline at end of file diff --git a/app/less/fonts.less b/app/less/fonts.less index af9f8fda..99d3187f 100644 --- a/app/less/fonts.less +++ b/app/less/fonts.less @@ -34,7 +34,45 @@ font-style: normal; } +@font-face { + font-family: 'Sintony-Bold'; + src: url('fonts/sintony-bold-webfont.eot'); + src: url('fonts/sintony-bold-webfont.eot?#iefix') format('embedded-opentype'), + url('fonts/sintony-bold-webfont.woff2') format('woff2'), + url('fonts/sintony-bold-webfont.woff') format('woff'), + url('fonts/sintony-bold-webfont.ttf') format('truetype'), + url('fonts/sintony-bold-webfont.svg#sintonybold') format('svg'); + font-weight: normal; + font-style: normal; + +} + +@font-face { + font-family: 'Sintony-Regular'; + src: url('fonts/sintony-regular-webfont.eot'); + src: url('fonts/sintony-regular-webfont.eot?#iefix') format('embedded-opentype'), + url('fonts/sintony-regular-webfont.woff2') format('woff2'), + url('fonts/sintony-regular-webfont.woff') format('woff'), + url('fonts/sintony-regular-webfont.ttf') format('truetype'), + url('fonts/sintony-regular-webfont.svg#sintonyregular') format('svg'); + font-weight: normal; + font-style: normal; + +} + +@font-face { + font-family: 'eurocaps'; + src: url('fonts/eurocaps-webfont.eot'); + src: url('fonts/eurocaps-webfont.eot?#iefix') format('embedded-opentype'), + url('fonts/eurocaps-webfont.woff2') format('woff2'), + url('fonts/eurocaps-webfont.woff') format('woff'), + url('fonts/eurocaps-webfont.ttf') format('truetype'), + url('fonts/eurocaps-webfont.svg#euro_capsregular') format('svg'); + font-weight: normal; + font-style: normal; + +} + +@fStandard: 'eurocaps', Helvetica, sans-serif; +@fTitle: 'Orbitron-Regular', Arial, sans-serif; -@standardFamily: Helvetica, sans-serif; -@titleFamily: 'Orbitron-Medium', Arial, sans-serif; -@itemFamily: 'Orbitron-Regular', Arial, sans-serif; \ No newline at end of file diff --git a/app/less/icons.less b/app/less/icons.less new file mode 100644 index 00000000..a7ef7fc5 --- /dev/null +++ b/app/less/icons.less @@ -0,0 +1,43 @@ + +.logo, .icon { + background-repeat: no-repeat; + background-position: center; + background-size: contain; +} + +.icon { + width: 25px; + height: 25px; +} + +.logo { + display: inline-block; + width: 50px; + height: 50px; +} + +.mount-T { + background-image: url(images/icons/mount-t.svg); +} +.mount-F { + background-image: url(images/icons/mount-f.svg); +} +.mount-G { + background-image: url(images/icons/mount-g.svg); +} + +.shipyard { + background-image: url(images/icons/logo.svg); +} + +.github { + background-image: url(images/icons/github-mark.svg); +} + +.reddit { + background-image: url(images/icons/reddit.svg); +} + +.elite-dangerous { + background-image: url(images/ed-logo-sm.png); +} \ No newline at end of file diff --git a/app/less/list.less b/app/less/list.less index 658b1f53..ea72aa4f 100644 --- a/app/less/list.less +++ b/app/less/list.less @@ -1,61 +1,84 @@ .list { - user-select: none; - -moz-user-select: none; - -webkit-user-select: none; - -ms-user-select: none; - float: left; + overflow: hidden; + padding: 5px; + cursor: default; + position: relative; + font-size: 0.8em; - .list-item { + .header { + position: absolute; + width: 100%; + height: 1.6em; + font-family: @fTitle; + color: @primary; + text-transform: uppercase; + } + .items { + margin-top: 25px; + margin-bottom: 10px; clear: both; overflow: hidden; - margin: 3px 0px; + + .item { + clear: both; + margin: 1px 0 0; + overflow: hidden; + + .val { + float:right; + text-align: right; + } + + .lbl { + float: left; + } + color: @disabled; + cursor: pointer; + + &:hover { + color: @warning-disabled; + } + + &.enabled { + color: @fg; + &:hover { + color: @warning; + } + } + + &.consumer { + .val:before { + content: "-"; + } + } + + &.untoggleable { + cursor: default; + } + } } - .val { - float:right; + .summary { + font-family: @fStandard; + overflow: hidden; text-align: right; + + .item { + float:right; + width: 25% + } + .lbl { + font-family: @fTitle; + color: @primary; + text-transform: uppercase; + } } - .lbl { - float: left; + &:nth-child(n+2) { + border-top: 1px solid @primary; } } -#cost-list { - color: grey; - width: 300px; - - .list-item { - cursor: pointer; - } - - .enabled { - color: #FFF; - } -} - - -#power-list { - color: grey; - width: 300px; - - .enabled { - color: #FFF; - } - - .consumer { - cursor: pointer; - } - - .consumer.enabled { - color: @fg; - } - - .common, .internal, .hardpoints { - - } - -} \ No newline at end of file diff --git a/app/less/logos.less b/app/less/logos.less deleted file mode 100644 index 91ebcfe2..00000000 --- a/app/less/logos.less +++ /dev/null @@ -1,23 +0,0 @@ - -.logo { - background-repeat: no-repeat; - background-position: center; - display: inline-block; - width: 30px; - height: 30px; -} - -.github { - background-image: url(images/github-mark.svg); - background-size: contain; -} - -.reddit { - background-image: url(images/reddit.svg); - background-size: contain; -} - -.elite-dangerous { - background-image: url(images/ed-logo-sm.png); - background-size: contain; -} \ No newline at end of file diff --git a/app/less/meters.less b/app/less/meters.less new file mode 100644 index 00000000..f1da75af --- /dev/null +++ b/app/less/meters.less @@ -0,0 +1,18 @@ + +svg.meter { + text { + fill: @warning; + font-size: 15px; + font-family: @fStandard; + text-transform:uppercase; + alignment-baseline: middle; + } + + rect { + fill: @disabled; + + &.active { + fill: @warning; + } + } +} diff --git a/app/less/ship.less b/app/less/ship.less index 5c854a0a..0842d98c 100644 --- a/app/less/ship.less +++ b/app/less/ship.less @@ -14,13 +14,61 @@ } #hardpoints { - width: 525px; + .slot:nth-child(2n) { + clear: left; + margin-right: 10px; + } } #standard { - width: 265px; + .slot { + clear: left; + } } #internal { - width: 525px; -} \ No newline at end of file + .slot { + clear: left; + } +} + +#summary { + .user-select-none(); + float: right; + width: 40%; + border-top: 2px solid @primary; + border-bottom: 2px solid @primary; + background-color: @primary-bg; +} + +legend { + text-transform: uppercase; + padding: 0 5px; + color: @warning; + font-family: @fTitle; +} + +fieldset { + user-select: none; + -moz-user-select: none; + -webkit-user-select: none; + -ms-user-select: none; + cursor: default; + border: 2px solid @warning-bg; + .border-radius(5px); + margin: 5px; + padding: 1px 5px 5px; +} + +.toggle { + cursor: pointer; +} + +.expandable { + display: none; + + &.expanded { + display: block; + } +} + diff --git a/app/less/shipyard.less b/app/less/shipyard.less index 06aa79a2..a3dfec82 100644 --- a/app/less/shipyard.less +++ b/app/less/shipyard.less @@ -5,26 +5,29 @@ a.ship { width: 22%; height: 30%; margin: 1% 1%; - background-color: #222; + background-color: @bg; padding: 0.5%; text-decoration: none; - color: #FFF; - font-family: @standardFamily; + color: @fg; + font-family: @fStandard; + text-align: right; + .user-select-none(); &:hover { - background-color: @fg; + background-color: @secondary-bg; } h2 { width: 100%; text-transform: uppercase; margin: 0; - font-family: @titleFamily; + font-family: @fTitle; + text-align: left; } small { color: @warning; - font-family: @titleFamily; + font-family: @fTitle; float: left; font-size: 0.8em; } diff --git a/app/less/slot.less b/app/less/slot.less new file mode 100644 index 00000000..82072232 --- /dev/null +++ b/app/less/slot.less @@ -0,0 +1,164 @@ + +.slot-group { + float: left; + margin: 0 5px; + background-color: @bgBlack; + .user-select-none(); + cursor: default; + + h1 { + font-family: @fTitle; + color: @bgBlack; + background-color: @primary-disabled; + text-transform: uppercase; + margin: 2px 0; + font-size: 0.8em; + padding-left: 0.5em; + } +} + +.slot { + float: left; + width: 230px; + font-size: 0.75em; + margin-top: 3px; + position: relative; + z-index: 0; + padding-right: 0.4em; + padding-left: 1.65em; + box-sizing: border-box; + background-color: @primary-bg; + border: 1px solid @primary-disabled; + color: @disabled; + + .details { + overflow: hidden; + height: 100%; + cursor: pointer; + } + + .cb { + overflow: hidden; + } + + .l { + margin-right: 1em; + } + + .sz { + text-align: center; + position: absolute; + top: 0; + height: 100%; + left: 0; + font-size: 1.2em; + width: 1.2em; + color: @primary-disabled; + border-right: 1px solid @primary-disabled; + box-sizing: border-box; + } + + .empty { + font-size: 1.5em; + color: lighten(@primary-bg, 12%); + text-align: center; + letter-spacing: 0.1em; + line-height: 1.8em; + } + + &:hover{ + color: @fg; + border: 1px solid @primary; + + .sz { + color: @primary; + border-right: 1px solid @primary; + } + } + + &.selected { + color: @primary-bg; + background-color: @primary; + border: 1px solid @primary; + z-index: 1; + .sz { + color: @primary; + background-color: @primary-bg; + border-right: 1px solid @primary; + } + } +} + +.select { + color: @primary-disabled; + position: absolute; + left: -1px; + padding: 5px 0; + width: 100%; + margin: 0; + max-height: 300px; + overflow-y: scroll; + background-color: @bg; + border: 1px solid @primary; + + + .select-group { + clear: both; + margin: 5px 0; + padding-left: 5px; + border-top: 1px solid @primary-disabled; + border-bottom: 1px solid @primary-disabled; + } + + .empty-c, .c, .lc { + cursor: pointer; + + color: @primary-disabled; + + &:hover { + color: @warning; + } + } + + @optionSpacing: 1.8em; + + .lc { + padding-left: 5px; + line-height:@optionSpacing; + } + + .empty-c { + line-height:@optionSpacing; + text-align: center; + } + + .c { + border:1px solid @primary-disabled; + display: block; + float:left; + padding: 0; + margin: 0.5em; + width: 2em; + //height: 1.5em; + line-height: @optionSpacing; + text-align: center; + + &:hover { + border:1px solid @warning; + } + + &:nth-child(5n +1) { + clear: left; + } + } + + ul { + margin: 0; + margin-left: 20px; + padding: 0; + list-style: none; + overflow: hidden; + } + + +} diff --git a/app/less/utilities.less b/app/less/utilities.less index d74c5e44..647299e1 100644 --- a/app/less/utilities.less +++ b/app/less/utilities.less @@ -19,4 +19,13 @@ -moz-background-clip: padding; -webkit-background-clip: padding-box; background-clip: padding-box; +} + +.user-select-none (){ + -webkit-touch-callout: none; + -webkit-user-select: none; + -khtml-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + user-select: none; } \ No newline at end of file diff --git a/app/views/component_select.html b/app/views/component_select.html index 65a1e0d1..2224ee19 100644 --- a/app/views/component_select.html +++ b/app/views/component_select.html @@ -1,3 +1,3 @@ diff --git a/app/views/costs.html b/app/views/costs.html index 538ea19c..421807f7 100644 --- a/app/views/costs.html +++ b/app/views/costs.html @@ -1,18 +1,29 @@ -
-
{{ship.name}}
{{$r.fCrd(ship.cost)}}
+
Costs
+ -
-
{{ship.bulkheads.c.name}}
{{$r.fCrd(ship.bulkheads.c.cost)}}
-
-
-
{{c.c.class}}{{c.c.rating}} {{$r.CArr[$index]}}
{{$r.fCrd(c.c.cost)}}
-
-
-
{{c.c.class}}{{c.c.rating}} {{c.c.name}}
{{$r.fCrd(c.c.cost)}}
-
-
-
{{c.c.class}}{{c.c.rating}} {{c.c.name || $r.igMap[c.c.group]}}
{{$r.fCrd(c.c.cost)}}
-
-
-
Total
{{$r.fCrd(ship.totalCost)}}
+ +
+
+
Total
+
{{$r.fCrd(ship.totalCost)}} CR
+
+
+
Insurance
+
{{$r.fCrd(ship.totalCost * (1-insurance))}} CR
+
diff --git a/app/views/hardpoint.html b/app/views/hardpoint.html new file mode 100644 index 00000000..6b110641 --- /dev/null +++ b/app/views/hardpoint.html @@ -0,0 +1,16 @@ +
{{['U','S','M','L','H'][hp.maxClass]}}
+
EMPTY
+
+
{{hp.c.name}}
{{hp.c.class}}{{hp.c.rating}}/{{hp.c.mode}}{{hp.c.missile}}
+
+
+
+
+
+
Ammo: {{$r.fCrd(hp.c.clip)}}/{{$r.fCrd(hp.c.ammo)}}
+
ROF: {{hp.c.rof}}/s
+
+{{$r.fRPct(hp.c.shieldmul)}}
+
{{hp.c.range}} KM
+
{{hp.c.mass}} T
+
+
diff --git a/app/views/menu.html b/app/views/menu.html index 0be50c47..923a8890 100644 --- a/app/views/menu.html +++ b/app/views/menu.html @@ -1,6 +1,6 @@
-

Shipyard

+
diff --git a/app/views/power.html b/app/views/power.html index 8a773e74..416ff013 100644 --- a/app/views/power.html +++ b/app/views/power.html @@ -1,20 +1,37 @@ -
-
{{ship.common[0].c.class}}{{ship.common[0].c.rating}} {{$r.CArr[0]}}
{{$r.fPwr(ship.common[0].c.pGen)}}
-
-
-
{{c.c.class}}{{c.c.rating}} {{$r.CArr[$index]}}
{{$r.fPwr(c.c.power)}}
-
-
-
1H Cargo Scoop
{{$r.fPwr(ship.cargoScoop.c.power)}}
-
-
-
{{c.c.class}}{{c.c.rating}} {{c.c.name}}
{{$r.fPwr(c.c.power)}}
-
+
Power Use
+ +
+
+
Available
+
{{$r.fPwr(ship.powerAvailable)}} MW
+
+
+
Deployed
+
{{$r.fPwr(ship.powerDeployed)}} MW ({{$r.fPct(ship.powerDeployed/ship.powerAvailable)}})
+
+
+
Retracted
+
{{$r.fPwr(ship.powerRetracted)}} MW ({{$r.fPct(ship.powerRetracted/ship.powerAvailable)}})
+
+
diff --git a/app/views/ship-range.html b/app/views/ship-range.html new file mode 100644 index 00000000..b4533544 --- /dev/null +++ b/app/views/ship-range.html @@ -0,0 +1,15 @@ +
Jump Range
+ +
+
+
Laden
+
{{$r.fRound(ship.ladenJumpRange)}} Ly
+
+
+
Unladen
+
{{$r.fRound(ship.unladenJumpRange)}} Ly
+
+
diff --git a/app/views/ship.html b/app/views/ship.html index c63f8d5a..ffa24f27 100644 --- a/app/views/ship.html +++ b/app/views/ship.html @@ -1,55 +1,164 @@ -
- {{ship.name}} -
Class: {{ship.class}}
-
Mass: {{fMass(ship.unladenMass)}} - {{fMass(ship.ladenMass)}} [{{ship.mass}}]T
-
Speed: {{ship.speed}} [{{ship.boost}}] M/s
-
Agility: {{ship.agility}}
-
Shields: {{ship.shields}}
-
Armour: {{ship.armour}}
-
Fuel: {{ship.fuelCapacity}}T
-
Cargo: {{ship.cargoCapacity}}T
-
Armour: {{ship.armour}}
-
Pad Size: {{['','Small','Medium','Large'][ship.class]}}
-
+
+

HardPoints

+
+
+
+
+
-
- Standard -
-
Bulkheads
-
{{ship.bulkheads.c.name}} -
{{ship.bulkheads.c.mass}}T
+
+

Standard

+
+
+
8
+
Bulkheads
{{ship.bulkheads.c.class}}{{ship.bulkheads.c.rating}}
+
{{ship.bulkheads.c.name}}
+
{{ship.bulkheads.c.mass}} T
-
-
{{b.name}}
+
    +
  • Lightweight Alloy
  • +
  • Reinforced Alloy
  • +
  • Military Grade Composite
  • +
  • Mirrored Surface Composite
  • +
  • Reactive Surface Composite
  • +
+
+
+
+
{{pp.maxClass}}
+
Power Plant
+
{{pp.id}}
+
+
Eff: {{pp.c.eff}}
+
Power: {{pp.c.pGen}} MW
+
{{pp.c.mass}} T
+
-
-
-
+
+
+
{{th.maxClass}}
+
Thrusters
+
{{th.id}}
+
+
Opt: {{th.c.optmass}} T
+
Max: {{th.c.optmass}} T
+
{{th.c.mass}} T
+
+
-
+
+
+
{{fsd.maxClass}}
+
Frame Shift Drive
+
{{fsd.id}}
+
+
Opt: {{fsd.c.optmass}} T
+
Max Fuel: {{fsd.c.maxfuel}} T
+
{{fsd.c.mass}} T
+
+
+
+
+
+
{{ls.maxClass}}
+
Life Support
+
{{ls.id}}
+
+
Time: {{fTime(ls.c.time)}}
+
{{ls.c.mass}} T
+
+
+
+
+
+
{{pd.maxClass}}
+
Power Distributor
+
{{pd.id}}
+
+ +
{{pd.c.mass}} T
+
+
+
+
+
+
{{ss.maxClass}}
+
Sensors
+
{{ss.id}}
+
+
{{ss.c.range}} KM
+
{{ss.c.mass}} T
+
+
+
+
+
+
{{ft.maxClass}}
+
Fuel Tank
+
{{ft.id}}
+
{{ft.c.capacity}} T
+
+
+
+
-
- HardPoints -
-
-
-
-
- -
- Internal Compartments -
-
-
-
+
+

Internal Compartments

+
+
+
+
EMPTY
+
{{grp}}
-
+
-
+
-
-
\ No newline at end of file +
+
+
Maneuverability
+
+
Boost
{{fRound(ship.boost)}} m/s
+
Speed
{{fRound(ship.speed)}} m/s
+
Agility
{{ship.agility}} / 10
+
+
+
+
Shields
+
+
Recharge Rate
{{fRound(0)}} Mj/s
+
Strength
{{fRound(ship.shieldStrength)}} Mj
+
Multiplier
{{fRPct(ship.shieldMultiplier)}}
+
+
+
+
Armor
+
+
Total
{{ship.armourTotal}}
+
Added
{{ship.armourAdded}}
+
Base
{{ship.armour}}
+
+
+
+
Mass
+
+
Max
{{fRound(ship.maxMass)}} T
+
Laden
{{fRound(ship.ladenMass)}} T
+
Unladen
{{fRound(ship.unladenMass)}} T
+
+
+
+
+
Capacity
+
+
Cargo
{{fRound(ship.cargoCapacity)}} T
+
Fuel
{{fRound(ship.fuelCapacity)}} T
+
+
+
+
+
diff --git a/app/views/ships.html b/app/views/ships.html index 048467bc..88d8f9a0 100644 --- a/app/views/ships.html +++ b/app/views/ships.html @@ -1,10 +1,9 @@ - +

{{s.name}}

{{s.manufacturer}}
-
{{SP[s.group]}}
- {{fCrd(s.cost)}} C + {{fCrd(s.cost)}} CR
\ No newline at end of file diff --git a/app/views/slot.html b/app/views/slot.html index 775187c3..81b54363 100644 --- a/app/views/slot.html +++ b/app/views/slot.html @@ -1,6 +1,15 @@ -
{{lbl}}
-
{{c.maxClass}}
-
- {{c.c.class}}{{c.c.rating}} -
{{c.c.mass || c.c.capacity}}T
+
{{c.maxClass}}
+
EMPTY
+
+
{{c.c.name || lbl}}
+
{{c.c.class}}{{c.c.rating}}
+
+
Opt: {{c.c.optmass}} T
+
Max: {{c.c.optmass}} T
+
{{c.c.bins}} Bins
+
{{c.c.range}} KM
+
{{c.c.mass || '0'}} T
+ + +
\ No newline at end of file diff --git a/bower.json b/bower.json index 8313cb72..24922688 100644 --- a/bower.json +++ b/bower.json @@ -1,10 +1,10 @@ { - "name": "shipyard", - "version": "0.0.0", + "name": "coriolis_shipyard", + "version": "0.1.0", "authors": [ "Colin McLeod " ], - "description": "Elite Dangerous Shipyard", + "description": "Coriolis Shipyard for Elite Dangerous", "main": "app/app.js", "moduleType": [ "amd" @@ -25,15 +25,13 @@ "dependencies": { "d3": "~3.5.5", "ng-lodash": "~0.2.0", - "nvd3": "~1.7.1", - "angularjs-nvd3-directives": "~0.0.7", - "angular-route": "~1.3.15" + "angular-route": "~1.3.15", + "n3-line-chart": "~1.1.6" }, "overrides": { "nvd3": { - "ignore": true, "main": [ - "**/*css" + "build/nv.d3.js" ] } } diff --git a/data/DATA_README.md b/data/DATA_README.md index 5ac60a97..8a7cff0d 100644 --- a/data/DATA_README.md +++ b/data/DATA_README.md @@ -1,6 +1,3 @@ Explain WTF is going on here.... - -#TODO - - Fix ALL Ship internal component defaults \ No newline at end of file diff --git a/data/component_ids.md b/data/component_ids.md new file mode 100644 index 00000000..2120d4a9 --- /dev/null +++ b/data/component_ids.md @@ -0,0 +1,21 @@ + +2h - Basic Discovery scanner + +Shield Generator + 3v - 2E + 44 - 3E + 49 - 4E + 4e - 5E + 4j - 6E + 4o - 7E + 4t - 8E + +Cargo Hold + 00 - 1E + 01 - 2E + 02 - 3E + 03 - 4E + 04 - 5E + 05 - 6E + 06 - 7E + 07 - 8E \ No newline at end of file diff --git a/data/components/common/frame_shift_drive.json b/data/components/common/frame_shift_drive.json index 895a6eb2..4f6684cd 100644 --- a/data/components/common/frame_shift_drive.json +++ b/data/components/common/frame_shift_drive.json @@ -1,168 +1,58 @@ { - "2A": { - "class": 2, + "6A": { + "class": 6, "rating": "A", - "cost": 160224, - "mass": 2.5, - "power": 0.3, - "optmass": 90, - "maxfuel": 0.9, + "cost": 16179531, + "mass": 40, + "power": 0.75, + "optmass": 1800, + "maxfuel": 8, "fuelmul": 0.012, - "fuelpower": 2 + "fuelpower": 2.6 }, - "2B": { - "class": 2, + "6B": { + "class": 6, "rating": "B", - "cost": 53408, - "mass": 4, - "power": 0.25, - "optmass": 75, - "maxfuel": 0.8, + "cost": 5393177, + "mass": 64, + "power": 0.63, + "optmass": 1500, + "maxfuel": 6.6, "fuelmul": 0.01, - "fuelpower": 2 + "fuelpower": 2.6 }, - "2C": { - "class": 2, + "6C": { + "class": 6, "rating": "C", - "cost": 17803, - "mass": 2.5, - "power": 0.2, - "optmass": 60, - "maxfuel": 0.6, + "cost": 1797726, + "mass": 40, + "power": 0.5, + "optmass": 1200, + "maxfuel": 5.3, "fuelmul": 0.008, - "fuelpower": 2 + "fuelpower": 2.6 }, - "2D": { - "class": 2, + "6D": { + "class": 6, "rating": "D", - "cost": 5934, - "mass": 1, - "power": 0.18, - "optmass": 54, - "maxfuel": 0.6, - "fuelmul": 0.01, - "fuelpower": 2 - }, - "2E": { - "class": 2, - "rating": "E", - "cost": 1978, - "mass": 2.5, - "power": 0.16, - "optmass": 48, - "maxfuel": 0.6, - "fuelmul": 0.011, - "fuelpower": 2 - }, - "3A": { - "class": 3, - "rating": "A", - "cost": 507912, - "mass": 5, - "power": 0.45, - "optmass": 150, - "maxfuel": 1.8, - "fuelmul": 0.012, - "fuelpower": 2.15 - }, - "3B": { - "class": 3, - "rating": "B", - "cost": 169304, - "mass": 8, - "power": 0.38, - "optmass": 125, - "maxfuel": 1.5, - "fuelmul": 0.01, - "fuelpower": 2.15 - }, - "3C": { - "class": 3, - "rating": "C", - "cost": 56435, - "mass": 5, - "power": 0.3, - "optmass": 100, - "maxfuel": 1.2, - "fuelmul": 0.008, - "fuelpower": 2.15 - }, - "3D": { - "class": 3, - "rating": "D", - "cost": 18812, - "mass": 2, - "power": 0.27, - "optmass": 90, - "maxfuel": 1.2, - "fuelmul": 0.01, - "fuelpower": 2.15 - }, - "3E": { - "class": 3, - "rating": "E", - "cost": 6271, - "mass": 5, - "power": 0.24, - "optmass": 80, - "maxfuel": 1.2, - "fuelmul": 0.011, - "fuelpower": 2.15 - }, - "4A": { - "class": 4, - "rating": "A", - "cost": 1610080, - "mass": 10, - "power": 0.45, - "optmass": 525, - "maxfuel": 3, - "fuelmul": 0.012, - "fuelpower": 2.3 - }, - "4B": { - "class": 4, - "rating": "B", - "cost": 536693, + "cost": 599242, "mass": 16, - "power": 0.38, - "optmass": 438, - "maxfuel": 2.5, + "power": 0.45, + "optmass": 1080, + "maxfuel": 5.3, "fuelmul": 0.01, - "fuelpower": 2.3 + "fuelpower": 2.6 }, - "4C": { - "class": 4, - "rating": "C", - "cost": 178898, - "mass": 10, - "power": 0.3, - "optmass": 350, - "maxfuel": 2, - "fuelmul": 0.008, - "fuelpower": 2.3 - }, - "4D": { - "class": 4, - "rating": "D", - "cost": 59633, - "mass": 4, - "power": 0.27, - "optmass": 315, - "maxfuel": 2, - "fuelmul": 0.01, - "fuelpower": 2.3 - }, - "4E": { - "class": 4, + "6E": { + "class": 6, "rating": "E", - "cost": 19878, - "mass": 10, - "power": 0.24, - "optmass": 280, - "maxfuel": 2, + "cost": 199747, + "mass": 40, + "power": 0.4, + "optmass": 960, + "maxfuel": 5.3, "fuelmul": 0.011, - "fuelpower": 2.3 + "fuelpower": 2.6 }, "5A": { "class": 5, @@ -219,59 +109,169 @@ "fuelmul": 0.011, "fuelpower": 2.45 }, - "6A": { - "class": 6, + "4A": { + "class": 4, "rating": "A", - "cost": 16179531, - "mass": 40, - "power": 0.75, - "optmass": 1800, - "maxfuel": 8, - "fuelmul": 0.012, - "fuelpower": 2.6 - }, - "6B": { - "class": 6, - "rating": "B", - "cost": 5393177, - "mass": 64, - "power": 0.63, - "optmass": 1500, - "maxfuel": 6.6, - "fuelmul": 0.01, - "fuelpower": 2.6 - }, - "6C": { - "class": 6, - "rating": "C", - "cost": 1797726, - "mass": 40, - "power": 0.5, - "optmass": 1200, - "maxfuel": 5.3, - "fuelmul": 0.008, - "fuelpower": 2.6 - }, - "6D": { - "class": 6, - "rating": "D", - "cost": 599242, - "mass": 16, + "cost": 1610080, + "mass": 10, "power": 0.45, - "optmass": 1080, - "maxfuel": 5.3, - "fuelmul": 0.01, - "fuelpower": 2.6 + "optmass": 525, + "maxfuel": 3, + "fuelmul": 0.012, + "fuelpower": 2.3 }, - "6E": { - "class": 6, + "4B": { + "class": 4, + "rating": "B", + "cost": 536693, + "mass": 16, + "power": 0.38, + "optmass": 438, + "maxfuel": 2.5, + "fuelmul": 0.01, + "fuelpower": 2.3 + }, + "4C": { + "class": 4, + "rating": "C", + "cost": 178898, + "mass": 10, + "power": 0.3, + "optmass": 350, + "maxfuel": 2, + "fuelmul": 0.008, + "fuelpower": 2.3 + }, + "4D": { + "class": 4, + "rating": "D", + "cost": 59633, + "mass": 4, + "power": 0.27, + "optmass": 315, + "maxfuel": 2, + "fuelmul": 0.01, + "fuelpower": 2.3 + }, + "4E": { + "class": 4, "rating": "E", - "cost": 199747, - "mass": 40, - "power": 0.4, - "optmass": 960, - "maxfuel": 5.3, + "cost": 19878, + "mass": 10, + "power": 0.24, + "optmass": 280, + "maxfuel": 2, "fuelmul": 0.011, - "fuelpower": 2.6 + "fuelpower": 2.3 + }, + "3A": { + "class": 3, + "rating": "A", + "cost": 507912, + "mass": 5, + "power": 0.45, + "optmass": 150, + "maxfuel": 1.8, + "fuelmul": 0.012, + "fuelpower": 2.15 + }, + "3B": { + "class": 3, + "rating": "B", + "cost": 169304, + "mass": 8, + "power": 0.38, + "optmass": 125, + "maxfuel": 1.5, + "fuelmul": 0.01, + "fuelpower": 2.15 + }, + "3C": { + "class": 3, + "rating": "C", + "cost": 56435, + "mass": 5, + "power": 0.3, + "optmass": 100, + "maxfuel": 1.2, + "fuelmul": 0.008, + "fuelpower": 2.15 + }, + "3D": { + "class": 3, + "rating": "D", + "cost": 18812, + "mass": 2, + "power": 0.27, + "optmass": 90, + "maxfuel": 1.2, + "fuelmul": 0.01, + "fuelpower": 2.15 + }, + "3E": { + "class": 3, + "rating": "E", + "cost": 6271, + "mass": 5, + "power": 0.24, + "optmass": 80, + "maxfuel": 1.2, + "fuelmul": 0.011, + "fuelpower": 2.15 + }, + "2A": { + "class": 2, + "rating": "A", + "cost": 160224, + "mass": 2.5, + "power": 0.3, + "optmass": 90, + "maxfuel": 0.9, + "fuelmul": 0.012, + "fuelpower": 2 + }, + "2B": { + "class": 2, + "rating": "B", + "cost": 53408, + "mass": 4, + "power": 0.25, + "optmass": 75, + "maxfuel": 0.8, + "fuelmul": 0.01, + "fuelpower": 2 + }, + "2C": { + "class": 2, + "rating": "C", + "cost": 17803, + "mass": 2.5, + "power": 0.2, + "optmass": 60, + "maxfuel": 0.6, + "fuelmul": 0.008, + "fuelpower": 2 + }, + "2D": { + "class": 2, + "rating": "D", + "cost": 5934, + "mass": 1, + "power": 0.18, + "optmass": 54, + "maxfuel": 0.6, + "fuelmul": 0.01, + "fuelpower": 2 + }, + "2E": { + "class": 2, + "rating": "E", + "cost": 1978, + "mass": 2.5, + "power": 0.16, + "optmass": 48, + "maxfuel": 0.6, + "fuelmul": 0.011, + "fuelpower": 2 } } diff --git a/data/components/common/fuel_tank.json b/data/components/common/fuel_tank.json index da096ba0..ca74036e 100644 --- a/data/components/common/fuel_tank.json +++ b/data/components/common/fuel_tank.json @@ -1,27 +1,9 @@ { - "1C": { - "class": 1, + "6C": { + "class": 6, "rating": "C", - "cost": 1000, - "capacity": 2 - }, - "2C": { - "class": 2, - "rating": "C", - "cost": 3750, - "capacity": 4 - }, - "3C": { - "class": 3, - "rating": "C", - "cost": 7063, - "capacity": 8 - }, - "4C": { - "class": 4, - "rating": "C", - "cost": 24734, - "capacity": 16 + "cost": 341577, + "capacity": 64 }, "5C": { "class": 5, @@ -29,10 +11,29 @@ "cost": 97754, "capacity": 32 }, - "6C": { - "class": 6, + "4C": { + "class": 4, "rating": "C", - "cost": 341577, - "capacity": 64 + "cost": 24734, + "capacity": 16 + }, + "3C": { + "class": 3, + "rating": "C", + "cost": 7063, + "capacity": 8 + }, + "2C": { + "class": 2, + "rating": "C", + "cost": 3750, + "capacity": 4 + }, + "1C": { + "class": 1, + "rating": "C", + "cost": 1000, + "capacity": 2 } + } \ No newline at end of file diff --git a/data/components/common/power_plant.json b/data/components/common/power_plant.json index 8be517c4..0c469aad 100644 --- a/data/components/common/power_plant.json +++ b/data/components/common/power_plant.json @@ -1,162 +1,82 @@ { - "2A": { - "class": 2, + "8A": { + "class": 8, "rating": "A", - "cost": 160224, - "mass": 1.3, - "pGen": 9.6, + "cost": 162586486, + "mass": 80, + "pGen": 36, "eff": "B" }, - "2B": { - "class": 2, + "8B": { + "class": 8, "rating": "B", - "cost": 53408, - "mass": 2, - "pGen": 8.8, + "cost": 54195495, + "mass": 128, + "pGen": 33, "eff": "C" }, - "2C": { - "class": 2, + "8C": { + "class": 8, "rating": "C", - "cost": 17803, - "mass": 1.3, - "pGen": 8, + "cost": 18065165, + "mass": 80, + "pGen": 30, "eff": "C" }, - "2D": { - "class": 2, + "8D": { + "class": 8, "rating": "D", - "cost": 5934, - "mass": 1, - "pGen": 7.2, + "cost": 6021722, + "mass": 64, + "pGen": 27, "eff": "D" }, - "2E": { - "class": 2, + "8E": { + "class": 8, "rating": "E", - "cost": 1978, - "mass": 2.5, - "pGen": 6.4, + "cost": 2007241, + "mass": 160, + "pGen": 24, "eff": "F" }, - "3A": { - "class": 3, + "7A": { + "class": 7, "rating": "A", - "cost": 507912, - "mass": 2.5, - "pGen": 12, + "cost": 51289112, + "mass": 40, + "pGen": 30, "eff": "B" }, - "3B": { - "class": 3, + "7B": { + "class": 7, "rating": "B", - "cost": 169304, - "mass": 4, - "pGen": 11, + "cost": 17096371, + "mass": 64, + "pGen": 27.5, "eff": "C" }, - "3C": { - "class": 3, + "7C": { + "class": 7, "rating": "C", - "cost": 56435, - "mass": 2.5, - "pGen": 10, + "cost": 5698790, + "mass": 40, + "pGen": 25, "eff": "C" }, - "3D": { - "class": 3, + "7D": { + "class": 7, "rating": "D", - "cost": 18812, - "mass": 2, - "pGen": 9, + "cost": 1899597, + "mass": 32, + "pGen": 22.5, "eff": "D" }, - "3E": { - "class": 3, + "7E": { + "class": 7, "rating": "E", - "cost": 6271, - "mass": 5, - "pGen": 8, - "eff": "F" - }, - "4A": { - "class": 4, - "rating": "A", - "cost": 1610080, - "mass": 5, - "pGen": 15.6, - "eff": "B" - }, - "4B": { - "class": 4, - "rating": "B", - "cost": 536693, - "mass": 8, - "pGen": 14.3, - "eff": "C" - }, - "4C": { - "class": 4, - "rating": "C", - "cost": 178898, - "mass": 5, - "pGen": 13, - "eff": "C" - }, - "4D": { - "class": 4, - "rating": "D", - "cost": 59633, - "mass": 4, - "pGen": 11.7, - "eff": "D" - }, - "4E": { - "class": 4, - "rating": "E", - "cost": 19878, - "mass": 10, - "pGen": 10.4, - "eff": "F" - }, - "5A": { - "class": 5, - "rating": "A", - "cost": 5103953, - "mass": 10, - "pGen": 20.4, - "eff": "B" - }, - "5B": { - "class": 5, - "rating": "B", - "cost": 1701318, - "mass": 16, - "pGen": 18.7, - "eff": "C" - }, - "5C": { - "class": 5, - "rating": "C", - "cost": 567106, - "mass": 10, - "pGen": 17, - "eff": "C" - }, - "5D": { - "class": 5, - "rating": "D", - "cost": 189035, - "mass": 8, - "pGen": 15.3, - "eff": "D" - }, - "5E": { - "class": 5, - "rating": "E", - "cost": 63012, - "mass": 20, - "pGen": 13.6, + "cost": 633199, + "mass": 80, + "pGen": 20, "eff": "F" }, "6A": { @@ -199,84 +119,164 @@ "pGen": 16.8, "eff": "F" }, - "7A": { - "class": 7, + "5A": { + "class": 5, "rating": "A", - "cost": 51289112, - "mass": 40, - "pGen": 30, + "cost": 5103953, + "mass": 10, + "pGen": 20.4, "eff": "B" }, - "7B": { - "class": 7, + "5B": { + "class": 5, "rating": "B", - "cost": 17096371, - "mass": 64, - "pGen": 27.5, + "cost": 1701318, + "mass": 16, + "pGen": 18.7, "eff": "C" }, - "7C": { - "class": 7, + "5C": { + "class": 5, "rating": "C", - "cost": 5698790, - "mass": 40, - "pGen": 25, + "cost": 567106, + "mass": 10, + "pGen": 17, "eff": "C" }, - "7D": { - "class": 7, + "5D": { + "class": 5, "rating": "D", - "cost": 1899597, - "mass": 32, - "pGen": 22.5, + "cost": 189035, + "mass": 8, + "pGen": 15.3, "eff": "D" }, - "7E": { - "class": 7, + "5E": { + "class": 5, "rating": "E", - "cost": 633199, - "mass": 80, - "pGen": 20, + "cost": 63012, + "mass": 20, + "pGen": 13.6, "eff": "F" }, - "8A": { - "class": 8, + "4A": { + "class": 4, "rating": "A", - "cost": 162586486, - "mass": 80, - "pGen": 36, + "cost": 1610080, + "mass": 5, + "pGen": 15.6, "eff": "B" }, - "8B": { - "class": 8, + "4B": { + "class": 4, "rating": "B", - "cost": 54195495, - "mass": 128, - "pGen": 33, + "cost": 536693, + "mass": 8, + "pGen": 14.3, "eff": "C" }, - "8C": { - "class": 8, + "4C": { + "class": 4, "rating": "C", - "cost": 18065165, - "mass": 80, - "pGen": 30, + "cost": 178898, + "mass": 5, + "pGen": 13, "eff": "C" }, - "8D": { - "class": 8, + "4D": { + "class": 4, "rating": "D", - "cost": 6021722, - "mass": 64, - "pGen": 27, + "cost": 59633, + "mass": 4, + "pGen": 11.7, "eff": "D" }, - "8E": { - "class": 8, + "4E": { + "class": 4, "rating": "E", - "cost": 2007241, - "mass": 160, - "pGen": 24, + "cost": 19878, + "mass": 10, + "pGen": 10.4, + "eff": "F" + }, + "3A": { + "class": 3, + "rating": "A", + "cost": 507912, + "mass": 2.5, + "pGen": 12, + "eff": "B" + }, + "3B": { + "class": 3, + "rating": "B", + "cost": 169304, + "mass": 4, + "pGen": 11, + "eff": "C" + }, + "3C": { + "class": 3, + "rating": "C", + "cost": 56435, + "mass": 2.5, + "pGen": 10, + "eff": "C" + }, + "3D": { + "class": 3, + "rating": "D", + "cost": 18812, + "mass": 2, + "pGen": 9, + "eff": "D" + }, + "3E": { + "class": 3, + "rating": "E", + "cost": 6271, + "mass": 5, + "pGen": 8, + "eff": "F" + }, + "2A": { + "class": 2, + "rating": "A", + "cost": 160224, + "mass": 1.3, + "pGen": 9.6, + "eff": "B" + }, + "2B": { + "class": 2, + "rating": "B", + "cost": 53408, + "mass": 2, + "pGen": 8.8, + "eff": "C" + }, + "2C": { + "class": 2, + "rating": "C", + "cost": 17803, + "mass": 1.3, + "pGen": 8, + "eff": "C" + }, + "2D": { + "class": 2, + "rating": "D", + "cost": 5934, + "mass": 1, + "pGen": 7.2, + "eff": "D" + }, + "2E": { + "class": 2, + "rating": "E", + "cost": 1978, + "mass": 2.5, + "pGen": 6.4, "eff": "F" } } diff --git a/data/components/hardpoints/shield_booster.json b/data/components/hardpoints/shield_booster.json index be344109..3aa39b26 100644 --- a/data/components/hardpoints/shield_booster.json +++ b/data/components/hardpoints/shield_booster.json @@ -8,7 +8,7 @@ "mass": 3.5, "power": 1.2, "passive": 1, - "shieldmul": 1.2 + "shieldmul": 0.2 }, "05": { "group": "ub", @@ -19,7 +19,7 @@ "mass": 3, "power": 1, "passive": 1, - "shieldmul": 1.16 + "shieldmul": 0.16 }, "06": { "group": "ub", @@ -30,7 +30,7 @@ "mass": 2, "power": 0.7, "passive": 1, - "shieldmul": 1.12 + "shieldmul": 0.12 }, "07": { "group": "ub", @@ -41,7 +41,7 @@ "mass": 1, "power": 0.5, "passive": 1, - "shieldmul": 1.08 + "shieldmul": 0.08 }, "08": { "group": "ub", @@ -52,6 +52,6 @@ "mass": 0.5, "power": 0.2, "passive": 1, - "shieldmul": 1.04 + "shieldmul": 0.04 } } \ No newline at end of file diff --git a/data/components/internal/fuel_scoops.json b/data/components/internal/fuel_scoops.json index b957dc4d..71493bce 100644 --- a/data/components/internal/fuel_scoops.json +++ b/data/components/internal/fuel_scoops.json @@ -2,7 +2,6 @@ "Fuel Scoops": { "30": { "group": "fs", - "name": "Fuel Scoop", "class": 3, "rating": "D", "cost": 14109, @@ -11,7 +10,6 @@ }, "31": { "group": "fs", - "name": "Fuel Scoop", "class": 3, "rating": "E", "cost": 3386, @@ -20,7 +18,6 @@ }, "32": { "group": "fs", - "name": "Fuel Scoop", "class": 4, "rating": "A", "cost": 2862364, @@ -29,7 +26,6 @@ }, "33": { "group": "fs", - "name": "Fuel Scoop", "class": 4, "rating": "B", "cost": 715591, @@ -38,7 +34,6 @@ }, "34": { "group": "fs", - "name": "Fuel Scoop", "class": 4, "rating": "C", "cost": 178898, @@ -47,7 +42,6 @@ }, "35": { "group": "fs", - "name": "Fuel Scoop", "class": 4, "rating": "D", "cost": 44724, @@ -56,7 +50,6 @@ }, "36": { "group": "fs", - "name": "Fuel Scoop", "class": 4, "rating": "E", "cost": 10734, @@ -65,7 +58,6 @@ }, "37": { "group": "fs", - "name": "Fuel Scoop", "class": 5, "rating": "A", "cost": 9073694, @@ -74,7 +66,6 @@ }, "38": { "group": "fs", - "name": "Fuel Scoop", "class": 5, "rating": "B", "cost": 2268424, @@ -83,7 +74,6 @@ }, "39": { "group": "fs", - "name": "Fuel Scoop", "class": 5, "rating": "C", "cost": 567106, @@ -92,7 +82,6 @@ }, "2j": { "group": "fs", - "name": "Fuel Scoop", "class": 1, "rating": "A", "cost": 82270, @@ -101,7 +90,6 @@ }, "2k": { "group": "fs", - "name": "Fuel Scoop", "class": 1, "rating": "B", "cost": 20568, @@ -110,7 +98,6 @@ }, "2l": { "group": "fs", - "name": "Fuel Scoop", "class": 1, "rating": "C", "cost": 5142, @@ -119,7 +106,6 @@ }, "2m": { "group": "fs", - "name": "Fuel Scoop", "class": 1, "rating": "D", "cost": 1285, @@ -128,7 +114,6 @@ }, "2n": { "group": "fs", - "name": "Fuel Scoop", "class": 1, "rating": "E", "cost": 309, @@ -137,7 +122,6 @@ }, "2o": { "group": "fs", - "name": "Fuel Scoop", "class": 2, "rating": "A", "cost": 284844, @@ -146,7 +130,6 @@ }, "2p": { "group": "fs", - "name": "Fuel Scoop", "class": 2, "rating": "B", "cost": 71211, @@ -155,7 +138,6 @@ }, "2q": { "group": "fs", - "name": "Fuel Scoop", "class": 2, "rating": "C", "cost": 17803, @@ -164,7 +146,6 @@ }, "2r": { "group": "fs", - "name": "Fuel Scoop", "class": 2, "rating": "D", "cost": 4451, @@ -173,7 +154,6 @@ }, "2s": { "group": "fs", - "name": "Fuel Scoop", "class": 2, "rating": "E", "cost": 1068, @@ -182,7 +162,6 @@ }, "2t": { "group": "fs", - "name": "Fuel Scoop", "class": 3, "rating": "A", "cost": 902954, @@ -191,7 +170,6 @@ }, "2u": { "group": "fs", - "name": "Fuel Scoop", "class": 3, "rating": "B", "cost": 225738, @@ -200,7 +178,6 @@ }, "2v": { "group": "fs", - "name": "Fuel Scoop", "class": 3, "rating": "C", "cost": 56435, @@ -209,7 +186,6 @@ }, "3a": { "group": "fs", - "name": "Fuel Scoop", "class": 5, "rating": "D", "cost": 141776, @@ -218,7 +194,6 @@ }, "3b": { "group": "fs", - "name": "Fuel Scoop", "class": 5, "rating": "E", "cost": 34026, @@ -227,7 +202,6 @@ }, "3c": { "group": "fs", - "name": "Fuel Scoop", "class": 6, "rating": "A", "cost": 28763610, @@ -236,7 +210,6 @@ }, "3d": { "group": "fs", - "name": "Fuel Scoop", "class": 6, "rating": "B", "cost": 7190903, @@ -245,7 +218,6 @@ }, "3e": { "group": "fs", - "name": "Fuel Scoop", "class": 6, "rating": "C", "cost": 1797726, @@ -254,7 +226,6 @@ }, "3f": { "group": "fs", - "name": "Fuel Scoop", "class": 6, "rating": "D", "cost": 449431, @@ -263,7 +234,6 @@ }, "3g": { "group": "fs", - "name": "Fuel Scoop", "class": 6, "rating": "E", "cost": 107864, @@ -272,7 +242,6 @@ }, "3h": { "group": "fs", - "name": "Fuel Scoop", "class": 7, "rating": "A", "cost": 91180644, @@ -281,7 +250,6 @@ }, "3i": { "group": "fs", - "name": "Fuel Scoop", "class": 7, "rating": "B", "cost": 22795161, @@ -290,7 +258,6 @@ }, "3j": { "group": "fs", - "name": "Fuel Scoop", "class": 7, "rating": "C", "cost": 5698790, @@ -299,7 +266,6 @@ }, "3k": { "group": "fs", - "name": "Fuel Scoop", "class": 7, "rating": "D", "cost": 1424698, @@ -308,7 +274,6 @@ }, "3l": { "group": "fs", - "name": "Fuel Scoop", "class": 7, "rating": "E", "cost": 341927, @@ -317,7 +282,6 @@ }, "3m": { "group": "fs", - "name": "Fuel Scoop", "class": 8, "rating": "A", "cost": 289042541, @@ -326,7 +290,6 @@ }, "3n": { "group": "fs", - "name": "Fuel Scoop", "class": 8, "rating": "B", "cost": 72260660, @@ -335,7 +298,6 @@ }, "3o": { "group": "fs", - "name": "Fuel Scoop", "class": 8, "rating": "C", "cost": 18065165, @@ -344,7 +306,6 @@ }, "3p": { "group": "fs", - "name": "Fuel Scoop", "class": 8, "rating": "D", "cost": 4516291, @@ -353,7 +314,6 @@ }, "3q": { "group": "fs", - "name": "Fuel Scoop", "class": 8, "rating": "E", "cost": 1083910, diff --git a/data/components/internal/refinery.json b/data/components/internal/refinery.json index 538ac8d3..62e9c1f0 100644 --- a/data/components/internal/refinery.json +++ b/data/components/internal/refinery.json @@ -6,7 +6,7 @@ "rating": "B", "cost": 1500282, "power": 0.49, - "capacity": 9 + "bins": 9 }, "21": { "group": "rf", @@ -14,7 +14,7 @@ "rating": "C", "cost": 500094, "power": 0.41, - "capacity": 7 + "bins": 7 }, "22": { "group": "rf", @@ -22,7 +22,7 @@ "rating": "D", "cost": 166698, "power": 0.33, - "capacity": 5 + "bins": 5 }, "23": { "group": "rf", @@ -30,7 +30,7 @@ "rating": "E", "cost": 55566, "power": 0.25, - "capacity": 4 + "bins": 4 }, "1g": { "group": "rf", @@ -38,7 +38,7 @@ "rating": "A", "cost": 486000, "power": 0.32, - "capacity": 4 + "bins": 4 }, "1h": { "group": "rf", @@ -46,7 +46,7 @@ "rating": "B", "cost": 162000, "power": 0.28, - "capacity": 3 + "bins": 3 }, "1i": { "group": "rf", @@ -54,7 +54,7 @@ "rating": "C", "cost": 54000, "power": 0.23, - "capacity": 2 + "bins": 2 }, "1j": { "group": "rf", @@ -62,7 +62,7 @@ "rating": "D", "cost": 18000, "power": 0.18, - "capacity": 1 + "bins": 1 }, "1k": { "group": "rf", @@ -70,7 +70,7 @@ "rating": "E", "cost": 6000, "power": 0.14, - "capacity": 1 + "bins": 1 }, "1l": { "group": "rf", @@ -78,7 +78,7 @@ "rating": "A", "cost": 1020600, "power": 0.39, - "capacity": 6 + "bins": 6 }, "1m": { "group": "rf", @@ -86,7 +86,7 @@ "rating": "B", "cost": 340200, "power": 0.34, - "capacity": 5 + "bins": 5 }, "1n": { "group": "rf", @@ -94,7 +94,7 @@ "rating": "C", "cost": 113400, "power": 0.28, - "capacity": 4 + "bins": 4 }, "1o": { "group": "rf", @@ -102,7 +102,7 @@ "rating": "D", "cost": 37800, "power": 0.22, - "capacity": 3 + "bins": 3 }, "1p": { "group": "rf", @@ -110,7 +110,7 @@ "rating": "E", "cost": 12600, "power": 0.17, - "capacity": 2 + "bins": 2 }, "1q": { "group": "rf", @@ -118,7 +118,7 @@ "rating": "A", "cost": 2143260, "power": 0.48, - "capacity": 8 + "bins": 8 }, "1r": { "group": "rf", @@ -126,7 +126,7 @@ "rating": "B", "cost": 714420, "power": 0.41, - "capacity": 7 + "bins": 7 }, "1s": { "group": "rf", @@ -134,7 +134,7 @@ "rating": "C", "cost": 238140, "power": 0.34, - "capacity": 6 + "bins": 6 }, "1t": { "group": "rf", @@ -142,7 +142,7 @@ "rating": "D", "cost": 79380, "power": 0.27, - "capacity": 4 + "bins": 4 }, "1u": { "group": "rf", @@ -150,7 +150,7 @@ "rating": "E", "cost": 26460, "power": 0.2, - "capacity": 3 + "bins": 3 }, "1v": { "group": "rf", @@ -158,7 +158,7 @@ "rating": "A", "cost": 4500846, "power": 0.57, - "capacity": 10 + "bins": 10 } } } \ No newline at end of file diff --git a/data/ships/adder.json b/data/ships/adder.json index 269dce0f..da7ab44f 100644 --- a/data/ships/adder.json +++ b/data/ships/adder.json @@ -54,11 +54,11 @@ 0 ], "internal": [ + "01", + "44", + "00", 0, - 0, - 0, - 0, - 0 + "2h" ] }, "mass": 35 diff --git a/data/ships/anaconda.json b/data/ships/anaconda.json index 58655655..48aff087 100644 --- a/data/ships/anaconda.json +++ b/data/ships/anaconda.json @@ -82,17 +82,17 @@ 0 ], "internal": [ + "05", + "04", + "4j", + 0, + "03", 0, 0, 0, 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0 + "2h", + "00" ] }, "mass": 400 diff --git a/data/ships/asp.json b/data/ships/asp.json index 7bf0baa3..a9425069 100644 --- a/data/ships/asp.json +++ b/data/ships/asp.json @@ -22,16 +22,16 @@ 5 ], "hardpoints": [ - 0, - 0, - 0, - 0, - 1, - 1, - 1, - 1, 2, - 2 + 2, + 1, + 1, + 1, + 1, + 0, + 0, + 0, + 0 ], "internal": [ 6, @@ -54,8 +54,6 @@ "5C" ], "hardpoints": [ - 0, - 0, 0, 0, 17, @@ -63,16 +61,18 @@ 0, 0, 0, + 0, + 0, 0 ], "internal": [ + "04", + "4e", + "01", 0, 0, - 0, - 0, - 0, - 0, - 0 + "00", + "2h" ] }, "mass": 280 diff --git a/data/ships/cobra_mk_iii.json b/data/ships/cobra_mk_iii.json index 6348a4fc..a331a238 100644 --- a/data/ships/cobra_mk_iii.json +++ b/data/ships/cobra_mk_iii.json @@ -57,12 +57,12 @@ 0 ], "internal": [ + "02", + "02", + "4e", + "00", 0, - 0, - 0, - 0, - 0, - 0 + "2h" ] }, "mass": 180 diff --git a/data/ships/eagle.json b/data/ships/eagle.json index d50900f1..94f9fc4d 100644 --- a/data/ships/eagle.json +++ b/data/ships/eagle.json @@ -50,9 +50,9 @@ 0 ], "internal": [ - 0, - 0, - 0 + "44", + "00", + "2h" ] }, "mass": 50 diff --git a/data/ships/federal_dropship.json b/data/ships/federal_dropship.json index 0a990c4a..77f0b092 100644 --- a/data/ships/federal_dropship.json +++ b/data/ships/federal_dropship.json @@ -22,15 +22,15 @@ 4 ], "hardpoints": [ - 0, - 0, - 0, - 0, - 2, - 2, 3, 2, - 2 + 2, + 2, + 2, + 0, + 0, + 0, + 0 ], "internal": [ 6, @@ -53,24 +53,24 @@ "4C" ], "hardpoints": [ - 0, - 0, - 0, - 0, - 0, - 0, 0, 17, - 17 - ], - "internal": [ - 0, + 17, 0, 0, 0, 0, 0, 0 + ], + "internal": [ + "04", + "03", + "4e", + "02", + 0, + 0, + "2h" ] }, "mass": 580 diff --git a/data/ships/fer_de_lance.json b/data/ships/fer_de_lance.json index 152be082..47de37f6 100644 --- a/data/ships/fer_de_lance.json +++ b/data/ships/fer_de_lance.json @@ -66,11 +66,11 @@ 0 ], "internal": [ + "03", + "49", + "02", 0, - 0, - 0, - 0, - 0 + "2h" ] }, "mass": 250 diff --git a/data/ships/hauler.json b/data/ships/hauler.json index ba3355e0..1c2ce56f 100644 --- a/data/ships/hauler.json +++ b/data/ships/hauler.json @@ -49,10 +49,10 @@ 0 ], "internal": [ - 0, - 0, - 0, - 0 + "01", + "01", + "3v", + "2h" ] }, "mass": 14 diff --git a/data/ships/imperial_clipper.json b/data/ships/imperial_clipper.json index 023dae07..c2fe99fe 100644 --- a/data/ships/imperial_clipper.json +++ b/data/ships/imperial_clipper.json @@ -63,14 +63,14 @@ 0 ], "internal": [ + "05", + "4j", + "02", 0, 0, 0, - 0, - 0, - 0, - 0, - 0 + "00", + "2h" ] }, "mass": 400 diff --git a/data/ships/orca.json b/data/ships/orca.json index 08a0e912..bac989e5 100644 --- a/data/ships/orca.json +++ b/data/ships/orca.json @@ -61,14 +61,14 @@ 0 ], "internal": [ + "04", + "03", + "03", + "4e", + "02", 0, 0, - 0, - 0, - 0, - 0, - 0, - 0 + "2h" ] }, "mass": 580 diff --git a/data/ships/python.json b/data/ships/python.json index 434def4a..6ef0e4c9 100644 --- a/data/ships/python.json +++ b/data/ships/python.json @@ -66,15 +66,15 @@ 0 ], "internal": [ + "04", + "04", + "4j", + "03", 0, 0, 0, - 0, - 0, - 0, - 0, - 0, - 0 + "00", + "2h" ] }, "mass": 350 diff --git a/data/ships/sidewinder.json b/data/ships/sidewinder.json index d7816a7c..3c97badf 100644 --- a/data/ships/sidewinder.json +++ b/data/ships/sidewinder.json @@ -50,9 +50,9 @@ 0 ], "internal": [ - 0, - 0, - 0 + "3v", + "01", + "2h" ] }, "mass": 25 diff --git a/data/ships/type_6_transporter.json b/data/ships/type_6_transporter.json index 50ec7281..6ea2689d 100644 --- a/data/ships/type_6_transporter.json +++ b/data/ships/type_6_transporter.json @@ -56,13 +56,13 @@ 0 ], "internal": [ - 0, - 0, - 0, - 0, - 0, - 0, - 0 + "03", + "03", + "02", + "02", + "44", + "00", + "2h" ] }, "mass": 155 diff --git a/data/ships/type_7_transport.json b/data/ships/type_7_transport.json index 304a67bd..62030a1f 100644 --- a/data/ships/type_7_transport.json +++ b/data/ships/type_7_transport.json @@ -63,14 +63,14 @@ 0 ], "internal": [ + "04", + "04", + "03", + "03", + "02", + "49", 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0 + "2h" ] }, "mass": 420 diff --git a/data/ships/type_9_heavy.json b/data/ships/type_9_heavy.json index 562f0852..c3175a27 100644 --- a/data/ships/type_9_heavy.json +++ b/data/ships/type_9_heavy.json @@ -33,6 +33,7 @@ 0 ], "internal": [ + 8, 7, 6, 5, @@ -65,15 +66,15 @@ 0 ], "internal": [ + "06", + "05", + "4j", + "03", + "02", 0, + "01", 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0 + "2h" ] }, "mass": 1000 diff --git a/data/ships/viper.json b/data/ships/viper.json index a8192282..54d648ec 100644 --- a/data/ships/viper.json +++ b/data/ships/viper.json @@ -55,10 +55,10 @@ 0 ], "internal": [ + "01", + "44", 0, - 0, - 0, - 0 + "2h" ] }, "mass": 60 diff --git a/data/ships/vulture.json b/data/ships/vulture.json index e75ff6c3..e049dfca 100644 --- a/data/ships/vulture.json +++ b/data/ships/vulture.json @@ -56,11 +56,11 @@ 0 ], "internal": [ + "4e", + "02", 0, 0, - 0, - 0, - 0 + "2h" ] }, "mass": 230 diff --git a/gulpfile.js b/gulpfile.js index a4627f3e..f7ef77af 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -1,18 +1,18 @@ -var gulp = require('gulp'), - less = require('gulp-less'), - jshint = require('gulp-jshint'), - minifyCSS = require('gulp-minify-css'), - concat = require('gulp-concat'), - uglify = require('gulp-uglify'), - sourcemaps = require('gulp-sourcemaps'), - templateCache = require('gulp-angular-templatecache'), - htmlmin = require('gulp-htmlmin'), - template = require('gulp-template'), - mainBowerFiles = require('main-bower-files'), - del = require('del'), - runSequence = require('run-sequence'), - exec = require('child_process').exec - pkg = require('./package.json'); +var gulp = require('gulp'), + less = require('gulp-less'), + jshint = require('gulp-jshint'), + minifyCSS = require('gulp-minify-css'), + concat = require('gulp-concat'), + uglify = require('gulp-uglify'), + sourcemaps = require('gulp-sourcemaps'), + templateCache = require('gulp-angular-templatecache'), + htmlmin = require('gulp-htmlmin'), + template = require('gulp-template'), + mainBowerFiles = require('main-bower-files'), + del = require('del'), + runSequence = require('run-sequence'), + exec = require('child_process').exec + pkg = require('./package.json'); gulp.task('less', function() { return gulp.src('app/less/app.less') @@ -107,6 +107,19 @@ gulp.task('generateIndexHTML', function() { version: pkg.version, date : (new Date()).toLocaleDateString() })) + .pipe(htmlmin({ + 'collapseBooleanAttributes': true, + 'collapseWhitespace': true, + 'removeAttributeQuotes': true, + 'removeComments': true, + 'removeEmptyAttributes': true, + 'removeRedundantAttributes': true, + 'removeScriptTypeAttributes': true, + 'removeStyleLinkTypeAttributes': true + }).on('error',function(e){ + console.log('File:', e.fileName); + console.log('Message:',e.message); + })) .pipe(gulp.dest('build')); }); @@ -138,4 +151,5 @@ gulp.task('watch', function() { gulp.task('clean', function (done) { del(['build'], done); }); gulp.task('build', function (done) { runSequence('clean', ['html2js','jsonToDB'], ['generateIndexHTML','bower','js','less','copy'], done); }); gulp.task('dev', function (done) { runSequence('build', 'serve','watch', done); }); +gulp.task('default', ['dev']); diff --git a/nginx.conf b/nginx.conf index 6a035bb1..d4ccc2d4 100644 --- a/nginx.conf +++ b/nginx.conf @@ -37,10 +37,11 @@ http { server { listen 3300; server_name localhost; + root ./build/; + index index.html; location / { - root ./build/; - index index.html index.htm; + try_files $uri $uri/ /index.html =404; } } } diff --git a/package.json b/package.json index 5646e464..1aca5fcf 100644 --- a/package.json +++ b/package.json @@ -1,9 +1,9 @@ { - "name": "ed_shipyard", - "version": "0.0.1", + "name": "coriolis_shipyard", + "version": "0.1.0", "repository": { "type": "git", - "url": "https://github.com/cmmcleod/ed-shipyard" + "url": "https://github.com/cmmcleod/coriolis" }, "private": true, "dependencies": {}, @@ -23,6 +23,7 @@ "json-concat": "0.0.0", "main-bower-files": "^2.6.2", "run-sequence": "^1.0.2", - "uglify-js": "^2.4.19" + "uglify-js": "^2.4.19", + "vinyl": "^0.4.6" } } diff --git a/scripts/json-to-db.js b/scripts/json-to-db.js index fddb0e5e..a33794dc 100644 --- a/scripts/json-to-db.js +++ b/scripts/json-to-db.js @@ -2,7 +2,6 @@ var fs = require('fs'); var UglifyJS = require('uglify-js'); var jsonConcat = require('json-concat'); var async = require('async'); - var db_filename = './app/js/db.js'; async.parallel([ @@ -27,28 +26,34 @@ async.parallel([ function done(err, json) { this(err,json); } function writeDB(err, arr) { - var db = { - ships: arr[0], - components: { - common: arr[1], - hardpoints: arr[2], - internal: arr[3], - bulkheads: arr[4] - } - }; + try { + var db = { + ships: arr[0], + components: { + common: arr[1], + hardpoints: arr[2], + internal: arr[3], + bulkheads: arr[4] + } + }; + } + catch (e) { + console.error(arguments); + exit(0); + } var ast = UglifyJS.parse('var DB = ' + JSON.stringify(db)); var code = ast.print_to_string({beautify: true, indent_level: 2}); fs.open(db_filename, 'w', function() { - fs.writeFile(db_filename, code, function(err) { - }); + fs.writeFile(db_filename, code, function(err) {}); }); + if (!fs.existsSync('./build')){ + fs.mkdirSync('./build'); + } + fs.open('./build/db.json', 'w', function() { - fs.writeFile('./build/db.json', JSON.stringify(db), function(err) { - }); + fs.writeFile('./build/db.json', JSON.stringify(db), function(err) {}); }); - } -