diff --git a/public/audio/cry/384-mega.mp3 b/public/audio/cry/384-mega.mp3 new file mode 100644 index 000000000..f881a4d03 Binary files /dev/null and b/public/audio/cry/384-mega.mp3 differ diff --git a/public/images/pokemon/384-mega.json b/public/images/pokemon/384-mega.json new file mode 100644 index 000000000..bfea79820 --- /dev/null +++ b/public/images/pokemon/384-mega.json @@ -0,0 +1,41 @@ +{ + "textures": [ + { + "image": "384-mega.png", + "format": "RGBA8888", + "size": { + "w": 96, + "h": 96 + }, + "scale": 1, + "frames": [ + { + "filename": "0001.png", + "rotated": false, + "trimmed": false, + "sourceSize": { + "w": 96, + "h": 96 + }, + "spriteSourceSize": { + "x": 0, + "y": 0, + "w": 96, + "h": 96 + }, + "frame": { + "x": 0, + "y": 0, + "w": 96, + "h": 96 + } + } + ] + } + ], + "meta": { + "app": "https://www.codeandweb.com/texturepacker", + "version": "3.0", + "smartupdate": "$TexturePacker:SmartUpdate:430b196156dce7e35efeb616df2afbb1:f04557de6b8b7c9f59e02ae300538366:cf7a16daaa5962e1da39cbbb1392de14$" + } +} diff --git a/public/images/pokemon/384-mega.png b/public/images/pokemon/384-mega.png new file mode 100644 index 000000000..f4087e367 Binary files /dev/null and b/public/images/pokemon/384-mega.png differ diff --git a/public/images/pokemon/back/384-mega.json b/public/images/pokemon/back/384-mega.json new file mode 100644 index 000000000..779f8fcf6 --- /dev/null +++ b/public/images/pokemon/back/384-mega.json @@ -0,0 +1,41 @@ +{ + "textures": [ + { + "image": "384-mega.png", + "format": "RGBA8888", + "size": { + "w": 96, + "h": 96 + }, + "scale": 1, + "frames": [ + { + "filename": "0001.png", + "rotated": false, + "trimmed": false, + "sourceSize": { + "w": 96, + "h": 96 + }, + "spriteSourceSize": { + "x": 0, + "y": 0, + "w": 96, + "h": 96 + }, + "frame": { + "x": 0, + "y": 0, + "w": 96, + "h": 96 + } + } + ] + } + ], + "meta": { + "app": "https://www.codeandweb.com/texturepacker", + "version": "3.0", + "smartupdate": "$TexturePacker:SmartUpdate:3d06b3a8aabe77748c6fd866e165d0fc:0f452ac0571c863522fa872a4e9a1be6:cf7a16daaa5962e1da39cbbb1392de14$" + } +} diff --git a/public/images/pokemon/back/384-mega.png b/public/images/pokemon/back/384-mega.png new file mode 100644 index 000000000..24743087b Binary files /dev/null and b/public/images/pokemon/back/384-mega.png differ diff --git a/public/images/pokemon/back/shiny/384-mega.json b/public/images/pokemon/back/shiny/384-mega.json new file mode 100644 index 000000000..779f8fcf6 --- /dev/null +++ b/public/images/pokemon/back/shiny/384-mega.json @@ -0,0 +1,41 @@ +{ + "textures": [ + { + "image": "384-mega.png", + "format": "RGBA8888", + "size": { + "w": 96, + "h": 96 + }, + "scale": 1, + "frames": [ + { + "filename": "0001.png", + "rotated": false, + "trimmed": false, + "sourceSize": { + "w": 96, + "h": 96 + }, + "spriteSourceSize": { + "x": 0, + "y": 0, + "w": 96, + "h": 96 + }, + "frame": { + "x": 0, + "y": 0, + "w": 96, + "h": 96 + } + } + ] + } + ], + "meta": { + "app": "https://www.codeandweb.com/texturepacker", + "version": "3.0", + "smartupdate": "$TexturePacker:SmartUpdate:3d06b3a8aabe77748c6fd866e165d0fc:0f452ac0571c863522fa872a4e9a1be6:cf7a16daaa5962e1da39cbbb1392de14$" + } +} diff --git a/public/images/pokemon/back/shiny/384-mega.png b/public/images/pokemon/back/shiny/384-mega.png new file mode 100644 index 000000000..074c78104 Binary files /dev/null and b/public/images/pokemon/back/shiny/384-mega.png differ diff --git a/public/images/pokemon/shiny/384-mega.json b/public/images/pokemon/shiny/384-mega.json new file mode 100644 index 000000000..bfea79820 --- /dev/null +++ b/public/images/pokemon/shiny/384-mega.json @@ -0,0 +1,41 @@ +{ + "textures": [ + { + "image": "384-mega.png", + "format": "RGBA8888", + "size": { + "w": 96, + "h": 96 + }, + "scale": 1, + "frames": [ + { + "filename": "0001.png", + "rotated": false, + "trimmed": false, + "sourceSize": { + "w": 96, + "h": 96 + }, + "spriteSourceSize": { + "x": 0, + "y": 0, + "w": 96, + "h": 96 + }, + "frame": { + "x": 0, + "y": 0, + "w": 96, + "h": 96 + } + } + ] + } + ], + "meta": { + "app": "https://www.codeandweb.com/texturepacker", + "version": "3.0", + "smartupdate": "$TexturePacker:SmartUpdate:430b196156dce7e35efeb616df2afbb1:f04557de6b8b7c9f59e02ae300538366:cf7a16daaa5962e1da39cbbb1392de14$" + } +} diff --git a/public/images/pokemon/shiny/384-mega.png b/public/images/pokemon/shiny/384-mega.png new file mode 100644 index 000000000..4c4a730ae Binary files /dev/null and b/public/images/pokemon/shiny/384-mega.png differ diff --git a/src/battle-scene.ts b/src/battle-scene.ts index 1f9ed1f14..2151e5ccd 100644 --- a/src/battle-scene.ts +++ b/src/battle-scene.ts @@ -1,7 +1,7 @@ import Phaser from 'phaser'; import { Biome } from './data/biome'; import UI from './ui/ui'; -import { EncounterPhase, SummonPhase, NextEncounterPhase, NewBiomeEncounterPhase, SelectBiomePhase, MessagePhase, CheckLoadPhase, TurnInitPhase, ReturnPhase, ToggleDoublePositionPhase, CheckSwitchPhase, LevelCapPhase, TestMessagePhase, ShowTrainerPhase, PartyHealPhase } from './battle-phases'; +import { EncounterPhase, SummonPhase, NextEncounterPhase, NewBiomeEncounterPhase, SelectBiomePhase, MessagePhase, CheckLoadPhase, TurnInitPhase, ReturnPhase, ToggleDoublePositionPhase, CheckSwitchPhase, LevelCapPhase, TestMessagePhase, ShowTrainerPhase } from './battle-phases'; import Pokemon, { PlayerPokemon, EnemyPokemon } from './pokemon'; import PokemonSpecies, { PokemonSpeciesFilter, allSpecies, getPokemonSpecies, initSpecies } from './data/pokemon-species'; import * as Utils from './utils'; diff --git a/src/data/ability.ts b/src/data/ability.ts index be9df8af1..85f3e35d3 100644 --- a/src/data/ability.ts +++ b/src/data/ability.ts @@ -1184,6 +1184,7 @@ export enum Abilities { DARK_AURA, FAIRY_AURA, PROTEAN, + DELTA_STREAM, SLUSH_RUSH, NEUTRALIZING_GAS } @@ -1439,6 +1440,8 @@ export function initAbilities() { new Ability(Abilities.DARK_AURA, "Dark Aura (N)", "Raises power of DARK type moves for all Pokémon in battle.", 6), new Ability(Abilities.FAIRY_AURA, "Fairy Aura (N)", "Raises power of FAIRY type moves for all Pokémon in battle.", 6), new Ability(Abilities.PROTEAN, "Protean (N)", "Changes the Pokémon's type to its last used move.", 6), + new Ability(Abilities.DELTA_STREAM, "Delta Stream", "The Pokémon creates strong winds when it enters a battle.", 6) + .attr(PostSummonWeatherChangeAbAttr, WeatherType.STRONG_WINDS), new Ability(Abilities.SLUSH_RUSH, "Slush Rush (N)", "Boosts the Pokémon's Speed stat in a hailstorm.", 7), new Ability(Abilities.NEUTRALIZING_GAS, "Neutralizing Gas (N)", "Neutralizes abilities of all Pokémon in battle.", 8) ); diff --git a/src/data/pokemon-species.ts b/src/data/pokemon-species.ts index d440ac851..9209864b4 100644 --- a/src/data/pokemon-species.ts +++ b/src/data/pokemon-species.ts @@ -139,9 +139,17 @@ export abstract class PokemonSpeciesForm { return `pkmn_icon__${this.getIconId(female, formIndex)}`; } + getCryKey(formIndex?: integer): string { + let ret = this.speciesId.toString(); + const forms = getPokemonSpecies(this.speciesId).forms; + if (forms.length && forms[formIndex || 0].formKey === 'mega') + ret += '-mega'; + return ret; + } + loadAssets(scene: BattleScene, female: boolean, formIndex?: integer, shiny?: boolean, startLoad?: boolean): Promise { return new Promise(resolve => { - scene.load.audio(this.speciesId.toString(), `audio/cry/${this.speciesId}.mp3`); + scene.load.audio(this.speciesId.toString(), `audio/cry/${this.getCryKey(formIndex)}.mp3`); scene.loadAtlas(this.getSpriteKey(female, formIndex, shiny), 'pokemon', this.getSpriteAtlasPath(female, formIndex, shiny)); scene.load.once(Phaser.Loader.Events.COMPLETE, () => { const originalWarn = console.warn; @@ -769,7 +777,10 @@ export function initSpecies() { new PokemonSpecies(Species.LATIOS, "Latios", 3, true, false, false, "Eon Pokémon", Type.DRAGON, Type.PSYCHIC, 2, 60, Abilities.LEVITATE, Abilities.NONE, Abilities.NONE, 600, 80, 90, 80, 130, 110, 110, 3, 90, 270, GrowthRate.SLOW, "Undiscovered", null, 100, 120, false), new PokemonSpecies(Species.KYOGRE, "Kyogre", 3, false, true, false, "Sea Basin Pokémon", Type.WATER, null, 4.5, 352, Abilities.DRIZZLE, Abilities.NONE, Abilities.NONE, 670, 100, 100, 90, 150, 140, 90, 3, 0, 302, GrowthRate.SLOW, "Undiscovered", null, null, 120, false), new PokemonSpecies(Species.GROUDON, "Groudon", 3, false, true, false, "Continent Pokémon", Type.GROUND, null, 3.5, 950, Abilities.DROUGHT, Abilities.NONE, Abilities.NONE, 670, 100, 150, 140, 100, 90, 90, 3, 0, 302, GrowthRate.SLOW, "Undiscovered", null, null, 120, false), - new PokemonSpecies(Species.RAYQUAZA, "Rayquaza", 3, false, true, false, "Sky High Pokémon", Type.DRAGON, Type.FLYING, 7, 206.5, Abilities.AIR_LOCK, Abilities.NONE, Abilities.NONE, 680, 105, 150, 90, 150, 90, 95, 45, 0, 306, GrowthRate.SLOW, "Undiscovered", null, null, 120, false), + new PokemonSpecies(Species.RAYQUAZA, "Rayquaza", 3, false, true, false, "Sky High Pokémon", Type.DRAGON, Type.FLYING, 7, 206.5, Abilities.AIR_LOCK, Abilities.NONE, Abilities.NONE, 680, 105, 150, 90, 150, 90, 95, 45, 0, 306, GrowthRate.SLOW, "Undiscovered", null, null, 120, false, false, + new PokemonForm("Normal", "", Type.DRAGON, Type.FLYING, 7, 206.5, Abilities.AIR_LOCK, Abilities.NONE, Abilities.NONE, 680, 105, 150, 90, 150, 90, 95, 45, 0, 306, GrowthRate.SLOW, "Undiscovered", null, null, 120, false), + new PokemonForm("Mega", "mega", Type.DRAGON, Type.FLYING, 7, 206.5, Abilities.DELTA_STREAM, Abilities.NONE, Abilities.NONE, 780, 105, 180, 100, 180, 100, 115, 45, 0, 306, GrowthRate.SLOW, "Undiscovered", null, null, 120, false) + ), new PokemonSpecies(Species.JIRACHI, "Jirachi", 3, false, false, true, "Wish Pokémon", Type.STEEL, Type.PSYCHIC, 0.3, 1.1, Abilities.SERENE_GRACE, Abilities.NONE, Abilities.NONE, 600, 100, 100, 100, 100, 100, 100, 3, 100, 270, GrowthRate.SLOW, "Undiscovered", null, null, 120, false), new PokemonSpecies(Species.DEOXYS, "Deoxys", 3, false, false, true, "DNA Pokémon", Type.PSYCHIC, null, 1.7, 60.8, Abilities.PRESSURE, Abilities.NONE, Abilities.NONE, 600, 50, 150, 50, 150, 50, 150, 3, 0, 270, GrowthRate.SLOW, "Undiscovered", null, null, 120, false, true, new PokemonForm("Normal Forme", "normal", Type.PSYCHIC, null, 1.7, 60.8, Abilities.PRESSURE, Abilities.NONE, Abilities.NONE, 600, 50, 150, 50, 150, 50, 150, 3, 0, 270, GrowthRate.SLOW, "Undiscovered", null, null, 120, false), diff --git a/src/data/trainer-type.ts b/src/data/trainer-type.ts index fe99a24f6..99d6d057c 100644 --- a/src/data/trainer-type.ts +++ b/src/data/trainer-type.ts @@ -724,5 +724,5 @@ export const trainerConfigs: TrainerConfigs = { .setPartyMemberFunc(1, getRandomPartyMemberFunc([ Species.PIDGEOT, Species.NOCTOWL, Species.SWELLOW, Species.STARAPTOR, Species.UNFEZANT ])) .setPartyMemberFunc(2, getSpeciesFilterRandomPartyMemberFunc((species: PokemonSpecies) => !pokemonEvolutions.hasOwnProperty(species.speciesId) && !pokemonPrevolutions.hasOwnProperty(species.speciesId) && species.baseTotal >= 450)) .setSpeciesFilter(species => species.baseTotal >= 540) - .setPartyMemberFunc(5, getRandomPartyMemberFunc([ Species.RAYQUAZA ])), + .setPartyMemberFunc(5, getRandomPartyMemberFunc([ Species.RAYQUAZA ], p => p.formIndex = 1)), } \ No newline at end of file diff --git a/src/pokemon.ts b/src/pokemon.ts index c749e4bff..5ee8fb964 100644 --- a/src/pokemon.ts +++ b/src/pokemon.ts @@ -435,7 +435,7 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container { getAbility(): Ability { if (ABILITY_OVERRIDE && this.isPlayer()) return abilities[ABILITY_OVERRIDE]; - return abilities[this.species.getAbility(this.abilityIndex)]; + return abilities[this.getSpeciesForm().getAbility(this.abilityIndex)]; } canApplyAbility(): boolean { @@ -1124,7 +1124,7 @@ export class PlayerPokemon extends Pokemon { this.handleSpecialEvolutions(evolution); this.species = getPokemonSpecies(evolution.speciesId); this.name = this.species.name; - const abilityCount = this.species.getAbilityCount(); + const abilityCount = this.getSpeciesForm().getAbilityCount(); if (this.abilityIndex >= abilityCount) // Shouldn't happen this.abilityIndex = abilityCount - 1; this.getSpeciesForm().generateIconAnim(this.scene, this.gender === Gender.FEMALE, this.formIndex);