feat: shot card equalizer

This commit is contained in:
TrèsAbhi committed 2026-04-03 12:15:03 -05:00
1 parent 77c516a6eb
commit 145de2bbbc
4 files changed
+22 -7

No files matched your search

@@ -18,6 +18,7 @@ import {
import { degToRad } from "three/src/math/MathUtils.js";
import { hasEquipment } from "../../../../core/blitzkit/hasEquipment";
import { jsxTree } from "../../../../core/blitzkit/jsxTree";
import { defaultEqualizer } from "../../../../core/blitzkit/tankToDuelMember";
import { discardClippingPlane } from "../../../../core/three/discardClippingPlane";
import { Duel } from "../../../../stores/duel";
import {
@@ -87,6 +88,10 @@ export function SpacedArmorSceneComponent({
) => {
const { customShell } = Tankopedia.state;
const shell = customShell ?? Duel.state.antagonist.shell;
const { equalize } = Duel.state;
const equalizer =
(equalize ? Duel.state.antagonist.tank.equalizer : undefined) ??
defaultEqualizer;
const cameraNormal = camera.position.clone().sub(point).normalize();
const shot: Shot = {
splashRadius:
@@ -367,6 +372,8 @@ export function SpacedArmorSceneComponent({
}
}
shot.damage *= equalizer.damage;
return shot;
},
[camera],
@@ -12,6 +12,7 @@ import {
} from "@radix-ui/themes";
import { useLocale } from "../../../../hooks/useLocale";
import { Duel } from "../../../../stores/duel";
import { Tankopedia } from "../../../../stores/tankopedia";
import { ConfigurationChildWrapper } from "./ConfigurationChildWrapper";
export function Equalizer() {
@@ -35,6 +36,9 @@ export function Equalizer() {
Duel.mutate((draft) => {
draft.equalize = !draft.equalize;
});
Tankopedia.mutate((draft) => {
draft.shot = undefined;
});
}}
width="100%"
style={{