diff --git a/src/data/dialogue.ts b/src/data/dialogue.ts index e54196d9e25..8d1be662f73 100644 --- a/src/data/dialogue.ts +++ b/src/data/dialogue.ts @@ -909,7 +909,8 @@ export const trainerTypeDialogue = { }, [TrainerType.MORTY]: { encounter: [ - `With a little more, I could see a future in which I meet the legendary Pokémon. You're going to help me reach that level!`, + `With a little more, I could see a future in which I meet the legendary Pokémon. + $You're going to help me reach that level!`, `It's said that a rainbow-hued Pokémon will come down to appear before a truly powerful Trainer. $I believed that tale, so I have secretly trained here all my life. As a result, I can now see what others cannot. $I see a shadow of the person who will make the Pokémon appear. @@ -924,7 +925,8 @@ export const trainerTypeDialogue = { `I see… Your journey has taken you to far-away places and you have witnessed much more than I. $I envy you for that…`, `How is this possible…`, - `I don't think our potentials are so different. But you seem to have something more than that… So be it.`, + `I don't think our potentials are so different. + $But you seem to have something more than that… So be it.`, `Guess I need more training.`, `That's a shame.` ], diff --git a/src/field/trainer.ts b/src/field/trainer.ts index faa691406b9..60497239488 100644 --- a/src/field/trainer.ts +++ b/src/field/trainer.ts @@ -370,6 +370,34 @@ export default class Trainer extends Phaser.GameObjects.Container { this.getTintSprites().map((tintSprite, i) => tintSprite.setTexture(this.getKey(!!i)).setFrame(0)); } + /** + * Attempts to animate a given set of {@linkcode Phaser.GameObjects.Sprite} + * @see {@linkcode Phaser.GameObjects.Sprite.play} + * @param sprite {@linkcode Phaser.GameObjects.Sprite} to animate + * @param tintSprite {@linkcode Phaser.GameObjects.Sprite} placed on top of the sprite to add a color tint + * @param animConfig {@linkcode Phaser.Types.Animations.PlayAnimationConfig} to pass to {@linkcode Phaser.GameObjects.Sprite.play} + * @returns true if the sprite was able to be animated + */ + tryPlaySprite(sprite: Phaser.GameObjects.Sprite, tintSprite: Phaser.GameObjects.Sprite, animConfig: Phaser.Types.Animations.PlayAnimationConfig): boolean { + // Show an error in the console if there isn't a texture loaded + if (sprite.texture.key === '__MISSING') { + console.error(`No texture found for '${animConfig.key}'!`); + + return false; + } + // Don't try to play an animation when there isn't one + if (sprite.texture.frameTotal <= 1) { + console.warn(`No animation found for '${animConfig.key}'. Is this intentional?`); + + return false; + } + + sprite.play(animConfig); + tintSprite.play(animConfig); + + return true; + } + playAnim(): void { const trainerAnimConfig = { key: this.getKey(), @@ -379,14 +407,9 @@ export default class Trainer extends Phaser.GameObjects.Container { const sprites = this.getSprites(); const tintSprites = this.getTintSprites(); - // Don't try to play an animation when there isn't one - if (sprites.length > 1) { - sprites[0].play(trainerAnimConfig); - tintSprites[0].play(trainerAnimConfig); - } - else - console.warn(`No animation found for '${this.getKey()}'. Is this intentional?`); + this.tryPlaySprite(sprites[0], tintSprites[0], trainerAnimConfig); + // Queue an animation for the second trainer if this is a double battle against two separate trainers if (this.variant === TrainerVariant.DOUBLE && !this.config.doubleOnly) { const partnerTrainerAnimConfig = { key: this.getKey(true), @@ -394,13 +417,7 @@ export default class Trainer extends Phaser.GameObjects.Container { startFrame: 0 }; - // Don't try to play an animation when there isn't one - if (sprites.length > 1) { - sprites[1].play(partnerTrainerAnimConfig); - tintSprites[1].play(partnerTrainerAnimConfig); - } - else - console.warn(`No animation found for '${this.getKey()}'. Is this intentional?`); + this.tryPlaySprite(sprites[1], tintSprites[1], partnerTrainerAnimConfig); } } diff --git a/src/locales/it/battle.ts b/src/locales/it/battle.ts index 3eff2493ed6..c9cf46554c0 100644 --- a/src/locales/it/battle.ts +++ b/src/locales/it/battle.ts @@ -23,16 +23,16 @@ export const battle: SimpleTranslationEntries = { "attackFailed": "Ma ha fallito!", "attackHitsCount": `Colpito {{count}} volta/e!`, "expGain": "{{pokemonName}} ha guadagnato\n{{exp}} Punti Esperienza!", - "levelUp": "{{pokemonName}} è salito al \nlivello {{level}}!", - "learnMove": "{{pokemonName}} impara \n{{moveName}}!", + "levelUp": "{{pokemonName}} è salito al\nlivello {{level}}!", + "learnMove": "{{pokemonName}} impara\n{{moveName}}!", "learnMovePrompt": "{{pokemonName}} vorrebbe imparare\n{{moveName}}.", - "learnMoveLimitReached": "Tuttavia, {{pokemonName}} \nconosce già quattro mosse.", - "learnMoveReplaceQuestion": "Vuoi che ne dimentichi una e al suo \nposto la sostituisca con {{moveName}}?", - "learnMoveStopTeaching": "Vuoi smettere di fargli imparare \n{{moveName}}?", + "learnMoveLimitReached": "Tuttavia, {{pokemonName}}\nconosce già quattro mosse.", + "learnMoveReplaceQuestion": "Vuoi che ne dimentichi una e al suo\nposto apprenda {{moveName}}?", + "learnMoveStopTeaching": "Vuoi smettere di fargli imparare\n{{moveName}}?", "learnMoveNotLearned": "{{pokemonName}} non ha imparato\n{{moveName}}.", "learnMoveForgetQuestion": "Quale mossa deve dimenticare?", "learnMoveForgetSuccess": "{{pokemonName}} ha dimenticato la mossa\n{{moveName}}.", - "countdownPoof": "@d{32}1, @d{15}2, @d{15}e@d{15}… @d{15}… @d{15}… @d{15}@s{pb_bounce_1}Puff!", + "countdownPoof": "@d{32}1, @d{15}2, @d{15}e@d{15}… @d{15}… @d{15}… @d{15}@s{pb_bounce_1}ta-daaaa!", "learnMoveAnd": "E…", "levelCapUp": "Il livello massimo\nè aumentato a {{levelCap}}!", "moveNotImplemented": "{{moveName}} non è ancora implementata e non può essere selezionata.", @@ -51,6 +51,6 @@ export const battle: SimpleTranslationEntries = { "escapeVerbFlee": "fuggendo", "notDisabled": "{{pokemonName}}'s {{moveName}} non è più\ndisabilitata!", "skipItemQuestion": "Sei sicuro di non voler prendere nessun oggetto?", - "eggHatching": "Oh?", + "eggHatching": "Oh!", "ivScannerUseQuestion": "Vuoi usare lo scanner di IV su {{pokemonName}}?" } as const; \ No newline at end of file diff --git a/src/locales/pt_BR/pokeball.ts b/src/locales/pt_BR/pokeball.ts index c93af437ba2..75d81ebde03 100644 --- a/src/locales/pt_BR/pokeball.ts +++ b/src/locales/pt_BR/pokeball.ts @@ -5,6 +5,6 @@ export const pokeball: SimpleTranslationEntries = { "greatBall": "Grande Bola", "ultraBall": "Ultra Bola", "rogueBall": "Bola Rogue", - "masterBall": "Bole Mestra", + "masterBall": "Bola Mestra", "luxuryBall": "Bola Luxo", } as const; \ No newline at end of file