mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-10-23 19:49:50 +02:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ba17aae706 | ||
|
|
30ca5c053a | ||
|
|
c36419f5b6 | ||
|
|
1879895db2 | ||
|
|
c964e3c8ec | ||
|
|
2ef6d18f82 | ||
|
|
10b672572b | ||
|
|
2a4efa8cd2 | ||
|
|
5a8435da29 | ||
|
|
3461349a96 | ||
|
|
3791e9df12 | ||
|
|
b3c36aac93 | ||
|
|
c0895409bc | ||
|
|
438b565cbb | ||
|
|
cf1a82e89b | ||
|
|
0506e361b2 | ||
|
|
d6a1357a82 | ||
|
|
a5a1dbd51b | ||
|
|
5201350e44 | ||
|
|
6a84b9d5ae |
No files matched your search
@@ -27,3 +27,4 @@ target
|
|||||||
/.vercel
|
/.vercel
|
||||||
/.astro
|
/.astro
|
||||||
.vercel
|
.vercel
|
||||||
|
/src
|
||||||
@@ -0,0 +1,7 @@
|
|||||||
|
# BlitzKit 1.27.2
|
||||||
|
|
||||||
|
This update only affects the website.
|
||||||
|
|
||||||
|
## Fixes
|
||||||
|
|
||||||
|
- The new Improved Vertical Stabilizer equipment which only affects the gun depression found on the Type 63 now works
|
||||||
@@ -0,0 +1,9 @@
|
|||||||
|
# BlitzKit 1.27.3
|
||||||
|
|
||||||
|
This update only affects the bot.
|
||||||
|
|
||||||
|
## Fixes
|
||||||
|
|
||||||
|
- Added support for 64-bit IDs allowing users with new accounts to link with BlitzKit
|
||||||
|
- This comes at the added cost of resetting the links of all other accounts
|
||||||
|
- Just re-link and you're good to go
|
||||||
+1
-1
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "blitzkit",
|
"name": "blitzkit",
|
||||||
"private": true,
|
"private": true,
|
||||||
"version": "1.27.1",
|
"version": "1.27.3",
|
||||||
"description": "🎉 Tools for everything World of Tanks Blitz",
|
"description": "🎉 Tools for everything World of Tanks Blitz",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"types": "./types.d.ts",
|
"types": "./types.d.ts",
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ export const debugCommand = new Promise<CommandRegistry>((resolve) => {
|
|||||||
const list = [
|
const list = [
|
||||||
[strings.bot.commands.debug.body.version, packageJSON.version],
|
[strings.bot.commands.debug.body.version, packageJSON.version],
|
||||||
[
|
[
|
||||||
strings.bot.commands.debug.body.shard,
|
strings.bot.commands.debug.body.shard.label,
|
||||||
client.shard?.ids[0] ?? strings.bot.commands.debug.body.shard.default,
|
client.shard?.ids[0] ?? strings.bot.commands.debug.body.shard.default,
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
|
|||||||
@@ -8,12 +8,12 @@ export async function filtersToDescription(
|
|||||||
{ nation, tier, type, class: tankClass, tank }: StatFilters,
|
{ nation, tier, type, class: tankClass, tank }: StatFilters,
|
||||||
locale: Locale,
|
locale: Locale,
|
||||||
) {
|
) {
|
||||||
const { strings } = translator(locale);
|
const { strings, bkLocale } = translator(locale);
|
||||||
const awaitedTankDefinitions = await fetchTankDefinitions();
|
const awaitedTankDefinitions = await fetchTankDefinitions();
|
||||||
const info: string[] = [];
|
const info: string[] = [];
|
||||||
|
|
||||||
// TODO: somehow localize tank names?
|
// TODO: somehow localize tank names?
|
||||||
if (tank) return awaitedTankDefinitions.tanks[tank].name;
|
if (tank) return awaitedTankDefinitions.tanks[tank].name.locales[bkLocale];
|
||||||
if (nation)
|
if (nation)
|
||||||
info.push((strings.common.nations as Record<string, string>)[nation]);
|
info.push((strings.common.nations as Record<string, string>)[nation]);
|
||||||
if (tier) {
|
if (tier) {
|
||||||
|
|||||||
@@ -8,6 +8,8 @@ export async function getBlitzFromDiscord(discordId: bigint) {
|
|||||||
|
|
||||||
if (unique === null) return null;
|
if (unique === null) return null;
|
||||||
|
|
||||||
await flagUserActivity(unique.blitz_id);
|
const id = Number(unique.blitz_id);
|
||||||
return { id: unique.blitz_id, region: idToRegion(unique.blitz_id) };
|
|
||||||
|
await flagUserActivity(id);
|
||||||
|
return { id, region: idToRegion(id) };
|
||||||
}
|
}
|
||||||
@@ -3,7 +3,8 @@ import { Locale } from 'discord.js';
|
|||||||
import { SUPPORTED_LOCALES_DISCORD } from '../localization/strings/constants';
|
import { SUPPORTED_LOCALES_DISCORD } from '../localization/strings/constants';
|
||||||
import { translator } from '../localization/translator';
|
import { translator } from '../localization/translator';
|
||||||
|
|
||||||
const validNameRegex = /^[-_\p{L}\p{N}\p{sc=Deva}\p{sc=Thai}]{1,32}$/u;
|
const validNameRegex =
|
||||||
|
/^[\p{Ll}\p{Lm}\p{Lo}\p{N}\p{sc=Devanagari}\p{sc=Thai}_-]+$/u;
|
||||||
|
|
||||||
export function localizationObject(
|
export function localizationObject(
|
||||||
path: (strings: BlitzKitStrings) => string,
|
path: (strings: BlitzKitStrings) => string,
|
||||||
|
|||||||
@@ -12,8 +12,9 @@ export function translator(localeRaw: Locale) {
|
|||||||
SUPPORTED_LOCALES_DISCORD.includes(localeRaw)
|
SUPPORTED_LOCALES_DISCORD.includes(localeRaw)
|
||||||
? localeRaw
|
? localeRaw
|
||||||
: DEFAULT_LOCALE_DISCORD;
|
: DEFAULT_LOCALE_DISCORD;
|
||||||
const strings = STRINGS[SUPPORTED_LOCALES_DISCORD_MAP_INVERSE[locale]];
|
const bkLocale = SUPPORTED_LOCALES_DISCORD_MAP_INVERSE[locale];
|
||||||
const unwrap = unwrapper(SUPPORTED_LOCALES_DISCORD_MAP_INVERSE[locale]);
|
const strings = STRINGS[bkLocale];
|
||||||
|
const unwrap = unwrapper(bkLocale);
|
||||||
|
|
||||||
return { locale, strings, unwrap };
|
return { locale, strings, unwrap, bkLocale };
|
||||||
}
|
}
|
||||||
@@ -26,8 +26,10 @@ export async function fetchTankNames() {
|
|||||||
searchableName: tank.name_full ?? tank.name,
|
searchableName: tank.name_full ?? tank.name,
|
||||||
searchableNameDeburr,
|
searchableNameDeburr,
|
||||||
camouflages: tank.camouflages
|
camouflages: tank.camouflages
|
||||||
?.map((id) => camouflageDefinitions.camouflages[id]?.name)
|
?.map((id) => SUPPORTED_LOCALES.map((locale) => camouflageDefinitions.camouflages[id]?.name.locales[locale]))
|
||||||
|
.flat()
|
||||||
.filter(Boolean)
|
.filter(Boolean)
|
||||||
|
.map(deburr)
|
||||||
.join(' '),
|
.join(' '),
|
||||||
treeType: tank.type,
|
treeType: tank.type,
|
||||||
};
|
};
|
||||||
|
|||||||
+335
-1037
File diff suppressed because it is too large.
Load diff
+1164
-514
File diff suppressed because it is too large.
Load diff
+1164
-514
File diff suppressed because it is too large.
Load diff
+1090
-498
File diff suppressed because it is too large.
Load diff
+999
-601
File diff suppressed because it is too large.
Load diff
+224
-1242
File diff suppressed because it is too large.
Load diff
+1164
-514
File diff suppressed because it is too large.
Load diff
+1063
-683
File diff suppressed because it is too large.
Load diff
@@ -1,5 +1,4 @@
|
|||||||
import { assertSecret } from '@blitzkit/core';
|
import { assertSecret } from '@blitzkit/core';
|
||||||
import { existsSync } from 'fs';
|
|
||||||
import { mkdir, writeFile } from 'fs/promises';
|
import { mkdir, writeFile } from 'fs/promises';
|
||||||
import { parse as parsePath } from 'path';
|
import { parse as parsePath } from 'path';
|
||||||
import ProgressBar from 'progress';
|
import ProgressBar from 'progress';
|
||||||
@@ -57,9 +56,12 @@ while (true) {
|
|||||||
console.warn(`Failed to make directory "${dir}"`);
|
console.warn(`Failed to make directory "${dir}"`);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const isDvpl = path.endsWith('.dvpl');
|
||||||
|
const buffer = Buffer.from(data);
|
||||||
|
|
||||||
await writeFile(
|
await writeFile(
|
||||||
`${DATA}/${path}`,
|
`${DATA}/${path}${isDvpl ? '' : '.dvpl'}`,
|
||||||
new Uint8Array(writeDVPL(Buffer.from(data))),
|
new Uint8Array(isDvpl ? buffer : writeDVPL(buffer)),
|
||||||
);
|
);
|
||||||
|
|
||||||
bar.tick();
|
bar.tick();
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ import { TextureMutation } from './constants';
|
|||||||
|
|
||||||
export async function readTexture(path: string, mutation?: TextureMutation) {
|
export async function readTexture(path: string, mutation?: TextureMutation) {
|
||||||
const ddsTexturePath = path.replace('.tex', '.dx11.dds');
|
const ddsTexturePath = path.replace('.tex', '.dx11.dds');
|
||||||
const isDds = existsSync(ddsTexturePath);
|
const isDds = existsSync(`${ddsTexturePath}.dvpl`);
|
||||||
const resolvedTexturePath = isDds
|
const resolvedTexturePath = isDds
|
||||||
? ddsTexturePath
|
? ddsTexturePath
|
||||||
: ddsTexturePath.replace('.dds', '.pvr');
|
: ddsTexturePath.replace('.dds', '.pvr');
|
||||||
|
|||||||
@@ -30,10 +30,7 @@ export async function commitMultipleFiles(
|
|||||||
} else if (response.status === 200) {
|
} else if (response.status === 200) {
|
||||||
const buffer = Buffer.from(await response.arrayBuffer());
|
const buffer = Buffer.from(await response.arrayBuffer());
|
||||||
|
|
||||||
// we discard blob if they're the same size; it's unlikely their
|
if (!buffer.equals(change.content)) {
|
||||||
// contents will be different; I love playing russian roulette!
|
|
||||||
const equal = buffer.length === change.content.length || buffer.equals(change.content);
|
|
||||||
if (!equal) {
|
|
||||||
const diff = change.content.length - buffer.length;
|
const diff = change.content.length - buffer.length;
|
||||||
|
|
||||||
console.log(
|
console.log(
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ import { writeFile } from 'fs/promises';
|
|||||||
const ROOT = '@blitzkit/i18n/strings';
|
const ROOT = '@blitzkit/i18n/strings';
|
||||||
const WORKING_ROOT = '../../packages/i18n/strings';
|
const WORKING_ROOT = '../../packages/i18n/strings';
|
||||||
|
|
||||||
const defaultStrings = await import(`${ROOT}/${DEFAULT_LOCALE}.json`);
|
const defaultStrings = require(`${ROOT}/${DEFAULT_LOCALE}.json`).default;
|
||||||
const nonDefaultLocales = SUPPORTED_LOCALES.filter(
|
const nonDefaultLocales = SUPPORTED_LOCALES.filter(
|
||||||
(locale) => locale !== DEFAULT_LOCALE,
|
(locale) => locale !== DEFAULT_LOCALE,
|
||||||
);
|
);
|
||||||
@@ -19,9 +19,13 @@ function prune(defaultStrings: TranslationTree, strings: TranslationTree) {
|
|||||||
if (typeof defaultStrings[key] === typeof strings[key]) {
|
if (typeof defaultStrings[key] === typeof strings[key]) {
|
||||||
if (typeof strings[key] === 'string') {
|
if (typeof strings[key] === 'string') {
|
||||||
if (
|
if (
|
||||||
|
// are equivalent regardless of %s flavor
|
||||||
(defaultStrings[key] as string).replaceAll(/%s\d/g, '%s') ===
|
(defaultStrings[key] as string).replaceAll(/%s\d/g, '%s') ===
|
||||||
(strings[key] as string).replaceAll(/%s\d/g, '%s') ||
|
(strings[key] as string).replaceAll(/%s\d/g, '%s') ||
|
||||||
strings[key] === ''
|
// string is empty
|
||||||
|
strings[key] === '' ||
|
||||||
|
// string has old flavor of %s
|
||||||
|
strings[key].match(/%s([^\d]|$)/g) !== null
|
||||||
) {
|
) {
|
||||||
delete strings[key];
|
delete strings[key];
|
||||||
}
|
}
|
||||||
@@ -42,7 +46,7 @@ function prune(defaultStrings: TranslationTree, strings: TranslationTree) {
|
|||||||
for (const locale of nonDefaultLocales) {
|
for (const locale of nonDefaultLocales) {
|
||||||
console.log(`Pruning ${locale}...`);
|
console.log(`Pruning ${locale}...`);
|
||||||
|
|
||||||
const strings = await import(`${ROOT}/${locale}.json`);
|
const strings = require(`${ROOT}/${locale}.json`).default;
|
||||||
const pruned = prune(defaultStrings, strings);
|
const pruned = prune(defaultStrings, strings);
|
||||||
|
|
||||||
writeFile(`${WORKING_ROOT}/${locale}.json`, JSON.stringify(pruned, null, 2));
|
writeFile(`${WORKING_ROOT}/${locale}.json`, JSON.stringify(pruned, null, 2));
|
||||||
|
|||||||
@@ -180,6 +180,11 @@ export const StaticArmor = memo<ArmorSceneProps>(({ thicknessRange }) => {
|
|||||||
duel.protagonist.tank.equipment_preset,
|
duel.protagonist.tank.equipment_preset,
|
||||||
duel.protagonist.equipmentMatrix,
|
duel.protagonist.equipmentMatrix,
|
||||||
);
|
);
|
||||||
|
const hasDownImprovedVerticalStabilizer = await hasEquipment(
|
||||||
|
124,
|
||||||
|
duel.protagonist.tank.equipment_preset,
|
||||||
|
duel.protagonist.equipmentMatrix,
|
||||||
|
);
|
||||||
const boundingRect = canvas.getBoundingClientRect();
|
const boundingRect = canvas.getBoundingClientRect();
|
||||||
|
|
||||||
delta.set(event.clientX, event.clientY).sub(position);
|
delta.set(event.clientX, event.clientY).sub(position);
|
||||||
@@ -191,6 +196,7 @@ export const StaticArmor = memo<ArmorSceneProps>(({ thicknessRange }) => {
|
|||||||
gunModelDefinition.pitch,
|
gunModelDefinition.pitch,
|
||||||
turretModelDefinition.yaw,
|
turretModelDefinition.yaw,
|
||||||
hasImprovedVerticalStabilizer,
|
hasImprovedVerticalStabilizer,
|
||||||
|
hasDownImprovedVerticalStabilizer,
|
||||||
);
|
);
|
||||||
modelTransformEvent.emit({ pitch, yaw });
|
modelTransformEvent.emit({ pitch, yaw });
|
||||||
}
|
}
|
||||||
@@ -275,6 +281,11 @@ export const StaticArmor = memo<ArmorSceneProps>(({ thicknessRange }) => {
|
|||||||
duel.protagonist.tank.equipment_preset,
|
duel.protagonist.tank.equipment_preset,
|
||||||
duel.protagonist.equipmentMatrix,
|
duel.protagonist.equipmentMatrix,
|
||||||
);
|
);
|
||||||
|
const hasDownImprovedVerticalStabilizer = await hasEquipment(
|
||||||
|
124,
|
||||||
|
duel.protagonist.tank.equipment_preset,
|
||||||
|
duel.protagonist.equipmentMatrix,
|
||||||
|
);
|
||||||
const boundingRect = canvas.getBoundingClientRect();
|
const boundingRect = canvas.getBoundingClientRect();
|
||||||
delta.set(event.clientX, event.clientY).sub(position);
|
delta.set(event.clientX, event.clientY).sub(position);
|
||||||
position.set(event.clientX, event.clientY);
|
position.set(event.clientX, event.clientY);
|
||||||
@@ -285,6 +296,7 @@ export const StaticArmor = memo<ArmorSceneProps>(({ thicknessRange }) => {
|
|||||||
gunModelDefinition.pitch,
|
gunModelDefinition.pitch,
|
||||||
turretModelDefinition.yaw,
|
turretModelDefinition.yaw,
|
||||||
hasImprovedVerticalStabilizer,
|
hasImprovedVerticalStabilizer,
|
||||||
|
hasDownImprovedVerticalStabilizer,
|
||||||
);
|
);
|
||||||
modelTransformEvent.emit({ pitch, yaw });
|
modelTransformEvent.emit({ pitch, yaw });
|
||||||
}
|
}
|
||||||
@@ -357,6 +369,11 @@ export const StaticArmor = memo<ArmorSceneProps>(({ thicknessRange }) => {
|
|||||||
duel.protagonist.tank.equipment_preset,
|
duel.protagonist.tank.equipment_preset,
|
||||||
duel.protagonist.equipmentMatrix,
|
duel.protagonist.equipmentMatrix,
|
||||||
);
|
);
|
||||||
|
const hasDownImprovedVerticalStabilizer = await hasEquipment(
|
||||||
|
124,
|
||||||
|
duel.protagonist.tank.equipment_preset,
|
||||||
|
duel.protagonist.equipmentMatrix,
|
||||||
|
);
|
||||||
const boundingRect = canvas.getBoundingClientRect();
|
const boundingRect = canvas.getBoundingClientRect();
|
||||||
delta.set(event.clientX, event.clientY).sub(position);
|
delta.set(event.clientX, event.clientY).sub(position);
|
||||||
position.set(event.clientX, event.clientY);
|
position.set(event.clientX, event.clientY);
|
||||||
@@ -367,6 +384,7 @@ export const StaticArmor = memo<ArmorSceneProps>(({ thicknessRange }) => {
|
|||||||
gunModelDefinition.pitch,
|
gunModelDefinition.pitch,
|
||||||
turretModelDefinition.yaw,
|
turretModelDefinition.yaw,
|
||||||
hasImprovedVerticalStabilizer,
|
hasImprovedVerticalStabilizer,
|
||||||
|
hasDownImprovedVerticalStabilizer,
|
||||||
);
|
);
|
||||||
modelTransformEvent.emit({ pitch, yaw });
|
modelTransformEvent.emit({ pitch, yaw });
|
||||||
}
|
}
|
||||||
|
|||||||
+3
-1
@@ -107,6 +107,7 @@ export function Characteristics() {
|
|||||||
const hasSupercharger = useEquipment(107);
|
const hasSupercharger = useEquipment(107);
|
||||||
const hasCalibratedShells = useEquipment(103);
|
const hasCalibratedShells = useEquipment(103);
|
||||||
const hasImprovedVerticalStabilizer = useEquipment(122);
|
const hasImprovedVerticalStabilizer = useEquipment(122);
|
||||||
|
const hasDownImprovedVerticalStabilizer = useEquipment(124);
|
||||||
const penetrationCoefficient = coefficient([
|
const penetrationCoefficient = coefficient([
|
||||||
hasCalibratedShells,
|
hasCalibratedShells,
|
||||||
resolvePenetrationCoefficient(true, shell.type) - 1,
|
resolvePenetrationCoefficient(true, shell.type) - 1,
|
||||||
@@ -129,9 +130,10 @@ export function Characteristics() {
|
|||||||
gunModelDefinition.pitch,
|
gunModelDefinition.pitch,
|
||||||
turretModelDefinition.yaw,
|
turretModelDefinition.yaw,
|
||||||
hasImprovedVerticalStabilizer,
|
hasImprovedVerticalStabilizer,
|
||||||
|
hasDownImprovedVerticalStabilizer,
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
}, [hasImprovedVerticalStabilizer]);
|
}, [hasImprovedVerticalStabilizer, hasDownImprovedVerticalStabilizer]);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Flex
|
<Flex
|
||||||
|
|||||||
+3
@@ -25,6 +25,7 @@ export function QuickInputs() {
|
|||||||
const initialGunPitch =
|
const initialGunPitch =
|
||||||
tankModelDefinition.initial_turret_rotation?.pitch ?? 0;
|
tankModelDefinition.initial_turret_rotation?.pitch ?? 0;
|
||||||
const hasImprovedVerticalStabilizer = useEquipment(122);
|
const hasImprovedVerticalStabilizer = useEquipment(122);
|
||||||
|
const hasDownImprovedVerticalStabilizer = useEquipment(124);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (!yawInput.current) return;
|
if (!yawInput.current) return;
|
||||||
@@ -92,6 +93,7 @@ export function QuickInputs() {
|
|||||||
gunModelDefinition.pitch,
|
gunModelDefinition.pitch,
|
||||||
turretModelDefinition.yaw,
|
turretModelDefinition.yaw,
|
||||||
hasImprovedVerticalStabilizer,
|
hasImprovedVerticalStabilizer,
|
||||||
|
hasDownImprovedVerticalStabilizer,
|
||||||
);
|
);
|
||||||
modelTransformEvent.emit({ pitch, yaw });
|
modelTransformEvent.emit({ pitch, yaw });
|
||||||
mutateDuel((state) => {
|
mutateDuel((state) => {
|
||||||
@@ -133,6 +135,7 @@ export function QuickInputs() {
|
|||||||
gunModelDefinition.pitch,
|
gunModelDefinition.pitch,
|
||||||
turretModelDefinition.yaw,
|
turretModelDefinition.yaw,
|
||||||
hasImprovedVerticalStabilizer,
|
hasImprovedVerticalStabilizer,
|
||||||
|
hasDownImprovedVerticalStabilizer,
|
||||||
);
|
);
|
||||||
modelTransformEvent.emit({ pitch, yaw });
|
modelTransformEvent.emit({ pitch, yaw });
|
||||||
mutateDuel((state) => {
|
mutateDuel((state) => {
|
||||||
|
|||||||
+7
@@ -118,6 +118,11 @@ export function Controls({ naked }: ControlsProps) {
|
|||||||
duel.protagonist.tank.equipment_preset,
|
duel.protagonist.tank.equipment_preset,
|
||||||
duel.protagonist.equipmentMatrix,
|
duel.protagonist.equipmentMatrix,
|
||||||
);
|
);
|
||||||
|
const hasDownImprovedVerticalStabilizer = await hasEquipment(
|
||||||
|
124,
|
||||||
|
duel.protagonist.tank.equipment_preset,
|
||||||
|
duel.protagonist.equipmentMatrix,
|
||||||
|
);
|
||||||
|
|
||||||
switch (event) {
|
switch (event) {
|
||||||
case Pose.HullDown: {
|
case Pose.HullDown: {
|
||||||
@@ -127,6 +132,7 @@ export function Controls({ naked }: ControlsProps) {
|
|||||||
protagonistGunModelDefinition.pitch,
|
protagonistGunModelDefinition.pitch,
|
||||||
protagonistTurretModelDefinition.yaw,
|
protagonistTurretModelDefinition.yaw,
|
||||||
hasImprovedVerticalStabilizer,
|
hasImprovedVerticalStabilizer,
|
||||||
|
hasDownImprovedVerticalStabilizer,
|
||||||
);
|
);
|
||||||
|
|
||||||
camera.position
|
camera.position
|
||||||
@@ -159,6 +165,7 @@ export function Controls({ naked }: ControlsProps) {
|
|||||||
protagonistGunModelDefinition.pitch,
|
protagonistGunModelDefinition.pitch,
|
||||||
protagonistTurretModelDefinition.yaw,
|
protagonistTurretModelDefinition.yaw,
|
||||||
hasImprovedVerticalStabilizer,
|
hasImprovedVerticalStabilizer,
|
||||||
|
hasDownImprovedVerticalStabilizer,
|
||||||
);
|
);
|
||||||
|
|
||||||
camera.position
|
camera.position
|
||||||
|
|||||||
+12
@@ -185,6 +185,11 @@ export function TankModel() {
|
|||||||
duel.protagonist.tank.equipment_preset,
|
duel.protagonist.tank.equipment_preset,
|
||||||
duel.protagonist.equipmentMatrix,
|
duel.protagonist.equipmentMatrix,
|
||||||
);
|
);
|
||||||
|
const hasDownImprovedVerticalStabilizer = await hasEquipment(
|
||||||
|
124,
|
||||||
|
duel.protagonist.tank.equipment_preset,
|
||||||
|
duel.protagonist.equipmentMatrix,
|
||||||
|
);
|
||||||
const boundingRect = canvas.getBoundingClientRect();
|
const boundingRect = canvas.getBoundingClientRect();
|
||||||
|
|
||||||
delta.set(event.clientX, event.clientY).sub(position);
|
delta.set(event.clientX, event.clientY).sub(position);
|
||||||
@@ -196,6 +201,7 @@ export function TankModel() {
|
|||||||
gunModelDefinition.pitch,
|
gunModelDefinition.pitch,
|
||||||
turretModelDefinition.yaw,
|
turretModelDefinition.yaw,
|
||||||
hasImprovedVerticalStabilizer,
|
hasImprovedVerticalStabilizer,
|
||||||
|
hasDownImprovedVerticalStabilizer,
|
||||||
);
|
);
|
||||||
modelTransformEvent.emit({ pitch, yaw });
|
modelTransformEvent.emit({ pitch, yaw });
|
||||||
}
|
}
|
||||||
@@ -287,6 +293,11 @@ export function TankModel() {
|
|||||||
duel.protagonist.tank.equipment_preset,
|
duel.protagonist.tank.equipment_preset,
|
||||||
duel.protagonist.equipmentMatrix,
|
duel.protagonist.equipmentMatrix,
|
||||||
);
|
);
|
||||||
|
const hasDownImprovedVerticalStabilizer = await hasEquipment(
|
||||||
|
124,
|
||||||
|
duel.protagonist.tank.equipment_preset,
|
||||||
|
duel.protagonist.equipmentMatrix,
|
||||||
|
);
|
||||||
const boundingRect = canvas.getBoundingClientRect();
|
const boundingRect = canvas.getBoundingClientRect();
|
||||||
delta.set(event.clientX, event.clientY).sub(position);
|
delta.set(event.clientX, event.clientY).sub(position);
|
||||||
position.set(event.clientX, event.clientY);
|
position.set(event.clientX, event.clientY);
|
||||||
@@ -297,6 +308,7 @@ export function TankModel() {
|
|||||||
gunModelDefinition.pitch,
|
gunModelDefinition.pitch,
|
||||||
turretModelDefinition.yaw,
|
turretModelDefinition.yaw,
|
||||||
hasImprovedVerticalStabilizer,
|
hasImprovedVerticalStabilizer,
|
||||||
|
hasDownImprovedVerticalStabilizer,
|
||||||
);
|
);
|
||||||
modelTransformEvent.emit({ pitch, yaw });
|
modelTransformEvent.emit({ pitch, yaw });
|
||||||
}
|
}
|
||||||
|
|||||||
+2
@@ -41,6 +41,7 @@ export const TankSandbox = forwardRef<HTMLCanvasElement, TankSandboxProps>(
|
|||||||
const mutateTankopediaEphemeral = TankopediaEphemeral.useMutation();
|
const mutateTankopediaEphemeral = TankopediaEphemeral.useMutation();
|
||||||
const canvas = useRef<HTMLCanvasElement>(null);
|
const canvas = useRef<HTMLCanvasElement>(null);
|
||||||
const hasImprovedVerticalStabilizer = useEquipment(122);
|
const hasImprovedVerticalStabilizer = useEquipment(122);
|
||||||
|
const hasDownImprovedVerticalStabilizer = useEquipment(124);
|
||||||
const protagonistGun = Duel.use((state) => state.protagonist.gun);
|
const protagonistGun = Duel.use((state) => state.protagonist.gun);
|
||||||
const protagonistTurret = Duel.use((state) => state.protagonist.turret);
|
const protagonistTurret = Duel.use((state) => state.protagonist.turret);
|
||||||
const mutateDuel = Duel.useMutation();
|
const mutateDuel = Duel.useMutation();
|
||||||
@@ -82,6 +83,7 @@ export const TankSandbox = forwardRef<HTMLCanvasElement, TankSandboxProps>(
|
|||||||
gunModelDefinition.pitch,
|
gunModelDefinition.pitch,
|
||||||
turretModelDefinition.yaw,
|
turretModelDefinition.yaw,
|
||||||
hasImprovedVerticalStabilizer,
|
hasImprovedVerticalStabilizer,
|
||||||
|
hasDownImprovedVerticalStabilizer,
|
||||||
);
|
);
|
||||||
|
|
||||||
modelTransformEvent.emit({ pitch, yaw });
|
modelTransformEvent.emit({ pitch, yaw });
|
||||||
|
|||||||
@@ -12,6 +12,7 @@ export function applyPitchYawLimits(
|
|||||||
pitchLimits: PitchLimits, // deg
|
pitchLimits: PitchLimits, // deg
|
||||||
yawLimits?: YawLimits, // deg
|
yawLimits?: YawLimits, // deg
|
||||||
verticalStabilizer = false,
|
verticalStabilizer = false,
|
||||||
|
downVerticalStabilizer = false,
|
||||||
) {
|
) {
|
||||||
let newPitch = pitch;
|
let newPitch = pitch;
|
||||||
let newYaw = yaw;
|
let newYaw = yaw;
|
||||||
@@ -22,7 +23,8 @@ export function applyPitchYawLimits(
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
const depressionBuff = verticalStabilizer ? degToRad(3) : 0;
|
const depressionBuff =
|
||||||
|
verticalStabilizer || downVerticalStabilizer ? degToRad(3) : 0;
|
||||||
const elevationBuff = verticalStabilizer ? degToRad(4) : 0;
|
const elevationBuff = verticalStabilizer ? degToRad(4) : 0;
|
||||||
let lowerPitch = -degToRad(pitchLimits.max) - depressionBuff;
|
let lowerPitch = -degToRad(pitchLimits.max) - depressionBuff;
|
||||||
let upperPitch = -degToRad(pitchLimits.min) + elevationBuff;
|
let upperPitch = -degToRad(pitchLimits.min) + elevationBuff;
|
||||||
|
|||||||
@@ -109,6 +109,7 @@ export function tankCharacteristics(
|
|||||||
const hasEngineAccelerator = equipment(117);
|
const hasEngineAccelerator = equipment(117);
|
||||||
const hasCamouflageNet = equipment(115);
|
const hasCamouflageNet = equipment(115);
|
||||||
const hasImprovedVerticalStabilizer = equipment(122);
|
const hasImprovedVerticalStabilizer = equipment(122);
|
||||||
|
const hasDownImprovedVerticalStabilizer = equipment(124);
|
||||||
const hasImprovedSuspension = equipment(123);
|
const hasImprovedSuspension = equipment(123);
|
||||||
|
|
||||||
const hasTungsten = consumable(45);
|
const hasTungsten = consumable(45);
|
||||||
@@ -425,7 +426,8 @@ export function tankCharacteristics(
|
|||||||
const gunDepression =
|
const gunDepression =
|
||||||
gunModelDefinition.pitch.max +
|
gunModelDefinition.pitch.max +
|
||||||
gunDefaultPitch +
|
gunDefaultPitch +
|
||||||
(hasImprovedVerticalStabilizer ? 3 : 0);
|
(hasImprovedVerticalStabilizer ? 3 : 0) +
|
||||||
|
(hasDownImprovedVerticalStabilizer ? 3 : 0);
|
||||||
const gunElevation =
|
const gunElevation =
|
||||||
-gunModelDefinition.pitch.min -
|
-gunModelDefinition.pitch.min -
|
||||||
gunDefaultPitch +
|
gunDefaultPitch +
|
||||||
|
|||||||
@@ -39,7 +39,11 @@ const locale = Astro.params.locale ?? DEFAULT_LOCALE;
|
|||||||
window.location.pathname.startsWith(`/${locale}`),
|
window.location.pathname.startsWith(`/${locale}`),
|
||||||
);
|
);
|
||||||
|
|
||||||
if (!isAPI && bestLocale !== currentPathLocale) {
|
if (
|
||||||
|
!isAPI && // not an api, duh!
|
||||||
|
localStorage.getItem('preferred-locale') !== null && // no preference, so probably google's crawler
|
||||||
|
bestLocale !== currentPathLocale // we need to redirect
|
||||||
|
) {
|
||||||
window.location.pathname = isI18nPath
|
window.location.pathname = isI18nPath
|
||||||
? window.location.pathname.replace(
|
? window.location.pathname.replace(
|
||||||
`/${currentPathLocale}`,
|
`/${currentPathLocale}`,
|
||||||
|
|||||||
+2
-15
@@ -9,28 +9,15 @@ datasource db {
|
|||||||
}
|
}
|
||||||
|
|
||||||
model User {
|
model User {
|
||||||
blitz_id Int @id @map("blitz") // map: "blitz" was too vague
|
blitz_id BigInt @id @map("blitz") // map: "blitz" was too vague
|
||||||
last_used DateTime? @default(now())
|
last_used DateTime? @default(now())
|
||||||
tank_votes TankVote[]
|
|
||||||
|
|
||||||
@@map("Users") // map: "Users" was mistakenly plural
|
@@map("Users") // map: "Users" was mistakenly plural
|
||||||
}
|
}
|
||||||
|
|
||||||
model TankVote {
|
|
||||||
id Int @id
|
|
||||||
last_updated DateTime @default(now())
|
|
||||||
easiness Int?
|
|
||||||
firepower Int?
|
|
||||||
maneuverability Int?
|
|
||||||
survivability Int?
|
|
||||||
|
|
||||||
user User @relation(fields: [user_blitz_id], references: [blitz_id])
|
|
||||||
user_blitz_id Int
|
|
||||||
}
|
|
||||||
|
|
||||||
model DiscordUser {
|
model DiscordUser {
|
||||||
discord_id BigInt @id @map("discord") // map: "discord" was too vague
|
discord_id BigInt @id @map("discord") // map: "discord" was too vague
|
||||||
blitz_id Int @map("blitz") // map: "blitz" was too vague
|
blitz_id BigInt @map("blitz") // map: "blitz" was too vague
|
||||||
|
|
||||||
@@map("DiscordUsers") // map: "DiscordUsers" was mistakenly plural
|
@@map("DiscordUsers") // map: "DiscordUsers" was mistakenly plural
|
||||||
}
|
}
|
||||||
Submodule submodules/blitzkit-closed updated: c1d631764f...31937a9f1e.
Reference in new issue
Block a user