From 31bb92c08941e2fcc70bc066eff4f21821316423 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Tr=C3=A8sAbhi?= <43380238+tresabhi@users.noreply.github.com>
Date: Tue, 13 Feb 2024 20:45:43 -0600
Subject: [PATCH] feat: camouflage bonus
---
.../[id]/components/Characteristics/index.tsx | 31 ++++++++++++-------
1 file changed, 19 insertions(+), 12 deletions(-)
diff --git a/src/app/tools/tankopedia/[id]/components/Characteristics/index.tsx b/src/app/tools/tankopedia/[id]/components/Characteristics/index.tsx
index f7277c98b..b7eb2884a 100644
--- a/src/app/tools/tankopedia/[id]/components/Characteristics/index.tsx
+++ b/src/app/tools/tankopedia/[id]/components/Characteristics/index.tsx
@@ -12,6 +12,7 @@ import { unionBoundingBox } from '../../../../../../core/blitzkrieg/unionBoundin
import { useConsumable } from '../../../../../../core/blitzkrieg/useConsumable';
import { useEquipment } from '../../../../../../core/blitzkrieg/useEquipment';
import { useDuel } from '../../../../../../stores/duel';
+import { useTankopediaTemporary } from '../../../../../../stores/tankopedia';
import { Info } from './components/Info';
import { InfoWithDelta } from './components/InfoWithDelta';
@@ -63,17 +64,25 @@ export function Characteristics() {
const hasTungsten = useConsumable(45);
const hasReticleCalibration = useConsumable(28);
const hasShellReloadBoost = useConsumable(29);
+ const camouflage = useTankopediaTemporary((state) => state.camouflage);
+ const camouflageBonus = camouflage
+ ? tank.type === 'tankDestroyer'
+ ? 0.04
+ : tank.type === 'heavy'
+ ? 0.03
+ : 0.02
+ : 0;
const shellReloadBoostBonus = hasShellReloadBoost ? 0.7 : 1;
const adrenalineBonus = hasAdrenaline && gun.type === 'regular' ? 0.8 : 1;
const enginePowerBoostBonus =
(hasEnginePowerBoost ? 1.2 : 1) * (hasImprovedEnginePowerBoost ? 1.4 : 1);
const camouflageNetBonus = hasCamouflageNet
? tank.type === 'heavy'
- ? 1.03
+ ? 0.03
: tank.type === 'tankDestroyer'
- ? 1.07
- : 1.05
- : 1;
+ ? 0.07
+ : 0.05
+ : 0;
const calibratedShellsBonus = hasCalibratedShells
? isExplosive(shell.type)
? 1.1
@@ -456,27 +465,25 @@ export function Characteristics() {
- {tank.camouflage.still * camouflageNetBonus * 100}
+ {(tank.camouflage.still + camouflageNetBonus + camouflageBonus) * 100}
- {tank.camouflage.moving * camouflageNetBonus * 100}
+ {(tank.camouflage.moving + camouflageNetBonus + camouflageBonus) *
+ 100}
- {tank.camouflage.still *
+ {(tank.camouflage.still + camouflageNetBonus + camouflageBonus) *
gun.camouflageLoss *
- camouflageNetBonus *
100}
- {tank.camouflage.moving *
+ {(tank.camouflage.moving + camouflageNetBonus + camouflageBonus) *
gun.camouflageLoss *
- camouflageNetBonus *
100}
- {tank.camouflage.onFire *
+ {(tank.camouflage.onFire + camouflageNetBonus + camouflageBonus) *
tank.camouflage.still *
- camouflageNetBonus *
100}