Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
220e4388d4 | ||
|
|
51b2d1ce86 | ||
|
|
f3c1825c57 | ||
|
|
359dfcd102 | ||
|
|
649cdd893f | ||
|
|
0cb974acf5 | ||
|
|
9bca5dccc7 | ||
|
|
d707f1cc5d | ||
|
|
e058b09621 | ||
|
|
448e4e0d7d | ||
|
|
0ea7714578 | ||
|
|
4ed4395535 | ||
|
|
0209d48475 | ||
|
|
437bee4a85 | ||
|
|
4b8e73fa57 | ||
|
|
b96f925d9a | ||
|
|
1551dc50fd | ||
|
|
cbe22035cb | ||
|
|
4c8e5cc8ed | ||
|
|
ee4141838c | ||
|
|
24ff42a672 | ||
|
|
d8748c028e | ||
|
|
b55924ce2b | ||
|
|
66f7a8d369 | ||
|
|
8ed97a3173 | ||
|
|
b4f452b026 | ||
|
|
8d4d730b11 | ||
|
|
8f54bd5971 | ||
|
|
56a09536cd | ||
|
|
9df5efa422 | ||
|
|
ee5461a297 | ||
|
|
5ed5f45240 | ||
|
|
a8cdc96382 | ||
|
|
532d677491 | ||
|
|
610ea60ca2 | ||
|
|
718576d5a9 | ||
|
|
f885fba4bd | ||
|
|
408a14003c | ||
|
|
9416e25ee9 | ||
|
|
8a3bbb3647 | ||
|
|
e16cc63cfe | ||
|
|
b2856eab58 | ||
|
|
55ffe22fd6 | ||
|
|
98e0f28cd9 | ||
|
|
547381286e | ||
|
|
bdaf6e662c | ||
|
|
87438abaa3 | ||
|
|
f837aaf40a | ||
|
|
86e080aae9 | ||
|
|
57efde83df | ||
|
|
6b29584424 | ||
|
|
71e40a0113 | ||
|
|
b5e7170697 | ||
|
|
4122856024 | ||
|
|
5b4c85138e | ||
|
|
727ced967b | ||
|
|
4462ebe82c | ||
|
|
06ce263668 | ||
|
|
7e086cc639 | ||
|
|
540e56a12d | ||
|
|
faf802cf3d | ||
|
|
b6d6fa7212 | ||
|
|
dfa8be63b4 | ||
|
|
9eb6acc624 | ||
|
|
b6204b1c2c | ||
|
|
39f1389d77 | ||
|
|
53b0f04512 | ||
|
|
d2fa93ee71 | ||
|
|
7871eae7a3 | ||
|
|
0bd660f255 | ||
|
|
488857b7d8 | ||
|
|
5e4c5fc230 | ||
|
|
daf4cef61c | ||
|
|
496e127f64 | ||
|
|
7e6925772e | ||
|
|
b479c09cf8 | ||
|
|
eddc8168ba | ||
|
|
80dfc59017 | ||
|
|
fdc0f34e08 | ||
|
|
c0fdf10eba | ||
|
|
2aba4da1af | ||
|
|
581d889e9b | ||
|
|
6a280982d0 | ||
|
|
45c7d74160 | ||
|
|
9e225d2093 | ||
|
|
d1001df3cf | ||
|
|
d28c56fe1c | ||
|
|
fe68ebf450 | ||
|
|
18cc885869 | ||
|
|
9d4e1a66a1 | ||
|
|
da1af66c77 | ||
|
|
01409985a2 | ||
|
|
a86ac0619a | ||
|
|
385d165512 | ||
|
|
fcfc97b964 | ||
|
|
53d05e73a6 | ||
|
|
40a1eb861d | ||
|
|
1d3cb95b89 | ||
|
|
010303a818 | ||
|
|
7281b9fed0 | ||
|
|
c5785c7ae6 | ||
|
|
698731cb9a | ||
|
|
99bae8f2c5 | ||
|
|
5034ec1aa0 | ||
|
|
be821c1f8b | ||
|
|
a364b79a9b | ||
|
|
0aa6e1e79a | ||
|
|
d2a6379131 | ||
|
|
07ce61d19f | ||
|
|
ad9f2d8609 | ||
|
|
57702d8a43 | ||
|
|
9a30af3818 | ||
|
|
23751fbdf3 | ||
|
|
db6d181f78 | ||
|
|
56ca4dcc61 | ||
|
|
d08b537721 | ||
|
|
c1a2edb489 | ||
|
|
164b7fa454 | ||
|
|
428483cf4c | ||
|
|
89f02eb399 | ||
|
|
4ce127516c | ||
|
|
6f4f487dfe | ||
|
|
57dd60e804 | ||
|
|
d24fd2250c | ||
|
|
e00bcdfc06 | ||
|
|
67dd204ee6 | ||
|
|
e130583fa4 | ||
|
|
6ad20a0fcf | ||
|
|
9fad644d7a | ||
|
|
8cb523dd06 | ||
|
|
b50ee23a26 | ||
|
|
a973cf699b | ||
|
|
102abf49c4 | ||
|
|
8929e503ea | ||
|
|
a2a794eb74 | ||
|
|
2e95f5dd95 | ||
|
|
23a42230cb | ||
|
|
e66daed7ae | ||
|
|
f2d0f68f07 | ||
|
|
be4af0bf84 | ||
|
|
15172e8b33 | ||
|
|
c6b7918525 | ||
|
|
4f1c4421e5 | ||
|
|
7b830f5a71 | ||
|
|
6ce1135835 | ||
|
|
66eaaef6de | ||
|
|
48fbf59036 | ||
|
|
0e0f4fbe9f | ||
|
|
6ba6e10108 | ||
|
|
cf8fa4ffb4 | ||
|
|
2b0180dce2 | ||
|
|
de8d3396b1 | ||
|
|
caee848a47 | ||
|
|
baaae612fd | ||
|
|
4b5a511216 | ||
|
|
57dacddcfd | ||
|
|
a56665f3a3 | ||
|
|
c27e903c31 | ||
|
|
d01b7cf707 | ||
|
|
8921f84c38 | ||
|
|
6830df01fa | ||
|
|
476f180a1a | ||
|
|
67da59ef41 | ||
|
|
036cc9915d | ||
|
|
57b6ba19f0 | ||
|
|
32b5593d07 | ||
|
|
b05e70faee | ||
|
|
5c30169eca | ||
|
|
3b757562d2 | ||
|
|
1226ce89a7 | ||
|
|
dcc8207fb6 | ||
|
|
c50f40a887 | ||
|
|
85f7d420a0 | ||
|
|
1aec1b2885 | ||
|
|
51226c8503 | ||
|
|
4c8c2d0868 | ||
|
|
b2f266401f | ||
|
|
407d00b25b | ||
|
|
fb4fb926e8 | ||
|
|
70b0df55b0 | ||
|
|
7e8fd40c61 | ||
|
|
9286104391 | ||
|
|
814192c0b0 | ||
|
|
8fa6f87540 | ||
|
|
d265f0b0a1 | ||
|
|
9ccaade1fc | ||
|
|
2bb5bb33c0 | ||
|
|
e456063c27 | ||
|
|
7bc25f0722 | ||
|
|
6ed991d281 | ||
|
|
2487e0eebf | ||
|
|
6cc44cdfee | ||
|
|
eca26e1e79 | ||
|
|
5484a15071 | ||
|
|
b58ca4f594 | ||
|
|
7708e2c1db | ||
|
|
de77e27d50 | ||
|
|
e159583333 | ||
|
|
bfcf183a6e | ||
|
|
5541eca23d | ||
|
|
122d65840e | ||
|
|
ed4b72d85c | ||
|
|
4033e8618f | ||
|
|
42cada1811 | ||
|
|
ff7ed213c8 | ||
|
|
a0367af06b | ||
|
|
58c2965c53 | ||
|
|
8c1bf450a8 | ||
|
|
9ffc040723 | ||
|
|
f33a73e1bb | ||
|
|
edae41409a | ||
|
|
383d3a36ef | ||
|
|
6a958da390 | ||
|
|
ef154f99d5 | ||
|
|
4a20102de3 | ||
|
|
4e170f2917 | ||
|
|
a70d788f6b |
No files matched your search
@@ -16,10 +16,11 @@ on:
|
||||
- blitzkit/assets-dev
|
||||
default: blitzkit/assets
|
||||
|
||||
archive_url:
|
||||
asset_source:
|
||||
type: string
|
||||
required: false
|
||||
description: Archive URL to download instead of Steam client
|
||||
description: "Archive URL or Steam to download (example: steam:APP_ID/DEPOT_ID or zip:URL_TO_ZIP)"
|
||||
default: "steam:444200/444202"
|
||||
|
||||
schedule:
|
||||
- cron: "0 2 * * *"
|
||||
@@ -64,18 +65,18 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/checkout@v6
|
||||
with:
|
||||
submodules: recursive
|
||||
token: ${{ secrets.GH_TOKEN }}
|
||||
- uses: arduino/setup-protoc@v3
|
||||
with:
|
||||
repo-token: ${{ secrets.GH_TOKEN }}
|
||||
- uses: oven-sh/setup-bun@v1
|
||||
- uses: oven-sh/setup-bun@v2
|
||||
- run: bun run setup
|
||||
|
||||
- name: AppArmor hack
|
||||
run: echo 0 | sudo tee /proc/sys/kernel/apparmor_restrict_unprivileged_userns
|
||||
|
||||
- name: Build assets
|
||||
run: bun run build:assets --all-targets --manual
|
||||
run: bun run build:assets --all-targets --source=${{ github.event.inputs.asset_source || 'steam:444200/444202' }}
|
||||
@@ -32,11 +32,11 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/checkout@v6
|
||||
with:
|
||||
submodules: recursive
|
||||
token: ${{ secrets.GH_TOKEN }}
|
||||
- uses: oven-sh/setup-bun@v1
|
||||
- uses: oven-sh/setup-bun@v2
|
||||
- uses: arduino/setup-protoc@v3
|
||||
with:
|
||||
repo-token: ${{ secrets.GH_TOKEN }}
|
||||
|
||||
@@ -14,11 +14,11 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/checkout@v6
|
||||
with:
|
||||
submodules: recursive
|
||||
token: ${{ secrets.GH_TOKEN }}
|
||||
- uses: oven-sh/setup-bun@v1
|
||||
- uses: oven-sh/setup-bun@v2
|
||||
- uses: arduino/setup-protoc@v3
|
||||
with:
|
||||
repo-token: ${{ secrets.GH_TOKEN }}
|
||||
@@ -28,7 +28,7 @@ jobs:
|
||||
run: bun run build:bot
|
||||
|
||||
- name: Archive build
|
||||
uses: actions/upload-artifact@v4
|
||||
uses: actions/upload-artifact@v5
|
||||
with:
|
||||
name: bot
|
||||
path: dist/bot
|
||||
@@ -22,11 +22,11 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/checkout@v6
|
||||
with:
|
||||
submodules: recursive
|
||||
token: ${{ secrets.GH_TOKEN }}
|
||||
- uses: oven-sh/setup-bun@v1
|
||||
- uses: oven-sh/setup-bun@v2
|
||||
- uses: arduino/setup-protoc@v3
|
||||
with:
|
||||
repo-token: ${{ secrets.GH_TOKEN }}
|
||||
|
||||
@@ -42,7 +42,7 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- uses: oven-sh/setup-bun@v1
|
||||
- uses: oven-sh/setup-bun@v2
|
||||
- uses: arduino/setup-protoc@v3
|
||||
with:
|
||||
repo-token: ${{ secrets.GH_TOKEN }}
|
||||
|
||||
@@ -32,11 +32,11 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/checkout@v6
|
||||
with:
|
||||
submodules: recursive
|
||||
token: ${{ secrets.GH_TOKEN }}
|
||||
- uses: oven-sh/setup-bun@v1
|
||||
- uses: oven-sh/setup-bun@v2
|
||||
- uses: arduino/setup-protoc@v3
|
||||
with:
|
||||
repo-token: ${{ secrets.GH_TOKEN }}
|
||||
|
||||
@@ -32,11 +32,11 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/checkout@v6
|
||||
with:
|
||||
submodules: recursive
|
||||
token: ${{ secrets.GH_TOKEN }}
|
||||
- uses: oven-sh/setup-bun@v1
|
||||
- uses: oven-sh/setup-bun@v2
|
||||
- uses: arduino/setup-protoc@v3
|
||||
with:
|
||||
repo-token: ${{ secrets.GH_TOKEN }}
|
||||
|
||||
@@ -32,11 +32,11 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/checkout@v6
|
||||
with:
|
||||
submodules: recursive
|
||||
token: ${{ secrets.GH_TOKEN }}
|
||||
- uses: oven-sh/setup-bun@v1
|
||||
- uses: oven-sh/setup-bun@v2
|
||||
- uses: arduino/setup-protoc@v3
|
||||
with:
|
||||
repo-token: ${{ secrets.GH_TOKEN }}
|
||||
|
||||
@@ -24,11 +24,11 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/checkout@v6
|
||||
with:
|
||||
submodules: recursive
|
||||
token: ${{ secrets.GH_TOKEN }}
|
||||
- uses: oven-sh/setup-bun@v1
|
||||
- uses: oven-sh/setup-bun@v2
|
||||
- uses: arduino/setup-protoc@v3
|
||||
with:
|
||||
repo-token: ${{ secrets.GH_TOKEN }}
|
||||
|
||||
@@ -0,0 +1,66 @@
|
||||
name: Website UE
|
||||
|
||||
on:
|
||||
push:
|
||||
workflow_dispatch:
|
||||
|
||||
schedule:
|
||||
- cron: "0 4 * * *"
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
pages: write
|
||||
id-token: write
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.ref }}
|
||||
cancel-in-progress: ${{ github.ref == 'refs/heads/main' }}
|
||||
|
||||
env:
|
||||
WOTB_SERVER: ${{ secrets.WOTB_SERVER }}
|
||||
|
||||
jobs:
|
||||
build:
|
||||
name: Build
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v6
|
||||
with:
|
||||
submodules: recursive
|
||||
token: ${{ secrets.GH_TOKEN }}
|
||||
|
||||
- uses: oven-sh/setup-bun@v2
|
||||
|
||||
- uses: actions/setup-node@v6
|
||||
with:
|
||||
node-version: latest
|
||||
|
||||
- uses: arduino/setup-protoc@v3
|
||||
with:
|
||||
repo-token: ${{ secrets.GH_TOKEN }}
|
||||
|
||||
- uses: actions/configure-pages@v5
|
||||
|
||||
- run: bun run setup
|
||||
|
||||
- name: Build website
|
||||
run: bun run build:website
|
||||
|
||||
- name: Upload artifact
|
||||
uses: actions/upload-pages-artifact@v4
|
||||
with:
|
||||
path: dist/website
|
||||
|
||||
deploy-github-pages:
|
||||
if: ${{ github.ref == 'refs/heads/ue' && github.repository == 'blitzkit/host-beta' }}
|
||||
name: Deploy to GitHub Pages
|
||||
runs-on: ubuntu-latest
|
||||
needs: build
|
||||
environment:
|
||||
name: Production
|
||||
url: ${{ steps.deployment.outputs.page_url }}
|
||||
|
||||
steps:
|
||||
- name: Deploy to GitHub Pages
|
||||
id: deployment
|
||||
uses: actions/deploy-pages@v4
|
||||
@@ -38,11 +38,11 @@ jobs:
|
||||
name: Build
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/checkout@v6
|
||||
with:
|
||||
submodules: recursive
|
||||
token: ${{ secrets.GH_TOKEN }}
|
||||
- uses: oven-sh/setup-bun@v1
|
||||
- uses: oven-sh/setup-bun@v2
|
||||
- uses: arduino/setup-protoc@v3
|
||||
with:
|
||||
repo-token: ${{ secrets.GH_TOKEN }}
|
||||
@@ -53,7 +53,7 @@ jobs:
|
||||
run: bun run build:website
|
||||
|
||||
- name: Upload artifact
|
||||
uses: actions/upload-pages-artifact@v3
|
||||
uses: actions/upload-pages-artifact@v4
|
||||
with:
|
||||
path: dist/website
|
||||
|
||||
|
||||
@@ -22,7 +22,7 @@ depots
|
||||
public/sitemap*
|
||||
/firebase.json
|
||||
target
|
||||
# packages/core/src/protos/*.ts
|
||||
packages/website-ue/src/protos/*.ts
|
||||
/.vercel
|
||||
.astro
|
||||
.vercel
|
||||
|
||||
@@ -17,8 +17,6 @@
|
||||
"astrojs",
|
||||
"astrolib",
|
||||
"atgm",
|
||||
"Autoloader",
|
||||
"Autoreloader",
|
||||
"AYUV",
|
||||
"battleresults",
|
||||
"bbox",
|
||||
@@ -61,10 +59,12 @@
|
||||
"Ddpf",
|
||||
"Ddsd",
|
||||
"deadrail",
|
||||
"DEBUFF",
|
||||
"debugflags",
|
||||
"deburr",
|
||||
"decalmask",
|
||||
"decompressor",
|
||||
"décor",
|
||||
"dedup",
|
||||
"defence",
|
||||
"degressive",
|
||||
@@ -74,6 +74,7 @@
|
||||
"DIDS",
|
||||
"donotremove",
|
||||
"drei",
|
||||
"Droodles",
|
||||
"dvpd",
|
||||
"dvpl",
|
||||
"DVPLCRC",
|
||||
@@ -96,9 +97,11 @@
|
||||
"gameplay",
|
||||
"glsl",
|
||||
"GLTF",
|
||||
"GSOR",
|
||||
"gtag",
|
||||
"haha",
|
||||
"Herdbreaker",
|
||||
"Hetz",
|
||||
"highp",
|
||||
"iife",
|
||||
"imgur",
|
||||
@@ -173,6 +176,7 @@
|
||||
"ratingleaderboard",
|
||||
"raycaster",
|
||||
"Redirector",
|
||||
"REGEN",
|
||||
"Relogin",
|
||||
"researchable",
|
||||
"Resvg",
|
||||
@@ -187,10 +191,12 @@
|
||||
"searchtanks",
|
||||
"SHAREDEXP",
|
||||
"SKLLD",
|
||||
"sluggify",
|
||||
"smoothstep",
|
||||
"Smri",
|
||||
"Specularity",
|
||||
"SSAO",
|
||||
"stackable",
|
||||
"startcase",
|
||||
"statkit",
|
||||
"statsfull",
|
||||
|
||||
@@ -1,19 +1,47 @@
|
||||
# BlitzKit Credits
|
||||
|
||||
BlitzKit is a one man band **TrèsAbhi** but I am far from solo.
|
||||
BlitzKit is a one man band **TrèsAbhi** but I am far from solo. Helpers, in the order of contribution over time:
|
||||
|
||||
| Role | People |
|
||||
| ------------------------------ | ------------------------------ |
|
||||
| Bot verification | S0AP |
|
||||
| General testing | Prince_NA |
|
||||
| Bot advertisement platform | S0AP |
|
||||
| Bot rendering pipeline | Vovko |
|
||||
| Game asset decompression | Maddox |
|
||||
| Game 3D model parsing | Pyogenics |
|
||||
| Game file layout | Aeson |
|
||||
| 3-caliber rule edge cases | Minitelrose, ChickenMan7777 |
|
||||
| Embed UX | \_34, HisRoyalFatness, Synx |
|
||||
| Tankopedia pre-release testing | [OPTML], Aeson, \_34, xkdkw |
|
||||
| Website advertisement platform | Aeson |
|
||||
| Compare pre-release testing | [OPTML] |
|
||||
| Redacted | GonnaHetzMe |
|
||||
### S0AP
|
||||
|
||||
BlitzKit Discord bot verification, testing, advertisement, and the initial encouragement to create BlitzKit.
|
||||
|
||||
### Prince_NA
|
||||
|
||||
BlitzKit Discord bot and website testing and general advise.
|
||||
|
||||
### Vovko
|
||||
|
||||
BlitzKit Discord bot and website rendering pipeline.
|
||||
|
||||
### Maddox
|
||||
|
||||
Game file decompression.
|
||||
|
||||
### Pyogenics
|
||||
|
||||
Game 3D model parsing.
|
||||
|
||||
### Aeson
|
||||
|
||||
Game file layout, general advise, advertisement, and Tankopedia pre-release testing.
|
||||
|
||||
### Minitelrose, ChickenMan7777
|
||||
|
||||
3-caliber rule edge cases.
|
||||
|
||||
### HisRoyalFatness, Synx
|
||||
|
||||
Embed UX.
|
||||
|
||||
### [OPTML] clan, \_34, xkdkw, Droodles Blitz
|
||||
|
||||
Tankopedia pre-release testing.
|
||||
|
||||
### GonnaHetzMe
|
||||
|
||||
Redacted by request.
|
||||
|
||||
### Mark Greene
|
||||
|
||||
GitHub contributor on bug fixes and feature additions.
|
||||
@@ -0,0 +1,5 @@
|
||||
# BlitzKit 1.29.7
|
||||
|
||||
## Features
|
||||
|
||||
- Re-introduced the ability to deploy BlitzKit OpenTests
|
||||
@@ -0,0 +1,19 @@
|
||||
# BlitzKit 1.29.8
|
||||
|
||||
Thank you to [Mark Greene](https://github.com/Hitjack007) for your contributions this update.
|
||||
|
||||
## Features
|
||||
|
||||
- Added an option to clear provisions and consumables from all tanks in Compare
|
||||
- Added the ability to choose stock turrets and guns in Mixer if a tank has any
|
||||
- Added streaks to Guesser
|
||||
- Introduced an option to partially reveal tanks in Guesser
|
||||
- This removes the darkness effect but keeps the name hidden
|
||||
- This will reset your streak to 0
|
||||
- Regardless of getting the right guess on the tank's name, your response will be counted as incorrect if partially revealed
|
||||
|
||||
## Fixes
|
||||
|
||||
- The Tankopedia now smoothly resizes when enlarging on interaction
|
||||
- [Mark Greene] Stock turrets now correctly mount the corresponding stock gun
|
||||
- The consumable and provision buttons in Compare are no longer tiny
|
||||
@@ -0,0 +1,14 @@
|
||||
# BlitzKit 1.29.9
|
||||
|
||||
Thank you to [Mark Greene](https://github.com/Hitjack007) for your contributions this update.
|
||||
|
||||
## Features
|
||||
|
||||
- Reworked tank search filters to be far more compact to make way for new filters
|
||||
- [Mark Greene] Added the ability to filter tanks by consumables
|
||||
- Added the ability to filter tanks by provisions and game-mode abilities and powers
|
||||
|
||||
## Fixes
|
||||
|
||||
- Consumable and provision icons in Compare are now properly sized
|
||||
- [Mark Greene] Provisions now properly affect terrain resistances
|
||||
@@ -0,0 +1,57 @@
|
||||
# Christmas Garage Guide 2025
|
||||
|
||||
This content was pre-recorded on a test server and the version you may see may not be the same. Please see [the official WoTB portal](https://wotblitz.com/) for the most up-to-date information.
|
||||
|
||||
The holiday season has arrived, and this year the celebrations spill directly into your garage, transforming the familiar space into a festive hub filled with activities, rewards, and seasonal flair. Instead of just offering decorations or a visual makeover, this event brings a full set of mechanics that turn everyday battles into a steady stream of progress. Whether you’re aiming for bonuses, collectibles, or new tanks, the garage is designed to make every match feel like part of a larger holiday journey.
|
||||
|
||||

|
||||
|
||||
## The Music Box
|
||||
|
||||
The familiar Snow Globes are absent this year, replaced entirely by **Music Boxes**, which act as the new way to try your luck for seasonal rewards. They behave similarly to the Snow Globes and give you a chance to obtain various items, including a shot at the brand-new **[GSOR the TANK](https://blitzkit.app/tanks/gsor-the-tank/)**. But this time around, **they do not guarantee a tank every single time.** But as a bonus, the Music Box guarantees you will not receive duplicate tanks. Once you have a tank, the Music Box will try its best to give you a different one each time.
|
||||
|
||||

|
||||
|
||||
## Win Battles, Earn Rewards
|
||||
|
||||
Each victory during the event rewards you with **3 Hot Coffees**, a seasonal currency that serves as the backbone of the progression system. These coffees can be exchanged for a variety of Festive Town rewards, giving you reasons to keep pushing through battles even if you’re just casually playing.
|
||||
|
||||

|
||||
|
||||
With the coffees, you’ll also be able to claim **2 tank certificates**, one for **tier VII** vehicles and another covering **tier IX–X** options.
|
||||
|
||||
The tier VII pool includes the [E 25](https://blitzkit.app/tanks/e-25), [CS-52 LIS](https://blitzkit.app/tanks/cs-52-lis), [AMX 13 57](https://blitzkit.app/tanks/amx-13-57), [Steyr WT](https://blitzkit.app/tanks/steyr-wt), [Kunze Panzer](https://blitzkit.app/tanks/kunze-panzer), and [Super Hellcat](https://blitzkit.app/tanks/super-hellcat). Meanwhile, the tier IX–X certificate gives access to higher-tier picks like the [121B](https://blitzkit.app/tanks/121b), [AMX 30 B](https://blitzkit.app/tanks/amx-30-b), [Obj. 260](https://blitzkit.app/tanks/obj-260), [Char Futur 4](https://blitzkit.app/tanks/char-futur-4), [TL-7-120](https://blitzkit.app/tanks/tl-7-120), and [Object 452K](https://blitzkit.app/tanks/object-452k).
|
||||
|
||||

|
||||
|
||||
## Upgrade Your Christmas Tree
|
||||
|
||||
Golden tokens allow you to upgrade your Christmas Tree through **four distinct stages**, each bringing your garage closer to its fully decorated holiday form.
|
||||
|
||||

|
||||
|
||||
As the tree grows, additional ornament slots open up, eight in total, which appear on the left side of your screen. These slots give you more room to customize the look of your garage and make the tree feel like something you’ve built up piece by piece over the course of the event. Each new ornament adds to the atmosphere, making the progression feel both cosmetic and rewarding.
|
||||
|
||||
A fully decorated tree grants up to **+25% silver** per battle, turning your regular gameplay into a more profitable experience without requiring extra effort. Ensure all your ornaments come from the same set to unlock the full potential of the tree (all left, all middle, or all right).
|
||||
|
||||

|
||||
|
||||
## Upgrade Your Yuletide Stall
|
||||
|
||||
Your golden tokens can also be invested into upgrading the **Yuletide Stall**, another element of the garage that evolves as you level it up. Each upgrade unlocks new rewards, giving you incentives to distribute your tokens across different attractions instead of focusing on only one. The stall begins in a simple state, but after upgrades it transforms visually and functionally, becoming a more vibrant part of your garage.
|
||||
|
||||

|
||||
|
||||
Each upgrade unlocks a tier worth of rewards that you can claim in exchange for Free XP, Gold, Silver, and more Hot Coffees!
|
||||
|
||||

|
||||
|
||||
## Upgrade Your Shooting Gallery
|
||||
|
||||
Another upgradeable area is the **Shooting Gallery**, which contributes its own set of rewards as it levels up. Enhancing the gallery expands your options for exchanging mastery badges, making those badges more useful during the event than they usually are.
|
||||
|
||||

|
||||
|
||||

|
||||
|
||||
Consider yourselves debriefed. Happy holidays!
|
||||
@@ -1,13 +1,13 @@
|
||||
{
|
||||
"name": "blitzkit",
|
||||
"version": "1.29.6",
|
||||
"version": "2.0.0-beta.2",
|
||||
"license": "BlitzKit License",
|
||||
"private": true,
|
||||
"scripts": {
|
||||
"build:assets": "cd packages/scripts && bun run build:assets",
|
||||
"build:averages": "bun --filter=@blitzkit/scripts run build:averages",
|
||||
"build:bot": "cd packages/scripts && bun run build:bot",
|
||||
"build:website": "cd packages/website && bun run build",
|
||||
"build:website": "cd packages/website-ue && bun run build",
|
||||
"build:prisma": "prisma generate",
|
||||
"build:proxyclient": "cd packages/scripts && bun run build:proxyclient",
|
||||
"build:catalogitemaccesssor": "cd packages/scripts && bun run build:catalogitemaccesssor",
|
||||
@@ -16,26 +16,26 @@
|
||||
"dev:bot": "bun run build:bot --dev && bun start:bot",
|
||||
"start:bot": "bun dist/bot/main.js",
|
||||
"dev:docs": "vitepress dev docs",
|
||||
"dev:website": "cd packages/website && bun run dev",
|
||||
"dev:website": "cd packages/website-ue && bun run dev",
|
||||
"dev:app": "cd packages/app && bun run dev",
|
||||
"dev": "bun run dev:website",
|
||||
"dev:api": "bun --filter=@blitzkit/api run dev",
|
||||
"setup:depotdownloader": "bun --filter=@blitzkit/scripts run setup:depotdownloader",
|
||||
"setup:patches": "bun --filter=@blitzkit/scripts run setup:patches",
|
||||
"start:website": "bun --filter=@blitzkit/website run start",
|
||||
"start:website": "bun --filter=@blitzkit/website-ue run start",
|
||||
"host:docs": "vitepress preview docs",
|
||||
"lint": "tsc",
|
||||
"lint:website": "cd packages/website && bun run lint",
|
||||
"lint:website": "cd packages/website-ue && bun run lint",
|
||||
"format": "prettier --write \"**/*.@(json|js|jsx|css|md|ts|tsx|html|xml|yml|gltf)\"",
|
||||
"update": "yarn upgrade --latest",
|
||||
"tunnel": "cloudflared tunnel --url http://localhost:3000",
|
||||
"discoverids": "scripts/discoverIds.ts",
|
||||
"build:protos": "cd packages/scripts && bun run build:protos",
|
||||
"preview:website": "cd packages/website && bun run preview",
|
||||
"preview:website": "cd packages/website-ue && bun run preview",
|
||||
"build:reviews": "cd packages/scripts && bun build:reviews",
|
||||
"build:ids": "cd packages/scripts && bun build:ids",
|
||||
"prunestrings": "cd packages/scripts && bun prunestrings",
|
||||
"setup": "bun install && bun run build:prisma && bun run build:protos && bun run build:proxyclient",
|
||||
"setup": "bun install && bun run build:prisma && bun run build:protos && bun run build:proxyclient && bun run build:catalogitemaccesssor",
|
||||
"patchnotes": "cd packages/scripts && bun run patchnotes"
|
||||
},
|
||||
"type": "module",
|
||||
|
||||
@@ -52,7 +52,7 @@ export const ratingLeaderboardCommand = new Promise<CommandRegistry>(
|
||||
const seasonNumbers = range(
|
||||
FIRST_MINIMAL_ARCHIVED_RATING_SEASON,
|
||||
latestArchivedSeasonNumber + (onGoingSeason ? 1 : 0) + 1
|
||||
);
|
||||
).slice(-25);
|
||||
|
||||
function addOptions(option: SlashCommandSubcommandBuilder) {
|
||||
const { strings } = translator(Locale.EnglishUS);
|
||||
@@ -196,7 +196,7 @@ export const ratingLeaderboardCommand = new Promise<CommandRegistry>(
|
||||
strings.common.leagues as Record<string, string>
|
||||
)[name]
|
||||
),
|
||||
}) satisfies APIApplicationCommandOptionChoice<string>
|
||||
} satisfies APIApplicationCommandOptionChoice<string>)
|
||||
)
|
||||
)
|
||||
.setRequired(true);
|
||||
@@ -219,8 +219,8 @@ export const ratingLeaderboardCommand = new Promise<CommandRegistry>(
|
||||
const season = seasonOption
|
||||
? parseInt(seasonOption)
|
||||
: onGoingSeason
|
||||
? latestArchivedSeasonNumber + 1
|
||||
: latestArchivedSeasonNumber;
|
||||
? latestArchivedSeasonNumber + 1
|
||||
: latestArchivedSeasonNumber;
|
||||
const isCurrentSeason = season === latestArchivedSeasonNumber + 1;
|
||||
let titleName: string;
|
||||
let titleImage: string | undefined;
|
||||
@@ -258,7 +258,7 @@ export const ratingLeaderboardCommand = new Promise<CommandRegistry>(
|
||||
position: player.number,
|
||||
clan: player.clan_tag,
|
||||
nickname: player.nickname,
|
||||
}) satisfies SimplifiedPlayer
|
||||
} satisfies SimplifiedPlayer)
|
||||
)
|
||||
)
|
||||
: await getArchivedRatingLeaderboard(region, season!).then(
|
||||
@@ -295,7 +295,7 @@ export const ratingLeaderboardCommand = new Promise<CommandRegistry>(
|
||||
.deleted_player,
|
||||
{ id: player.id }
|
||||
),
|
||||
}) satisfies SimplifiedPlayer
|
||||
} satisfies SimplifiedPlayer)
|
||||
);
|
||||
}
|
||||
);
|
||||
@@ -349,7 +349,7 @@ export const ratingLeaderboardCommand = new Promise<CommandRegistry>(
|
||||
score: player.score,
|
||||
clan: player.clan_tag,
|
||||
nickname: player.nickname,
|
||||
}) satisfies SimplifiedPlayer
|
||||
} satisfies SimplifiedPlayer)
|
||||
)
|
||||
)
|
||||
: await getArchivedRatingLeaderboard(region, season!).then(
|
||||
|
||||
@@ -19,9 +19,9 @@ export function localizationObject(
|
||||
(!strict || validNameRegex.test(translation)) && translation.length > 0;
|
||||
|
||||
if (!isValid) {
|
||||
console.warn(
|
||||
`Invalid localization for ${locale} (${path}): ${translation}; skipping...`
|
||||
);
|
||||
// console.warn(
|
||||
// `Invalid localization for ${locale} (${path}): ${translation}; skipping...`
|
||||
// );
|
||||
return localizations;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,25 +0,0 @@
|
||||
export enum BlitzVFSSourceType {
|
||||
Steam,
|
||||
}
|
||||
|
||||
type BlitzVFSSource = {
|
||||
type: BlitzVFSSourceType;
|
||||
|
||||
username: string;
|
||||
password: string;
|
||||
|
||||
app: number;
|
||||
os: "windows";
|
||||
};
|
||||
|
||||
export class BlitzVFS {
|
||||
constructor(private source: BlitzVFSSource) {}
|
||||
|
||||
async init() {
|
||||
return this;
|
||||
}
|
||||
|
||||
async file(path: string) {
|
||||
return new Uint8Array();
|
||||
}
|
||||
}
|
||||
@@ -4,63 +4,54 @@ import {
|
||||
GunDefinition,
|
||||
Provision,
|
||||
TankDefinition,
|
||||
} from '../protos';
|
||||
} from "../protos";
|
||||
|
||||
export function checkConsumableProvisionInclusivity(
|
||||
consumableProvision: Consumable | Provision,
|
||||
tank: TankDefinition,
|
||||
gun: GunDefinition,
|
||||
gun: GunDefinition
|
||||
) {
|
||||
const included =
|
||||
!consumableProvision.game_mode_exclusive &&
|
||||
consumableProvision.include?.every((rule) => {
|
||||
switch (rule.filter_type!.$case) {
|
||||
case 'tiers':
|
||||
return (
|
||||
rule.filter_type!.value.min <= tank.tier &&
|
||||
tank.tier <= rule.filter_type!.value.max
|
||||
);
|
||||
const included = consumableProvision.include?.every((rule) => {
|
||||
switch (rule.filter_type!.$case) {
|
||||
case "tiers":
|
||||
return (
|
||||
rule.filter_type!.value.min <= tank.tier &&
|
||||
tank.tier <= rule.filter_type!.value.max
|
||||
);
|
||||
|
||||
case 'ids':
|
||||
return rule.filter_type!.value.ids.includes(tank.id);
|
||||
case "ids":
|
||||
return rule.filter_type!.value.ids.includes(tank.id);
|
||||
|
||||
case 'nations':
|
||||
return rule.filter_type!.value.nations.includes(tank.nation);
|
||||
case "nations":
|
||||
return rule.filter_type!.value.nations.includes(tank.nation);
|
||||
|
||||
case 'categories':
|
||||
throw new SyntaxError('Category filtering found in include rule');
|
||||
}
|
||||
});
|
||||
const excluded =
|
||||
consumableProvision.game_mode_exclusive ||
|
||||
consumableProvision.exclude?.some((rule) => {
|
||||
switch (rule.filter_type!.$case) {
|
||||
case 'tiers':
|
||||
return (
|
||||
rule.filter_type!.value.min <= tank.tier &&
|
||||
tank.tier <= rule.filter_type!.value.max
|
||||
);
|
||||
case "categories":
|
||||
throw new SyntaxError("Category filtering found in include rule");
|
||||
}
|
||||
});
|
||||
const excluded = consumableProvision.exclude?.some((rule) => {
|
||||
switch (rule.filter_type!.$case) {
|
||||
case "tiers":
|
||||
return (
|
||||
rule.filter_type!.value.min <= tank.tier &&
|
||||
tank.tier <= rule.filter_type!.value.max
|
||||
);
|
||||
|
||||
case 'ids':
|
||||
return rule.filter_type!.value.ids.includes(tank.id);
|
||||
case "ids":
|
||||
return rule.filter_type!.value.ids.includes(tank.id);
|
||||
|
||||
case 'nations':
|
||||
return rule.filter_type!.value.nations.includes(tank.nation);
|
||||
case "nations":
|
||||
return rule.filter_type!.value.nations.includes(tank.nation);
|
||||
|
||||
case 'categories':
|
||||
return rule.filter_type!.value.categories.some((category) => {
|
||||
switch (category) {
|
||||
case ConsumableTankCategoryFilterCategory.CLIP:
|
||||
return gun.gun_type!.$case !== 'regular';
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
case "categories":
|
||||
return rule.filter_type!.value.categories.some((category) => {
|
||||
switch (category) {
|
||||
case ConsumableTankCategoryFilterCategory.CLIP:
|
||||
return gun.gun_type!.$case !== "regular";
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
return (
|
||||
!consumableProvision.game_mode_exclusive &&
|
||||
consumableProvision.include?.length > 0 &&
|
||||
included &&
|
||||
!excluded
|
||||
);
|
||||
return consumableProvision.include?.length > 0 && included && !excluded;
|
||||
}
|
||||
@@ -17,7 +17,7 @@ export async function getArchivedLatestSeasonNumber() {
|
||||
if (ratingInfo.detail) {
|
||||
const regionsURL = (
|
||||
(await fetch(
|
||||
`https://api.github.com/repos/tresabhi/${assertSecret(
|
||||
`https://api.github.com/repos/${assertSecret(
|
||||
import.meta.env.PUBLIC_ASSET_REPO
|
||||
)}/git/trees/main`
|
||||
).then((response) => response.json())) as GitHubTrees
|
||||
|
||||
@@ -1,49 +1,50 @@
|
||||
export * from './assertSecret';
|
||||
export * from './asset';
|
||||
export * from './availableProvisions';
|
||||
export * from './averageDefinitions';
|
||||
export * from "./assertSecret";
|
||||
export * from "./asset";
|
||||
export * from "./availableProvisions";
|
||||
export * from "./averageDefinitions";
|
||||
// export * from './camouflageDefinitions';
|
||||
// export * from './checkConsumableProvisionInclusivity';
|
||||
export * from './coefficient';
|
||||
export * from './consumableDefinitions';
|
||||
export * from "./coefficient";
|
||||
export * from "./consumableDefinitions";
|
||||
// export * from './context';
|
||||
export * from './createDefaultSkills';
|
||||
export * from './degressiveStat';
|
||||
export * from './discoveredIdDefinitions';
|
||||
export * from './emblemURL';
|
||||
export * from './equipmentDefinitions';
|
||||
export * from './eventManager';
|
||||
export * from './gameDefinitions';
|
||||
export * from './getArchivedLatestSeasonNumber';
|
||||
export * from "./createDefaultSkills";
|
||||
export * from "./degressiveStat";
|
||||
export * from "./discoveredIdDefinitions";
|
||||
export * from "./emblemURL";
|
||||
export * from "./equipmentDefinitions";
|
||||
export * from "./eventManager";
|
||||
export * from "./gameDefinitions";
|
||||
export * from "./getArchivedLatestSeasonNumber";
|
||||
// export * from './getArchivedRatingInfo';
|
||||
export * from './getArchivedRatingLeaderboard';
|
||||
export * from "./getArchivedRatingLeaderboard";
|
||||
// export * from './getArchivedRatingMidnightLeaderboard';
|
||||
export * from './getTimeDaysAgo';
|
||||
export * from './isExplosive';
|
||||
export * from './mapDefinitions';
|
||||
export * from './modelDefinitions';
|
||||
export * from './normalizeBoundingBox';
|
||||
export * from "./getTimeDaysAgo";
|
||||
export * from "./isExplosive";
|
||||
export * from "./mapDefinitions";
|
||||
export * from "./modelDefinitions";
|
||||
export * from "./normalizeBoundingBox";
|
||||
// export * from './parseBkni';
|
||||
// export * from './patientFetch';
|
||||
export * from './patientFetchJSON';
|
||||
export * from './progressiveStat';
|
||||
export * from './provisionDefinitions';
|
||||
export * from './resolveDpm';
|
||||
export * from './resolvePenetrationCoefficient';
|
||||
export * from './reviews';
|
||||
export * from './skillDefinitions';
|
||||
export * from './sum';
|
||||
export * from './tankDefinitions';
|
||||
export * from './tankIcon';
|
||||
export * from './tankNames';
|
||||
export * from './unionBoundingBox';
|
||||
export * from './uniqueGuns';
|
||||
export * from './unwrapBlitzkitResponse';
|
||||
export * from './votes';
|
||||
export * from "./patientFetchJSON";
|
||||
export * from "./progressiveStat";
|
||||
export * from "./provisionDefinitions";
|
||||
export * from "./resolveDpm";
|
||||
export * from "./resolvePenetrationCoefficient";
|
||||
export * from "./reviews";
|
||||
export * from "./skillDefinitions";
|
||||
export * from "./sum";
|
||||
export * from "./tankDefinitions";
|
||||
export * from "./tankIcon";
|
||||
export * from "./tankNames";
|
||||
export * from "./unionBoundingBox";
|
||||
export * from "./uniqueGuns";
|
||||
export * from "./unwrapBlitzkitResponse";
|
||||
export * from "./votes";
|
||||
// export * from './withCORSProxy';
|
||||
export * from './createDefaultProvisions';
|
||||
export * from './gallery';
|
||||
export * from './metaSortTank';
|
||||
export * from './popularTanks';
|
||||
export * from './romanize';
|
||||
export * from './youtubers';
|
||||
export * from "./createDefaultProvisions";
|
||||
export * from "./gallery";
|
||||
export * from "./metaSortTank";
|
||||
export * from "./popularTanks";
|
||||
export * from "./romanize";
|
||||
export * from "./sluggify.ts";
|
||||
export * from "./youtubers";
|
||||
@@ -0,0 +1,16 @@
|
||||
import { deburr } from "lodash-es";
|
||||
|
||||
const nonAlphanumericRegex = /[^a-z0-9]/g;
|
||||
const multipleDashesRegex = /--+/g;
|
||||
const trailingDashRegex = /-$/g;
|
||||
const leadingDashRegex = /^-/g;
|
||||
|
||||
export function sluggify(value: string) {
|
||||
let slug = deburr(value).toLowerCase();
|
||||
slug = slug.replaceAll(nonAlphanumericRegex, "-");
|
||||
slug = slug.replaceAll(multipleDashesRegex, "-");
|
||||
slug = slug.replaceAll(trailingDashRegex, "");
|
||||
slug = slug.replaceAll(leadingDashRegex, "");
|
||||
|
||||
return slug;
|
||||
}
|
||||
@@ -3,6 +3,7 @@ export * from "./fisherYates";
|
||||
export * from "./formatCompact";
|
||||
export * from "./isNumber";
|
||||
export * from "./NaNFallback";
|
||||
export * from "./normalizeAngleDeg";
|
||||
export * from "./normalizeAngleRad";
|
||||
export * from "./normalToEuler";
|
||||
export * from "./numberToRomanNumeral";
|
||||
@@ -0,0 +1,6 @@
|
||||
export function normalizeAngleDeg(angle: number) {
|
||||
const newAngle = angle % 360;
|
||||
if (newAngle > 360) return newAngle - 360;
|
||||
if (newAngle < -360) return newAngle + 360;
|
||||
return newAngle;
|
||||
}
|
||||
@@ -13,7 +13,8 @@
|
||||
"hp": "{value}hp",
|
||||
"x": "x{value}",
|
||||
"percentage": "{value}%",
|
||||
"deg_s": "{value}°/s"
|
||||
"deg_s": "{value}°/s",
|
||||
"plus": "+{value}"
|
||||
},
|
||||
"gun_types": {
|
||||
"auto_loader": "Auto cargador",
|
||||
@@ -22,8 +23,8 @@
|
||||
},
|
||||
"shells": {
|
||||
"ap": "AP",
|
||||
"apcr": "APCR",
|
||||
"heat": "AEAC",
|
||||
"ap_cr": "APCR",
|
||||
"hc": "HEAT",
|
||||
"he": "AE"
|
||||
},
|
||||
"player_count_period": {
|
||||
@@ -668,6 +669,8 @@
|
||||
"count_singular": "1 tanque",
|
||||
"count_plural": "{count} tanks",
|
||||
"sorting_by": "Sorting by {name}",
|
||||
"clear": "Limpiar",
|
||||
"tier": "Tier {tier}",
|
||||
"no_tanks_found": {
|
||||
"body": "No se encontraron tanques.",
|
||||
"search_again": "Intenta buscar de nuevo.",
|
||||
@@ -814,7 +817,13 @@
|
||||
"next": "Next",
|
||||
"no_results": "Sin resultados"
|
||||
},
|
||||
"stats": "{correct} / {total} guessed correctly"
|
||||
"stats": "{correct} / {total} correct, {streak} streak",
|
||||
"help": {
|
||||
"title": "Partially reveal tank?",
|
||||
"description": "Reveals the tank without showing the name. This round will be considered incorrect and break your streak!",
|
||||
"cancel": "Cancelar",
|
||||
"reveal": "Reveal"
|
||||
}
|
||||
},
|
||||
"tankopedia": {
|
||||
"search": "Search a stat...",
|
||||
@@ -1135,10 +1144,12 @@
|
||||
"upgrade": "Mejorar"
|
||||
},
|
||||
"provisions": {
|
||||
"clear": "Limpiar"
|
||||
"clear": "Clear this tank",
|
||||
"clear_all": "Clear all tanks"
|
||||
},
|
||||
"consumables": {
|
||||
"clear": "Limpiar"
|
||||
"clear": "Clear this tank",
|
||||
"clear_all": "Clear all tanks"
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
@@ -13,7 +13,8 @@
|
||||
"hp": "{value}hp",
|
||||
"x": "x{value}",
|
||||
"percentage": "{value}%",
|
||||
"deg_s": "{value}°/s"
|
||||
"deg_s": "{value}°/s",
|
||||
"plus": "+{value}"
|
||||
},
|
||||
"gun_types": {
|
||||
"auto_loader": "Chargement auto",
|
||||
@@ -22,8 +23,8 @@
|
||||
},
|
||||
"shells": {
|
||||
"ap": "AP",
|
||||
"apcr": "APCR",
|
||||
"heat": "HEAT",
|
||||
"ap_cr": "APCR",
|
||||
"hc": "HEAT",
|
||||
"he": "HE"
|
||||
},
|
||||
"player_count_period": {
|
||||
@@ -612,7 +613,7 @@
|
||||
}
|
||||
},
|
||||
"rating": {
|
||||
"name": "rating",
|
||||
"name": "côtée",
|
||||
"description": "Rating player's statistics",
|
||||
"subcommands": {
|
||||
"today": {
|
||||
@@ -668,6 +669,8 @@
|
||||
"count_singular": "1 tank",
|
||||
"count_plural": "{count} tanks",
|
||||
"sorting_by": "Sorting by {name}",
|
||||
"clear": "Clear",
|
||||
"tier": "Tier {tier}",
|
||||
"no_tanks_found": {
|
||||
"body": "No tanks found.",
|
||||
"search_again": "Try searching again.",
|
||||
@@ -814,7 +817,13 @@
|
||||
"next": "Next",
|
||||
"no_results": "No results"
|
||||
},
|
||||
"stats": "{correct} / {total} guessed correctly"
|
||||
"stats": "{correct} / {total} guessed correctly",
|
||||
"help": {
|
||||
"title": "Partially reveal tank?",
|
||||
"description": "Reveals the tank without showing the name. This round will be considered incorrect and break your streak!",
|
||||
"cancel": "Cancel",
|
||||
"reveal": "Reveal"
|
||||
}
|
||||
},
|
||||
"tankopedia": {
|
||||
"search": "Search a stat...",
|
||||
@@ -1135,10 +1144,12 @@
|
||||
"upgrade": "Upgrade"
|
||||
},
|
||||
"provisions": {
|
||||
"clear": "Clear"
|
||||
"clear": "Clear",
|
||||
"clear_all": "Clear all tanks"
|
||||
},
|
||||
"consumables": {
|
||||
"clear": "Clear"
|
||||
"clear": "Clear",
|
||||
"clear_all": "Clear all tanks"
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
@@ -13,7 +13,8 @@
|
||||
"hp": "{value}hp",
|
||||
"x": "x{value}",
|
||||
"percentage": "{value}%",
|
||||
"deg_s": "{value}°/s"
|
||||
"deg_s": "{value}°/s",
|
||||
"plus": "+{value}"
|
||||
},
|
||||
"gun_types": {
|
||||
"auto_loader": "自動装填砲",
|
||||
@@ -22,8 +23,8 @@
|
||||
},
|
||||
"shells": {
|
||||
"ap": "AP",
|
||||
"apcr": "APCR",
|
||||
"heat": "HEAT",
|
||||
"ap_cr": "APCR",
|
||||
"hc": "HEAT",
|
||||
"he": "HE"
|
||||
},
|
||||
"player_count_period": {
|
||||
@@ -668,6 +669,8 @@
|
||||
"count_singular": "1 輌",
|
||||
"count_plural": "{count} tanks",
|
||||
"sorting_by": "Sorting by {name}",
|
||||
"clear": "クリア",
|
||||
"tier": "Tier {tier}",
|
||||
"no_tanks_found": {
|
||||
"body": "該当する車輌が存在しません。",
|
||||
"search_again": "もう一度検索してください。",
|
||||
@@ -814,7 +817,13 @@
|
||||
"next": "Next",
|
||||
"no_results": "該当なし"
|
||||
},
|
||||
"stats": "{correct} / {total} guessed correctly"
|
||||
"stats": "{correct} / {total} correct, {streak} streak",
|
||||
"help": {
|
||||
"title": "Partially reveal tank?",
|
||||
"description": "Reveals the tank without showing the name. This round will be considered incorrect and break your streak!",
|
||||
"cancel": "Cancel",
|
||||
"reveal": "Reveal"
|
||||
}
|
||||
},
|
||||
"tankopedia": {
|
||||
"search": "Search a stat...",
|
||||
@@ -1135,10 +1144,12 @@
|
||||
"upgrade": "最終装備"
|
||||
},
|
||||
"provisions": {
|
||||
"clear": "クリア"
|
||||
"clear": "Clear this tank",
|
||||
"clear_all": "Clear all tanks"
|
||||
},
|
||||
"consumables": {
|
||||
"clear": "クリア"
|
||||
"clear": "Clear this tank",
|
||||
"clear_all": "Clear all tanks"
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
@@ -13,7 +13,8 @@
|
||||
"hp": "{value}hp",
|
||||
"x": "x{value}",
|
||||
"percentage": "{value}%",
|
||||
"deg_s": "{value}°/s"
|
||||
"deg_s": "{value}°/s",
|
||||
"plus": "+{value}"
|
||||
},
|
||||
"gun_types": {
|
||||
"auto_loader": "Auto loader",
|
||||
@@ -22,8 +23,8 @@
|
||||
},
|
||||
"shells": {
|
||||
"ap": "AP",
|
||||
"apcr": "APCR",
|
||||
"heat": "HEAT",
|
||||
"ap_cr": "APCR",
|
||||
"hc": "HEAT",
|
||||
"he": "OB"
|
||||
},
|
||||
"player_count_period": {
|
||||
@@ -668,6 +669,8 @@
|
||||
"count_singular": "1 tank",
|
||||
"count_plural": "{count} tanks",
|
||||
"sorting_by": "Sorting by {name}",
|
||||
"clear": "Clear",
|
||||
"tier": "Tier {tier}",
|
||||
"no_tanks_found": {
|
||||
"body": "No tanks found.",
|
||||
"search_again": "Try searching again.",
|
||||
@@ -814,7 +817,13 @@
|
||||
"next": "Next",
|
||||
"no_results": "Brak wyników"
|
||||
},
|
||||
"stats": "{correct} / {total} guessed correctly"
|
||||
"stats": "{correct} / {total} correct, {streak} streak",
|
||||
"help": {
|
||||
"title": "Partially reveal tank?",
|
||||
"description": "Reveals the tank without showing the name. This round will be considered incorrect and break your streak!",
|
||||
"cancel": "Cancel",
|
||||
"reveal": "Reveal"
|
||||
}
|
||||
},
|
||||
"tankopedia": {
|
||||
"search": "Search a stat...",
|
||||
@@ -1135,10 +1144,12 @@
|
||||
"upgrade": "Upgrade"
|
||||
},
|
||||
"provisions": {
|
||||
"clear": "Clear"
|
||||
"clear": "Clear this tank",
|
||||
"clear_all": "Clear all tanks"
|
||||
},
|
||||
"consumables": {
|
||||
"clear": "Clear"
|
||||
"clear": "Clear this tank",
|
||||
"clear_all": "Clear all tanks"
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
@@ -13,7 +13,8 @@
|
||||
"hp": "{value}hp",
|
||||
"x": "x{value}",
|
||||
"percentage": "{value}%",
|
||||
"deg_s": "{value}°/s"
|
||||
"deg_s": "{value}°/s",
|
||||
"plus": "+{value}"
|
||||
},
|
||||
"gun_types": {
|
||||
"auto_loader": "Autocarregador",
|
||||
@@ -22,8 +23,8 @@
|
||||
},
|
||||
"shells": {
|
||||
"ap": "AP",
|
||||
"apcr": "APCR",
|
||||
"heat": "HEAT",
|
||||
"ap_cr": "APCR",
|
||||
"hc": "HEAT",
|
||||
"he": "HE"
|
||||
},
|
||||
"player_count_period": {
|
||||
@@ -668,6 +669,8 @@
|
||||
"count_singular": "1 tanque",
|
||||
"count_plural": "{count} tanks",
|
||||
"sorting_by": "Sorting by {name}",
|
||||
"clear": "Limpar",
|
||||
"tier": "Tier {tier}",
|
||||
"no_tanks_found": {
|
||||
"body": "Nenhum tanque encontrado.",
|
||||
"search_again": "Tente pesquisar novamente.",
|
||||
@@ -814,7 +817,13 @@
|
||||
"next": "Next",
|
||||
"no_results": "Sem resultados"
|
||||
},
|
||||
"stats": "{correct} / {total} guessed correctly"
|
||||
"stats": "{correct} / {total} correct, {streak} streak",
|
||||
"help": {
|
||||
"title": "Partially reveal tank?",
|
||||
"description": "Reveals the tank without showing the name. This round will be considered incorrect and break your streak!",
|
||||
"cancel": "Cancelar",
|
||||
"reveal": "Reveal"
|
||||
}
|
||||
},
|
||||
"tankopedia": {
|
||||
"search": "Search a stat...",
|
||||
@@ -1135,10 +1144,12 @@
|
||||
"upgrade": "Melhorar"
|
||||
},
|
||||
"provisions": {
|
||||
"clear": "Limpar"
|
||||
"clear": "Clear this tank",
|
||||
"clear_all": "Clear all tanks"
|
||||
},
|
||||
"consumables": {
|
||||
"clear": "Limpar"
|
||||
"clear": "Clear this tank",
|
||||
"clear_all": "Clear all tanks"
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
@@ -13,7 +13,8 @@
|
||||
"hp": "{value}оп",
|
||||
"x": "x{value}",
|
||||
"percentage": "{value}%",
|
||||
"deg_s": "{value}°/с"
|
||||
"deg_s": "{value}°/с",
|
||||
"plus": "+{value}"
|
||||
},
|
||||
"gun_types": {
|
||||
"auto_loader": "Барабан",
|
||||
@@ -22,8 +23,8 @@
|
||||
},
|
||||
"shells": {
|
||||
"ap": "ББ",
|
||||
"apcr": "БП",
|
||||
"heat": "КС",
|
||||
"ap_cr": "БП",
|
||||
"hc": "ОФ",
|
||||
"he": "ОФ"
|
||||
},
|
||||
"player_count_period": {
|
||||
@@ -668,6 +669,8 @@
|
||||
"count_singular": "1 танк",
|
||||
"count_plural": "Танков: {count}",
|
||||
"sorting_by": "Сортировать по {name}",
|
||||
"clear": "Очистить",
|
||||
"tier": " {tier} уровня",
|
||||
"no_tanks_found": {
|
||||
"body": "Танков не найдено.",
|
||||
"search_again": "Попробуйте повторить поиск.",
|
||||
@@ -814,7 +817,13 @@
|
||||
"next": "Следующий",
|
||||
"no_results": "Ничего не найденo"
|
||||
},
|
||||
"stats": "{correct} / {total} угадано верно"
|
||||
"stats": "{correct} / {total} правильно, серия: {streak}",
|
||||
"help": {
|
||||
"title": "Частично раскрыть танк?",
|
||||
"description": "Показывает танк не показывая название. Этот раунд будет считаться проигранным и прекратит серию!",
|
||||
"cancel": "Отмена",
|
||||
"reveal": "Раскрыть"
|
||||
}
|
||||
},
|
||||
"tankopedia": {
|
||||
"search": "Поиск характеристик...",
|
||||
@@ -1135,10 +1144,12 @@
|
||||
"upgrade": "Топ"
|
||||
},
|
||||
"provisions": {
|
||||
"clear": "Очистить"
|
||||
"clear": "Убрать",
|
||||
"clear_all": "Убрать со всех"
|
||||
},
|
||||
"consumables": {
|
||||
"clear": "Очистить"
|
||||
"clear": "Убрать",
|
||||
"clear_all": "Убрать со всех"
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
@@ -13,7 +13,8 @@
|
||||
"hp": "{value}од",
|
||||
"x": "x{value}",
|
||||
"percentage": "{value}%",
|
||||
"deg_s": "{value}град/c"
|
||||
"deg_s": "{value}град/c",
|
||||
"plus": "+{value}"
|
||||
},
|
||||
"gun_types": {
|
||||
"auto_loader": "Магазинна система заряджання",
|
||||
@@ -22,8 +23,8 @@
|
||||
},
|
||||
"shells": {
|
||||
"ap": "ББ",
|
||||
"apcr": "БП",
|
||||
"heat": "КС",
|
||||
"ap_cr": "APCR",
|
||||
"hc": "HEAT",
|
||||
"he": "ОФ"
|
||||
},
|
||||
"player_count_period": {
|
||||
@@ -668,6 +669,8 @@
|
||||
"count_singular": "1 танк",
|
||||
"count_plural": "Танків: {count} ",
|
||||
"sorting_by": "Відсортувати за {name}",
|
||||
"clear": "Clear",
|
||||
"tier": "Рівень {tier}",
|
||||
"no_tanks_found": {
|
||||
"body": "Нічого не знайдено.",
|
||||
"search_again": "Спробуйте шукати заново.",
|
||||
@@ -814,7 +817,13 @@
|
||||
"next": "Next",
|
||||
"no_results": "Немає результатів"
|
||||
},
|
||||
"stats": "{correct} / {total} guessed correctly"
|
||||
"stats": "{correct} / {total} correct, {streak} streak",
|
||||
"help": {
|
||||
"title": "Partially reveal tank?",
|
||||
"description": "Reveals the tank without showing the name. This round will be considered incorrect and break your streak!",
|
||||
"cancel": "Cancel",
|
||||
"reveal": "Reveal"
|
||||
}
|
||||
},
|
||||
"tankopedia": {
|
||||
"search": "Search a stat...",
|
||||
@@ -1135,10 +1144,12 @@
|
||||
"upgrade": "Upgrade"
|
||||
},
|
||||
"provisions": {
|
||||
"clear": "Clear"
|
||||
"clear": "Clear this tank",
|
||||
"clear_all": "Clear all tanks"
|
||||
},
|
||||
"consumables": {
|
||||
"clear": "Clear"
|
||||
"clear": "Clear this tank",
|
||||
"clear_all": "Clear all tanks"
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
@@ -13,7 +13,8 @@
|
||||
"hp": "{value} 生命值",
|
||||
"x": "x{value}",
|
||||
"percentage": "{value}%",
|
||||
"deg_s": "{value}度°/秒"
|
||||
"deg_s": "{value}度°/秒",
|
||||
"plus": "+{value}"
|
||||
},
|
||||
"gun_types": {
|
||||
"auto_loader": "弹夹型坦克",
|
||||
@@ -22,8 +23,8 @@
|
||||
},
|
||||
"shells": {
|
||||
"ap": "穿甲弹",
|
||||
"apcr": "硬式复合穿甲弹",
|
||||
"heat": "反战车高爆弹",
|
||||
"ap_cr": "APCR",
|
||||
"hc": "HEAT",
|
||||
"he": "高爆弹"
|
||||
},
|
||||
"player_count_period": {
|
||||
@@ -668,6 +669,8 @@
|
||||
"count_singular": "1辆战车",
|
||||
"count_plural": "{count} 辆坦克",
|
||||
"sorting_by": "按 {name} 排序",
|
||||
"clear": "清除",
|
||||
"tier": "{tier} 阶",
|
||||
"no_tanks_found": {
|
||||
"body": "找不到战车。",
|
||||
"search_again": "请尝试重新搜索。",
|
||||
@@ -804,7 +807,7 @@
|
||||
},
|
||||
"guess": {
|
||||
"name": "猜测",
|
||||
"button": "What could it be?",
|
||||
"button": "这会是什么?",
|
||||
"description": "坦克剪影小游戏",
|
||||
"seo_description": "看剪影猜坦克",
|
||||
"search": {
|
||||
@@ -814,7 +817,13 @@
|
||||
"next": "下一个",
|
||||
"no_results": "沒有結果"
|
||||
},
|
||||
"stats": "猜对了 {correct} / {total}"
|
||||
"stats": "猜对了 {correct} / {total}",
|
||||
"help": {
|
||||
"title": "Partially reveal tank?",
|
||||
"description": "Reveals the tank without showing the name. This round will be considered incorrect and break your streak!",
|
||||
"cancel": "取消",
|
||||
"reveal": "Reveal"
|
||||
}
|
||||
},
|
||||
"tankopedia": {
|
||||
"search": "搜索属性……",
|
||||
@@ -1135,10 +1144,12 @@
|
||||
"upgrade": "顶级配置"
|
||||
},
|
||||
"provisions": {
|
||||
"clear": "清除"
|
||||
"clear": "清除",
|
||||
"clear_all": "Clear all tanks"
|
||||
},
|
||||
"consumables": {
|
||||
"clear": "清除"
|
||||
"clear": "清除",
|
||||
"clear_all": "Clear all tanks"
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
@@ -31,6 +31,7 @@
|
||||
"steam-user": "^5.2.3",
|
||||
"three": "^0.180.0",
|
||||
"ts-proto": "^2.7.7",
|
||||
"unzipit": "^1.4.3",
|
||||
"yaml": "^2.8.1"
|
||||
},
|
||||
"private": true,
|
||||
|
||||
@@ -5,10 +5,12 @@ import { vfs } from "./constants";
|
||||
export async function boosterIcons() {
|
||||
console.log("Building booster icons...");
|
||||
|
||||
using uploader = new AssetUploader("booster icons");
|
||||
const boosterFiles = (vfs.dir(`Data/Gfx/Shared/boosters`)).filter(
|
||||
(file) => !file.includes("@2x.txt") && !file.startsWith("texture0")
|
||||
);
|
||||
const uploader = new AssetUploader("booster icons");
|
||||
const boosterFiles = vfs
|
||||
.dir("Data/Gfx/Shared/boosters")
|
||||
.filter(
|
||||
(file) => !file.includes("@2x.txt") && !file.startsWith("texture0")
|
||||
);
|
||||
const image = sharp(
|
||||
await vfs.file(`Data/Gfx/Shared/boosters/texture0.packed.webp`)
|
||||
);
|
||||
|
||||
@@ -1,12 +1,33 @@
|
||||
import { assertSecret } from "@blitzkit/core";
|
||||
import { SteamVFS } from "../core/steam/vfs";
|
||||
import { AbstractVFS } from "../core/vfs/abstract";
|
||||
import { SteamVFS } from "../core/vfs/steam";
|
||||
import { ZipVFS } from "../core/vfs/zip";
|
||||
|
||||
const APP = 444200;
|
||||
const DEPOT = 444202;
|
||||
const steamPattern = /steam:(\d+)\/(\d+)/;
|
||||
const zipPattern = /zip:(.+)/;
|
||||
|
||||
export const vfs = await new SteamVFS(
|
||||
assertSecret(import.meta.env.STEAM_USERNAME),
|
||||
assertSecret(import.meta.env.STEAM_PASSWORD),
|
||||
APP,
|
||||
DEPOT
|
||||
).init();
|
||||
const source = Bun.argv
|
||||
.find((arg) => arg.startsWith("--source="))
|
||||
?.split("=")[1];
|
||||
|
||||
let resolved: AbstractVFS;
|
||||
|
||||
if (!source) {
|
||||
throw new Error("No source specified");
|
||||
} else if (steamPattern.test(source)) {
|
||||
const [, app, depot] = source.match(steamPattern)!.map(Number);
|
||||
|
||||
resolved = await new SteamVFS(
|
||||
assertSecret(import.meta.env.STEAM_USERNAME),
|
||||
assertSecret(import.meta.env.STEAM_PASSWORD),
|
||||
app,
|
||||
depot
|
||||
).init();
|
||||
} else if (zipPattern.test(source)) {
|
||||
const [, url] = source.match(zipPattern)!;
|
||||
resolved = await new ZipVFS(url).init();
|
||||
} else {
|
||||
throw new Error("No valid source specified");
|
||||
}
|
||||
|
||||
export const vfs = resolved;
|
||||
@@ -62,7 +62,7 @@ export async function consumableProvisionIcons() {
|
||||
.replace(".psd", "")
|
||||
.replace(".txt", "");
|
||||
|
||||
if (vfs.has(`Data/${configPath}.packed.webp`)) {
|
||||
if (vfs.resolve(`Data/${configPath}.packed.webp`)) {
|
||||
const image = sharp(
|
||||
await vfs.file(`Data/${configPath}.packed.webp`)
|
||||
);
|
||||
@@ -131,7 +131,7 @@ export async function consumableProvisionIcons() {
|
||||
.replace(".psd", "")
|
||||
.replace(".txt", "");
|
||||
|
||||
if (vfs.has(`Data/${configPath}.packed.webp`)) {
|
||||
if (vfs.resolve(`Data/${configPath}.packed.webp`)) {
|
||||
const image = sharp(
|
||||
await vfs.file(`Data/${configPath}.packed.webp`)
|
||||
);
|
||||
|
||||
@@ -534,11 +534,11 @@ const blitzModuleTypeToBlitzkit: Record<keyof BlitzModuleType, ModuleType> = {
|
||||
export async function definitions() {
|
||||
console.log("Building definitions...");
|
||||
|
||||
using uploader = new AssetUploader("definitions");
|
||||
const uploader = new AssetUploader("definitions");
|
||||
const gameDefinitions: GameDefinitions = {
|
||||
version: (await vfs.text('Data/version.txt')).split(" ")[0],
|
||||
version: (await vfs.text("Data/version.txt")).split(" ")[0],
|
||||
nations: (
|
||||
await vfs.yaml<AvailableNationsYaml>('Data/available_nations.yaml')
|
||||
await vfs.yaml<AvailableNationsYaml>("Data/available_nations.yaml")
|
||||
).available_nations,
|
||||
gameModes: {},
|
||||
roles: {},
|
||||
@@ -561,10 +561,12 @@ export async function definitions() {
|
||||
[TankClass.TANK_DESTROYER]: { skills: [] },
|
||||
},
|
||||
};
|
||||
const nations = vfs.dir('Data/XML/item_defs/vehicles').filter((nation) => nation !== "common")
|
||||
const nations = vfs
|
||||
.dir("Data/XML/item_defs/vehicles")
|
||||
.filter((nation) => nation !== "common");
|
||||
const tankStringIdMap: Record<string, number> = {};
|
||||
const optionalDevices = await vfs.xml<{ root: OptionalDevices }>(
|
||||
'Data/XML/item_defs/vehicles/common/optional_devices.xml'
|
||||
"Data/XML/item_defs/vehicles/common/optional_devices.xml"
|
||||
);
|
||||
const stringsI18n: Record<string, Record<string, string>> = {};
|
||||
|
||||
@@ -617,9 +619,7 @@ export async function definitions() {
|
||||
const provisions: ProvisionsCommon = {};
|
||||
|
||||
for (const match of (
|
||||
await vfs.text(
|
||||
`Data/XML/item_defs/vehicles/common/consumables/list.xml`
|
||||
)
|
||||
await vfs.text(`Data/XML/item_defs/vehicles/common/consumables/list.xml`)
|
||||
).matchAll(/<items path="(.+)\.xml"\/>/g)) {
|
||||
if (match[1] === "prototypes") continue;
|
||||
|
||||
@@ -634,9 +634,7 @@ export async function definitions() {
|
||||
}
|
||||
|
||||
for (const match of (
|
||||
await vfs.text(
|
||||
`Data/XML/item_defs/vehicles/common/provisions/list.xml`
|
||||
)
|
||||
await vfs.text(`Data/XML/item_defs/vehicles/common/provisions/list.xml`)
|
||||
).matchAll(/<items path="(.+)\.xml"\/>/g)) {
|
||||
if (match[1] === "prototypes") continue;
|
||||
|
||||
@@ -1559,87 +1557,85 @@ export async function definitions() {
|
||||
const includeRaw = consumable.vehicleFilter?.include.vehicle;
|
||||
const excludeRaw = consumable.vehicleFilter?.exclude?.vehicle;
|
||||
|
||||
if (!entry.game_mode_exclusive) {
|
||||
if (includeRaw) {
|
||||
entry.include = [];
|
||||
if (includeRaw) {
|
||||
entry.include = [];
|
||||
|
||||
if ("minLevel" in includeRaw) {
|
||||
entry.include.push({
|
||||
filter_type: {
|
||||
$case: "tiers",
|
||||
value: {
|
||||
min: includeRaw.minLevel,
|
||||
max: includeRaw.maxLevel,
|
||||
},
|
||||
if ("minLevel" in includeRaw) {
|
||||
entry.include.push({
|
||||
filter_type: {
|
||||
$case: "tiers",
|
||||
value: {
|
||||
min: includeRaw.minLevel,
|
||||
max: includeRaw.maxLevel,
|
||||
},
|
||||
});
|
||||
} else if ("name" in includeRaw) {
|
||||
entry.include.push({
|
||||
filter_type: {
|
||||
$case: "ids",
|
||||
value: {
|
||||
ids: includeRaw.name.split(/ +/).map((key) => {
|
||||
return tankStringIdMap[key];
|
||||
}),
|
||||
},
|
||||
},
|
||||
});
|
||||
} else if ("name" in includeRaw) {
|
||||
entry.include.push({
|
||||
filter_type: {
|
||||
$case: "ids",
|
||||
value: {
|
||||
ids: includeRaw.name.split(/ +/).map((key) => {
|
||||
return tankStringIdMap[key];
|
||||
}),
|
||||
},
|
||||
});
|
||||
} else throw new SyntaxError("Unhandled include type");
|
||||
},
|
||||
});
|
||||
} else throw new SyntaxError("Unhandled include type");
|
||||
|
||||
if (consumable.vehicleFilter?.include.nations) {
|
||||
entry.include.push({
|
||||
filter_type: {
|
||||
$case: "nations",
|
||||
value: {
|
||||
nations: consumable.vehicleFilter.include.nations.split(" "),
|
||||
},
|
||||
if (consumable.vehicleFilter?.include.nations) {
|
||||
entry.include.push({
|
||||
filter_type: {
|
||||
$case: "nations",
|
||||
value: {
|
||||
nations: consumable.vehicleFilter.include.nations.split(" "),
|
||||
},
|
||||
});
|
||||
}
|
||||
},
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
if (excludeRaw) {
|
||||
entry.exclude = [];
|
||||
if (excludeRaw) {
|
||||
entry.exclude = [];
|
||||
|
||||
if ("name" in excludeRaw) {
|
||||
entry.exclude!.push({
|
||||
filter_type: {
|
||||
$case: "ids",
|
||||
value: {
|
||||
ids: excludeRaw.name.split(/ +/).map((key) => {
|
||||
return tankStringIdMap[key];
|
||||
}),
|
||||
},
|
||||
if ("name" in excludeRaw) {
|
||||
entry.exclude!.push({
|
||||
filter_type: {
|
||||
$case: "ids",
|
||||
value: {
|
||||
ids: excludeRaw.name.split(/ +/).map((key) => {
|
||||
return tankStringIdMap[key];
|
||||
}),
|
||||
},
|
||||
});
|
||||
} else if ("extendedTags" in excludeRaw) {
|
||||
entry.exclude!.push({
|
||||
filter_type: {
|
||||
$case: "categories",
|
||||
value: {
|
||||
categories: excludeRaw.extendedTags
|
||||
.split(" ")
|
||||
.map(
|
||||
(item) =>
|
||||
blitzTankFilterDefinitionCategoryToBlitzkit[
|
||||
item as BlitzTankFilterDefinitionCategory
|
||||
]
|
||||
),
|
||||
},
|
||||
},
|
||||
});
|
||||
} else if ("extendedTags" in excludeRaw) {
|
||||
entry.exclude!.push({
|
||||
filter_type: {
|
||||
$case: "categories",
|
||||
value: {
|
||||
categories: excludeRaw.extendedTags
|
||||
.split(" ")
|
||||
.map(
|
||||
(item) =>
|
||||
blitzTankFilterDefinitionCategoryToBlitzkit[
|
||||
item as BlitzTankFilterDefinitionCategory
|
||||
]
|
||||
),
|
||||
},
|
||||
});
|
||||
} else throw new SyntaxError("Unhandled exclude type");
|
||||
},
|
||||
});
|
||||
} else throw new SyntaxError("Unhandled exclude type");
|
||||
|
||||
if (consumable.vehicleFilter?.exclude?.nations) {
|
||||
entry.exclude!.push({
|
||||
filter_type: {
|
||||
$case: "nations",
|
||||
value: {
|
||||
nations: consumable.vehicleFilter.exclude.nations.split(" "),
|
||||
},
|
||||
if (consumable.vehicleFilter?.exclude?.nations) {
|
||||
entry.exclude!.push({
|
||||
filter_type: {
|
||||
$case: "nations",
|
||||
value: {
|
||||
nations: consumable.vehicleFilter.exclude.nations.split(" "),
|
||||
},
|
||||
});
|
||||
}
|
||||
},
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
@@ -1659,87 +1655,85 @@ export async function definitions() {
|
||||
const includeRaw = provision.vehicleFilter?.include.vehicle;
|
||||
const excludeRaw = provision.vehicleFilter?.exclude?.vehicle;
|
||||
|
||||
if (!entry.game_mode_exclusive) {
|
||||
if (includeRaw) {
|
||||
entry.include = [];
|
||||
if (includeRaw) {
|
||||
entry.include = [];
|
||||
|
||||
if ("minLevel" in includeRaw) {
|
||||
entry.include.push({
|
||||
filter_type: {
|
||||
$case: "tiers",
|
||||
value: {
|
||||
min: includeRaw.minLevel,
|
||||
max: includeRaw.maxLevel,
|
||||
},
|
||||
if ("minLevel" in includeRaw) {
|
||||
entry.include.push({
|
||||
filter_type: {
|
||||
$case: "tiers",
|
||||
value: {
|
||||
min: includeRaw.minLevel,
|
||||
max: includeRaw.maxLevel,
|
||||
},
|
||||
});
|
||||
} else if ("name" in includeRaw) {
|
||||
entry.include.push({
|
||||
filter_type: {
|
||||
$case: "ids",
|
||||
value: {
|
||||
ids: includeRaw.name.split(/ +/).map((key) => {
|
||||
return tankStringIdMap[key];
|
||||
}),
|
||||
},
|
||||
},
|
||||
});
|
||||
} else if ("name" in includeRaw) {
|
||||
entry.include.push({
|
||||
filter_type: {
|
||||
$case: "ids",
|
||||
value: {
|
||||
ids: includeRaw.name.split(/ +/).map((key) => {
|
||||
return tankStringIdMap[key];
|
||||
}),
|
||||
},
|
||||
});
|
||||
} else throw new SyntaxError("Unhandled include type");
|
||||
},
|
||||
});
|
||||
} else throw new SyntaxError("Unhandled include type");
|
||||
|
||||
if (provision.vehicleFilter?.include.nations) {
|
||||
entry.include.push({
|
||||
filter_type: {
|
||||
$case: "nations",
|
||||
value: {
|
||||
nations: provision.vehicleFilter.include.nations.split(" "),
|
||||
},
|
||||
if (provision.vehicleFilter?.include.nations) {
|
||||
entry.include.push({
|
||||
filter_type: {
|
||||
$case: "nations",
|
||||
value: {
|
||||
nations: provision.vehicleFilter.include.nations.split(" "),
|
||||
},
|
||||
});
|
||||
}
|
||||
},
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
if (excludeRaw) {
|
||||
entry.exclude = [];
|
||||
if (excludeRaw) {
|
||||
entry.exclude = [];
|
||||
|
||||
if ("name" in excludeRaw) {
|
||||
entry.exclude!.push({
|
||||
filter_type: {
|
||||
$case: "ids",
|
||||
value: {
|
||||
ids: excludeRaw.name
|
||||
.split(/ +/)
|
||||
.map((key) => tankStringIdMap[key]),
|
||||
},
|
||||
if ("name" in excludeRaw) {
|
||||
entry.exclude!.push({
|
||||
filter_type: {
|
||||
$case: "ids",
|
||||
value: {
|
||||
ids: excludeRaw.name
|
||||
.split(/ +/)
|
||||
.map((key) => tankStringIdMap[key]),
|
||||
},
|
||||
});
|
||||
} else if ("extendedTags" in excludeRaw) {
|
||||
entry.exclude!.push({
|
||||
filter_type: {
|
||||
$case: "categories",
|
||||
value: {
|
||||
categories: excludeRaw.extendedTags
|
||||
.split(" ")
|
||||
.map(
|
||||
(item) =>
|
||||
blitzTankFilterDefinitionCategoryToBlitzkit[
|
||||
item as BlitzTankFilterDefinitionCategory
|
||||
]
|
||||
),
|
||||
},
|
||||
},
|
||||
});
|
||||
} else if ("extendedTags" in excludeRaw) {
|
||||
entry.exclude!.push({
|
||||
filter_type: {
|
||||
$case: "categories",
|
||||
value: {
|
||||
categories: excludeRaw.extendedTags
|
||||
.split(" ")
|
||||
.map(
|
||||
(item) =>
|
||||
blitzTankFilterDefinitionCategoryToBlitzkit[
|
||||
item as BlitzTankFilterDefinitionCategory
|
||||
]
|
||||
),
|
||||
},
|
||||
});
|
||||
} else throw new SyntaxError("Unhandled exclude type");
|
||||
},
|
||||
});
|
||||
} else throw new SyntaxError("Unhandled exclude type");
|
||||
|
||||
if (provision.vehicleFilter?.exclude?.nations) {
|
||||
entry.exclude!.push({
|
||||
filter_type: {
|
||||
$case: "nations",
|
||||
value: {
|
||||
nations: provision.vehicleFilter.exclude.nations.split(" "),
|
||||
},
|
||||
if (provision.vehicleFilter?.exclude?.nations) {
|
||||
entry.exclude!.push({
|
||||
filter_type: {
|
||||
$case: "nations",
|
||||
value: {
|
||||
nations: provision.vehicleFilter.exclude.nations.split(" "),
|
||||
},
|
||||
});
|
||||
}
|
||||
},
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -28,7 +28,7 @@ export async function skillIcons() {
|
||||
const avatar = await vfs.xml<{ root: Avatar }>(
|
||||
`Data/XML/item_defs/tankmen/avatar.xml`
|
||||
);
|
||||
using uploader = new AssetUploader("skill icons");
|
||||
const uploader = new AssetUploader("skill icons");
|
||||
|
||||
for (const key in avatar.root.skills) {
|
||||
const skill = avatar.root.skills[key];
|
||||
|
||||
@@ -2,12 +2,15 @@ import { build } from "esbuild";
|
||||
import { cp, readdir, rm } from "fs/promises";
|
||||
import { argv } from "process";
|
||||
|
||||
const dev = argv.includes("--dev");
|
||||
|
||||
const projectDir = "../..";
|
||||
const srcRoot = `${projectDir}/packages/bot`;
|
||||
const distRoot = `${projectDir}/dist/bot`;
|
||||
const modulesRoot = "../../node_modules";
|
||||
const modulesRoot = dev
|
||||
? "../../packages/bot/node_modules"
|
||||
: "../../node_modules";
|
||||
const workers = await readdir(`${srcRoot}/src/workers`);
|
||||
const dev = argv.includes("--dev");
|
||||
|
||||
await rm(distRoot, { recursive: true, force: true });
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@ import {
|
||||
} from "@blitzkit/core";
|
||||
import { Accessor, Document, Node, Scene } from "@gltf-transform/core";
|
||||
import { times } from "lodash-es";
|
||||
import { SteamVFS } from "../steam/vfs";
|
||||
import { SteamVFS } from "../vfs/vfs";
|
||||
import {
|
||||
vertexAttributeGLTFName,
|
||||
vertexAttributeGltfVectorSizes,
|
||||
|
||||
@@ -9,7 +9,7 @@ import { Document, Material, Node, Scene } from "@gltf-transform/core";
|
||||
import { dedup, prune } from "@gltf-transform/functions";
|
||||
import { times } from "lodash-es";
|
||||
import { dirname } from "path";
|
||||
import { SteamVFS } from "../../steam/vfs";
|
||||
import { SteamVFS } from "../../vfs/vfs";
|
||||
import { readBaseColor } from "../readBaseColor";
|
||||
import { readNormal } from "../readNormal";
|
||||
import { readRoughnessMetallic } from "../readRoughnessMetallic";
|
||||
|
||||
@@ -3,7 +3,7 @@ import { vfs } from "../../../buildAssets/constants";
|
||||
|
||||
export async function readTexture(path: string) {
|
||||
const ddsTexturePath = path.replace(".tex", ".dx11.dds");
|
||||
const isDds = vfs.has(ddsTexturePath);
|
||||
const isDds = vfs.resolve(ddsTexturePath);
|
||||
const resolvedTexturePath = isDds
|
||||
? ddsTexturePath
|
||||
: ddsTexturePath.replace(".dds", ".pvr");
|
||||
|
||||
@@ -0,0 +1,84 @@
|
||||
import { readDVPL } from "@blitzkit/core";
|
||||
import { XMLParser } from "fast-xml-parser";
|
||||
import { normalize } from "path/posix";
|
||||
import { parse } from "yaml";
|
||||
|
||||
export abstract class AbstractVFS {
|
||||
textDecoder = new TextDecoder();
|
||||
private xmlParser = new XMLParser();
|
||||
|
||||
abstract init(): Promise<typeof this>;
|
||||
|
||||
abstract dispose(): void;
|
||||
|
||||
abstract has(path: string): boolean;
|
||||
|
||||
abstract raw(path: string): Promise<Uint8Array>;
|
||||
|
||||
abstract paths(): string[];
|
||||
|
||||
resolve(path: string) {
|
||||
const normalized = normalize(path);
|
||||
if (this.has(normalized)) return normalized;
|
||||
|
||||
const dvplPath = `${normalized}.dvpl`;
|
||||
if (this.has(dvplPath)) return dvplPath;
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
assert(path: string) {
|
||||
const resolved = this.resolve(path);
|
||||
|
||||
if (resolved === null) throw new Error(`File not found: ${path}`);
|
||||
|
||||
return resolved;
|
||||
}
|
||||
|
||||
async file(file: string) {
|
||||
const resolved = this.assert(file);
|
||||
const raw = await this.raw(resolved);
|
||||
let buffer = raw;
|
||||
|
||||
if (resolved.endsWith(".dvpl")) {
|
||||
buffer = new Uint8Array(readDVPL(Buffer.from(raw)));
|
||||
}
|
||||
|
||||
return buffer;
|
||||
}
|
||||
|
||||
dir(path: string) {
|
||||
const parentSegments = path.split("/").length;
|
||||
const children = new Set<string>();
|
||||
|
||||
for (const child of this.paths()) {
|
||||
if (!child.startsWith(path) || child === path) continue;
|
||||
|
||||
const childSegments = child.split("/");
|
||||
const nextSegment = childSegments[parentSegments];
|
||||
|
||||
children.add(nextSegment);
|
||||
}
|
||||
|
||||
return Array.from(children);
|
||||
}
|
||||
|
||||
async text(path: string) {
|
||||
const file = await this.file(path);
|
||||
return this.textDecoder.decode(file);
|
||||
}
|
||||
|
||||
async yaml<Type>(path: string) {
|
||||
const file = await this.text(path);
|
||||
return parse(file) as Type;
|
||||
}
|
||||
|
||||
async xml<Type>(path: string) {
|
||||
const file = await this.text(path);
|
||||
return this.xmlParser.parse(file) as Type;
|
||||
}
|
||||
|
||||
[Symbol.dispose]() {
|
||||
this.dispose();
|
||||
}
|
||||
}
|
||||
@@ -1,8 +1,5 @@
|
||||
import { readDVPL } from "@blitzkit/core/src/blitz";
|
||||
import { XMLParser } from "fast-xml-parser";
|
||||
import { normalize } from "path/posix";
|
||||
import SteamUser, { EConnectionProtocol } from "steam-user";
|
||||
import { parse } from "yaml";
|
||||
import { AbstractVFS } from "./abstract";
|
||||
|
||||
interface SteamManifestFile {
|
||||
chunks: {
|
||||
@@ -33,11 +30,8 @@ interface SteamManifest {
|
||||
crc_clear: number;
|
||||
}
|
||||
|
||||
export class SteamVFS {
|
||||
export class SteamVFS extends AbstractVFS {
|
||||
private steam = new SteamUser({ protocol: EConnectionProtocol.TCP });
|
||||
private textDecoder = new TextDecoder();
|
||||
private xmlParser = new XMLParser();
|
||||
|
||||
private manifest: Map<string, SteamManifestFile> = new Map();
|
||||
|
||||
constructor(
|
||||
@@ -45,7 +39,9 @@ export class SteamVFS {
|
||||
private password: string,
|
||||
private app: number,
|
||||
private depot: number
|
||||
) {}
|
||||
) {
|
||||
super();
|
||||
}
|
||||
|
||||
async init() {
|
||||
this.steam.logOn({
|
||||
@@ -71,10 +67,8 @@ export class SteamVFS {
|
||||
);
|
||||
});
|
||||
|
||||
const paths: string[] = [];
|
||||
for (const file of manifest.files) {
|
||||
const path = file.filename.replaceAll("\\", "/");
|
||||
paths.push(path);
|
||||
this.manifest.set(path, file);
|
||||
}
|
||||
|
||||
@@ -82,74 +76,23 @@ export class SteamVFS {
|
||||
}
|
||||
|
||||
has(path: string) {
|
||||
const normalized = normalize(path);
|
||||
const dvplPath = `${normalized}.dvpl`;
|
||||
|
||||
return (
|
||||
(this.manifest.has(dvplPath) && dvplPath) ||
|
||||
(this.manifest.has(normalized) && normalized)
|
||||
);
|
||||
return this.manifest.has(path);
|
||||
}
|
||||
|
||||
assert(requested: string) {
|
||||
const path = this.has(requested);
|
||||
|
||||
if (!path) throw new Error(`File not found: ${requested}`);
|
||||
|
||||
return path;
|
||||
}
|
||||
|
||||
dir(path: string) {
|
||||
const parentSegments = path.split("/").length;
|
||||
const children: string[] = [];
|
||||
|
||||
for (const child of this.manifest.keys()) {
|
||||
const childSegments = child.split("/");
|
||||
|
||||
if (
|
||||
child.startsWith(path) &&
|
||||
parentSegments + 1 === childSegments.length
|
||||
) {
|
||||
children.push(childSegments.at(-1)!);
|
||||
}
|
||||
}
|
||||
|
||||
return children;
|
||||
}
|
||||
|
||||
async file(requested: string) {
|
||||
const path = this.assert(requested);
|
||||
async raw(path: string) {
|
||||
const fileManifest = this.manifest.get(path)!;
|
||||
const downloaded: { type: "complete"; file: Buffer } =
|
||||
// @ts-expect-error
|
||||
await this.steam.downloadFile(this.app, this.depot, fileManifest);
|
||||
let buffer = downloaded.file;
|
||||
|
||||
if (path.endsWith(".dvpl")) buffer = readDVPL(downloaded.file);
|
||||
|
||||
return new Uint8Array(buffer);
|
||||
return new Uint8Array(downloaded.file);
|
||||
}
|
||||
|
||||
async text(path: string) {
|
||||
const file = await this.file(path);
|
||||
return this.textDecoder.decode(file);
|
||||
}
|
||||
|
||||
async yaml<Type>(path: string) {
|
||||
const file = await this.text(path);
|
||||
return parse(file) as Type;
|
||||
}
|
||||
|
||||
async xml<Type>(path: string) {
|
||||
const file = await this.text(path);
|
||||
return this.xmlParser.parse(file) as Type;
|
||||
paths() {
|
||||
return Array.from(this.manifest.keys());
|
||||
}
|
||||
|
||||
dispose() {
|
||||
this.steam.logOff();
|
||||
}
|
||||
|
||||
[Symbol.dispose]() {
|
||||
this.dispose();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,38 @@
|
||||
import { normalize } from "path/posix";
|
||||
import { HTTPRangeReader, unzip, ZipEntry } from "unzipit";
|
||||
import { AbstractVFS } from "./abstract";
|
||||
|
||||
export class ZipVFS extends AbstractVFS {
|
||||
entries = new Map<string, ZipEntry>();
|
||||
|
||||
constructor(private url: string, private root = "app/") {
|
||||
super();
|
||||
}
|
||||
|
||||
async init() {
|
||||
const reader = new HTTPRangeReader(this.url);
|
||||
const { entries } = await unzip(reader);
|
||||
|
||||
for (const entry of Object.values(entries)) {
|
||||
const normalized = normalize(entry.name.slice(this.root.length));
|
||||
this.entries.set(normalized, entry);
|
||||
}
|
||||
|
||||
return this;
|
||||
}
|
||||
|
||||
has(path: string) {
|
||||
return this.entries.has(path);
|
||||
}
|
||||
|
||||
async raw(path: string) {
|
||||
const arrayBuffer = await this.entries.get(path)!.arrayBuffer();
|
||||
return new Uint8Array(arrayBuffer);
|
||||
}
|
||||
|
||||
paths() {
|
||||
return Array.from(this.entries.keys());
|
||||
}
|
||||
|
||||
dispose() {}
|
||||
}
|
||||
@@ -1,21 +1,16 @@
|
||||
import { exec as execSync } from "child_process";
|
||||
import { execFile } from "child_process";
|
||||
import { existsSync } from "fs";
|
||||
import { readdir, rm } from "fs/promises";
|
||||
import { promisify } from "util";
|
||||
import { mkdir, readdir, rm, writeFile } from "fs/promises";
|
||||
|
||||
const MAX_COMMAND_LENGTH = 2 ** 11;
|
||||
const TS_PROTO_EXECUTABLE_LOCATIONS = [
|
||||
"./node_modules/.bin/protoc-gen-ts_proto",
|
||||
"../../node_modules/.bin/protoc-gen-ts_proto",
|
||||
];
|
||||
|
||||
const roots = [
|
||||
// "../../packages/core/src/protos",
|
||||
const ROOTS = [
|
||||
"../../packages/closed/protos",
|
||||
"../../packages/website-ue/src/protos",
|
||||
];
|
||||
|
||||
const exec = promisify(execSync);
|
||||
|
||||
let tsProtoExecutableLocation: string | undefined = undefined;
|
||||
|
||||
for (const location of TS_PROTO_EXECUTABLE_LOCATIONS) {
|
||||
@@ -36,42 +31,38 @@ if (!tsProtoExecutableLocation) {
|
||||
);
|
||||
}
|
||||
|
||||
for (const root of roots) {
|
||||
await mkdir("temp", { recursive: true });
|
||||
|
||||
for (const root of ROOTS) {
|
||||
let args = "";
|
||||
|
||||
for (const include of ROOTS) {
|
||||
args += `-I=${include}\n`;
|
||||
}
|
||||
|
||||
args += `--plugin=${tsProtoExecutableLocation}\n`;
|
||||
args += "--ts_proto_opt=esModuleInterop=true\n";
|
||||
args += "--ts_proto_opt=oneof=unions-value\n";
|
||||
args += "--ts_proto_opt=unrecognizedEnum=false\n";
|
||||
args += "--ts_proto_opt=snakeToCamel=false\n";
|
||||
args += `--ts_proto_out=${root}\n`;
|
||||
|
||||
const filesRaw = await readdir(`${root}`);
|
||||
const files: string[] = [];
|
||||
|
||||
for (const file of filesRaw) {
|
||||
if (file.endsWith(".proto")) files.push(file);
|
||||
if (file.endsWith(".proto")) {
|
||||
files.push(file);
|
||||
args += `${root}/${file}\n`;
|
||||
}
|
||||
|
||||
if (file.endsWith(".ts")) await rm(`${root}/${file}`);
|
||||
}
|
||||
|
||||
while (files.length > 0) {
|
||||
let command = [
|
||||
"protoc",
|
||||
`--plugin=${tsProtoExecutableLocation}`,
|
||||
"--ts_proto_opt=esModuleInterop=true",
|
||||
"--ts_proto_opt=oneof=unions-value",
|
||||
// "--ts_proto_opt=removeEnumPrefix=true",
|
||||
"--ts_proto_opt=unrecognizedEnum=false",
|
||||
"--ts_proto_opt=snakeToCamel=false",
|
||||
`--ts_proto_out=${root}`,
|
||||
`-I=${root}`,
|
||||
].join(" ");
|
||||
|
||||
while (true) {
|
||||
if (files.length === 0) break;
|
||||
|
||||
const file = files.at(-1);
|
||||
const newLine = ` ${root}/${file}`;
|
||||
|
||||
if (command.length + newLine.length < MAX_COMMAND_LENGTH) {
|
||||
command += newLine;
|
||||
files.pop();
|
||||
} else {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
await exec(command);
|
||||
}
|
||||
await writeFile("temp/protoc.txt", args);
|
||||
execFile("protoc", ["@temp/protoc.txt"], (error, stdout, stderr) => {
|
||||
if (error) throw new Error(error.message);
|
||||
if (stderr) console.error(stderr);
|
||||
if (stdout) console.log(stdout);
|
||||
});
|
||||
}
|
||||
@@ -0,0 +1,104 @@
|
||||
import node from "@astrojs/node";
|
||||
import react from "@astrojs/react";
|
||||
import locales from "@blitzkit/i18n/locales.json";
|
||||
import strings from "@blitzkit/i18n/strings/en.json";
|
||||
import { mauve, mauveDark } from "@radix-ui/colors";
|
||||
import favicons from "astro-favicons";
|
||||
import { defineConfig } from "astro/config";
|
||||
import packageJSON from "../../package.json";
|
||||
|
||||
const POSSIBLE_TARGETS = ["app", "web"];
|
||||
|
||||
const target = process.env.PUBLIC_TARGET;
|
||||
|
||||
if (!target || !POSSIBLE_TARGETS.includes(target)) {
|
||||
throw new Error("Invalid target");
|
||||
}
|
||||
|
||||
export default defineConfig({
|
||||
devToolbar: { enabled: false },
|
||||
|
||||
vite: {
|
||||
server: { allowedHosts: [] },
|
||||
|
||||
esbuild: {
|
||||
minifyIdentifiers: true,
|
||||
minifySyntax: false,
|
||||
minifyWhitespace: true,
|
||||
},
|
||||
},
|
||||
output: target === "web" ? "static" : "server",
|
||||
site: "https://blitzkit.app",
|
||||
outDir: "../../dist/website",
|
||||
prefetch: { defaultStrategy: "hover", prefetchAll: true },
|
||||
|
||||
// build: { concurrency: 4 },
|
||||
adapter: target === "app" ? node({ mode: "standalone" }) : undefined,
|
||||
|
||||
integrations: [
|
||||
favicons({
|
||||
name: strings.common.name,
|
||||
short_name: strings.common.name,
|
||||
|
||||
background: mauveDark.mauve1,
|
||||
themes: [mauve.mauve1, mauveDark.mauve1],
|
||||
appleStatusBarStyle: "black-translucent",
|
||||
|
||||
version: packageJSON.version,
|
||||
|
||||
// shortcuts: Object.values(tools)
|
||||
// .filter((tool) => !tool.disabled && !tool.href)
|
||||
// .map((tool) => {
|
||||
// const stringId = (tool.strings ??
|
||||
// tool.id) as keyof typeof strings.website.tools;
|
||||
|
||||
// return {
|
||||
// name: strings.website.tools[stringId].name,
|
||||
// name_localized: wrapper(
|
||||
// (strings) => strings.website.tools[stringId].name
|
||||
// ),
|
||||
// description: strings.website.tools[stringId].description,
|
||||
// description_localized: wrapper(
|
||||
// (strings) => strings.website.tools[stringId].description
|
||||
// ),
|
||||
// short_name: strings.website.tools[stringId].name,
|
||||
// short_name_localized: wrapper(
|
||||
// (strings) => strings.website.tools[stringId].name
|
||||
// ),
|
||||
// url: `/${tool.id}`,
|
||||
// icon: `public/assets/tools/${tool.id}.webp`,
|
||||
// };
|
||||
// }),
|
||||
|
||||
manifest: {
|
||||
// description: strings.website.home.seo_description,
|
||||
// description_localized: wrapper(
|
||||
// (strings) => strings.website.home.seo_description
|
||||
// ),
|
||||
|
||||
dir: "ltr",
|
||||
categories: ["utilities", "games", "developer", "developer tools"],
|
||||
|
||||
id: "com.tresabhi.blitzkit",
|
||||
start_url: "/",
|
||||
launch_handler: { client_mode: "navigate-new" },
|
||||
display: "fullscreen",
|
||||
display_override: ["fullscreen", "standalone", "minimal-ui"],
|
||||
|
||||
lang: locales.default,
|
||||
orientation: "any",
|
||||
},
|
||||
|
||||
icons: {
|
||||
windows: true,
|
||||
android: true,
|
||||
appleIcon: true,
|
||||
appleStartup: true,
|
||||
favicons: true,
|
||||
yandex: true,
|
||||
},
|
||||
}),
|
||||
|
||||
react(),
|
||||
],
|
||||
});
|
||||
@@ -0,0 +1,47 @@
|
||||
{
|
||||
"name": "@blitzkit/website-ue",
|
||||
"type": "module",
|
||||
"scripts": {
|
||||
"dev": "PUBLIC_TARGET=web astro dev",
|
||||
"build": "PUBLIC_TARGET=web astro build",
|
||||
"preview": "PUBLIC_TARGET=web astro preview",
|
||||
"lint": "PUBLIC_TARGET=web astro check",
|
||||
"astro": "astro"
|
||||
},
|
||||
"dependencies": {
|
||||
"@astrojs/check": "^0.9.4",
|
||||
"@astrojs/node": "^9.4.4",
|
||||
"@astrojs/react": "^4.4.0",
|
||||
"@astrolib/seo": "^1.0.0-beta.8",
|
||||
"@blitzkit/closed": "workspace:*",
|
||||
"@blitzkit/core": "workspace:*",
|
||||
"@blitzkit/i18n": "workspace:*",
|
||||
"@bufbuild/protobuf": "^2.10.2",
|
||||
"@fontsource-variable/roboto-flex": "^5.2.8",
|
||||
"@fontsource-variable/roboto-mono": "^5.2.8",
|
||||
"@radix-ui/colors": "^3.0.0",
|
||||
"@radix-ui/react-icons": "^1.3.2",
|
||||
"@react-three/drei": "^10.7.6",
|
||||
"@react-three/fiber": "^9.4.0",
|
||||
"@types/lodash-es": "^4.17.12",
|
||||
"@types/react": "^19.2.2",
|
||||
"@types/react-dom": "^19.2.2",
|
||||
"@types/three": "^0.180.0",
|
||||
"@vite-pwa/astro": "^1.1.0",
|
||||
"astro": "^5.14.4",
|
||||
"astro-favicons": "^3.1.5",
|
||||
"fuzzysort": "^3.1.0",
|
||||
"immer": "^10.1.3",
|
||||
"lodash-es": "^4.17.21",
|
||||
"quicklime": "^1.2.0",
|
||||
"react": "^19.2.0",
|
||||
"react-dom": "^19.2.0",
|
||||
"react-promise-suspense": "^0.3.4",
|
||||
"three": "^0.180.0",
|
||||
"three-stdlib": "^2.36.0",
|
||||
"typescript": "^5.9.3",
|
||||
"varuna": "workspace:*",
|
||||
"vite": "^7.1.9",
|
||||
"yaml": "^2.8.1"
|
||||
}
|
||||
}
|
||||
|
After Width: | Height: | Size: 481 KiB |
|
After Width: | Height: | Size: 170 KiB |
|
After Width: | Height: | Size: 443 KiB |
|
After Width: | Height: | Size: 330 KiB |
|
After Width: | Height: | Size: 715 KiB |
|
After Width: | Height: | Size: 144 KiB |
|
After Width: | Height: | Size: 676 KiB |
|
After Width: | Height: | Size: 188 KiB |
|
After Width: | Height: | Size: 367 KiB |
|
After Width: | Height: | Size: 1.0 MiB |
|
After Width: | Height: | Size: 274 KiB |
|
After Width: | Height: | Size: 346 KiB |
|
After Width: | Height: | Size: 208 KiB |
|
After Width: | Height: | Size: 406 KiB |
|
After Width: | Height: | Size: 360 KiB |
|
After Width: | Height: | Size: 193 KiB |
|
After Width: | Height: | Size: 200 KiB |
@@ -0,0 +1,46 @@
|
||||
<svg width="426" height="426" viewBox="0 0 426 426" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M416.628 244.997L235.625 372.974C223.13 381.809 202.87 381.809 190.375 372.974L9.37173 244.997C3.1239 240.58 -3.95076e-06 234.79 0 229V196.6H426V229C426 234.79 422.876 240.58 416.628 244.997Z" fill="#0D2847"/>
|
||||
<path d="M416.628 180.603L235.625 52.6262C223.13 43.7913 202.87 43.7913 190.375 52.6262L9.37172 180.603C-3.12391 189.438 -3.12391 203.762 9.37173 212.597L190.375 340.574C202.87 349.409 223.13 349.409 235.625 340.574L416.628 212.597C429.124 203.762 429.124 189.438 416.628 180.603Z" fill="#D9D9D9"/>
|
||||
<path d="M416.628 180.603L235.625 52.6262C223.13 43.7913 202.87 43.7913 190.375 52.6262L9.37172 180.603C-3.12391 189.438 -3.12391 203.762 9.37173 212.597L190.375 340.574C202.87 349.409 223.13 349.409 235.625 340.574L416.628 212.597C429.124 203.762 429.124 189.438 416.628 180.603Z" fill="url(#paint0_linear_764_240)"/>
|
||||
<path d="M416.628 180.603L235.625 52.6262C223.13 43.7913 202.87 43.7913 190.375 52.6262L9.37172 180.603C-3.12391 189.438 -3.12391 203.762 9.37173 212.597L190.375 340.574C202.87 349.409 223.13 349.409 235.625 340.574L416.628 212.597C429.124 203.762 429.124 189.438 416.628 180.603Z" fill="url(#paint1_linear_764_240)"/>
|
||||
<g filter="url(#filter0_d_764_240)">
|
||||
<path d="M197.056 150.108L201.368 153.051L290.596 213.945L306.6 202.599L310.832 199.599L289.153 184.23L288.86 177.31L335.236 182.298L351.706 170.622L359.102 165.378L288.049 158.111L286.355 118L263.968 133.871L265.867 167.722L217.292 135.762L197.056 150.108Z" fill="#111927" fill-opacity="0.5" shape-rendering="crispEdges"/>
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M192.905 289L74.2242 204.714L70 201.714L116.393 168.767C129.906 159.17 143.124 153.539 156.048 151.875C168.971 150.211 180.919 153.275 191.893 161.069C198.702 165.905 202.718 171.006 203.941 176.372C205.165 181.658 204.302 186.506 201.354 190.918L201.692 191.158C208.978 188.301 216.935 187.286 225.563 188.113C234.247 188.9 242.613 192.151 250.66 197.866C261.803 205.779 266.398 214.825 264.446 225.004C262.551 235.142 254.96 244.929 241.672 254.366L192.905 289ZM221.999 242.08L200.456 257.38L163.905 231.422L185.448 216.123C192.007 211.465 198.473 209.23 204.846 209.42C211.22 209.529 217.193 211.562 222.764 215.519C228.392 219.516 231.31 223.797 231.521 228.364C231.732 232.85 228.558 237.422 221.999 242.08ZM165.937 205.64L146.77 219.252L114.693 196.472L133.861 182.859C140.363 178.241 146.435 175.887 152.076 175.798C157.717 175.708 163.07 177.462 168.135 181.059C173.256 184.696 175.809 188.557 175.796 192.643C175.726 196.69 172.44 201.022 165.937 205.64Z" fill="#111927" fill-opacity="0.5" shape-rendering="crispEdges"/>
|
||||
<path d="M197.056 156.108L290.596 219.945L310.832 205.599L306.6 202.599L289.153 190.23L288.86 183.31L335.236 188.298L359.102 171.378L351.706 170.622L288.049 164.111L286.355 124L263.968 139.871L265.867 173.722L217.292 141.762L201.368 153.051L197.056 156.108Z" fill="#111927" fill-opacity="0.5" shape-rendering="crispEdges"/>
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M192.905 295L70 207.714L74.2242 204.714L116.393 174.767C129.906 165.17 143.124 159.539 156.048 157.875C168.971 156.211 180.919 159.275 191.893 167.069C198.702 171.905 202.718 177.006 203.941 182.372C205.165 187.658 204.302 192.506 201.354 196.918L201.692 197.158C208.978 194.301 216.935 193.286 225.563 194.113C234.247 194.9 242.613 198.151 250.66 203.866C261.803 211.779 266.398 220.825 264.446 231.004C262.551 241.142 254.96 250.929 241.672 260.366L192.905 295ZM221.999 248.08L200.456 263.38L163.905 237.422L185.448 222.123C192.007 217.465 198.473 215.23 204.846 215.42C211.22 215.529 217.193 217.562 222.764 221.519C228.392 225.516 231.31 229.797 231.521 234.364C231.732 238.85 228.558 243.422 221.999 248.08ZM165.937 211.64L146.77 225.252L114.693 202.472L133.861 188.859C140.363 184.241 146.435 181.887 152.076 181.798C157.717 181.708 163.07 183.462 168.135 187.059C173.256 190.696 175.809 194.557 175.796 198.643C175.726 202.69 172.44 207.022 165.937 211.64Z" fill="#111927" fill-opacity="0.5" shape-rendering="crispEdges"/>
|
||||
<path d="M310.832 199.599L306.6 202.599L310.832 205.599V199.599Z" fill="#111927" fill-opacity="0.5" shape-rendering="crispEdges"/>
|
||||
<path d="M359.102 165.378L351.706 170.622L359.102 171.378V165.378Z" fill="#111927" fill-opacity="0.5" shape-rendering="crispEdges"/>
|
||||
<path d="M201.368 153.051L197.056 150.108V156.108L201.368 153.051Z" fill="#111927" fill-opacity="0.5" shape-rendering="crispEdges"/>
|
||||
<path d="M74.2242 204.714L70 201.714V207.714L74.2242 204.714Z" fill="#111927" fill-opacity="0.5" shape-rendering="crispEdges"/>
|
||||
</g>
|
||||
<path d="M197.056 150.108L290.596 213.945L310.832 199.599L289.153 184.23L288.86 177.31L335.236 182.298L359.102 165.378L288.049 158.111L286.355 118L263.968 133.871L265.867 167.722L217.292 135.762L197.056 150.108Z" fill="url(#paint2_linear_764_240)"/>
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M192.905 289L70 201.714L116.393 168.767C129.906 159.17 143.124 153.539 156.048 151.875C168.971 150.211 180.919 153.275 191.893 161.069C198.702 165.905 202.718 171.006 203.941 176.372C205.165 181.658 204.302 186.506 201.354 190.918L201.692 191.158C208.978 188.301 216.935 187.286 225.563 188.113C234.247 188.9 242.613 192.151 250.66 197.866C261.803 205.779 266.398 214.825 264.446 225.004C262.551 235.142 254.96 244.929 241.672 254.366L192.905 289ZM221.999 242.08L200.456 257.38L163.905 231.422L185.448 216.123C192.007 211.465 198.473 209.23 204.846 209.42C211.22 209.529 217.193 211.562 222.764 215.519C228.392 219.516 231.31 223.797 231.521 228.364C231.732 232.85 228.558 237.422 221.999 242.08ZM165.937 205.64L146.77 219.252L114.693 196.472L133.861 182.859C140.363 178.241 146.435 175.887 152.076 175.798C157.717 175.708 163.07 177.462 168.135 181.059C173.256 184.696 175.809 188.557 175.796 192.643C175.726 196.69 172.44 201.022 165.937 205.64Z" fill="url(#paint3_linear_764_240)"/>
|
||||
<defs>
|
||||
<filter id="filter0_d_764_240" x="66" y="116" width="297.103" height="185" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB">
|
||||
<feFlood flood-opacity="0" result="BackgroundImageFix"/>
|
||||
<feColorMatrix in="SourceAlpha" type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" result="hardAlpha"/>
|
||||
<feOffset dy="2"/>
|
||||
<feGaussianBlur stdDeviation="2"/>
|
||||
<feComposite in2="hardAlpha" operator="out"/>
|
||||
<feColorMatrix type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.25 0"/>
|
||||
<feBlend mode="normal" in2="BackgroundImageFix" result="effect1_dropShadow_764_240"/>
|
||||
<feBlend mode="normal" in="SourceGraphic" in2="effect1_dropShadow_764_240" result="shape"/>
|
||||
</filter>
|
||||
<linearGradient id="paint0_linear_764_240" x1="213" y1="46" x2="213" y2="347.2" gradientUnits="userSpaceOnUse">
|
||||
<stop stop-color="#10243E"/>
|
||||
<stop offset="1" stop-color="#0F1B2D"/>
|
||||
</linearGradient>
|
||||
<linearGradient id="paint1_linear_764_240" x1="127.008" y1="96.51" x2="241.48" y2="334.974" gradientUnits="userSpaceOnUse">
|
||||
<stop stop-color="#262A65"/>
|
||||
<stop offset="1" stop-color="#104D87"/>
|
||||
</linearGradient>
|
||||
<linearGradient id="paint2_linear_764_240" x1="215" y1="98.5" x2="299.5" y2="210.5" gradientUnits="userSpaceOnUse">
|
||||
<stop offset="0.379808" stop-color="#C2E6FF"/>
|
||||
<stop offset="0.706731" stop-color="#70B8FF"/>
|
||||
</linearGradient>
|
||||
<linearGradient id="paint3_linear_764_240" x1="215" y1="98.5" x2="299.5" y2="210.5" gradientUnits="userSpaceOnUse">
|
||||
<stop offset="0.379808" stop-color="#C2E6FF"/>
|
||||
<stop offset="0.706731" stop-color="#70B8FF"/>
|
||||
</linearGradient>
|
||||
</defs>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 7.3 KiB |
@@ -0,0 +1,3 @@
|
||||
<meta charset="utf-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<link rel="sitemap" href="/sitemap-index.xml" />
|
||||
@@ -0,0 +1,56 @@
|
||||
---
|
||||
import "@fontsource-variable/roboto-flex";
|
||||
import "@fontsource-variable/roboto-mono";
|
||||
---
|
||||
|
||||
<style is:global>
|
||||
@import "@radix-ui/colors/mauve-dark.css";
|
||||
@import "@radix-ui/colors/mauve-alpha.css";
|
||||
|
||||
body {
|
||||
--space-0: 0.0625rem;
|
||||
--space-1: 0.125rem;
|
||||
--space-2: 0.25rem;
|
||||
--space-3: 0.5rem;
|
||||
--space-4: 1rem;
|
||||
--space-5: 2rem;
|
||||
--space-6: 4rem;
|
||||
--space-7: 8rem;
|
||||
--space-8: 16rem;
|
||||
--space-9: 32rem;
|
||||
|
||||
--weight-thin: 100;
|
||||
--weight-extra-light: 200;
|
||||
--weight-light: 300;
|
||||
--weight-regular: 400;
|
||||
--weight-medium: 500;
|
||||
--weight-semibold: 600;
|
||||
--weight-bold: 700;
|
||||
--weight-extra-bold: 800;
|
||||
--weight-black: 900;
|
||||
|
||||
--font-size-regular: var(--space-4);
|
||||
|
||||
--max-size: max(100vw, 100vh);
|
||||
|
||||
--outline-interactive: solid var(--space-1) var(--gray-5);
|
||||
--outline-focus: var(--space-1) solid var(--accent-6);
|
||||
|
||||
--shadow-cavity:
|
||||
inset var(--space-1) var(--space-1) var(--space-1) var(--gray-2),
|
||||
inset calc(var(--space-1) * -1) calc(var(--space-1) * -1) var(--space-1)
|
||||
var(--gray-4);
|
||||
--shadow-focus: 0 0 var(--space-3) var(--accent-4);
|
||||
|
||||
background-color: var(--gray-1);
|
||||
color: var(--gray-12);
|
||||
font-family: "Roboto Flex";
|
||||
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
body {
|
||||
margin: 0;
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,4 @@
|
||||
.code {
|
||||
font-family: "Roboto Mono";
|
||||
color: red;
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
import type { ComponentProps } from "react";
|
||||
import "./index.css";
|
||||
|
||||
export interface CodeProps extends ComponentProps<"code"> {}
|
||||
|
||||
export function Code({ className }: CodeProps) {
|
||||
return <code className={className?????} {...props} />;
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
---
|
||||
import type { Color } from "../pages/styles/colors/[accent].css";
|
||||
|
||||
interface Props {
|
||||
color: Color;
|
||||
alias: string;
|
||||
}
|
||||
|
||||
const { color, alias } = Astro.props;
|
||||
|
||||
let styles = "";
|
||||
|
||||
styles += ":root{";
|
||||
|
||||
for (let i = 0; i < 12; i++) {
|
||||
const n = i + 1;
|
||||
styles += `--${alias}-${n}:var(--${color}-${n});`;
|
||||
}
|
||||
|
||||
styles += "}";
|
||||
---
|
||||
|
||||
<style set:html={styles}></style>
|
||||
@@ -0,0 +1,25 @@
|
||||
---
|
||||
import * as colors from "@radix-ui/colors";
|
||||
import type { Color } from "../pages/styles/colors/[accent].css";
|
||||
|
||||
interface Props {
|
||||
color: Color;
|
||||
}
|
||||
|
||||
const { color } = Astro.props;
|
||||
const scale = colors[`${color}Dark`];
|
||||
|
||||
let styles = "";
|
||||
|
||||
styles += ":root{";
|
||||
|
||||
for (let i = 0; i < 12; i++) {
|
||||
const n = i + 1;
|
||||
const value = scale[`${color}${n}` as keyof typeof scale];
|
||||
styles += `--${color}-${n}:${value};`;
|
||||
}
|
||||
|
||||
styles += "}";
|
||||
---
|
||||
|
||||
<style set:html={styles}></style>
|
||||
@@ -0,0 +1,90 @@
|
||||
---
|
||||
import { MagnifyingGlassIcon } from "@radix-ui/react-icons";
|
||||
import { BlitzKitIcon } from "../icons/BlitzKit";
|
||||
import { Code } from "./Code";
|
||||
import { TextField } from "./TextField";
|
||||
|
||||
const strings = { home: { search: "test" } };
|
||||
---
|
||||
|
||||
<style>
|
||||
.home-hero {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: end;
|
||||
align-items: center;
|
||||
padding: 0 var(--space-4);
|
||||
position: relative;
|
||||
|
||||
.wallpaper {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
height: calc(100% - var(--space-5) / 2);
|
||||
|
||||
z-index: -1;
|
||||
|
||||
background-image: url(/assets/home-hero.webp);
|
||||
background-size: cover;
|
||||
background-position: top;
|
||||
|
||||
.gradient {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
flex-direction: column;
|
||||
gap: var(--space-7);
|
||||
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
|
||||
background: linear-gradient(transparent, var(--gray-1));
|
||||
}
|
||||
}
|
||||
|
||||
.name {
|
||||
margin: var(--space-6) 0;
|
||||
|
||||
.icon-wrapper {
|
||||
position: relative;
|
||||
|
||||
width: var(--space-6);
|
||||
height: var(--space-6);
|
||||
|
||||
.icon {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
.version {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
right: 0;
|
||||
transform: translateX(100%);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.text-field {
|
||||
width: 100%;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
<div class="home-hero">
|
||||
<div class="wallpaper">
|
||||
<div class="gradient"></div>
|
||||
</div>
|
||||
|
||||
<div class="name">
|
||||
<div class="icon-wrapper">
|
||||
<BlitzKitIcon className="icon" />
|
||||
<Code className="version">2.0</Code>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<TextField placeholder={strings.home.search}>
|
||||
<MagnifyingGlassIcon />
|
||||
</TextField>
|
||||
</div>
|
||||
@@ -0,0 +1,26 @@
|
||||
import type { CharacteristicOutput } from "../core/tankopedia/characteristics";
|
||||
import type { CharacteristicRenderConfig } from "../core/tankopedia/characteristicsOrder";
|
||||
import { renderCharacteristic } from "../core/tankopedia/renderCharacteristic";
|
||||
|
||||
interface Props {
|
||||
characteristic: CharacteristicOutput;
|
||||
others: CharacteristicOutput[];
|
||||
config: CharacteristicRenderConfig;
|
||||
}
|
||||
|
||||
export function TankopediaCharacteristic({
|
||||
characteristic,
|
||||
others,
|
||||
config,
|
||||
}: Props) {
|
||||
if (characteristic === null) return null;
|
||||
|
||||
const rendered = renderCharacteristic(characteristic, config);
|
||||
|
||||
return (
|
||||
<p>
|
||||
{config.name}: {rendered} {config.units && `${config.units}`} (1 /{" "}
|
||||
{others.length})
|
||||
</p>
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
interface Props {
|
||||
toy: string;
|
||||
}
|
||||
|
||||
export function TankopediaToy({ toy }: Props) {
|
||||
return <p>toy: {toy}</p>;
|
||||
}
|
||||
@@ -0,0 +1,51 @@
|
||||
.text-field {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
|
||||
gap: var(--space-3);
|
||||
margin: 0 var(--space-4);
|
||||
|
||||
border-radius: var(--max-size);
|
||||
|
||||
background-color: var(--gray-3);
|
||||
outline: var(--outline-interactive);
|
||||
box-shadow: var(--shadow-cavity);
|
||||
|
||||
font-size: var(--font-size-regular);
|
||||
color: var(--gray-11);
|
||||
|
||||
&[data-has-icon="true"] {
|
||||
padding-left: var(--space-3);
|
||||
}
|
||||
|
||||
&:focus-within {
|
||||
outline: var(--outline-focus);
|
||||
box-shadow: var(--shadow-focus);
|
||||
}
|
||||
|
||||
svg {
|
||||
width: 1em;
|
||||
height: 1em;
|
||||
}
|
||||
|
||||
input {
|
||||
min-width: 0;
|
||||
|
||||
background: none;
|
||||
border: none;
|
||||
|
||||
font-size: inherit;
|
||||
font-weight: medium;
|
||||
padding: var(--space-3) 0;
|
||||
|
||||
color: var(--gray-12);
|
||||
|
||||
&::placeholder {
|
||||
color: var(--gray-11);
|
||||
}
|
||||
|
||||
&:focus {
|
||||
outline: none;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
import type { ComponentProps, ReactNode } from "react";
|
||||
import "./index.css";
|
||||
|
||||
export interface TextFieldProps extends ComponentProps<"input"> {
|
||||
children?: ReactNode;
|
||||
}
|
||||
|
||||
export function TextField({ children, ...props }: TextFieldProps) {
|
||||
return (
|
||||
<div className="text-field" data-has-icon={children !== undefined}>
|
||||
{children}
|
||||
<input {...props} />
|
||||
</div>
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
import type { CatalogItemAccessor } from "@blitzkit/closed";
|
||||
|
||||
export abstract class AbstractAPI {
|
||||
abstract tanks(): Promise<Tanks>;
|
||||
|
||||
abstract tankList(): Promise<TankList>;
|
||||
|
||||
abstract strings(
|
||||
locale: string,
|
||||
prefix?: string
|
||||
): Promise<Record<string, string>>;
|
||||
|
||||
abstract tank(id: string): Promise<Tank>;
|
||||
|
||||
abstract avatars(): Promise<CatalogItemAccessor[]>;
|
||||
abstract avatar(id: string): Promise<CatalogItemAccessor>;
|
||||
|
||||
abstract backgrounds(): Promise<CatalogItemAccessor[]>;
|
||||
abstract background(id: string): Promise<CatalogItemAccessor>;
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
import { fetchPB } from "@blitzkit/core";
|
||||
import { Tank } from "../../protos/tank";
|
||||
import { TankList } from "../../protos/tank_list";
|
||||
import { Tanks } from "../../protos/tanks";
|
||||
import { AbstractAPI } from "./abstract";
|
||||
|
||||
export class ClientAPI extends AbstractAPI {
|
||||
tanks() {
|
||||
return fetchPB("/api/tanks/all.pb", Tanks);
|
||||
}
|
||||
|
||||
tankList() {
|
||||
return fetchPB("/api/tanks/list.pb", TankList);
|
||||
}
|
||||
|
||||
tank(id: string) {
|
||||
return fetchPB(`/api/tanks/${id}.pb`, Tank);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
import { assertSecret } from "@blitzkit/core";
|
||||
import type { AbstractAPI } from "./abstract";
|
||||
|
||||
let dynamicAPI: AbstractAPI;
|
||||
|
||||
if (typeof window === "undefined") {
|
||||
const { ProxyClient } = await import("@blitzkit/closed");
|
||||
const { ServerAPI } = await import("./server");
|
||||
|
||||
const proxyClient = await new ProxyClient(
|
||||
assertSecret(import.meta.env.WOTB_SERVER)
|
||||
).handshake();
|
||||
const metadata = await proxyClient.metadata();
|
||||
|
||||
dynamicAPI = new ServerAPI(metadata);
|
||||
} else {
|
||||
const { ClientAPI } = await import("./client");
|
||||
|
||||
dynamicAPI = new ClientAPI();
|
||||
}
|
||||
|
||||
export const api = dynamicAPI;
|
||||
@@ -0,0 +1,165 @@
|
||||
import type { MetadataAccessor } from "@blitzkit/closed";
|
||||
import { sluggify } from "@blitzkit/core";
|
||||
import type { RemoteStorageComponent } from "@protos/blitz_static_remote_storage_component";
|
||||
import { parse } from "yaml";
|
||||
import type { Tank } from "../../protos/tank";
|
||||
import type { TankList, TankListEntry } from "../../protos/tank_list";
|
||||
import type { Tanks } from "../../protos/tanks";
|
||||
import { AbstractAPI } from "./abstract";
|
||||
|
||||
if (typeof window !== "undefined") {
|
||||
throw new Error("ServerAPI is being evaluated in the browser");
|
||||
}
|
||||
|
||||
interface LocalizationConfig {
|
||||
namespaces: string[];
|
||||
}
|
||||
|
||||
export class ServerAPI extends AbstractAPI {
|
||||
constructor(private metadata: MetadataAccessor) {
|
||||
super();
|
||||
}
|
||||
|
||||
async strings(locale: string) {
|
||||
const group = this.metadata.group("ClientConfigsEntity");
|
||||
|
||||
if (group.length !== 1) {
|
||||
throw new RangeError(
|
||||
`Don't know how to handle ${group.length} ClientConfigsEntities`
|
||||
);
|
||||
}
|
||||
|
||||
const clientConfig = this.metadata.item(group[0].id);
|
||||
const localizationResources = clientConfig.LocalizationResources();
|
||||
|
||||
if (!localizationResources.remote_storage) {
|
||||
throw new Error("Localization resources not found");
|
||||
}
|
||||
|
||||
let remoteStorage: RemoteStorageComponent | undefined = undefined;
|
||||
|
||||
for (const candidateId of localizationResources.remote_storage
|
||||
.remote_urls) {
|
||||
const item = this.metadata.item(candidateId);
|
||||
const candidate = item.RemoteStorage();
|
||||
|
||||
if (
|
||||
remoteStorage === undefined ||
|
||||
candidate.download_speed_weight > remoteStorage.download_speed_weight
|
||||
) {
|
||||
remoteStorage = candidate;
|
||||
}
|
||||
}
|
||||
|
||||
if (remoteStorage === undefined) {
|
||||
throw new Error("No suitable production remote storage found");
|
||||
}
|
||||
|
||||
const strings: Record<string, string> = {};
|
||||
const configPath = `${remoteStorage.url}/${remoteStorage.relative_path}/config.yaml`;
|
||||
|
||||
try {
|
||||
const config = await fetch(configPath)
|
||||
.then((response) => response.text())
|
||||
.then((text) => parse(text) as LocalizationConfig);
|
||||
|
||||
for (const namespace of config.namespaces) {
|
||||
Object.assign(
|
||||
strings,
|
||||
await fetch(
|
||||
`${remoteStorage.url}/${remoteStorage.relative_path}/${namespace}/${locale}.yaml`
|
||||
)
|
||||
.then((response) => response.text())
|
||||
.then((text) => {
|
||||
const strings: Record<string, string> = {};
|
||||
const parsed = parse(text) as Record<string, string>;
|
||||
|
||||
for (const key in parsed) {
|
||||
strings[key] = parsed[key].replaceAll('\\"', '"');
|
||||
}
|
||||
|
||||
return strings;
|
||||
})
|
||||
);
|
||||
}
|
||||
} catch (error) {
|
||||
console.warn(
|
||||
`Failed to fetch config from ${configPath}. Returning empty strings. This will throw an error in production. Error:`,
|
||||
error
|
||||
);
|
||||
}
|
||||
|
||||
return strings;
|
||||
}
|
||||
|
||||
_tankList: TankList | undefined;
|
||||
async tankList() {
|
||||
if (this._tankList === undefined) {
|
||||
const group = this.metadata.group("TankEntity");
|
||||
const list: TankListEntry[] = [];
|
||||
const strings = await this.strings("en");
|
||||
|
||||
for (const item of group) {
|
||||
const tankCatalog = item.TankCatalog();
|
||||
|
||||
if (!tankCatalog.name) continue;
|
||||
|
||||
const name = strings[tankCatalog.name.value];
|
||||
|
||||
if (!name) continue;
|
||||
|
||||
const id = item.name;
|
||||
const slug = sluggify(name);
|
||||
|
||||
list.push({ id, slug });
|
||||
}
|
||||
|
||||
this._tankList = { list };
|
||||
}
|
||||
|
||||
return this._tankList;
|
||||
}
|
||||
|
||||
async tanks() {
|
||||
const tankList = await this.tankList();
|
||||
const data: Tanks = { tanks: {} };
|
||||
|
||||
for (const { id } of tankList.list) {
|
||||
data.tanks[id] = await this.tank(id);
|
||||
}
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
async tank(id: string) {
|
||||
const tankList = await this.tankList();
|
||||
const tankListEntry = tankList.list.find((tank) => tank.id === id);
|
||||
|
||||
if (!tankListEntry) {
|
||||
throw new Error(`Tank with id ${id} not found`);
|
||||
}
|
||||
|
||||
const { slug } = tankListEntry;
|
||||
const item = this.metadata.item(`TankEntity.${id}`);
|
||||
const tank = item.TankCatalog();
|
||||
const compensation = item.Compensation();
|
||||
|
||||
return { tank, compensation, slug } satisfies Tank;
|
||||
}
|
||||
|
||||
async avatars() {
|
||||
return this.metadata.group("ProfileAvatarEntity");
|
||||
}
|
||||
|
||||
async avatar(id: string) {
|
||||
return this.metadata.item(`ProfileAvatarEntity.${id}`);
|
||||
}
|
||||
|
||||
async backgrounds() {
|
||||
return this.metadata.group("ProfileBackgroundEntity");
|
||||
}
|
||||
|
||||
async background(id: string) {
|
||||
return this.metadata.item(`ProfileBackgroundEntity.${id}`);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,205 @@
|
||||
import { StandardSinglePrice } from "@protos/blitz_static_standard_single_price";
|
||||
import { PenetrationGroup } from "@protos/blitz_static_tank_penetration_group";
|
||||
import {
|
||||
PenetrationGroupUpgrade,
|
||||
PitchLimit,
|
||||
ShellUpgrade,
|
||||
ShellUpgrageSingleChange,
|
||||
StageParameters,
|
||||
TankAttributeChange,
|
||||
TankAttributeChange_AttributeName,
|
||||
TankAttributeChange_Modifier,
|
||||
VisualChanges,
|
||||
} from "@protos/blitz_static_tank_upgrade_single_stage";
|
||||
|
||||
function patch(stage0: StageParameters, stage1: StageParameters) {
|
||||
if (stage1.stage_number !== ++stage0.stage_number) {
|
||||
throw new Error("Change stage number must be 1 greater than base");
|
||||
}
|
||||
|
||||
for (const attribute1 of stage1.attributes) {
|
||||
let value1: number;
|
||||
|
||||
switch (attribute1.modifier) {
|
||||
case TankAttributeChange_Modifier.MODIFIER_OVERRIDE:
|
||||
value1 = attribute1.value;
|
||||
break;
|
||||
|
||||
case TankAttributeChange_Modifier.MODIFIER_MULTIPLY:
|
||||
case TankAttributeChange_Modifier.MODIFIER_ADD:
|
||||
const attribute0 = stage0.attributes.find(
|
||||
(attribute0) =>
|
||||
attribute0.attribute_name === attribute1.attribute_name
|
||||
);
|
||||
|
||||
if (!attribute0) {
|
||||
throw new Error(
|
||||
`Missing attribute ${
|
||||
TankAttributeChange_AttributeName[attribute1.attribute_name]
|
||||
} (${attribute1.attribute_name}) to modify`
|
||||
);
|
||||
}
|
||||
|
||||
case TankAttributeChange_Modifier.MODIFIER_MULTIPLY: {
|
||||
value1 = attribute0!.value! * attribute1.value;
|
||||
break;
|
||||
}
|
||||
|
||||
case TankAttributeChange_Modifier.MODIFIER_ADD: {
|
||||
value1 = attribute0!.value! + attribute1.value;
|
||||
break;
|
||||
}
|
||||
|
||||
default:
|
||||
throw new Error(
|
||||
`Unhandled modified ${
|
||||
TankAttributeChange_Modifier[attribute1.modifier]
|
||||
}`
|
||||
);
|
||||
}
|
||||
|
||||
const attribute0 = TankAttributeChange.create({
|
||||
modifier: TankAttributeChange_Modifier.MODIFIER_OVERRIDE,
|
||||
attribute_name: attribute1.attribute_name,
|
||||
value: value1,
|
||||
});
|
||||
const index0 = stage0.attributes.findIndex(
|
||||
(attribute) => attribute.attribute_name === attribute1.attribute_name
|
||||
);
|
||||
|
||||
if (index0 === -1) {
|
||||
stage0.attributes.push(attribute0);
|
||||
} else {
|
||||
stage0.attributes[index0] = attribute0;
|
||||
}
|
||||
}
|
||||
|
||||
for (const penetrationGroupUpgrade1 of stage1.penetration_groups_upgrades) {
|
||||
const penetrationGroupUpgrade0 = stage0.penetration_groups_upgrades.find(
|
||||
(group) => group.tank_part === penetrationGroupUpgrade1.tank_part
|
||||
);
|
||||
|
||||
if (penetrationGroupUpgrade0) {
|
||||
penetrationGroupUpgrade0.primary_armor = [
|
||||
...penetrationGroupUpgrade1.primary_armor,
|
||||
];
|
||||
|
||||
for (const penetrationGroup1 of penetrationGroupUpgrade1.penetration_groups) {
|
||||
const penetrationGroup0 =
|
||||
penetrationGroupUpgrade0.penetration_groups.find(
|
||||
(baseGroup) => baseGroup.group_name === penetrationGroup1.group_name
|
||||
);
|
||||
|
||||
if (penetrationGroup0) {
|
||||
penetrationGroup0.common_data = penetrationGroup1.common_data;
|
||||
penetrationGroup0.armor = penetrationGroup1.armor;
|
||||
} else {
|
||||
penetrationGroupUpgrade0.penetration_groups.push(
|
||||
PenetrationGroup.create(penetrationGroup1)
|
||||
);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
stage0.penetration_groups_upgrades.push(
|
||||
PenetrationGroupUpgrade.create(penetrationGroupUpgrade1)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
if (stage1.modules_upgrades.length > 0) {
|
||||
throw new Error("Modules upgrades not implemented");
|
||||
}
|
||||
|
||||
for (const shellUpgrades1 of stage1.shells_upgrades) {
|
||||
let shellUpgrades0 = stage0.shells_upgrades.find(
|
||||
(baseShell) => baseShell.shell_id === shellUpgrades1.shell_id
|
||||
);
|
||||
|
||||
if (shellUpgrades0) {
|
||||
shellUpgrades0.shell_type = shellUpgrades1.shell_type;
|
||||
|
||||
for (const changedShellUpgrade of shellUpgrades1.changes) {
|
||||
const shellUpgrade0 = shellUpgrades0.changes.find(
|
||||
(baseShellUpgrade) =>
|
||||
baseShellUpgrade.attribute_name ===
|
||||
changedShellUpgrade.attribute_name
|
||||
);
|
||||
|
||||
if (shellUpgrade0) {
|
||||
shellUpgrade0.value = changedShellUpgrade.value;
|
||||
} else {
|
||||
shellUpgrades0.changes.push(
|
||||
ShellUpgrageSingleChange.create(changedShellUpgrade)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
shellUpgrades0.silver_price =
|
||||
shellUpgrades1.silver_price === undefined
|
||||
? undefined
|
||||
: StandardSinglePrice.create(shellUpgrades1.silver_price);
|
||||
} else {
|
||||
stage0.shells_upgrades.push(ShellUpgrade.create(shellUpgrades1));
|
||||
}
|
||||
}
|
||||
|
||||
if (stage1.pump_reload_times.length > 0) {
|
||||
stage0.pump_reload_times = [...stage1.pump_reload_times];
|
||||
}
|
||||
|
||||
if (stage1.pitch_limits_up.length > 0 && stage0.pitch_limits_up.length > 0) {
|
||||
throw new Error("Pitch limits not implemented");
|
||||
}
|
||||
|
||||
for (const pitchLimitUp1 of stage1.pitch_limits_up) {
|
||||
stage0.pitch_limits_up.push(PitchLimit.create(pitchLimitUp1));
|
||||
}
|
||||
|
||||
if (
|
||||
stage1.pitch_limits_down.length > 0 &&
|
||||
stage0.pitch_limits_down.length > 0
|
||||
) {
|
||||
throw new Error("Pitch limits not implemented");
|
||||
}
|
||||
|
||||
for (const pitchLimitDown1 of stage1.pitch_limits_down) {
|
||||
stage0.pitch_limits_down.push(PitchLimit.create(pitchLimitDown1));
|
||||
}
|
||||
|
||||
for (const visualChange1 of stage1.visual_changes) {
|
||||
const visualChange0 = stage0.visual_changes.find(
|
||||
(baseVisualChange) =>
|
||||
baseVisualChange.tank_part === visualChange1.tank_part
|
||||
);
|
||||
|
||||
if (visualChange0) {
|
||||
visualChange0.name = visualChange1.name;
|
||||
} else {
|
||||
stage0.visual_changes.push(VisualChanges.create(visualChange1));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
export function aggregateStageParameters(
|
||||
base: StageParameters,
|
||||
stages: StageParameters[]
|
||||
) {
|
||||
const stage0 = StageParameters.create({ ...base, stage_number: 0 });
|
||||
|
||||
/**
|
||||
* Bug in Reforged: base stats are stage 1, so is the first upgrade. Manually
|
||||
* setting it to stage 0 below and if the bug's been fixed, throw an error
|
||||
* in dev mode to allow clean up in the future. Also, update the initial
|
||||
* stage number to -1.
|
||||
*/
|
||||
|
||||
if (base.stage_number === 0 && import.meta.env.DEV) {
|
||||
throw new Error(
|
||||
"Base stats are now stage 0. In-game bug fixed, please remove hack."
|
||||
);
|
||||
}
|
||||
|
||||
stages.forEach((stage) => patch(stage0, stage));
|
||||
|
||||
return stage0;
|
||||
}
|
||||
@@ -0,0 +1,100 @@
|
||||
import { normalizeAngleDeg } from "@blitzkit/core";
|
||||
import type { PitchLimit } from "@protos/blitz_static_tank_upgrade_single_stage";
|
||||
import { clamp, degToRad, lerp, radToDeg } from "three/src/math/MathUtils.js";
|
||||
|
||||
export function applyPitchYawLimits(
|
||||
givenPitch: number,
|
||||
givenYaw: number,
|
||||
pitchLimitsUp: PitchLimit[],
|
||||
pitchLimitsDown: PitchLimit[]
|
||||
) {
|
||||
const givenYawDeg = normalizeAngleDeg(radToDeg(givenYaw));
|
||||
const givenPitchDeg = normalizeAngleDeg(radToDeg(givenPitch));
|
||||
|
||||
const yawDeg = givenYawDeg;
|
||||
const yaw = degToRad(givenYawDeg);
|
||||
|
||||
let leftLimitUp: PitchLimit | undefined;
|
||||
let rightLimitUp: PitchLimit | undefined;
|
||||
let leftLimitDown: PitchLimit | undefined;
|
||||
let rightLimitDown: PitchLimit | undefined;
|
||||
|
||||
for (const limit of pitchLimitsUp) {
|
||||
const normalizedAngle = normalizeAngleDeg(limit.angle);
|
||||
|
||||
if (normalizedAngle <= yawDeg) {
|
||||
if (
|
||||
!leftLimitUp ||
|
||||
normalizeAngleDeg(yawDeg - normalizedAngle) <
|
||||
normalizeAngleDeg(yawDeg - leftLimitUp.angle)
|
||||
) {
|
||||
leftLimitUp = limit;
|
||||
}
|
||||
}
|
||||
|
||||
if (normalizedAngle >= yawDeg) {
|
||||
if (
|
||||
!rightLimitUp ||
|
||||
normalizeAngleDeg(normalizedAngle - yawDeg) <
|
||||
normalizeAngleDeg(rightLimitUp.angle - yawDeg)
|
||||
) {
|
||||
rightLimitUp = limit;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
for (const limit of pitchLimitsDown) {
|
||||
const normalizedAngle = normalizeAngleDeg(limit.angle);
|
||||
|
||||
if (normalizedAngle <= yawDeg) {
|
||||
if (
|
||||
!leftLimitDown ||
|
||||
normalizeAngleDeg(yawDeg - normalizedAngle) <
|
||||
normalizeAngleDeg(yawDeg - leftLimitDown.angle)
|
||||
) {
|
||||
leftLimitDown = limit;
|
||||
}
|
||||
}
|
||||
|
||||
if (normalizedAngle >= yawDeg) {
|
||||
if (
|
||||
!rightLimitDown ||
|
||||
normalizeAngleDeg(normalizedAngle - yawDeg) <
|
||||
normalizeAngleDeg(rightLimitDown.angle - yawDeg)
|
||||
) {
|
||||
rightLimitDown = limit;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!leftLimitUp || !rightLimitUp || !leftLimitDown || !rightLimitDown) {
|
||||
throw new Error("Pitch limits not found");
|
||||
}
|
||||
|
||||
const spanUp = rightLimitUp.angle - leftLimitUp.angle;
|
||||
const spanDown = rightLimitDown.angle - leftLimitDown.angle;
|
||||
|
||||
let limitUp: number;
|
||||
let limitDown: number;
|
||||
|
||||
if (spanUp === 0) {
|
||||
limitUp = leftLimitUp.limit;
|
||||
} else {
|
||||
const delta = givenYawDeg - leftLimitUp.angle;
|
||||
const t = delta / spanUp;
|
||||
limitUp = lerp(leftLimitUp.limit, rightLimitUp.limit, t);
|
||||
}
|
||||
|
||||
if (spanDown === 0) {
|
||||
limitDown = leftLimitDown.limit;
|
||||
} else {
|
||||
const delta = givenYawDeg - leftLimitDown.angle;
|
||||
const t = delta / spanDown;
|
||||
limitDown = lerp(leftLimitDown.limit, rightLimitDown.limit, t);
|
||||
}
|
||||
|
||||
const pitchDeg = clamp(givenPitchDeg, -limitDown, limitUp);
|
||||
const pitch = degToRad(pitchDeg);
|
||||
|
||||
return { pitch, yaw };
|
||||
}
|
||||
@@ -0,0 +1,423 @@
|
||||
import { TankClass } from "@blitzkit/core";
|
||||
import {
|
||||
ShellUpgrageSingleChange_AttributeName,
|
||||
StageParameters,
|
||||
TankAttributeChange_AttributeName,
|
||||
} from "@protos/blitz_static_tank_upgrade_single_stage";
|
||||
import { radToDeg } from "three/src/math/MathUtils.js";
|
||||
import type { Tank } from "../../protos/tank";
|
||||
import { applyPitchYawLimits } from "./applyPitchYawLimits";
|
||||
import { TerrainHardness, type TankState } from "./tankState";
|
||||
|
||||
export type CharacteristicOutput = number | number[] | string | null;
|
||||
|
||||
type Characteristic = (helpers: {
|
||||
characteristic: (name: CharacteristicName) => CharacteristicOutput;
|
||||
attribute: (name: TankAttributeChange_AttributeName) => number;
|
||||
attributeSafe: (name: TankAttributeChange_AttributeName) => number | null;
|
||||
shell: (name: ShellUpgrageSingleChange_AttributeName) => number;
|
||||
shellSafe: (name: ShellUpgrageSingleChange_AttributeName) => number | null;
|
||||
state: TankState;
|
||||
tank: Tank;
|
||||
parameters: StageParameters;
|
||||
id: string;
|
||||
}) => CharacteristicOutput;
|
||||
|
||||
export type CharacteristicName = keyof typeof characteristics;
|
||||
|
||||
export enum GunType {
|
||||
Regular,
|
||||
AutoLoader,
|
||||
AutoReloader,
|
||||
}
|
||||
|
||||
export const characteristics = {
|
||||
gun_type({ attributeSafe, attribute }) {
|
||||
const isPump =
|
||||
attributeSafe(TankAttributeChange_AttributeName.ATTRIBUTE_NAME_IS_PUMP) ??
|
||||
0;
|
||||
|
||||
if (isPump === 1) return GunType.AutoReloader;
|
||||
|
||||
const clipSize = attribute(
|
||||
TankAttributeChange_AttributeName.ATTRIBUTE_NAME_CLIP_SIZE
|
||||
);
|
||||
|
||||
if (clipSize === 1) return GunType.Regular;
|
||||
|
||||
return GunType.AutoLoader;
|
||||
},
|
||||
|
||||
clip_size({ attribute, characteristic }) {
|
||||
const gunType = characteristic("gun_type")!;
|
||||
|
||||
if (gunType === GunType.Regular) return null;
|
||||
|
||||
return attribute(
|
||||
TankAttributeChange_AttributeName.ATTRIBUTE_NAME_CLIP_SIZE
|
||||
);
|
||||
},
|
||||
|
||||
damage({ shell }) {
|
||||
return shell(
|
||||
ShellUpgrageSingleChange_AttributeName.ATTRIBUTE_NAME_ARMOR_DAMAGE
|
||||
);
|
||||
},
|
||||
|
||||
module_damage({ shell }) {
|
||||
return shell(
|
||||
ShellUpgrageSingleChange_AttributeName.ATTRIBUTE_NAME_MODULE_DAMAGE
|
||||
);
|
||||
},
|
||||
|
||||
penetration({ shell }) {
|
||||
return shell(
|
||||
ShellUpgrageSingleChange_AttributeName.ATTRIBUTE_NAME_PIERCING_POWER
|
||||
);
|
||||
},
|
||||
|
||||
reload({ characteristic, attribute }) {
|
||||
const gunType = characteristic("gun_type")!;
|
||||
|
||||
if (gunType === GunType.AutoReloader) return null;
|
||||
|
||||
return attribute(
|
||||
TankAttributeChange_AttributeName.ATTRIBUTE_NAME_RELOAD_TIME
|
||||
);
|
||||
},
|
||||
|
||||
reloads({ characteristic, parameters }) {
|
||||
const gunType = characteristic("gun_type")!;
|
||||
|
||||
if (gunType !== GunType.AutoReloader) return null;
|
||||
|
||||
return parameters.pump_reload_times;
|
||||
},
|
||||
|
||||
intra_clip({ characteristic, attribute }) {
|
||||
const gunType = characteristic("gun_type")!;
|
||||
|
||||
if (gunType === GunType.Regular) return null;
|
||||
|
||||
const clipRate = attribute(
|
||||
TankAttributeChange_AttributeName.ATTRIBUTE_NAME_CLIP_RATE
|
||||
);
|
||||
|
||||
return 60 / clipRate;
|
||||
},
|
||||
|
||||
optimal_shell({ characteristic }) {
|
||||
const gunType = characteristic("gun_type")!;
|
||||
|
||||
if (gunType !== GunType.AutoReloader) return null;
|
||||
|
||||
const intraClip = characteristic("intra_clip") as number;
|
||||
const reloads = characteristic("reloads") as number[];
|
||||
let optimal: number | undefined = undefined;
|
||||
|
||||
for (let index = 0; index < reloads.length; index++) {
|
||||
const reload = reloads[index] + (index > 0 ? intraClip : 0);
|
||||
if (optimal === undefined || reload < reloads[optimal]) optimal = index;
|
||||
}
|
||||
|
||||
if (optimal === undefined) {
|
||||
throw new Error("Unable to find optimal shell");
|
||||
}
|
||||
|
||||
return optimal;
|
||||
},
|
||||
|
||||
dpm({ characteristic }) {
|
||||
let dps: number;
|
||||
const gunType = characteristic("gun_type")!;
|
||||
const damage = characteristic("damage") as number;
|
||||
|
||||
switch (gunType) {
|
||||
case GunType.Regular: {
|
||||
const reload = characteristic("reload") as number;
|
||||
|
||||
dps = damage / reload;
|
||||
break;
|
||||
}
|
||||
|
||||
case GunType.AutoLoader: {
|
||||
const reload = characteristic("reload") as number;
|
||||
const intraClip = characteristic("intra_clip") as number;
|
||||
const clipSize = characteristic("clip_size") as number;
|
||||
|
||||
dps = (damage * clipSize) / (reload + (clipSize - 1) * intraClip);
|
||||
break;
|
||||
}
|
||||
|
||||
case GunType.AutoReloader: {
|
||||
const reloads = characteristic("reloads") as number[];
|
||||
const optimalShell = characteristic("optimal_shell") as number;
|
||||
const intraClip = characteristic("intra_clip") as number;
|
||||
const reload =
|
||||
reloads[optimalShell] + (optimalShell > 0 ? intraClip : 0);
|
||||
|
||||
dps = damage / reload;
|
||||
break;
|
||||
}
|
||||
|
||||
default:
|
||||
throw new Error("Unknown gun type");
|
||||
}
|
||||
|
||||
return 60 * dps;
|
||||
},
|
||||
|
||||
caliber({ shell }) {
|
||||
return shell(ShellUpgrageSingleChange_AttributeName.ATTRIBUTE_NAME_CALIBER);
|
||||
},
|
||||
|
||||
normalization({ shellSafe }) {
|
||||
return shellSafe(
|
||||
ShellUpgrageSingleChange_AttributeName.ATTRIBUTE_NAME_NORMALIZATION
|
||||
);
|
||||
},
|
||||
|
||||
ricochet({ shell }) {
|
||||
return shell(
|
||||
ShellUpgrageSingleChange_AttributeName.ATTRIBUTE_NAME_RICOCHET_ANGLE
|
||||
);
|
||||
},
|
||||
|
||||
shell_velocity({ shell }) {
|
||||
return (
|
||||
shell(ShellUpgrageSingleChange_AttributeName.ATTRIBUTE_NAME_SPEED) / 100
|
||||
);
|
||||
},
|
||||
|
||||
shell_range({ shellSafe }) {
|
||||
const maxDistance = shellSafe(
|
||||
ShellUpgrageSingleChange_AttributeName.ATTRIBUTE_NAME_MAX_DISTANCE
|
||||
);
|
||||
return maxDistance === null ? Infinity : maxDistance / 100;
|
||||
},
|
||||
|
||||
shell_capacity({ shellSafe }) {
|
||||
const count = shellSafe(
|
||||
ShellUpgrageSingleChange_AttributeName.ATTRIBUTE_NAME_MAX_COUNT
|
||||
);
|
||||
return count === -1 || count === null ? Infinity : count;
|
||||
},
|
||||
|
||||
aim_time({ attribute }) {
|
||||
return attribute(
|
||||
TankAttributeChange_AttributeName.ATTRIBUTE_NAME_AIMING_TIME
|
||||
);
|
||||
},
|
||||
|
||||
speed_forward({ attribute }) {
|
||||
return attribute(
|
||||
TankAttributeChange_AttributeName.ATTRIBUTE_NAME_FORWARD_MAX_SPEED
|
||||
);
|
||||
},
|
||||
|
||||
speed_backward({ attribute }) {
|
||||
return attribute(
|
||||
TankAttributeChange_AttributeName.ATTRIBUTE_NAME_BACKWARD_MAX_SPEED
|
||||
);
|
||||
},
|
||||
|
||||
dispersion({ attribute, characteristic, state }) {
|
||||
const base = attribute(
|
||||
TankAttributeChange_AttributeName.ATTRIBUTE_NAME_DISPERSION_ANGLE
|
||||
);
|
||||
const movement = attribute(
|
||||
TankAttributeChange_AttributeName.ATTRIBUTE_NAME_DISPERSION_FACTOR_VEHICLE_MOVEMENT
|
||||
);
|
||||
const vehicleRotation = attribute(
|
||||
TankAttributeChange_AttributeName.ATTRIBUTE_NAME_DISPERSION_FACTOR_VEHICLE_ROTATION
|
||||
);
|
||||
const turretRotation = attribute(
|
||||
TankAttributeChange_AttributeName.ATTRIBUTE_NAME_DISPERSION_FACTOR_TURRET_ROTATION
|
||||
);
|
||||
const afterShot = attribute(
|
||||
TankAttributeChange_AttributeName.ATTRIBUTE_NAME_DISPERSION_FACTOR_AFTER_SHOT
|
||||
);
|
||||
const gunDamaged = attribute(
|
||||
TankAttributeChange_AttributeName.ATTRIBUTE_NAME_DISPERSION_FACTOR_WHILE_GUN_DAMAGED
|
||||
);
|
||||
const maxSpeed = characteristic("speed_forward") as number;
|
||||
|
||||
return (
|
||||
(state.isGunDamaged ? gunDamaged : 1) *
|
||||
(base +
|
||||
(state.speed / maxSpeed) * movement +
|
||||
(state.isHullTraversing ? vehicleRotation : 0) +
|
||||
(state.isTurretTraversing ? turretRotation : 0) +
|
||||
(state.isShooting ? afterShot : 0))
|
||||
);
|
||||
},
|
||||
|
||||
gun_depression({ parameters, tank }) {
|
||||
return -radToDeg(
|
||||
applyPitchYawLimits(
|
||||
-Math.PI / 2,
|
||||
0,
|
||||
parameters.pitch_limits_up,
|
||||
parameters.pitch_limits_down
|
||||
).pitch
|
||||
);
|
||||
},
|
||||
|
||||
gun_elevation({ parameters }) {
|
||||
return radToDeg(
|
||||
applyPitchYawLimits(
|
||||
Math.PI / 2,
|
||||
0,
|
||||
parameters.pitch_limits_up,
|
||||
parameters.pitch_limits_down
|
||||
).pitch
|
||||
);
|
||||
},
|
||||
|
||||
engine_power({ attribute }) {
|
||||
return attribute(
|
||||
TankAttributeChange_AttributeName.ATTRIBUTE_NAME_ENGINE_POWER
|
||||
);
|
||||
},
|
||||
|
||||
weight({ attribute }) {
|
||||
return (
|
||||
attribute(TankAttributeChange_AttributeName.ATTRIBUTE_NAME_MASS) / 1000
|
||||
);
|
||||
},
|
||||
|
||||
terrain_coefficient({ attribute, state }) {
|
||||
let name: TankAttributeChange_AttributeName;
|
||||
|
||||
switch (state.terrainHardness) {
|
||||
case TerrainHardness.Soft:
|
||||
name =
|
||||
TankAttributeChange_AttributeName.ATTRIBUTE_NAME_TERRAIN_RESISTANCE_SOFT;
|
||||
break;
|
||||
case TerrainHardness.Medium:
|
||||
name =
|
||||
TankAttributeChange_AttributeName.ATTRIBUTE_NAME_TERRAIN_RESISTANCE_MEDIUM;
|
||||
break;
|
||||
case TerrainHardness.Hard:
|
||||
name =
|
||||
TankAttributeChange_AttributeName.ATTRIBUTE_NAME_TERRAIN_RESISTANCE_HARD;
|
||||
break;
|
||||
}
|
||||
|
||||
return attribute(name);
|
||||
},
|
||||
|
||||
power_to_weight({ characteristic }) {
|
||||
const power = characteristic("engine_power") as number;
|
||||
const weight = characteristic("weight") as number;
|
||||
const terrainCoefficient = characteristic("terrain_coefficient") as number;
|
||||
return power / weight / terrainCoefficient;
|
||||
},
|
||||
|
||||
turret_traverse_speed({ attribute }) {
|
||||
return attribute(
|
||||
TankAttributeChange_AttributeName.ATTRIBUTE_NAME_TURRET_ROTATION_SPEED
|
||||
);
|
||||
},
|
||||
|
||||
hull_traverse_speed() {
|
||||
return -Infinity;
|
||||
},
|
||||
|
||||
health({ attribute }) {
|
||||
return attribute(
|
||||
TankAttributeChange_AttributeName.ATTRIBUTE_NAME_MAX_HEALTH
|
||||
);
|
||||
},
|
||||
|
||||
fire_chance({ attribute }) {
|
||||
return (
|
||||
attribute(
|
||||
TankAttributeChange_AttributeName.ATTRIBUTE_NAME_FIRE_START_CHANCE
|
||||
) * 100
|
||||
);
|
||||
},
|
||||
|
||||
view_range({ attribute }) {
|
||||
return (
|
||||
attribute(
|
||||
TankAttributeChange_AttributeName.ATTRIBUTE_NAME_CIRCULAR_VISION_RADIUS
|
||||
) / 100
|
||||
);
|
||||
},
|
||||
|
||||
class({ tank }) {
|
||||
return tank.tank!.tank_class;
|
||||
},
|
||||
|
||||
camouflage({ attribute, characteristic, attributeSafe, state }) {
|
||||
const tankClass = characteristic("class");
|
||||
const base = attribute(
|
||||
TankAttributeChange_AttributeName.ATTRIBUTE_NAME_CONCEALMENT_STILL
|
||||
);
|
||||
const moving =
|
||||
tankClass === TankClass.LIGHT
|
||||
? 0
|
||||
: attribute(
|
||||
TankAttributeChange_AttributeName.ATTRIBUTE_NAME_CONCEALMENT_MOVING
|
||||
);
|
||||
const shooting = attribute(
|
||||
TankAttributeChange_AttributeName.ATTRIBUTE_NAME_CONCEALMENT_FACTOR_AT_SHOT
|
||||
);
|
||||
|
||||
if (
|
||||
attributeSafe(
|
||||
TankAttributeChange_AttributeName.ATTRIBUTE_NAME_CONCEALMENT_FIRE_PENALTY
|
||||
)
|
||||
) {
|
||||
throw new Error("Fire penalty implemented! Code it in!!");
|
||||
}
|
||||
|
||||
return (
|
||||
100 *
|
||||
base *
|
||||
(1 + moving * state.speed) *
|
||||
(state.isShooting ? shooting : 1)
|
||||
);
|
||||
},
|
||||
|
||||
height() {
|
||||
return -Infinity;
|
||||
},
|
||||
|
||||
length() {
|
||||
return -Infinity;
|
||||
},
|
||||
|
||||
volume() {
|
||||
return -Infinity;
|
||||
},
|
||||
|
||||
nation({ tank }) {
|
||||
return tank.tank!.nation;
|
||||
},
|
||||
|
||||
name({ tank }) {
|
||||
return tank.tank!.name!.value;
|
||||
},
|
||||
|
||||
tier({ tank }) {
|
||||
return tank.tank!.tier_catalog_id;
|
||||
},
|
||||
|
||||
type({ tank }) {
|
||||
return tank.tank!.tank_type;
|
||||
},
|
||||
|
||||
id({ id }) {
|
||||
return id;
|
||||
},
|
||||
|
||||
slug({ tank }) {
|
||||
return tank.slug;
|
||||
},
|
||||
|
||||
compensation({ tank }) {
|
||||
return tank.compensation!.compensation?.currency_reward?.amount ?? null;
|
||||
},
|
||||
} satisfies Record<string, Characteristic>;
|
||||
@@ -0,0 +1,138 @@
|
||||
import {
|
||||
Nation,
|
||||
TankClass,
|
||||
TankType,
|
||||
} from "@protos/blitz_static_tank_component";
|
||||
import {
|
||||
GunType,
|
||||
type CharacteristicName,
|
||||
type CharacteristicOutput,
|
||||
} from "./characteristics";
|
||||
|
||||
export enum BetterDirection {
|
||||
Higher,
|
||||
Lower,
|
||||
}
|
||||
|
||||
export interface CharacteristicRenderConfig {
|
||||
name: CharacteristicName;
|
||||
decimals?: number;
|
||||
units?: string;
|
||||
render?: (output: CharacteristicOutput) => string;
|
||||
}
|
||||
|
||||
type CharacteristicsOrder = {
|
||||
group: string;
|
||||
order: (
|
||||
| CharacteristicRenderConfig
|
||||
| {
|
||||
toy: string;
|
||||
}
|
||||
)[];
|
||||
}[];
|
||||
|
||||
export const characteristicsOrder: CharacteristicsOrder = [
|
||||
{
|
||||
group: "meta",
|
||||
order: [
|
||||
{ name: "name" },
|
||||
{ name: "tier" },
|
||||
{
|
||||
name: "nation",
|
||||
render(output) {
|
||||
return Nation[output as Nation];
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "class",
|
||||
render(output) {
|
||||
return TankClass[output as TankClass];
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "type",
|
||||
render(output) {
|
||||
return TankType[output as TankType];
|
||||
},
|
||||
},
|
||||
{ name: "compensation" },
|
||||
{ name: "id" },
|
||||
{ name: "slug" },
|
||||
],
|
||||
},
|
||||
{
|
||||
group: "firepower",
|
||||
order: [
|
||||
{
|
||||
name: "gun_type",
|
||||
render(output) {
|
||||
return GunType[output as GunType];
|
||||
},
|
||||
},
|
||||
{ name: "dpm", decimals: 0, units: "hp_min" },
|
||||
{ name: "reload", decimals: 2, units: "s" },
|
||||
{ name: "reloads", decimals: 2, units: "s" },
|
||||
{ name: "damage", units: "hp" },
|
||||
{ name: "module_damage", units: "hp" },
|
||||
{ name: "penetration", units: "mm" },
|
||||
{ name: "clip_size" },
|
||||
{ name: "intra_clip", decimals: 2, units: "s" },
|
||||
|
||||
{ toy: "reload" },
|
||||
|
||||
{ name: "caliber", units: "mm" },
|
||||
{ name: "normalization", units: "deg" },
|
||||
{ name: "ricochet", units: "deg" },
|
||||
|
||||
{ toy: "ricochet" },
|
||||
|
||||
{ name: "shell_velocity", units: "m_s" },
|
||||
{ name: "shell_range", units: "m" },
|
||||
{ name: "shell_capacity" },
|
||||
|
||||
{ name: "aim_time", decimals: 1, units: "s" },
|
||||
|
||||
{ toy: "aim_time" },
|
||||
|
||||
{ name: "dispersion", decimals: 3, units: "m" },
|
||||
|
||||
{ name: "gun_depression", decimals: 0, units: "deg" },
|
||||
{ name: "gun_elevation", decimals: 0, units: "deg" },
|
||||
|
||||
{ toy: "flexibility" },
|
||||
],
|
||||
},
|
||||
{
|
||||
group: "maneuverability",
|
||||
order: [
|
||||
{ name: "speed_forward", units: "km_h" },
|
||||
{ name: "speed_backward", units: "km_h" },
|
||||
|
||||
{ name: "engine_power", units: "bhp" },
|
||||
{ name: "weight", decimals: 1, units: "t" },
|
||||
|
||||
{ name: "terrain_coefficient" },
|
||||
{ name: "power_to_weight", decimals: 1, units: "bhp_t" },
|
||||
{ name: "hull_traverse_speed", units: "deg_s" },
|
||||
{ name: "turret_traverse_speed", units: "deg_s" },
|
||||
|
||||
{ toy: "traverse" },
|
||||
],
|
||||
},
|
||||
{
|
||||
group: "survivability",
|
||||
order: [
|
||||
{ name: "health", units: "hp" },
|
||||
{ name: "fire_chance", units: "%" },
|
||||
{ name: "view_range", units: "m" },
|
||||
|
||||
{ toy: "view_range" },
|
||||
|
||||
{ name: "camouflage", decimals: 0, units: "%" },
|
||||
|
||||
{ name: "height", units: "m" },
|
||||
{ name: "length", units: "m" },
|
||||
{ name: "volume", units: "m" },
|
||||
],
|
||||
},
|
||||
];
|
||||
@@ -0,0 +1,106 @@
|
||||
import {
|
||||
ShellUpgrageSingleChange_AttributeName,
|
||||
TankAttributeChange_AttributeName,
|
||||
} from "@protos/blitz_static_tank_upgrade_single_stage";
|
||||
import type { Tank } from "../../protos/tank";
|
||||
import { aggregateStageParameters } from "./aggregateStageParameters";
|
||||
import {
|
||||
characteristics,
|
||||
type CharacteristicName,
|
||||
type CharacteristicOutput,
|
||||
} from "./characteristics";
|
||||
import type { TankState } from "./tankState";
|
||||
|
||||
export type ComputedCharacteristics = Record<
|
||||
CharacteristicName,
|
||||
CharacteristicOutput
|
||||
>;
|
||||
|
||||
export function computeCharacteristics(
|
||||
id: string,
|
||||
tank: Tank,
|
||||
state: TankState
|
||||
) {
|
||||
const parameters = aggregateStageParameters(
|
||||
tank.tank!.base_stats!,
|
||||
tank.tank!.upgrade_stages.slice(0, state.stage)
|
||||
);
|
||||
|
||||
const computed: Partial<ComputedCharacteristics> = {};
|
||||
|
||||
function characteristic(name: CharacteristicName) {
|
||||
if (name in computed) return computed[name] as CharacteristicOutput;
|
||||
throw new Error(`${name} not computed yet`);
|
||||
}
|
||||
|
||||
function attributeSafe(name: TankAttributeChange_AttributeName) {
|
||||
const attribute = parameters.attributes.find(
|
||||
(attribute) => attribute.attribute_name === name
|
||||
);
|
||||
|
||||
return attribute ? attribute.value : null;
|
||||
}
|
||||
|
||||
function attribute(name: TankAttributeChange_AttributeName) {
|
||||
const attribute = attributeSafe(name);
|
||||
|
||||
if (attribute === null) {
|
||||
throw new Error(
|
||||
`Attribute ${TankAttributeChange_AttributeName[name]} (${name}) not found`
|
||||
);
|
||||
}
|
||||
|
||||
return attribute;
|
||||
}
|
||||
|
||||
function shellSafe(name: ShellUpgrageSingleChange_AttributeName) {
|
||||
const shell = parameters.shells_upgrades.find(
|
||||
(shell) => shell.shell_id === state.shell
|
||||
);
|
||||
|
||||
if (!shell) {
|
||||
throw new Error(
|
||||
`Shell ${ShellUpgrageSingleChange_AttributeName[name]} (${name}) not found`
|
||||
);
|
||||
}
|
||||
|
||||
const attribute = shell.changes.find(
|
||||
(change) => change.attribute_name === name
|
||||
);
|
||||
|
||||
return attribute ? attribute.value : null;
|
||||
}
|
||||
|
||||
function shell(name: ShellUpgrageSingleChange_AttributeName) {
|
||||
const attribute = shellSafe(name);
|
||||
|
||||
if (attribute === null) {
|
||||
throw new Error(
|
||||
`Shell attribute ${ShellUpgrageSingleChange_AttributeName[name]} (${name}) not found`
|
||||
);
|
||||
}
|
||||
|
||||
return attribute;
|
||||
}
|
||||
|
||||
for (const _name in characteristics) {
|
||||
const name = _name as CharacteristicName;
|
||||
const value = characteristics[name]({
|
||||
characteristic,
|
||||
attribute,
|
||||
attributeSafe,
|
||||
shell,
|
||||
shellSafe,
|
||||
state,
|
||||
tank,
|
||||
parameters,
|
||||
id,
|
||||
});
|
||||
computed[name] = value;
|
||||
}
|
||||
|
||||
return {
|
||||
characteristics: computed as ComputedCharacteristics,
|
||||
parameters,
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
import type { TankCatalogComponent } from "@protos/blitz_static_tank_component";
|
||||
import { TerrainHardness } from "./tankState";
|
||||
|
||||
export function createTankState(tank: TankCatalogComponent) {
|
||||
return {
|
||||
stage: tank.upgrade_stages.length,
|
||||
shell: 0,
|
||||
isGunDamaged: false,
|
||||
isHullTraversing: false,
|
||||
isShooting: false,
|
||||
isTurretTraversing: false,
|
||||
speed: 0,
|
||||
terrainHardness: TerrainHardness.Hard,
|
||||
isCaughtOnFire: false,
|
||||
};
|
||||
}
|
||||