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);