mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-10-21 10:47:04 +02:00
penetration
This commit is contained in:
1 parent
bf132a7387
commit
4e1219486d
9 files changed
+90
-19
No files matched your search
@@ -0,0 +1,16 @@
|
||||
import { ShellType } from "@blitzkit/protos";
|
||||
import { ShellKind } from "../types";
|
||||
|
||||
export const blitzShellKindToBlitzkit: Record<ShellKind, ShellType> = {
|
||||
ARMOR_PIERCING: ShellType.SHELL_TYPE_AP,
|
||||
ARMOR_PIERCING_CR: ShellType.SHELL_TYPE_APCR,
|
||||
HIGH_EXPLOSIVE: ShellType.SHELL_TYPE_HE,
|
||||
HOLLOW_CHARGE: ShellType.SHELL_TYPE_HEAT,
|
||||
};
|
||||
|
||||
// @ts-ignore
|
||||
export const blitzkitToBlitzShellKind: Record<ShellType, ShellKind> = {};
|
||||
|
||||
for (const [key, value] of Object.entries(blitzShellKindToBlitzkit)) {
|
||||
blitzkitToBlitzShellKind[value] = key as ShellKind;
|
||||
}
|
||||
@@ -1,3 +1,4 @@
|
||||
export * from "./blitzShellKindToBlitzkit";
|
||||
export * from "./canSplash";
|
||||
export * from "./clans";
|
||||
export * from "./classes";
|
||||
|
||||
@@ -12,7 +12,6 @@ import {
|
||||
OptionalDevices,
|
||||
OptionalDeviceSlots,
|
||||
ProvisionsCommon,
|
||||
ShellKind,
|
||||
SquadBattleTypeStylesYaml,
|
||||
TankmenAvatar,
|
||||
toUniqueId,
|
||||
@@ -25,7 +24,6 @@ import {
|
||||
CrewType,
|
||||
I18nString,
|
||||
ModuleType,
|
||||
ShellType,
|
||||
TankClass,
|
||||
} from "@blitzkit/protos";
|
||||
import type { extname, parse } from "node:path";
|
||||
@@ -80,12 +78,6 @@ export abstract class ServerBlitzKitAPI0 extends AbstractBlitzKitAPI {
|
||||
heavyTank: TankClass.TANK_CLASS_HEAVY,
|
||||
mediumTank: TankClass.TANK_CLASS_MEDIUM,
|
||||
};
|
||||
protected blitzShellKindToBlitzkit: Record<ShellKind, ShellType> = {
|
||||
ARMOR_PIERCING: ShellType.SHELL_TYPE_AP,
|
||||
ARMOR_PIERCING_CR: ShellType.SHELL_TYPE_APCR,
|
||||
HIGH_EXPLOSIVE: ShellType.SHELL_TYPE_HE,
|
||||
HOLLOW_CHARGE: ShellType.SHELL_TYPE_HEAT,
|
||||
};
|
||||
protected blitzTankFilterDefinitionCategoryToBlitzkit: Record<
|
||||
BlitzTankFilterDefinitionCategory,
|
||||
ConsumableTankCategoryFilterCategory
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import {
|
||||
BlitzCrewType,
|
||||
BlitzModuleType,
|
||||
blitzShellKindToBlitzkit,
|
||||
BlitzTankClass,
|
||||
ChassisDefinitionsList,
|
||||
EngineDefinitionsList,
|
||||
@@ -509,8 +510,8 @@ export abstract class ServerBlitzKitAPI1 extends ServerBlitzKitAPI0 {
|
||||
.map((string) => {
|
||||
const trimmed = string.trim();
|
||||
|
||||
if (trimmed in this.blitzShellKindToBlitzkit) {
|
||||
return this.blitzShellKindToBlitzkit[trimmed as ShellKind];
|
||||
if (trimmed in blitzShellKindToBlitzkit) {
|
||||
return blitzShellKindToBlitzkit[trimmed as ShellKind];
|
||||
}
|
||||
|
||||
throw new SyntaxError(`Invalid shell kind: ${trimmed}`);
|
||||
@@ -614,7 +615,7 @@ export abstract class ServerBlitzKitAPI1 extends ServerBlitzKitAPI0 {
|
||||
caliber: shell.caliber,
|
||||
normalization: shell.normalizationAngle,
|
||||
ricochet: shell.ricochetAngle,
|
||||
type: this.blitzShellKindToBlitzkit[shell.kind],
|
||||
type: blitzShellKindToBlitzkit[shell.kind],
|
||||
explosion_radius:
|
||||
shell.kind === "HIGH_EXPLOSIVE"
|
||||
? (shell.explosionRadius ?? 0)
|
||||
|
||||
Reference in new issue
Block a user