mirror of
https://github.com/EDCD/coriolis.git
synced 2025-12-09 06:43:24 +00:00
Armour resistances caps introduced
This commit is contained in:
@@ -184,17 +184,17 @@ export default class Defence extends TranslatedComponent {
|
|||||||
const armourDamageTakenExplosiveTt = [];
|
const armourDamageTakenExplosiveTt = [];
|
||||||
armourDamageTakenExplosiveTt.push(<div key='bulkheads'>{translate('bulkheads') + ' ' + formats.pct1(armour.explosive.bulkheads)}</div>);
|
armourDamageTakenExplosiveTt.push(<div key='bulkheads'>{translate('bulkheads') + ' ' + formats.pct1(armour.explosive.bulkheads)}</div>);
|
||||||
armourDamageTakenExplosiveTt.push(<div key='reinforcement'>{translate('reinforcement') + ' ' + formats.pct1(armour.explosive.reinforcement)}</div>);
|
armourDamageTakenExplosiveTt.push(<div key='reinforcement'>{translate('reinforcement') + ' ' + formats.pct1(armour.explosive.reinforcement)}</div>);
|
||||||
if (armour.explosive.bulkheads * armour.explosive.reinforcement != 1) effectiveArmourExplosiveTt.push(<div key='resistance'>{translate('resistance') + ' ' + formats.int(rawArmour / (armour.explosive.bulkheads * armour.explosive.reinforcement) - rawArmour)}</div>);
|
if (armour.explosive.total != 1) effectiveArmourExplosiveTt.push(<div key='resistance'>{translate('resistance') + ' ' + formats.int(rawArmour / armour.explosive.total - rawArmour)}</div>);
|
||||||
|
|
||||||
const armourDamageTakenKineticTt = [];
|
const armourDamageTakenKineticTt = [];
|
||||||
armourDamageTakenKineticTt.push(<div key='bulkheads'>{translate('bulkheads') + ' ' + formats.pct1(armour.kinetic.bulkheads)}</div>);
|
armourDamageTakenKineticTt.push(<div key='bulkheads'>{translate('bulkheads') + ' ' + formats.pct1(armour.kinetic.bulkheads)}</div>);
|
||||||
armourDamageTakenKineticTt.push(<div key='reinforcement'>{translate('reinforcement') + ' ' + formats.pct1(armour.kinetic.reinforcement)}</div>);
|
armourDamageTakenKineticTt.push(<div key='reinforcement'>{translate('reinforcement') + ' ' + formats.pct1(armour.kinetic.reinforcement)}</div>);
|
||||||
if (armour.kinetic.bulkheads * armour.kinetic.reinforcement != 1) effectiveArmourKineticTt.push(<div key='resistance'>{translate('resistance') + ' ' + formats.int(rawArmour / (armour.kinetic.bulkheads * armour.kinetic.reinforcement) - rawArmour)}</div>);
|
if (armour.kinetic.total != 1) effectiveArmourKineticTt.push(<div key='resistance'>{translate('resistance') + ' ' + formats.int(rawArmour / armour.kinetic.total - rawArmour)}</div>);
|
||||||
|
|
||||||
const armourDamageTakenThermalTt = [];
|
const armourDamageTakenThermalTt = [];
|
||||||
armourDamageTakenThermalTt.push(<div key='bulkheads'>{translate('bulkheads') + ' ' + formats.pct1(armour.thermal.bulkheads)}</div>);
|
armourDamageTakenThermalTt.push(<div key='bulkheads'>{translate('bulkheads') + ' ' + formats.pct1(armour.thermal.bulkheads)}</div>);
|
||||||
armourDamageTakenThermalTt.push(<div key='reinforcement'>{translate('reinforcement') + ' ' + formats.pct1(armour.thermal.reinforcement)}</div>);
|
armourDamageTakenThermalTt.push(<div key='reinforcement'>{translate('reinforcement') + ' ' + formats.pct1(armour.thermal.reinforcement)}</div>);
|
||||||
if (armour.thermal.bulkheads * armour.thermal.reinforcement != 1) effectiveArmourThermalTt.push(<div key='resistance'>{translate('resistance') + ' ' + formats.int(rawArmour / (armour.thermal.bulkheads * armour.thermal.reinforcement) - rawArmour)}</div>);
|
if (armour.thermal.total != 1) effectiveArmourThermalTt.push(<div key='resistance'>{translate('resistance') + ' ' + formats.int(rawArmour / armour.thermal.total - rawArmour)}</div>);
|
||||||
|
|
||||||
const effectiveArmourData = [];
|
const effectiveArmourData = [];
|
||||||
const effectiveAbsoluteArmour = armour.total / armour.absolute.total;
|
const effectiveAbsoluteArmour = armour.total / armour.absolute.total;
|
||||||
|
|||||||
@@ -546,22 +546,21 @@ export function armourMetrics(ship) {
|
|||||||
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,
|
||||||
expl: 0
|
// expl: 0
|
||||||
};
|
// };
|
||||||
// Armour from HRPs and module armour from MRPs
|
// Armour from HRPs and module armour from MRPs
|
||||||
for (let slot of ship.internal) {
|
for (let slot of ship.internal) {
|
||||||
if (slot.m && (slot.m.grp === 'hr' || slot.m.grp === 'ghrp')) {
|
if (slot.m && (slot.m.grp === 'hr' || slot.m.grp === 'ghrp')) {
|
||||||
armourReinforcement += slot.m.getHullReinforcement();
|
armourReinforcement += slot.m.getHullReinforcement();
|
||||||
// Hull boost for HRPs is applied against the ship's base armour
|
// Hull boost for HRPs is applied against the ship's base armour
|
||||||
armourReinforcement += ship.baseArmour * slot.m.getModValue('hullboost') / 10000;
|
armourReinforcement += ship.baseArmour * slot.m.getModValue('hullboost') / 10000;
|
||||||
res.expl += slot.m.getExplosiveResistance();
|
// res.expl += slot.m.getExplosiveResistance();
|
||||||
res.kin += slot.m.getKineticResistance();
|
// res.kin += slot.m.getKineticResistance();
|
||||||
res.therm += slot.m.getThermalResistance();
|
// res.therm += slot.m.getThermalResistance();
|
||||||
hullExplDmg = hullExplDmg * (1 - slot.m.getExplosiveResistance());
|
hullExplDmg = hullExplDmg * (1 - slot.m.getExplosiveResistance());
|
||||||
|
|
||||||
hullKinDmg = hullKinDmg * (1 - slot.m.getKineticResistance());
|
hullKinDmg = hullKinDmg * (1 - slot.m.getKineticResistance());
|
||||||
hullThermDmg = hullThermDmg * (1 - slot.m.getThermalResistance());
|
hullThermDmg = hullThermDmg * (1 - slot.m.getThermalResistance());
|
||||||
}
|
}
|
||||||
@@ -593,11 +592,6 @@ export function armourMetrics(ship) {
|
|||||||
// hullKinDmg = kinDim + overage;
|
// hullKinDmg = kinDim + overage;
|
||||||
// }
|
// }
|
||||||
|
|
||||||
// Apply diminishing returns
|
|
||||||
// hullExplDmg = hullExplDmg > 0.7 ? hullExplDmg : 0.7 - (0.7 - hullExplDmg) / 2;
|
|
||||||
// hullKinDmg = hullKinDmg > 0.7 ? hullKinDmg : 0.7 - (0.7 - hullKinDmg) / 2;
|
|
||||||
// hullThermDmg = hullThermDmg > 0.7 ? hullThermDmg : 0.7 - (0.7 - hullThermDmg) / 2;
|
|
||||||
|
|
||||||
const armour = {
|
const armour = {
|
||||||
bulkheads: armourBulkheads,
|
bulkheads: armourBulkheads,
|
||||||
reinforcement: armourReinforcement,
|
reinforcement: armourReinforcement,
|
||||||
@@ -614,25 +608,31 @@ export function armourMetrics(ship) {
|
|||||||
total: 1
|
total: 1
|
||||||
};
|
};
|
||||||
|
|
||||||
|
let armourExplDmg = diminishDamageMult(0.7, 1 - ship.bulkheads.m.getExplosiveResistance());
|
||||||
|
let armourReinforcedExplDmg = diminishDamageMult(0.7, (1 - ship.bulkheads.m.getExplosiveResistance()) * hullExplDmg);
|
||||||
armour.explosive = {
|
armour.explosive = {
|
||||||
bulkheads: 1 - ship.bulkheads.m.getExplosiveResistance(),
|
bulkheads: armourExplDmg,
|
||||||
reinforcement: hullExplDmg,
|
reinforcement: armourReinforcedExplDmg - armourExplDmg,
|
||||||
total: (1 - ship.bulkheads.m.getExplosiveResistance()) * hullExplDmg,
|
total: armourReinforcedExplDmg,
|
||||||
res: 1 - hullExplDmg
|
res: 1 - armourReinforcedExplDmg
|
||||||
};
|
};
|
||||||
|
|
||||||
|
let armourKinDmg = diminishDamageMult(0.7, 1 - ship.bulkheads.m.getKineticResistance());
|
||||||
|
let armourReinforcedKinDmg = diminishDamageMult(0.7, (1 - ship.bulkheads.m.getKineticResistance()) * hullKinDmg);
|
||||||
armour.kinetic = {
|
armour.kinetic = {
|
||||||
bulkheads: 1 - ship.bulkheads.m.getKineticResistance(),
|
bulkheads: armourKinDmg,
|
||||||
reinforcement: hullKinDmg,
|
reinforcement: armourReinforcedKinDmg - armourKinDmg,
|
||||||
total: (1 - ship.bulkheads.m.getKineticResistance()) * hullKinDmg,
|
total: armourReinforcedKinDmg,
|
||||||
res: 1 - hullKinDmg
|
res: 1 - armourReinforcedKinDmg
|
||||||
};
|
};
|
||||||
|
|
||||||
|
let armourThermDmg = diminishDamageMult(0.7, 1 - ship.bulkheads.m.getThermalResistance());
|
||||||
|
let armourReinforcedThermDmg = diminishDamageMult(0.7, (1 - ship.bulkheads.m.getThermalResistance()) * hullThermDmg);
|
||||||
armour.thermal = {
|
armour.thermal = {
|
||||||
bulkheads: 1 - ship.bulkheads.m.getThermalResistance(),
|
bulkheads: armourThermDmg,
|
||||||
reinforcement: hullThermDmg,
|
reinforcement: armourReinforcedThermDmg - armourThermDmg,
|
||||||
total: (1 - ship.bulkheads.m.getThermalResistance()) * hullThermDmg,
|
total: armourReinforcedThermDmg,
|
||||||
res: 1 - hullThermDmg
|
res: 1 - armourReinforcedThermDmg
|
||||||
};
|
};
|
||||||
return armour;
|
return armour;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user