From a9a73863e89caf979f28c4e97be61ff160a0116a Mon Sep 17 00:00:00 2001 From: Frederico Santos Date: Sat, 26 Oct 2024 22:43:15 +0100 Subject: [PATCH 1/7] Comment out startGame call on manifest fetch failure --- src/main.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main.ts b/src/main.ts index 8a69d3f1b72..d9472fce50c 100644 --- a/src/main.ts +++ b/src/main.ts @@ -103,7 +103,7 @@ fetch("/manifest.json") game["manifest"] = jsonResponse.manifest; }).catch(() => { // Manifest not found (likely local build) - startGame(); + // startGame(); }); export default game; From 9a56f080db2405010240ff0273328973ec3c78b5 Mon Sep 17 00:00:00 2001 From: innerthunder <168692175+innerthunder@users.noreply.github.com> Date: Sat, 26 Oct 2024 19:34:48 -0700 Subject: [PATCH 2/7] [Hotfix] Fix status damage triggering before berry usage (#4732) * Fix status damage triggering before berry usage * Bump version number * Revert "Bump version number" This reverts commit 64b194f5a7c7507b4253c96ed5b9cc028bc80ab6. * Bump version number for real this time --- package-lock.json | 4 ++-- package.json | 2 +- src/phases/turn-start-phase.ts | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/package-lock.json b/package-lock.json index be946306471..bbe52272f92 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "pokemon-rogue-battle", - "version": "1.1.0", + "version": "1.1.1", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "pokemon-rogue-battle", - "version": "1.1.0", + "version": "1.1.1", "hasInstallScript": true, "dependencies": { "@material/material-color-utilities": "^0.2.7", diff --git a/package.json b/package.json index a31296d1644..4666ffb7587 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "pokemon-rogue-battle", "private": true, - "version": "1.1.0", + "version": "1.1.1", "type": "module", "scripts": { "start": "vite", diff --git a/src/phases/turn-start-phase.ts b/src/phases/turn-start-phase.ts index 497d449912f..dc3ee3f660a 100644 --- a/src/phases/turn-start-phase.ts +++ b/src/phases/turn-start-phase.ts @@ -205,11 +205,11 @@ export class TurnStartPhase extends FieldPhase { } this.scene.pushPhase(new WeatherEffectPhase(this.scene)); + this.scene.pushPhase(new BerryPhase(this.scene)); /** Add a new phase to check who should be taking status damage */ this.scene.pushPhase(new CheckStatusEffectPhase(this.scene, moveOrder)); - this.scene.pushPhase(new BerryPhase(this.scene)); this.scene.pushPhase(new TurnEndPhase(this.scene)); /** From dfb42e44a695040c2a7ae9b76e8564572ed89c0d Mon Sep 17 00:00:00 2001 From: PigeonBar <56974298+PigeonBar@users.noreply.github.com> Date: Sun, 27 Oct 2024 00:04:57 -0400 Subject: [PATCH 3/7] [Hotfix] Fix Eternatus egg tier (#4734) --- package-lock.json | 4 ++-- package.json | 2 +- src/data/balance/species-egg-tiers.ts | 2 +- src/data/egg.ts | 10 ++++++--- src/test/eggs/egg.test.ts | 30 ++++++++++++++++++++++++++- 5 files changed, 40 insertions(+), 8 deletions(-) diff --git a/package-lock.json b/package-lock.json index bbe52272f92..0c36f9cfee9 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "pokemon-rogue-battle", - "version": "1.1.1", + "version": "1.1.2", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "pokemon-rogue-battle", - "version": "1.1.1", + "version": "1.1.2", "hasInstallScript": true, "dependencies": { "@material/material-color-utilities": "^0.2.7", diff --git a/package.json b/package.json index 4666ffb7587..aef6e7b2ba0 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "pokemon-rogue-battle", "private": true, - "version": "1.1.1", + "version": "1.1.2", "type": "module", "scripts": { "start": "vite", diff --git a/src/data/balance/species-egg-tiers.ts b/src/data/balance/species-egg-tiers.ts index cd266dfcf54..27baa18151a 100644 --- a/src/data/balance/species-egg-tiers.ts +++ b/src/data/balance/species-egg-tiers.ts @@ -497,7 +497,7 @@ export const speciesEggTiers = { [Species.DREEPY]: EggTier.RARE, [Species.ZACIAN]: EggTier.LEGENDARY, [Species.ZAMAZENTA]: EggTier.LEGENDARY, - [Species.ETERNATUS]: EggTier.COMMON, + [Species.ETERNATUS]: EggTier.LEGENDARY, [Species.KUBFU]: EggTier.EPIC, [Species.ZARUDE]: EggTier.EPIC, [Species.REGIELEKI]: EggTier.EPIC, diff --git a/src/data/egg.ts b/src/data/egg.ts index 0f88c53b748..f7d109dfa62 100644 --- a/src/data/egg.ts +++ b/src/data/egg.ts @@ -544,11 +544,15 @@ export class Egg { //// } -export function getLegendaryGachaSpeciesForTimestamp(scene: BattleScene, timestamp: number): Species { - const legendarySpecies = Object.entries(speciesEggTiers) +export function getValidLegendaryGachaSpecies() : Species[] { + return Object.entries(speciesEggTiers) .filter(s => s[1] === EggTier.LEGENDARY) .map(s => parseInt(s[0])) - .filter(s => getPokemonSpecies(s).isObtainable()); + .filter(s => getPokemonSpecies(s).isObtainable() && s !== Species.ETERNATUS); +} + +export function getLegendaryGachaSpeciesForTimestamp(scene: BattleScene, timestamp: number): Species { + const legendarySpecies = getValidLegendaryGachaSpecies(); let ret: Species; diff --git a/src/test/eggs/egg.test.ts b/src/test/eggs/egg.test.ts index 6f57af63e6b..aebb196ff5e 100644 --- a/src/test/eggs/egg.test.ts +++ b/src/test/eggs/egg.test.ts @@ -1,4 +1,7 @@ -import { Egg, getLegendaryGachaSpeciesForTimestamp } from "#app/data/egg"; +import { speciesEggTiers } from "#app/data/balance/species-egg-tiers"; +import { speciesStarterCosts } from "#app/data/balance/starters"; +import { Egg, getLegendaryGachaSpeciesForTimestamp, getValidLegendaryGachaSpecies } from "#app/data/egg"; +import { allSpecies } from "#app/data/pokemon-species"; import { EggSourceType } from "#app/enums/egg-source-types"; import { EggTier } from "#app/enums/egg-type"; import { VariantTier } from "#app/enums/variant-tier"; @@ -64,6 +67,12 @@ describe("Egg Generation Tests", () => { expect(gachaSpeciesCount).toBeGreaterThan(0.4 * EGG_HATCH_COUNT); expect(gachaSpeciesCount).toBeLessThan(0.6 * EGG_HATCH_COUNT); }); + it("should never be allowed to generate Eternatus via the legendary gacha", () => { + const validLegendaryGachaSpecies = getValidLegendaryGachaSpecies(); + expect(validLegendaryGachaSpecies.every(s => speciesEggTiers[s] === EggTier.LEGENDARY)).toBe(true); + expect(validLegendaryGachaSpecies.every(s => allSpecies[s].isObtainable())).toBe(true); + expect(validLegendaryGachaSpecies.includes(Species.ETERNATUS)).toBe(false); + }); it("should hatch an Arceus. Set from species", () => { const scene = game.scene; const expectedSpecies = Species.ARCEUS; @@ -376,4 +385,23 @@ describe("Egg Generation Tests", () => { expect(diffShiny).toBe(true); expect(diffAbility).toBe(true); }); + + // For now, we are using this test to detect oversights in egg tiers. + // Delete this test if the balance team rebalances species costs independently of egg tiers. + it("should have correct egg tiers based on species costs", () => { + const getExpectedEggTier = (starterCost) => + starterCost <= 3 ? EggTier.COMMON + : starterCost <= 5 ? EggTier.RARE + : starterCost <= 7 ? EggTier.EPIC + : EggTier.LEGENDARY; + + allSpecies.forEach(pokemonSpecies => { + const rootSpecies = pokemonSpecies.getRootSpeciesId(); + const speciesCost = speciesStarterCosts[rootSpecies]; + const expectedEggTier = getExpectedEggTier(speciesCost); + const actualEggTier = speciesEggTiers[rootSpecies]; + + expect(actualEggTier).toBe(expectedEggTier); + }); + }); }); From 41380b39b950f9eeb49b31a48c0e7f5a25232de3 Mon Sep 17 00:00:00 2001 From: Moka <54149968+MokaStitcher@users.noreply.github.com> Date: Sun, 27 Oct 2024 21:32:30 +0100 Subject: [PATCH 4/7] [Hotfix] Fix manifest getting loaded before the game is initialized (#4739) * Fix manifest being used before the game is initialized * bump game version * make manifest fix more future proof * Revert "make manifest fix more future proof" This reverts commit 32591b35d0438dac99eb2ea29cd6757e3086008a. * fix locales path for offline builds --- package-lock.json | 4 ++-- package.json | 2 +- src/main.ts | 10 ++++++---- src/plugins/i18n.ts | 2 +- 4 files changed, 10 insertions(+), 8 deletions(-) diff --git a/package-lock.json b/package-lock.json index 0c36f9cfee9..5c134ae70dd 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "pokemon-rogue-battle", - "version": "1.1.2", + "version": "1.1.3", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "pokemon-rogue-battle", - "version": "1.1.2", + "version": "1.1.3", "hasInstallScript": true, "dependencies": { "@material/material-color-utilities": "^0.2.7", diff --git a/package.json b/package.json index aef6e7b2ba0..4a8743745b9 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "pokemon-rogue-battle", "private": true, - "version": "1.1.2", + "version": "1.1.3", "type": "module", "scripts": { "start": "vite", diff --git a/src/main.ts b/src/main.ts index d25ff08222d..993bd1018ae 100644 --- a/src/main.ts +++ b/src/main.ts @@ -44,7 +44,7 @@ document.fonts.load("16px emerald").then(() => document.fonts.load("10px pkmnems let game; -const startGame = async () => { +const startGame = async (manifest?: any) => { await initI18n(); const LoadingScene = (await import("./loading-scene")).LoadingScene; const BattleScene = (await import("./battle-scene")).default; @@ -94,16 +94,18 @@ const startGame = async () => { version: version }); game.sound.pauseOnBlur = false; + if (manifest) { + game["manifest"] = manifest; + } }; fetch("/manifest.json") .then(res => res.json()) .then(jsonResponse => { - startGame(); - game["manifest"] = jsonResponse.manifest; + startGame(jsonResponse.manifest); }).catch(() => { // Manifest not found (likely local build) - // startGame(); + startGame(); }); export default game; diff --git a/src/plugins/i18n.ts b/src/plugins/i18n.ts index d24484bbf9d..91a67b9414c 100644 --- a/src/plugins/i18n.ts +++ b/src/plugins/i18n.ts @@ -164,7 +164,7 @@ export async function initI18n(): Promise { } else { fileName = camelCaseToKebabCase(ns); } - return `/locales/${lng}/${fileName}.json?v=${pkg.version}`; + return `./locales/${lng}/${fileName}.json?v=${pkg.version}`; }, }, defaultNS: "menu", From 33f5f4c33ba82621a5e95dcbf02092b8757569af Mon Sep 17 00:00:00 2001 From: chaosgrimmon <31082757+chaosgrimmon@users.noreply.github.com> Date: Sun, 27 Oct 2024 18:23:09 -0400 Subject: [PATCH 5/7] [Sprite] Hotfix cut off Binacle sprite (#4741) * Trim 688.json duration * Trim 688.json duration * Fix cut off Binacle back * Fix cut off shiny Binacle back * Bump version * Bump version * Revert cutting off hair * Revert cutting off hair * Remove trailing comma * Remove trailing comma --- package-lock.json | 4 +- package.json | 2 +- public/images/pokemon/688.json | 3 +- public/images/pokemon/back/688.json | 58 +++++++---------------- public/images/pokemon/back/shiny/688.json | 58 +++++++---------------- public/images/pokemon/shiny/688.json | 3 +- 6 files changed, 41 insertions(+), 87 deletions(-) diff --git a/package-lock.json b/package-lock.json index 5c134ae70dd..a8b0718bb15 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "pokemon-rogue-battle", - "version": "1.1.3", + "version": "1.1.4", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "pokemon-rogue-battle", - "version": "1.1.3", + "version": "1.1.4", "hasInstallScript": true, "dependencies": { "@material/material-color-utilities": "^0.2.7", diff --git a/package.json b/package.json index 4a8743745b9..17a66e32286 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "pokemon-rogue-battle", "private": true, - "version": "1.1.3", + "version": "1.1.4", "type": "module", "scripts": { "start": "vite", diff --git a/public/images/pokemon/688.json b/public/images/pokemon/688.json index 069d176730e..3d9aa902a54 100644 --- a/public/images/pokemon/688.json +++ b/public/images/pokemon/688.json @@ -5,8 +5,7 @@ "rotated": false, "trimmed": false, "spriteSourceSize": { "x": 0, "y": 0, "w": 64, "h": 63 }, - "sourceSize": { "w": 64, "h": 63 }, - "duration": 100 + "sourceSize": { "w": 64, "h": 63 } } ], "meta": { diff --git a/public/images/pokemon/back/688.json b/public/images/pokemon/back/688.json index 872fbc1f9db..d9f30db34a8 100644 --- a/public/images/pokemon/back/688.json +++ b/public/images/pokemon/back/688.json @@ -1,41 +1,19 @@ -{ - "textures": [ - { - "image": "688.png", - "format": "RGBA8888", - "size": { - "w": 52, - "h": 52 - }, - "scale": 1, - "frames": [ - { - "filename": "0001.png", - "rotated": false, - "trimmed": false, - "sourceSize": { - "w": 41, - "h": 52 - }, - "spriteSourceSize": { - "x": 0, - "y": 0, - "w": 41, - "h": 52 - }, - "frame": { - "x": 0, - "y": 0, - "w": 41, - "h": 52 - } - } - ] - } - ], - "meta": { - "app": "https://www.codeandweb.com/texturepacker", - "version": "3.0", - "smartupdate": "$TexturePacker:SmartUpdate:ea462f2b1b46327e3b8fcb7ec5e44f08:2d2598cc03dec73182dbea237ad83b34:176060351d0044923af938ba7932a6ef$" - } +{ "frames": [ + { + "filename": "0001.png", + "frame": { "x": 0, "y": 0, "w": 51, "h": 65 }, + "rotated": false, + "trimmed": false, + "spriteSourceSize": { "x": 0, "y": 0, "w": 51, "h": 65 }, + "sourceSize": { "w": 51, "h": 65 } + } + ], + "meta": { + "app": "https://www.aseprite.org/", + "version": "1.3.7-dev", + "image": "688.png", + "format": "I8", + "size": { "w": 51, "h": 65 }, + "scale": "1" + } } diff --git a/public/images/pokemon/back/shiny/688.json b/public/images/pokemon/back/shiny/688.json index 56cf47aab5a..d9f30db34a8 100644 --- a/public/images/pokemon/back/shiny/688.json +++ b/public/images/pokemon/back/shiny/688.json @@ -1,41 +1,19 @@ -{ - "textures": [ - { - "image": "688.png", - "format": "RGBA8888", - "size": { - "w": 52, - "h": 52 - }, - "scale": 1, - "frames": [ - { - "filename": "0001.png", - "rotated": false, - "trimmed": false, - "sourceSize": { - "w": 41, - "h": 52 - }, - "spriteSourceSize": { - "x": 0, - "y": 0, - "w": 41, - "h": 52 - }, - "frame": { - "x": 0, - "y": 0, - "w": 41, - "h": 52 - } - } - ] - } - ], - "meta": { - "app": "https://www.codeandweb.com/texturepacker", - "version": "3.0", - "smartupdate": "$TexturePacker:SmartUpdate:0261b6c9242bba728fcfbfc515875b27:de0d9ddceed9311b33ae50ba86e969d1:176060351d0044923af938ba7932a6ef$" - } +{ "frames": [ + { + "filename": "0001.png", + "frame": { "x": 0, "y": 0, "w": 51, "h": 65 }, + "rotated": false, + "trimmed": false, + "spriteSourceSize": { "x": 0, "y": 0, "w": 51, "h": 65 }, + "sourceSize": { "w": 51, "h": 65 } + } + ], + "meta": { + "app": "https://www.aseprite.org/", + "version": "1.3.7-dev", + "image": "688.png", + "format": "I8", + "size": { "w": 51, "h": 65 }, + "scale": "1" + } } diff --git a/public/images/pokemon/shiny/688.json b/public/images/pokemon/shiny/688.json index 069d176730e..3d9aa902a54 100644 --- a/public/images/pokemon/shiny/688.json +++ b/public/images/pokemon/shiny/688.json @@ -5,8 +5,7 @@ "rotated": false, "trimmed": false, "spriteSourceSize": { "x": 0, "y": 0, "w": 64, "h": 63 }, - "sourceSize": { "w": 64, "h": 63 }, - "duration": 100 + "sourceSize": { "w": 64, "h": 63 } } ], "meta": { From 5797f265a415cdaabdc639bdcf9ce949f01c24f7 Mon Sep 17 00:00:00 2001 From: pom-eranian Date: Sun, 27 Oct 2024 22:32:36 -0400 Subject: [PATCH 6/7] [Sprite][hotfix] Fixed cropping on 658 static greninja and ash greninja (#4743) * [Sprite][hotfix] Fixed cropping on static greninja and ash greninja * bump version number --- package-lock.json | 4 +- package.json | 2 +- public/images/pokemon/658-ash.json | 58 ++++++------------- public/images/pokemon/658.json | 58 ++++++------------- public/images/pokemon/back/658-ash.json | 58 ++++++------------- public/images/pokemon/back/658.json | 58 ++++++------------- public/images/pokemon/back/shiny/658-ash.json | 58 ++++++------------- public/images/pokemon/back/shiny/658.json | 58 ++++++------------- public/images/pokemon/shiny/658-ash.json | 58 ++++++------------- public/images/pokemon/shiny/658.json | 58 ++++++------------- 10 files changed, 147 insertions(+), 323 deletions(-) diff --git a/package-lock.json b/package-lock.json index a8b0718bb15..17108c86ba8 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "pokemon-rogue-battle", - "version": "1.1.4", + "version": "1.1.5", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "pokemon-rogue-battle", - "version": "1.1.4", + "version": "1.1.5", "hasInstallScript": true, "dependencies": { "@material/material-color-utilities": "^0.2.7", diff --git a/package.json b/package.json index 17a66e32286..657bf7a5cd4 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "pokemon-rogue-battle", "private": true, - "version": "1.1.4", + "version": "1.1.5", "type": "module", "scripts": { "start": "vite", diff --git a/public/images/pokemon/658-ash.json b/public/images/pokemon/658-ash.json index 8fbe19f5ccb..c2b8eede9ef 100644 --- a/public/images/pokemon/658-ash.json +++ b/public/images/pokemon/658-ash.json @@ -1,41 +1,19 @@ -{ - "textures": [ - { - "image": "658-ash.png", - "format": "RGBA8888", - "size": { - "w": 79, - "h": 79 - }, - "scale": 1, - "frames": [ - { - "filename": "0001.png", - "rotated": false, - "trimmed": false, - "sourceSize": { - "w": 79, - "h": 74 - }, - "spriteSourceSize": { - "x": 0, - "y": 0, - "w": 79, - "h": 74 - }, - "frame": { - "x": 0, - "y": 0, - "w": 79, - "h": 74 - } - } - ] - } - ], - "meta": { - "app": "https://www.codeandweb.com/texturepacker", - "version": "3.0", - "smartupdate": "$TexturePacker:SmartUpdate:936f62fa49ba4d6e402bb2e2eaf2afd0:ed00ba047a44b4bf1309bc147dd000e3:bfbf521a5c7bd80bcd95a96d9789c0dd$" - } +{ "frames": [ + { + "filename": "0001.png", + "frame": { "x": 0, "y": 0, "w": 79, "h": 74 }, + "rotated": false, + "trimmed": false, + "spriteSourceSize": { "x": 0, "y": 0, "w": 79, "h": 74 }, + "sourceSize": { "w": 79, "h": 74 }, + "duration": 100 + } + ], + "meta": { + "app": "https://www.aseprite.org/", + "version": "1.3.7-x64", + "format": "I8", + "size": { "w": 79, "h": 74 }, + "scale": "1" + } } diff --git a/public/images/pokemon/658.json b/public/images/pokemon/658.json index 4fd918e0f50..219645ec240 100644 --- a/public/images/pokemon/658.json +++ b/public/images/pokemon/658.json @@ -1,41 +1,19 @@ -{ - "textures": [ - { - "image": "658.png", - "format": "RGBA8888", - "size": { - "w": 75, - "h": 75 - }, - "scale": 1, - "frames": [ - { - "filename": "0001.png", - "rotated": false, - "trimmed": false, - "sourceSize": { - "w": 75, - "h": 65 - }, - "spriteSourceSize": { - "x": 0, - "y": 0, - "w": 75, - "h": 65 - }, - "frame": { - "x": 0, - "y": 0, - "w": 75, - "h": 65 - } - } - ] - } - ], - "meta": { - "app": "https://www.codeandweb.com/texturepacker", - "version": "3.0", - "smartupdate": "$TexturePacker:SmartUpdate:e0b10df331bd4ce6760edab61dee144b:061561c45beff89a92bf0158d065204f:5affcab976148657d36bf4ff3410f92d$" - } +{ "frames": [ + { + "filename": "0001.png", + "frame": { "x": 0, "y": 0, "w": 85, "h": 67 }, + "rotated": false, + "trimmed": false, + "spriteSourceSize": { "x": 0, "y": 0, "w": 85, "h": 67 }, + "sourceSize": { "w": 85, "h": 67 }, + "duration": 100 + } + ], + "meta": { + "app": "https://www.aseprite.org/", + "version": "1.3.7-x64", + "format": "I8", + "size": { "w": 85, "h": 67 }, + "scale": "1" + } } diff --git a/public/images/pokemon/back/658-ash.json b/public/images/pokemon/back/658-ash.json index 4ddab1765b2..51a722070b3 100644 --- a/public/images/pokemon/back/658-ash.json +++ b/public/images/pokemon/back/658-ash.json @@ -1,41 +1,19 @@ -{ - "textures": [ - { - "image": "658-ash.png", - "format": "RGBA8888", - "size": { - "w": 73, - "h": 73 - }, - "scale": 1, - "frames": [ - { - "filename": "0001.png", - "rotated": false, - "trimmed": false, - "sourceSize": { - "w": 73, - "h": 69 - }, - "spriteSourceSize": { - "x": 0, - "y": 0, - "w": 73, - "h": 69 - }, - "frame": { - "x": 0, - "y": 0, - "w": 73, - "h": 69 - } - } - ] - } - ], - "meta": { - "app": "https://www.codeandweb.com/texturepacker", - "version": "3.0", - "smartupdate": "$TexturePacker:SmartUpdate:4f38801bb3afeda5faff04bdcf6a666f:0c78ce2715e7510bf55da0a92b42661c:bfbf521a5c7bd80bcd95a96d9789c0dd$" - } +{ "frames": [ + { + "filename": "0001.png", + "frame": { "x": 0, "y": 0, "w": 73, "h": 73 }, + "rotated": false, + "trimmed": false, + "spriteSourceSize": { "x": 0, "y": 0, "w": 73, "h": 73 }, + "sourceSize": { "w": 73, "h": 73 }, + "duration": 100 + } + ], + "meta": { + "app": "https://www.aseprite.org/", + "version": "1.3.7-x64", + "format": "I8", + "size": { "w": 73, "h": 73 }, + "scale": "1" + } } diff --git a/public/images/pokemon/back/658.json b/public/images/pokemon/back/658.json index 119002876a6..050b63e3592 100644 --- a/public/images/pokemon/back/658.json +++ b/public/images/pokemon/back/658.json @@ -1,41 +1,19 @@ -{ - "textures": [ - { - "image": "658.png", - "format": "RGBA8888", - "size": { - "w": 77, - "h": 77 - }, - "scale": 1, - "frames": [ - { - "filename": "0001.png", - "rotated": false, - "trimmed": false, - "sourceSize": { - "w": 77, - "h": 65 - }, - "spriteSourceSize": { - "x": 0, - "y": 0, - "w": 77, - "h": 65 - }, - "frame": { - "x": 0, - "y": 0, - "w": 77, - "h": 65 - } - } - ] - } - ], - "meta": { - "app": "https://www.codeandweb.com/texturepacker", - "version": "3.0", - "smartupdate": "$TexturePacker:SmartUpdate:acdb9925f3f23b947504eec7cc28c92d:1a13d9d418f6c107bb9e5d621d9154bb:5affcab976148657d36bf4ff3410f92d$" - } +{ "frames": [ + { + "filename": "0001.png", + "frame": { "x": 0, "y": 0, "w": 77, "h": 77 }, + "rotated": false, + "trimmed": false, + "spriteSourceSize": { "x": 0, "y": 0, "w": 77, "h": 77 }, + "sourceSize": { "w": 77, "h": 77 }, + "duration": 100 + } + ], + "meta": { + "app": "https://www.aseprite.org/", + "version": "1.3.7-x64", + "format": "I8", + "size": { "w": 77, "h": 77 }, + "scale": "1" + } } diff --git a/public/images/pokemon/back/shiny/658-ash.json b/public/images/pokemon/back/shiny/658-ash.json index a796ad08246..51a722070b3 100644 --- a/public/images/pokemon/back/shiny/658-ash.json +++ b/public/images/pokemon/back/shiny/658-ash.json @@ -1,41 +1,19 @@ -{ - "textures": [ - { - "image": "658-ash.png", - "format": "RGBA8888", - "size": { - "w": 73, - "h": 73 - }, - "scale": 1, - "frames": [ - { - "filename": "0001.png", - "rotated": false, - "trimmed": false, - "sourceSize": { - "w": 73, - "h": 69 - }, - "spriteSourceSize": { - "x": 0, - "y": 0, - "w": 73, - "h": 69 - }, - "frame": { - "x": 0, - "y": 0, - "w": 73, - "h": 69 - } - } - ] - } - ], - "meta": { - "app": "https://www.codeandweb.com/texturepacker", - "version": "3.0", - "smartupdate": "$TexturePacker:SmartUpdate:d474b821316a87dfe09b397bdc2db5ef:497de0c2ec59ceba163e870b3226c76c:bfbf521a5c7bd80bcd95a96d9789c0dd$" - } +{ "frames": [ + { + "filename": "0001.png", + "frame": { "x": 0, "y": 0, "w": 73, "h": 73 }, + "rotated": false, + "trimmed": false, + "spriteSourceSize": { "x": 0, "y": 0, "w": 73, "h": 73 }, + "sourceSize": { "w": 73, "h": 73 }, + "duration": 100 + } + ], + "meta": { + "app": "https://www.aseprite.org/", + "version": "1.3.7-x64", + "format": "I8", + "size": { "w": 73, "h": 73 }, + "scale": "1" + } } diff --git a/public/images/pokemon/back/shiny/658.json b/public/images/pokemon/back/shiny/658.json index cc5d3c5b9ff..050b63e3592 100644 --- a/public/images/pokemon/back/shiny/658.json +++ b/public/images/pokemon/back/shiny/658.json @@ -1,41 +1,19 @@ -{ - "textures": [ - { - "image": "658.png", - "format": "RGBA8888", - "size": { - "w": 77, - "h": 77 - }, - "scale": 1, - "frames": [ - { - "filename": "0001.png", - "rotated": false, - "trimmed": false, - "sourceSize": { - "w": 77, - "h": 65 - }, - "spriteSourceSize": { - "x": 0, - "y": 0, - "w": 77, - "h": 65 - }, - "frame": { - "x": 0, - "y": 0, - "w": 77, - "h": 65 - } - } - ] - } - ], - "meta": { - "app": "https://www.codeandweb.com/texturepacker", - "version": "3.0", - "smartupdate": "$TexturePacker:SmartUpdate:5891f87a78022cde3402e7d9714cc7bf:756360084290e39c139e3fef91c81759:5affcab976148657d36bf4ff3410f92d$" - } +{ "frames": [ + { + "filename": "0001.png", + "frame": { "x": 0, "y": 0, "w": 77, "h": 77 }, + "rotated": false, + "trimmed": false, + "spriteSourceSize": { "x": 0, "y": 0, "w": 77, "h": 77 }, + "sourceSize": { "w": 77, "h": 77 }, + "duration": 100 + } + ], + "meta": { + "app": "https://www.aseprite.org/", + "version": "1.3.7-x64", + "format": "I8", + "size": { "w": 77, "h": 77 }, + "scale": "1" + } } diff --git a/public/images/pokemon/shiny/658-ash.json b/public/images/pokemon/shiny/658-ash.json index 7ac419b1686..c2b8eede9ef 100644 --- a/public/images/pokemon/shiny/658-ash.json +++ b/public/images/pokemon/shiny/658-ash.json @@ -1,41 +1,19 @@ -{ - "textures": [ - { - "image": "658-ash.png", - "format": "RGBA8888", - "size": { - "w": 79, - "h": 79 - }, - "scale": 1, - "frames": [ - { - "filename": "0001.png", - "rotated": false, - "trimmed": false, - "sourceSize": { - "w": 79, - "h": 74 - }, - "spriteSourceSize": { - "x": 0, - "y": 0, - "w": 79, - "h": 74 - }, - "frame": { - "x": 0, - "y": 0, - "w": 79, - "h": 74 - } - } - ] - } - ], - "meta": { - "app": "https://www.codeandweb.com/texturepacker", - "version": "3.0", - "smartupdate": "$TexturePacker:SmartUpdate:3dd081ba5490f090a73de8423aac2f6b:f088fafaea755476f2abf488e7340cab:bfbf521a5c7bd80bcd95a96d9789c0dd$" - } +{ "frames": [ + { + "filename": "0001.png", + "frame": { "x": 0, "y": 0, "w": 79, "h": 74 }, + "rotated": false, + "trimmed": false, + "spriteSourceSize": { "x": 0, "y": 0, "w": 79, "h": 74 }, + "sourceSize": { "w": 79, "h": 74 }, + "duration": 100 + } + ], + "meta": { + "app": "https://www.aseprite.org/", + "version": "1.3.7-x64", + "format": "I8", + "size": { "w": 79, "h": 74 }, + "scale": "1" + } } diff --git a/public/images/pokemon/shiny/658.json b/public/images/pokemon/shiny/658.json index 92f9b29175c..219645ec240 100644 --- a/public/images/pokemon/shiny/658.json +++ b/public/images/pokemon/shiny/658.json @@ -1,41 +1,19 @@ -{ - "textures": [ - { - "image": "658.png", - "format": "RGBA8888", - "size": { - "w": 75, - "h": 75 - }, - "scale": 1, - "frames": [ - { - "filename": "0001.png", - "rotated": false, - "trimmed": false, - "sourceSize": { - "w": 75, - "h": 65 - }, - "spriteSourceSize": { - "x": 0, - "y": 0, - "w": 75, - "h": 65 - }, - "frame": { - "x": 0, - "y": 0, - "w": 75, - "h": 65 - } - } - ] - } - ], - "meta": { - "app": "https://www.codeandweb.com/texturepacker", - "version": "3.0", - "smartupdate": "$TexturePacker:SmartUpdate:be07c062265a19e890f1e2d2d1b5527d:ad4583a5a0498c496e9a93574c55ee03:5affcab976148657d36bf4ff3410f92d$" - } +{ "frames": [ + { + "filename": "0001.png", + "frame": { "x": 0, "y": 0, "w": 85, "h": 67 }, + "rotated": false, + "trimmed": false, + "spriteSourceSize": { "x": 0, "y": 0, "w": 85, "h": 67 }, + "sourceSize": { "w": 85, "h": 67 }, + "duration": 100 + } + ], + "meta": { + "app": "https://www.aseprite.org/", + "version": "1.3.7-x64", + "format": "I8", + "size": { "w": 85, "h": 67 }, + "scale": "1" + } } From b4cc9d7892a7d8b548c857f3acca40d5cf5defba Mon Sep 17 00:00:00 2001 From: innerthunder <168692175+innerthunder@users.noreply.github.com> Date: Mon, 28 Oct 2024 06:02:10 -0700 Subject: [PATCH 7/7] [Hotfix] Fix crash when Mist would block a stat drop (#4746) * Fix crash when Mist would block a stat drop * Bump version * Bump version (again) --- package-lock.json | 4 +-- package.json | 2 +- src/data/arena-tag.ts | 1 + src/phases/stat-stage-change-phase.ts | 2 +- src/test/moves/mist.test.ts | 49 +++++++++++++++++++++++++++ 5 files changed, 54 insertions(+), 4 deletions(-) create mode 100644 src/test/moves/mist.test.ts diff --git a/package-lock.json b/package-lock.json index 17108c86ba8..9e512884922 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "pokemon-rogue-battle", - "version": "1.1.5", + "version": "1.1.6", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "pokemon-rogue-battle", - "version": "1.1.5", + "version": "1.1.6", "hasInstallScript": true, "dependencies": { "@material/material-color-utilities": "^0.2.7", diff --git a/package.json b/package.json index 657bf7a5cd4..f106fb1a773 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "pokemon-rogue-battle", "private": true, - "version": "1.1.5", + "version": "1.1.6", "type": "module", "scripts": { "start": "vite", diff --git a/src/data/arena-tag.ts b/src/data/arena-tag.ts index d2c95b7ccdf..43de6e02dcb 100644 --- a/src/data/arena-tag.ts +++ b/src/data/arena-tag.ts @@ -126,6 +126,7 @@ export class MistTag extends ArenaTag { * Cancels the lowering of stats * @param arena the {@linkcode Arena} containing this effect * @param simulated `true` if the effect should be applied quietly + * @param attacker the {@linkcode Pokemon} using a move into this effect. * @param cancelled a {@linkcode BooleanHolder} whose value is set to `true` * to flag the stat reduction as cancelled * @returns `true` if a stat reduction was cancelled; `false` otherwise diff --git a/src/phases/stat-stage-change-phase.ts b/src/phases/stat-stage-change-phase.ts index 2d4b3ce6c6f..ce6ebea2442 100644 --- a/src/phases/stat-stage-change-phase.ts +++ b/src/phases/stat-stage-change-phase.ts @@ -65,7 +65,7 @@ export class StatStageChangePhase extends PokemonPhase { if (!this.selfTarget && stages.value < 0) { // TODO: add a reference to the source of the stat change to fix Infiltrator interaction - this.scene.arena.applyTagsForSide(MistTag, pokemon.isPlayer() ? ArenaTagSide.PLAYER : ArenaTagSide.ENEMY, false, null, false, cancelled); + this.scene.arena.applyTagsForSide(MistTag, pokemon.isPlayer() ? ArenaTagSide.PLAYER : ArenaTagSide.ENEMY, false, null, cancelled); } if (!cancelled.value && !this.selfTarget && stages.value < 0) { diff --git a/src/test/moves/mist.test.ts b/src/test/moves/mist.test.ts new file mode 100644 index 00000000000..cd338f79412 --- /dev/null +++ b/src/test/moves/mist.test.ts @@ -0,0 +1,49 @@ +import { Stat } from "#enums/stat"; +import { Abilities } from "#enums/abilities"; +import { Moves } from "#enums/moves"; +import { Species } from "#enums/species"; +import GameManager from "#test/utils/gameManager"; +import Phaser from "phaser"; +import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest"; + +describe("Moves - Mist", () => { + let phaserGame: Phaser.Game; + let game: GameManager; + + beforeAll(() => { + phaserGame = new Phaser.Game({ + type: Phaser.HEADLESS, + }); + }); + + afterEach(() => { + game.phaseInterceptor.restoreOg(); + }); + + beforeEach(() => { + game = new GameManager(phaserGame); + game.override + .moveset([ Moves.MIST, Moves.SPLASH ]) + .ability(Abilities.BALL_FETCH) + .battleType("double") + .disableCrits() + .enemySpecies(Species.SNORLAX) + .enemyAbility(Abilities.BALL_FETCH) + .enemyMoveset(Moves.GROWL); + }); + + it("should prevent the user's side from having stats lowered", async () => { + await game.classicMode.startBattle([ Species.MAGIKARP, Species.FEEBAS ]); + + const playerPokemon = game.scene.getPlayerField(); + + game.move.select(Moves.MIST, 0); + game.move.select(Moves.SPLASH, 1); + + await game.phaseInterceptor.to("BerryPhase"); + + playerPokemon.forEach(p => expect(p.getStatStage(Stat.ATK)).toBe(0)); + }); + + it.todo("should be ignored by opponents with Infiltrator"); +});