mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-10-21 18:57:03 +02:00
feat: more values batch 1
This commit is contained in:
1 parent
1a19e56523
commit
b811be4284
12 files changed
+94
-46
No files matched your search
@@ -10,6 +10,6 @@
|
||||
- Maddox: game file decompression
|
||||
- Pyogenics: tank model decompression
|
||||
- Aeson: game files layout
|
||||
- minitelrose, ChickenMan7777: 3-caliber rule edge cases
|
||||
- Minitelrose, ChickenMan7777: 3-caliber rule edge cases
|
||||
- \_34, HisRoyalFatness, Synx, xkdkw: embed UX
|
||||
- [OPTML], Aeson, \_34, Droodles: beta testing tankopedia
|
||||
@@ -88,6 +88,11 @@ interface VehicleDefinitions {
|
||||
};
|
||||
chassis: {
|
||||
[key: string]: {
|
||||
rotationSpeed: number;
|
||||
shotDispersionFactors: {
|
||||
vehicleMovement: number;
|
||||
vehicleRotation: number;
|
||||
};
|
||||
hullPosition: string;
|
||||
armor: {
|
||||
leftTrack:
|
||||
@@ -112,6 +117,7 @@ interface VehicleDefinitions {
|
||||
};
|
||||
turrets0: {
|
||||
[key: string]: {
|
||||
rotationSpeed: number;
|
||||
circularVisionRadius: number;
|
||||
maxHealth: number;
|
||||
armor: VehicleDefinitionArmor;
|
||||
@@ -136,6 +142,13 @@ interface VehicleDefinitions {
|
||||
};
|
||||
invisibilityFactorAtShot: number | number[];
|
||||
reloadTime: number;
|
||||
aimingTime?: number;
|
||||
shotDispersionRadius: number;
|
||||
shotDispersionFactors?: {
|
||||
turretRotation: number;
|
||||
afterShot: number;
|
||||
whileGunDamaged: number;
|
||||
};
|
||||
maxAmmo: number;
|
||||
extraPitchLimits?: {
|
||||
front?: string;
|
||||
@@ -177,6 +190,12 @@ interface GunDefinitionsList {
|
||||
ids: Record<string, number>;
|
||||
shared: {
|
||||
[key: string]: {
|
||||
shotDispersionFactors: {
|
||||
turretRotation: number;
|
||||
afterShot: number;
|
||||
whileGunDamaged: number;
|
||||
};
|
||||
aimingTime: number;
|
||||
userString: string;
|
||||
tags: string;
|
||||
level: number;
|
||||
@@ -254,7 +273,7 @@ const consumableProvisionEffectSuffixes = [
|
||||
'Percent',
|
||||
];
|
||||
const blitzTankTypeToBlitzkrieg: Record<BlitzTankType, TankType> = {
|
||||
'AT-SPG': 'tank_destroyer',
|
||||
'AT-SPG': 'tankDestroyer',
|
||||
lightTank: 'light',
|
||||
mediumTank: 'medium',
|
||||
heavyTank: 'heavy',
|
||||
@@ -392,9 +411,9 @@ export async function definitions(production: boolean) {
|
||||
(tank.shortUserString
|
||||
? strings[tank.shortUserString]
|
||||
: undefined) ?? strings[tank.userString],
|
||||
name_full: strings[tank.userString],
|
||||
nameFull: strings[tank.userString],
|
||||
nation,
|
||||
tree_type: tankTags.includes('collectible')
|
||||
treeType: tankTags.includes('collectible')
|
||||
? 'collector'
|
||||
: (typeof tank.price === 'number' ? false : 'gold' in tank.price)
|
||||
? 'premium'
|
||||
@@ -410,12 +429,15 @@ export async function definitions(production: boolean) {
|
||||
},
|
||||
turrets: [],
|
||||
engines: [],
|
||||
dispersion: {
|
||||
move: defaultChassis.shotDispersionFactors.vehicleMovement,
|
||||
traverse: defaultChassis.shotDispersionFactors.vehicleRotation,
|
||||
},
|
||||
traverseSpeed: defaultChassis.rotationSpeed,
|
||||
};
|
||||
|
||||
if (
|
||||
tankDefinitions[tankId].name === tankDefinitions[tankId].name_full
|
||||
) {
|
||||
delete tankDefinitions[tankId].name_full;
|
||||
if (tankDefinitions[tankId].name === tankDefinitions[tankId].nameFull) {
|
||||
delete tankDefinitions[tankId].nameFull;
|
||||
}
|
||||
|
||||
modelDefinitions[tankId] = {
|
||||
@@ -494,6 +516,7 @@ export async function definitions(production: boolean) {
|
||||
});
|
||||
|
||||
tankDefinitions[tankId].turrets.push({
|
||||
traverseSpeed: turret.rotationSpeed,
|
||||
id: turretId,
|
||||
name:
|
||||
strings[turret.userString] ??
|
||||
@@ -503,7 +526,7 @@ export async function definitions(production: boolean) {
|
||||
tier: turret.level as Tier,
|
||||
guns: [],
|
||||
health: turret.maxHealth,
|
||||
view_range: turret.circularVisionRadius,
|
||||
viewRange: turret.circularVisionRadius,
|
||||
});
|
||||
|
||||
modelDefinitions[tankId].turrets[turretId] = {
|
||||
@@ -567,6 +590,9 @@ export async function definitions(production: boolean) {
|
||||
: turretGunEntry.extraPitchLimits.transition.at(-1)!
|
||||
: undefined;
|
||||
const gunArmor: ModelArmor = { thickness: {} };
|
||||
const shotDispersionFactors =
|
||||
turretGunEntry.shotDispersionFactors ??
|
||||
gunListEntry.shotDispersionFactors;
|
||||
|
||||
Object.keys(turretGunEntry.armor)
|
||||
.filter((name) => name.startsWith('armor_'))
|
||||
@@ -599,6 +625,13 @@ export async function definitions(production: boolean) {
|
||||
typeof turretGunEntry.invisibilityFactorAtShot === 'number'
|
||||
? turretGunEntry.invisibilityFactorAtShot
|
||||
: turretGunEntry.invisibilityFactorAtShot.at(-1)!,
|
||||
aimTime: turretGunEntry.aimingTime ?? gunListEntry.aimingTime,
|
||||
dispersion: {
|
||||
base: turretGunEntry.shotDispersionRadius,
|
||||
damaged: shotDispersionFactors.whileGunDamaged,
|
||||
shot: shotDispersionFactors.afterShot,
|
||||
traverse: shotDispersionFactors.turretRotation,
|
||||
},
|
||||
} as GunDefinition);
|
||||
|
||||
modelDefinitions[tankId].turrets[turretId].guns[gunId] = {
|
||||
|
||||
@@ -295,7 +295,7 @@ export default function SessionPage() {
|
||||
}
|
||||
type="tank"
|
||||
tankType={tankDefinitions?.type}
|
||||
treeType={tankDefinitions?.tree_type}
|
||||
treeType={tankDefinitions?.treeType}
|
||||
stats={session.customColumns.map((customColumn) => {
|
||||
const rowStat = rowStats[customColumn.display];
|
||||
|
||||
|
||||
@@ -53,7 +53,7 @@ export function Characteristics() {
|
||||
{Math.round(engine.fire_chance * 100)}
|
||||
</Info>
|
||||
<Info name="View range" unit="m">
|
||||
{turret.view_range}
|
||||
{turret.viewRange}
|
||||
</Info>
|
||||
<Info name="Camouflage" unit="%" />
|
||||
<Info indent name="Still">
|
||||
|
||||
@@ -14,9 +14,9 @@ export function Title() {
|
||||
<Flex gap="2" align="center">
|
||||
<Heading
|
||||
color={
|
||||
protagonist.tank.tree_type === 'premium'
|
||||
protagonist.tank.treeType === 'premium'
|
||||
? 'amber'
|
||||
: protagonist.tank.tree_type === 'collector'
|
||||
: protagonist.tank.treeType === 'collector'
|
||||
? 'blue'
|
||||
: undefined
|
||||
}
|
||||
@@ -24,7 +24,7 @@ export function Title() {
|
||||
<Flex align="center" gap="2">
|
||||
<img
|
||||
src={
|
||||
TREE_TYPE_ICONS[protagonist.tank.tree_type][
|
||||
TREE_TYPE_ICONS[protagonist.tank.treeType][
|
||||
protagonist.tank.type
|
||||
]
|
||||
}
|
||||
|
||||
+2
-2
@@ -29,7 +29,7 @@ export function CompactSearchResultRow({
|
||||
{TIER_ROMAN_NUMERALS[tank.tier]}
|
||||
</Text>
|
||||
|
||||
<Text color={tank.tree_type === 'collector' ? 'blue' : 'amber'}>
|
||||
<Text color={tank.treeType === 'collector' ? 'blue' : 'amber'}>
|
||||
<Flex gap="2" align="center">
|
||||
<SmallTankIcon id={tank.id} size={16} />
|
||||
|
||||
@@ -37,7 +37,7 @@ export function CompactSearchResultRow({
|
||||
style={{
|
||||
display: 'block',
|
||||
color:
|
||||
tank.tree_type === 'researchable' ? 'white' : undefined,
|
||||
tank.treeType === 'researchable' ? 'white' : undefined,
|
||||
}}
|
||||
>
|
||||
{tank.name}
|
||||
|
||||
@@ -56,7 +56,7 @@ export function TankSearch({ compact, onSelect = () => {} }: TankSearchProps) {
|
||||
: filters.types.includes(tank.type)) &&
|
||||
(filters.treeTypes.length === 0
|
||||
? true
|
||||
: filters.treeTypes.includes(tank.tree_type)) &&
|
||||
: filters.treeTypes.includes(tank.treeType)) &&
|
||||
(filters.nations.length === 0
|
||||
? true
|
||||
: filters.nations.includes(tank.nation)) &&
|
||||
@@ -266,9 +266,9 @@ export function TankSearch({ compact, onSelect = () => {} }: TankSearchProps) {
|
||||
<Flex align="center" justify="center" gap="1">
|
||||
<img
|
||||
src={
|
||||
(tank.tree_type === 'collector'
|
||||
(tank.treeType === 'collector'
|
||||
? TANK_ICONS_COLLECTOR
|
||||
: tank.tree_type === 'premium'
|
||||
: tank.treeType === 'premium'
|
||||
? TANK_ICONS_PREMIUM
|
||||
: TANK_ICONS)[tank.type]
|
||||
}
|
||||
@@ -277,16 +277,16 @@ export function TankSearch({ compact, onSelect = () => {} }: TankSearchProps) {
|
||||
<Text
|
||||
size="4"
|
||||
color={
|
||||
tank.tree_type === 'collector'
|
||||
tank.treeType === 'collector'
|
||||
? 'blue'
|
||||
: tank.tree_type === 'premium'
|
||||
: tank.treeType === 'premium'
|
||||
? 'amber'
|
||||
: undefined
|
||||
}
|
||||
weight="medium"
|
||||
style={{
|
||||
color:
|
||||
tank.tree_type === 'researchable'
|
||||
tank.treeType === 'researchable'
|
||||
? slateDark.slate12
|
||||
: undefined,
|
||||
whiteSpace: 'nowrap',
|
||||
|
||||
@@ -97,7 +97,7 @@ export const ownedTanksCommand: CommandRegistry = {
|
||||
name={tank.name}
|
||||
tankType={tank.type}
|
||||
image={tankIcon(tank.id)}
|
||||
treeType={tank.tree_type}
|
||||
treeType={tank.treeType}
|
||||
/>
|
||||
)),
|
||||
)}
|
||||
@@ -110,7 +110,7 @@ export const ownedTanksCommand: CommandRegistry = {
|
||||
name={tank.name}
|
||||
tankType={tank.type}
|
||||
image={tankIcon(tank.id)}
|
||||
treeType={tank.tree_type}
|
||||
treeType={tank.treeType}
|
||||
/>
|
||||
)),
|
||||
)}
|
||||
|
||||
@@ -6,7 +6,7 @@ import {
|
||||
import { theme } from '../../../stitches.config';
|
||||
|
||||
export const TANK_TYPES = [
|
||||
'tank_destroyer',
|
||||
'tankDestroyer',
|
||||
'light',
|
||||
'medium',
|
||||
'heavy',
|
||||
|
||||
@@ -4,8 +4,8 @@ import { tankDefinitions } from '../blitzkrieg/tankDefinitions';
|
||||
export default async function getTreeType(id: number): Promise<TreeType> {
|
||||
const entry = (await tankDefinitions)[id];
|
||||
|
||||
if (entry.tree_type === 'collector') return 'collector';
|
||||
if (entry.tree_type === 'premium') return 'premium';
|
||||
if (entry.treeType === 'collector') return 'collector';
|
||||
if (entry.treeType === 'premium') return 'premium';
|
||||
|
||||
return 'researchable';
|
||||
}
|
||||
@@ -18,8 +18,8 @@ export interface TankDefinition {
|
||||
health: number;
|
||||
nation: string;
|
||||
name: string;
|
||||
name_full?: string;
|
||||
tree_type: TreeType;
|
||||
nameFull?: string;
|
||||
treeType: TreeType;
|
||||
consumables: number;
|
||||
provisions: number;
|
||||
tier: Tier;
|
||||
@@ -33,6 +33,11 @@ export interface TankDefinition {
|
||||
moving: number;
|
||||
onFire: number;
|
||||
};
|
||||
traverseSpeed: number;
|
||||
dispersion: {
|
||||
move: number;
|
||||
traverse: number;
|
||||
};
|
||||
equipment: string;
|
||||
}
|
||||
export interface EngineDefinition {
|
||||
@@ -46,33 +51,43 @@ export type TankDefinitionPrice =
|
||||
| { type: 'gold'; value: number };
|
||||
export interface TurretDefinition {
|
||||
health: number;
|
||||
view_range: number;
|
||||
viewRange: number;
|
||||
traverseSpeed: number;
|
||||
id: number;
|
||||
name: string;
|
||||
tier: Tier;
|
||||
guns: GunDefinition[];
|
||||
}
|
||||
export type GunDefinition = GunDefinitionBase &
|
||||
(GunDefinitionRegular | GunDefinitionAutoLoader | GunDefinitionAutoReloader);
|
||||
export type GunDefinition =
|
||||
| GunDefinitionRegular
|
||||
| GunDefinitionAutoLoader
|
||||
| GunDefinitionAutoReloader;
|
||||
interface GunDefinitionBase {
|
||||
id: number;
|
||||
name: string;
|
||||
tier: Tier;
|
||||
shells: ShellDefinition[];
|
||||
camouflageLoss: number;
|
||||
aimTime: number;
|
||||
dispersion: {
|
||||
base: number;
|
||||
traverse: number;
|
||||
shot: number;
|
||||
damaged: number;
|
||||
};
|
||||
}
|
||||
interface GunDefinitionRegular {
|
||||
interface GunDefinitionRegular extends GunDefinitionBase {
|
||||
type: 'regular';
|
||||
reload: number;
|
||||
}
|
||||
interface GunDefinitionAutoLoader {
|
||||
type: 'auto_loader';
|
||||
interface GunDefinitionAutoLoader extends GunDefinitionBase {
|
||||
type: 'autoLoader';
|
||||
reload: number;
|
||||
interClip: number;
|
||||
count: number;
|
||||
}
|
||||
interface GunDefinitionAutoReloader {
|
||||
type: 'auto_reloader';
|
||||
interface GunDefinitionAutoReloader extends GunDefinitionBase {
|
||||
type: 'autoReloader';
|
||||
reload: number[];
|
||||
interClip: number;
|
||||
count: number;
|
||||
@@ -93,8 +108,8 @@ export type ShellDefinition = {
|
||||
|
||||
export const GUN_TYPE_NAMES: Record<GunDefinition['type'], string> = {
|
||||
regular: 'Regular',
|
||||
auto_loader: 'Auto loader',
|
||||
auto_reloader: 'Auto reloader',
|
||||
autoLoader: 'Auto loader',
|
||||
autoReloader: 'Auto reloader',
|
||||
};
|
||||
|
||||
export const tankDefinitions = fetch(asset('definitions/tanks.json'), {
|
||||
@@ -117,28 +132,28 @@ export const tankNames = tanksDefinitionsArray.then((tanks) =>
|
||||
return {
|
||||
id,
|
||||
original: tank.name,
|
||||
combined: `${tank.name}${deburr(tank.name)}${tank.name_full ? `${tank.name_full}${deburr(tank.name_full)}` : ''}`,
|
||||
combined: `${tank.name}${deburr(tank.name)}${tank.nameFull ? `${tank.nameFull}${deburr(tank.nameFull)}` : ''}`,
|
||||
};
|
||||
}),
|
||||
),
|
||||
);
|
||||
|
||||
export const TANK_ICONS: Record<TankType, string> = {
|
||||
tank_destroyer: 'https://i.imgur.com/BIHSEH0.png',
|
||||
tankDestroyer: 'https://i.imgur.com/BIHSEH0.png',
|
||||
light: 'https://i.imgur.com/CSNha5V.png',
|
||||
medium: 'https://i.imgur.com/wvf3ltm.png',
|
||||
heavy: 'https://i.imgur.com/ECeqlZa.png',
|
||||
};
|
||||
|
||||
export const TANK_ICONS_PREMIUM: Record<TankType, string> = {
|
||||
tank_destroyer: 'https://i.imgur.com/TCu3EdR.png',
|
||||
tankDestroyer: 'https://i.imgur.com/TCu3EdR.png',
|
||||
light: 'https://i.imgur.com/zdkpTRb.png',
|
||||
medium: 'https://i.imgur.com/3z7eHX6.png',
|
||||
heavy: 'https://i.imgur.com/P3vbmyA.png',
|
||||
};
|
||||
|
||||
export const TANK_ICONS_COLLECTOR: Record<TankType, string> = {
|
||||
tank_destroyer: 'https://i.imgur.com/WTjeirB.png',
|
||||
tankDestroyer: 'https://i.imgur.com/WTjeirB.png',
|
||||
light: 'https://i.imgur.com/EwhtKkU.png',
|
||||
medium: 'https://i.imgur.com/u8YDMBh.png',
|
||||
heavy: 'https://i.imgur.com/8xRf3nc.png',
|
||||
|
||||
@@ -31,10 +31,10 @@ export async function filterStats(
|
||||
(filters.tier === undefined || entry.tier === filters.tier) &&
|
||||
(filters.tankType === undefined || entry.type === filters.tankType) &&
|
||||
(filters.treeType === undefined ||
|
||||
(filters.treeType === 'collector' && entry.tree_type === 'collector') ||
|
||||
(filters.treeType === 'premium' && entry.tree_type === 'premium') ||
|
||||
(filters.treeType === 'collector' && entry.treeType === 'collector') ||
|
||||
(filters.treeType === 'premium' && entry.treeType === 'premium') ||
|
||||
(filters.treeType === 'researchable' &&
|
||||
entry.tree_type === 'researchable')) &&
|
||||
entry.treeType === 'researchable')) &&
|
||||
(filters.tank === undefined || entry.id === filters.tank)
|
||||
);
|
||||
});
|
||||
|
||||
Reference in new issue
Block a user