Compare commits

...

99 Commits

Author SHA1 Message Date
Lugiad
afa983b445
Merge bad5b5b34c into 70e7f8b4d4 2025-08-15 17:14:37 +02:00
Bertie690
70e7f8b4d4
[Misc] Removed populateAnims script (#6229)
Removed `populateAnims`

Co-authored-by: Wlowscha <54003515+Wlowscha@users.noreply.github.com>
2025-08-15 17:11:37 +02:00
Lugiad
bad5b5b34c
Merge branch 'beta' into hebrew-pr 2025-08-14 12:43:33 +02:00
Lugiad
65024b6c13
Merge branch 'pagefaultgames:beta' into hebrew-pr 2025-07-21 20:49:22 +02:00
Lugiad
47848b04eb
Merge branch 'beta' into hebrew-pr 2025-07-11 20:02:22 +02:00
Lugiad
5b6d8331a0
Update starter-select-ui-handler.ts 2025-07-05 21:06:31 +02:00
Lugiad
e5f4793cf8
Merge branch 'beta' into hebrew-pr 2025-07-05 21:04:07 +02:00
Lugiad
50f36ef8cd
Merge branch 'beta' into hebrew-pr 2025-06-18 23:09:13 +02:00
Lugiad
95f4cdc2da
Update i18n.ts 2025-06-18 23:08:44 +02:00
Lugiad
8e7d3e4a6c
Merge branch 'beta' into hebrew-pr 2025-06-17 22:41:06 +02:00
Lugiad
55d6b9a168
Merge branch 'beta' into hebrew-pr 2025-06-16 13:24:10 +02:00
Lugiad
55804df91e
Merge branch 'beta' into hebrew-pr 2025-06-12 02:13:14 +02:00
Lugiad
814e6ba690
Merge branch 'beta' into hebrew-pr 2025-05-31 18:59:54 +02:00
Lugiad
638a318048
Merge branch 'beta' into hebrew-pr 2025-05-31 01:58:08 +02:00
Lugiad
e8cc0adc0a
Merge branch 'beta' into hebrew-pr 2025-05-28 00:25:50 +02:00
Lugiad
1266ec3d03
Merge branch 'beta' into hebrew-pr 2025-05-21 14:39:37 +02:00
Lugiad
f86bbb10f1
Merge branch 'beta' into hebrew-pr 2025-05-14 00:57:43 +02:00
Lugiad
3a7e477c26
Update common.ts 2025-05-10 15:03:08 +02:00
Lugiad
b9e1022aea
Merge branch 'beta' into hebrew-pr 2025-05-10 15:02:03 +02:00
Lugiad
072a255322
Delete src/utils.ts 2025-05-10 15:01:23 +02:00
Lugiad
d84b8c5249
Merge branch 'beta' into hebrew-pr 2025-04-03 16:29:47 +02:00
Lugiad
319f2f9ba1
Merge branch 'beta' into hebrew-pr 2025-03-31 18:06:25 +02:00
Lugiad
3d03da1051
Merge branch 'beta' into hebrew-pr 2025-03-25 21:12:44 +01:00
Lugiad
f213747500
Merge branch 'beta' into hebrew-pr 2025-03-20 23:24:31 +01:00
Lugiad
f090768750
Merge branch 'beta' into hebrew-pr 2025-03-09 22:32:52 +01:00
Lugiad
2e15267b3a
Merge branch 'pagefaultgames:beta' into hebrew-pr 2025-03-04 17:20:15 +01:00
Lugiad
9271e4e645
Merge branch 'beta' into hebrew-pr 2025-02-20 15:52:53 +01:00
Lugiad
151eb3faa8
Merge branch 'beta' into hebrew-pr 2025-02-14 13:47:47 +01:00
Lugiad
473c73fef7
Merge branch 'pagefaultgames:beta' into hebrew-pr 2025-02-05 16:39:51 +01:00
Lugiad
5506c2cd4d
Merge branch 'beta' into hebrew-pr 2025-01-30 16:21:58 +01:00
Lugiad
80523937e7
Merge branch 'beta' into hebrew-pr 2025-01-21 15:42:54 +01:00
Lugiad
8e3246777e
Merge branch 'beta' into hebrew-pr 2025-01-05 13:48:24 +01:00
Lugiad
b9a4c03d87
Merge branch 'beta' into hebrew-pr 2024-12-08 02:49:08 +01:00
Lugiad
dd877fc8a4
Merge branch 'beta' into hebrew-pr 2024-12-02 19:23:46 +01:00
Lugiad
334c26849f
Merge branch 'beta' into hebrew-pr 2024-11-04 02:21:30 +01:00
Lugiad
b95c9cc4c3
Add files via upload 2024-11-04 02:17:43 +01:00
Lugiad
f24f87f210
Merge branch 'beta' into hebrew-pr 2024-10-18 14:55:38 +02:00
Lugiad
b817253053
Merge branch 'beta' into hebrew-pr 2024-10-11 19:50:27 +02:00
Lugiad
3dfbffd589
Updated with hebrew characters 2024-10-07 20:24:13 +02:00
Lugiad
544af31502
Update i18n.ts 2024-10-07 18:39:06 +02:00
Lugiad
3c22323d01
Merge branch 'beta' into hebrew-pr 2024-10-07 18:36:06 +02:00
Lugiad
65651f6be8
Merge branch 'beta' into hebrew-pr 2024-10-03 15:49:58 +02:00
Lugiad
b013337c2b
Delete src/locales/he directory 2024-10-03 15:48:49 +02:00
Lugiad
d82903a100
Merge branch 'beta' into hebrew-pr 2024-09-29 23:08:23 +02:00
Lugiad
6f99cba1ab
Update menu.json 2024-09-29 21:19:02 +02:00
Lugiad
df2a0d963c
Update utils.ts 2024-09-29 20:46:54 +02:00
Lugiad
dfa826d5fa
Update settings-display-ui-handler.ts 2024-09-29 20:16:17 +02:00
Lugiad
fb35f6f230
Update settings.ts 2024-09-29 20:15:57 +02:00
Lugiad
7816e398a1
Merge branch 'beta' into hebrew-pr 2024-09-29 12:59:52 +02:00
Lugiad
804585c752
Add files via upload 2024-09-29 12:56:54 +02:00
Lugiad
056bfcf115
Delete src/locales/he directory 2024-09-29 12:55:13 +02:00
Lugiad
ab17b4b4e3
Add files via upload 2024-09-29 12:54:10 +02:00
Lugiad
9cf884dce0
Delete src/locales/he/mystery-encounters directory 2024-09-29 12:52:49 +02:00
Lugiad
20f910ab60
Add files via upload 2024-09-29 12:47:10 +02:00
Lugiad
fcca584be7
Merge branch 'beta' into hebrew-pr 2024-09-27 00:49:28 +02:00
Lugiad
224461c40f
Merge branch 'beta' into hebrew-pr 2024-09-26 02:31:55 +02:00
Lugiad
d7e0b67308
Add files via upload 2024-09-25 13:53:54 +02:00
Lugiad
dccd8aecca
Merge branch 'beta' into hebrew-pr 2024-09-25 13:47:14 +02:00
Lugiad
55f0e9f711
Update mysterious-chest-dialogue.json 2024-09-23 02:03:33 +02:00
Lugiad
adcfd4e6fc
Add files via upload 2024-09-22 22:54:08 +02:00
Lugiad
cfef026db4
Merge branch 'beta' into hebrew-pr 2024-09-22 18:20:01 +02:00
Lugiad
ffbaa9d087
Merge branch 'beta' into hebrew-pr 2024-09-22 12:48:34 +02:00
Lugiad
d0f6dd7df7
Merge branch 'beta' into hebrew-pr 2024-09-22 03:57:17 +02:00
Lugiad
d0bd19dac2
Merge branch 'beta' into hebrew-pr 2024-09-21 17:47:10 +02:00
Lugiad
d51f8e6668
Merge branch 'beta' into hebrew-pr 2024-09-20 18:42:48 +02:00
Lugiad
44d5d54221
Merge branch 'beta' into hebrew-pr 2024-09-20 16:28:18 +02:00
Lugiad
c523bc52e8
Merge branch 'beta' into hebrew-pr 2024-09-20 16:26:18 +02:00
Lugiad
8e1f6ac597
Merge branch 'beta' into hebrew-pr 2024-09-20 10:07:38 +02:00
Lugiad
cf065befd3
Merge branch 'beta' into hebrew-pr 2024-09-20 02:37:46 +02:00
Lugiad
b274f28b3b
Merge branch 'beta' into hebrew-pr 2024-09-19 23:14:46 +02:00
Lugiad
6b9161b452
Merge branch 'beta' into hebrew-pr 2024-09-19 18:05:34 +02:00
Lugiad
6c3947107b
Update config.ts 2024-09-18 19:47:42 +02:00
Lugiad
90bc7e61fc
Add files via upload 2024-09-18 19:12:48 +02:00
Lugiad
87330648df
Add files via upload 2024-09-18 19:11:57 +02:00
Lugiad
1460e2b008
Merge branch 'beta' into hebrew-pr 2024-09-18 18:49:13 +02:00
Lugiad
6495eef073
Update bgm-name.json 2024-09-18 17:23:29 +02:00
Lugiad
e0244e0b31
Update a-trainers-test-dialogue.json 2024-09-18 00:31:25 +02:00
Lugiad
8dffce19a2
Update bgm-name.json 2024-09-18 00:30:26 +02:00
Lugiad
778b8f02fc
Add files via upload 2024-09-16 23:42:53 +02:00
Lugiad
3336bf8f4d
statuses_he.json 2024-09-16 23:42:29 +02:00
Lugiad
9300c59ad0
statuses_he..json 2024-09-16 23:42:07 +02:00
Lugiad
a6a4e54c03
Merge branch 'beta' into hebrew-pr 2024-09-16 23:20:28 +02:00
Lugiad
75fe691cd5
Add files via upload 2024-09-15 23:03:18 +02:00
Lugiad
71cfcd338b
Delete src/locales/he_IL directory 2024-09-15 23:02:17 +02:00
Lugiad
932cc3fdc0
Update starter-select-ui-handler.ts 2024-09-15 22:47:02 +02:00
Lugiad
ef69cb3fd0
Update settings-display-ui-handler.ts 2024-09-15 22:46:29 +02:00
Lugiad
bd9ce49130
Update settings.ts 2024-09-15 22:46:01 +02:00
Lugiad
6605e0ba85
Update i18n.ts 2024-09-15 22:45:19 +02:00
Lugiad
7abc5e9315
Update config.ts 2024-09-15 22:44:35 +02:00
Lugiad
fe1a6079bc
Rename types_he-IL.png to types_he.png 2024-09-15 22:44:12 +02:00
Lugiad
892ad0adec
Update and rename types_he-IL.json to types_he.json 2024-09-15 22:43:34 +02:00
Lugiad
513ac1dd82
Update settings.ts 2024-09-15 21:09:39 +02:00
Lugiad
c295afd112
Update i18n.ts 2024-09-15 21:08:44 +02:00
Lugiad
39ac733d0e
Update settings-display-ui-handler.ts 2024-09-15 21:08:10 +02:00
Lugiad
d2f12b5e65
Update starter-select-ui-handler.ts 2024-09-15 21:07:09 +02:00
Lugiad
eef81f62e2
Update types_he-IL.json 2024-09-15 20:50:16 +02:00
Lugiad
340e667f14
Update menu.json 2024-09-15 20:26:31 +02:00
Lugiad
dc4e787cda
Add files via upload 2024-09-15 20:24:58 +02:00
Lugiad
6540524679
Add files via upload 2024-09-15 20:24:22 +02:00
11 changed files with 658 additions and 302 deletions

View File

@ -0,0 +1,188 @@
{
"textures": [
{
"image": "statuses_he.png",
"format": "RGBA8888",
"size": {
"w": 22,
"h": 64
},
"scale": 1,
"frames": [
{
"filename": "pokerus",
"rotated": false,
"trimmed": false,
"sourceSize": {
"w": 22,
"h": 8
},
"spriteSourceSize": {
"x": 0,
"y": 0,
"w": 22,
"h": 8
},
"frame": {
"x": 0,
"y": 0,
"w": 22,
"h": 8
}
},
{
"filename": "burn",
"rotated": false,
"trimmed": false,
"sourceSize": {
"w": 20,
"h": 8
},
"spriteSourceSize": {
"x": 0,
"y": 0,
"w": 20,
"h": 8
},
"frame": {
"x": 0,
"y": 8,
"w": 20,
"h": 8
}
},
{
"filename": "faint",
"rotated": false,
"trimmed": false,
"sourceSize": {
"w": 20,
"h": 8
},
"spriteSourceSize": {
"x": 0,
"y": 0,
"w": 20,
"h": 8
},
"frame": {
"x": 0,
"y": 16,
"w": 20,
"h": 8
}
},
{
"filename": "freeze",
"rotated": false,
"trimmed": false,
"sourceSize": {
"w": 20,
"h": 8
},
"spriteSourceSize": {
"x": 0,
"y": 0,
"w": 20,
"h": 8
},
"frame": {
"x": 0,
"y": 24,
"w": 20,
"h": 8
}
},
{
"filename": "paralysis",
"rotated": false,
"trimmed": false,
"sourceSize": {
"w": 20,
"h": 8
},
"spriteSourceSize": {
"x": 0,
"y": 0,
"w": 20,
"h": 8
},
"frame": {
"x": 0,
"y": 32,
"w": 20,
"h": 8
}
},
{
"filename": "poison",
"rotated": false,
"trimmed": false,
"sourceSize": {
"w": 20,
"h": 8
},
"spriteSourceSize": {
"x": 0,
"y": 0,
"w": 20,
"h": 8
},
"frame": {
"x": 0,
"y": 40,
"w": 20,
"h": 8
}
},
{
"filename": "sleep",
"rotated": false,
"trimmed": false,
"sourceSize": {
"w": 20,
"h": 8
},
"spriteSourceSize": {
"x": 0,
"y": 0,
"w": 20,
"h": 8
},
"frame": {
"x": 0,
"y": 48,
"w": 20,
"h": 8
}
},
{
"filename": "toxic",
"rotated": false,
"trimmed": false,
"sourceSize": {
"w": 20,
"h": 8
},
"spriteSourceSize": {
"x": 0,
"y": 0,
"w": 20,
"h": 8
},
"frame": {
"x": 0,
"y": 56,
"w": 20,
"h": 8
}
}
]
}
],
"meta": {
"app": "https://www.codeandweb.com/texturepacker",
"version": "3.0",
"smartupdate": "$TexturePacker:SmartUpdate:37686e85605d17b806f22d43081c1139:70535ffee63ba61b3397d8470c2c8982:e6649238c018d3630e55681417c698ca$"
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 441 B

440
public/images/types_he.json Normal file
View File

@ -0,0 +1,440 @@
{
"textures": [
{
"image": "types_he.png",
"format": "RGBA8888",
"size": {
"w": 32,
"h": 280
},
"scale": 1,
"frames": [
{
"filename": "unknown",
"rotated": false,
"trimmed": false,
"sourceSize": {
"w": 32,
"h": 14
},
"spriteSourceSize": {
"x": 0,
"y": 0,
"w": 32,
"h": 14
},
"frame": {
"x": 0,
"y": 0,
"w": 32,
"h": 14
}
},
{
"filename": "bug",
"rotated": false,
"trimmed": false,
"sourceSize": {
"w": 32,
"h": 14
},
"spriteSourceSize": {
"x": 0,
"y": 0,
"w": 32,
"h": 14
},
"frame": {
"x": 0,
"y": 14,
"w": 32,
"h": 14
}
},
{
"filename": "dark",
"rotated": false,
"trimmed": false,
"sourceSize": {
"w": 32,
"h": 14
},
"spriteSourceSize": {
"x": 0,
"y": 0,
"w": 32,
"h": 14
},
"frame": {
"x": 0,
"y": 28,
"w": 32,
"h": 14
}
},
{
"filename": "dragon",
"rotated": false,
"trimmed": false,
"sourceSize": {
"w": 32,
"h": 14
},
"spriteSourceSize": {
"x": 0,
"y": 0,
"w": 32,
"h": 14
},
"frame": {
"x": 0,
"y": 42,
"w": 32,
"h": 14
}
},
{
"filename": "electric",
"rotated": false,
"trimmed": false,
"sourceSize": {
"w": 32,
"h": 14
},
"spriteSourceSize": {
"x": 0,
"y": 0,
"w": 32,
"h": 14
},
"frame": {
"x": 0,
"y": 56,
"w": 32,
"h": 14
}
},
{
"filename": "fairy",
"rotated": false,
"trimmed": false,
"sourceSize": {
"w": 32,
"h": 14
},
"spriteSourceSize": {
"x": 0,
"y": 0,
"w": 32,
"h": 14
},
"frame": {
"x": 0,
"y": 70,
"w": 32,
"h": 14
}
},
{
"filename": "fighting",
"rotated": false,
"trimmed": false,
"sourceSize": {
"w": 32,
"h": 14
},
"spriteSourceSize": {
"x": 0,
"y": 0,
"w": 32,
"h": 14
},
"frame": {
"x": 0,
"y": 84,
"w": 32,
"h": 14
}
},
{
"filename": "fire",
"rotated": false,
"trimmed": false,
"sourceSize": {
"w": 32,
"h": 14
},
"spriteSourceSize": {
"x": 0,
"y": 0,
"w": 32,
"h": 14
},
"frame": {
"x": 0,
"y": 98,
"w": 32,
"h": 14
}
},
{
"filename": "flying",
"rotated": false,
"trimmed": false,
"sourceSize": {
"w": 32,
"h": 14
},
"spriteSourceSize": {
"x": 0,
"y": 0,
"w": 32,
"h": 14
},
"frame": {
"x": 0,
"y": 112,
"w": 32,
"h": 14
}
},
{
"filename": "ghost",
"rotated": false,
"trimmed": false,
"sourceSize": {
"w": 32,
"h": 14
},
"spriteSourceSize": {
"x": 0,
"y": 0,
"w": 32,
"h": 14
},
"frame": {
"x": 0,
"y": 126,
"w": 32,
"h": 14
}
},
{
"filename": "grass",
"rotated": false,
"trimmed": false,
"sourceSize": {
"w": 32,
"h": 14
},
"spriteSourceSize": {
"x": 0,
"y": 0,
"w": 32,
"h": 14
},
"frame": {
"x": 0,
"y": 140,
"w": 32,
"h": 14
}
},
{
"filename": "ground",
"rotated": false,
"trimmed": false,
"sourceSize": {
"w": 32,
"h": 14
},
"spriteSourceSize": {
"x": 0,
"y": 0,
"w": 32,
"h": 14
},
"frame": {
"x": 0,
"y": 154,
"w": 32,
"h": 14
}
},
{
"filename": "ice",
"rotated": false,
"trimmed": false,
"sourceSize": {
"w": 32,
"h": 14
},
"spriteSourceSize": {
"x": 0,
"y": 0,
"w": 32,
"h": 14
},
"frame": {
"x": 0,
"y": 168,
"w": 32,
"h": 14
}
},
{
"filename": "normal",
"rotated": false,
"trimmed": false,
"sourceSize": {
"w": 32,
"h": 14
},
"spriteSourceSize": {
"x": 0,
"y": 0,
"w": 32,
"h": 14
},
"frame": {
"x": 0,
"y": 182,
"w": 32,
"h": 14
}
},
{
"filename": "poison",
"rotated": false,
"trimmed": false,
"sourceSize": {
"w": 32,
"h": 14
},
"spriteSourceSize": {
"x": 0,
"y": 0,
"w": 32,
"h": 14
},
"frame": {
"x": 0,
"y": 196,
"w": 32,
"h": 14
}
},
{
"filename": "psychic",
"rotated": false,
"trimmed": false,
"sourceSize": {
"w": 32,
"h": 14
},
"spriteSourceSize": {
"x": 0,
"y": 0,
"w": 32,
"h": 14
},
"frame": {
"x": 0,
"y": 210,
"w": 32,
"h": 14
}
},
{
"filename": "rock",
"rotated": false,
"trimmed": false,
"sourceSize": {
"w": 32,
"h": 14
},
"spriteSourceSize": {
"x": 0,
"y": 0,
"w": 32,
"h": 14
},
"frame": {
"x": 0,
"y": 224,
"w": 32,
"h": 14
}
},
{
"filename": "steel",
"rotated": false,
"trimmed": false,
"sourceSize": {
"w": 32,
"h": 14
},
"spriteSourceSize": {
"x": 0,
"y": 0,
"w": 32,
"h": 14
},
"frame": {
"x": 0,
"y": 238,
"w": 32,
"h": 14
}
},
{
"filename": "water",
"rotated": false,
"trimmed": false,
"sourceSize": {
"w": 32,
"h": 14
},
"spriteSourceSize": {
"x": 0,
"y": 0,
"w": 32,
"h": 14
},
"frame": {
"x": 0,
"y": 252,
"w": 32,
"h": 14
}
},
{
"filename": "stellar",
"rotated": false,
"trimmed": false,
"sourceSize": {
"w": 32,
"h": 14
},
"spriteSourceSize": {
"x": 0,
"y": 0,
"w": 32,
"h": 14
},
"frame": {
"x": 0,
"y": 266,
"w": 32,
"h": 14
}
}
]
}
],
"meta": {
"app": "https://www.codeandweb.com/texturepacker",
"version": "3.0",
"smartupdate": "$TexturePacker:SmartUpdate:f14cf47d9a8f1d40c8e03aa6ba00fff3:6fc4227b57a95d429a1faad4280f7ec8:5961efbfbf4c56b8745347e7a663a32f$"
}
}

BIN
public/images/types_he.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.4 KiB

View File

@ -27,13 +27,7 @@ import { UiInputs } from "#app/ui-inputs";
import { biomeDepths, getBiomeName } from "#balance/biomes";
import { pokemonPrevolutions } from "#balance/pokemon-evolutions";
import { FRIENDSHIP_GAIN_FROM_BATTLE } from "#balance/starters";
import {
initCommonAnims,
initMoveAnim,
loadCommonAnimAssets,
loadMoveAnimAssets,
populateAnims,
} from "#data/battle-anims";
import { initCommonAnims, initMoveAnim, loadCommonAnimAssets, loadMoveAnimAssets } from "#data/battle-anims";
import { allAbilities, allMoves, allSpecies, modifierTypes } from "#data/data-lists";
import { battleSpecDialogue } from "#data/dialogue";
import type { SpeciesFormChangeTrigger } from "#data/form-change-triggers";
@ -388,7 +382,6 @@ export class BattleScene extends SceneBase {
const defaultMoves = [MoveId.TACKLE, MoveId.TAIL_WHIP, MoveId.FOCUS_ENERGY, MoveId.STRUGGLE];
await Promise.all([
populateAnims(),
this.initVariantData(),
initCommonAnims().then(() => loadCommonAnimAssets(true)),
Promise.all(defaultMoves.map(m => initMoveAnim(m))).then(() => loadMoveAnimAssets(defaultMoves, true)),

View File

@ -404,22 +404,18 @@ export const chargeAnims = new Map<ChargeAnim, AnimConfig | [AnimConfig, AnimCon
export const commonAnims = new Map<CommonAnim, AnimConfig>();
export const encounterAnims = new Map<EncounterAnim, AnimConfig>();
export function initCommonAnims(): Promise<void> {
return new Promise(resolve => {
const commonAnimNames = getEnumKeys(CommonAnim);
const commonAnimIds = getEnumValues(CommonAnim);
const commonAnimFetches: Promise<Map<CommonAnim, AnimConfig>>[] = [];
for (let ca = 0; ca < commonAnimIds.length; ca++) {
const commonAnimId = commonAnimIds[ca];
commonAnimFetches.push(
globalScene
.cachedFetch(`./battle-anims/common-${toKebabCase(commonAnimNames[ca])}.json`)
.then(response => response.json())
.then(cas => commonAnims.set(commonAnimId, new AnimConfig(cas))),
);
}
Promise.allSettled(commonAnimFetches).then(() => resolve());
});
export async function initCommonAnims(): Promise<void> {
const commonAnimFetches: Promise<Map<CommonAnim, AnimConfig>>[] = [];
for (const commonAnimName of getEnumKeys(CommonAnim)) {
const commonAnimId = CommonAnim[commonAnimName];
commonAnimFetches.push(
globalScene
.cachedFetch(`./battle-anims/common-${toKebabCase(commonAnimName)}.json`)
.then(response => response.json())
.then(cas => commonAnims.set(commonAnimId, new AnimConfig(cas))),
);
}
await Promise.allSettled(commonAnimFetches);
}
export function initMoveAnim(move: MoveId): Promise<void> {
@ -1396,279 +1392,3 @@ export class EncounterBattleAnim extends BattleAnim {
return this.oppAnim;
}
}
export async function populateAnims() {
const commonAnimNames = getEnumKeys(CommonAnim).map(k => k.toLowerCase());
const commonAnimMatchNames = commonAnimNames.map(k => k.replace(/_/g, ""));
const commonAnimIds = getEnumValues(CommonAnim);
const chargeAnimNames = getEnumKeys(ChargeAnim).map(k => k.toLowerCase());
const chargeAnimMatchNames = chargeAnimNames.map(k => k.replace(/_/g, " "));
const chargeAnimIds = getEnumValues(ChargeAnim);
const commonNamePattern = /name: (?:Common:)?(Opp )?(.*)/;
const moveNameToId = {};
// Exclude MoveId.NONE;
for (const move of getEnumValues(MoveId).slice(1)) {
// KARATE_CHOP => KARATECHOP
const moveName = MoveId[move].toUpperCase().replace(/_/g, "");
moveNameToId[moveName] = move;
}
const seNames: string[] = []; //(await fs.readdir('./public/audio/se/battle_anims/')).map(se => se.toString());
const animsData: any[] = []; //battleAnimRawData.split('!ruby/array:PBAnimation').slice(1); // TODO: add a proper type
for (let a = 0; a < animsData.length; a++) {
const fields = animsData[a].split("@").slice(1);
const nameField = fields.find(f => f.startsWith("name: "));
let isOppMove: boolean | undefined;
let commonAnimId: CommonAnim | undefined;
let chargeAnimId: ChargeAnim | undefined;
if (!nameField.startsWith("name: Move:") && !(isOppMove = nameField.startsWith("name: OppMove:"))) {
const nameMatch = commonNamePattern.exec(nameField)!; // TODO: is this bang correct?
const name = nameMatch[2].toLowerCase();
if (commonAnimMatchNames.indexOf(name) > -1) {
commonAnimId = commonAnimIds[commonAnimMatchNames.indexOf(name)];
} else if (chargeAnimMatchNames.indexOf(name) > -1) {
isOppMove = nameField.startsWith("name: Opp ");
chargeAnimId = chargeAnimIds[chargeAnimMatchNames.indexOf(name)];
}
}
const nameIndex = nameField.indexOf(":", 5) + 1;
const animName = nameField.slice(nameIndex, nameField.indexOf("\n", nameIndex));
if (!moveNameToId.hasOwnProperty(animName) && !commonAnimId && !chargeAnimId) {
continue;
}
const anim = commonAnimId || chargeAnimId ? new AnimConfig() : new AnimConfig();
if (anim instanceof AnimConfig) {
(anim as AnimConfig).id = moveNameToId[animName];
}
if (commonAnimId) {
commonAnims.set(commonAnimId, anim);
} else if (chargeAnimId) {
chargeAnims.set(chargeAnimId, !isOppMove ? anim : [chargeAnims.get(chargeAnimId) as AnimConfig, anim]);
} else {
moveAnims.set(
moveNameToId[animName],
!isOppMove ? (anim as AnimConfig) : [moveAnims.get(moveNameToId[animName]) as AnimConfig, anim as AnimConfig],
);
}
for (let f = 0; f < fields.length; f++) {
const field = fields[f];
const fieldName = field.slice(0, field.indexOf(":"));
const fieldData = field.slice(fieldName.length + 1, field.lastIndexOf("\n")).trim();
switch (fieldName) {
case "array": {
const framesData = fieldData.split(" - - - ").slice(1);
for (let fd = 0; fd < framesData.length; fd++) {
anim.frames.push([]);
const frameData = framesData[fd];
const focusFramesData = frameData.split(" - - ");
for (let tf = 0; tf < focusFramesData.length; tf++) {
const values = focusFramesData[tf].replace(/ {6}- /g, "").split("\n");
const targetFrame = new AnimFrame(
Number.parseFloat(values[0]),
Number.parseFloat(values[1]),
Number.parseFloat(values[2]),
Number.parseFloat(values[11]),
Number.parseFloat(values[3]),
Number.parseInt(values[4]) === 1,
Number.parseInt(values[6]) === 1,
Number.parseInt(values[5]),
Number.parseInt(values[7]),
Number.parseInt(values[8]),
Number.parseInt(values[12]),
Number.parseInt(values[13]),
Number.parseInt(values[14]),
Number.parseInt(values[15]),
Number.parseInt(values[16]),
Number.parseInt(values[17]),
Number.parseInt(values[18]),
Number.parseInt(values[19]),
Number.parseInt(values[21]),
Number.parseInt(values[22]),
Number.parseInt(values[23]),
Number.parseInt(values[24]),
Number.parseInt(values[20]) === 1,
Number.parseInt(values[25]),
Number.parseInt(values[26]) as AnimFocus,
);
anim.frames[fd].push(targetFrame);
}
}
break;
}
case "graphic": {
const graphic = fieldData !== "''" ? fieldData : "";
anim.graphic = graphic.indexOf(".") > -1 ? graphic.slice(0, fieldData.indexOf(".")) : graphic;
break;
}
case "timing": {
const timingEntries = fieldData.split("- !ruby/object:PBAnimTiming ").slice(1);
for (let t = 0; t < timingEntries.length; t++) {
const timingData = timingEntries[t]
.replace(/\n/g, " ")
.replace(/[ ]{2,}/g, " ")
.replace(/[a-z]+: ! '', /gi, "")
.replace(/name: (.*?),/, 'name: "$1",')
.replace(
/flashColor: !ruby\/object:Color { alpha: ([\d.]+), blue: ([\d.]+), green: ([\d.]+), red: ([\d.]+)}/,
"flashRed: $4, flashGreen: $3, flashBlue: $2, flashAlpha: $1",
);
const frameIndex = Number.parseInt(/frame: (\d+)/.exec(timingData)![1]); // TODO: is the bang correct?
let resourceName = /name: "(.*?)"/.exec(timingData)![1].replace("''", ""); // TODO: is the bang correct?
const timingType = Number.parseInt(/timingType: (\d)/.exec(timingData)![1]); // TODO: is the bang correct?
let timedEvent: AnimTimedEvent | undefined;
switch (timingType) {
case 0:
if (resourceName && resourceName.indexOf(".") === -1) {
let ext: string | undefined;
["wav", "mp3", "m4a"].every(e => {
if (seNames.indexOf(`${resourceName}.${e}`) > -1) {
ext = e;
return false;
}
return true;
});
if (!ext) {
ext = ".wav";
}
resourceName += `.${ext}`;
}
timedEvent = new AnimTimedSoundEvent(frameIndex, resourceName);
break;
case 1:
timedEvent = new AnimTimedAddBgEvent(frameIndex, resourceName.slice(0, resourceName.indexOf(".")));
break;
case 2:
timedEvent = new AnimTimedUpdateBgEvent(frameIndex, resourceName.slice(0, resourceName.indexOf(".")));
break;
}
if (!timedEvent) {
continue;
}
const propPattern = /([a-z]+): (.*?)(?:,|\})/gi;
let propMatch: RegExpExecArray;
while ((propMatch = propPattern.exec(timingData)!)) {
// TODO: is this bang correct?
const prop = propMatch[1];
let value: any = propMatch[2];
switch (prop) {
case "bgX":
case "bgY":
value = Number.parseFloat(value);
break;
case "volume":
case "pitch":
case "opacity":
case "colorRed":
case "colorGreen":
case "colorBlue":
case "colorAlpha":
case "duration":
case "flashScope":
case "flashRed":
case "flashGreen":
case "flashBlue":
case "flashAlpha":
case "flashDuration":
value = Number.parseInt(value);
break;
}
if (timedEvent.hasOwnProperty(prop)) {
timedEvent[prop] = value;
}
}
if (!anim.frameTimedEvents.has(frameIndex)) {
anim.frameTimedEvents.set(frameIndex, []);
}
anim.frameTimedEvents.get(frameIndex)!.push(timedEvent); // TODO: is this bang correct?
}
break;
}
case "position":
anim.position = Number.parseInt(fieldData);
break;
case "hue":
anim.hue = Number.parseInt(fieldData);
break;
}
}
}
// biome-ignore lint/correctness/noUnusedVariables: used in commented code
const animReplacer = (k, v) => {
if (k === "id" && !v) {
return undefined;
}
if (v instanceof Map) {
return Object.fromEntries(v);
}
if (v instanceof AnimTimedEvent) {
v["eventType"] = v.getEventType();
}
return v;
};
const animConfigProps = ["id", "graphic", "frames", "frameTimedEvents", "position", "hue"];
const animFrameProps = [
"x",
"y",
"zoomX",
"zoomY",
"angle",
"mirror",
"visible",
"blendType",
"target",
"graphicFrame",
"opacity",
"color",
"tone",
"flash",
"locked",
"priority",
"focus",
];
const propSets = [animConfigProps, animFrameProps];
// biome-ignore lint/correctness/noUnusedVariables: used in commented code
const animComparator = (a: Element, b: Element) => {
let props: string[];
for (let p = 0; p < propSets.length; p++) {
props = propSets[p];
// @ts-expect-error TODO
const ai = props.indexOf(a.key);
if (ai === -1) {
continue;
}
// @ts-expect-error TODO
const bi = props.indexOf(b.key);
return ai < bi ? -1 : ai > bi ? 1 : 0;
}
return 0;
};
/*for (let ma of moveAnims.keys()) {
const data = moveAnims.get(ma);
(async () => {
await fs.writeFile(`../public/battle-anims/${Moves[ma].toLowerCase().replace(/\_/g, '-')}.json`, stringify(data, { replacer: animReplacer, cmp: animComparator, space: ' ' }));
})();
}
for (let ca of chargeAnims.keys()) {
const data = chargeAnims.get(ca);
(async () => {
await fs.writeFile(`../public/battle-anims/${chargeAnimNames[chargeAnimIds.indexOf(ca)].replace(/\_/g, '-')}.json`, stringify(data, { replacer: animReplacer, cmp: animComparator, space: ' ' }));
})();
}
for (let cma of commonAnims.keys()) {
const data = commonAnims.get(cma);
(async () => {
await fs.writeFile(`../public/battle-anims/common-${commonAnimNames[commonAnimIds.indexOf(cma)].replace(/\_/g, '-')}.json`, stringify(data, { replacer: animReplacer, cmp: animComparator, space: ' ' }));
})();
}*/
}

View File

@ -79,13 +79,13 @@ const fonts: Array<LoadingFontFaceProperty> = [
face: new FontFace("emerald", "url(./fonts/pokemon-bw.ttf)", {
unicodeRange: rangesByLanguage.japanese,
}),
only: ["en", "es", "fr", "it", "de", "pt", "ko", "ja", "ca", "da", "tr", "ro", "ru", "tl"],
only: ["en", "es", "fr", "it", "de", "pt", "ko", "ja", "ca", "da", "tr", "ro", "ru", "tl", "he"],
},
{
face: new FontFace("pkmnems", "url(./fonts/pokemon-bw.ttf)", {
unicodeRange: rangesByLanguage.japanese,
}),
only: ["en", "es", "fr", "it", "de", "pt", "ko", "ja", "ca", "da", "tr", "ro", "ru", "tl"],
only: ["en", "es", "fr", "it", "de", "pt", "ko", "ja", "ca", "da", "tr", "ro", "ru", "tl", "he"],
},
];
@ -192,6 +192,7 @@ export async function initI18n(): Promise<void> {
"ro",
"ru",
"tl",
"he",
],
backend: {
loadPath(lng: string, [ns]: string[]) {

View File

@ -985,6 +985,10 @@ export function setSetting(setting: string, value: number): boolean {
label: "Tagalog (Needs Help)",
handler: () => changeLocaleHandler("tl"),
},
{
label: "עברית",
handler: () => changeLocaleHandler("he")
},
{
label: i18next.t("settings:back"),
handler: () => cancelHandler(),

View File

@ -122,6 +122,11 @@ export class SettingsDisplayUiHandler extends AbstractSettingsUiHandler {
value: "Tagalog",
label: "Tagalog (Needs Help)",
};
case "he":
this.settings[languageIndex].options[0] = {
value: "עברית",
label: "עברית",
};
break;
default:
this.settings[languageIndex].options[0] = {

View File

@ -181,6 +181,10 @@ const languageSettings: { [key: string]: LanguageSetting } = {
starterInfoTextSize: "56px",
instructionTextSize: "38px",
},
he: {
starterInfoTextSize: "56px",
instructionTextSize: "38px",
},
};
const valueReductionMax = 2;

View File

@ -430,6 +430,7 @@ export function hasAllLocalizedSprites(lang?: string): boolean {
case "fr":
case "da":
case "de":
case "he":
case "it":
case "zh-CN":
case "zh-TW":