From 5ad8f189501a0afea2cc458eeacecaadae5c192c Mon Sep 17 00:00:00 2001 From: Wlowscha <54003515+Wlowscha@users.noreply.github.com> Date: Fri, 14 Feb 2025 02:13:28 +0100 Subject: [PATCH 1/6] getFullUnlockedData now properly accounts for forms --- src/data/pokemon-species.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/data/pokemon-species.ts b/src/data/pokemon-species.ts index 5883bac3fc8..8473f7788e3 100644 --- a/src/data/pokemon-species.ts +++ b/src/data/pokemon-species.ts @@ -1051,7 +1051,11 @@ export default class PokemonSpecies extends PokemonSpeciesForm implements Locali caughtAttr += DexAttr.VARIANT_2; caughtAttr += DexAttr.VARIANT_3; } - caughtAttr += DexAttr.DEFAULT_FORM; + + // Summing successive bigints for each obtainable form + caughtAttr += this.forms + .map((f, index) => f.isUnobtainable ? 0n : 128n * 2n ** BigInt(index)) + .reduce((acc, val) => acc + val, 0n); return caughtAttr; } From 7611061378f61e21381719a33f21266f3e02774d Mon Sep 17 00:00:00 2001 From: Wlowscha <54003515+Wlowscha@users.noreply.github.com> Date: Fri, 14 Feb 2025 02:15:24 +0100 Subject: [PATCH 2/6] Updating version --- package-lock.json | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/package-lock.json b/package-lock.json index 270b72afda8..1bf7649704b 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "pokemon-rogue-battle", - "version": "1.6.0", + "version": "1.6.1", "lockfileVersion": 3, "requires": true, "packages": { diff --git a/package.json b/package.json index 3861d5fb4ca..4e43b835189 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "pokemon-rogue-battle", "private": true, - "version": "1.6.0", + "version": "1.6.1", "type": "module", "scripts": { "start": "vite", From 8f498f1197df29673b25e2f9116589feae59065b Mon Sep 17 00:00:00 2001 From: Wlowscha <54003515+Wlowscha@users.noreply.github.com> Date: Fri, 14 Feb 2025 03:03:14 +0100 Subject: [PATCH 3/6] Counting default form in caughtAttr for mons that don't have alternative forms --- src/data/pokemon-species.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/data/pokemon-species.ts b/src/data/pokemon-species.ts index 8473f7788e3..4349cee2cbf 100644 --- a/src/data/pokemon-species.ts +++ b/src/data/pokemon-species.ts @@ -1053,9 +1053,9 @@ export default class PokemonSpecies extends PokemonSpeciesForm implements Locali } // Summing successive bigints for each obtainable form - caughtAttr += this.forms - .map((f, index) => f.isUnobtainable ? 0n : 128n * 2n ** BigInt(index)) - .reduce((acc, val) => acc + val, 0n); + caughtAttr += this?.forms?.length > 1 ? + this.forms.map((f, index) => f.isUnobtainable ? 0n : 128n * 2n ** BigInt(index)).reduce((acc, val) => acc + val, 0n) : + DexAttr.DEFAULT_FORM; return caughtAttr; } From d159901ea1464911af612cd950c0eb4c5b671b84 Mon Sep 17 00:00:00 2001 From: Wlowscha <54003515+Wlowscha@users.noreply.github.com> Date: Fri, 14 Feb 2025 03:03:58 +0100 Subject: [PATCH 4/6] Updated version --- package-lock.json | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/package-lock.json b/package-lock.json index 1bf7649704b..b3ce2c3b415 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "pokemon-rogue-battle", - "version": "1.6.1", + "version": "1.6.2", "lockfileVersion": 3, "requires": true, "packages": { diff --git a/package.json b/package.json index 4e43b835189..bbbb0f56f6b 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "pokemon-rogue-battle", "private": true, - "version": "1.6.1", + "version": "1.6.2", "type": "module", "scripts": { "start": "vite", From 77fbcc70ef7c0c56c6b75f8e252ecd46c442e8f1 Mon Sep 17 00:00:00 2001 From: Xavion3 Date: Fri, 14 Feb 2025 18:40:13 +1100 Subject: [PATCH 5/6] [Bug][Hotfix] Fix fusion with dual type + monotype with shared primary type. (#5322) * Fix fusion with dual type + monotype with shared primary type. * Update version number * Add test case --- package-lock.json | 4 ++-- package.json | 2 +- src/field/pokemon.ts | 6 ++++++ src/test/field/pokemon.test.ts | 11 +++++++++++ 4 files changed, 20 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index b3ce2c3b415..2ae45b1e2c2 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "pokemon-rogue-battle", - "version": "1.6.2", + "version": "1.6.3", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "pokemon-rogue-battle", - "version": "1.5.4", + "version": "1.6.3", "hasInstallScript": true, "dependencies": { "@material/material-color-utilities": "^0.2.7", diff --git a/package.json b/package.json index bbbb0f56f6b..495815be15d 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "pokemon-rogue-battle", "private": true, - "version": "1.6.2", + "version": "1.6.3", "type": "module", "scripts": { "start": "vite", diff --git a/src/field/pokemon.ts b/src/field/pokemon.ts index 82674fb8b46..b1e48df5c61 100644 --- a/src/field/pokemon.ts +++ b/src/field/pokemon.ts @@ -1322,6 +1322,12 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container { } else if (fusionType1 !== types[0]) { secondType = fusionType1; } + + + if (secondType === Type.UNKNOWN && Utils.isNullOrUndefined(fusionType2)) { // If second pokemon was monotype and shared its primary type + secondType = (customTypes && this.customPokemonData.types.length > 1 && this.customPokemonData.types[1] !== Type.UNKNOWN) + ? this.customPokemonData.types[1] : (speciesForm.type2 ?? Type.UNKNOWN); + } } else { // If not a fusion, just get the second type from the species, checking for permanent changes from ME secondType = (customTypes && this.customPokemonData.types.length > 1 && this.customPokemonData.types[1] !== Type.UNKNOWN) diff --git a/src/test/field/pokemon.test.ts b/src/test/field/pokemon.test.ts index 0a1ddac9e90..0c282b44f49 100644 --- a/src/test/field/pokemon.test.ts +++ b/src/test/field/pokemon.test.ts @@ -150,6 +150,17 @@ describe("Spec - Pokemon", () => { expect(types[1]).toBe(Type.DARK); }); + it("Fusing mons with two and one types", async () => { + game.override.starterSpecies(Species.NUMEL); + game.override.starterFusionSpecies(Species.CHARMANDER); + await game.classicMode.startBattle(); + const pokemon = scene.getPlayerParty()[0]; + + const types = pokemon.getTypes(); + expect(types[0]).toBe(Type.FIRE); + expect(types[1]).toBe(Type.GROUND); + }); + it("Fusing two mons with two types", async () => { game.override.starterSpecies(Species.NATU); game.override.starterFusionSpecies(Species.HOUNDOUR); From 7b9d1d6570a9560909acad59a8b47c263eb1d7ad Mon Sep 17 00:00:00 2001 From: AJ Fontaine <36677462+Fontbane@users.noreply.github.com> Date: Fri, 14 Feb 2025 21:51:41 -0500 Subject: [PATCH 6/6] [Hotfix] Fix crash involving female Pyroar fusions with exp sprites (#5331) * Fix crash involving female Pyroar fusions with exp sprites * Update locales submodule --- package-lock.json | 4 +-- package.json | 2 +- public/images/pokemon/668-female.json | 41 -------------------------- public/images/pokemon/668-female.png | Bin 898 -> 0 bytes public/locales | 2 +- src/field/pokemon.ts | 9 ++++-- 6 files changed, 11 insertions(+), 47 deletions(-) delete mode 100644 public/images/pokemon/668-female.json delete mode 100644 public/images/pokemon/668-female.png diff --git a/package-lock.json b/package-lock.json index 2ae45b1e2c2..ce1feb7db41 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "pokemon-rogue-battle", - "version": "1.6.3", + "version": "1.6.4", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "pokemon-rogue-battle", - "version": "1.6.3", + "version": "1.6.4", "hasInstallScript": true, "dependencies": { "@material/material-color-utilities": "^0.2.7", diff --git a/package.json b/package.json index 495815be15d..c9b5798af76 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "pokemon-rogue-battle", "private": true, - "version": "1.6.3", + "version": "1.6.4", "type": "module", "scripts": { "start": "vite", diff --git a/public/images/pokemon/668-female.json b/public/images/pokemon/668-female.json deleted file mode 100644 index 13d67c90194..00000000000 --- a/public/images/pokemon/668-female.json +++ /dev/null @@ -1,41 +0,0 @@ -{ - "textures": [ - { - "image": "668-female.png", - "format": "RGBA8888", - "size": { - "w": 72, - "h": 72 - }, - "scale": 1, - "frames": [ - { - "filename": "0001.png", - "rotated": false, - "trimmed": false, - "sourceSize": { - "w": 63, - "h": 72 - }, - "spriteSourceSize": { - "x": 0, - "y": 0, - "w": 63, - "h": 72 - }, - "frame": { - "x": 0, - "y": 0, - "w": 63, - "h": 72 - } - } - ] - } - ], - "meta": { - "app": "https://www.codeandweb.com/texturepacker", - "version": "3.0", - "smartupdate": "$TexturePacker:SmartUpdate:3f88e039152d4a967a218cb721938610:e6991ce9c3bad348cbc05ebf9b440302:d99ed0e84a0695b54e479aa98271aba1$" - } -} diff --git a/public/images/pokemon/668-female.png b/public/images/pokemon/668-female.png deleted file mode 100644 index c8f4e205491a3c9298afb167fad34989f8374085..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 898 zcmV-|1AY97P)9ipC~f?H~&!QiD!hish$88UPV zX(u5MN3Tnl78^R0QcSc72YT@Sk_7y}^xnye&XO&Ec#yfDzW0!f$u4>Rk(|gR-)KI>MZL8`JY?jNP&BPpk z6|3KFQ6lfn-Xc{mT6Lf2H;>h)Axik%pjItc)tU~_I*I3uq1tV~#v*s8`={!Q&I&?M zEt~!CDA|j+TdhG$g9vL!E*a^euWJRRMZ~jg`J-=0@=t+I%akdP8K*>eQUBYPZAT?F7FrJ>ozcaRU5 zxHTzg-8A_bJ&aN_4fI8G8h0oG=;o!VGS})bQdotb6mO_W5BVh`EjEaFjJ^68!pF@y zKNr|r^idL66vPgq{YMaac5iN$<`D}J=>Z}Z6{ct!1w6o=b}OCL4pIuFMFEdl+^sYR z+98=pSuV1y;Cw~{1+qn`+l0J9bs9_RNhuf9PQ$q!iV|7s*{n8=1qqF6k#^>JMOf;& zYLMrk8KPFnA^@cd9}x*V^st8{KK6IMJ@!Ts9iW;x2@fGMA0TB>K^!zYh?0GDriQ5Y z8x%IkUQq`n7I8dvkr(!m{cmaZMzm80P=bitw=s+_cc?Jepa4b?W7MDxsDmhxQna^w zC5S`gxPlIm0H+S(D*z79$it~aR6+?BIT<1;G`{iCFewBmM58JZ8*DnI@Qs{Qj2#F6 Y0boY}eU9#KL;wH)07*qoM6N<$f?NrLjQ{`u diff --git a/public/locales b/public/locales index f917baa1bb2..58dda14ee83 160000 --- a/public/locales +++ b/public/locales @@ -1 +1 @@ -Subproject commit f917baa1bb2fc5071587b7894ce7b4898cc64f36 +Subproject commit 58dda14ee834204c4bd5ece47694a3c068df4b0e diff --git a/src/field/pokemon.ts b/src/field/pokemon.ts index b1e48df5c61..5c6fbb34aea 100644 --- a/src/field/pokemon.ts +++ b/src/field/pokemon.ts @@ -4042,6 +4042,11 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container { } } + if (fusionPixelColors.length === 0) { // ERROR HANDLING IS NOT OPTIONAL BUDDY + console.log("Failed to create fusion palette"); + return; + } + let paletteColors: Map; let fusionPaletteColors: Map; @@ -4055,8 +4060,8 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container { Math.random = originalRandom; - paletteColors = paletteColors!; // tell TS compiler that paletteColors is defined! - fusionPaletteColors = fusionPaletteColors!; // TS compiler that fusionPaletteColors is defined! + paletteColors = paletteColors!; // erroneously tell TS compiler that paletteColors is defined! + fusionPaletteColors = fusionPaletteColors!; // mischievously misinform TS compiler that fusionPaletteColors is defined! const [ palette, fusionPalette ] = [ paletteColors, fusionPaletteColors ] .map(paletteColors => { let keys = Array.from(paletteColors.keys()).sort((a: number, b: number) => paletteColors.get(a)! < paletteColors.get(b)! ? 1 : -1);