From 6a1da862d44fd8c306b9c379d73c4851e406aae7 Mon Sep 17 00:00:00 2001 From: Flashfyre Date: Mon, 13 May 2024 14:01:49 -0400 Subject: [PATCH] Add WiP changes for Nuzlocke mode --- public/images/trainer/nuzleaf.json | 2036 ++++++++++++++++++++++++++++ public/images/trainer/nuzleaf.png | Bin 0 -> 4043 bytes src/battle-scene.ts | 9 +- src/battle.ts | 15 +- src/data/dialogue.ts | 27 +- src/data/enums/trainer-type.ts | 3 +- src/data/trainer-config.ts | 40 +- src/enums/battle-spec.ts | 3 +- src/field/pokemon.ts | 4 +- src/field/trainer.ts | 23 +- src/game-mode.ts | 5 +- src/loading-scene.ts | 2 +- src/messages.ts | 1 + src/phases.ts | 68 +- src/system/pokemon-data.ts | 7 +- 15 files changed, 2210 insertions(+), 33 deletions(-) create mode 100644 public/images/trainer/nuzleaf.json create mode 100644 public/images/trainer/nuzleaf.png diff --git a/public/images/trainer/nuzleaf.json b/public/images/trainer/nuzleaf.json new file mode 100644 index 00000000000..e2e793fce14 --- /dev/null +++ b/public/images/trainer/nuzleaf.json @@ -0,0 +1,2036 @@ +{ + "textures": [ + { + "image": "nuzleaf.png", + "format": "RGBA8888", + "size": { + "w": 215, + "h": 215 + }, + "scale": 1, + "frames": [ + { + "filename": "0005.png", + "rotated": false, + "trimmed": true, + "sourceSize": { + "w": 46, + "h": 58 + }, + "spriteSourceSize": { + "x": 1, + "y": 0, + "w": 43, + "h": 58 + }, + "frame": { + "x": 0, + "y": 0, + "w": 43, + "h": 58 + } + }, + { + "filename": "0006.png", + "rotated": false, + "trimmed": true, + "sourceSize": { + "w": 46, + "h": 58 + }, + "spriteSourceSize": { + "x": 1, + "y": 0, + "w": 43, + "h": 58 + }, + "frame": { + "x": 0, + "y": 0, + "w": 43, + "h": 58 + } + }, + { + "filename": "0029.png", + "rotated": false, + "trimmed": true, + "sourceSize": { + "w": 46, + "h": 58 + }, + "spriteSourceSize": { + "x": 1, + "y": 0, + "w": 43, + "h": 58 + }, + "frame": { + "x": 0, + "y": 0, + "w": 43, + "h": 58 + } + }, + { + "filename": "0030.png", + "rotated": false, + "trimmed": true, + "sourceSize": { + "w": 46, + "h": 58 + }, + "spriteSourceSize": { + "x": 1, + "y": 0, + "w": 43, + "h": 58 + }, + "frame": { + "x": 0, + "y": 0, + "w": 43, + "h": 58 + } + }, + { + "filename": "0053.png", + "rotated": false, + "trimmed": true, + "sourceSize": { + "w": 46, + "h": 58 + }, + "spriteSourceSize": { + "x": 1, + "y": 0, + "w": 43, + "h": 58 + }, + "frame": { + "x": 0, + "y": 0, + "w": 43, + "h": 58 + } + }, + { + "filename": "0054.png", + "rotated": false, + "trimmed": true, + "sourceSize": { + "w": 46, + "h": 58 + }, + "spriteSourceSize": { + "x": 1, + "y": 0, + "w": 43, + "h": 58 + }, + "frame": { + "x": 0, + "y": 0, + "w": 43, + "h": 58 + } + }, + { + "filename": "0077.png", + "rotated": false, + "trimmed": true, + "sourceSize": { + "w": 46, + "h": 58 + }, + "spriteSourceSize": { + "x": 1, + "y": 0, + "w": 43, + "h": 58 + }, + "frame": { + "x": 0, + "y": 0, + "w": 43, + "h": 58 + } + }, + { + "filename": "0078.png", + "rotated": false, + "trimmed": true, + "sourceSize": { + "w": 46, + "h": 58 + }, + "spriteSourceSize": { + "x": 1, + "y": 0, + "w": 43, + "h": 58 + }, + "frame": { + "x": 0, + "y": 0, + "w": 43, + "h": 58 + } + }, + { + "filename": "0017.png", + "rotated": false, + "trimmed": true, + "sourceSize": { + "w": 46, + "h": 58 + }, + "spriteSourceSize": { + "x": 1, + "y": 0, + "w": 43, + "h": 58 + }, + "frame": { + "x": 0, + "y": 58, + "w": 43, + "h": 58 + } + }, + { + "filename": "0018.png", + "rotated": false, + "trimmed": true, + "sourceSize": { + "w": 46, + "h": 58 + }, + "spriteSourceSize": { + "x": 1, + "y": 0, + "w": 43, + "h": 58 + }, + "frame": { + "x": 0, + "y": 58, + "w": 43, + "h": 58 + } + }, + { + "filename": "0041.png", + "rotated": false, + "trimmed": true, + "sourceSize": { + "w": 46, + "h": 58 + }, + "spriteSourceSize": { + "x": 1, + "y": 0, + "w": 43, + "h": 58 + }, + "frame": { + "x": 0, + "y": 58, + "w": 43, + "h": 58 + } + }, + { + "filename": "0042.png", + "rotated": false, + "trimmed": true, + "sourceSize": { + "w": 46, + "h": 58 + }, + "spriteSourceSize": { + "x": 1, + "y": 0, + "w": 43, + "h": 58 + }, + "frame": { + "x": 0, + "y": 58, + "w": 43, + "h": 58 + } + }, + { + "filename": "0065.png", + "rotated": false, + "trimmed": true, + "sourceSize": { + "w": 46, + "h": 58 + }, + "spriteSourceSize": { + "x": 1, + "y": 0, + "w": 43, + "h": 58 + }, + "frame": { + "x": 0, + "y": 58, + "w": 43, + "h": 58 + } + }, + { + "filename": "0066.png", + "rotated": false, + "trimmed": true, + "sourceSize": { + "w": 46, + "h": 58 + }, + "spriteSourceSize": { + "x": 1, + "y": 0, + "w": 43, + "h": 58 + }, + "frame": { + "x": 0, + "y": 58, + "w": 43, + "h": 58 + } + }, + { + "filename": "0089.png", + "rotated": false, + "trimmed": true, + "sourceSize": { + "w": 46, + "h": 58 + }, + "spriteSourceSize": { + "x": 1, + "y": 0, + "w": 43, + "h": 58 + }, + "frame": { + "x": 0, + "y": 58, + "w": 43, + "h": 58 + } + }, + { + "filename": "0090.png", + "rotated": false, + "trimmed": true, + "sourceSize": { + "w": 46, + "h": 58 + }, + "spriteSourceSize": { + "x": 1, + "y": 0, + "w": 43, + "h": 58 + }, + "frame": { + "x": 0, + "y": 58, + "w": 43, + "h": 58 + } + }, + { + "filename": "0007.png", + "rotated": false, + "trimmed": true, + "sourceSize": { + "w": 46, + "h": 58 + }, + "spriteSourceSize": { + "x": 1, + "y": 0, + "w": 42, + "h": 58 + }, + "frame": { + "x": 0, + "y": 116, + "w": 42, + "h": 58 + } + }, + { + "filename": "0031.png", + "rotated": false, + "trimmed": true, + "sourceSize": { + "w": 46, + "h": 58 + }, + "spriteSourceSize": { + "x": 1, + "y": 0, + "w": 42, + "h": 58 + }, + "frame": { + "x": 0, + "y": 116, + "w": 42, + "h": 58 + } + }, + { + "filename": "0055.png", + "rotated": false, + "trimmed": true, + "sourceSize": { + "w": 46, + "h": 58 + }, + "spriteSourceSize": { + "x": 1, + "y": 0, + "w": 42, + "h": 58 + }, + "frame": { + "x": 0, + "y": 116, + "w": 42, + "h": 58 + } + }, + { + "filename": "0079.png", + "rotated": false, + "trimmed": true, + "sourceSize": { + "w": 46, + "h": 58 + }, + "spriteSourceSize": { + "x": 1, + "y": 0, + "w": 42, + "h": 58 + }, + "frame": { + "x": 0, + "y": 116, + "w": 42, + "h": 58 + } + }, + { + "filename": "0015.png", + "rotated": false, + "trimmed": true, + "sourceSize": { + "w": 46, + "h": 58 + }, + "spriteSourceSize": { + "x": 0, + "y": 0, + "w": 42, + "h": 58 + }, + "frame": { + "x": 42, + "y": 116, + "w": 42, + "h": 58 + } + }, + { + "filename": "0016.png", + "rotated": false, + "trimmed": true, + "sourceSize": { + "w": 46, + "h": 58 + }, + "spriteSourceSize": { + "x": 0, + "y": 0, + "w": 42, + "h": 58 + }, + "frame": { + "x": 42, + "y": 116, + "w": 42, + "h": 58 + } + }, + { + "filename": "0039.png", + "rotated": false, + "trimmed": true, + "sourceSize": { + "w": 46, + "h": 58 + }, + "spriteSourceSize": { + "x": 0, + "y": 0, + "w": 42, + "h": 58 + }, + "frame": { + "x": 42, + "y": 116, + "w": 42, + "h": 58 + } + }, + { + "filename": "0040.png", + "rotated": false, + "trimmed": true, + "sourceSize": { + "w": 46, + "h": 58 + }, + "spriteSourceSize": { + "x": 0, + "y": 0, + "w": 42, + "h": 58 + }, + "frame": { + "x": 42, + "y": 116, + "w": 42, + "h": 58 + } + }, + { + "filename": "0063.png", + "rotated": false, + "trimmed": true, + "sourceSize": { + "w": 46, + "h": 58 + }, + "spriteSourceSize": { + "x": 0, + "y": 0, + "w": 42, + "h": 58 + }, + "frame": { + "x": 42, + "y": 116, + "w": 42, + "h": 58 + } + }, + { + "filename": "0064.png", + "rotated": false, + "trimmed": true, + "sourceSize": { + "w": 46, + "h": 58 + }, + "spriteSourceSize": { + "x": 0, + "y": 0, + "w": 42, + "h": 58 + }, + "frame": { + "x": 42, + "y": 116, + "w": 42, + "h": 58 + } + }, + { + "filename": "0087.png", + "rotated": false, + "trimmed": true, + "sourceSize": { + "w": 46, + "h": 58 + }, + "spriteSourceSize": { + "x": 0, + "y": 0, + "w": 42, + "h": 58 + }, + "frame": { + "x": 42, + "y": 116, + "w": 42, + "h": 58 + } + }, + { + "filename": "0088.png", + "rotated": false, + "trimmed": true, + "sourceSize": { + "w": 46, + "h": 58 + }, + "spriteSourceSize": { + "x": 0, + "y": 0, + "w": 42, + "h": 58 + }, + "frame": { + "x": 42, + "y": 116, + "w": 42, + "h": 58 + } + }, + { + "filename": "0008.png", + "rotated": false, + "trimmed": true, + "sourceSize": { + "w": 46, + "h": 58 + }, + "spriteSourceSize": { + "x": 1, + "y": 0, + "w": 41, + "h": 58 + }, + "frame": { + "x": 43, + "y": 0, + "w": 41, + "h": 58 + } + }, + { + "filename": "0032.png", + "rotated": false, + "trimmed": true, + "sourceSize": { + "w": 46, + "h": 58 + }, + "spriteSourceSize": { + "x": 1, + "y": 0, + "w": 41, + "h": 58 + }, + "frame": { + "x": 43, + "y": 0, + "w": 41, + "h": 58 + } + }, + { + "filename": "0056.png", + "rotated": false, + "trimmed": true, + "sourceSize": { + "w": 46, + "h": 58 + }, + "spriteSourceSize": { + "x": 1, + "y": 0, + "w": 41, + "h": 58 + }, + "frame": { + "x": 43, + "y": 0, + "w": 41, + "h": 58 + } + }, + { + "filename": "0080.png", + "rotated": false, + "trimmed": true, + "sourceSize": { + "w": 46, + "h": 58 + }, + "spriteSourceSize": { + "x": 1, + "y": 0, + "w": 41, + "h": 58 + }, + "frame": { + "x": 43, + "y": 0, + "w": 41, + "h": 58 + } + }, + { + "filename": "0009.png", + "rotated": false, + "trimmed": true, + "sourceSize": { + "w": 46, + "h": 58 + }, + "spriteSourceSize": { + "x": 0, + "y": 0, + "w": 41, + "h": 58 + }, + "frame": { + "x": 43, + "y": 58, + "w": 41, + "h": 58 + } + }, + { + "filename": "0033.png", + "rotated": false, + "trimmed": true, + "sourceSize": { + "w": 46, + "h": 58 + }, + "spriteSourceSize": { + "x": 0, + "y": 0, + "w": 41, + "h": 58 + }, + "frame": { + "x": 43, + "y": 58, + "w": 41, + "h": 58 + } + }, + { + "filename": "0057.png", + "rotated": false, + "trimmed": true, + "sourceSize": { + "w": 46, + "h": 58 + }, + "spriteSourceSize": { + "x": 0, + "y": 0, + "w": 41, + "h": 58 + }, + "frame": { + "x": 43, + "y": 58, + "w": 41, + "h": 58 + } + }, + { + "filename": "0081.png", + "rotated": false, + "trimmed": true, + "sourceSize": { + "w": 46, + "h": 58 + }, + "spriteSourceSize": { + "x": 0, + "y": 0, + "w": 41, + "h": 58 + }, + "frame": { + "x": 43, + "y": 58, + "w": 41, + "h": 58 + } + }, + { + "filename": "0001.png", + "rotated": false, + "trimmed": true, + "sourceSize": { + "w": 46, + "h": 58 + }, + "spriteSourceSize": { + "x": 1, + "y": 1, + "w": 45, + "h": 57 + }, + "frame": { + "x": 84, + "y": 0, + "w": 45, + "h": 57 + } + }, + { + "filename": "0002.png", + "rotated": false, + "trimmed": true, + "sourceSize": { + "w": 46, + "h": 58 + }, + "spriteSourceSize": { + "x": 1, + "y": 1, + "w": 45, + "h": 57 + }, + "frame": { + "x": 84, + "y": 0, + "w": 45, + "h": 57 + } + }, + { + "filename": "0025.png", + "rotated": false, + "trimmed": true, + "sourceSize": { + "w": 46, + "h": 58 + }, + "spriteSourceSize": { + "x": 1, + "y": 1, + "w": 45, + "h": 57 + }, + "frame": { + "x": 84, + "y": 0, + "w": 45, + "h": 57 + } + }, + { + "filename": "0026.png", + "rotated": false, + "trimmed": true, + "sourceSize": { + "w": 46, + "h": 58 + }, + "spriteSourceSize": { + "x": 1, + "y": 1, + "w": 45, + "h": 57 + }, + "frame": { + "x": 84, + "y": 0, + "w": 45, + "h": 57 + } + }, + { + "filename": "0049.png", + "rotated": false, + "trimmed": true, + "sourceSize": { + "w": 46, + "h": 58 + }, + "spriteSourceSize": { + "x": 1, + "y": 1, + "w": 45, + "h": 57 + }, + "frame": { + "x": 84, + "y": 0, + "w": 45, + "h": 57 + } + }, + { + "filename": "0050.png", + "rotated": false, + "trimmed": true, + "sourceSize": { + "w": 46, + "h": 58 + }, + "spriteSourceSize": { + "x": 1, + "y": 1, + "w": 45, + "h": 57 + }, + "frame": { + "x": 84, + "y": 0, + "w": 45, + "h": 57 + } + }, + { + "filename": "0073.png", + "rotated": false, + "trimmed": true, + "sourceSize": { + "w": 46, + "h": 58 + }, + "spriteSourceSize": { + "x": 1, + "y": 1, + "w": 45, + "h": 57 + }, + "frame": { + "x": 84, + "y": 0, + "w": 45, + "h": 57 + } + }, + { + "filename": "0074.png", + "rotated": false, + "trimmed": true, + "sourceSize": { + "w": 46, + "h": 58 + }, + "spriteSourceSize": { + "x": 1, + "y": 1, + "w": 45, + "h": 57 + }, + "frame": { + "x": 84, + "y": 0, + "w": 45, + "h": 57 + } + }, + { + "filename": "0003.png", + "rotated": false, + "trimmed": true, + "sourceSize": { + "w": 46, + "h": 58 + }, + "spriteSourceSize": { + "x": 1, + "y": 1, + "w": 45, + "h": 57 + }, + "frame": { + "x": 129, + "y": 0, + "w": 45, + "h": 57 + } + }, + { + "filename": "0004.png", + "rotated": false, + "trimmed": true, + "sourceSize": { + "w": 46, + "h": 58 + }, + "spriteSourceSize": { + "x": 1, + "y": 1, + "w": 45, + "h": 57 + }, + "frame": { + "x": 129, + "y": 0, + "w": 45, + "h": 57 + } + }, + { + "filename": "0027.png", + "rotated": false, + "trimmed": true, + "sourceSize": { + "w": 46, + "h": 58 + }, + "spriteSourceSize": { + "x": 1, + "y": 1, + "w": 45, + "h": 57 + }, + "frame": { + "x": 129, + "y": 0, + "w": 45, + "h": 57 + } + }, + { + "filename": "0028.png", + "rotated": false, + "trimmed": true, + "sourceSize": { + "w": 46, + "h": 58 + }, + "spriteSourceSize": { + "x": 1, + "y": 1, + "w": 45, + "h": 57 + }, + "frame": { + "x": 129, + "y": 0, + "w": 45, + "h": 57 + } + }, + { + "filename": "0051.png", + "rotated": false, + "trimmed": true, + "sourceSize": { + "w": 46, + "h": 58 + }, + "spriteSourceSize": { + "x": 1, + "y": 1, + "w": 45, + "h": 57 + }, + "frame": { + "x": 129, + "y": 0, + "w": 45, + "h": 57 + } + }, + { + "filename": "0052.png", + "rotated": false, + "trimmed": true, + "sourceSize": { + "w": 46, + "h": 58 + }, + "spriteSourceSize": { + "x": 1, + "y": 1, + "w": 45, + "h": 57 + }, + "frame": { + "x": 129, + "y": 0, + "w": 45, + "h": 57 + } + }, + { + "filename": "0075.png", + "rotated": false, + "trimmed": true, + "sourceSize": { + "w": 46, + "h": 58 + }, + "spriteSourceSize": { + "x": 1, + "y": 1, + "w": 45, + "h": 57 + }, + "frame": { + "x": 129, + "y": 0, + "w": 45, + "h": 57 + } + }, + { + "filename": "0076.png", + "rotated": false, + "trimmed": true, + "sourceSize": { + "w": 46, + "h": 58 + }, + "spriteSourceSize": { + "x": 1, + "y": 1, + "w": 45, + "h": 57 + }, + "frame": { + "x": 129, + "y": 0, + "w": 45, + "h": 57 + } + }, + { + "filename": "0010.png", + "rotated": false, + "trimmed": true, + "sourceSize": { + "w": 46, + "h": 58 + }, + "spriteSourceSize": { + "x": 0, + "y": 0, + "w": 41, + "h": 58 + }, + "frame": { + "x": 174, + "y": 0, + "w": 41, + "h": 58 + } + }, + { + "filename": "0034.png", + "rotated": false, + "trimmed": true, + "sourceSize": { + "w": 46, + "h": 58 + }, + "spriteSourceSize": { + "x": 0, + "y": 0, + "w": 41, + "h": 58 + }, + "frame": { + "x": 174, + "y": 0, + "w": 41, + "h": 58 + } + }, + { + "filename": "0058.png", + "rotated": false, + "trimmed": true, + "sourceSize": { + "w": 46, + "h": 58 + }, + "spriteSourceSize": { + "x": 0, + "y": 0, + "w": 41, + "h": 58 + }, + "frame": { + "x": 174, + "y": 0, + "w": 41, + "h": 58 + } + }, + { + "filename": "0082.png", + "rotated": false, + "trimmed": true, + "sourceSize": { + "w": 46, + "h": 58 + }, + "spriteSourceSize": { + "x": 0, + "y": 0, + "w": 41, + "h": 58 + }, + "frame": { + "x": 174, + "y": 0, + "w": 41, + "h": 58 + } + }, + { + "filename": "0019.png", + "rotated": false, + "trimmed": true, + "sourceSize": { + "w": 46, + "h": 58 + }, + "spriteSourceSize": { + "x": 1, + "y": 1, + "w": 45, + "h": 57 + }, + "frame": { + "x": 84, + "y": 57, + "w": 45, + "h": 57 + } + }, + { + "filename": "0020.png", + "rotated": false, + "trimmed": true, + "sourceSize": { + "w": 46, + "h": 58 + }, + "spriteSourceSize": { + "x": 1, + "y": 1, + "w": 45, + "h": 57 + }, + "frame": { + "x": 84, + "y": 57, + "w": 45, + "h": 57 + } + }, + { + "filename": "0043.png", + "rotated": false, + "trimmed": true, + "sourceSize": { + "w": 46, + "h": 58 + }, + "spriteSourceSize": { + "x": 1, + "y": 1, + "w": 45, + "h": 57 + }, + "frame": { + "x": 84, + "y": 57, + "w": 45, + "h": 57 + } + }, + { + "filename": "0044.png", + "rotated": false, + "trimmed": true, + "sourceSize": { + "w": 46, + "h": 58 + }, + "spriteSourceSize": { + "x": 1, + "y": 1, + "w": 45, + "h": 57 + }, + "frame": { + "x": 84, + "y": 57, + "w": 45, + "h": 57 + } + }, + { + "filename": "0067.png", + "rotated": false, + "trimmed": true, + "sourceSize": { + "w": 46, + "h": 58 + }, + "spriteSourceSize": { + "x": 1, + "y": 1, + "w": 45, + "h": 57 + }, + "frame": { + "x": 84, + "y": 57, + "w": 45, + "h": 57 + } + }, + { + "filename": "0068.png", + "rotated": false, + "trimmed": true, + "sourceSize": { + "w": 46, + "h": 58 + }, + "spriteSourceSize": { + "x": 1, + "y": 1, + "w": 45, + "h": 57 + }, + "frame": { + "x": 84, + "y": 57, + "w": 45, + "h": 57 + } + }, + { + "filename": "0091.png", + "rotated": false, + "trimmed": true, + "sourceSize": { + "w": 46, + "h": 58 + }, + "spriteSourceSize": { + "x": 1, + "y": 1, + "w": 45, + "h": 57 + }, + "frame": { + "x": 84, + "y": 57, + "w": 45, + "h": 57 + } + }, + { + "filename": "0092.png", + "rotated": false, + "trimmed": true, + "sourceSize": { + "w": 46, + "h": 58 + }, + "spriteSourceSize": { + "x": 1, + "y": 1, + "w": 45, + "h": 57 + }, + "frame": { + "x": 84, + "y": 57, + "w": 45, + "h": 57 + } + }, + { + "filename": "0023.png", + "rotated": false, + "trimmed": true, + "sourceSize": { + "w": 46, + "h": 58 + }, + "spriteSourceSize": { + "x": 1, + "y": 1, + "w": 45, + "h": 57 + }, + "frame": { + "x": 129, + "y": 57, + "w": 45, + "h": 57 + } + }, + { + "filename": "0024.png", + "rotated": false, + "trimmed": true, + "sourceSize": { + "w": 46, + "h": 58 + }, + "spriteSourceSize": { + "x": 1, + "y": 1, + "w": 45, + "h": 57 + }, + "frame": { + "x": 129, + "y": 57, + "w": 45, + "h": 57 + } + }, + { + "filename": "0047.png", + "rotated": false, + "trimmed": true, + "sourceSize": { + "w": 46, + "h": 58 + }, + "spriteSourceSize": { + "x": 1, + "y": 1, + "w": 45, + "h": 57 + }, + "frame": { + "x": 129, + "y": 57, + "w": 45, + "h": 57 + } + }, + { + "filename": "0048.png", + "rotated": false, + "trimmed": true, + "sourceSize": { + "w": 46, + "h": 58 + }, + "spriteSourceSize": { + "x": 1, + "y": 1, + "w": 45, + "h": 57 + }, + "frame": { + "x": 129, + "y": 57, + "w": 45, + "h": 57 + } + }, + { + "filename": "0071.png", + "rotated": false, + "trimmed": true, + "sourceSize": { + "w": 46, + "h": 58 + }, + "spriteSourceSize": { + "x": 1, + "y": 1, + "w": 45, + "h": 57 + }, + "frame": { + "x": 129, + "y": 57, + "w": 45, + "h": 57 + } + }, + { + "filename": "0072.png", + "rotated": false, + "trimmed": true, + "sourceSize": { + "w": 46, + "h": 58 + }, + "spriteSourceSize": { + "x": 1, + "y": 1, + "w": 45, + "h": 57 + }, + "frame": { + "x": 129, + "y": 57, + "w": 45, + "h": 57 + } + }, + { + "filename": "0095.png", + "rotated": false, + "trimmed": true, + "sourceSize": { + "w": 46, + "h": 58 + }, + "spriteSourceSize": { + "x": 1, + "y": 1, + "w": 45, + "h": 57 + }, + "frame": { + "x": 129, + "y": 57, + "w": 45, + "h": 57 + } + }, + { + "filename": "0096.png", + "rotated": false, + "trimmed": true, + "sourceSize": { + "w": 46, + "h": 58 + }, + "spriteSourceSize": { + "x": 1, + "y": 1, + "w": 45, + "h": 57 + }, + "frame": { + "x": 129, + "y": 57, + "w": 45, + "h": 57 + } + }, + { + "filename": "0013.png", + "rotated": false, + "trimmed": true, + "sourceSize": { + "w": 46, + "h": 58 + }, + "spriteSourceSize": { + "x": 0, + "y": 0, + "w": 41, + "h": 58 + }, + "frame": { + "x": 174, + "y": 58, + "w": 41, + "h": 58 + } + }, + { + "filename": "0014.png", + "rotated": false, + "trimmed": true, + "sourceSize": { + "w": 46, + "h": 58 + }, + "spriteSourceSize": { + "x": 0, + "y": 0, + "w": 41, + "h": 58 + }, + "frame": { + "x": 174, + "y": 58, + "w": 41, + "h": 58 + } + }, + { + "filename": "0037.png", + "rotated": false, + "trimmed": true, + "sourceSize": { + "w": 46, + "h": 58 + }, + "spriteSourceSize": { + "x": 0, + "y": 0, + "w": 41, + "h": 58 + }, + "frame": { + "x": 174, + "y": 58, + "w": 41, + "h": 58 + } + }, + { + "filename": "0038.png", + "rotated": false, + "trimmed": true, + "sourceSize": { + "w": 46, + "h": 58 + }, + "spriteSourceSize": { + "x": 0, + "y": 0, + "w": 41, + "h": 58 + }, + "frame": { + "x": 174, + "y": 58, + "w": 41, + "h": 58 + } + }, + { + "filename": "0061.png", + "rotated": false, + "trimmed": true, + "sourceSize": { + "w": 46, + "h": 58 + }, + "spriteSourceSize": { + "x": 0, + "y": 0, + "w": 41, + "h": 58 + }, + "frame": { + "x": 174, + "y": 58, + "w": 41, + "h": 58 + } + }, + { + "filename": "0062.png", + "rotated": false, + "trimmed": true, + "sourceSize": { + "w": 46, + "h": 58 + }, + "spriteSourceSize": { + "x": 0, + "y": 0, + "w": 41, + "h": 58 + }, + "frame": { + "x": 174, + "y": 58, + "w": 41, + "h": 58 + } + }, + { + "filename": "0085.png", + "rotated": false, + "trimmed": true, + "sourceSize": { + "w": 46, + "h": 58 + }, + "spriteSourceSize": { + "x": 0, + "y": 0, + "w": 41, + "h": 58 + }, + "frame": { + "x": 174, + "y": 58, + "w": 41, + "h": 58 + } + }, + { + "filename": "0086.png", + "rotated": false, + "trimmed": true, + "sourceSize": { + "w": 46, + "h": 58 + }, + "spriteSourceSize": { + "x": 0, + "y": 0, + "w": 41, + "h": 58 + }, + "frame": { + "x": 174, + "y": 58, + "w": 41, + "h": 58 + } + }, + { + "filename": "0011.png", + "rotated": false, + "trimmed": true, + "sourceSize": { + "w": 46, + "h": 58 + }, + "spriteSourceSize": { + "x": 0, + "y": 0, + "w": 40, + "h": 58 + }, + "frame": { + "x": 84, + "y": 116, + "w": 40, + "h": 58 + } + }, + { + "filename": "0012.png", + "rotated": false, + "trimmed": true, + "sourceSize": { + "w": 46, + "h": 58 + }, + "spriteSourceSize": { + "x": 0, + "y": 0, + "w": 40, + "h": 58 + }, + "frame": { + "x": 84, + "y": 116, + "w": 40, + "h": 58 + } + }, + { + "filename": "0035.png", + "rotated": false, + "trimmed": true, + "sourceSize": { + "w": 46, + "h": 58 + }, + "spriteSourceSize": { + "x": 0, + "y": 0, + "w": 40, + "h": 58 + }, + "frame": { + "x": 84, + "y": 116, + "w": 40, + "h": 58 + } + }, + { + "filename": "0036.png", + "rotated": false, + "trimmed": true, + "sourceSize": { + "w": 46, + "h": 58 + }, + "spriteSourceSize": { + "x": 0, + "y": 0, + "w": 40, + "h": 58 + }, + "frame": { + "x": 84, + "y": 116, + "w": 40, + "h": 58 + } + }, + { + "filename": "0059.png", + "rotated": false, + "trimmed": true, + "sourceSize": { + "w": 46, + "h": 58 + }, + "spriteSourceSize": { + "x": 0, + "y": 0, + "w": 40, + "h": 58 + }, + "frame": { + "x": 84, + "y": 116, + "w": 40, + "h": 58 + } + }, + { + "filename": "0060.png", + "rotated": false, + "trimmed": true, + "sourceSize": { + "w": 46, + "h": 58 + }, + "spriteSourceSize": { + "x": 0, + "y": 0, + "w": 40, + "h": 58 + }, + "frame": { + "x": 84, + "y": 116, + "w": 40, + "h": 58 + } + }, + { + "filename": "0083.png", + "rotated": false, + "trimmed": true, + "sourceSize": { + "w": 46, + "h": 58 + }, + "spriteSourceSize": { + "x": 0, + "y": 0, + "w": 40, + "h": 58 + }, + "frame": { + "x": 84, + "y": 116, + "w": 40, + "h": 58 + } + }, + { + "filename": "0084.png", + "rotated": false, + "trimmed": true, + "sourceSize": { + "w": 46, + "h": 58 + }, + "spriteSourceSize": { + "x": 0, + "y": 0, + "w": 40, + "h": 58 + }, + "frame": { + "x": 84, + "y": 116, + "w": 40, + "h": 58 + } + }, + { + "filename": "0021.png", + "rotated": false, + "trimmed": true, + "sourceSize": { + "w": 46, + "h": 58 + }, + "spriteSourceSize": { + "x": 1, + "y": 2, + "w": 45, + "h": 56 + }, + "frame": { + "x": 124, + "y": 114, + "w": 45, + "h": 56 + } + }, + { + "filename": "0045.png", + "rotated": false, + "trimmed": true, + "sourceSize": { + "w": 46, + "h": 58 + }, + "spriteSourceSize": { + "x": 1, + "y": 2, + "w": 45, + "h": 56 + }, + "frame": { + "x": 124, + "y": 114, + "w": 45, + "h": 56 + } + }, + { + "filename": "0069.png", + "rotated": false, + "trimmed": true, + "sourceSize": { + "w": 46, + "h": 58 + }, + "spriteSourceSize": { + "x": 1, + "y": 2, + "w": 45, + "h": 56 + }, + "frame": { + "x": 124, + "y": 114, + "w": 45, + "h": 56 + } + }, + { + "filename": "0093.png", + "rotated": false, + "trimmed": true, + "sourceSize": { + "w": 46, + "h": 58 + }, + "spriteSourceSize": { + "x": 1, + "y": 2, + "w": 45, + "h": 56 + }, + "frame": { + "x": 124, + "y": 114, + "w": 45, + "h": 56 + } + }, + { + "filename": "0022.png", + "rotated": false, + "trimmed": true, + "sourceSize": { + "w": 46, + "h": 58 + }, + "spriteSourceSize": { + "x": 1, + "y": 2, + "w": 45, + "h": 56 + }, + "frame": { + "x": 169, + "y": 116, + "w": 45, + "h": 56 + } + }, + { + "filename": "0046.png", + "rotated": false, + "trimmed": true, + "sourceSize": { + "w": 46, + "h": 58 + }, + "spriteSourceSize": { + "x": 1, + "y": 2, + "w": 45, + "h": 56 + }, + "frame": { + "x": 169, + "y": 116, + "w": 45, + "h": 56 + } + }, + { + "filename": "0070.png", + "rotated": false, + "trimmed": true, + "sourceSize": { + "w": 46, + "h": 58 + }, + "spriteSourceSize": { + "x": 1, + "y": 2, + "w": 45, + "h": 56 + }, + "frame": { + "x": 169, + "y": 116, + "w": 45, + "h": 56 + } + }, + { + "filename": "0094.png", + "rotated": false, + "trimmed": true, + "sourceSize": { + "w": 46, + "h": 58 + }, + "spriteSourceSize": { + "x": 1, + "y": 2, + "w": 45, + "h": 56 + }, + "frame": { + "x": 169, + "y": 116, + "w": 45, + "h": 56 + } + } + ] + } + ], + "meta": { + "app": "https://www.codeandweb.com/texturepacker", + "version": "3.0", + "smartupdate": "$TexturePacker:SmartUpdate:285116ddfd9237149c09114492d6f39a:3d4d742a88fca26b8d4440b7df2ce007:c4226591ee12ad13f709803479251047$" + } +} diff --git a/public/images/trainer/nuzleaf.png b/public/images/trainer/nuzleaf.png new file mode 100644 index 0000000000000000000000000000000000000000..fcaca7b091dca6e6a13fac79503953ef70bae2e0 GIT binary patch literal 4043 zcma)9`9IX_`<@Mh!B~blc8N&VLMV-W%aSY^%7iRutl6?=5L08RaBK;M?2#E;WGA~U zgRwM*RI(;Zgzq@#^9Ou?c%J+Hy6@|{pX<7x=a=_m3o`>Y7Je200KjHssB1}&lcx&` zrtcqKUy7#(1&ixedh`ef0Mz}}EsfRDFN~c@&SCz}3FNR;e`gZuMKc=PTo^kvv_Wou zvA5B6a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U)0pSim;B z!aB-=c}aXnnjAGn1a=Cc&f_BKBW(b+X|&dZbtN_{w#RAwbm@CGQN^*z_Fpv!CjVVj z0hcB=$46eSO(QQ%hHBORy{DM`J7`1mU!s|W!_Rg)IB`37b;Dwe%c}i1)7I|#oy9+g zhZ^G~pPS6OK0E2VCR8Gi9xzFMEgj`yhyTwH4CEfT@+fzTg(kdL-*a`{ kFF9;>@&EDpAnXsH2I~Qj`w_=i`X4sHNY6~SQX3Qfe*odKUH||9 literal 0 HcmV?d00001 diff --git a/src/battle-scene.ts b/src/battle-scene.ts index 3971ca66be1..0262c9627c9 100644 --- a/src/battle-scene.ts +++ b/src/battle-scene.ts @@ -626,6 +626,7 @@ export default class BattleScene extends SceneBase { } if (postProcess) postProcess(pokemon); + pokemon.calculateStats(); pokemon.init(); return pokemon; } @@ -805,7 +806,7 @@ export default class BattleScene extends SceneBase { const playerField = this.getPlayerField(); - if (this.gameMode.hasFixedBattles && fixedBattles.hasOwnProperty(newWaveIndex) && trainerData === undefined) { + if (this.gameMode.hasFixedBattles && fixedBattles.hasOwnProperty(newWaveIndex) && fixedBattles[newWaveIndex].condition(this) && trainerData === undefined) { battleConfig = fixedBattles[newWaveIndex]; newDouble = battleConfig.double; newBattleType = battleConfig.battleType; @@ -816,14 +817,14 @@ export default class BattleScene extends SceneBase { if (!this.gameMode.hasTrainers) newBattleType = BattleType.WILD; else if (battleType === undefined) - newBattleType = this.gameMode.isWaveTrainer(newWaveIndex, this.arena) ? BattleType.TRAINER : BattleType.WILD; + newBattleType = this.gameMode.isWaveTrainer(newWaveIndex, this) ? BattleType.TRAINER : BattleType.WILD; else newBattleType = battleType; if (newBattleType === BattleType.TRAINER) { const trainerType = this.arena.randomTrainerType(newWaveIndex); let doubleTrainer = false; - if (trainerConfigs[trainerType].doubleOnly) + if (trainerConfigs[trainerType].doubleOnly && trainerConfigs[trainerType].hasGenders) doubleTrainer = true; else if (trainerConfigs[trainerType].hasDouble) { const doubleChance = new Utils.IntegerHolder(newWaveIndex % 10 === 0 ? 32 : 8); @@ -884,7 +885,7 @@ export default class BattleScene extends SceneBase { isNewBiome = !Utils.randSeedInt(6 - biomeWaves); }, lastBattle.waveIndex << 4); } - const resetArenaState = (isNewBiome || this.currentBattle.battleType === BattleType.TRAINER || this.currentBattle.battleSpec === BattleSpec.FINAL_BOSS) && !this.gameMode.hasNoReturns; + const resetArenaState = (isNewBiome || this.currentBattle.battleType === BattleType.TRAINER || [ BattleSpec.FINAL_BOSS, BattleSpec.NUZLOCKE_BOSS ].includes(this.currentBattle.battleSpec)) && !this.gameMode.hasNoReturns; this.getEnemyParty().forEach(enemyPokemon => enemyPokemon.destroy()); this.trySpreadPokerus(); if (!isNewBiome && (newWaveIndex % 10) == 5) diff --git a/src/battle.ts b/src/battle.ts index 580bad9a508..e52139d53d2 100644 --- a/src/battle.ts +++ b/src/battle.ts @@ -92,7 +92,7 @@ export default class Battle { let spec = BattleSpec.DEFAULT; if (this.gameMode.isClassic) { if (this.waveIndex === 200) - spec = BattleSpec.FINAL_BOSS; + spec = !this.gameMode.isNuzlocke ? BattleSpec.FINAL_BOSS : BattleSpec.NUZLOCKE_BOSS; } this.battleSpec = spec; } @@ -186,7 +186,7 @@ export default class Battle { if (!this.started && this.trainer.config.encounterBgm && this.trainer.getEncounterMessages()?.length) return `encounter_${this.trainer.getEncounterBgm()}`; return this.trainer.getBattleBgm(); - } else if (this.gameMode.isClassic && this.waveIndex > 195 && this.battleSpec !== BattleSpec.FINAL_BOSS) + } else if (this.gameMode.isClassic && this.waveIndex > 195 && ![ BattleSpec.FINAL_BOSS, BattleSpec.NUZLOCKE_BOSS ].includes(this.battleSpec)) return 'end_summit'; for (let pokemon of battlers) { if (this.battleSpec === BattleSpec.FINAL_BOSS) { @@ -256,6 +256,7 @@ export class FixedBattleConfig { public getTrainer: GetTrainerFunc; public getEnemyParty: GetEnemyPartyFunc; public seedOffsetWaveIndex: integer; + public condition: (scene: BattleScene) => boolean; setBattleType(battleType: BattleType): FixedBattleConfig { this.battleType = battleType; @@ -281,6 +282,11 @@ export class FixedBattleConfig { this.seedOffsetWaveIndex = seedOffsetWaveIndex; return this; } + + setCondition(condition: (scene: BattleScene) => boolean): FixedBattleConfig { + this.condition = condition; + return this; + } } function getRandomTrainerFunc(trainerPool: (TrainerType | TrainerType[])[]): GetTrainerFunc { @@ -325,5 +331,8 @@ export const fixedBattles: FixedBattleConfigs = { [190]: new FixedBattleConfig().setBattleType(BattleType.TRAINER).setSeedOffsetWave(182) .setGetTrainerFunc(getRandomTrainerFunc([ TrainerType.BLUE, [ TrainerType.RED, TrainerType.LANCE_CHAMPION ], [ TrainerType.STEVEN, TrainerType.WALLACE ], TrainerType.CYNTHIA, [ TrainerType.ALDER, TrainerType.IRIS ], TrainerType.DIANTHA, TrainerType.HAU, [ TrainerType.GEETA, TrainerType.NEMONA ], TrainerType.KIERAN, TrainerType.LEON ])), [195]: new FixedBattleConfig().setBattleType(BattleType.TRAINER) - .setGetTrainerFunc(scene => new Trainer(scene, TrainerType.RIVAL_6, scene.gameData.gender === PlayerGender.MALE ? TrainerVariant.FEMALE : TrainerVariant.DEFAULT)) + .setGetTrainerFunc(scene => new Trainer(scene, TrainerType.RIVAL_6, scene.gameData.gender === PlayerGender.MALE ? TrainerVariant.FEMALE : TrainerVariant.DEFAULT)), + [200]: new FixedBattleConfig().setBattleType(BattleType.TRAINER) + .setGetTrainerFunc(scene => new Trainer(scene, TrainerType.NUZLEAF, TrainerVariant.DEFAULT)) + .setCondition(scene => scene.gameMode.isNuzlocke) }; \ No newline at end of file diff --git a/src/data/dialogue.ts b/src/data/dialogue.ts index 8fd9fc12560..bd8fa170c27 100644 --- a/src/data/dialogue.ts +++ b/src/data/dialogue.ts @@ -2269,7 +2269,12 @@ export const trainerTypeDialogue = { $@c{smile_ehalf}…Thank you.` ] } - ] + ], + [TrainerType.NUZLEAF]: { + encounter: [ + `You've done well to make it this far.\nI am Nuzleaf, and this is your final test.` + ] + } }; export const battleSpecDialogue = { @@ -2299,15 +2304,15 @@ export function initTrainerTypeDialogue(): void { const trainerTypes = Object.keys(trainerTypeDialogue).map(t => parseInt(t) as TrainerType); for (let trainerType of trainerTypes) { const messages = trainerTypeDialogue[trainerType]; - const messageTypes = [ 'encounter', 'victory', 'defeat' ]; - for (let messageType of messageTypes) { - if (Array.isArray(messages)) { - if (messages[0][messageType]) - trainerConfigs[trainerType][`${messageType}Messages`] = messages[0][messageType]; - if (messages.length > 1) - trainerConfigs[trainerType][`female${messageType.slice(0, 1).toUpperCase()}${messageType.slice(1)}Messages`] = messages[1][messageType]; - } else - trainerConfigs[trainerType][`${messageType}Messages`] = messages[messageType]; - } + const messageTypes = [ 'encounter', 'victory', 'defeat' ]; + for (let messageType of messageTypes) { + if (Array.isArray(messages)) { + if (messages[0][messageType]) + trainerConfigs[trainerType][`${messageType}Messages`] = messages[0][messageType]; + if (messages.length > 1) + trainerConfigs[trainerType][`female${messageType.slice(0, 1).toUpperCase()}${messageType.slice(1)}Messages`] = messages[1][messageType]; + } else + trainerConfigs[trainerType][`${messageType}Messages`] = messages[messageType]; + } } } \ No newline at end of file diff --git a/src/data/enums/trainer-type.ts b/src/data/enums/trainer-type.ts index c30b098960c..2a7d89228f8 100644 --- a/src/data/enums/trainer-type.ts +++ b/src/data/enums/trainer-type.ts @@ -180,5 +180,6 @@ export enum TrainerType { RIVAL_3, RIVAL_4, RIVAL_5, - RIVAL_6 + RIVAL_6, + NUZLEAF = 400 } diff --git a/src/data/trainer-config.ts b/src/data/trainer-config.ts index 36d76edcfab..ac90a147e9f 100644 --- a/src/data/trainer-config.ts +++ b/src/data/trainer-config.ts @@ -6,7 +6,7 @@ import { TrainerType } from "./enums/trainer-type"; import { Moves } from "./enums/moves"; import { PokeballType } from "./pokeball"; import { pokemonEvolutions, pokemonPrevolutions } from "./pokemon-evolutions"; -import PokemonSpecies, { PokemonSpeciesFilter, getPokemonSpecies } from "./pokemon-species"; +import PokemonSpecies, { PokemonSpeciesFilter, SpeciesFormKey, getPokemonSpecies } from "./pokemon-species"; import { Species } from "./enums/species"; import { tmSpecies } from "./tms"; import { Type } from "./type"; @@ -155,7 +155,9 @@ export const trainerPartyTemplates = { RIVAL_3: new TrainerPartyCompoundTemplate(new TrainerPartyTemplate(1, PartyMemberStrength.STRONG), new TrainerPartyTemplate(1, PartyMemberStrength.AVERAGE), new TrainerPartyTemplate(1, PartyMemberStrength.AVERAGE, false, true), new TrainerPartyTemplate(1, PartyMemberStrength.WEAK, false, true)), RIVAL_4: new TrainerPartyCompoundTemplate(new TrainerPartyTemplate(1, PartyMemberStrength.STRONG), new TrainerPartyTemplate(1, PartyMemberStrength.AVERAGE), new TrainerPartyTemplate(2, PartyMemberStrength.AVERAGE, false, true), new TrainerPartyTemplate(1, PartyMemberStrength.WEAK, false, true)), RIVAL_5: new TrainerPartyCompoundTemplate(new TrainerPartyTemplate(1, PartyMemberStrength.STRONG), new TrainerPartyTemplate(1, PartyMemberStrength.AVERAGE), new TrainerPartyTemplate(3, PartyMemberStrength.AVERAGE, false, true), new TrainerPartyTemplate(1, PartyMemberStrength.STRONG)), - RIVAL_6: new TrainerPartyCompoundTemplate(new TrainerPartyTemplate(1, PartyMemberStrength.STRONG), new TrainerPartyTemplate(1, PartyMemberStrength.AVERAGE), new TrainerPartyTemplate(3, PartyMemberStrength.AVERAGE, false, true), new TrainerPartyTemplate(1, PartyMemberStrength.STRONGER)) + RIVAL_6: new TrainerPartyCompoundTemplate(new TrainerPartyTemplate(1, PartyMemberStrength.STRONG), new TrainerPartyTemplate(1, PartyMemberStrength.AVERAGE), new TrainerPartyTemplate(3, PartyMemberStrength.AVERAGE, false, true), new TrainerPartyTemplate(1, PartyMemberStrength.STRONGER)), + + NUZLEAF: new TrainerPartyTemplate(1, PartyMemberStrength.STRONG, false, true)//new TrainerPartyTemplate(5, PartyMemberStrength.STRONG, false, true), }; type PartyTemplateFunc = (scene: BattleScene) => TrainerPartyTemplate; @@ -867,11 +869,45 @@ export const trainerConfigs: TrainerConfigs = { p.shiny = true; p.variant = 1; p.formIndex = 1; + p.generateName(); })) .setGenModifiersFunc(party => { const starter = party[0]; return [ modifierTypes.TERA_SHARD().generateType(null, [ starter.species.type1 ]).withIdFromFunc(modifierTypes.TERA_SHARD).newModifier(starter) as PersistentModifier ]; }), + [TrainerType.NUZLEAF]: new TrainerConfig((t = TrainerType.NUZLEAF)).setName('Nuzleaf').setBoss().setEncounterBgm('final').setBattleBgm('battle_final').setPartyTemplates(trainerPartyTemplates.NUZLEAF) + .setPartyMemberFunc(0, getSpeciesFilterRandomPartyMemberFunc((species: PokemonSpecies) => species.baseTotal >= 540, TrainerSlot.TRAINER, false, + (p => { + p.level = 200; + p.setBoss(true, 1); + }))) + .setPartyMemberFunc(1, getSpeciesFilterRandomPartyMemberFunc((species: PokemonSpecies) => species.baseTotal >= 540, TrainerSlot.TRAINER, false, + (p => { + p.level = 200; + p.setBoss(true, 1); + }))) + .setPartyMemberFunc(2, getSpeciesFilterRandomPartyMemberFunc((species: PokemonSpecies) => !pokemonEvolutions.hasOwnProperty(species.speciesId) && species.forms.some(f => f.formKey.includes(SpeciesFormKey.MEGA)), TrainerSlot.TRAINER, false, + (p => { + p.level = 200; + p.formIndex = p.species.forms.findIndex(f => f.formKey.includes(SpeciesFormKey.MEGA)); + p.setBoss(true, 2); + p.generateName(); + }) + )) + .setPartyMemberFunc(3, getSpeciesFilterRandomPartyMemberFunc((species: PokemonSpecies) => !pokemonEvolutions.hasOwnProperty(species.speciesId) && species.forms.some(f => f.formKey.includes(SpeciesFormKey.GIGANTAMAX)), TrainerSlot.TRAINER, false, + (p => { + p.level = 200; + p.formIndex = p.species.forms.findIndex(f => f.formKey.includes(SpeciesFormKey.GIGANTAMAX)); + p.setBoss(true, 2); + p.generateName(); + }) + )) + .setPartyMemberFunc(4, getSpeciesFilterRandomPartyMemberFunc((species: PokemonSpecies) => species.baseTotal >= 540, TrainerSlot.TRAINER, false, + (p => { + p.level = 200; + p.setBoss(true, 1); + }))) + .setSpeciesFilter(species => species.baseTotal >= 540) }; (function() { diff --git a/src/enums/battle-spec.ts b/src/enums/battle-spec.ts index 00bc7f92fea..0068e66b83f 100644 --- a/src/enums/battle-spec.ts +++ b/src/enums/battle-spec.ts @@ -1,4 +1,5 @@ export enum BattleSpec { DEFAULT, - FINAL_BOSS + FINAL_BOSS, + NUZLOCKE_BOSS } diff --git a/src/field/pokemon.ts b/src/field/pokemon.ts index 70ad0b33d75..7a31a5fdb5d 100644 --- a/src/field/pokemon.ts +++ b/src/field/pokemon.ts @@ -1795,6 +1795,7 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container { transitionIndex = i; + i = 0; rate = 0.85; let frameProgress = 0; @@ -1810,6 +1811,7 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container { delay: Utils.fixedInt(delay), repeat: -1, callback: () => { + ++i; frameThreshold = sprite.anims.msPerFrame / rate; frameProgress += delay; while (frameProgress > frameThreshold) { @@ -2658,7 +2660,7 @@ export class EnemyPokemon extends Pokemon { this.trainerSlot = trainerSlot; if (boss) - this.setBoss(); + this.setBoss(true, dataSource?.bossSegments); if (!dataSource) { this.generateAndPopulateMoveset(); diff --git a/src/field/trainer.ts b/src/field/trainer.ts index d52085b65a0..a73c7147a87 100644 --- a/src/field/trainer.ts +++ b/src/field/trainer.ts @@ -184,9 +184,11 @@ export default class Trainer extends Phaser.GameObjects.Container { return ret; } - genPartyMember(index: integer): EnemyPokemon { + genPartyMember(index: integer, retryCount: integer = 0): EnemyPokemon { const battle = this.scene.currentBattle; const level = battle.enemyLevels[index]; + + let retry = false; let ret: EnemyPokemon; @@ -196,10 +198,20 @@ export default class Trainer extends Phaser.GameObjects.Container { if (this.config.partyMemberFuncs.hasOwnProperty(index)) { ret = this.config.partyMemberFuncs[index](this.scene, level, strength); + if (template.isBalanced(index)) { + const partyMemberTypes = battle.enemyParty.map(p => p.getTypes(true)).flat(); + if (partyMemberTypes.indexOf(ret.species.type1) > -1 || (ret.species.type2 !== null && partyMemberTypes.indexOf(ret.species.type2) > -1)) + retry = true; + } return; } if (this.config.partyMemberFuncs.hasOwnProperty(index - template.size)) { - ret = this.config.partyMemberFuncs[index - template.size](this.scene, level, template.getStrength(index)); + ret = this.config.partyMemberFuncs[index - template.size](this.scene, level, strength); + if (template.isBalanced(index - template.size)) { + const partyMemberTypes = battle.enemyParty.map(p => p.getTypes(true)).flat(); + if (partyMemberTypes.indexOf(ret.species.type1) > -1 || (ret.species.type2 !== null && partyMemberTypes.indexOf(ret.species.type2) > -1)) + retry = true; + } return; } @@ -218,7 +230,10 @@ export default class Trainer extends Phaser.GameObjects.Container { : this.genNewPartyMemberSpecies(level, strength); ret = this.scene.addEnemyPokemon(species, level, !this.isDouble() || !(index % 2) ? TrainerSlot.TRAINER : TrainerSlot.TRAINER_PARTNER); - }, this.config.hasStaticParty ? this.config.getDerivedType() + ((index + 1) << 8) : this.scene.currentBattle.waveIndex + (this.config.getDerivedType() << 10) + (((!this.config.useSameSeedForAllMembers ? index : 0) + 1) << 8)); + }, this.config.hasStaticParty ? this.config.getDerivedType() + ((index + 1 + retryCount * 6) << 8) : this.scene.currentBattle.waveIndex + (this.config.getDerivedType() << 10) + (((!this.config.useSameSeedForAllMembers ? index : 0) + 1 + retryCount * 6) << 8)); + + if (retry && ++retryCount < 10) + return this.genPartyMember(index, retryCount); return ret; } @@ -311,7 +326,7 @@ export default class Trainer extends Phaser.GameObjects.Container { } getNextSummonIndex(trainerSlot: TrainerSlot = TrainerSlot.NONE, partyMemberScores: [integer, integer][] = this.getPartyMemberMatchupScores(trainerSlot)): integer { - if (trainerSlot && !this.isDouble()) + if (trainerSlot && !this.isDouble() || !this.config.hasGenders) trainerSlot = TrainerSlot.NONE; const sortedPartyMemberScores = this.getSortedPartyMemberMatchupScores(partyMemberScores); diff --git a/src/game-mode.ts b/src/game-mode.ts index 253c8c22647..69d968e2b75 100644 --- a/src/game-mode.ts +++ b/src/game-mode.ts @@ -90,9 +90,10 @@ export class GameMode implements GameModeConfig { } } - isWaveTrainer(waveIndex: integer, arena: Arena): boolean { + isWaveTrainer(waveIndex: integer, scene: BattleScene): boolean { if (this.isDaily) return waveIndex % 10 === 5 || (!(waveIndex % 10) && waveIndex > 10 && !this.isWaveFinal(waveIndex)); + const arena = scene.arena; if ((waveIndex % 30) === (arena.scene.offsetGym ? 0 : 20) && !this.isWaveFinal(waveIndex)) return true; else if (waveIndex % 10 !== 1 && waveIndex % 10) { @@ -103,7 +104,7 @@ export class GameMode implements GameModeConfig { for (let w = Math.max(waveIndex - 3, waveBase + 2); w <= Math.min(waveIndex + 3, waveBase + 9); w++) { if (w === waveIndex) continue; - if ((w % 30) === (arena.scene.offsetGym ? 0 : 20) || fixedBattles.hasOwnProperty(w)) { + if ((w % 30) === (arena.scene.offsetGym ? 0 : 20) || (fixedBattles.hasOwnProperty(w) && fixedBattles[w].condition(scene))) { allowTrainerBattle = false; break; } else if (w < waveIndex) { diff --git a/src/loading-scene.ts b/src/loading-scene.ts index 065bcfd96d1..b8e0bdc2f3f 100644 --- a/src/loading-scene.ts +++ b/src/loading-scene.ts @@ -160,7 +160,7 @@ export class LoadingScene extends SceneBase { Utils.getEnumValues(TrainerType).map(tt => { const config = trainerConfigs[tt]; this.loadAtlas(config.getSpriteKey(), 'trainer'); - if (config.doubleOnly || config.hasDouble) + if ((config.doubleOnly || config.hasDouble) && config.hasGenders) this.loadAtlas(config.getSpriteKey(true), 'trainer'); }); diff --git a/src/messages.ts b/src/messages.ts index ffd9aa6efea..75dd56fa2b5 100644 --- a/src/messages.ts +++ b/src/messages.ts @@ -9,6 +9,7 @@ export function getPokemonPrefix(pokemon: Pokemon): string { let prefix: string; switch (pokemon.scene.currentBattle.battleSpec) { case BattleSpec.DEFAULT: + case BattleSpec.NUZLOCKE_BOSS: prefix = !pokemon.isPlayer() ? pokemon.hasTrainer() ? 'Foe ' : 'Wild ' : ''; break; case BattleSpec.FINAL_BOSS: diff --git a/src/phases.ts b/src/phases.ts index 8de21a0dc14..23d5e90cc91 100644 --- a/src/phases.ts +++ b/src/phases.ts @@ -740,11 +740,13 @@ export class EncounterPhase extends BattlePhase { if (this.scene.gameMode.isClassic && (battle.battleSpec === BattleSpec.FINAL_BOSS || this.scene.gameMode.isWaveFinal(battle.waveIndex))) { if (battle.battleSpec !== BattleSpec.FINAL_BOSS) { enemyPokemon.formIndex = 1; + enemyPokemon.calculateStats(); enemyPokemon.updateScale(); } enemyPokemon.setBoss(); } else if (!(battle.waveIndex % 1000)) { enemyPokemon.formIndex = 1; + enemyPokemon.calculateStats(); enemyPokemon.updateScale(); } } @@ -3346,8 +3348,13 @@ export class VictoryPhase extends PokemonPhase { if (!this.scene.getEnemyParty().find(p => this.scene.currentBattle.battleType ? !p?.isFainted(true) : p.isOnField())) { this.scene.pushPhase(new BattleEndPhase(this.scene)); - if (this.scene.currentBattle.battleType === BattleType.TRAINER) + if (this.scene.currentBattle.battleType === BattleType.TRAINER) { + if (this.scene.currentBattle.battleSpec === BattleSpec.NUZLOCKE_BOSS) { + this.scene.pushPhase(new NuzlockeBossSwitchPhase(this.scene)); + return this.end(); + } this.scene.pushPhase(new TrainerVictoryPhase(this.scene)); + } if (this.scene.gameMode.isEndless || !this.scene.gameMode.isWaveFinal(this.scene.currentBattle.waveIndex)) { this.scene.pushPhase(new EggLapsePhase(this.scene)); if (this.scene.currentBattle.waveIndex % 10) @@ -4599,6 +4606,65 @@ export class ScanIvsPhase extends PokemonPhase { } } +export class NuzlockeBossSwitchPhase extends BattlePhase { + start(): void { + super.start(); + + this.scene.currentBattle.addBattleScore(this.scene); + + this.scene.gameData.gameStats.trainersDefeated++; + + this.scene.clearEnemyHeldItemModifiers(); + + const pokemon = this.scene.addEnemyPokemon(getPokemonSpecies(Species.NUZLEAF), 300, TrainerSlot.NONE, true); + pokemon.setAlpha(0); + pokemon.x += 16; + pokemon.y -= 16; + pokemon.setBoss(true, 5); + + this.scene.currentBattle.battleType = BattleType.WILD; + this.scene.currentBattle.enemyParty = [ pokemon ]; + + pokemon.loadAssets().then(() => { + this.scene.add.existing(pokemon); + this.scene.field.add(pokemon); + + this.scene.gameData.setPokemonSeen(pokemon, true, false); + + const playerPokemon = this.scene.getPlayerPokemon() as Pokemon; + if (playerPokemon?.visible) + this.scene.field.moveBelow(pokemon, playerPokemon); + this.scene.currentBattle.seenEnemyPartyMemberIds.add(pokemon.id); + + pokemon.initBattleInfo(); + + regenerateModifierPoolThresholds(this.scene.getEnemyField(), ModifierPoolType.WILD); + this.scene.generateEnemyModifiers(); + + this.scene.updateModifiers(false); + this.scene.updateFieldScale(); + pokemon.showInfo(); + pokemon.playAnim(); + pokemon.setVisible(true); + pokemon.getSprite().setVisible(true); + this.scene.updateFieldScale(); + this.scene.tweens.add({ + targets: pokemon, + duration: 250, + ease: 'Sine.easeIn', + alpha: 1, + x: '-=16', + y: '+=16', + onComplete: () => { + pokemon.cry(); + pokemon.resetSummonData(); + this.scene.time.delayedCall(1000, () => this.end()); + } + }); + }); + } +} + export class TrainerMessageTestPhase extends BattlePhase { private trainerTypes: TrainerType[]; diff --git a/src/system/pokemon-data.ts b/src/system/pokemon-data.ts index b9589020e9b..91a7dc2cdea 100644 --- a/src/system/pokemon-data.ts +++ b/src/system/pokemon-data.ts @@ -49,6 +49,7 @@ export default class PokemonData { public fusionLuck: integer; public boss: boolean; + public bossSegments: integer; public summonData: PokemonSummonData; @@ -90,8 +91,10 @@ export default class PokemonData { this.fusionGender = source.fusionGender; this.fusionLuck = source.fusionLuck !== undefined ? source.fusionLuck : (source.fusionShiny ? source.fusionVariant + 1 : 0); - if (!forHistory) - this.boss = (source instanceof EnemyPokemon && !!source.bossSegments) || (!this.player && !!source.boss); + if (!forHistory) { + this.bossSegments = !this.player ? source?.bossSegments || 0 : 0; + this.boss = !!this.bossSegments || !!source?.boss; + } if (sourcePokemon) { this.moveset = sourcePokemon.moveset;