mirror of
https://github.com/EDCD/coriolis.git
synced 2025-12-09 22:55:35 +00:00
more work on fixing resistances
hopefully getting close
This commit is contained in:
@@ -145,10 +145,10 @@ export default class ShipSummaryTable extends TranslatedComponent {
|
|||||||
<td>{formats.pct1(ship.shieldExplRes)}</td>
|
<td>{formats.pct1(ship.shieldExplRes)}</td>
|
||||||
<td>{formats.pct1(ship.shieldKinRes)}</td>
|
<td>{formats.pct1(ship.shieldKinRes)}</td>
|
||||||
<td>{formats.pct1(ship.shieldThermRes)}</td>
|
<td>{formats.pct1(ship.shieldThermRes)}</td>
|
||||||
<td>{int(ship && ship.shield > 0 ? ship.shield / sgMetrics.absolute.total : 0)}{u.MJ}</td>
|
<td>{int(ship && ship.shield > 0 ? ship.shield : 0)}{u.MJ}</td>
|
||||||
<td>{int(ship && ship.shield > 0 ? ship.shield / sgMetrics.explosive.total : 0)}{u.MJ}</td>
|
<td>{int(ship && ship.shield > 0 ? ship.shield * ((1 / (1 - (ship.shieldExplRes)))) : 0)}{u.MJ}</td>
|
||||||
<td>{int(ship && ship.shield > 0 ? ship.shield / sgMetrics.kinetic.total : 0)}{u.MJ}</td>
|
<td>{int(ship && ship.shield > 0 ? ship.shield * ((1 / (1 - (ship.shieldKinRes)))) : 0)}{u.MJ}</td>
|
||||||
<td>{int(ship && ship.shield > 0 ? ship.shield / sgMetrics.thermal.total : 0)}{u.MJ}</td>
|
<td>{int(ship && ship.shield > 0 ? ship.shield * ((1 / (1 - (ship.shieldThermRes)))) : 0)}{u.MJ}</td>
|
||||||
<td>{sgMetrics && sgMetrics.recover ? formats.time(sgMetrics.recover) : 0}</td>
|
<td>{sgMetrics && sgMetrics.recover ? formats.time(sgMetrics.recover) : 0}</td>
|
||||||
<td>{sgMetrics && sgMetrics.recharge ? formats.time(sgMetrics.recharge) : 0}</td>
|
<td>{sgMetrics && sgMetrics.recharge ? formats.time(sgMetrics.recharge) : 0}</td>
|
||||||
</tr>
|
</tr>
|
||||||
@@ -176,10 +176,10 @@ export default class ShipSummaryTable extends TranslatedComponent {
|
|||||||
<td>{formats.pct1(ship.hullExplRes)}</td>
|
<td>{formats.pct1(ship.hullExplRes)}</td>
|
||||||
<td>{formats.pct1(ship.hullKinRes)}</td>
|
<td>{formats.pct1(ship.hullKinRes)}</td>
|
||||||
<td>{formats.pct1(ship.hullThermRes)}</td>
|
<td>{formats.pct1(ship.hullThermRes)}</td>
|
||||||
<td>{int(ship.armour / armourMetrics.absolute.total)}</td>
|
<td>{int(ship.armour)}</td>
|
||||||
<td>{int(ship.armour / armourMetrics.explosive.total)}</td>
|
<td>{int(ship.armour * ((1 / (1 - (ship.hullExplRes)))))}</td>
|
||||||
<td>{int(ship.armour / armourMetrics.kinetic.total)}</td>
|
<td>{int(ship.armour * ((1 / (1 - (ship.hullKinRes)))))}</td>
|
||||||
<td>{int(ship.armour / armourMetrics.thermal.total)}</td>
|
<td>{int(ship.armour * ((1 / (1 - (ship.hullThermRes)))))}</td>
|
||||||
<td>{int(armourMetrics.modulearmour)}</td>
|
<td>{int(armourMetrics.modulearmour)}</td>
|
||||||
<td>{int(armourMetrics.moduleprotection * 100) + '%'}</td>
|
<td>{int(armourMetrics.moduleprotection * 100) + '%'}</td>
|
||||||
|
|
||||||
|
|||||||
@@ -345,9 +345,9 @@ export function shieldMetrics(ship, sys) {
|
|||||||
let boosterExplDmg = 1;
|
let boosterExplDmg = 1;
|
||||||
let boosterKinDmg = 1;
|
let boosterKinDmg = 1;
|
||||||
let boosterThermDmg = 1;
|
let boosterThermDmg = 1;
|
||||||
const explDim = dimReturnLine(shieldGenerator.explres);
|
// const explDim = dimReturnLine(shieldGenerator.explres);
|
||||||
const thermDim = dimReturnLine(shieldGenerator.thermres);
|
// const thermDim = dimReturnLine(shieldGenerator.thermres);
|
||||||
const kinDim = dimReturnLine(shieldGenerator.kinres);
|
// const kinDim = dimReturnLine(shieldGenerator.kinres);
|
||||||
for (let slot of ship.hardpoints) {
|
for (let slot of ship.hardpoints) {
|
||||||
if (slot.enabled && slot.m && slot.m.grp == 'sb') {
|
if (slot.enabled && slot.m && slot.m.grp == 'sb') {
|
||||||
boost += slot.m.getShieldBoost();
|
boost += slot.m.getShieldBoost();
|
||||||
@@ -367,25 +367,28 @@ export function shieldMetrics(ship, sys) {
|
|||||||
// Remove base shield generator strength
|
// Remove base shield generator strength
|
||||||
boost -= 1;
|
boost -= 1;
|
||||||
|
|
||||||
if (res.expl > explDim) {
|
// if (res.expl > explDim) {
|
||||||
const overage = (res.expl - explDim) * 0.5;
|
// const overage = (res.expl - explDim) * 0.5;
|
||||||
boosterExplDmg = explDim + overage;
|
// res.expl = explDim + overage;
|
||||||
}
|
// boosterExplDmg = explDim + overage;
|
||||||
|
// }
|
||||||
if (res.therm > thermDim) {
|
//
|
||||||
const overage = (res.therm - thermDim) * 0.5;
|
// if (res.therm > thermDim) {
|
||||||
boosterThermDmg = thermDim + overage;
|
// const overage = (res.therm - thermDim) * 0.5;
|
||||||
}
|
// res.therm = thermDim + overage;
|
||||||
|
// boosterThermDmg = thermDim + overage;
|
||||||
if (res.kin > kinDim) {
|
// }
|
||||||
const overage = (res.kin - kinDim) * 0.5;
|
//
|
||||||
boosterKinDmg = kinDim + overage;
|
// if (res.kin > kinDim) {
|
||||||
}
|
// const overage = (res.kin - kinDim) * 0.5;
|
||||||
|
// res.kin = kinDim + overage;
|
||||||
|
// boosterKinDmg = kinDim + overage;
|
||||||
|
// }
|
||||||
// Apply diminishing returns
|
// Apply diminishing returns
|
||||||
// boosterExplDmg = boosterExplDmg > 0.7 ? boosterExplDmg : 0.7 - (0.7 - boosterExplDmg) / 2;
|
// boosterExplDmg = boosterExplDmg > 0.7 ? boosterExplDmg : 0.7 - (0.7 - boosterExplDmg) / 2;
|
||||||
// boosterKinDmg = boosterKinDmg > 0.7 ? boosterKinDmg : 0.7 - (0.7 - boosterKinDmg) / 2;
|
// boosterKinDmg = boosterKinDmg > 0.7 ? boosterKinDmg : 0.7 - (0.7 - boosterKinDmg) / 2;
|
||||||
// boosterThermDmg = boosterThermDmg > 0.7 ? boosterThermDmg : 0.7 - (0.7 - boosterThermDmg) / 2;
|
// boosterThermDmg = boosterThermDmg > 0.7 ? boosterThermDmg : 0.7 - (0.7 - boosterThermDmg) / 2;
|
||||||
|
// res.therm = res.therm > 0.7 ? res.therm : 0.7 - (0.7 - res.therm) / 2;
|
||||||
|
|
||||||
const generatorStrength = this.shieldStrength(ship.hullMass, ship.baseShieldStrength, shieldGenerator, 1);
|
const generatorStrength = this.shieldStrength(ship.hullMass, ship.baseShieldStrength, shieldGenerator, 1);
|
||||||
const boostersStrength = generatorStrength * boost;
|
const boostersStrength = generatorStrength * boost;
|
||||||
@@ -466,7 +469,8 @@ export function shieldMetrics(ship, sys) {
|
|||||||
boosters: boosterExplDmg,
|
boosters: boosterExplDmg,
|
||||||
sys: (1 - sysResistance),
|
sys: (1 - sysResistance),
|
||||||
total: (1 - shieldGenerator.getExplosiveResistance()) * boosterExplDmg * (1 - sysResistance),
|
total: (1 - shieldGenerator.getExplosiveResistance()) * boosterExplDmg * (1 - sysResistance),
|
||||||
max: (1 - shieldGenerator.getExplosiveResistance()) * boosterExplDmg * (1 - maxSysResistance)
|
max: (1 - shieldGenerator.getExplosiveResistance()) * boosterExplDmg * (1 - maxSysResistance),
|
||||||
|
res: 1 - boosterExplDmg
|
||||||
};
|
};
|
||||||
|
|
||||||
shield.kinetic = {
|
shield.kinetic = {
|
||||||
@@ -474,7 +478,8 @@ export function shieldMetrics(ship, sys) {
|
|||||||
boosters: boosterKinDmg,
|
boosters: boosterKinDmg,
|
||||||
sys: (1 - sysResistance),
|
sys: (1 - sysResistance),
|
||||||
total: (1 - shieldGenerator.getKineticResistance()) * boosterKinDmg * (1 - sysResistance),
|
total: (1 - shieldGenerator.getKineticResistance()) * boosterKinDmg * (1 - sysResistance),
|
||||||
max: (1 - shieldGenerator.getKineticResistance()) * boosterKinDmg * (1 - maxSysResistance)
|
max: (1 - shieldGenerator.getKineticResistance()) * boosterKinDmg * (1 - maxSysResistance),
|
||||||
|
res: 1 - boosterKinDmg
|
||||||
};
|
};
|
||||||
|
|
||||||
shield.thermal = {
|
shield.thermal = {
|
||||||
@@ -482,10 +487,10 @@ export function shieldMetrics(ship, sys) {
|
|||||||
boosters: boosterThermDmg,
|
boosters: boosterThermDmg,
|
||||||
sys: (1 - sysResistance),
|
sys: (1 - sysResistance),
|
||||||
total: (1 - shieldGenerator.getThermalResistance()) * boosterThermDmg * (1 - sysResistance),
|
total: (1 - shieldGenerator.getThermalResistance()) * boosterThermDmg * (1 - sysResistance),
|
||||||
max: (1 - shieldGenerator.getThermalResistance()) * boosterThermDmg * (1 - maxSysResistance)
|
max: (1 - shieldGenerator.getThermalResistance()) * boosterThermDmg * (1 - maxSysResistance),
|
||||||
|
res: 1 - boosterThermDmg
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
return shield;
|
return shield;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -518,7 +523,7 @@ export function armourMetrics(ship) {
|
|||||||
let hullExplDmg = 1;
|
let hullExplDmg = 1;
|
||||||
let hullKinDmg = 1;
|
let hullKinDmg = 1;
|
||||||
let hullThermDmg = 1;
|
let hullThermDmg = 1;
|
||||||
const dimReturnLine = (res) => 1 - (1 - res) * 0.7;
|
// const dimReturnLine = (res) => 1 - (1 - res) * 0.7;
|
||||||
let res = {
|
let res = {
|
||||||
kin: 0,
|
kin: 0,
|
||||||
therm: 0,
|
therm: 0,
|
||||||
@@ -545,23 +550,26 @@ export function armourMetrics(ship) {
|
|||||||
}
|
}
|
||||||
moduleProtection = 1 - moduleProtection;
|
moduleProtection = 1 - moduleProtection;
|
||||||
|
|
||||||
const explDim = dimReturnLine(bulkheads.explres);
|
// const explDim = dimReturnLine(bulkheads.explres);
|
||||||
const thermDim = dimReturnLine(bulkheads.thermres);
|
// const thermDim = dimReturnLine(bulkheads.thermres);
|
||||||
const kinDim = dimReturnLine(bulkheads.kinres);
|
// const kinDim = dimReturnLine(bulkheads.kinres);
|
||||||
if (res.expl > explDim) {
|
// if (res.expl > explDim) {
|
||||||
const overage = (res.expl - explDim) * 0.5;
|
// const overage = (res.expl - explDim) * 0.5;
|
||||||
hullExplDmg = explDim + overage;
|
// res.expl = explDim + overage;
|
||||||
}
|
// hullExplDmg = explDim + overage;
|
||||||
|
// }
|
||||||
if (res.therm > thermDim) {
|
//
|
||||||
const overage = (res.therm - thermDim) * 0.5;
|
// if (res.therm > thermDim) {
|
||||||
hullThermDmg = thermDim + overage;
|
// const overage = (res.therm - thermDim) * 0.5;
|
||||||
}
|
// res.therm = thermDim + overage;
|
||||||
|
// hullThermDmg = thermDim + overage;
|
||||||
if (res.kin > kinDim) {
|
// }
|
||||||
const overage = (res.kin - kinDim) * 0.5;
|
//
|
||||||
hullKinDmg = kinDim + overage;
|
// if (res.kin > kinDim) {
|
||||||
}
|
// const overage = (res.kin - kinDim) * 0.5;
|
||||||
|
// res.kin = kinDim + overage;
|
||||||
|
// hullKinDmg = kinDim + overage;
|
||||||
|
// }
|
||||||
|
|
||||||
// Apply diminishing returns
|
// Apply diminishing returns
|
||||||
// hullExplDmg = hullExplDmg > 0.7 ? hullExplDmg : 0.7 - (0.7 - hullExplDmg) / 2;
|
// hullExplDmg = hullExplDmg > 0.7 ? hullExplDmg : 0.7 - (0.7 - hullExplDmg) / 2;
|
||||||
@@ -587,21 +595,23 @@ export function armourMetrics(ship) {
|
|||||||
armour.explosive = {
|
armour.explosive = {
|
||||||
bulkheads: 1 - ship.bulkheads.m.getExplosiveResistance(),
|
bulkheads: 1 - ship.bulkheads.m.getExplosiveResistance(),
|
||||||
reinforcement: hullExplDmg,
|
reinforcement: hullExplDmg,
|
||||||
total: (1 - ship.bulkheads.m.getExplosiveResistance()) * hullExplDmg
|
total: (1 - ship.bulkheads.m.getExplosiveResistance()) * hullExplDmg,
|
||||||
|
res: 1 - hullExplDmg
|
||||||
};
|
};
|
||||||
|
|
||||||
armour.kinetic = {
|
armour.kinetic = {
|
||||||
bulkheads: 1 - ship.bulkheads.m.getKineticResistance(),
|
bulkheads: 1 - ship.bulkheads.m.getKineticResistance(),
|
||||||
reinforcement: hullKinDmg,
|
reinforcement: hullKinDmg,
|
||||||
total: (1 - ship.bulkheads.m.getKineticResistance()) * hullKinDmg
|
total: (1 - ship.bulkheads.m.getKineticResistance()) * hullKinDmg,
|
||||||
|
res: 1 - hullKinDmg
|
||||||
};
|
};
|
||||||
|
|
||||||
armour.thermal = {
|
armour.thermal = {
|
||||||
bulkheads: 1 - ship.bulkheads.m.getThermalResistance(),
|
bulkheads: 1 - ship.bulkheads.m.getThermalResistance(),
|
||||||
reinforcement: hullThermDmg,
|
reinforcement: hullThermDmg,
|
||||||
total: (1 - ship.bulkheads.m.getThermalResistance()) * hullThermDmg
|
total: (1 - ship.bulkheads.m.getThermalResistance()) * hullThermDmg,
|
||||||
|
res: 1 - hullThermDmg
|
||||||
};
|
};
|
||||||
|
|
||||||
return armour;
|
return armour;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user