From a2bf592eaf32f885614192805292c49345476209 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tr=C3=A8sAbhi?= <43380238+tresabhi@users.noreply.github.com> Date: Fri, 24 May 2024 20:50:55 -0500 Subject: [PATCH] feat: more progress --- .../SpacedArmorSceneComponent/index.tsx | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/src/components/Armor/components/SpacedArmorSceneComponent/index.tsx b/src/components/Armor/components/SpacedArmorSceneComponent/index.tsx index f8ccc64b8..eabf9e99e 100644 --- a/src/components/Armor/components/SpacedArmorSceneComponent/index.tsx +++ b/src/components/Armor/components/SpacedArmorSceneComponent/index.tsx @@ -238,7 +238,9 @@ export function SpacedArmorSceneComponent({ } } - if (remainingPenetration <= 0) break; + if (shell.type !== ShellType.HE && remainingPenetration <= 0) { + break; + } index++; } @@ -271,6 +273,8 @@ export function SpacedArmorSceneComponent({ shot.layersIn.length > 1 || lastLayer.status === 'blocked' ) { + console.log(finalDamage); + shot.status = finalDamage > 0 ? 'splash' : 'blocked'; shot.damage = finalDamage; } else { @@ -278,7 +282,16 @@ export function SpacedArmorSceneComponent({ shot.damage = shell.damage.armor; } } else { - shot.status = lastLayer.status; + if (lastLayer.status === 'blocked') { + shot.status = 'blocked'; + shot.damage = 0; + } else if (lastLayer.status === 'penetration') { + shot.status = 'penetration'; + shot.damage = shell.damage.armor; + } else { + // check second array for result + shot.status = 'ricochet'; + } } console.log(shot);