Compare commits

...
114 Commits
Author SHA1 Message Date
TrèsAbhi e058b09621 Merge pull request #199 from blitzkit/main-i18n 2026-01-04 21:18:48 +00:00
TrèsAbhi 448e4e0d7d New translations en.json (Russian) 2026-01-04 12:33:13 +00:00
TrèsAbhi 0ea7714578 feat: redo credits 2026-01-03 13:36:15 -06:00
TrèsAbhi cbe22035cb Merge pull request #194 from blitzkit/main-i18n 2026-01-02 18:47:42 +00:00
TrèsAbhi 4c8e5cc8ed New translations en.json (Chinese Simplified) 2026-01-02 18:46:54 +00:00
TrèsAbhi ee4141838c New translations en.json (Ukrainian) 2026-01-02 18:46:53 +00:00
TrèsAbhi 24ff42a672 New translations en.json (Russian) 2026-01-02 18:46:52 +00:00
TrèsAbhi d8748c028e New translations en.json (Portuguese) 2026-01-02 18:46:51 +00:00
TrèsAbhi b55924ce2b New translations en.json (Polish) 2026-01-02 18:46:50 +00:00
TrèsAbhi 66f7a8d369 New translations en.json (Japanese) 2026-01-02 18:46:49 +00:00
TrèsAbhi 8ed97a3173 New translations en.json (Spanish) 2026-01-02 18:46:47 +00:00
TrèsAbhi b4f452b026 New translations en.json (French) 2026-01-02 18:46:46 +00:00
TrèsAbhi 8d4d730b11 feat: logs 2026-01-02 12:43:07 -06:00
TrèsAbhi 8f54bd5971 fix: use role filters 2026-01-02 12:39:45 -06:00
TrèsAbhi 56a09536cd fix: use roles 2026-01-02 12:09:23 -06:00
TrèsAbhi 9df5efa422 feat: enable gamemode exclusive 2026-01-02 11:32:27 -06:00
TrèsAbhi ee5461a297 feat: reset button 2026-01-02 11:28:11 -06:00
TrèsAbhi 5ed5f45240 feat: 90rem 2025-12-31 14:42:13 -06:00
TrèsAbhi a8cdc96382 fix: some filtering 2025-12-31 14:41:13 -06:00
TrèsAbhi 532d677491 feat: provision filters 2025-12-31 14:37:14 -06:00
TrèsAbhi 610ea60ca2 feat: provisions and powers 2025-12-31 14:31:48 -06:00
TrèsAbhi 718576d5a9 feat: provisions 2025-12-31 14:27:48 -06:00
TrèsAbhi f885fba4bd fix: keys 2025-12-31 14:20:44 -06:00
TrèsAbhi 408a14003c fix: allow interactbility oustisde of dropdoiwn 2025-12-31 14:19:10 -06:00
TrèsAbhi 9416e25ee9 feat: start of logs 2025-12-31 14:18:58 -06:00
TrèsAbhi 8a3bbb3647 feat: clear button 2025-12-31 14:08:37 -06:00
TrèsAbhi e16cc63cfe feat: bigger icons 2025-12-31 14:06:08 -06:00
TrèsAbhi b2856eab58 feat: localize 2025-12-31 14:02:28 -06:00
TrèsAbhi 55ffe22fd6 feat: gamemode abilities 2025-12-31 13:56:31 -06:00
TrèsAbhi 98e0f28cd9 feat: consumables 2025-12-31 13:51:54 -06:00
TrèsAbhi 547381286e feat: testing filters 2025-12-31 13:42:19 -06:00
TrèsAbhi bdaf6e662c fix: surface 2025-12-31 13:40:34 -06:00
TrèsAbhi 87438abaa3 feat: simplify 2025-12-31 13:38:18 -06:00
TrèsAbhi f837aaf40a fix: use dropdown 2025-12-30 20:56:42 -06:00
TrèsAbhi 86e080aae9 feat: shells 2025-12-30 20:48:51 -06:00
TrèsAbhi 57efde83df Merge pull request #193 from Hitjack007/filter-by-provision 2025-12-31 02:39:06 +00:00
TrèsAbhi 6b29584424 feat: minor adjusments 2025-12-30 20:38:32 -06:00
TrèsAbhi 71e40a0113 feat: tank types 2025-12-30 20:30:18 -06:00
TrèsAbhi b5e7170697 feat: gun types 2025-12-30 20:23:06 -06:00
TrèsAbhi 4122856024 fix: reduce gap 2025-12-30 20:13:37 -06:00
TrèsAbhi 5b4c85138e feat: classes 2025-12-30 20:12:25 -06:00
TrèsAbhi 727ced967b feat: extract components 2025-12-30 20:05:00 -06:00
TrèsAbhi 4462ebe82c feat: tiers filter 2025-12-30 20:00:18 -06:00
TrèsAbhi 06ce263668 feat: compact nations selector 2025-12-30 19:53:06 -06:00
TrèsAbhi 7e086cc639 Merge pull request #192 from Hitjack007/main 2025-12-31 01:04:11 +00:00
TrèsAbhi 540e56a12d feat: format all 2025-12-30 19:03:00 -06:00
TrèsAbhi faf802cf3d revert: Modules.tsx 2025-12-30 19:02:05 -06:00
TrèsAbhi b6d6fa7212 Remove unused React import from FilterControl.tsx 2025-12-30 09:52:11 -06:00
TrèsAbhi dfa8be63b4 Pet peeve 2025-12-30 09:51:10 -06:00
TrèsAbhi 9eb6acc624 Fix formatting of consumables array in tankFilters 2025-12-30 09:49:06 -06:00
Mark Greene b6204b1c2c Added ability to filter tanks by available provisions 2025-12-30 20:45:44 +13:00
TrèsAbhi 39f1389d77 Remove unused provision logging comments
Removed commented-out logging code for provisions.
2025-12-29 21:27:41 -06:00
Mark Greene 53b0f04512 Revert changes 2025-12-30 15:53:25 +13:00
Mark Greene d2fa93ee71 Revert changes 2025-12-30 15:51:57 +13:00
Mark Greene 7871eae7a3 revert changes 2025-12-30 15:50:43 +13:00
Mark Greene 0bd660f255 Revert changes 2025-12-30 15:48:44 +13:00
Mark Greene 488857b7d8 Merge branch 'blitzkit:main' into main 2025-12-30 15:45:38 +13:00
Mark Greene 5e4c5fc230 Fixed Provisions not affecting terrain resistances and added commented-out helper function to log provisions later if needed. 2025-12-30 15:43:16 +13:00
TrèsAbhi 7e6925772e fix: plural 2025-12-27 20:02:51 -06:00
TrèsAbhi b479c09cf8 feat: logs 2025-12-27 20:01:29 -06:00
TrèsAbhi eddc8168ba feat: helping reveal 2025-12-27 19:51:50 -06:00
TrèsAbhi 80dfc59017 feat: streaks in guesser 2025-12-27 19:39:10 -06:00
TrèsAbhi fdc0f34e08 feat: clear all provisions and consumables 2025-12-27 19:36:12 -06:00
TrèsAbhi c0fdf10eba fix: tiny compare table buttons 2025-12-27 19:33:17 -06:00
TrèsAbhi 2aba4da1af fix: selector 2025-12-27 19:26:16 -06:00
TrèsAbhi 581d889e9b feat: module selection 2025-12-27 19:21:22 -06:00
TrèsAbhi 6a280982d0 fix: remove ue code 2025-12-27 18:50:14 -06:00
TrèsAbhi 45c7d74160 revert: icon scale 2025-12-27 18:45:09 -06:00
Mark Greene 9e225d2093 Fixed Provison Button Sizes 2025-12-28 12:12:56 +13:00
Mark Greene d1001df3cf Add randomise function to modules 2025-12-28 10:06:53 +13:00
Mark Greene d28c56fe1c Add Randomise function to module selection 2025-12-28 10:04:21 +13:00
TrèsAbhi fe68ebf450 Merge pull request #189 from Hitjack007/main
Fix Turret chnage not affecting DPM
2025-12-27 04:17:26 +00:00
TrèsAbhi 18cc885869 feat: hide bug in exclaim
Removed redundant comment about fixing a bug.
2025-12-26 21:13:06 -06:00
Mark Greene 9d4e1a66a1 Fix Turret chnage not affecting DPM 2025-12-27 15:35:16 +13:00
TrèsAbhi de8d3396b1 fix: use normalized dvpl path 2025-12-16 12:35:56 -06:00
TrèsAbhi baaae612fd Merge branch 'main' into dev 2025-12-15 22:29:04 -06:00
TrèsAbhi 4b5a511216 fix: use resolve 2025-12-15 22:26:37 -06:00
TrèsAbhi 57dacddcfd fix: use resolve 2025-12-15 22:26:14 -06:00
TrèsAbhi a56665f3a3 Merge branch 'main' into dev 2025-12-15 22:24:41 -06:00
TrèsAbhi c27e903c31 New translations en.json (Chinese Simplified) (#187) 2025-12-15 22:24:06 -06:00
TrèsAbhi 476f180a1a New translations en.json (French) (#186) 2025-12-14 20:02:16 -06:00
TrèsAbhi b05e70faee feat: clear all provisions 2025-12-10 23:03:30 -06:00
TrèsAbhi 5c30169eca fix: canvas smooth resize 2025-12-10 22:57:21 -06:00
TrèsAbhi 1226ce89a7 fix: shallow testing 2025-12-10 17:46:58 -06:00
TrèsAbhi dcc8207fb6 fix: deconstructor 2025-12-10 17:31:03 -06:00
TrèsAbhi c50f40a887 fix: default 2025-12-10 17:15:35 -06:00
TrèsAbhi 85f7d420a0 feat: logs 2025-12-10 17:14:18 -06:00
TrèsAbhi 1aec1b2885 feat: add zip abilities 2025-12-10 17:13:12 -06:00
TrèsAbhi 51226c8503 Merge branch 'main' into dev 2025-12-10 16:54:49 -06:00
TrèsAbhi 407d00b25b Update index.astro 2025-12-05 09:35:05 -06:00
TrèsAbhi fb4fb926e8 fix: add boxShadow to Giveaway component for improved styling 2025-12-04 14:22:24 -06:00
TrèsAbhi 70b0df55b0 fix: add drop-shadow filter to Giveaway component image for better visibility 2025-12-04 14:21:32 -06:00
TrèsAbhi 7e8fd40c61 fix: format minutes and seconds in Giveaway component for better readability 2025-12-04 14:20:23 -06:00
TrèsAbhi 9286104391 feat: enhance Giveaway component with skeleton loading state 2025-12-04 14:19:35 -06:00
TrèsAbhi 814192c0b0 feat: add Giveaway component for Music Box event with countdown timer 2025-12-04 14:17:53 -06:00
TrèsAbhi 8fa6f87540 fix: update disclaimer for Christmas Garage Guide 2025 2025-12-04 12:29:50 -06:00
TrèsAbhi d265f0b0a1 fix: clarify Christmas Tree ornament set requirements in Christmas Garage Guide 2025 2025-12-03 18:29:32 -06:00
TrèsAbhi 9ccaade1fc fix: clarify Christmas Tree upgrade mechanics in Christmas Garage Guide 2025 2025-12-03 18:28:56 -06:00
TrèsAbhi 2bb5bb33c0 fix: enhance clarity on Christmas Tree upgrade benefits in Christmas Garage Guide 2025 2025-12-03 18:28:03 -06:00
TrèsAbhi e456063c27 fix: clarify Music Box mechanics in Christmas Garage Guide 2025 2025-12-03 18:26:54 -06:00
TrèsAbhi 7bc25f0722 fix: clarify Music Box mechanics in Christmas Garage Guide 2025 2025-12-03 18:26:12 -06:00
TrèsAbhi 6ed991d281 fix: clarify Music Box mechanics in Christmas Garage Guide 2025 2025-12-03 18:25:02 -06:00
GonnaHetzMe 2487e0eebf Update GitHub Actions to latest versions (#185) 2025-12-03 18:22:53 -06:00
TrèsAbhi 6cc44cdfee feat: add ArticlePlug component for Christmas 2025 promotion 2025-12-03 18:12:41 -06:00
TrèsAbhi eca26e1e79 feat: enhance Christmas Garage Guide 2025 with detailed mechanics and rewards 2025-12-03 18:01:05 -06:00
TrèsAbhi 5484a15071 fix: standardize import quotes and set maxWidth for PageWrapper 2025-12-03 17:51:19 -06:00
TrèsAbhi b58ca4f594 feat: move guide to guides 2025-12-03 17:49:16 -06:00
TrèsAbhi 7708e2c1db feat: add Christmas Garage Guide 2025 and update settings 2025-12-03 17:48:29 -06:00
TrèsAbhi de77e27d50 fix: max 25 seasons 2025-12-01 17:13:26 -06:00
TrèsAbhi e159583333 fix: use repos direct 2025-12-01 17:02:54 -06:00
TrèsAbhi bfcf183a6e feat: hide warning 2025-12-01 17:01:19 -06:00
TrèsAbhi 8c1bf450a8 fix: use map's ahs 2025-11-29 15:22:13 -06:00
TrèsAbhi 9ffc040723 feat: implement all methods 2025-11-29 15:16:09 -06:00
TrèsAbhi f33a73e1bb feat: zip reader 2025-11-29 14:34:06 -06:00
70 changed files with 2459 additions and 1146 deletions

No files matched your search

+6 -5
View File
@@ -16,10 +16,11 @@ on:
- blitzkit/assets-dev - blitzkit/assets-dev
default: blitzkit/assets default: blitzkit/assets
archive_url: asset_source:
type: string type: string
required: false 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: schedule:
- cron: "0 2 * * *" - cron: "0 2 * * *"
@@ -64,18 +65,18 @@ jobs:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v4 - uses: actions/checkout@v6
with: with:
submodules: recursive submodules: recursive
token: ${{ secrets.GH_TOKEN }} token: ${{ secrets.GH_TOKEN }}
- uses: arduino/setup-protoc@v3 - uses: arduino/setup-protoc@v3
with: with:
repo-token: ${{ secrets.GH_TOKEN }} repo-token: ${{ secrets.GH_TOKEN }}
- uses: oven-sh/setup-bun@v1 - uses: oven-sh/setup-bun@v2
- run: bun run setup - run: bun run setup
- name: AppArmor hack - name: AppArmor hack
run: echo 0 | sudo tee /proc/sys/kernel/apparmor_restrict_unprivileged_userns run: echo 0 | sudo tee /proc/sys/kernel/apparmor_restrict_unprivileged_userns
- name: Build assets - 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' }}
+2 -2
View File
@@ -32,11 +32,11 @@ jobs:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v4 - uses: actions/checkout@v6
with: with:
submodules: recursive submodules: recursive
token: ${{ secrets.GH_TOKEN }} token: ${{ secrets.GH_TOKEN }}
- uses: oven-sh/setup-bun@v1 - uses: oven-sh/setup-bun@v2
- uses: arduino/setup-protoc@v3 - uses: arduino/setup-protoc@v3
with: with:
repo-token: ${{ secrets.GH_TOKEN }} repo-token: ${{ secrets.GH_TOKEN }}
+3 -3
View File
@@ -14,11 +14,11 @@ jobs:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v4 - uses: actions/checkout@v6
with: with:
submodules: recursive submodules: recursive
token: ${{ secrets.GH_TOKEN }} token: ${{ secrets.GH_TOKEN }}
- uses: oven-sh/setup-bun@v1 - uses: oven-sh/setup-bun@v2
- uses: arduino/setup-protoc@v3 - uses: arduino/setup-protoc@v3
with: with:
repo-token: ${{ secrets.GH_TOKEN }} repo-token: ${{ secrets.GH_TOKEN }}
@@ -28,7 +28,7 @@ jobs:
run: bun run build:bot run: bun run build:bot
- name: Archive build - name: Archive build
uses: actions/upload-artifact@v4 uses: actions/upload-artifact@v5
with: with:
name: bot name: bot
path: dist/bot path: dist/bot
+2 -2
View File
@@ -22,11 +22,11 @@ jobs:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v4 - uses: actions/checkout@v6
with: with:
submodules: recursive submodules: recursive
token: ${{ secrets.GH_TOKEN }} token: ${{ secrets.GH_TOKEN }}
- uses: oven-sh/setup-bun@v1 - uses: oven-sh/setup-bun@v2
- uses: arduino/setup-protoc@v3 - uses: arduino/setup-protoc@v3
with: with:
repo-token: ${{ secrets.GH_TOKEN }} repo-token: ${{ secrets.GH_TOKEN }}
+1 -1
View File
@@ -42,7 +42,7 @@ jobs:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: oven-sh/setup-bun@v1 - uses: oven-sh/setup-bun@v2
- uses: arduino/setup-protoc@v3 - uses: arduino/setup-protoc@v3
with: with:
repo-token: ${{ secrets.GH_TOKEN }} repo-token: ${{ secrets.GH_TOKEN }}
+2 -2
View File
@@ -32,11 +32,11 @@ jobs:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v4 - uses: actions/checkout@v6
with: with:
submodules: recursive submodules: recursive
token: ${{ secrets.GH_TOKEN }} token: ${{ secrets.GH_TOKEN }}
- uses: oven-sh/setup-bun@v1 - uses: oven-sh/setup-bun@v2
- uses: arduino/setup-protoc@v3 - uses: arduino/setup-protoc@v3
with: with:
repo-token: ${{ secrets.GH_TOKEN }} repo-token: ${{ secrets.GH_TOKEN }}
+2 -2
View File
@@ -32,11 +32,11 @@ jobs:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v4 - uses: actions/checkout@v6
with: with:
submodules: recursive submodules: recursive
token: ${{ secrets.GH_TOKEN }} token: ${{ secrets.GH_TOKEN }}
- uses: oven-sh/setup-bun@v1 - uses: oven-sh/setup-bun@v2
- uses: arduino/setup-protoc@v3 - uses: arduino/setup-protoc@v3
with: with:
repo-token: ${{ secrets.GH_TOKEN }} repo-token: ${{ secrets.GH_TOKEN }}
+2 -2
View File
@@ -32,11 +32,11 @@ jobs:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v4 - uses: actions/checkout@v6
with: with:
submodules: recursive submodules: recursive
token: ${{ secrets.GH_TOKEN }} token: ${{ secrets.GH_TOKEN }}
- uses: oven-sh/setup-bun@v1 - uses: oven-sh/setup-bun@v2
- uses: arduino/setup-protoc@v3 - uses: arduino/setup-protoc@v3
with: with:
repo-token: ${{ secrets.GH_TOKEN }} repo-token: ${{ secrets.GH_TOKEN }}
+2 -2
View File
@@ -24,11 +24,11 @@ jobs:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v4 - uses: actions/checkout@v6
with: with:
submodules: recursive submodules: recursive
token: ${{ secrets.GH_TOKEN }} token: ${{ secrets.GH_TOKEN }}
- uses: oven-sh/setup-bun@v1 - uses: oven-sh/setup-bun@v2
- uses: arduino/setup-protoc@v3 - uses: arduino/setup-protoc@v3
with: with:
repo-token: ${{ secrets.GH_TOKEN }} repo-token: ${{ secrets.GH_TOKEN }}
+3 -3
View File
@@ -38,11 +38,11 @@ jobs:
name: Build name: Build
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v4 - uses: actions/checkout@v6
with: with:
submodules: recursive submodules: recursive
token: ${{ secrets.GH_TOKEN }} token: ${{ secrets.GH_TOKEN }}
- uses: oven-sh/setup-bun@v1 - uses: oven-sh/setup-bun@v2
- uses: arduino/setup-protoc@v3 - uses: arduino/setup-protoc@v3
with: with:
repo-token: ${{ secrets.GH_TOKEN }} repo-token: ${{ secrets.GH_TOKEN }}
@@ -53,7 +53,7 @@ jobs:
run: bun run build:website run: bun run build:website
- name: Upload artifact - name: Upload artifact
uses: actions/upload-pages-artifact@v3 uses: actions/upload-pages-artifact@v4
with: with:
path: dist/website path: dist/website
+4
View File
@@ -65,6 +65,7 @@
"deburr", "deburr",
"decalmask", "decalmask",
"decompressor", "decompressor",
"décor",
"dedup", "dedup",
"defence", "defence",
"degressive", "degressive",
@@ -74,6 +75,7 @@
"DIDS", "DIDS",
"donotremove", "donotremove",
"drei", "drei",
"Droodles",
"dvpd", "dvpd",
"dvpl", "dvpl",
"DVPLCRC", "DVPLCRC",
@@ -96,9 +98,11 @@
"gameplay", "gameplay",
"glsl", "glsl",
"GLTF", "GLTF",
"GSOR",
"gtag", "gtag",
"haha", "haha",
"Herdbreaker", "Herdbreaker",
"Hetz",
"highp", "highp",
"iife", "iife",
"imgur", "imgur",
+5
View File
@@ -122,6 +122,7 @@
"steam-user": "^5.2.3", "steam-user": "^5.2.3",
"three": "^0.180.0", "three": "^0.180.0",
"ts-proto": "^2.7.7", "ts-proto": "^2.7.7",
"unzipit": "^1.4.3",
"yaml": "^2.8.1", "yaml": "^2.8.1",
}, },
}, },
@@ -2413,6 +2414,8 @@
"unstorage": ["[email protected]", "", { "dependencies": { "anymatch": "^3.1.3", "chokidar": "^4.0.3", "destr": "^2.0.5", "h3": "^1.15.4", "lru-cache": "^10.4.3", "node-fetch-native": "^1.6.7", "ofetch": "^1.4.1", "ufo": "^1.6.1" }, "peerDependencies": { "@azure/app-configuration": "^1.8.0", "@azure/cosmos": "^4.2.0", "@azure/data-tables": "^13.3.0", "@azure/identity": "^4.6.0", "@azure/keyvault-secrets": "^4.9.0", "@azure/storage-blob": "^12.26.0", "@capacitor/preferences": "^6.0.3 || ^7.0.0", "@deno/kv": ">=0.9.0", "@netlify/blobs": "^6.5.0 || ^7.0.0 || ^8.1.0 || ^9.0.0 || ^10.0.0", "@planetscale/database": "^1.19.0", "@upstash/redis": "^1.34.3", "@vercel/blob": ">=0.27.1", "@vercel/functions": "^2.2.12 || ^3.0.0", "@vercel/kv": "^1.0.1", "aws4fetch": "^1.0.20", "db0": ">=0.2.1", "idb-keyval": "^6.2.1", "ioredis": "^5.4.2", "uploadthing": "^7.4.4" }, "optionalPeers": ["@azure/app-configuration", "@azure/cosmos", "@azure/data-tables", "@azure/identity", "@azure/keyvault-secrets", "@azure/storage-blob", "@capacitor/preferences", "@deno/kv", "@netlify/blobs", "@planetscale/database", "@upstash/redis", "@vercel/blob", "@vercel/functions", "@vercel/kv", "aws4fetch", "db0", "idb-keyval", "ioredis", "uploadthing"] }, "sha512-KKGwRTT0iVBCErKemkJCLs7JdxNVfqTPc/85ae1XES0+bsHbc/sFBfVi5kJp156cc51BHinIH2l3k0EZ24vOBQ=="], "unstorage": ["[email protected]", "", { "dependencies": { "anymatch": "^3.1.3", "chokidar": "^4.0.3", "destr": "^2.0.5", "h3": "^1.15.4", "lru-cache": "^10.4.3", "node-fetch-native": "^1.6.7", "ofetch": "^1.4.1", "ufo": "^1.6.1" }, "peerDependencies": { "@azure/app-configuration": "^1.8.0", "@azure/cosmos": "^4.2.0", "@azure/data-tables": "^13.3.0", "@azure/identity": "^4.6.0", "@azure/keyvault-secrets": "^4.9.0", "@azure/storage-blob": "^12.26.0", "@capacitor/preferences": "^6.0.3 || ^7.0.0", "@deno/kv": ">=0.9.0", "@netlify/blobs": "^6.5.0 || ^7.0.0 || ^8.1.0 || ^9.0.0 || ^10.0.0", "@planetscale/database": "^1.19.0", "@upstash/redis": "^1.34.3", "@vercel/blob": ">=0.27.1", "@vercel/functions": "^2.2.12 || ^3.0.0", "@vercel/kv": "^1.0.1", "aws4fetch": "^1.0.20", "db0": ">=0.2.1", "idb-keyval": "^6.2.1", "ioredis": "^5.4.2", "uploadthing": "^7.4.4" }, "optionalPeers": ["@azure/app-configuration", "@azure/cosmos", "@azure/data-tables", "@azure/identity", "@azure/keyvault-secrets", "@azure/storage-blob", "@capacitor/preferences", "@deno/kv", "@netlify/blobs", "@planetscale/database", "@upstash/redis", "@vercel/blob", "@vercel/functions", "@vercel/kv", "aws4fetch", "db0", "idb-keyval", "ioredis", "uploadthing"] }, "sha512-KKGwRTT0iVBCErKemkJCLs7JdxNVfqTPc/85ae1XES0+bsHbc/sFBfVi5kJp156cc51BHinIH2l3k0EZ24vOBQ=="],
"unzipit": ["[email protected]", "", { "dependencies": { "uzip-module": "^1.0.2" } }, "sha512-gsq2PdJIWWGhx5kcdWStvNWit9FVdTewm4SEG7gFskWs+XCVaULt9+BwuoBtJiRE8eo3L1IPAOrbByNLtLtIlg=="],
"upath": ["[email protected]", "", {}, "sha512-aZwGpamFO61g3OlfT7OQCHqhGnW43ieH9WZeP7QxN/G/jS4jfqUkZxoryvJgVPEcrl5NL/ggHsSmLMHuH64Lhg=="], "upath": ["[email protected]", "", {}, "sha512-aZwGpamFO61g3OlfT7OQCHqhGnW43ieH9WZeP7QxN/G/jS4jfqUkZxoryvJgVPEcrl5NL/ggHsSmLMHuH64Lhg=="],
"update-browserslist-db": ["[email protected]", "", { "dependencies": { "escalade": "^3.2.0", "picocolors": "^1.1.1" }, "peerDependencies": { "browserslist": ">= 4.21.0" }, "bin": { "update-browserslist-db": "cli.js" } }, "sha512-UxhIZQ+QInVdunkDAaiazvvT/+fXL5Osr0JZlJulepYu6Jd7qJtDZjlur0emRlT71EN3ScPoE7gvsuIKKNavKw=="], "update-browserslist-db": ["[email protected]", "", { "dependencies": { "escalade": "^3.2.0", "picocolors": "^1.1.1" }, "peerDependencies": { "browserslist": ">= 4.21.0" }, "bin": { "update-browserslist-db": "cli.js" } }, "sha512-UxhIZQ+QInVdunkDAaiazvvT/+fXL5Osr0JZlJulepYu6Jd7qJtDZjlur0emRlT71EN3ScPoE7gvsuIKKNavKw=="],
@@ -2431,6 +2434,8 @@
"utility-types": ["[email protected]", "", {}, "sha512-6Z7Ma2aVEWisaL6TvBCy7P8rm2LQoPv6dJ7ecIaIixHcwfbJ0x7mWdbcwlIM5IGQxPZSFYeqRCqlOOeKoJYMkw=="], "utility-types": ["[email protected]", "", {}, "sha512-6Z7Ma2aVEWisaL6TvBCy7P8rm2LQoPv6dJ7ecIaIixHcwfbJ0x7mWdbcwlIM5IGQxPZSFYeqRCqlOOeKoJYMkw=="],
"uzip-module": ["[email protected]", "", {}, "sha512-AMqwWZaknLM77G+VPYNZLEruMGWGzyigPK3/Whg99B3S6vGHuqsyl5ZrOv1UUF3paGK1U6PM0cnayioaryg/fA=="],
"varuna": ["varuna@workspace:packages/varuna"], "varuna": ["varuna@workspace:packages/varuna"],
"vfile": ["[email protected]", "", { "dependencies": { "@types/unist": "^3.0.0", "vfile-message": "^4.0.0" } }, "sha512-KzIbH/9tXat2u30jf+smMwFCsno4wHVdNmzFyL+T/L3UGqqk6JKfVqOFOZEpZSHADH1k40ab6NUIXZq422ov3Q=="], "vfile": ["[email protected]", "", { "dependencies": { "@types/unist": "^3.0.0", "vfile-message": "^4.0.0" } }, "sha512-KzIbH/9tXat2u30jf+smMwFCsno4wHVdNmzFyL+T/L3UGqqk6JKfVqOFOZEpZSHADH1k40ab6NUIXZq422ov3Q=="],
+44 -16
View File
@@ -1,19 +1,47 @@
# BlitzKit Credits # 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 | ### S0AP
| ------------------------------ | ------------------------------ |
| Bot verification | S0AP | BlitzKit Discord bot verification, testing, advertisement, and the initial encouragement to create BlitzKit.
| General testing | Prince_NA |
| Bot advertisement platform | S0AP | ### Prince_NA
| Bot rendering pipeline | Vovko |
| Game asset decompression | Maddox | BlitzKit Discord bot and website testing and general advise.
| Game 3D model parsing | Pyogenics |
| Game file layout | Aeson | ### Vovko
| 3-caliber rule edge cases | Minitelrose, ChickenMan7777 |
| Embed UX | \_34, HisRoyalFatness, Synx | BlitzKit Discord bot and website rendering pipeline.
| Tankopedia pre-release testing | [OPTML], Aeson, \_34, xkdkw |
| Website advertisement platform | Aeson | ### Maddox
| Compare pre-release testing | [OPTML] |
| Redacted | GonnaHetzMe | 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.
+5
View File
@@ -0,0 +1,5 @@
# BlitzKit 1.29.7
## Features
- Re-introduced the ability to deploy BlitzKit OpenTests
+19
View File
@@ -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
+14
View File
@@ -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
+57
View File
@@ -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.
![](https://i.imgur.com/HmbDw0x.jpeg)
## 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.
![](https://i.imgur.com/sxYV77L.jpeg)
## 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.
![](https://i.imgur.com/MXGxejz.jpeg)
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).
![](https://i.imgur.com/lxr7PE9.png)
## 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.
![](https://i.imgur.com/bcmQE8T.jpeg)
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).
![](https://i.imgur.com/MMbyYLn.jpeg)
## 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.
![](https://i.imgur.com/AONZN5O.jpeg)
Each upgrade unlocks a tier worth of rewards that you can claim in exchange for Free XP, Gold, Silver, and more Hot Coffees!
![](https://i.imgur.com/8fNy0Yj.png)
## 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.
![](https://i.imgur.com/Rj1WNCE.jpeg)
![](https://i.imgur.com/GAUd2uR.png)
Consider yourselves debriefed. Happy holidays!
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
+1 -1
View File
@@ -1,6 +1,6 @@
{ {
"name": "blitzkit", "name": "blitzkit",
"version": "1.29.6", "version": "1.29.9",
"license": "BlitzKit License", "license": "BlitzKit License",
"private": true, "private": true,
"scripts": { "scripts": {
@@ -52,7 +52,7 @@ export const ratingLeaderboardCommand = new Promise<CommandRegistry>(
const seasonNumbers = range( const seasonNumbers = range(
FIRST_MINIMAL_ARCHIVED_RATING_SEASON, FIRST_MINIMAL_ARCHIVED_RATING_SEASON,
latestArchivedSeasonNumber + (onGoingSeason ? 1 : 0) + 1 latestArchivedSeasonNumber + (onGoingSeason ? 1 : 0) + 1
); ).slice(-25);
function addOptions(option: SlashCommandSubcommandBuilder) { function addOptions(option: SlashCommandSubcommandBuilder) {
const { strings } = translator(Locale.EnglishUS); const { strings } = translator(Locale.EnglishUS);
@@ -196,7 +196,7 @@ export const ratingLeaderboardCommand = new Promise<CommandRegistry>(
strings.common.leagues as Record<string, string> strings.common.leagues as Record<string, string>
)[name] )[name]
), ),
}) satisfies APIApplicationCommandOptionChoice<string> } satisfies APIApplicationCommandOptionChoice<string>)
) )
) )
.setRequired(true); .setRequired(true);
@@ -219,8 +219,8 @@ export const ratingLeaderboardCommand = new Promise<CommandRegistry>(
const season = seasonOption const season = seasonOption
? parseInt(seasonOption) ? parseInt(seasonOption)
: onGoingSeason : onGoingSeason
? latestArchivedSeasonNumber + 1 ? latestArchivedSeasonNumber + 1
: latestArchivedSeasonNumber; : latestArchivedSeasonNumber;
const isCurrentSeason = season === latestArchivedSeasonNumber + 1; const isCurrentSeason = season === latestArchivedSeasonNumber + 1;
let titleName: string; let titleName: string;
let titleImage: string | undefined; let titleImage: string | undefined;
@@ -258,7 +258,7 @@ export const ratingLeaderboardCommand = new Promise<CommandRegistry>(
position: player.number, position: player.number,
clan: player.clan_tag, clan: player.clan_tag,
nickname: player.nickname, nickname: player.nickname,
}) satisfies SimplifiedPlayer } satisfies SimplifiedPlayer)
) )
) )
: await getArchivedRatingLeaderboard(region, season!).then( : await getArchivedRatingLeaderboard(region, season!).then(
@@ -295,7 +295,7 @@ export const ratingLeaderboardCommand = new Promise<CommandRegistry>(
.deleted_player, .deleted_player,
{ id: player.id } { id: player.id }
), ),
}) satisfies SimplifiedPlayer } satisfies SimplifiedPlayer)
); );
} }
); );
@@ -349,7 +349,7 @@ export const ratingLeaderboardCommand = new Promise<CommandRegistry>(
score: player.score, score: player.score,
clan: player.clan_tag, clan: player.clan_tag,
nickname: player.nickname, nickname: player.nickname,
}) satisfies SimplifiedPlayer } satisfies SimplifiedPlayer)
) )
) )
: await getArchivedRatingLeaderboard(region, season!).then( : await getArchivedRatingLeaderboard(region, season!).then(
@@ -19,9 +19,9 @@ export function localizationObject(
(!strict || validNameRegex.test(translation)) && translation.length > 0; (!strict || validNameRegex.test(translation)) && translation.length > 0;
if (!isValid) { if (!isValid) {
console.warn( // console.warn(
`Invalid localization for ${locale} (${path}): ${translation}; skipping...` // `Invalid localization for ${locale} (${path}): ${translation}; skipping...`
); // );
return localizations; return localizations;
} }
-25
View File
@@ -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, GunDefinition,
Provision, Provision,
TankDefinition, TankDefinition,
} from '../protos'; } from "../protos";
export function checkConsumableProvisionInclusivity( export function checkConsumableProvisionInclusivity(
consumableProvision: Consumable | Provision, consumableProvision: Consumable | Provision,
tank: TankDefinition, tank: TankDefinition,
gun: GunDefinition, gun: GunDefinition
) { ) {
const included = const included = consumableProvision.include?.every((rule) => {
!consumableProvision.game_mode_exclusive && switch (rule.filter_type!.$case) {
consumableProvision.include?.every((rule) => { case "tiers":
switch (rule.filter_type!.$case) { return (
case 'tiers': rule.filter_type!.value.min <= tank.tier &&
return ( tank.tier <= rule.filter_type!.value.max
rule.filter_type!.value.min <= tank.tier && );
tank.tier <= rule.filter_type!.value.max
);
case 'ids': case "ids":
return rule.filter_type!.value.ids.includes(tank.id); return rule.filter_type!.value.ids.includes(tank.id);
case 'nations': case "nations":
return rule.filter_type!.value.nations.includes(tank.nation); return rule.filter_type!.value.nations.includes(tank.nation);
case 'categories': case "categories":
throw new SyntaxError('Category filtering found in include rule'); throw new SyntaxError("Category filtering found in include rule");
} }
}); });
const excluded = const excluded = consumableProvision.exclude?.some((rule) => {
consumableProvision.game_mode_exclusive || switch (rule.filter_type!.$case) {
consumableProvision.exclude?.some((rule) => { case "tiers":
switch (rule.filter_type!.$case) { return (
case 'tiers': rule.filter_type!.value.min <= tank.tier &&
return ( tank.tier <= rule.filter_type!.value.max
rule.filter_type!.value.min <= tank.tier && );
tank.tier <= rule.filter_type!.value.max
);
case 'ids': case "ids":
return rule.filter_type!.value.ids.includes(tank.id); return rule.filter_type!.value.ids.includes(tank.id);
case 'nations': case "nations":
return rule.filter_type!.value.nations.includes(tank.nation); return rule.filter_type!.value.nations.includes(tank.nation);
case 'categories': case "categories":
return rule.filter_type!.value.categories.some((category) => { return rule.filter_type!.value.categories.some((category) => {
switch (category) { switch (category) {
case ConsumableTankCategoryFilterCategory.CLIP: case ConsumableTankCategoryFilterCategory.CLIP:
return gun.gun_type!.$case !== 'regular'; return gun.gun_type!.$case !== "regular";
} }
}); });
} }
}); });
return ( return consumableProvision.include?.length > 0 && included && !excluded;
!consumableProvision.game_mode_exclusive &&
consumableProvision.include?.length > 0 &&
included &&
!excluded
);
} }
@@ -17,7 +17,7 @@ export async function getArchivedLatestSeasonNumber() {
if (ratingInfo.detail) { if (ratingInfo.detail) {
const regionsURL = ( const regionsURL = (
(await fetch( (await fetch(
`https://api.github.com/repos/tresabhi/${assertSecret( `https://api.github.com/repos/${assertSecret(
import.meta.env.PUBLIC_ASSET_REPO import.meta.env.PUBLIC_ASSET_REPO
)}/git/trees/main` )}/git/trees/main`
).then((response) => response.json())) as GitHubTrees ).then((response) => response.json())) as GitHubTrees
+19 -6
View File
@@ -15,7 +15,8 @@
"hp": "{value}hp", "hp": "{value}hp",
"x": "x{value}", "x": "x{value}",
"percentage": "{value}%", "percentage": "{value}%",
"deg_s": "{value}°/s" "deg_s": "{value}°/s",
"plus": "+{value}"
}, },
"gun_types": { "gun_types": {
@@ -26,8 +27,8 @@
"shells": { "shells": {
"ap": "AP", "ap": "AP",
"apcr": "APCR", "ap_cr": "APCR",
"heat": "HEAT", "hc": "HEAT",
"he": "HE" "he": "HE"
}, },
@@ -759,11 +760,15 @@
"count_singular": "1 tank", "count_singular": "1 tank",
"count_plural": "{count} tanks", "count_plural": "{count} tanks",
"sorting_by": "Sorting by {name}", "sorting_by": "Sorting by {name}",
"clear": "Clear",
"tier": "Tier {tier}",
"no_tanks_found": { "no_tanks_found": {
"body": "No tanks found.", "body": "No tanks found.",
"search_again": "Try searching again.", "search_again": "Try searching again.",
"clear_filters": "Try clearing filters." "clear_filters": "Try clearing filters."
}, },
"sort": { "sort": {
"meta.none": "none", "meta.none": "none",
"survivability.health": "health", "survivability.health": "health",
@@ -917,7 +922,13 @@
"next": "Next", "next": "Next",
"no_results": "No results" "no_results": "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": { "tankopedia": {
@@ -1267,10 +1278,12 @@
"upgrade": "Upgrade" "upgrade": "Upgrade"
}, },
"provisions": { "provisions": {
"clear": "Clear" "clear": "Clear this tank",
"clear_all": "Clear all tanks"
}, },
"consumables": { "consumables": {
"clear": "Clear" "clear": "Clear this tank",
"clear_all": "Clear all tanks"
} }
} }
}, },
+17 -6
View File
@@ -13,7 +13,8 @@
"hp": "{value}hp", "hp": "{value}hp",
"x": "x{value}", "x": "x{value}",
"percentage": "{value}%", "percentage": "{value}%",
"deg_s": "{value}°/s" "deg_s": "{value}°/s",
"plus": "+{value}"
}, },
"gun_types": { "gun_types": {
"auto_loader": "Auto cargador", "auto_loader": "Auto cargador",
@@ -22,8 +23,8 @@
}, },
"shells": { "shells": {
"ap": "AP", "ap": "AP",
"apcr": "APCR", "ap_cr": "APCR",
"heat": "AEAC", "hc": "HEAT",
"he": "AE" "he": "AE"
}, },
"player_count_period": { "player_count_period": {
@@ -668,6 +669,8 @@
"count_singular": "1 tanque", "count_singular": "1 tanque",
"count_plural": "{count} tanks", "count_plural": "{count} tanks",
"sorting_by": "Sorting by {name}", "sorting_by": "Sorting by {name}",
"clear": "Limpiar",
"tier": "Tier {tier}",
"no_tanks_found": { "no_tanks_found": {
"body": "No se encontraron tanques.", "body": "No se encontraron tanques.",
"search_again": "Intenta buscar de nuevo.", "search_again": "Intenta buscar de nuevo.",
@@ -814,7 +817,13 @@
"next": "Next", "next": "Next",
"no_results": "Sin resultados" "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": { "tankopedia": {
"search": "Search a stat...", "search": "Search a stat...",
@@ -1135,10 +1144,12 @@
"upgrade": "Mejorar" "upgrade": "Mejorar"
}, },
"provisions": { "provisions": {
"clear": "Limpiar" "clear": "Clear this tank",
"clear_all": "Clear all tanks"
}, },
"consumables": { "consumables": {
"clear": "Limpiar" "clear": "Clear this tank",
"clear_all": "Clear all tanks"
} }
} }
}, },
+18 -7
View File
@@ -13,7 +13,8 @@
"hp": "{value}hp", "hp": "{value}hp",
"x": "x{value}", "x": "x{value}",
"percentage": "{value}%", "percentage": "{value}%",
"deg_s": "{value}°/s" "deg_s": "{value}°/s",
"plus": "+{value}"
}, },
"gun_types": { "gun_types": {
"auto_loader": "Chargement auto", "auto_loader": "Chargement auto",
@@ -22,8 +23,8 @@
}, },
"shells": { "shells": {
"ap": "AP", "ap": "AP",
"apcr": "APCR", "ap_cr": "APCR",
"heat": "HEAT", "hc": "HEAT",
"he": "HE" "he": "HE"
}, },
"player_count_period": { "player_count_period": {
@@ -612,7 +613,7 @@
} }
}, },
"rating": { "rating": {
"name": "rating", "name": "côtée",
"description": "Rating player's statistics", "description": "Rating player's statistics",
"subcommands": { "subcommands": {
"today": { "today": {
@@ -668,6 +669,8 @@
"count_singular": "1 tank", "count_singular": "1 tank",
"count_plural": "{count} tanks", "count_plural": "{count} tanks",
"sorting_by": "Sorting by {name}", "sorting_by": "Sorting by {name}",
"clear": "Clear",
"tier": "Tier {tier}",
"no_tanks_found": { "no_tanks_found": {
"body": "No tanks found.", "body": "No tanks found.",
"search_again": "Try searching again.", "search_again": "Try searching again.",
@@ -814,7 +817,13 @@
"next": "Next", "next": "Next",
"no_results": "No results" "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": { "tankopedia": {
"search": "Search a stat...", "search": "Search a stat...",
@@ -1135,10 +1144,12 @@
"upgrade": "Upgrade" "upgrade": "Upgrade"
}, },
"provisions": { "provisions": {
"clear": "Clear" "clear": "Clear",
"clear_all": "Clear all tanks"
}, },
"consumables": { "consumables": {
"clear": "Clear" "clear": "Clear",
"clear_all": "Clear all tanks"
} }
} }
}, },
+17 -6
View File
@@ -13,7 +13,8 @@
"hp": "{value}hp", "hp": "{value}hp",
"x": "x{value}", "x": "x{value}",
"percentage": "{value}%", "percentage": "{value}%",
"deg_s": "{value}°/s" "deg_s": "{value}°/s",
"plus": "+{value}"
}, },
"gun_types": { "gun_types": {
"auto_loader": "自動装填砲", "auto_loader": "自動装填砲",
@@ -22,8 +23,8 @@
}, },
"shells": { "shells": {
"ap": "AP", "ap": "AP",
"apcr": "APCR", "ap_cr": "APCR",
"heat": "HEAT", "hc": "HEAT",
"he": "HE" "he": "HE"
}, },
"player_count_period": { "player_count_period": {
@@ -668,6 +669,8 @@
"count_singular": "1 輌", "count_singular": "1 輌",
"count_plural": "{count} tanks", "count_plural": "{count} tanks",
"sorting_by": "Sorting by {name}", "sorting_by": "Sorting by {name}",
"clear": "クリア",
"tier": "Tier {tier}",
"no_tanks_found": { "no_tanks_found": {
"body": "該当する車輌が存在しません。", "body": "該当する車輌が存在しません。",
"search_again": "もう一度検索してください。", "search_again": "もう一度検索してください。",
@@ -814,7 +817,13 @@
"next": "Next", "next": "Next",
"no_results": "該当なし" "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": { "tankopedia": {
"search": "Search a stat...", "search": "Search a stat...",
@@ -1135,10 +1144,12 @@
"upgrade": "最終装備" "upgrade": "最終装備"
}, },
"provisions": { "provisions": {
"clear": "クリア" "clear": "Clear this tank",
"clear_all": "Clear all tanks"
}, },
"consumables": { "consumables": {
"clear": "クリア" "clear": "Clear this tank",
"clear_all": "Clear all tanks"
} }
} }
}, },
+17 -6
View File
@@ -13,7 +13,8 @@
"hp": "{value}hp", "hp": "{value}hp",
"x": "x{value}", "x": "x{value}",
"percentage": "{value}%", "percentage": "{value}%",
"deg_s": "{value}°/s" "deg_s": "{value}°/s",
"plus": "+{value}"
}, },
"gun_types": { "gun_types": {
"auto_loader": "Auto loader", "auto_loader": "Auto loader",
@@ -22,8 +23,8 @@
}, },
"shells": { "shells": {
"ap": "AP", "ap": "AP",
"apcr": "APCR", "ap_cr": "APCR",
"heat": "HEAT", "hc": "HEAT",
"he": "OB" "he": "OB"
}, },
"player_count_period": { "player_count_period": {
@@ -668,6 +669,8 @@
"count_singular": "1 tank", "count_singular": "1 tank",
"count_plural": "{count} tanks", "count_plural": "{count} tanks",
"sorting_by": "Sorting by {name}", "sorting_by": "Sorting by {name}",
"clear": "Clear",
"tier": "Tier {tier}",
"no_tanks_found": { "no_tanks_found": {
"body": "No tanks found.", "body": "No tanks found.",
"search_again": "Try searching again.", "search_again": "Try searching again.",
@@ -814,7 +817,13 @@
"next": "Next", "next": "Next",
"no_results": "Brak wyników" "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": { "tankopedia": {
"search": "Search a stat...", "search": "Search a stat...",
@@ -1135,10 +1144,12 @@
"upgrade": "Upgrade" "upgrade": "Upgrade"
}, },
"provisions": { "provisions": {
"clear": "Clear" "clear": "Clear this tank",
"clear_all": "Clear all tanks"
}, },
"consumables": { "consumables": {
"clear": "Clear" "clear": "Clear this tank",
"clear_all": "Clear all tanks"
} }
} }
}, },
+17 -6
View File
@@ -13,7 +13,8 @@
"hp": "{value}hp", "hp": "{value}hp",
"x": "x{value}", "x": "x{value}",
"percentage": "{value}%", "percentage": "{value}%",
"deg_s": "{value}°/s" "deg_s": "{value}°/s",
"plus": "+{value}"
}, },
"gun_types": { "gun_types": {
"auto_loader": "Autocarregador", "auto_loader": "Autocarregador",
@@ -22,8 +23,8 @@
}, },
"shells": { "shells": {
"ap": "AP", "ap": "AP",
"apcr": "APCR", "ap_cr": "APCR",
"heat": "HEAT", "hc": "HEAT",
"he": "HE" "he": "HE"
}, },
"player_count_period": { "player_count_period": {
@@ -668,6 +669,8 @@
"count_singular": "1 tanque", "count_singular": "1 tanque",
"count_plural": "{count} tanks", "count_plural": "{count} tanks",
"sorting_by": "Sorting by {name}", "sorting_by": "Sorting by {name}",
"clear": "Limpar",
"tier": "Tier {tier}",
"no_tanks_found": { "no_tanks_found": {
"body": "Nenhum tanque encontrado.", "body": "Nenhum tanque encontrado.",
"search_again": "Tente pesquisar novamente.", "search_again": "Tente pesquisar novamente.",
@@ -814,7 +817,13 @@
"next": "Next", "next": "Next",
"no_results": "Sem resultados" "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": { "tankopedia": {
"search": "Search a stat...", "search": "Search a stat...",
@@ -1135,10 +1144,12 @@
"upgrade": "Melhorar" "upgrade": "Melhorar"
}, },
"provisions": { "provisions": {
"clear": "Limpar" "clear": "Clear this tank",
"clear_all": "Clear all tanks"
}, },
"consumables": { "consumables": {
"clear": "Limpar" "clear": "Clear this tank",
"clear_all": "Clear all tanks"
} }
} }
}, },
+17 -6
View File
@@ -13,7 +13,8 @@
"hp": "{value}оп", "hp": "{value}оп",
"x": "x{value}", "x": "x{value}",
"percentage": "{value}%", "percentage": "{value}%",
"deg_s": "{value}°/с" "deg_s": "{value}°/с",
"plus": "+{value}"
}, },
"gun_types": { "gun_types": {
"auto_loader": "Барабан", "auto_loader": "Барабан",
@@ -22,8 +23,8 @@
}, },
"shells": { "shells": {
"ap": "ББ", "ap": "ББ",
"apcr": "БП", "ap_cr": "БП",
"heat": "КС", "hc": "ОФ",
"he": "ОФ" "he": "ОФ"
}, },
"player_count_period": { "player_count_period": {
@@ -668,6 +669,8 @@
"count_singular": "1 танк", "count_singular": "1 танк",
"count_plural": "Танков: {count}", "count_plural": "Танков: {count}",
"sorting_by": "Сортировать по {name}", "sorting_by": "Сортировать по {name}",
"clear": "Очистить",
"tier": " {tier} уровня",
"no_tanks_found": { "no_tanks_found": {
"body": "Танков не найдено.", "body": "Танков не найдено.",
"search_again": "Попробуйте повторить поиск.", "search_again": "Попробуйте повторить поиск.",
@@ -814,7 +817,13 @@
"next": "Следующий", "next": "Следующий",
"no_results": "Ничего не найденo" "no_results": "Ничего не найденo"
}, },
"stats": "{correct} / {total} угадано верно" "stats": "{correct} / {total} правильно, серия: {streak}",
"help": {
"title": "Частично раскрыть танк?",
"description": "Показывает танк не показывая название. Этот раунд будет считаться проигранным и прекратит серию!",
"cancel": "Отмена",
"reveal": "Раскрыть"
}
}, },
"tankopedia": { "tankopedia": {
"search": "Поиск характеристик...", "search": "Поиск характеристик...",
@@ -1135,10 +1144,12 @@
"upgrade": "Топ" "upgrade": "Топ"
}, },
"provisions": { "provisions": {
"clear": "Очистить" "clear": "Убрать",
"clear_all": "Убрать со всех"
}, },
"consumables": { "consumables": {
"clear": "Очистить" "clear": "Убрать",
"clear_all": "Убрать со всех"
} }
} }
}, },
+17 -6
View File
@@ -13,7 +13,8 @@
"hp": "{value}од", "hp": "{value}од",
"x": "x{value}", "x": "x{value}",
"percentage": "{value}%", "percentage": "{value}%",
"deg_s": "{value}град/c" "deg_s": "{value}град/c",
"plus": "+{value}"
}, },
"gun_types": { "gun_types": {
"auto_loader": "Магазинна система заряджання", "auto_loader": "Магазинна система заряджання",
@@ -22,8 +23,8 @@
}, },
"shells": { "shells": {
"ap": "ББ", "ap": "ББ",
"apcr": "БП", "ap_cr": "APCR",
"heat": "КС", "hc": "HEAT",
"he": "ОФ" "he": "ОФ"
}, },
"player_count_period": { "player_count_period": {
@@ -668,6 +669,8 @@
"count_singular": "1 танк", "count_singular": "1 танк",
"count_plural": "Танків: {count} ", "count_plural": "Танків: {count} ",
"sorting_by": "Відсортувати за {name}", "sorting_by": "Відсортувати за {name}",
"clear": "Clear",
"tier": "Рівень {tier}",
"no_tanks_found": { "no_tanks_found": {
"body": "Нічого не знайдено.", "body": "Нічого не знайдено.",
"search_again": "Спробуйте шукати заново.", "search_again": "Спробуйте шукати заново.",
@@ -814,7 +817,13 @@
"next": "Next", "next": "Next",
"no_results": "Немає результатів" "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": { "tankopedia": {
"search": "Search a stat...", "search": "Search a stat...",
@@ -1135,10 +1144,12 @@
"upgrade": "Upgrade" "upgrade": "Upgrade"
}, },
"provisions": { "provisions": {
"clear": "Clear" "clear": "Clear this tank",
"clear_all": "Clear all tanks"
}, },
"consumables": { "consumables": {
"clear": "Clear" "clear": "Clear this tank",
"clear_all": "Clear all tanks"
} }
} }
}, },
+18 -7
View File
@@ -13,7 +13,8 @@
"hp": "{value} 生命值", "hp": "{value} 生命值",
"x": "x{value}", "x": "x{value}",
"percentage": "{value}%", "percentage": "{value}%",
"deg_s": "{value}度°/秒" "deg_s": "{value}度°/秒",
"plus": "+{value}"
}, },
"gun_types": { "gun_types": {
"auto_loader": "弹夹型坦克", "auto_loader": "弹夹型坦克",
@@ -22,8 +23,8 @@
}, },
"shells": { "shells": {
"ap": "穿甲弹", "ap": "穿甲弹",
"apcr": "硬式复合穿甲弹", "ap_cr": "APCR",
"heat": "反战车高爆弹", "hc": "HEAT",
"he": "高爆弹" "he": "高爆弹"
}, },
"player_count_period": { "player_count_period": {
@@ -668,6 +669,8 @@
"count_singular": "1辆战车", "count_singular": "1辆战车",
"count_plural": "{count} 辆坦克", "count_plural": "{count} 辆坦克",
"sorting_by": "按 {name} 排序", "sorting_by": "按 {name} 排序",
"clear": "清除",
"tier": "{tier} 阶",
"no_tanks_found": { "no_tanks_found": {
"body": "找不到战车。", "body": "找不到战车。",
"search_again": "请尝试重新搜索。", "search_again": "请尝试重新搜索。",
@@ -804,7 +807,7 @@
}, },
"guess": { "guess": {
"name": "猜测", "name": "猜测",
"button": "What could it be?", "button": "这会是什么?",
"description": "坦克剪影小游戏", "description": "坦克剪影小游戏",
"seo_description": "看剪影猜坦克", "seo_description": "看剪影猜坦克",
"search": { "search": {
@@ -814,7 +817,13 @@
"next": "下一个", "next": "下一个",
"no_results": "沒有結果" "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": { "tankopedia": {
"search": "搜索属性……", "search": "搜索属性……",
@@ -1135,10 +1144,12 @@
"upgrade": "顶级配置" "upgrade": "顶级配置"
}, },
"provisions": { "provisions": {
"clear": "清除" "clear": "清除",
"clear_all": "Clear all tanks"
}, },
"consumables": { "consumables": {
"clear": "清除" "clear": "清除",
"clear_all": "Clear all tanks"
} }
} }
}, },
+1
View File
@@ -31,6 +31,7 @@
"steam-user": "^5.2.3", "steam-user": "^5.2.3",
"three": "^0.180.0", "three": "^0.180.0",
"ts-proto": "^2.7.7", "ts-proto": "^2.7.7",
"unzipit": "^1.4.3",
"yaml": "^2.8.1" "yaml": "^2.8.1"
}, },
"private": true, "private": true,
@@ -5,10 +5,12 @@ import { vfs } from "./constants";
export async function boosterIcons() { export async function boosterIcons() {
console.log("Building booster icons..."); console.log("Building booster icons...");
using uploader = new AssetUploader("booster icons"); const uploader = new AssetUploader("booster icons");
const boosterFiles = (vfs.dir(`Data/Gfx/Shared/boosters`)).filter( const boosterFiles = vfs
(file) => !file.includes("@2x.txt") && !file.startsWith("texture0") .dir("Data/Gfx/Shared/boosters")
); .filter(
(file) => !file.includes("@2x.txt") && !file.startsWith("texture0")
);
const image = sharp( const image = sharp(
await vfs.file(`Data/Gfx/Shared/boosters/texture0.packed.webp`) await vfs.file(`Data/Gfx/Shared/boosters/texture0.packed.webp`)
); );
+30 -9
View File
@@ -1,12 +1,33 @@
import { assertSecret } from "@blitzkit/core"; 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 steamPattern = /steam:(\d+)\/(\d+)/;
const DEPOT = 444202; const zipPattern = /zip:(.+)/;
export const vfs = await new SteamVFS( const source = Bun.argv
assertSecret(import.meta.env.STEAM_USERNAME), .find((arg) => arg.startsWith("--source="))
assertSecret(import.meta.env.STEAM_PASSWORD), ?.split("=")[1];
APP,
DEPOT let resolved: AbstractVFS;
).init();
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(".psd", "")
.replace(".txt", ""); .replace(".txt", "");
if (vfs.has(`Data/${configPath}.packed.webp`)) { if (vfs.resolve(`Data/${configPath}.packed.webp`)) {
const image = sharp( const image = sharp(
await vfs.file(`Data/${configPath}.packed.webp`) await vfs.file(`Data/${configPath}.packed.webp`)
); );
@@ -131,7 +131,7 @@ export async function consumableProvisionIcons() {
.replace(".psd", "") .replace(".psd", "")
.replace(".txt", ""); .replace(".txt", "");
if (vfs.has(`Data/${configPath}.packed.webp`)) { if (vfs.resolve(`Data/${configPath}.packed.webp`)) {
const image = sharp( const image = sharp(
await vfs.file(`Data/${configPath}.packed.webp`) await vfs.file(`Data/${configPath}.packed.webp`)
); );
+143 -149
View File
@@ -534,11 +534,11 @@ const blitzModuleTypeToBlitzkit: Record<keyof BlitzModuleType, ModuleType> = {
export async function definitions() { export async function definitions() {
console.log("Building definitions..."); console.log("Building definitions...");
using uploader = new AssetUploader("definitions"); const uploader = new AssetUploader("definitions");
const gameDefinitions: GameDefinitions = { const gameDefinitions: GameDefinitions = {
version: (await vfs.text('Data/version.txt')).split(" ")[0], version: (await vfs.text("Data/version.txt")).split(" ")[0],
nations: ( nations: (
await vfs.yaml<AvailableNationsYaml>('Data/available_nations.yaml') await vfs.yaml<AvailableNationsYaml>("Data/available_nations.yaml")
).available_nations, ).available_nations,
gameModes: {}, gameModes: {},
roles: {}, roles: {},
@@ -561,10 +561,12 @@ export async function definitions() {
[TankClass.TANK_DESTROYER]: { skills: [] }, [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 tankStringIdMap: Record<string, number> = {};
const optionalDevices = await vfs.xml<{ root: OptionalDevices }>( 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>> = {}; const stringsI18n: Record<string, Record<string, string>> = {};
@@ -617,9 +619,7 @@ export async function definitions() {
const provisions: ProvisionsCommon = {}; const provisions: ProvisionsCommon = {};
for (const match of ( for (const match of (
await vfs.text( await vfs.text(`Data/XML/item_defs/vehicles/common/consumables/list.xml`)
`Data/XML/item_defs/vehicles/common/consumables/list.xml`
)
).matchAll(/<items path="(.+)\.xml"\/>/g)) { ).matchAll(/<items path="(.+)\.xml"\/>/g)) {
if (match[1] === "prototypes") continue; if (match[1] === "prototypes") continue;
@@ -634,9 +634,7 @@ export async function definitions() {
} }
for (const match of ( for (const match of (
await vfs.text( await vfs.text(`Data/XML/item_defs/vehicles/common/provisions/list.xml`)
`Data/XML/item_defs/vehicles/common/provisions/list.xml`
)
).matchAll(/<items path="(.+)\.xml"\/>/g)) { ).matchAll(/<items path="(.+)\.xml"\/>/g)) {
if (match[1] === "prototypes") continue; if (match[1] === "prototypes") continue;
@@ -1559,87 +1557,85 @@ export async function definitions() {
const includeRaw = consumable.vehicleFilter?.include.vehicle; const includeRaw = consumable.vehicleFilter?.include.vehicle;
const excludeRaw = consumable.vehicleFilter?.exclude?.vehicle; const excludeRaw = consumable.vehicleFilter?.exclude?.vehicle;
if (!entry.game_mode_exclusive) { if (includeRaw) {
if (includeRaw) { entry.include = [];
entry.include = [];
if ("minLevel" in includeRaw) { if ("minLevel" in includeRaw) {
entry.include.push({ entry.include.push({
filter_type: { filter_type: {
$case: "tiers", $case: "tiers",
value: { value: {
min: includeRaw.minLevel, min: includeRaw.minLevel,
max: includeRaw.maxLevel, max: includeRaw.maxLevel,
},
}, },
}); },
} else if ("name" in includeRaw) { });
entry.include.push({ } else if ("name" in includeRaw) {
filter_type: { entry.include.push({
$case: "ids", filter_type: {
value: { $case: "ids",
ids: includeRaw.name.split(/ +/).map((key) => { value: {
return tankStringIdMap[key]; 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) { if (consumable.vehicleFilter?.include.nations) {
entry.include.push({ entry.include.push({
filter_type: { filter_type: {
$case: "nations", $case: "nations",
value: { value: {
nations: consumable.vehicleFilter.include.nations.split(" "), nations: consumable.vehicleFilter.include.nations.split(" "),
},
}, },
}); },
} });
} }
}
if (excludeRaw) { if (excludeRaw) {
entry.exclude = []; entry.exclude = [];
if ("name" in excludeRaw) { if ("name" in excludeRaw) {
entry.exclude!.push({ entry.exclude!.push({
filter_type: { filter_type: {
$case: "ids", $case: "ids",
value: { value: {
ids: excludeRaw.name.split(/ +/).map((key) => { ids: excludeRaw.name.split(/ +/).map((key) => {
return tankStringIdMap[key]; return tankStringIdMap[key];
}), }),
},
}, },
}); },
} else if ("extendedTags" in excludeRaw) { });
entry.exclude!.push({ } else if ("extendedTags" in excludeRaw) {
filter_type: { entry.exclude!.push({
$case: "categories", filter_type: {
value: { $case: "categories",
categories: excludeRaw.extendedTags value: {
.split(" ") categories: excludeRaw.extendedTags
.map( .split(" ")
(item) => .map(
blitzTankFilterDefinitionCategoryToBlitzkit[ (item) =>
item as BlitzTankFilterDefinitionCategory blitzTankFilterDefinitionCategoryToBlitzkit[
] item as BlitzTankFilterDefinitionCategory
), ]
}, ),
}, },
}); },
} else throw new SyntaxError("Unhandled exclude type"); });
} else throw new SyntaxError("Unhandled exclude type");
if (consumable.vehicleFilter?.exclude?.nations) { if (consumable.vehicleFilter?.exclude?.nations) {
entry.exclude!.push({ entry.exclude!.push({
filter_type: { filter_type: {
$case: "nations", $case: "nations",
value: { value: {
nations: consumable.vehicleFilter.exclude.nations.split(" "), nations: consumable.vehicleFilter.exclude.nations.split(" "),
},
}, },
}); },
} });
} }
} }
}); });
@@ -1659,87 +1655,85 @@ export async function definitions() {
const includeRaw = provision.vehicleFilter?.include.vehicle; const includeRaw = provision.vehicleFilter?.include.vehicle;
const excludeRaw = provision.vehicleFilter?.exclude?.vehicle; const excludeRaw = provision.vehicleFilter?.exclude?.vehicle;
if (!entry.game_mode_exclusive) { if (includeRaw) {
if (includeRaw) { entry.include = [];
entry.include = [];
if ("minLevel" in includeRaw) { if ("minLevel" in includeRaw) {
entry.include.push({ entry.include.push({
filter_type: { filter_type: {
$case: "tiers", $case: "tiers",
value: { value: {
min: includeRaw.minLevel, min: includeRaw.minLevel,
max: includeRaw.maxLevel, max: includeRaw.maxLevel,
},
}, },
}); },
} else if ("name" in includeRaw) { });
entry.include.push({ } else if ("name" in includeRaw) {
filter_type: { entry.include.push({
$case: "ids", filter_type: {
value: { $case: "ids",
ids: includeRaw.name.split(/ +/).map((key) => { value: {
return tankStringIdMap[key]; 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) { if (provision.vehicleFilter?.include.nations) {
entry.include.push({ entry.include.push({
filter_type: { filter_type: {
$case: "nations", $case: "nations",
value: { value: {
nations: provision.vehicleFilter.include.nations.split(" "), nations: provision.vehicleFilter.include.nations.split(" "),
},
}, },
}); },
} });
} }
}
if (excludeRaw) { if (excludeRaw) {
entry.exclude = []; entry.exclude = [];
if ("name" in excludeRaw) { if ("name" in excludeRaw) {
entry.exclude!.push({ entry.exclude!.push({
filter_type: { filter_type: {
$case: "ids", $case: "ids",
value: { value: {
ids: excludeRaw.name ids: excludeRaw.name
.split(/ +/) .split(/ +/)
.map((key) => tankStringIdMap[key]), .map((key) => tankStringIdMap[key]),
},
}, },
}); },
} else if ("extendedTags" in excludeRaw) { });
entry.exclude!.push({ } else if ("extendedTags" in excludeRaw) {
filter_type: { entry.exclude!.push({
$case: "categories", filter_type: {
value: { $case: "categories",
categories: excludeRaw.extendedTags value: {
.split(" ") categories: excludeRaw.extendedTags
.map( .split(" ")
(item) => .map(
blitzTankFilterDefinitionCategoryToBlitzkit[ (item) =>
item as BlitzTankFilterDefinitionCategory blitzTankFilterDefinitionCategoryToBlitzkit[
] item as BlitzTankFilterDefinitionCategory
), ]
}, ),
}, },
}); },
} else throw new SyntaxError("Unhandled exclude type"); });
} else throw new SyntaxError("Unhandled exclude type");
if (provision.vehicleFilter?.exclude?.nations) { if (provision.vehicleFilter?.exclude?.nations) {
entry.exclude!.push({ entry.exclude!.push({
filter_type: { filter_type: {
$case: "nations", $case: "nations",
value: { value: {
nations: provision.vehicleFilter.exclude.nations.split(" "), nations: provision.vehicleFilter.exclude.nations.split(" "),
},
}, },
}); },
} });
} }
} }
@@ -28,7 +28,7 @@ export async function skillIcons() {
const avatar = await vfs.xml<{ root: Avatar }>( const avatar = await vfs.xml<{ root: Avatar }>(
`Data/XML/item_defs/tankmen/avatar.xml` `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) { for (const key in avatar.root.skills) {
const skill = avatar.root.skills[key]; const skill = avatar.root.skills[key];
+5 -2
View File
@@ -2,12 +2,15 @@ import { build } from "esbuild";
import { cp, readdir, rm } from "fs/promises"; import { cp, readdir, rm } from "fs/promises";
import { argv } from "process"; import { argv } from "process";
const dev = argv.includes("--dev");
const projectDir = "../.."; const projectDir = "../..";
const srcRoot = `${projectDir}/packages/bot`; const srcRoot = `${projectDir}/packages/bot`;
const distRoot = `${projectDir}/dist/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 workers = await readdir(`${srcRoot}/src/workers`);
const dev = argv.includes("--dev");
await rm(distRoot, { recursive: true, force: true }); await rm(distRoot, { recursive: true, force: true });
@@ -6,7 +6,7 @@ import {
} from "@blitzkit/core"; } from "@blitzkit/core";
import { Accessor, Document, Node, Scene } from "@gltf-transform/core"; import { Accessor, Document, Node, Scene } from "@gltf-transform/core";
import { times } from "lodash-es"; import { times } from "lodash-es";
import { SteamVFS } from "../steam/vfs"; import { SteamVFS } from "../vfs/vfs";
import { import {
vertexAttributeGLTFName, vertexAttributeGLTFName,
vertexAttributeGltfVectorSizes, vertexAttributeGltfVectorSizes,
@@ -9,7 +9,7 @@ import { Document, Material, Node, Scene } from "@gltf-transform/core";
import { dedup, prune } from "@gltf-transform/functions"; import { dedup, prune } from "@gltf-transform/functions";
import { times } from "lodash-es"; import { times } from "lodash-es";
import { dirname } from "path"; import { dirname } from "path";
import { SteamVFS } from "../../steam/vfs"; import { SteamVFS } from "../../vfs/vfs";
import { readBaseColor } from "../readBaseColor"; import { readBaseColor } from "../readBaseColor";
import { readNormal } from "../readNormal"; import { readNormal } from "../readNormal";
import { readRoughnessMetallic } from "../readRoughnessMetallic"; import { readRoughnessMetallic } from "../readRoughnessMetallic";
@@ -3,7 +3,7 @@ import { vfs } from "../../../buildAssets/constants";
export async function readTexture(path: string) { export async function readTexture(path: string) {
const ddsTexturePath = path.replace(".tex", ".dx11.dds"); const ddsTexturePath = path.replace(".tex", ".dx11.dds");
const isDds = vfs.has(ddsTexturePath); const isDds = vfs.resolve(ddsTexturePath);
const resolvedTexturePath = isDds const resolvedTexturePath = isDds
? ddsTexturePath ? ddsTexturePath
: ddsTexturePath.replace(".dds", ".pvr"); : ddsTexturePath.replace(".dds", ".pvr");
+84
View File
@@ -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 SteamUser, { EConnectionProtocol } from "steam-user";
import { parse } from "yaml"; import { AbstractVFS } from "./abstract";
interface SteamManifestFile { interface SteamManifestFile {
chunks: { chunks: {
@@ -33,11 +30,8 @@ interface SteamManifest {
crc_clear: number; crc_clear: number;
} }
export class SteamVFS { export class SteamVFS extends AbstractVFS {
private steam = new SteamUser({ protocol: EConnectionProtocol.TCP }); private steam = new SteamUser({ protocol: EConnectionProtocol.TCP });
private textDecoder = new TextDecoder();
private xmlParser = new XMLParser();
private manifest: Map<string, SteamManifestFile> = new Map(); private manifest: Map<string, SteamManifestFile> = new Map();
constructor( constructor(
@@ -45,7 +39,9 @@ export class SteamVFS {
private password: string, private password: string,
private app: number, private app: number,
private depot: number private depot: number
) {} ) {
super();
}
async init() { async init() {
this.steam.logOn({ this.steam.logOn({
@@ -71,10 +67,8 @@ export class SteamVFS {
); );
}); });
const paths: string[] = [];
for (const file of manifest.files) { for (const file of manifest.files) {
const path = file.filename.replaceAll("\\", "/"); const path = file.filename.replaceAll("\\", "/");
paths.push(path);
this.manifest.set(path, file); this.manifest.set(path, file);
} }
@@ -82,74 +76,23 @@ export class SteamVFS {
} }
has(path: string) { has(path: string) {
const normalized = normalize(path); return this.manifest.has(path);
const dvplPath = `${normalized}.dvpl`;
return (
(this.manifest.has(dvplPath) && dvplPath) ||
(this.manifest.has(normalized) && normalized)
);
} }
assert(requested: string) { async raw(path: 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);
const fileManifest = this.manifest.get(path)!; const fileManifest = this.manifest.get(path)!;
const downloaded: { type: "complete"; file: Buffer } = const downloaded: { type: "complete"; file: Buffer } =
// @ts-expect-error // @ts-expect-error
await this.steam.downloadFile(this.app, this.depot, fileManifest); await this.steam.downloadFile(this.app, this.depot, fileManifest);
let buffer = downloaded.file;
if (path.endsWith(".dvpl")) buffer = readDVPL(downloaded.file); return new Uint8Array(downloaded.file);
return new Uint8Array(buffer);
} }
async text(path: string) { paths() {
const file = await this.file(path); return Array.from(this.manifest.keys());
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;
} }
dispose() { dispose() {
this.steam.logOff(); this.steam.logOff();
} }
[Symbol.dispose]() {
this.dispose();
}
} }
+38
View File
@@ -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() {}
}
@@ -0,0 +1,38 @@
---
import { tankIcon } from "@blitzkit/core";
import { Flex, Heading, Link, Strong, Text } from "@radix-ui/themes";
---
<Flex justify="center" px="4">
<Link
color="gray"
highContrast
style={{ display: "content" }}
href="/docs/guides/christmas-2025"
underline="none"
>
<Flex
mt="3"
px="5"
py="4"
style={{
borderRadius: "var(--radius-3)",
backgroundImage: "url(https://i.imgur.com/LRYmSkg.png)",
backgroundSize: "cover",
backgroundPosition: "center",
boxSizing: "border-box",
}}
align="center"
gap="5"
>
<img src={tankIcon(25169)} style={{ height: "min(15vw, 5rem)" }} />
<Flex direction="column">
<Heading size={{ initial: "4", sm: "6" }}>Christmas 2025</Heading>
<Text size={{ initial: "2", sm: "3" }}>
Win the <Strong>GSOR the TANK</Strong> and more!
</Text>
</Flex>
</Flex>
</Link>
</Flex>
@@ -277,14 +277,14 @@ export function CompareTable({ stats }: CompareTableProps) {
</Popover.Content> </Popover.Content>
</Popover.Root> </Popover.Root>
<Flex align="center" justify="center" gap="3"> <Flex justify="center" gap="3">
<Popover.Root> <Popover.Root>
<Popover.Trigger> <Popover.Trigger>
<Button <Button
variant="ghost" variant="ghost"
radius="large" radius="large"
style={{ style={{
height: "100%", height: "2rem",
width: 12, width: 12,
position: "relative", position: "relative",
}} }}
@@ -345,7 +345,24 @@ export function CompareTable({ stats }: CompareTableProps) {
}); });
}} }}
/> />
<Flex justify="end" mt="4">
<Flex justify="end" mt="4" gap="3">
<Button
variant="ghost"
onClick={() => {
CompareEphemeral.mutate((draft) => {
draft.members.map((member) => {
member.provisions = [];
});
});
}}
>
{
strings.website.tools.compare.table.provisions
.clear_all
}
</Button>
<Button <Button
variant="ghost" variant="ghost"
onClick={() => { onClick={() => {
@@ -473,7 +490,7 @@ export function CompareTable({ stats }: CompareTableProps) {
variant="ghost" variant="ghost"
radius="large" radius="large"
style={{ style={{
height: "100%", height: "2rem",
width: 12, width: 12,
position: "relative", position: "relative",
}} }}
@@ -536,7 +553,23 @@ export function CompareTable({ stats }: CompareTableProps) {
} }
/> />
<Flex justify="end" mt="4"> <Flex justify="end" mt="4" gap="4">
<Button
variant="ghost"
onClick={() => {
CompareEphemeral.mutate((draft) => {
draft.members.map((member) => {
member.consumables = [];
});
});
}}
>
{
strings.website.tools.compare.table.consumables
.clear_all
}
</Button>
<Button <Button
variant="ghost" variant="ghost"
onClick={() => { onClick={() => {
@@ -1,6 +1,6 @@
import type { Consumable } from '@blitzkit/core'; import type { Consumable } from "@blitzkit/core";
import { Flex, type FlexProps } from '@radix-ui/themes'; import { Flex, type FlexProps } from "@radix-ui/themes";
import { ConsumableButton } from './ModuleButtons/ConsumableButton'; import { ConsumableButton } from "./ModuleButtons/ConsumableButton";
type ConsumablesManagerProps = FlexProps & { type ConsumablesManagerProps = FlexProps & {
consumables: Consumable[]; consumables: Consumable[];
@@ -27,6 +27,8 @@ export function ConsumablesManager({
return ( return (
<Flex wrap="wrap" gap="2" {...props}> <Flex wrap="wrap" gap="2" {...props}>
{consumables.map((consumable) => { {consumables.map((consumable) => {
if (consumable.game_mode_exclusive) return null;
const isSelected = selected.some((id) => id === consumable.id); const isSelected = selected.some((id) => id === consumable.id);
return ( return (
@@ -0,0 +1,89 @@
import { Code, Flex, Heading, Link, Text } from "@radix-ui/themes";
import { useEffect, useState, type ReactNode } from "react";
import type { MaybeSkeletonComponentProps } from "../types/maybeSkeletonComponentProps";
import { InlineSkeleton } from "./InlineSkeleton";
const TIME = 1764898200 * 1000;
export function Giveaway({ skeleton }: MaybeSkeletonComponentProps) {
const [timeLeft, setTimeLeft] = useState<number>(TIME - Date.now());
useEffect(() => {
const interval = setInterval(() => {
setTimeLeft(TIME - Date.now());
}, 1000);
return () => {
clearInterval(interval);
};
}, []);
let string: ReactNode;
if (timeLeft > 0) {
const hours = Math.floor(timeLeft / (1000 * 60 * 60));
const minutes = Math.floor((timeLeft / (1000 * 60)) % 60)
.toString()
.padStart(2, "0");
const seconds = Math.floor((timeLeft / 1000) % 60)
.toString()
.padStart(2, "0");
string = (
<>
in{" "}
<Code highContrast>
{hours}h {minutes}m {seconds}s
</Code>
</>
);
} else {
string = "has ended. Come again later!";
}
return (
<Flex justify="center" px="4">
<Link
color="gray"
highContrast
style={{ display: "content" }}
href="https://discord.gg/njQdBhNS?event=1446208951136813117"
underline="none"
>
<Flex
mt="3"
px="5"
py="4"
style={{
borderRadius: "var(--radius-3)",
backgroundImage: "url(https://i.imgur.com/LRYmSkg.png)",
backgroundSize: "cover",
backgroundPosition: "center",
boxSizing: "border-box",
boxShadow: "0 0 var(--space-7) var(--blue-a5)",
}}
align="center"
gap="5"
>
<img
src="https://i.imgur.com/mvmJQgB.png"
style={{
height: "min(15vw, 5rem)",
filter: "drop-shadow(0.5rem 0.5rem 1rem #00000080)",
}}
/>
<Flex direction="column">
<Heading size={{ initial: "4", sm: "6" }}>
Music Box giveaway {!skeleton && string}{" "}
{skeleton && <InlineSkeleton width="10rem" />}
</Heading>
<Text size={{ initial: "2", sm: "3" }}>
Join the BlitzKit Discord server event
</Text>
</Flex>
</Flex>
</Link>
</Flex>
);
}
@@ -9,12 +9,15 @@ const CONTRAST = 2 ** 2;
export function GuessRenderer() { export function GuessRenderer() {
const guessState = Guess.use((state) => state.guessState); const guessState = Guess.use((state) => state.guessState);
const isRevealed = guessState !== GuessState.NotGuessed; const helpingReveal = Guess.use((state) => state.helpingReveal);
const isRevealed = helpingReveal || guessState !== GuessState.NotGuessed;
return ( return (
<SmartCanvas <SmartCanvas
style={{ style={{
filter: `grayscale(${isRevealed ? 0 : 1}) contrast(${isRevealed ? 1 : CONTRAST}) brightness(${isRevealed ? 1 : BRIGHTNESS})`, filter: `grayscale(${isRevealed ? 0 : 1}) contrast(${
isRevealed ? 1 : CONTRAST
}) brightness(${isRevealed ? 1 : BRIGHTNESS})`,
transitionDuration: isRevealed ? "2s" : undefined, transitionDuration: isRevealed ? "2s" : undefined,
transitionProperty: "filter", transitionProperty: "filter",
}} }}
+52 -1
View File
@@ -7,14 +7,17 @@ import {
import { literals } from "@blitzkit/i18n"; import { literals } from "@blitzkit/i18n";
import { import {
ArrowRightIcon, ArrowRightIcon,
EyeOpenIcon,
MagnifyingGlassIcon, MagnifyingGlassIcon,
PaperPlaneIcon, PaperPlaneIcon,
} from "@radix-ui/react-icons"; } from "@radix-ui/react-icons";
import { import {
AlertDialog,
Box, Box,
Button, Button,
Card, Card,
Flex, Flex,
IconButton,
Spinner, Spinner,
Text, Text,
TextField, TextField,
@@ -43,6 +46,8 @@ export function Guesser() {
const guessState = Guess.use((state) => state.guessState); const guessState = Guess.use((state) => state.guessState);
const correctGuesses = Guess.use((state) => state.correctGuesses); const correctGuesses = Guess.use((state) => state.correctGuesses);
const totalGuesses = Guess.use((state) => state.totalGuesses); const totalGuesses = Guess.use((state) => state.totalGuesses);
const helpingReveal = Guess.use((state) => state.helpingReveal);
const streak = Guess.use((state) => state.streak);
const { strings, unwrap } = useLocale(); const { strings, unwrap } = useLocale();
const input = useRef<HTMLInputElement>(null); const input = useRef<HTMLInputElement>(null);
const [searching, setSearching] = useState(false); const [searching, setSearching] = useState(false);
@@ -150,6 +155,7 @@ export function Guesser() {
{literals(strings.website.tools.guess.stats, { {literals(strings.website.tools.guess.stats, {
correct: correctGuesses, correct: correctGuesses,
total: totalGuesses, total: totalGuesses,
streak: streak,
})} })}
</Text> </Text>
</Flex> </Flex>
@@ -169,6 +175,48 @@ export function Guesser() {
</TextField.Slot> </TextField.Slot>
</TextField.Root> </TextField.Root>
<AlertDialog.Root>
<AlertDialog.Trigger>
<IconButton
size="3"
disabled={guessState !== GuessState.NotGuessed}
>
<EyeOpenIcon />
</IconButton>
</AlertDialog.Trigger>
<AlertDialog.Content>
<AlertDialog.Title>
{strings.website.tools.guess.help.title}
</AlertDialog.Title>
<AlertDialog.Description>
{strings.website.tools.guess.help.description}
</AlertDialog.Description>
<Flex justify="end" gap="2">
<AlertDialog.Cancel>
<Button variant="outline">
{strings.website.tools.guess.help.cancel}
</Button>
</AlertDialog.Cancel>
<AlertDialog.Action>
<Button
color="tomato"
onClick={() => {
Guess.mutate((draft) => {
draft.helpingReveal = true;
draft.streak = 0;
});
}}
>
{strings.website.tools.guess.help.reveal}
</Button>
</AlertDialog.Action>
</Flex>
</AlertDialog.Content>
</AlertDialog.Root>
<Button <Button
size="3" size="3"
color={ color={
@@ -178,7 +226,8 @@ export function Guesser() {
} }
onClick={() => { onClick={() => {
if (guessState === GuessState.NotGuessed) { if (guessState === GuessState.NotGuessed) {
const correct = selected !== null && selected.id === tank.id; const correct =
selected !== null && selected.id === tank.id && !helpingReveal;
Guess.mutate((draft) => { Guess.mutate((draft) => {
draft.guessState = correct draft.guessState = correct
@@ -186,6 +235,7 @@ export function Guesser() {
: GuessState.Incorrect; : GuessState.Incorrect;
draft.totalGuesses++; draft.totalGuesses++;
draft.correctGuesses += correct ? 1 : 0; draft.correctGuesses += correct ? 1 : 0;
draft.streak = correct ? draft.streak + 1 : 0;
}); });
} else { } else {
const id = Number(ids[Math.floor(Math.random() * ids.length)]); const id = Number(ids[Math.floor(Math.random() * ids.length)]);
@@ -196,6 +246,7 @@ export function Guesser() {
draft.tank = tank; draft.tank = tank;
draft.guessState = GuessState.NotGuessed; draft.guessState = GuessState.NotGuessed;
draft.helpingReveal = false;
input.current.value = ""; input.current.value = "";
}); });
@@ -1,5 +1,6 @@
import { Flex } from '@radix-ui/themes'; import { Flex } from "@radix-ui/themes";
import { ProvisionButton } from './ModuleButtons/ProvisionButton'; import { awaitableProvisionDefinitions } from "../core/awaitables/provisionDefinitions";
import { ProvisionButton } from "./ModuleButtons/ProvisionButton";
interface ProvisionsManagerProps { interface ProvisionsManagerProps {
provisions: number[]; provisions: number[];
@@ -8,6 +9,8 @@ interface ProvisionsManagerProps {
onChange?: (provisions: number[]) => void; onChange?: (provisions: number[]) => void;
} }
const provisionDefinitions = await awaitableProvisionDefinitions;
export function ProvisionsManager({ export function ProvisionsManager({
provisions, provisions,
selected, selected,
@@ -15,15 +18,18 @@ export function ProvisionsManager({
disabled, disabled,
}: ProvisionsManagerProps) { }: ProvisionsManagerProps) {
return ( return (
<Flex wrap="wrap" gap="2" justify={{ initial: 'center', sm: 'start' }}> <Flex wrap="wrap" gap="2" justify={{ initial: "center", sm: "start" }}>
{provisions.map((provision) => { {provisions.map((id) => {
const isSelected = selected.includes(provision); const isSelected = selected.includes(id);
const provision = provisionDefinitions.provisions[id];
if (provision.game_mode_exclusive) return null;
return ( return (
<ProvisionButton <ProvisionButton
key={provision} key={id}
disabled={disabled && !isSelected} disabled={disabled && !isSelected}
provision={provision} provision={id}
selected={isSelected} selected={isSelected}
onClick={() => { onClick={() => {
if (!onChange) return; if (!onChange) return;
@@ -31,9 +37,9 @@ export function ProvisionsManager({
const draft = [...selected]; const draft = [...selected];
if (isSelected) { if (isSelected) {
draft.splice(draft.indexOf(provision), 1); draft.splice(draft.indexOf(id), 1);
} else { } else {
draft.push(provision); draft.push(id);
} }
onChange(draft); onChange(draft);
File diff suppressed because it is too large. Load diff
@@ -429,7 +429,7 @@ export const TankSearch = memo<TankSearchProps>(
}, [tankFilters, tankopediaSort]); }, [tankFilters, tankopediaSort]);
return ( return (
<Flex direction="column" gap="4" flexGrow="1" {...props}> <Flex direction="column" gap="2" flexGrow="1" {...props}>
<SearchBar <SearchBar
skeleton={skeleton} skeleton={skeleton}
topResult={tanks?.[0]} topResult={tanks?.[0]}
@@ -176,11 +176,17 @@ export function Modules() {
(turret) => turret.id === unlock.id (turret) => turret.id === unlock.id
)!; )!;
if ( // Check if current gun exists in new turret
!draft.protagonist.turret.guns.some( const gunInNewTurret = draft.protagonist.turret.guns.find(
(gun) => gun.id === draft.protagonist.gun.id (gun) => gun.id === draft.protagonist.gun.id
) );
) {
if (gunInNewTurret) {
// Gun exists - get it FROM this turret
draft.protagonist.gun = gunInNewTurret;
draft.protagonist.shell = gunInNewTurret.shells[0];
} else {
// Gun doesn't exist - select top gun from new turret
draft.protagonist.gun = draft.protagonist.turret.guns.at(-1)!; draft.protagonist.gun = draft.protagonist.turret.guns.at(-1)!;
draft.protagonist.shell = draft.protagonist.gun.shells[0]; draft.protagonist.shell = draft.protagonist.gun.shells[0];
} }
@@ -1,10 +1,10 @@
import { asset } from '@blitzkit/core'; import { asset } from "@blitzkit/core";
import { Box, Flex, Heading, Text } from '@radix-ui/themes'; import { Box, Flex, Heading, Text } from "@radix-ui/themes";
import { awaitableConsumableDefinitions } from '../../core/awaitables/consumableDefinitions'; import { awaitableConsumableDefinitions } from "../../core/awaitables/consumableDefinitions";
import { awaitableGameDefinitions } from '../../core/awaitables/gameDefinitions'; import { awaitableGameDefinitions } from "../../core/awaitables/gameDefinitions";
import { awaitableProvisionDefinitions } from '../../core/awaitables/provisionDefinitions'; import { awaitableProvisionDefinitions } from "../../core/awaitables/provisionDefinitions";
import { useLocale } from '../../hooks/useLocale'; import { useLocale } from "../../hooks/useLocale";
import { Duel } from '../../stores/duel'; import { Duel } from "../../stores/duel";
const [gameDefinitions, consumableDefinitions, provisionDefinitions] = const [gameDefinitions, consumableDefinitions, provisionDefinitions] =
await Promise.all([ await Promise.all([
@@ -39,22 +39,22 @@ export function GameModeSection() {
overflow="hidden" overflow="hidden"
direction="column" direction="column"
style={{ style={{
borderRadius: 'var(--radius-3)', borderRadius: "var(--radius-3)",
background: `url(${asset( background: `url(${asset(
`icons/game_mode_banners/${id}.webp`, `icons/game_mode_banners/${id}.webp`
)})`, )})`,
backgroundSize: 'cover', backgroundSize: "cover",
backgroundPosition: 'center', backgroundPosition: "center",
}} }}
> >
<Box <Box
flexGrow="1" flexGrow="1"
style={{ style={{
background: `url(${asset( background: `url(${asset(
`icons/game_mode_banners/${id}.webp`, `icons/game_mode_banners/${id}.webp`
)})`, )})`,
backgroundSize: 'cover', backgroundSize: "cover",
backgroundPosition: 'center', backgroundPosition: "center",
}} }}
/> />
@@ -64,8 +64,8 @@ export function GameModeSection() {
height="98px" height="98px"
flexShrink="0" flexShrink="0"
style={{ style={{
backdropFilter: 'blur(4rem)', backdropFilter: "blur(4rem)",
WebkitBackdropFilter: 'blur(4rem)', WebkitBackdropFilter: "blur(4rem)",
}} }}
align="center" align="center"
justify="center" justify="center"
@@ -83,9 +83,9 @@ export function GameModeSection() {
<Flex align="center" gap="1"> <Flex align="center" gap="1">
<img <img
style={{ style={{
width: '1.5em', width: "1.5em",
height: '1.5em', height: "1.5em",
objectFit: 'contain', objectFit: "contain",
}} }}
src={asset(`icons/provisions/${id}.webp`)} src={asset(`icons/provisions/${id}.webp`)}
alt={unwrap(provisions.name)} alt={unwrap(provisions.name)}
@@ -95,6 +95,7 @@ export function GameModeSection() {
</Text> </Text>
); );
})} })}
{gameDefinitions.roles[value].consumables.map((id) => { {gameDefinitions.roles[value].consumables.map((id) => {
const consumable = consumableDefinitions.consumables[id]; const consumable = consumableDefinitions.consumables[id];
@@ -103,9 +104,9 @@ export function GameModeSection() {
<Flex align="center" gap="1"> <Flex align="center" gap="1">
<img <img
style={{ style={{
width: '1.5em', width: "1.5em",
height: '1.5em', height: "1.5em",
objectFit: 'contain', objectFit: "contain",
}} }}
src={asset(`icons/consumables/${id}.webp`)} src={asset(`icons/consumables/${id}.webp`)}
alt={unwrap(consumable.name)} alt={unwrap(consumable.name)}
@@ -108,10 +108,10 @@ export function CustomShellButton() {
{strings.common.shells.ap} {strings.common.shells.ap}
</Select.Item> </Select.Item>
<Select.Item value={`${ShellType.APCR}`}> <Select.Item value={`${ShellType.APCR}`}>
{strings.common.shells.apcr} {strings.common.shells.ap_cr}
</Select.Item> </Select.Item>
<Select.Item value={`${ShellType.HEAT}`}> <Select.Item value={`${ShellType.HEAT}`}>
{strings.common.shells.heat} {strings.common.shells.hc}
</Select.Item> </Select.Item>
<Select.Item value={`${ShellType.HE}`}> <Select.Item value={`${ShellType.HE}`}>
{strings.common.shells.he} {strings.common.shells.he}
@@ -150,6 +150,7 @@ export const TankSandbox = forwardRef<HTMLCanvasElement, TankSandboxProps>(
return ( return (
<SmartCanvas <SmartCanvas
resize={{ debounce: 0 }}
ref={canvas} ref={canvas}
scene={{ fog: new Fog("black", 30, 50) }} scene={{ fog: new Fog("black", 30, 50) }}
gl={{ gl={{
@@ -1,9 +1,17 @@
import type { TankDefinition } from "@blitzkit/core"; import type { TankDefinition } from "@blitzkit/core";
import { checkConsumableProvisionInclusivity } from "@blitzkit/core/src/blitzkit/checkConsumableProvisionInclusivity";
import { times } from "lodash-es"; import { times } from "lodash-es";
import { awaitableConsumableDefinitions } from "../../core/awaitables/consumableDefinitions";
import type { TankFilters } from "../../stores/tankFilters"; import type { TankFilters } from "../../stores/tankFilters";
import { awaitableGameDefinitions } from "../awaitables/gameDefinitions";
import { awaitableProvisionDefinitions } from "../awaitables/provisionDefinitions";
const SHELLS = times(3, (index) => index); const SHELLS = times(3, (index) => index);
const consumableDefinitions = await awaitableConsumableDefinitions;
const provisionDefinitions = await awaitableProvisionDefinitions;
const gameDefinitions = await awaitableGameDefinitions;
export async function filterTank( export async function filterTank(
filters: TankFilters, filters: TankFilters,
tank: TankDefinition, tank: TankDefinition,
@@ -40,6 +48,42 @@ export async function filterTank(
gun.shells[index].type === filters.shells[index] gun.shells[index].type === filters.shells[index]
) )
) )
) ) &&
(filters.consumables.length === 0 ||
filters.consumables.every((consumable) =>
tank.turrets.some((turret) =>
turret.guns.some((gun) =>
checkConsumableProvisionInclusivity(
consumableDefinitions.consumables[consumable],
tank,
gun
)
)
)
)) &&
(filters.provisions.length === 0 ||
filters.provisions.every((provision) =>
tank.turrets.some((turret) =>
turret.guns.some((gun) =>
checkConsumableProvisionInclusivity(
provisionDefinitions.provisions[provision],
tank,
gun
)
)
)
)) &&
(filters.abilities.length === 0 ||
Object.values(tank.roles).some((id) =>
gameDefinitions.roles[id as unknown as number].consumables.some(
(consumable) => filters.abilities.includes(consumable)
)
)) &&
(filters.powers.length === 0 ||
Object.values(tank.roles).some((id) =>
gameDefinitions.roles[id as unknown as number].provisions.some(
(consumable) => filters.powers.includes(consumable)
)
))
); );
} }
@@ -19,9 +19,9 @@ import {
type TankDefinition, type TankDefinition,
type TrackDefinition, type TrackDefinition,
type TurretDefinition, type TurretDefinition,
} from '@blitzkit/core'; } from "@blitzkit/core";
import { coefficient } from '@blitzkit/core/src/blitzkit/coefficient'; import { coefficient } from "@blitzkit/core/src/blitzkit/coefficient";
import type { EquipmentMatrix } from '../../stores/duel'; import type { EquipmentMatrix } from "../../stores/duel";
export type TankCharacteristics = ReturnType<typeof tankCharacteristics>; export type TankCharacteristics = ReturnType<typeof tankCharacteristics>;
export type TankCharacteristicsKey = keyof TankCharacteristics; export type TankCharacteristicsKey = keyof TankCharacteristics;
@@ -76,7 +76,7 @@ export function tankCharacteristics(
tankModelDefinition: ModelDefinition; tankModelDefinition: ModelDefinition;
equipmentDefinitions: EquipmentDefinitions; equipmentDefinitions: EquipmentDefinitions;
provisionDefinitions: ProvisionDefinitions; provisionDefinitions: ProvisionDefinitions;
}, }
) { ) {
const preset = equipmentDefinitions.presets[tank.equipment_preset]; const preset = equipmentDefinitions.presets[tank.equipment_preset];
const turretModelDefinition = tankModelDefinition.turrets[turret.id]; const turretModelDefinition = tankModelDefinition.turrets[turret.id];
@@ -86,7 +86,7 @@ export function tankCharacteristics(
return preset.slots.some((slot, index) => { return preset.slots.some((slot, index) => {
const choice = equipmentMatrix[Math.floor(index / 3)][index % 3]; const choice = equipmentMatrix[Math.floor(index / 3)][index % 3];
if (choice === 0) return false; if (choice === 0) return false;
const equipped = slot[choice === -1 ? 'left' : 'right']; const equipped = slot[choice === -1 ? "left" : "right"];
return equipped === id; return equipped === id;
}); });
} }
@@ -138,7 +138,7 @@ export function tankCharacteristics(
provisionDefinitions.provisions[provision].crew provisionDefinitions.provisions[provision].crew
? total + provisionDefinitions.provisions[provision].crew! / 100 ? total + provisionDefinitions.provisions[provision].crew! / 100
: total, : total,
0, 0
) + (hasImprovedVentilation ? 0.08 : 0); ) + (hasImprovedVentilation ? 0.08 : 0);
const commanderMastery = 1 + provisionCrewBonus; const commanderMastery = 1 + provisionCrewBonus;
const loaderMastery = const loaderMastery =
@@ -158,19 +158,19 @@ export function tankCharacteristics(
coefficient( coefficient(
[applyReactiveArmor && shell.type !== ShellType.HE, -0.27], [applyReactiveArmor && shell.type !== ShellType.HE, -0.27],
[applyDynamicArmor, -0.1], [applyDynamicArmor, -0.1],
[applySpallLiner && shell.type === ShellType.HE, -0.2], [applySpallLiner && shell.type === ShellType.HE, -0.2]
); );
const assaultDamageCoefficient = const assaultDamageCoefficient =
gun.assault_ranges && gun.assault_ranges.types.includes(shell.type) gun.assault_ranges && gun.assault_ranges.types.includes(shell.type)
? (gun.assault_ranges.ranges.find( ? gun.assault_ranges.ranges.find(
({ distance }) => distance >= assaultDistance, ({ distance }) => distance >= assaultDistance
)?.factor ?? 0) )?.factor ?? 0
: 1; : 1;
const moduleDamageCoefficient = coefficient([hasTungsten, 0.15]); const moduleDamageCoefficient = coefficient([hasTungsten, 0.15]);
const reloadCoefficient = const reloadCoefficient =
(coefficient([hasGunRammer, -0.05]) * (coefficient([hasGunRammer, -0.05]) *
coefficient([true, degressiveStat(loaderMastery)])) / coefficient([true, degressiveStat(loaderMastery)])) /
coefficient([hasAdrenaline && gun.gun_type!.$case === 'regular', 0.17]); coefficient([hasAdrenaline && gun.gun_type!.$case === "regular", 0.17]);
const penetrationCoefficient = coefficient([ const penetrationCoefficient = coefficient([
hasCalibratedShells, hasCalibratedShells,
resolvePenetrationCoefficient(true, shell.type) - 1, resolvePenetrationCoefficient(true, shell.type) - 1,
@@ -178,16 +178,16 @@ export function tankCharacteristics(
const healthCoefficient = coefficient( const healthCoefficient = coefficient(
[hasSandbagArmor, 0.03], [hasSandbagArmor, 0.03],
[hasEnhancedSandbagArmor, 0.06], [hasEnhancedSandbagArmor, 0.06],
[hasImprovedAssembly, 0.04], [hasImprovedAssembly, 0.04]
); );
const shellVelocityCoefficient = coefficient( const shellVelocityCoefficient = coefficient(
[hasSupercharger, 0.35], [hasSupercharger, 0.35],
[hasImprovedGunPowder, 0.3], [hasImprovedGunPowder, 0.3]
); );
const aimTimeCoefficient = const aimTimeCoefficient =
coefficient( coefficient(
[hasEnhancedGunLayingDrive, -0.15], [hasEnhancedGunLayingDrive, -0.15],
[hasReticleCalibration, -0.3], [hasReticleCalibration, -0.3]
) * coefficient([true, degressiveStat(gunnerMastery)]); ) * coefficient([true, degressiveStat(gunnerMastery)]);
const dispersionStillCoefficient = const dispersionStillCoefficient =
coefficient([hasRefinedGun, -0.15], [hasReticleCalibration, -0.3]) * coefficient([hasRefinedGun, -0.15], [hasReticleCalibration, -0.3]) *
@@ -198,19 +198,19 @@ export function tankCharacteristics(
]); ]);
const dispersionHullTraverseCoefficient = coefficient( const dispersionHullTraverseCoefficient = coefficient(
[hasVerticalStabilizer, -0.15], [hasVerticalStabilizer, -0.15],
[true, -crewSkills.smooth_turn / 100], [true, -crewSkills.smooth_turn / 100]
); );
const dispersionAfterShotCoefficient = coefficient( const dispersionAfterShotCoefficient = coefficient(
[hasVerticalStabilizer, -0.15], [hasVerticalStabilizer, -0.15],
[true, -crewSkills.soft_recoil / 100], [true, -crewSkills.soft_recoil / 100]
); );
const dispersionMovingCoefficient = coefficient( const dispersionMovingCoefficient = coefficient(
[hasVerticalStabilizer, -0.15], [hasVerticalStabilizer, -0.15],
[true, -crewSkills.smooth_driving / 100], [true, -crewSkills.smooth_driving / 100]
); );
const dispersionTurretTraverseCoefficient = coefficient( const dispersionTurretTraverseCoefficient = coefficient(
[hasVerticalStabilizer, -0.15], [hasVerticalStabilizer, -0.15],
[true, -crewSkills.smooth_turret * (2 / 100)], [true, -crewSkills.smooth_turret * (2 / 100)]
); );
const enginePowerCoefficient = coefficient( const enginePowerCoefficient = coefficient(
[ [
@@ -225,7 +225,7 @@ export function tankCharacteristics(
[hasStandardFuel, 0.03], [hasStandardFuel, 0.03],
[hasImprovedFuel, 0.1], [hasImprovedFuel, 0.1],
[hasGearOil, 0.03], [hasGearOil, 0.03],
[hasImprovedGearOil, 0.06], [hasImprovedGearOil, 0.06]
); );
const turretTraverseCoefficient = const turretTraverseCoefficient =
coefficient([hasStandardFuel, 0.03], [hasImprovedFuel, 0.1]) * coefficient([hasStandardFuel, 0.03], [hasImprovedFuel, 0.1]) *
@@ -234,36 +234,41 @@ export function tankCharacteristics(
coefficient( coefficient(
[hasImprovedControl, 0.11], [hasImprovedControl, 0.11],
[hasImprovedEnginePowerBoost, 0.01], [hasImprovedEnginePowerBoost, 0.01],
[true, crewSkills.virtuoso / 100], [true, crewSkills.virtuoso / 100]
) * coefficient([true, progressiveStat(driverMastery)]); ) * coefficient([true, progressiveStat(driverMastery)]);
const resistanceHardCoefficient = coefficient([hasImprovedSuspension, -0.2]);
const resistanceMediumCoefficient = coefficient([ const resistanceHardCoefficient =
hasImprovedSuspension, coefficient([hasImprovedSuspension, -0.2]) *
-0.15, coefficient([true, degressiveStat(driverMastery)]);
]); const resistanceMediumCoefficient =
const resistanceSoftCoefficient = coefficient([hasImprovedSuspension, -0.3]); coefficient([hasImprovedSuspension, -0.15]) *
coefficient([true, degressiveStat(driverMastery)]);
const resistanceSoftCoefficient =
coefficient([hasImprovedSuspension, -0.3]) *
coefficient([true, degressiveStat(driverMastery)]);
const viewRangeCoefficient = const viewRangeCoefficient =
coefficient([ coefficient([
hasImprovedOptics, hasImprovedOptics,
tank.class === TankClass.HEAVY tank.class === TankClass.HEAVY
? 0.06 ? 0.06
: tank.class === TankClass.MEDIUM : tank.class === TankClass.MEDIUM
? 0.08 ? 0.08
: tank.class === TankClass.LIGHT : tank.class === TankClass.LIGHT
? 0.11 ? 0.11
: 0.04, : 0.04,
]) * coefficient([true, progressiveStat(commanderMastery)]); ]) * coefficient([true, progressiveStat(commanderMastery)]);
const fireChanceCoefficient = coefficient([hasProtectiveKit, -0.2]); const fireChanceCoefficient = coefficient([hasProtectiveKit, -0.2]);
const speedForwardsSum = sum( const speedForwardsSum = sum(
[hasImprovedEnginePowerBoost, 4], [hasImprovedEnginePowerBoost, 4],
[hasGearOil, 2], [hasGearOil, 2],
[hasImprovedGearOil, 4], [hasImprovedGearOil, 4]
); );
const speedBackwardsSum = sum( const speedBackwardsSum = sum(
[hasImprovedEnginePowerBoost, 8], [hasImprovedEnginePowerBoost, 8],
[hasGearOil, 2], [hasGearOil, 2],
[hasImprovedGearOil, 4], [hasImprovedGearOil, 4]
); );
const camouflageCoefficientMoving = sum( const camouflageCoefficientMoving = sum(
[ [
@@ -273,8 +278,8 @@ export function tankCharacteristics(
tank.class === TankClass.TANK_DESTROYER tank.class === TankClass.TANK_DESTROYER
? 0.04 ? 0.04
: tank.class === TankClass.HEAVY : tank.class === TankClass.HEAVY
? 0.03 ? 0.03
: 0.02, : 0.02,
]), ]),
], ],
[ [
@@ -282,11 +287,11 @@ export function tankCharacteristics(
tank.class === TankClass.HEAVY tank.class === TankClass.HEAVY
? 0.02 ? 0.02
: tank.class === TankClass.MEDIUM : tank.class === TankClass.MEDIUM
? 0.04 ? 0.04
: tank.class === TankClass.LIGHT : tank.class === TankClass.LIGHT
? 0.07 ? 0.07
: 0.1, : 0.1,
], ]
); );
const camouflageCoefficientStill = sum( const camouflageCoefficientStill = sum(
[ [
@@ -297,10 +302,10 @@ export function tankCharacteristics(
tank.class === TankClass.TANK_DESTROYER tank.class === TankClass.TANK_DESTROYER
? 0.04 ? 0.04
: tank.class === TankClass.HEAVY : tank.class === TankClass.HEAVY
? 0.03 ? 0.03
: 0.02, : 0.02,
], ],
[true, crewSkills.camouflage * (3 / 100)], [true, crewSkills.camouflage * (3 / 100)]
), ),
], ],
[ [
@@ -308,18 +313,18 @@ export function tankCharacteristics(
tank.class === TankClass.HEAVY tank.class === TankClass.HEAVY
? 0.04 ? 0.04
: tank.class === TankClass.MEDIUM : tank.class === TankClass.MEDIUM
? 0.08 ? 0.08
: tank.class === TankClass.LIGHT : tank.class === TankClass.LIGHT
? 0.14 ? 0.14
: 0.2, : 0.2,
], ]
); );
const size = normalizeBoundingBox( const size = normalizeBoundingBox(
unionBoundingBox( unionBoundingBox(
tankModelDefinition.bounding_box, tankModelDefinition.bounding_box,
turretModelDefinition.bounding_box, turretModelDefinition.bounding_box
), )
); );
const weightKg = const weightKg =
tank.weight + engine.weight + track.weight + turret.weight + gun.weight; tank.weight + engine.weight + track.weight + turret.weight + gun.weight;
@@ -339,14 +344,14 @@ export function tankCharacteristics(
shell, shell,
damageCoefficient, damageCoefficient,
reloadCoefficient, reloadCoefficient,
intraClipCoefficient, intraClipCoefficient
); );
const intraClip = const intraClip =
gun.gun_type?.$case === 'regular' gun.gun_type?.$case === "regular"
? undefined ? undefined
: gun.gun_type!.value.intra_clip * intraClipCoefficient; : gun.gun_type!.value.intra_clip * intraClipCoefficient;
const mostOptimalShellIndex = const mostOptimalShellIndex =
gun.gun_type!.$case === 'auto_reloader' gun.gun_type!.$case === "auto_reloader"
? gun.gun_type!.value.shell_reloads.reduce<null | { ? gun.gun_type!.value.shell_reloads.reduce<null | {
index: number; index: number;
reload: number; reload: number;
@@ -364,7 +369,7 @@ export function tankCharacteristics(
shell.armor_damage * damageCoefficientWithoutAssault; shell.armor_damage * damageCoefficientWithoutAssault;
const damage = shell.armor_damage * damageCoefficient; const damage = shell.armor_damage * damageCoefficient;
const dpmEffective = const dpmEffective =
gun.gun_type!.$case === 'auto_reloader' gun.gun_type!.$case === "auto_reloader"
? gun.gun_type!.value.shell_reloads[0] > ? gun.gun_type!.value.shell_reloads[0] >
gun.gun_type!.value.shell_reloads[1] + gun.gun_type!.value.intra_clip gun.gun_type!.value.shell_reloads[1] + gun.gun_type!.value.intra_clip
? ((armorDamageCoefficient * shell.armor_damage) / ? ((armorDamageCoefficient * shell.armor_damage) /
@@ -389,23 +394,23 @@ export function tankCharacteristics(
gun.gun_type!.value.shell_reloads.slice(1).length gun.gun_type!.value.shell_reloads.slice(1).length
: undefined; : undefined;
const shells = const shells =
gun.gun_type!.$case === 'regular' ? 1 : gun.gun_type!.value.shell_count; gun.gun_type!.$case === "regular" ? 1 : gun.gun_type!.value.shell_count;
const shellReloads = const shellReloads =
gun.gun_type!.$case === 'auto_reloader' gun.gun_type!.$case === "auto_reloader"
? gun.gun_type!.value.shell_reloads.map( ? gun.gun_type!.value.shell_reloads.map(
(reload) => reload * reloadCoefficient, (reload) => reload * reloadCoefficient
) )
: undefined; : undefined;
const shellReload = const shellReload =
gun.gun_type!.$case === 'auto_reloader' gun.gun_type!.$case === "auto_reloader"
? undefined ? undefined
: (gun.gun_type!.$case === 'regular' : (gun.gun_type!.$case === "regular"
? gun.gun_type!.value.reload ? gun.gun_type!.value.reload
: gun.gun_type!.value.clip_reload) * reloadCoefficient; : gun.gun_type!.value.clip_reload) * reloadCoefficient;
const caliber = shell.caliber; const caliber = shell.caliber;
const penetration = shell.penetration.near * penetrationCoefficient; const penetration = shell.penetration.near * penetrationCoefficient;
const clipDamage = const clipDamage =
gun.gun_type!.$case === 'regular' gun.gun_type!.$case === "regular"
? undefined ? undefined
: gun.gun_type!.value.shell_count * damage; : gun.gun_type!.value.shell_count * damage;
const moduleDamage = shell.module_damage * moduleDamageCoefficient; const moduleDamage = shell.module_damage * moduleDamageCoefficient;
@@ -599,45 +604,45 @@ export const characteristicsOrder: {
items: TankCharacteristicsKey[]; items: TankCharacteristicsKey[];
}[] = [ }[] = [
{ {
name: 'Firepower', name: "Firepower",
items: [ items: [
'gunType', "gunType",
'dpm', "dpm",
'shells', "shells",
'shellReload', "shellReload",
'shellReloads', "shellReloads",
'intraClip', "intraClip",
'penetration', "penetration",
'penetrationAt250m', "penetrationAt250m",
'damage', "damage",
'clipDamage', "clipDamage",
'moduleDamage', "moduleDamage",
'caliber', "caliber",
'shellNormalization', "shellNormalization",
'shellRicochet', "shellRicochet",
'shellVelocity', "shellVelocity",
'shellRange', "shellRange",
'shellCapacity', "shellCapacity",
'aimTime', "aimTime",
'dispersion', "dispersion",
'dispersionMoving', "dispersionMoving",
'dispersionHullTraversing', "dispersionHullTraversing",
'dispersionTurretTraversing', "dispersionTurretTraversing",
'dispersionShooting', "dispersionShooting",
'dispersionGunDamaged', "dispersionGunDamaged",
'gunDepression', "gunDepression",
'gunElevation', "gunElevation",
'gunFrontalDepression', "gunFrontalDepression",
'gunFrontalElevation', "gunFrontalElevation",
'gunRearDepression', "gunRearDepression",
'gunRearElevation', "gunRearElevation",
'azimuthLeft', "azimuthLeft",
'azimuthRight', "azimuthRight",
], ],
}, },
{ {
name: 'Crew', name: "Crew",
items: ['crewCount'], items: ["crewCount"],
}, },
]; ];
@@ -1,5 +1,5 @@
import { Markdown } from '../../../../../components/Markdown'; import { Markdown } from "../../../../../components/Markdown";
import { PageWrapper } from '../../../../../components/PageWrapper'; import { PageWrapper } from "../../../../../components/PageWrapper";
interface PageProps { interface PageProps {
content: string; content: string;
@@ -7,7 +7,7 @@ interface PageProps {
export function Page({ content }: PageProps) { export function Page({ content }: PageProps) {
return ( return (
<PageWrapper> <PageWrapper maxWidth="50rem">
<Markdown>{content}</Markdown> <Markdown>{content}</Markdown>
</PageWrapper> </PageWrapper>
); );
@@ -6,6 +6,7 @@ import { literals } from "@blitzkit/i18n/src/literals";
import { Box, Flex, Link } from "@radix-ui/themes"; import { Box, Flex, Link } from "@radix-ui/themes";
import type { GetStaticPaths } from "astro"; import type { GetStaticPaths } from "astro";
import { AesonPlug } from "../../components/AesonPlug"; import { AesonPlug } from "../../components/AesonPlug";
import { Giveaway } from "../../components/Giveaway";
import HomeHero from "../../components/HomeHero.astro"; import HomeHero from "../../components/HomeHero.astro";
import { Plugs } from "../../components/Plugs"; import { Plugs } from "../../components/Plugs";
import ToolCard from "../../components/ToolCard.astro"; import ToolCard from "../../components/ToolCard.astro";
@@ -1,23 +1,31 @@
import { asset } from "@blitzkit/core"; import {
import { CaretRightIcon, UpdateIcon } from "@radix-ui/react-icons"; asset,
GunDefinition,
TankDefinition,
TIER_ROMAN_NUMERALS,
TurretDefinition,
} from "@blitzkit/core";
import { literals } from "@blitzkit/i18n";
import { CaretRightIcon, CaretUpIcon, UpdateIcon } from "@radix-ui/react-icons";
import { import {
Box, Box,
Button, Button,
Dialog, Dialog,
Flex, Flex,
IconButton,
Popover,
Skeleton, Skeleton,
Text, Text,
type ButtonProps, type ButtonProps,
} from "@radix-ui/themes"; } from "@radix-ui/themes";
import { useRef, useState } from "react"; import { useRef, useState } from "react";
import { MixerScene } from "../../../components/MixerScene"; import { MixerScene } from "../../../components/MixerScene";
import { ModuleButton } from "../../../components/ModuleButtons/ModuleButton";
import { PageWrapper } from "../../../components/PageWrapper"; import { PageWrapper } from "../../../components/PageWrapper";
import { ScreenshotButton } from "../../../components/ScreenshotButton"; import { ScreenshotButton } from "../../../components/ScreenshotButton";
import { import { TankSearch } from "../../../components/TankSearch";
TankSearch,
type TankSearchProps,
} from "../../../components/TankSearch";
import { awaitableModelDefinitions } from "../../../core/awaitables/modelDefinitions"; import { awaitableModelDefinitions } from "../../../core/awaitables/modelDefinitions";
import { awaitableTankDefinitions } from "../../../core/awaitables/tankDefinitions";
import { curateMixer } from "../../../core/blitzkit/curateMixer"; import { curateMixer } from "../../../core/blitzkit/curateMixer";
import { import {
LocaleProvider, LocaleProvider,
@@ -31,6 +39,7 @@ import type { MaybeSkeletonComponentProps } from "../../../types/maybeSkeletonCo
const modelDefinition = await awaitableModelDefinitions.then( const modelDefinition = await awaitableModelDefinitions.then(
({ models }) => models[1] ({ models }) => models[1]
); );
const tankDefinitions = await awaitableTankDefinitions;
export function Page({ export function Page({
locale, locale,
@@ -50,57 +59,147 @@ export function Page({
); );
} }
function ModuleButton({ type ModuleButtonProps = Omit<ButtonProps, "onSelect"> &
MaybeSkeletonComponentProps & {
tank: number;
onSelect: (
tank: TankDefinition,
turret?: TurretDefinition,
gun?: GunDefinition
) => void;
turret?: number;
gun?: number;
};
function ModuleChooser({
skeleton, skeleton,
tank, tank,
onSelect, onSelect,
turret,
gun,
...props ...props
}: Omit<ButtonProps, "onSelect"> & }: ModuleButtonProps) {
MaybeSkeletonComponentProps & {
tank: number;
onSelect: TankSearchProps["onSelect"];
}) {
const { strings } = useLocale(); const { strings } = useLocale();
const [open, setOpen] = useState(false); const [open, setOpen] = useState(false);
const tankDefinition = tankDefinitions.tanks[tank];
const turretDefinition = tankDefinition.turrets.find((t) => t.id === turret);
const gunDefinition = turretDefinition?.guns.find((g) => g.id === gun);
const subSelector =
turret !== undefined &&
(tankDefinition.turrets.length > 1 ||
(gun !== undefined && turretDefinition!.guns.length > 1));
return ( return (
<Dialog.Root open={open} onOpenChange={setOpen}> <Flex>
<Dialog.Trigger> <Dialog.Root open={open} onOpenChange={setOpen}>
<Button <Dialog.Trigger>
variant="surface" <Button
size="4" variant="surface"
style={{ overflow: "clip" }} size={{ initial: "3", md: "4" }}
{...props} style={{
> overflow: "clip",
{skeleton ? ( borderTopRightRadius: subSelector ? 0 : undefined,
<Skeleton width="4em" height="2em" /> borderBottomRightRadius: subSelector ? 0 : undefined,
) : ( }}
<img {...props}
>
{skeleton ? (
<Skeleton width="4em" height="2em" />
) : (
<img
style={{
width: "4em",
height: "4em",
objectFit: "contain",
}}
src={asset(`icons/tanks/big/${tank}.webp`)}
/>
)}
</Button>
</Dialog.Trigger>
<Dialog.Content>
<Dialog.Title>
{strings.website.common.tank_search.select_dialog_title}
</Dialog.Title>
<TankSearch
compact
onSelect={(tank) => {
onSelect?.(tank);
setOpen(false);
}}
/>
</Dialog.Content>
</Dialog.Root>
{subSelector && (
<Popover.Root>
<Popover.Trigger>
<IconButton
variant="surface"
size={{ initial: "3", md: "4" }}
style={{ style={{
width: "4em", overflow: "clip",
height: "4em", borderTopLeftRadius: 0,
objectFit: "contain", borderBottomLeftRadius: 0,
marginLeft: -1,
}} }}
src={asset(`icons/tanks/big/${tank}.webp`)} {...props}
/> >
)} <CaretUpIcon />
</Button> </IconButton>
</Dialog.Trigger> </Popover.Trigger>
<Dialog.Content> <Popover.Content>
<Dialog.Title> <Flex direction="column" gap="2">
{strings.website.common.tank_search.select_dialog_title} {tankDefinition.turrets.length > 1 && (
</Dialog.Title> <Flex gap="2">
{tankDefinition.turrets.map((turret) => (
<ModuleButton
variant={
turret.id === turretDefinition?.id ? "solid" : undefined
}
key={turret.id}
module="turret"
discriminator={TIER_ROMAN_NUMERALS[turret.tier]}
onClick={() => {
onSelect?.(tankDefinition, turret);
}}
/>
))}
</Flex>
)}
<TankSearch {turretDefinition && turretDefinition.guns.length > 1 && (
compact <Flex gap="2">
onSelect={(tank) => { {turretDefinition.guns.map((gun) => (
onSelect?.(tank); <ModuleButton
setOpen(false); variant={
}} gun.id === gunDefinition?.id ? "solid" : undefined
/> }
</Dialog.Content> key={gun.id}
</Dialog.Root> module="gun"
discriminator={TIER_ROMAN_NUMERALS[gun.tier]}
secondaryDiscriminator={
<Text style={{ fontSize: "0.75em" }}>
{literals(strings.common.units.mm, {
value: gun.shells[0].caliber.toFixed(0),
})}
</Text>
}
onClick={() => {
onSelect?.(tankDefinition, turretDefinition, gun);
}}
/>
))}
</Flex>
)}
</Flex>
</Popover.Content>
</Popover.Root>
)}
</Flex>
); );
} }
@@ -113,9 +212,12 @@ function ModuleSeparator() {
} }
function Content({ skeleton }: MaybeSkeletonComponentProps) { function Content({ skeleton }: MaybeSkeletonComponentProps) {
const hull = Mixer.use((state) => state.hull); const hullTankId = Mixer.use((state) => state.hull);
const turretId = Mixer.use((state) => state.turret.tank.id); const turretTankId = Mixer.use((state) => state.turret.tank.id);
const gunId = Mixer.use((state) => state.gun.tank.id); const turretTurretId = Mixer.use((state) => state.turret.turret.id);
const gunTankId = Mixer.use((state) => state.gun.tank.id);
const gunTurretId = Mixer.use((state) => state.gun.turret.id);
const gunGunId = Mixer.use((state) => state.gun.gun.id);
const canvas = useRef<HTMLCanvasElement>(null!); const canvas = useRef<HTMLCanvasElement>(null!);
const { strings } = useLocale(); const { strings } = useLocale();
@@ -136,7 +238,7 @@ function Content({ skeleton }: MaybeSkeletonComponentProps) {
> >
<Flex gap="2"> <Flex gap="2">
<ScreenshotButton <ScreenshotButton
name={hull.slug} name={hullTankId.slug}
canvas={canvas} canvas={canvas}
highContrast highContrast
variant="surface" variant="surface"
@@ -160,9 +262,9 @@ function Content({ skeleton }: MaybeSkeletonComponentProps) {
</Flex> </Flex>
<Flex gap="2" align="center"> <Flex gap="2" align="center">
<ModuleButton <ModuleChooser
skeleton={skeleton} skeleton={skeleton}
tank={hull.id} tank={hullTankId.id}
onSelect={(tank) => { onSelect={(tank) => {
Mixer.mutate((draft) => { Mixer.mutate((draft) => {
draft.hull = tank; draft.hull = tank;
@@ -170,28 +272,34 @@ function Content({ skeleton }: MaybeSkeletonComponentProps) {
}} }}
/> />
<ModuleSeparator /> <ModuleSeparator />
<ModuleButton <ModuleChooser
skeleton={skeleton} skeleton={skeleton}
tank={turretId} tank={turretTankId}
onSelect={(tank) => { turret={turretTurretId}
onSelect={(tank, turret) => {
Mixer.mutate((draft) => { Mixer.mutate((draft) => {
draft.turret = { draft.turret = {
tank, tank,
turret: tank.turrets.at(-1)!, turret: turret ?? tank.turrets.at(-1)!,
}; };
}); });
}} }}
/> />
<ModuleSeparator /> <ModuleSeparator />
<ModuleButton <ModuleChooser
skeleton={skeleton} skeleton={skeleton}
tank={gunId} tank={gunTankId}
onSelect={(tank) => { turret={gunTurretId}
gun={gunGunId}
onSelect={(tank, turret, gun) => {
Mixer.mutate((draft) => { Mixer.mutate((draft) => {
draft.gun = { draft.gun = {
tank, tank,
turret: tank.turrets.at(-1)!, turret: turret ?? tank.turrets.at(-1)!,
gun: tank.turrets.at(-1)!.guns.at(-1)!, gun:
gun ??
turret?.guns.at(-1) ??
tank.turrets.at(-1)!.guns.at(-1)!,
}; };
}); });
}} }}
+4
View File
@@ -12,6 +12,8 @@ export interface Guess {
guessState: GuessState; guessState: GuessState;
totalGuesses: number; totalGuesses: number;
correctGuesses: number; correctGuesses: number;
streak: number;
helpingReveal: boolean;
} }
export const Guess = new Varuna<Guess, TankDefinition>((tank) => ({ export const Guess = new Varuna<Guess, TankDefinition>((tank) => ({
@@ -19,4 +21,6 @@ export const Guess = new Varuna<Guess, TankDefinition>((tank) => ({
guessState: GuessState.NotGuessed, guessState: GuessState.NotGuessed,
totalGuesses: 0, totalGuesses: 0,
correctGuesses: 0, correctGuesses: 0,
streak: 0,
helpingReveal: false,
})); }));
@@ -21,6 +21,10 @@ export interface TankFilters {
searching: boolean; searching: boolean;
gunType: CaseType<GunDefinition>[]; gunType: CaseType<GunDefinition>[];
shells: [ShellType | null, ShellType | null, ShellType | null]; shells: [ShellType | null, ShellType | null, ShellType | null];
consumables: number[];
provisions: number[];
abilities: number[];
powers: number[];
showTesting: boolean; showTesting: boolean;
showNonTesting: boolean; showNonTesting: boolean;
@@ -37,6 +41,10 @@ export const TankFilters = new Varuna<TankFilters>({
searching: false, searching: false,
gunType: [], gunType: [],
shells: [null, null, null], shells: [null, null, null],
consumables: [],
provisions: [],
abilities: [],
powers: [],
showTesting: true, showTesting: true,
showNonTesting: true, showNonTesting: true,