mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-10-24 20:19:49 +02:00
(1) some implementation
This commit is contained in:
1 parent
244968bbbf
commit
b0611d7d72
13 files changed
+1359
-1006
No files matched your search
File diff suppressed because it is too large.
Load diff
@@ -0,0 +1,10 @@
|
|||||||
|
export type BlitzModuleType = {
|
||||||
|
[key in "vehicle" | "engine" | "chassis" | "turret" | "gun"]:
|
||||||
|
| UnlocksInner
|
||||||
|
| UnlocksInner[];
|
||||||
|
};
|
||||||
|
|
||||||
|
interface UnlocksInner {
|
||||||
|
cost: number | string;
|
||||||
|
"#text": number;
|
||||||
|
}
|
||||||
@@ -0,0 +1,4 @@
|
|||||||
|
export interface ChassisDefinitionsList {
|
||||||
|
nextAvailableId: number;
|
||||||
|
ids: Record<string, number>;
|
||||||
|
}
|
||||||
@@ -0,0 +1,13 @@
|
|||||||
|
export interface EngineDefinitionsList {
|
||||||
|
nextAvailableId: number;
|
||||||
|
ids: Record<string, number>;
|
||||||
|
shared: {
|
||||||
|
[key: string]: {
|
||||||
|
userString: string;
|
||||||
|
level: number;
|
||||||
|
fireStartingChance: number;
|
||||||
|
weight: number;
|
||||||
|
power: number;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
@@ -0,0 +1,31 @@
|
|||||||
|
export interface GunDefinitionsList {
|
||||||
|
nextAvailableId: number;
|
||||||
|
ids: Record<string, number>;
|
||||||
|
shared: {
|
||||||
|
[key: string]: {
|
||||||
|
rotationSpeed: number;
|
||||||
|
weight: number;
|
||||||
|
shotDispersionFactors: {
|
||||||
|
turretRotation: number;
|
||||||
|
afterShot: number;
|
||||||
|
whileGunDamaged: number;
|
||||||
|
};
|
||||||
|
maxAmmo: number;
|
||||||
|
aimingTime: number;
|
||||||
|
shotDispersionRadius: number;
|
||||||
|
userString: string;
|
||||||
|
tags: string;
|
||||||
|
level: number;
|
||||||
|
pitchLimits: string;
|
||||||
|
burst?: { count: number; rate: number };
|
||||||
|
clip?: { count: number; rate: number };
|
||||||
|
shots: {
|
||||||
|
[key: string]: {
|
||||||
|
speed: number;
|
||||||
|
piercingPower: string;
|
||||||
|
maxDistance: number;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
@@ -1,16 +1,25 @@
|
|||||||
export * from "./availableNationsYaml";
|
export * from "./availableNationsYaml";
|
||||||
|
export * from "./blitzModuleType";
|
||||||
export * from "./blitzStrings";
|
export * from "./blitzStrings";
|
||||||
export * from "./camouflagesXml";
|
export * from "./camouflagesXml";
|
||||||
export * from "./camouflagesYaml";
|
export * from "./camouflagesYaml";
|
||||||
|
export * from "./chassisDefinitionsList";
|
||||||
export * from "./combatRolesYaml";
|
export * from "./combatRolesYaml";
|
||||||
export * from "./consumablesCommon";
|
export * from "./consumablesCommon";
|
||||||
export * from "./consumablesVehicleFilter";
|
export * from "./consumablesVehicleFilter";
|
||||||
|
export * from "./engineDefinitionsList";
|
||||||
export * from "./glossary";
|
export * from "./glossary";
|
||||||
|
export * from "./gunDefinitionsList";
|
||||||
export * from "./mapsYaml";
|
export * from "./mapsYaml";
|
||||||
export * from "./optionalDevices";
|
export * from "./optionalDevices";
|
||||||
export * from "./optionalDeviceSlots";
|
export * from "./optionalDeviceSlots";
|
||||||
export * from "./provisionsCommon";
|
export * from "./provisionsCommon";
|
||||||
|
export * from "./shellDefinitionsList";
|
||||||
export * from "./squadBattleTypeStylesYaml";
|
export * from "./squadBattleTypeStylesYaml";
|
||||||
export * from "./tankmenAvatar";
|
export * from "./tankmenAvatar";
|
||||||
|
export * from "./tankParameters";
|
||||||
export * from "./tanksStats";
|
export * from "./tanksStats";
|
||||||
|
export * from "./turretDefinitionsList";
|
||||||
|
export * from "./vehicleDefinitionArmor";
|
||||||
export * from "./vehicleDefinitionList";
|
export * from "./vehicleDefinitionList";
|
||||||
|
export * from "./vehicleDefinitions";
|
||||||
@@ -0,0 +1,22 @@
|
|||||||
|
export type ShellDefinitionsList = Record<
|
||||||
|
string,
|
||||||
|
{
|
||||||
|
id: number;
|
||||||
|
userString: string;
|
||||||
|
icon: string;
|
||||||
|
kind: ShellKind;
|
||||||
|
caliber: number;
|
||||||
|
damage: { armor: number; devices: number };
|
||||||
|
normalizationAngle?: number;
|
||||||
|
ricochetAngle?: number;
|
||||||
|
explosionRadius?: number;
|
||||||
|
}
|
||||||
|
> & {
|
||||||
|
icons: Record<string, string>;
|
||||||
|
};
|
||||||
|
|
||||||
|
type ShellKind =
|
||||||
|
| "ARMOR_PIERCING"
|
||||||
|
| "ARMOR_PIERCING_CR"
|
||||||
|
| "HIGH_EXPLOSIVE"
|
||||||
|
| "HOLLOW_CHARGE";
|
||||||
@@ -0,0 +1,33 @@
|
|||||||
|
import { Vector3Tuple } from "three";
|
||||||
|
|
||||||
|
export interface TankParameters {
|
||||||
|
resourcesPath: {
|
||||||
|
smallIconPath: string;
|
||||||
|
bigIconPath: string;
|
||||||
|
blitzModelPath: string;
|
||||||
|
};
|
||||||
|
collision: {
|
||||||
|
[key: string]: {
|
||||||
|
points: Vector3Tuple;
|
||||||
|
bbox: {
|
||||||
|
min: Vector3Tuple;
|
||||||
|
max: Vector3Tuple;
|
||||||
|
};
|
||||||
|
averageThickness?: Record<string, number>;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
maskSlice?: {
|
||||||
|
[key: string]:
|
||||||
|
| {
|
||||||
|
enabled: boolean;
|
||||||
|
planePosition: Vector3Tuple;
|
||||||
|
planeNormal: Vector3Tuple;
|
||||||
|
planeAxis: Vector3Tuple;
|
||||||
|
frustumConeBaseRadius: number;
|
||||||
|
frustumConeAngleDegrees: number;
|
||||||
|
planeSliceMode: number;
|
||||||
|
frustumConeSliceMode: number;
|
||||||
|
}
|
||||||
|
| undefined;
|
||||||
|
};
|
||||||
|
}
|
||||||
@@ -0,0 +1,4 @@
|
|||||||
|
export interface TurretDefinitionsList {
|
||||||
|
nextAvailableId: number;
|
||||||
|
ids: Record<string, number>;
|
||||||
|
}
|
||||||
@@ -0,0 +1,4 @@
|
|||||||
|
export type VehicleDefinitionArmor = Record<
|
||||||
|
string,
|
||||||
|
number | { vehicleDamageFactor: 0; "#text": number } | number[]
|
||||||
|
>;
|
||||||
@@ -0,0 +1,152 @@
|
|||||||
|
import { BlitzModuleType } from "@blitzkit/core";
|
||||||
|
|
||||||
|
export interface VehicleDefinitions {
|
||||||
|
invisibility: {
|
||||||
|
moving: number;
|
||||||
|
still: number;
|
||||||
|
firePenalty: number;
|
||||||
|
};
|
||||||
|
crew: Record<BlitzCrewType, string | string[]>;
|
||||||
|
speedLimits: {
|
||||||
|
forward: number;
|
||||||
|
backward: number;
|
||||||
|
};
|
||||||
|
consumableSlots: number;
|
||||||
|
provisionSlots: number;
|
||||||
|
optDevicePreset: string | string[];
|
||||||
|
hull: {
|
||||||
|
armor: VehicleDefinitionArmor;
|
||||||
|
turretPositions: { turret: string };
|
||||||
|
turretInitialRotation?: { yaw: 0; pitch: 6.5; roll: 0 };
|
||||||
|
maxHealth: number;
|
||||||
|
weight: number;
|
||||||
|
};
|
||||||
|
chassis: {
|
||||||
|
[key: string]: {
|
||||||
|
unlocks: UnlocksListing;
|
||||||
|
weight: number;
|
||||||
|
terrainResistance: string;
|
||||||
|
rotationSpeed: number;
|
||||||
|
userString: string;
|
||||||
|
shotDispersionFactors: {
|
||||||
|
vehicleMovement: number;
|
||||||
|
vehicleRotation: number;
|
||||||
|
};
|
||||||
|
level: number;
|
||||||
|
hullPosition: string;
|
||||||
|
armor: {
|
||||||
|
leftTrack:
|
||||||
|
| number
|
||||||
|
| {
|
||||||
|
chanceToHitByProjectile: number;
|
||||||
|
chanceToHitByExplosion: number;
|
||||||
|
"#text": number;
|
||||||
|
};
|
||||||
|
rightTrack:
|
||||||
|
| number
|
||||||
|
| {
|
||||||
|
chanceToHitByProjectile: number;
|
||||||
|
chanceToHitByExplosion: number;
|
||||||
|
"#text": number;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
engines: {
|
||||||
|
[key: string]: {
|
||||||
|
unlocks: UnlocksListing;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
turrets0: {
|
||||||
|
[key: string]: {
|
||||||
|
unlocks: UnlocksListing;
|
||||||
|
rotationSpeed: number;
|
||||||
|
weight: number;
|
||||||
|
circularVisionRadius: number;
|
||||||
|
maxHealth: number;
|
||||||
|
armor: VehicleDefinitionArmor;
|
||||||
|
userString: string;
|
||||||
|
level: number;
|
||||||
|
yawLimits: string | string[];
|
||||||
|
gunPosition: string | string[];
|
||||||
|
models: { undamaged: string };
|
||||||
|
hitTester: {
|
||||||
|
collisionModel: string;
|
||||||
|
};
|
||||||
|
guns: {
|
||||||
|
[key: string]: {
|
||||||
|
unlocks: UnlocksListing;
|
||||||
|
armor: VehicleDefinitionArmor & {
|
||||||
|
gun?:
|
||||||
|
| number
|
||||||
|
| {
|
||||||
|
chanceToHitByProjectile: number;
|
||||||
|
chanceToHitByExplosion: number;
|
||||||
|
"#text": number;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
invisibilityFactorAtShot: number | number[];
|
||||||
|
reloadTime: number;
|
||||||
|
aimingTime?: number;
|
||||||
|
shotDispersionRadius: number;
|
||||||
|
shotDispersionFactors?: {
|
||||||
|
turretRotation: number;
|
||||||
|
afterShot: number;
|
||||||
|
whileGunDamaged: number;
|
||||||
|
};
|
||||||
|
maxAmmo: number;
|
||||||
|
extraPitchLimits?: {
|
||||||
|
front?: string;
|
||||||
|
back?: string;
|
||||||
|
transition?: number | number[];
|
||||||
|
};
|
||||||
|
pitchLimits?: string | string[];
|
||||||
|
pumpGunMode?: boolean;
|
||||||
|
pumpGunReloadTimes?: string;
|
||||||
|
clip?: { count: number; rate: number };
|
||||||
|
burst?: { count: number; rate: number };
|
||||||
|
models: { undamaged: string };
|
||||||
|
extras?: {
|
||||||
|
trayShell?: {
|
||||||
|
kinds: string;
|
||||||
|
sectors: Record<
|
||||||
|
string,
|
||||||
|
{ id: number; distance: number; factor: number }[]
|
||||||
|
>;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
extras?: {
|
||||||
|
armorsStatesController?: {
|
||||||
|
state: [
|
||||||
|
{
|
||||||
|
id: 0;
|
||||||
|
armors: string;
|
||||||
|
type: "default";
|
||||||
|
enabled: true;
|
||||||
|
factorsModifiers: "";
|
||||||
|
default: "";
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: 1;
|
||||||
|
armors: string;
|
||||||
|
type: "default";
|
||||||
|
enabled: false;
|
||||||
|
factorsModifiers: "";
|
||||||
|
},
|
||||||
|
];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
export type BlitzCrewType =
|
||||||
|
| "commander"
|
||||||
|
| "radioman"
|
||||||
|
| "gunner"
|
||||||
|
| "driver"
|
||||||
|
| "loader";
|
||||||
|
|
||||||
|
export type UnlocksListing = BlitzModuleType | undefined;
|
||||||
File diff suppressed because it is too large.
Load diff
@@ -1,43 +1,10 @@
|
|||||||
import { NATION_IDS } from "@blitzkit/core";
|
import { NATION_IDS } from "@blitzkit/core";
|
||||||
import sharp from "sharp";
|
import sharp from "sharp";
|
||||||
import type { Vector3Tuple } from "three";
|
|
||||||
import { parsePackedSpriteRect } from "../core/blitz/parsePackedSpriteRect";
|
import { parsePackedSpriteRect } from "../core/blitz/parsePackedSpriteRect";
|
||||||
import { AssetUploader } from "../core/github/assetUploader";
|
import { AssetUploader } from "../core/github/assetUploader";
|
||||||
import { vfs } from "./constants";
|
import { vfs } from "./constants";
|
||||||
import type { VehicleDefinitionList } from "./definitions";
|
import type { VehicleDefinitionList } from "./definitions";
|
||||||
|
|
||||||
export interface TankParameters {
|
|
||||||
resourcesPath: {
|
|
||||||
smallIconPath: string;
|
|
||||||
bigIconPath: string;
|
|
||||||
blitzModelPath: string;
|
|
||||||
};
|
|
||||||
collision: {
|
|
||||||
[key: string]: {
|
|
||||||
points: Vector3Tuple;
|
|
||||||
bbox: {
|
|
||||||
min: Vector3Tuple;
|
|
||||||
max: Vector3Tuple;
|
|
||||||
};
|
|
||||||
averageThickness?: Record<string, number>;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
maskSlice?: {
|
|
||||||
[key: string]:
|
|
||||||
| {
|
|
||||||
enabled: boolean;
|
|
||||||
planePosition: Vector3Tuple;
|
|
||||||
planeNormal: Vector3Tuple;
|
|
||||||
planeAxis: Vector3Tuple;
|
|
||||||
frustumConeBaseRadius: number;
|
|
||||||
frustumConeAngleDegrees: number;
|
|
||||||
planeSliceMode: number;
|
|
||||||
frustumConeSliceMode: number;
|
|
||||||
}
|
|
||||||
| undefined;
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
async function extractPackedTankIcon(packedBuffer: Buffer, context: string) {
|
async function extractPackedTankIcon(packedBuffer: Buffer, context: string) {
|
||||||
const texture = sharp(packedBuffer);
|
const texture = sharp(packedBuffer);
|
||||||
const spriteRect = parsePackedSpriteRect(packedBuffer);
|
const spriteRect = parsePackedSpriteRect(packedBuffer);
|
||||||
|
|||||||
Reference in new issue
Block a user