Merge branch 'feature/23' into develop

This commit is contained in:
Cmdr McDonald
2017-03-12 18:36:45 +00:00
18 changed files with 85 additions and 38 deletions

View File

@@ -1,3 +1,13 @@
#2.3.0
* Add 2.3 diminishing returns on shield value
* Make scan time visible on scanners where available
* Update power distributor able-to-boost calculation to take fractional MJ values in to account
* Revert to floating header due to issues on iOS
* Add effective total shield value to defence summary
* Fix issue where new module added to a slot did not reset its enabled status
* Show integrity value for relevant modules
* Reset old modification values when a new roll is applied
#2.2.19
* Power management panel now displays modules in descending order of power usage by default
* Shot speed can no longer be modified directly. Its value is derived from the range modifier for Long Range and Focused modifications

View File

@@ -310,7 +310,7 @@
"unladenRange": 18.74,
"yaw": 10,
"fullTankRange": 18.36,
"hardness": 65,
"hardness": 170,
"ladenRange": 16.59,
"unladenFastestRange": 74.2,
"ladenFastestRange": 66.96,

View File

@@ -1,6 +1,6 @@
{
"name": "coriolis_shipyard",
"version": "2.2.19",
"version": "2.3.0b",
"repository": {
"type": "git",
"url": "https://github.com/EDCD/coriolis"

View File

@@ -41,6 +41,8 @@ const GRPCAT = {
'mr': 'ordnance',
'tp': 'ordnance',
'nl': 'ordnance',
'sc': 'scanners',
'ss': 'scanners',
// Utilities
'cs': 'scanners',
'kw': 'scanners',
@@ -60,7 +62,6 @@ const CATEGORIES = {
'limpet controllers': ['cc', 'fx', 'hb', 'pc'],
'passenger cabins': ['pce', 'pci', 'pcm', 'pcq'],
'rf': ['rf'],
'sc': ['sc'],
'shields': ['sg', 'bsg', 'psg', 'scb'],
'structural reinforcement': ['hr', 'mrp'],
'dc': ['dc'],
@@ -72,7 +73,7 @@ const CATEGORIES = {
'sb': ['sb'],
'hs': ['hs'],
'defence': ['ch', 'po', 'ec'],
'scanners': ['cs', 'kw', 'ws'],
'scanners': ['sc', 'ss', 'cs', 'kw', 'ws'], // Overloaded with internal scanners
};
/**

View File

@@ -64,6 +64,22 @@ export default class DefenceSummary extends TranslatedComponent {
<span onMouseOver={termtip.bind(null, translate('base') + ' ' + formats.pct1(1 - shieldGenerator.thermres))} onMouseOut={tooltip.bind(null, null)}>{formats.pct1(1 - ship.shieldThermRes)}</span>
</td>
</tr> : null }
{ship.shield ?
<tr>
<td className='le'><span onMouseOver={termtip.bind(null,'PHRASE_TOTAL_EFFECTIVE_SHIELD')} onMouseOut={tooltip.bind(null, null)}>{translate('total effective shield')}</span></td>
<td className='ri'>
<span onMouseOver={termtip.bind(null, 'explosive')} onMouseOut={tooltip.bind(null, null)}><DamageExplosive /></span>&nbsp;
{formats.int((ship.shield + ship.shieldCells) / (1 - ship.shieldExplRes))}{units.MJ}
</td>
<td className='ri'>
<span onMouseOver={termtip.bind(null, 'kinetic')} onMouseOut={tooltip.bind(null, null)}><DamageKinetic /></span>&nbsp;
{formats.int((ship.shield + ship.shieldCells) / (1 - ship.shieldKinRes))}{units.MJ}
</td>
<td className='ri'>
<span onMouseOver={termtip.bind(null, 'thermal')} onMouseOut={tooltip.bind(null, null)}><DamageThermal /></span>&nbsp;
{formats.int((ship.shield + ship.shieldCells) / (1 - ship.shieldThermRes))}{units.MJ}
</td>
</tr> : null }
{ ship.shield && ship.shieldCells ?
<tr>

View File

@@ -75,6 +75,7 @@ export default class HardpointSlot extends Slot {
{ m.getDps() && m.getEps() ? <div className={'l'} onMouseOver={termtip.bind(null, 'dpe')} onMouseOut={tooltip.bind(null, null)}>{translate('DPE')}: {formats.f1(m.getDps() / m.getEps())}</div> : null }
{ m.getRoF() ? <div className={'l'} onMouseOver={termtip.bind(null, 'rof')} onMouseOut={tooltip.bind(null, null)}>{translate('ROF')}: {formats.f1(m.getRoF())}{u.ps}</div> : null }
{ m.getRange() ? <div className={'l'}>{translate('range')} {formats.f1(m.getRange() / 1000)}{u.km}</div> : null }
{ m.getScanTime() ? <div className={'l'}>{translate('scantime')} {formats.f1(m.getScanTime())}{u.s}</div> : null }
{ m.getFalloff() ? <div className={'l'}>{translate('falloff')} {formats.round(m.getFalloff() / 1000)}{u.km}</div> : null }
{ m.getShieldBoost() ? <div className={'l'}>+{formats.pct1(m.getShieldBoost())}</div> : null }
{ m.getAmmo() ? <div className={'l'}>{translate('ammunition')}: {formats.int(m.getClip())}/{formats.int(m.getAmmo())}</div> : null }
@@ -84,8 +85,8 @@ export default class HardpointSlot extends Slot {
{ showModuleResistances && m.getExplosiveResistance() ? <div className='l'>{translate('explres')}: {formats.pct(m.getExplosiveResistance())}</div> : null }
{ showModuleResistances && m.getKineticResistance() ? <div className='l'>{translate('kinres')}: {formats.pct(m.getKineticResistance())}</div> : null }
{ showModuleResistances && m.getThermalResistance() ? <div className='l'>{translate('thermres')}: {formats.pct(m.getThermalResistance())}</div> : null }
{ m.getIntegrity() ? <div className='l'>{translate('integrity')}: {formats.int(m.getIntegrity())}</div> : null }
{ m && validMods.length > 0 ? <div className='r' ><button onClick={this._toggleModifications.bind(this)} onContextMenu={stopCtxPropagation} onMouseOver={termtip.bind(null, 'modifications')} onMouseOut={tooltip.bind(null, null)}><ListModifications /></button></div> : null }
</div>
</div>;
} else {

View File

@@ -58,18 +58,17 @@ export default class InternalSlot extends Slot {
{ m.rangeLS ? <div className={'l'}>{translate('range')}: {m.rangeLS}{u.Ls}</div> : null }
{ m.rangeLS === null ? <div className={'l'}>{u.Ls}</div> : null }
{ m.rangeRating ? <div className={'l'}>{translate('range')}: {m.rangeRating}</div> : null }
{ m.getHullReinforcement() ? <div className={'l'}>+{formats.int(m.getHullReinforcement() + ship.baseArmour * m.getModValue('hullboost') / 10000)} <u className='cap'>{translate('armour')}</u></div> : null }
{ m.getProtection() ? <div className={'l'}>{formats.rPct(m.getProtection())} <u className='cap'>{translate('protection')}</u></div> : null }
{ m.getIntegrity() && m.grp === 'mrp' ? <div className={'l'}>{formats.int(m.getIntegrity())} <u className='cap'>{translate('integrity')}</u></div> : null }
{ m.maximum ? <div className={'l'}>{translate('max')}: {(m.maximum)}</div> : null }
{ m.passengers ? <div className={'l'}>{translate('passengers')}: {m.passengers}</div> : null }
{ m.getRegenerationRate() ? <div className='l'>{translate('regen')}: {formats.round1(m.getRegenerationRate())}{u.ps}</div> : null }
{ m.getBrokenRegenerationRate() ? <div className='l'>{translate('brokenregen')}: {formats.round1(m.getBrokenRegenerationRate())}{u.ps}</div> : null }
{ showModuleResistances && m.getExplosiveResistance() ? <div className='l'>{translate('explres')}: {formats.pct(m.getExplosiveResistance())}</div> : null }
{ showModuleResistances && m.getKineticResistance() ? <div className='l'>{translate('kinres')}: {formats.pct(m.getKineticResistance())}</div> : null }
{ showModuleResistances && m.getThermalResistance() ? <div className='l'>{translate('thermres')}: {formats.pct(m.getThermalResistance())}</div> : null }
{ m.getRegenerationRate() ? <div className='l'>{translate('regen')}: {formats.round1(m.getRegenerationRate())}{u.ps}</div> : null }
{ m.getBrokenRegenerationRate() ? <div className='l'>{translate('brokenregen')}: {formats.round1(m.getBrokenRegenerationRate())}{u.ps}</div> : null }
{ m.getHullReinforcement() ? <div className='l'>{translate('armour')}: {formats.int(m.getHullReinforcement() + ship.baseArmour * m.getModValue('hullboost') / 10000)}</div> : null }
{ m.getProtection() ? <div className='l'>{translate('protection')}: {formats.rPct(m.getProtection())}</div> : null }
{ m.getIntegrity() ? <div className='l'>{translate('integrity')}: {formats.int(m.getIntegrity())}</div> : null }
{ m && validMods.length > 0 ? <div className='r' ><button onClick={this._toggleModifications.bind(this)} onContextMenu={stopCtxPropagation} onMouseOver={termtip.bind(null, 'modifications')} onMouseOut={tooltip.bind(null, null)}><ListModifications /></button></div> : null }
</div>
</div>;
} else {

View File

@@ -174,6 +174,7 @@ export default class ModificationsMenu extends TranslatedComponent {
*/
_rollWorst() {
const { m, ship } = this.props;
ship.clearModifications(m);
const features = m.blueprint.grades[m.blueprint.grade].features;
for (const featureName in features) {
let value = features[featureName][0];
@@ -188,6 +189,7 @@ export default class ModificationsMenu extends TranslatedComponent {
*/
_rollRandom() {
const { m, ship } = this.props;
ship.clearModifications(m);
const features = m.blueprint.grades[m.blueprint.grade].features;
for (const featureName in features) {
let value = features[featureName][0] + (Math.random() * (features[featureName][1] - features[featureName][0]));
@@ -216,6 +218,7 @@ export default class ModificationsMenu extends TranslatedComponent {
*/
_rollExtreme() {
const { m, ship } = this.props;
ship.clearModifications(m);
const features = m.blueprint.grades[m.blueprint.grade].features;
for (const featureName in features) {
let value;

View File

@@ -104,7 +104,7 @@ export default class StandardSlot extends TranslatedComponent {
{ showModuleResistances && m.getExplosiveResistance() ? <div className='l'>{translate('explres')}: {formats.pct(m.getExplosiveResistance())}</div> : null }
{ showModuleResistances && m.getKineticResistance() ? <div className='l'>{translate('kinres')}: {formats.pct(m.getKineticResistance())}</div> : null }
{ showModuleResistances && m.getThermalResistance() ? <div className='l'>{translate('thermres')}: {formats.pct(m.getThermalResistance())}</div> : null }
{ m.getIntegrity() ? <div className='l'>{translate('integrity')}: {formats.int(m.getIntegrity())}</div> : null }
{ validMods.length > 0 ? <div className='r' ><button onClick={this._toggleModifications.bind(this)} onContextMenu={stopCtxPropagation} onMouseOver={termtip.bind(null, 'modifications')} onMouseOut={tooltip.bind(null, null)}><ListModifications /></button></div> : null }
</div>
</div>

View File

@@ -170,7 +170,7 @@ export default class StandardSlotSection extends SlotSection {
selected={currentMenu == st[4]}
onChange={this.props.onChange}
ship={ship}
warning={m => m instanceof Module ? m.getEnginesCapacity() < ship.boostEnergy : m.engcap < ship.boostEnergy}
warning={m => m instanceof Module ? m.getEnginesCapacity() <= ship.boostEnergy : m.engcap <= ship.boostEnergy}
/>;
slots[6] = <StandardSlot

View File

@@ -38,6 +38,7 @@ export const terms = {
PHRASE_SELECT_SPECIAL: 'Click to select an experimental effect',
PHRASE_NO_SPECIAL: 'No experimental effect',
PHRASE_SHOPPING_LIST: 'Stations that sell this build',
PHRASE_TOTAL_EFFECTIVE_SHIELD: 'Total amount of damage that can be taken from each damage type, if using all shield cells',
HELP_MODIFICATIONS_MENU: 'Click on a number to enter a new value, or drag along the bar for small changes',
@@ -88,9 +89,10 @@ export const terms = {
rg: 'Rail Gun',
s: 'Sensors',
sb: 'Shield Booster',
sc: 'Scanner',
sc: 'Stellar Scanners',
scb: 'Shield Cell Bank',
sg: 'Shield Generator',
ss: 'Surface Scanners',
t: 'thrusters',
tp: 'Torpedo Pylon',
ul: 'Burst Laser',
@@ -103,6 +105,8 @@ export const terms = {
'damage received from': 'Damage received from',
'against shields': 'Against shields',
'against hull': 'Against hull',
'total effective shield': 'Total effective shield',
// 'ammo' was overloaded for outfitting page and modul info, so changed to ammunition for outfitting page
ammunition: 'Ammo',
@@ -177,6 +181,9 @@ export const terms = {
regen: 'Regeneration rate',
reload: 'Reload',
rof: 'Rate of fire',
scanangle: 'Scan angle',
scanrange: 'Scan range',
scantime: 'Scan time',
shield: 'Shield',
shieldboost: 'Shield boost',
shieldreinforcement: 'Shield reinforcement',

View File

@@ -344,6 +344,14 @@ export default class Module {
return this._getModifiedValue('ranget');
}
/**
* Get the scan time for this module, taking in to account modifications
* @return {Number} the scan time of this module
*/
getScanTime() {
return this._getModifiedValue('scantime');
}
/**
* Get the capture arc for this module, taking in to account modifications
* @return {Number} the capture arc of this module

View File

@@ -126,7 +126,7 @@ export default class ModuleSet {
let pd = this.standard[4][0];
for (let p of this.standard[4]) {
if (p.mass < pd.mass && p.engcap >= boostEnergy) {
if (p.mass < pd.mass && p.engcap > boostEnergy) {
pd = p;
}
}

View File

@@ -135,7 +135,7 @@ export default class Ship {
*/
canBoost() {
return this.canThrust() && // Thrusters operational
this.boostEnergy <= this.standard[4].m.getEnginesCapacity(); // PD capacitor is sufficient for boost
this.standard[4].m.getEnginesCapacity() > this.boostEnergy; // PD capacitor is sufficient for boost
}
/**
@@ -569,7 +569,6 @@ export default class Ship {
for (i = 0; i < cl; i++) {
standard[i].cat = 0;
standard[i].enabled = enabled ? enabled[i + 1] * 1 : true;
standard[i].priority = priorities && priorities[i + 1] ? priorities[i + 1] * 1 : 0;
standard[i].type = 'SYS';
standard[i].m = null; // Resetting 'old' modul if there was one
@@ -582,6 +581,7 @@ export default class Ship {
}
this.use(standard[i], module, true);
}
standard[i].enabled = enabled ? enabled[i + 1] * 1 : true;
}
standard[1].type = 'ENG'; // Thrusters
@@ -590,7 +590,6 @@ export default class Ship {
for (i = 0, l = hps.length; i < l; i++) {
hps[i].cat = 1;
hps[i].enabled = enabled ? enabled[cl + i] * 1 : true;
hps[i].priority = priorities && priorities[cl + i] ? priorities[cl + i] * 1 : 0;
hps[i].type = hps[i].maxClass ? 'WEP' : 'SYS';
hps[i].m = null; // Resetting 'old' modul if there was one
@@ -604,13 +603,13 @@ export default class Ship {
}
this.use(hps[i], module, true);
}
hps[i].enabled = enabled ? enabled[cl + i] * 1 : true;
}
cl += hps.length; // Increase accounts for hardpoints
for (i = 0, l = internal.length; i < l; i++) {
internal[i].cat = 2;
internal[i].enabled = enabled ? enabled[cl + i] * 1 : true;
internal[i].priority = priorities && priorities[cl + i] ? priorities[cl + i] * 1 : 0;
internal[i].type = 'SYS';
internal[i].m = null; // Resetting 'old' modul if there was one
@@ -624,6 +623,7 @@ export default class Ship {
}
this.use(internal[i], module, true);
}
internal[i].enabled = enabled ? enabled[cl + i] * 1 : true;
}
// Update aggragated stats
@@ -1258,8 +1258,7 @@ export default class Ship {
}
// We apply diminishing returns to the boosted value
// (no we don't; FD pulled back on this idea. But leave this here in case they reinstate it)
// shieldBoost = Math.min(shieldBoost, (1 - Math.pow(Math.E, -0.7 * shieldBoost)) * 2.5);
shieldBoost = Math.min(shieldBoost, (1 - Math.pow(Math.E, -0.7 * shieldBoost)) * 2.5);
shield = shield * shieldBoost;
@@ -1641,6 +1640,7 @@ export default class Ship {
}
let oldModule = slot.m;
slot.m = m;
slot.enabled = true;
slot.discountedCost = (m && m.cost) ? m.cost * this.moduleCostMultiplier : 0;
this.updateStats(slot, m, oldModule, preventUpdate);

View File

@@ -155,9 +155,9 @@ export function diffDetails(language, m, mm) {
if (mPowerUsage != mmPowerUsage) propDiffs.push(<div key='power'>{translate('power')}: <span className={diffClass(mPowerUsage, mmPowerUsage, true)}>{diff(formats.round, mPowerUsage, mmPowerUsage)}{units.MJ}</span></div>);
}
let mDps = m.damage * (m.rpshot || 1) * (m.rof || 1) || 0;
let mDps = m.damage * (m.rpshot || 1) * (m.rof || 1);
let mmDps = mm ? mm.getDps() || 0 : 0;
if (mDps != mmDps) propDiffs.push(<div key='dps'>{translate('dps')}: <span className={diffClass(mmDps, mDps, true)}>{diff(formats.round, mDps, mmDps)}</span></div>);
if (mDps && mDps != mmDps) propDiffs.push(<div key='dps'>{translate('dps')}: <span className={diffClass(mmDps, mDps, true)}>{diff(formats.round, mDps, mmDps)}</span></div>);
let mAffectsShield = isShieldGenerator(m.grp) || m.grp == 'sb';
let mmAffectsShield = isShieldGenerator(mm ? mm.grp : null) || mm && mm.grp == 'sb';
@@ -187,12 +187,12 @@ export function diffDetails(language, m, mm) {
if (mProtection != mmProtection) {
propDiffs.push(<div key='protection'>{translate('protection')}: <span className={diffClass(mmProtection, mProtection, true)}>{diff(formats.pct, mProtection, mmProtection)}</span></div>);
}
}
let mIntegrity = m.integrity;
let mmIntegrity = mm ? mm.getIntegrity() || 0 : 0;
if (mIntegrity != mmIntegrity) {
propDiffs.push(<div key='integrity'>{translate('integrity')}: <span className={diffClass(mmIntegrity, mIntegrity, true)}>{diff(formats.round, mIntegrity, mmIntegrity)}</span></div>);
}
if (m.grp === 'hr') {
let mHullReinforcement = m.hullreinforcement;
let mmHullReinforcement = mm ? mm.getHullReinforcement() || 0 : 0;
if (mHullReinforcement && mHullReinforcement != mmHullReinforcement) propDiffs.push(<div key='hullreinforcement'>{translate('hullreinforcement')}: <span className={diffClass(mmHullReinforcement, mHullReinforcement, true)}>{diff(formats.round, mHullReinforcement, mmHullReinforcement)}</span></div>);
}
if (m.grp == 'pd') {
@@ -243,5 +243,11 @@ export function diffDetails(language, m, mm) {
}
}
return propDiffs ? <div className='cap' style={{ whiteSpace: 'nowrap' }}>{propDiffs}</div> : null;
let mIntegrity = m.integrity;
let mmIntegrity = mm ? mm.getIntegrity() || 0 : 0;
if (mIntegrity != mmIntegrity) {
propDiffs.push(<div key='integrity'>{translate('integrity')}: <span className={diffClass(mmIntegrity, mIntegrity, true)}>{diff(formats.round, mIntegrity, mmIntegrity)}</span></div>);
}
return propDiffs.length > 0 ? <div className='cap' style={{ whiteSpace: 'nowrap' }}>{propDiffs}</div> : null;
}

View File

@@ -42,7 +42,6 @@ div, a, li {
#coriolis {
width: 100%;
height: 100%;
padding-top: 48px;
overflow-y: scroll;
-webkit-overflow-scrolling: touch;
box-sizing: border-box;

View File

@@ -20,10 +20,7 @@ header {
line-height: 3em;
font-family: @fTitle;
vertical-align: middle;
position: absolute;
top: 0px;
left: 0px;
width: 100%;
position: relative;
z-index: 2;
box-sizing: border-box;
.user-select-none();

View File

@@ -230,16 +230,16 @@
},
"armour": {
"description": "Sum of base armour + any hull reinforcements",
"type": "integer",
"type": "number",
"minimum": 1
},
"armourAdded":{
"description": "Armour added through Hull reinforcement",
"type": "integer",
"type": "number",
"minimum": 0
},
"baseShieldStrength": {
"type": "integer",
"type": "number",
"minimum": 1
},
"baseArmour": {