fix: engine accel now affects all engine powers

This commit is contained in:
TrèsAbhi committed 2024-02-11 14:28:27 -06:00
1 parent acd7162aa1
commit 12cf05cb50
1 file changed
+20 -26
@@ -63,11 +63,16 @@ export function Characteristics() {
? 1.07 ? 1.07
: 1.05 : 1.05
: 1; : 1;
const hasCalibratedShellsBonus = hasCalibratedShells const calibratedShellsBonus = hasCalibratedShells
? isExplosive(shell.type) ? isExplosive(shell.type)
? 1.1 ? 1.1
: 1.05 : 1.05
: 1; : 1;
const engineAcceleratorBonus = hasEngineAccelerator
? tank.type === 'light' || tank.type === 'medium'
? 1.05
: 1.07
: 1;
/** /**
* TODO: * TODO:
@@ -164,8 +169,7 @@ export function Characteristics() {
decimals={0} decimals={0}
name="Penetration" name="Penetration"
> >
{resolveNearPenetration(shell.penetration) * {resolveNearPenetration(shell.penetration) * calibratedShellsBonus}
hasCalibratedShellsBonus}
</InfoWithDelta> </InfoWithDelta>
)} )}
{typeof shell.penetration !== 'number' && ( {typeof shell.penetration !== 'number' && (
@@ -176,7 +180,7 @@ export function Characteristics() {
decimals={0} decimals={0}
name="At 0m" name="At 0m"
> >
{shell.penetration[0] * hasCalibratedShellsBonus} {shell.penetration[0] * calibratedShellsBonus}
</InfoWithDelta> </InfoWithDelta>
<Info <Info
delta={ delta={
@@ -186,7 +190,7 @@ export function Characteristics() {
penetrationDistance / 500, penetrationDistance / 500,
) - ) -
shell.penetration[0]) * shell.penetration[0]) *
hasCalibratedShellsBonus calibratedShellsBonus
} }
indent indent
decimals={0} decimals={0}
@@ -196,7 +200,7 @@ export function Characteristics() {
shell.penetration[0], shell.penetration[0],
shell.penetration[1], shell.penetration[1],
penetrationDistance / 500, penetrationDistance / 500,
) * hasCalibratedShellsBonus} ) * calibratedShellsBonus}
</Info> </Info>
<Flex align="center" gap="2" style={{ paddingLeft: 24 }}> <Flex align="center" gap="2" style={{ paddingLeft: 24 }}>
<Text>Distance</Text> <Text>Distance</Text>
@@ -361,38 +365,25 @@ export function Characteristics() {
{tank.speed.backwards} {tank.speed.backwards}
</InfoWithDelta> </InfoWithDelta>
<InfoWithDelta decimals={0} name="Power" unit="hp"> <InfoWithDelta decimals={0} name="Power" unit="hp">
{engine.power} {engine.power * engineAcceleratorBonus}
</InfoWithDelta> </InfoWithDelta>
<Info name="Power to weight ratio" unit="hp/tn" /> <Info name="Power to weight ratio" unit="hp/tn" />
<InfoWithDelta decimals={1} indent name="On hard terrain"> <InfoWithDelta decimals={1} indent name="On hard terrain">
{(engine.power / {(engine.power * engineAcceleratorBonus) /
weightTons / weightTons /
(track.resistance.hard * (hasImprovedSuspension ? 0.75 : 1))) * (track.resistance.hard * (hasImprovedSuspension ? 0.75 : 1))}
(hasEngineAccelerator
? tank.type === 'light' || tank.type === 'medium'
? 1.05
: 1.07
: 1)}
</InfoWithDelta> </InfoWithDelta>
<InfoWithDelta decimals={1} indent name="On medium terrain"> <InfoWithDelta decimals={1} indent name="On medium terrain">
{(engine.power / {((engine.power * engineAcceleratorBonus) /
weightTons / weightTons /
(track.resistance.medium * (hasImprovedSuspension ? 0.75 : 1))) * (track.resistance.medium * (hasImprovedSuspension ? 0.75 : 1))) *
(hasEngineAccelerator engineAcceleratorBonus}
? tank.type === 'light' || tank.type === 'medium'
? 1.05
: 1.07
: 1)}
</InfoWithDelta> </InfoWithDelta>
<InfoWithDelta decimals={1} indent name="On soft terrain"> <InfoWithDelta decimals={1} indent name="On soft terrain">
{(engine.power / {((engine.power * engineAcceleratorBonus) /
weightTons / weightTons /
(track.resistance.soft * (hasImprovedSuspension ? 0.75 : 1))) * (track.resistance.soft * (hasImprovedSuspension ? 0.75 : 1))) *
(hasEngineAccelerator engineAcceleratorBonus}
? tank.type === 'light' || tank.type === 'medium'
? 1.05
: 1.07
: 1)}
</InfoWithDelta> </InfoWithDelta>
<InfoWithDelta <InfoWithDelta
decimals={1} decimals={1}
@@ -405,6 +396,7 @@ export function Characteristics() {
<Info name="Effective traverse speed" unit="°/s" /> <Info name="Effective traverse speed" unit="°/s" />
<InfoWithDelta decimals={1} indent name="On hard terrain"> <InfoWithDelta decimals={1} indent name="On hard terrain">
{(engine.power / stockEngine.power) * {(engine.power / stockEngine.power) *
engineAcceleratorBonus *
track.traverseSpeed * track.traverseSpeed *
(track.resistance.hard / track.resistance.hard) * (track.resistance.hard / track.resistance.hard) *
(stockWeight / weight) * (stockWeight / weight) *
@@ -412,6 +404,7 @@ export function Characteristics() {
</InfoWithDelta> </InfoWithDelta>
<InfoWithDelta decimals={1} indent name="On medium terrain"> <InfoWithDelta decimals={1} indent name="On medium terrain">
{(engine.power / stockEngine.power) * {(engine.power / stockEngine.power) *
engineAcceleratorBonus *
track.traverseSpeed * track.traverseSpeed *
(track.resistance.hard / track.resistance.medium) * (track.resistance.hard / track.resistance.medium) *
(stockWeight / weight) * (stockWeight / weight) *
@@ -419,6 +412,7 @@ export function Characteristics() {
</InfoWithDelta> </InfoWithDelta>
<InfoWithDelta decimals={1} indent name="On soft terrain"> <InfoWithDelta decimals={1} indent name="On soft terrain">
{(engine.power / stockEngine.power) * {(engine.power / stockEngine.power) *
engineAcceleratorBonus *
track.traverseSpeed * track.traverseSpeed *
(track.resistance.hard / track.resistance.soft) * (track.resistance.hard / track.resistance.soft) *
(stockWeight / weight) * (stockWeight / weight) *