Skip to content
This repository has been archived by the owner on Apr 7, 2023. It is now read-only.

Commit

Permalink
Handle new Bi-Weave Shield Generator
Browse files Browse the repository at this point in the history
  • Loading branch information
sf302 committed Nov 14, 2015
1 parent 16c76b2 commit a713105
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
1 change: 1 addition & 0 deletions app/js/i18n/en.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ angular.module('app').config(['$translateProvider', function($translateProvider)
'build name': 'Build Name',
builds: 'builds',
bh: 'bulkheads',
'bsg': 'Bi-Weave Shield Generator',
ul: 'Burst Laser',
buy: 'buy',
cancel: 'cancel',
Expand Down
8 changes: 4 additions & 4 deletions app/js/shipyard/factory-ship.js
Original file line number Diff line number Diff line change
Expand Up @@ -110,9 +110,9 @@ angular.module('shipyard').factory('Ship', ['Components', 'calcShieldStrength',
*/
Ship.prototype.findInternalByGroup = function(group) {
var index;
if (group == 'sg' || group == 'psg') {
if (group == 'sg' || group == 'psg' || group == 'bsg') {
index = _.findIndex(this.internal, function(slot) {
return slot.c && (slot.c.grp == 'sg' || slot.c.grp == 'psg');
return slot.c && (slot.c.grp == 'sg' || slot.c.grp == 'psg' || slot.c.grp == 'bsg');
});
} else {
index = _.findIndex(this.internal, function(slot) {
Expand Down Expand Up @@ -303,7 +303,7 @@ angular.module('shipyard').factory('Ship', ['Components', 'calcShieldStrength',
if (slot.c) {
this.priorityBands[slot.priority][powerUsageType(slot, slot.c)] += enabled ? slot.c.power : -slot.c.power;

if (slot.c.grp == 'sg' || slot.c.grp == 'psg') {
if (slot.c.grp == 'sg' || slot.c.grp == 'psg' || slot.c.grp == 'bsg') {
this.updateShieldStrength();
} else if (slot.c.grp == 'sb') {
this.shieldMultiplier += slot.c.shieldmul * (enabled ? 1 : -1);
Expand Down Expand Up @@ -456,7 +456,7 @@ angular.module('shipyard').factory('Ship', ['Components', 'calcShieldStrength',
Ship.prototype.use = function(slot, id, component, preventUpdate) {
if (slot.id != id) { // Selecting a different component
// Slot is an internal slot, is not being emptied, and the selected component group/type must be of unique
if (slot.cat == 2 && component && _.includes(['psg', 'sg', 'rf', 'fs'], component.grp)) {
if (slot.cat == 2 && component && _.includes(['bsg', 'psg', 'sg', 'rf', 'fs'], component.grp)) {
// Find another internal slot that already has this type/group installed
var similarSlot = this.findInternalByGroup(component.grp);
// If another slot has an installed component with of the same type
Expand Down
1 change: 1 addition & 0 deletions app/js/shipyard/module-shipyard.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ angular.module('shipyard', ['ngLodash'])
scb: 'Shield Cell Bank',
sg: 'Shield Generator',
psg: 'Prismatic Shield Generator',
bsg: 'Bi-Weave Shield Generator',
dc: 'Docking Computer',
fx: 'Fuel Transfer Limpet Controller',
pc: 'Prospector Limpet Controller',
Expand Down

0 comments on commit a713105

Please sign in to comment.