diff --git a/package-lock.json b/package-lock.json index 270b72afda8..ce1feb7db41 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "pokemon-rogue-battle", - "version": "1.6.0", + "version": "1.6.4", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "pokemon-rogue-battle", - "version": "1.5.4", + "version": "1.6.4", "hasInstallScript": true, "dependencies": { "@material/material-color-utilities": "^0.2.7", diff --git a/package.json b/package.json index 3861d5fb4ca..c9b5798af76 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "pokemon-rogue-battle", "private": true, - "version": "1.6.0", + "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 c8f4e205491..00000000000 Binary files a/public/images/pokemon/668-female.png and /dev/null differ 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/data/pokemon-species.ts b/src/data/pokemon-species.ts index 5883bac3fc8..4349cee2cbf 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?.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; } diff --git a/src/field/pokemon.ts b/src/field/pokemon.ts index 82674fb8b46..5c6fbb34aea 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) @@ -4036,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; @@ -4049,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); 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);