mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-10-28 04:59:50 +01:00
fix: consider shells
This commit is contained in:
1 parent
e1b5b21fae
commit
a704b291fd
7 files changed
+24
-13
No files matched your search
@@ -294,7 +294,7 @@ export interface TankDefinition {
|
|||||||
crew: Crew[];
|
crew: Crew[];
|
||||||
health: number;
|
health: number;
|
||||||
nation: string;
|
nation: string;
|
||||||
name: I18nString | undefined;
|
name: I18nString;
|
||||||
type: TankType;
|
type: TankType;
|
||||||
max_consumables: number;
|
max_consumables: number;
|
||||||
max_provisions: number;
|
max_provisions: number;
|
||||||
|
|||||||
+8
-2
@@ -2,7 +2,10 @@ import { DragHandleDots2Icon } from '@radix-ui/react-icons';
|
|||||||
import { Box, Flex, Text } from '@radix-ui/themes';
|
import { Box, Flex, Text } from '@radix-ui/themes';
|
||||||
import { useEffect, useRef, useState } from 'react';
|
import { useEffect, useRef, useState } from 'react';
|
||||||
import { clamp } from 'three/src/math/MathUtils.js';
|
import { clamp } from 'three/src/math/MathUtils.js';
|
||||||
import { fakeLogInverse } from '../../../../../../../../../core/blitzkit/fakeLog';
|
import {
|
||||||
|
fakeLog,
|
||||||
|
fakeLogInverse,
|
||||||
|
} from '../../../../../../../../../core/blitzkit/fakeLog';
|
||||||
import { Var } from '../../../../../../../../../core/radix/var';
|
import { Var } from '../../../../../../../../../core/radix/var';
|
||||||
import { Duel } from '../../../../../../../../../stores/duel';
|
import { Duel } from '../../../../../../../../../stores/duel';
|
||||||
import './index.css';
|
import './index.css';
|
||||||
@@ -13,7 +16,10 @@ interface Props {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export function AssaultCursor({ maxDistance, maxFakeDistance }: Props) {
|
export function AssaultCursor({ maxDistance, maxFakeDistance }: Props) {
|
||||||
const [x, setX] = useState(0.5);
|
const assaultDistance = Duel.use(
|
||||||
|
(state) => state.protagonist.assaultDistance,
|
||||||
|
);
|
||||||
|
const [x, setX] = useState(fakeLog(assaultDistance / maxDistance, 2));
|
||||||
const cursor = useRef<HTMLDivElement>(null);
|
const cursor = useRef<HTMLDivElement>(null);
|
||||||
const mutateDuel = Duel.useMutation();
|
const mutateDuel = Duel.useMutation();
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -120,7 +120,7 @@ export function Firepower({ stats }: StatsAcceptorProps) {
|
|||||||
<InfoWithDelta stats={stats} decimals={0} value="moduleDamage" />
|
<InfoWithDelta stats={stats} decimals={0} value="moduleDamage" />
|
||||||
<InfoWithDelta stats={stats} decimals={0} value="penetration" />
|
<InfoWithDelta stats={stats} decimals={0} value="penetration" />
|
||||||
|
|
||||||
{gun.gun_type!.value.base.assault_ranges && (
|
{gun.gun_type!.value.base.assault_ranges?.types.includes(shell.type) && (
|
||||||
<AssaultRangesVisualizer
|
<AssaultRangesVisualizer
|
||||||
stats={stats}
|
stats={stats}
|
||||||
ranges={gun.gun_type!.value.base.assault_ranges}
|
ranges={gun.gun_type!.value.base.assault_ranges}
|
||||||
|
|||||||
+4
-1
@@ -73,6 +73,9 @@ export function SceneProps() {
|
|||||||
const crewSkills = TankopediaEphemeral.use((state) => state.skills);
|
const crewSkills = TankopediaEphemeral.use((state) => state.skills);
|
||||||
const consumables = Duel.use((state) => state.protagonist.consumables);
|
const consumables = Duel.use((state) => state.protagonist.consumables);
|
||||||
const provisions = Duel.use((state) => state.protagonist.provisions);
|
const provisions = Duel.use((state) => state.protagonist.provisions);
|
||||||
|
const assaultDistance = Duel.use(
|
||||||
|
(state) => state.protagonist.assaultDistance,
|
||||||
|
);
|
||||||
const equipmentMatrix = Duel.use(
|
const equipmentMatrix = Duel.use(
|
||||||
(state) => state.protagonist.equipmentMatrix,
|
(state) => state.protagonist.equipmentMatrix,
|
||||||
);
|
);
|
||||||
@@ -96,7 +99,7 @@ export function SceneProps() {
|
|||||||
stockTurret: tank.turrets[0],
|
stockTurret: tank.turrets[0],
|
||||||
stockTrack: tank.tracks[0],
|
stockTrack: tank.tracks[0],
|
||||||
track,
|
track,
|
||||||
assaultDistance: 0,
|
assaultDistance,
|
||||||
},
|
},
|
||||||
{ equipmentDefinitions, provisionDefinitions, tankModelDefinition },
|
{ equipmentDefinitions, provisionDefinitions, tankModelDefinition },
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -159,12 +159,13 @@ export function tankCharacteristics(
|
|||||||
[applyDynamicArmor, -0.1],
|
[applyDynamicArmor, -0.1],
|
||||||
[applySpallLiner && shell.type === ShellType.HE, -0.2],
|
[applySpallLiner && shell.type === ShellType.HE, -0.2],
|
||||||
);
|
);
|
||||||
const assaultDamageCoefficient = gun.gun_type!.value.base.assault_ranges
|
const assaultDamageCoefficient =
|
||||||
? // && gun.gun_type!.value.base.assault_ranges.types.includes(shell.type)
|
gun.gun_type!.value.base.assault_ranges &&
|
||||||
(gun.gun_type!.value.base.assault_ranges.ranges.find(
|
gun.gun_type!.value.base.assault_ranges.types.includes(shell.type)
|
||||||
({ distance }) => distance >= assaultDistance,
|
? (gun.gun_type!.value.base.assault_ranges.ranges.find(
|
||||||
)?.factor ?? 0)
|
({ distance }) => distance >= assaultDistance,
|
||||||
: 1;
|
)?.factor ?? 0)
|
||||||
|
: 1;
|
||||||
const moduleDamageCoefficient =
|
const moduleDamageCoefficient =
|
||||||
coefficient([hasTungsten, 0.15]) * assaultDamageCoefficient;
|
coefficient([hasTungsten, 0.15]) * assaultDamageCoefficient;
|
||||||
const reloadCoefficient =
|
const reloadCoefficient =
|
||||||
|
|||||||
@@ -40,6 +40,7 @@ export function tankToDuelMember(
|
|||||||
yaw,
|
yaw,
|
||||||
pitch,
|
pitch,
|
||||||
turret,
|
turret,
|
||||||
assaultDistance: 0,
|
assaultDistance:
|
||||||
|
(gun.gun_type!.value.base.assault_ranges?.ranges[0].distance ?? 0) / 2,
|
||||||
} satisfies DuelMember;
|
} satisfies DuelMember;
|
||||||
}
|
}
|
||||||
@@ -85,7 +85,7 @@ function Content() {
|
|||||||
member.key !== thisMember.key &&
|
member.key !== thisMember.key &&
|
||||||
member.provisions.includes(101),
|
member.provisions.includes(101),
|
||||||
),
|
),
|
||||||
assaultDistance: 0,
|
assaultDistance: thisMember.assaultDistance,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
equipmentDefinitions: equipmentDefinitions,
|
equipmentDefinitions: equipmentDefinitions,
|
||||||
|
|||||||
Reference in new issue
Block a user