Skip to content

Commit

Permalink
Merge branch 'release/2.2.8'
Browse files Browse the repository at this point in the history
  • Loading branch information
cmdrmcdonald committed Jan 13, 2017
2 parents 05e06f3 + 260f298 commit 2a84128
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 11 deletions.
7 changes: 7 additions & 0 deletions ChangeLog.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
#2.2.8
* Fix issue where filling all internals with cargo racks would include restricted slots
* Use coriolis-data 2.2.8:
* Set military slot of Viper Mk IV to class 3; was incorrectly set as class 2
* Update base regeneration rate of prismatic shield generators to values in 2.2.03
* Update specials with information in 2.2.03

#2.2.7
* Fix resistance diminishing return calculations
* Do not allow -100% to be entered as a modification value
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "coriolis_shipyard",
"version": "2.2.7",
"version": "2.2.8",
"repository": {
"type": "git",
"url": "https://github.com/EDCD/coriolis"
Expand Down
19 changes: 10 additions & 9 deletions src/app/components/InternalSlotSection.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import SlotSection from './SlotSection';
import InternalSlot from './InternalSlot';
import * as ModuleUtils from '../shipyard/ModuleUtils';
import { stopCtxPropagation } from '../utils/UtilityFunctions';
import { canMount } from '../utils/SlotFunctions';

/**
* Internal slot section
Expand Down Expand Up @@ -47,7 +48,7 @@ export default class InternalSlotSection extends SlotSection {
let clobber = event.getModifierState('Alt');
let ship = this.props.ship;
ship.internal.forEach((slot) => {
if ((clobber || !slot.m) && (!slot.eligible || slot.eligible.cr)) {
if ((clobber || !slot.m) && canMount(ship, slot, 'cr')) {
ship.use(slot, ModuleUtils.findInternal('cr', slot.maxClass, 'E'));
}
});
Expand All @@ -63,7 +64,7 @@ export default class InternalSlotSection extends SlotSection {
let clobber = event.getModifierState('Alt');
let ship = this.props.ship;
ship.internal.forEach((slot) => {
if ((clobber || !slot.m) && (!slot.eligible || slot.eligible.ft)) {
if ((clobber || !slot.m) && canMount(ship, slot, 'ft')) {
ship.use(slot, ModuleUtils.findInternal('ft', slot.maxClass, 'C'));
}
});
Expand All @@ -79,7 +80,7 @@ export default class InternalSlotSection extends SlotSection {
let clobber = event.getModifierState('Alt');
let ship = this.props.ship;
ship.internal.forEach((slot) => {
if ((clobber || !slot.m) && (!slot.eligible || slot.eligible.pcq)) {
if ((clobber || !slot.m) && canMount(ship, slot, 'pcq')) {
ship.use(slot, ModuleUtils.findInternal('pcq', Math.min(slot.maxClass, 6), 'B')); // Passenger cabins top out at 6
}
});
Expand All @@ -95,7 +96,7 @@ export default class InternalSlotSection extends SlotSection {
let clobber = event.getModifierState('Alt');
let ship = this.props.ship;
ship.internal.forEach((slot) => {
if ((clobber || !slot.m) && (!slot.eligible || slot.eligible.pcm)) {
if ((clobber || !slot.m) && canMount(ship, slot, 'pcm')) {
ship.use(slot, ModuleUtils.findInternal('pcm', Math.min(slot.maxClass, 6), 'C')); // Passenger cabins top out at 6
}
});
Expand All @@ -111,7 +112,7 @@ export default class InternalSlotSection extends SlotSection {
let clobber = event.getModifierState('Alt');
let ship = this.props.ship;
ship.internal.forEach((slot) => {
if ((clobber || !slot.m) && (!slot.eligible || slot.eligible.pci)) {
if ((clobber || !slot.m) && canMount(ship, slot, 'pci')) {
ship.use(slot, ModuleUtils.findInternal('pci', Math.min(slot.maxClass, 6), 'D')); // Passenger cabins top out at 6
}
});
Expand All @@ -127,7 +128,7 @@ export default class InternalSlotSection extends SlotSection {
let clobber = event.getModifierState('Alt');
let ship = this.props.ship;
ship.internal.forEach((slot) => {
if ((clobber || !slot.m) && (!slot.eligible || slot.eligible.pce)) {
if ((clobber || !slot.m) && canMount(ship, slot, 'pce')) {
ship.use(slot, ModuleUtils.findInternal('pce', Math.min(slot.maxClass, 6), 'E')); // Passenger cabins top out at 6
}
});
Expand All @@ -144,7 +145,7 @@ export default class InternalSlotSection extends SlotSection {
let ship = this.props.ship;
let chargeCap = 0; // Capacity of single activation
ship.internal.forEach(function(slot) {
if ((clobber || (!slot.m && !ModuleUtils.isShieldGenerator(slot.m.grp))) && (!slot.eligible || slot.eligible.scb)) {
if ((clobber && !(slot.m && ModuleUtils.isShieldGenerator(slot.m.grp)) || !slot.m) && canMount(ship, slot, 'scb')) {
ship.use(slot, ModuleUtils.findInternal('scb', slot.maxClass, 'A'));
ship.setSlotEnabled(slot, chargeCap <= ship.shieldStrength); // Don't waste cell capacity on overcharge
chargeCap += slot.m.recharge;
Expand All @@ -162,7 +163,7 @@ export default class InternalSlotSection extends SlotSection {
let clobber = event.getModifierState('Alt');
let ship = this.props.ship;
ship.internal.forEach((slot) => {
if ((clobber || !slot.m) && (!slot.eligible || slot.eligible.hr)) {
if ((clobber || !slot.m) && canMount(ship, slot, 'hr')) {
ship.use(slot, ModuleUtils.findInternal('hr', Math.min(slot.maxClass, 5), 'D')); // Hull reinforcements top out at 5D
}
});
Expand All @@ -178,7 +179,7 @@ export default class InternalSlotSection extends SlotSection {
let clobber = event.getModifierState('Alt');
let ship = this.props.ship;
ship.internal.forEach((slot) => {
if ((clobber || !slot.m) && (!slot.eligible || slot.eligible.mrp)) {
if ((clobber || !slot.m) && canMount(ship, slot, 'mrp')) {
ship.use(slot, ModuleUtils.findInternal('mrp', Math.min(slot.maxClass, 5), 'D')); // Module reinforcements top out at 5D
}
});
Expand Down
4 changes: 3 additions & 1 deletion src/app/shipyard/ShipRoles.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,9 @@ export function trader(ship, shielded, standardOpts) {
ship.use(slot, sg);
sg = null;
} else {
ship.use(slot, ModuleUtils.findInternal('cr', slot.maxClass, 'E'));
if (canMount(ship, slot, 'cr')) {
ship.use(slot, ModuleUtils.findInternal('cr', slot.maxClass, 'E'));
}
}
}

Expand Down

0 comments on commit 2a84128

Please sign in to comment.