mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-10-23 19:49:50 +02:00
feat: map definitions
This commit is contained in:
1 parent
25788dedf4
commit
2a2a7a067c
2 files changed
+53
-1
No files matched your search
@@ -18,6 +18,7 @@ import {
|
|||||||
EquipmentRow,
|
EquipmentRow,
|
||||||
} from '../../src/core/blitzkit/equipmentDefinitions';
|
} from '../../src/core/blitzkit/equipmentDefinitions';
|
||||||
import { GameDefinitions } from '../../src/core/blitzkit/gameDefinitions';
|
import { GameDefinitions } from '../../src/core/blitzkit/gameDefinitions';
|
||||||
|
import { MapDefinitions } from '../../src/core/blitzkit/mapDefinitions';
|
||||||
import {
|
import {
|
||||||
ModelArmor,
|
ModelArmor,
|
||||||
ModelDefinitions,
|
ModelDefinitions,
|
||||||
@@ -325,6 +326,31 @@ type ConsumablesVehicleFilter =
|
|||||||
| { name: string }
|
| { name: string }
|
||||||
| { extendedTags: string };
|
| { extendedTags: string };
|
||||||
|
|
||||||
|
export interface Maps {
|
||||||
|
maps: {
|
||||||
|
[key: string]: {
|
||||||
|
id: number;
|
||||||
|
tags?: string;
|
||||||
|
localName: string;
|
||||||
|
avaliableInTrainingRoom: boolean; // lol wg typo
|
||||||
|
spriteFrame: number;
|
||||||
|
supremacyPointsThreshold?: number;
|
||||||
|
availableModes: number[];
|
||||||
|
shadowMapsAvailable?: boolean;
|
||||||
|
assaultRespawnPoints: {
|
||||||
|
allies: MapAlly[];
|
||||||
|
enemies: MapAlly[];
|
||||||
|
};
|
||||||
|
levels?: number[];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface MapAlly {
|
||||||
|
respawnNumber: number;
|
||||||
|
points: Array<number[]>;
|
||||||
|
}
|
||||||
|
|
||||||
const blitzShellKindToBlitzkit: Record<ShellKind, ShellType> = {
|
const blitzShellKindToBlitzkit: Record<ShellKind, ShellType> = {
|
||||||
ARMOR_PIERCING: 'ap',
|
ARMOR_PIERCING: 'ap',
|
||||||
ARMOR_PIERCING_CR: 'ap_cr',
|
ARMOR_PIERCING_CR: 'ap_cr',
|
||||||
@@ -348,6 +374,7 @@ export async function definitions(production: boolean) {
|
|||||||
};
|
};
|
||||||
const tankDefinitions: TankDefinitions = {};
|
const tankDefinitions: TankDefinitions = {};
|
||||||
const modelDefinitions: ModelDefinitions = {};
|
const modelDefinitions: ModelDefinitions = {};
|
||||||
|
const mapDefinitions: MapDefinitions = {};
|
||||||
const equipmentDefinitions: EquipmentDefinitions = {
|
const equipmentDefinitions: EquipmentDefinitions = {
|
||||||
presets: {},
|
presets: {},
|
||||||
equipments: {},
|
equipments: {},
|
||||||
@@ -386,7 +413,7 @@ export async function definitions(production: boolean) {
|
|||||||
const avatar = await readXMLDVPL<{ root: Avatar }>(
|
const avatar = await readXMLDVPL<{ root: Avatar }>(
|
||||||
`${DATA}/XML/item_defs/tankmen/avatar.xml.dvpl`,
|
`${DATA}/XML/item_defs/tankmen/avatar.xml.dvpl`,
|
||||||
);
|
);
|
||||||
|
const maps = await readYAMLDVPL<Maps>(`${DATA}/maps.yaml.dvpl`);
|
||||||
const tankXps = new Map<number, number>();
|
const tankXps = new Map<number, number>();
|
||||||
|
|
||||||
await Promise.all(
|
await Promise.all(
|
||||||
@@ -1122,6 +1149,13 @@ export async function definitions(production: boolean) {
|
|||||||
skillDefinitions.classes[tankClass as TankClass] = skills.split(' ');
|
skillDefinitions.classes[tankClass as TankClass] = skills.split(' ');
|
||||||
});
|
});
|
||||||
|
|
||||||
|
Object.entries(maps.maps).forEach(([key, map]) => {
|
||||||
|
mapDefinitions[map.id] = {
|
||||||
|
id: map.id,
|
||||||
|
name: strings[`#maps:${key}:${map.localName}`],
|
||||||
|
};
|
||||||
|
});
|
||||||
|
|
||||||
await commitAssets(
|
await commitAssets(
|
||||||
'definitions',
|
'definitions',
|
||||||
[
|
[
|
||||||
@@ -1160,6 +1194,11 @@ export async function definitions(production: boolean) {
|
|||||||
encoding: 'base64',
|
encoding: 'base64',
|
||||||
path: 'definitions/skills.cdon.lz4',
|
path: 'definitions/skills.cdon.lz4',
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
content: superCompress(mapDefinitions),
|
||||||
|
encoding: 'base64',
|
||||||
|
path: 'definitions/maps.cdon.lz4',
|
||||||
|
},
|
||||||
],
|
],
|
||||||
production,
|
production,
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -0,0 +1,13 @@
|
|||||||
|
import { asset } from './asset';
|
||||||
|
import { fetchCdonLz4 } from './fetchCdonLz4';
|
||||||
|
|
||||||
|
export interface MapDefinitions {
|
||||||
|
[id: number]: {
|
||||||
|
id: number;
|
||||||
|
name: string;
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
export const mapDefinitions = fetchCdonLz4<MapDefinitions>(
|
||||||
|
asset('definitions/maps.cdon.lz4'),
|
||||||
|
);
|
||||||
Reference in new issue
Block a user