diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md index 3e6b8bf6d0d..a30cb642a46 100644 --- a/.github/pull_request_template.md +++ b/.github/pull_request_template.md @@ -30,7 +30,7 @@ - [ ] The PR is self-contained and cannot be split into smaller PRs? - [ ] Have I provided a clear explanation of the changes? - [ ] Have I considered writing automated tests for the issue? -- [ ] If I have text, did I add make it translatable and added a key in the English language? +- [ ] If I have text, did I make it translatable and add a key in the English locale file(s)? - [ ] Have I tested the changes (manually)? - [ ] Are all unit tests still passing? (`npm run test`) - [ ] Are the changes visual? diff --git a/index.css b/index.css index 8034c1a4b38..abf4f9f708c 100644 --- a/index.css +++ b/index.css @@ -148,10 +148,10 @@ input:-internal-autofill-selected { /* Show cycle buttons only on STARTER_SELECT and on touch configuration panel */ #touchControls:not(.config-mode):not([data-ui-mode='STARTER_SELECT']) #apadOpenFilters, -#touchControls:not(.config-mode):not([data-ui-mode='STARTER_SELECT']) #apadCycleForm, -#touchControls:not(.config-mode):not([data-ui-mode='STARTER_SELECT']) #apadCycleShiny, +#touchControls:not(.config-mode):not([data-ui-mode='STARTER_SELECT'], [data-ui-mode='RUN_INFO']) #apadCycleForm, +#touchControls:not(.config-mode):not([data-ui-mode='STARTER_SELECT'], [data-ui-mode='RUN_INFO']) #apadCycleShiny, #touchControls:not(.config-mode):not([data-ui-mode='STARTER_SELECT']) #apadCycleNature, -#touchControls:not(.config-mode):not([data-ui-mode='STARTER_SELECT']) #apadCycleAbility, +#touchControls:not(.config-mode):not([data-ui-mode='STARTER_SELECT'], [data-ui-mode='RUN_INFO']) #apadCycleAbility, #touchControls:not(.config-mode):not([data-ui-mode='STARTER_SELECT']) #apadCycleGender, #touchControls:not(.config-mode):not([data-ui-mode='STARTER_SELECT']) #apadCycleVariant { display: none; diff --git a/public/images/events/september-update-de.png b/public/images/events/september-update-de.png new file mode 100644 index 00000000000..1ecb46e408c Binary files /dev/null and b/public/images/events/september-update-de.png differ diff --git a/public/images/events/september-update-en.png b/public/images/events/september-update-en.png new file mode 100644 index 00000000000..57dd130b98d Binary files /dev/null and b/public/images/events/september-update-en.png differ diff --git a/public/images/events/september-update-es.png b/public/images/events/september-update-es.png new file mode 100644 index 00000000000..8c294d21403 Binary files /dev/null and b/public/images/events/september-update-es.png differ diff --git a/public/images/events/september-update-fr.png b/public/images/events/september-update-fr.png new file mode 100644 index 00000000000..4be33c85e9a Binary files /dev/null and b/public/images/events/september-update-fr.png differ diff --git a/public/images/events/september-update-it.png b/public/images/events/september-update-it.png new file mode 100644 index 00000000000..62542f4eb9b Binary files /dev/null and b/public/images/events/september-update-it.png differ diff --git a/public/images/events/september-update-ja.png b/public/images/events/september-update-ja.png new file mode 100644 index 00000000000..93e18c51223 Binary files /dev/null and b/public/images/events/september-update-ja.png differ diff --git a/public/images/events/september-update-ko.png b/public/images/events/september-update-ko.png new file mode 100644 index 00000000000..13585327fce Binary files /dev/null and b/public/images/events/september-update-ko.png differ diff --git a/public/images/events/september-update-pt_BR.png b/public/images/events/september-update-pt_BR.png new file mode 100644 index 00000000000..8dd8b8759e9 Binary files /dev/null and b/public/images/events/september-update-pt_BR.png differ diff --git a/public/images/events/september-update-zh_CN.png b/public/images/events/september-update-zh_CN.png new file mode 100644 index 00000000000..ee56d644d24 Binary files /dev/null and b/public/images/events/september-update-zh_CN.png differ diff --git a/public/images/pokemon/exp/shiny/1002b.png b/public/images/pokemon/exp/shiny/1002b.png deleted file mode 100644 index 85dfb1c4bd6..00000000000 Binary files a/public/images/pokemon/exp/shiny/1002b.png and /dev/null differ diff --git a/public/images/pokemon/exp/shiny/1002s.png b/public/images/pokemon/exp/shiny/1002s.png deleted file mode 100644 index 835b3dcd73b..00000000000 Binary files a/public/images/pokemon/exp/shiny/1002s.png and /dev/null differ diff --git a/public/images/pokemon/exp/shiny/1002sb.png b/public/images/pokemon/exp/shiny/1002sb.png deleted file mode 100644 index f87e2fc4239..00000000000 Binary files a/public/images/pokemon/exp/shiny/1002sb.png and /dev/null differ diff --git a/src/data/ability.ts b/src/data/ability.ts index 8b7a7772efe..4d3d32e22fa 100644 --- a/src/data/ability.ts +++ b/src/data/ability.ts @@ -8,7 +8,7 @@ import { Weather, WeatherType } from "./weather"; import { BattlerTag, GroundedTag, GulpMissileTag, SemiInvulnerableTag } from "./battler-tags"; import { StatusEffect, getNonVolatileStatusEffects, getStatusEffectDescriptor, getStatusEffectHealText } from "./status-effect"; import { Gender } from "./gender"; -import Move, { AttackMove, MoveCategory, MoveFlags, MoveTarget, FlinchAttr, OneHitKOAttr, HitHealAttr, allMoves, StatusMove, SelfStatusMove, VariablePowerAttr, applyMoveAttrs, IncrementMovePriorityAttr, VariableMoveTypeAttr, RandomMovesetMoveAttr, RandomMoveAttr, NaturePowerAttr, CopyMoveAttr, MoveAttr, MultiHitAttr, ChargeAttr, SacrificialAttr, SacrificialAttrOnHit, NeutralDamageAgainstFlyingTypeMultiplierAttr } from "./move"; +import Move, { AttackMove, MoveCategory, MoveFlags, MoveTarget, FlinchAttr, OneHitKOAttr, HitHealAttr, allMoves, StatusMove, SelfStatusMove, VariablePowerAttr, applyMoveAttrs, IncrementMovePriorityAttr, VariableMoveTypeAttr, RandomMovesetMoveAttr, RandomMoveAttr, NaturePowerAttr, CopyMoveAttr, MoveAttr, MultiHitAttr, ChargeAttr, SacrificialAttr, SacrificialAttrOnHit, NeutralDamageAgainstFlyingTypeMultiplierAttr, FixedDamageAttr } from "./move"; import { ArenaTagSide, ArenaTrapTag } from "./arena-tag"; import { Stat, getStatName } from "./pokemon-stat"; import { BerryModifier, PokemonHeldItemModifier } from "../modifier/modifier"; @@ -475,6 +475,47 @@ export class NonSuperEffectiveImmunityAbAttr extends TypeImmunityAbAttr { } } +/** + * Attribute implementing the effects of {@link https://bulbapedia.bulbagarden.net/wiki/Tera_Shell_(Ability) | Tera Shell} + * When the source is at full HP, incoming attacks will have a maximum 0.5x type effectiveness multiplier. + * @extends PreDefendAbAttr + */ +export class FullHpResistTypeAbAttr extends PreDefendAbAttr { + /** + * Reduces a type multiplier to 0.5 if the source is at full HP. + * @param pokemon {@linkcode Pokemon} the Pokemon with this ability + * @param passive n/a + * @param simulated n/a (this doesn't change game state) + * @param attacker n/a + * @param move {@linkcode Move} the move being used on the source + * @param cancelled n/a + * @param args `[0]` a container for the move's current type effectiveness multiplier + * @returns `true` if the move's effectiveness is reduced; `false` otherwise + */ + applyPreDefend(pokemon: Pokemon, passive: boolean, simulated: boolean, attacker: Pokemon, move: Move | null, cancelled: Utils.BooleanHolder | null, args: any[]): boolean | Promise { + const typeMultiplier = args[0]; + if (!(typeMultiplier && typeMultiplier instanceof Utils.NumberHolder)) { + return false; + } + + if (move && move.hasAttr(FixedDamageAttr)) { + return false; + } + + if (pokemon.isFullHp() && typeMultiplier.value > 0.5) { + typeMultiplier.value = 0.5; + return true; + } + return false; + } + + getTriggerMessage(pokemon: Pokemon, abilityName: string, ...args: any[]): string { + return i18next.t("abilityTriggers:fullHpResistType", { + pokemonNameWithAffix: getPokemonNameWithAffix(pokemon) + }); + } +} + export class PostDefendAbAttr extends AbAttr { applyPostDefend(pokemon: Pokemon, passive: boolean, simulated: boolean, attacker: Pokemon, move: Move, hitResult: HitResult | null, args: any[]): boolean | Promise { return false; @@ -2387,7 +2428,7 @@ export class PostSummonWeatherSuppressedFormChangeAbAttr extends PostSummonAbAtt /** * Triggers weather-based form change when summoned into an active weather. - * Used by Forecast. + * Used by Forecast and Flower Gift. * @extends PostSummonAbAttr */ export class PostSummonFormChangeByWeatherAbAttr extends PostSummonAbAttr { @@ -2410,7 +2451,10 @@ export class PostSummonFormChangeByWeatherAbAttr extends PostSummonAbAttr { * @returns whether the form change was triggered */ applyPostSummon(pokemon: Pokemon, passive: boolean, simulated: boolean, args: any[]): boolean { - if (pokemon.species.speciesId === Species.CASTFORM && this.ability === Abilities.FORECAST) { + const isCastformWithForecast = (pokemon.species.speciesId === Species.CASTFORM && this.ability === Abilities.FORECAST); + const isCherrimWithFlowerGift = (pokemon.species.speciesId === Species.CHERRIM && this.ability === Abilities.FLOWER_GIFT); + + if (isCastformWithForecast || isCherrimWithFlowerGift) { if (simulated) { return simulated; } @@ -3083,37 +3127,41 @@ export class PostWeatherChangeAbAttr extends AbAttr { /** * Triggers weather-based form change when weather changes. - * Used by Forecast. + * Used by Forecast and Flower Gift. * @extends PostWeatherChangeAbAttr */ export class PostWeatherChangeFormChangeAbAttr extends PostWeatherChangeAbAttr { private ability: Abilities; + private formRevertingWeathers: WeatherType[]; - constructor(ability: Abilities) { + constructor(ability: Abilities, formRevertingWeathers: WeatherType[]) { super(false); this.ability = ability; + this.formRevertingWeathers = formRevertingWeathers; } /** * Calls {@linkcode Arena.triggerWeatherBasedFormChangesToNormal | triggerWeatherBasedFormChangesToNormal} when the * weather changed to form-reverting weather, otherwise calls {@linkcode Arena.triggerWeatherBasedFormChanges | triggerWeatherBasedFormChanges} - * @param {Pokemon} pokemon the Pokemon that changed the weather + * @param {Pokemon} pokemon the Pokemon with this ability * @param passive n/a * @param weather n/a * @param args n/a * @returns whether the form change was triggered */ applyPostWeatherChange(pokemon: Pokemon, passive: boolean, simulated: boolean, weather: WeatherType, args: any[]): boolean { - if (pokemon.species.speciesId === Species.CASTFORM && this.ability === Abilities.FORECAST) { + const isCastformWithForecast = (pokemon.species.speciesId === Species.CASTFORM && this.ability === Abilities.FORECAST); + const isCherrimWithFlowerGift = (pokemon.species.speciesId === Species.CHERRIM && this.ability === Abilities.FLOWER_GIFT); + + if (isCastformWithForecast || isCherrimWithFlowerGift) { if (simulated) { return simulated; } - const formRevertingWeathers: WeatherType[] = [ WeatherType.NONE, WeatherType.SANDSTORM, WeatherType.STRONG_WINDS, WeatherType.FOG ]; const weatherType = pokemon.scene.arena.weather?.weatherType; - if (weatherType && formRevertingWeathers.includes(weatherType)) { + if (weatherType && this.formRevertingWeathers.includes(weatherType)) { pokemon.scene.arena.triggerWeatherBasedFormChangesToNormal(); } else { pokemon.scene.arena.triggerWeatherBasedFormChanges(); @@ -4703,7 +4751,8 @@ function setAbilityRevealed(pokemon: Pokemon): void { */ function getPokemonWithWeatherBasedForms(scene: BattleScene) { return scene.getField(true).filter(p => - p.hasAbility(Abilities.FORECAST) && p.species.speciesId === Species.CASTFORM + (p.hasAbility(Abilities.FORECAST) && p.species.speciesId === Species.CASTFORM) + || (p.hasAbility(Abilities.FLOWER_GIFT) && p.species.speciesId === Species.CHERRIM) ); } @@ -4902,7 +4951,7 @@ export function initAbilities() { .attr(UncopiableAbilityAbAttr) .attr(NoFusionAbilityAbAttr) .attr(PostSummonFormChangeByWeatherAbAttr, Abilities.FORECAST) - .attr(PostWeatherChangeFormChangeAbAttr, Abilities.FORECAST), + .attr(PostWeatherChangeFormChangeAbAttr, Abilities.FORECAST, [ WeatherType.NONE, WeatherType.SANDSTORM, WeatherType.STRONG_WINDS, WeatherType.FOG ]), new Ability(Abilities.STICKY_HOLD, 3) .attr(BlockItemTheftAbAttr) .bypassFaint() @@ -5025,7 +5074,7 @@ export function initAbilities() { .attr(AlwaysHitAbAttr) .attr(DoubleBattleChanceAbAttr), new Ability(Abilities.STALL, 4) - .attr(ChangeMovePriorityAbAttr, (pokemon, move: Move) => true, -0.5), + .attr(ChangeMovePriorityAbAttr, (pokemon, move: Move) => true, -0.2), new Ability(Abilities.TECHNICIAN, 4) .attr(MovePowerBoostAbAttr, (user, target, move) => { const power = new Utils.NumberHolder(move.power); @@ -5095,8 +5144,10 @@ export function initAbilities() { .conditionalAttr(getWeatherCondition(WeatherType.SUNNY || WeatherType.HARSH_SUN), BattleStatMultiplierAbAttr, BattleStat.SPDEF, 1.5) .attr(UncopiableAbilityAbAttr) .attr(NoFusionAbilityAbAttr) - .ignorable() - .partial(), + .attr(PostSummonFormChangeByWeatherAbAttr, Abilities.FLOWER_GIFT) + .attr(PostWeatherChangeFormChangeAbAttr, Abilities.FLOWER_GIFT, [ WeatherType.NONE, WeatherType.SANDSTORM, WeatherType.STRONG_WINDS, WeatherType.FOG, WeatherType.HAIL, WeatherType.HEAVY_RAIN, WeatherType.SNOW, WeatherType.RAIN ]) + .partial() // Should also boosts stats of ally + .ignorable(), new Ability(Abilities.BAD_DREAMS, 4) .attr(PostTurnHurtIfSleepingAbAttr), new Ability(Abilities.PICKPOCKET, 5) @@ -5713,7 +5764,7 @@ export function initAbilities() { .partial() // Healing not blocked by Heal Block .ignorable(), new Ability(Abilities.MYCELIUM_MIGHT, 9) - .attr(ChangeMovePriorityAbAttr, (pokemon, move) => move.category === MoveCategory.STATUS, -0.5) + .attr(ChangeMovePriorityAbAttr, (pokemon, move) => move.category === MoveCategory.STATUS, -0.2) .attr(PreventBypassSpeedChanceAbAttr, (pokemon, move) => move.category === MoveCategory.STATUS) .attr(MoveAbilityBypassAbAttr, (pokemon, move: Move) => move.category === MoveCategory.STATUS), new Ability(Abilities.MINDS_EYE, 9) @@ -5761,10 +5812,10 @@ export function initAbilities() { .attr(NoTransformAbilityAbAttr) .attr(NoFusionAbilityAbAttr), new Ability(Abilities.TERA_SHELL, 9) + .attr(FullHpResistTypeAbAttr) .attr(UncopiableAbilityAbAttr) .attr(UnswappableAbilityAbAttr) - .ignorable() - .unimplemented(), + .ignorable(), new Ability(Abilities.TERAFORM_ZERO, 9) .attr(UncopiableAbilityAbAttr) .attr(UnswappableAbilityAbAttr) diff --git a/src/data/battle-anims.ts b/src/data/battle-anims.ts index a2f6e41f4ae..da4e7f6a33b 100644 --- a/src/data/battle-anims.ts +++ b/src/data/battle-anims.ts @@ -788,10 +788,10 @@ export abstract class BattleAnim { targetSprite.pipelineData["tone"] = [ 0.0, 0.0, 0.0, 0.0 ]; targetSprite.setAngle(0); if (!this.isHideUser() && userSprite) { - userSprite.setVisible(true); + this.user?.getSprite().setVisible(true); // using this.user to fix context loss due to isOppAnim swap (#481) } if (!this.isHideTarget() && (targetSprite !== userSprite || !this.isHideUser())) { - targetSprite.setVisible(true); + this.target?.getSprite().setVisible(true); // using this.target to fix context loss due to isOppAnim swap (#481) } for (const ms of Object.values(spriteCache).flat()) { if (ms) { diff --git a/src/data/battler-tags.ts b/src/data/battler-tags.ts index f4203459c82..2e280634d5d 100644 --- a/src/data/battler-tags.ts +++ b/src/data/battler-tags.ts @@ -1524,6 +1524,25 @@ export class CritBoostTag extends BattlerTag { } } +/** + * Tag for the effects of Dragon Cheer, which boosts the critical hit ratio of the user's allies. + * @extends {CritBoostTag} + */ +export class DragonCheerTag extends CritBoostTag { + /** The types of the user's ally when the tag is added */ + public typesOnAdd: Type[]; + + constructor() { + super(BattlerTagType.CRIT_BOOST, Moves.DRAGON_CHEER); + } + + onAdd(pokemon: Pokemon): void { + super.onAdd(pokemon); + + this.typesOnAdd = pokemon.getTypes(true); + } +} + export class SaltCuredTag extends BattlerTag { private sourceIndex: number; @@ -1942,6 +1961,8 @@ export function getBattlerTag(tagType: BattlerTagType, turnCount: number, source return new TypeBoostTag(tagType, sourceMove, Type.FIRE, 1.5, false); case BattlerTagType.CRIT_BOOST: return new CritBoostTag(tagType, sourceMove); + case BattlerTagType.DRAGON_CHEER: + return new DragonCheerTag(); case BattlerTagType.ALWAYS_CRIT: case BattlerTagType.IGNORE_ACCURACY: return new BattlerTag(tagType, BattlerTagLapseType.TURN_END, 2, sourceMove); diff --git a/src/data/biomes.ts b/src/data/biomes.ts index 3879053b066..721231f9cb0 100644 --- a/src/data/biomes.ts +++ b/src/data/biomes.ts @@ -35,18 +35,18 @@ interface BiomeDepths { export const biomeLinks: BiomeLinks = { [Biome.TOWN]: Biome.PLAINS, [Biome.PLAINS]: [ Biome.GRASS, Biome.METROPOLIS, Biome.LAKE ], - [Biome.GRASS]: [ Biome.TALL_GRASS, [ Biome.CONSTRUCTION_SITE, 2 ] ], + [Biome.GRASS]: Biome.TALL_GRASS, [Biome.TALL_GRASS]: [ Biome.FOREST, Biome.CAVE ], - [Biome.SLUM]: Biome.CONSTRUCTION_SITE, + [Biome.SLUM]: [ Biome.CONSTRUCTION_SITE, [ Biome.SWAMP, 2 ] ], [Biome.FOREST]: [ Biome.JUNGLE, Biome.MEADOW ], [Biome.SEA]: [ Biome.SEABED, Biome.ICE_CAVE ], [Biome.SWAMP]: [ Biome.GRAVEYARD, Biome.TALL_GRASS ], - [Biome.BEACH]: [ Biome.SEA, [ Biome.ISLAND, 3 ] ], + [Biome.BEACH]: [ Biome.SEA, [ Biome.ISLAND, 2 ] ], [Biome.LAKE]: [ Biome.BEACH, Biome.SWAMP, Biome.CONSTRUCTION_SITE ], [Biome.SEABED]: [ Biome.CAVE, [ Biome.VOLCANO, 3 ] ], - [Biome.MOUNTAIN]: [ Biome.VOLCANO, [ Biome.DOJO, 2] [ Biome.WASTELAND, 2 ] ], + [Biome.MOUNTAIN]: [ Biome.VOLCANO, [ Biome.WASTELAND, 2 ], [ Biome.SPACE, 3 ] ], [Biome.BADLANDS]: [ Biome.DESERT, Biome.MOUNTAIN ], - [Biome.CAVE]: [ Biome.BADLANDS, Biome.LAKE ], + [Biome.CAVE]: [ Biome.BADLANDS, Biome.LAKE [ Biome.LABORATORY, 2 ] ], [Biome.DESERT]: [ Biome.RUINS, [ Biome.CONSTRUCTION_SITE, 2 ] ], [Biome.ICE_CAVE]: Biome.SNOWY_FOREST, [Biome.MEADOW]: [ Biome.PLAINS, Biome.FAIRY_CAVE ], @@ -54,17 +54,17 @@ export const biomeLinks: BiomeLinks = { [Biome.VOLCANO]: [ Biome.BEACH, [ Biome.ICE_CAVE, 3 ] ], [Biome.GRAVEYARD]: Biome.ABYSS, [Biome.DOJO]: [ Biome.PLAINS, [ Biome.JUNGLE, 2], [ Biome.TEMPLE, 2 ] ], - [Biome.FACTORY]: [ Biome.TALL_GRASS, [ Biome.LABORATORY, 3 ] ], - [Biome.RUINS]: [ Biome.FOREST ], + [Biome.FACTORY]: [ Biome.PLAINS, [ Biome.LABORATORY, 2 ] ], + [Biome.RUINS]: [ Biome.MOUNTAIN, [ Biome.FOREST, 2 ] ], [Biome.WASTELAND]: Biome.BADLANDS, - [Biome.ABYSS]: [ Biome.CAVE, [ Biome.SPACE, 3 ], [ Biome.WASTELAND, 3 ] ], + [Biome.ABYSS]: [ Biome.CAVE, [ Biome.SPACE, 2 ], [ Biome.WASTELAND, 2 ] ], [Biome.SPACE]: Biome.RUINS, [Biome.CONSTRUCTION_SITE]: [ Biome.POWER_PLANT, [ Biome.DOJO, 2 ] ], [Biome.JUNGLE]: [ Biome.TEMPLE ], [Biome.FAIRY_CAVE]: [ Biome.ICE_CAVE, [ Biome.SPACE, 2 ] ], [Biome.TEMPLE]: [ Biome.DESERT, [ Biome.SWAMP, 2 ], [ Biome.RUINS, 2 ] ], [Biome.METROPOLIS]: Biome.SLUM, - [Biome.SNOWY_FOREST]: [ Biome.FOREST, Biome.MOUNTAIN, [ Biome.LAKE, 2 ] ], + [Biome.SNOWY_FOREST]: [ Biome.FOREST, [ Biome.MOUNTAIN, 2 ], [ Biome.LAKE, 2 ] ], [Biome.ISLAND]: Biome.SEA, [Biome.LABORATORY]: Biome.CONSTRUCTION_SITE }; @@ -7666,7 +7666,7 @@ export function initBiomes() { if (biome === Biome.END) { const biomeList = Object.keys(Biome).filter(key => !isNaN(Number(key))); biomeList.pop(); // Removes Biome.END from the list - const randIndex = Utils.randInt(biomeList.length, 2); // Will never be Biome.TOWN or Biome.PLAINS + const randIndex = Utils.randInt(biomeList.length, 1); // Will never be Biome.TOWN biome = Biome[biomeList[randIndex]]; } const linkedBiomes: (Biome | [ Biome, integer ])[] = Array.isArray(biomeLinks[biome]) diff --git a/src/data/move.ts b/src/data/move.ts index f14bad4c805..3f87fc68b89 100644 --- a/src/data/move.ts +++ b/src/data/move.ts @@ -5888,9 +5888,9 @@ export class SwitchAbilitiesAttr extends MoveEffectAttr { target.summonData.ability = tempAbilityId; user.scene.queueMessage(i18next.t("moveTriggers:swappedAbilitiesWithTarget", {pokemonName: getPokemonNameWithAffix(user)})); - // Swaps Forecast from Castform + // Swaps Forecast/Flower Gift from Castform/Cherrim user.scene.arena.triggerWeatherBasedFormChangesToNormal(); - // Swaps Forecast to Castform (edge case) + // Swaps Forecast/Flower Gift to Castform/Cherrim (edge case) user.scene.arena.triggerWeatherBasedFormChanges(); return true; @@ -6037,6 +6037,57 @@ export class DestinyBondAttr extends MoveEffectAttr { } } +/** + * Attribute to apply a battler tag to the target if they have had their stats boosted this turn. + * @extends AddBattlerTagAttr + */ +export class AddBattlerTagIfBoostedAttr extends AddBattlerTagAttr { + constructor(tag: BattlerTagType) { + super(tag, false, false, 2, 5); + } + + /** + * @param user {@linkcode Pokemon} using this move + * @param target {@linkcode Pokemon} target of this move + * @param move {@linkcode Move} being used + * @param {any[]} args N/A + * @returns true + */ + apply(user: Pokemon, target: Pokemon, move: Move, args: any[]): boolean { + if (target.turnData.battleStatsIncreased) { + super.apply(user, target, move, args); + } + return true; + } +} + +/** + * Attribute to apply a status effect to the target if they have had their stats boosted this turn. + * @extends MoveEffectAttr + */ +export class StatusIfBoostedAttr extends MoveEffectAttr { + public effect: StatusEffect; + + constructor(effect: StatusEffect) { + super(true, MoveEffectTrigger.HIT); + this.effect = effect; + } + + /** + * @param user {@linkcode Pokemon} using this move + * @param target {@linkcode Pokemon} target of this move + * @param move {@linkcode Move} N/A + * @param {any[]} args N/A + * @returns true + */ + apply(user: Pokemon, target: Pokemon, move: Move, args: any[]): boolean { + if (target.turnData.battleStatsIncreased) { + target.trySetStatus(this.effect, true, user); + } + return true; + } +} + export class LastResortAttr extends MoveAttr { getCondition(): MoveConditionFunc { return (user: Pokemon, target: Pokemon, move: Move) => { @@ -8694,10 +8745,10 @@ export function initMoves() { new AttackMove(Moves.SKITTER_SMACK, Type.BUG, MoveCategory.PHYSICAL, 70, 90, 10, 100, 0, 8) .attr(StatChangeAttr, BattleStat.SPATK, -1), new AttackMove(Moves.BURNING_JEALOUSY, Type.FIRE, MoveCategory.SPECIAL, 70, 100, 5, 100, 0, 8) - .target(MoveTarget.ALL_NEAR_ENEMIES) - .partial(), + .attr(StatusIfBoostedAttr, StatusEffect.BURN) + .target(MoveTarget.ALL_NEAR_ENEMIES), new AttackMove(Moves.LASH_OUT, Type.DARK, MoveCategory.PHYSICAL, 75, 100, 5, -1, 0, 8) - .partial(), + .attr(MovePowerMultiplierAttr, (user, target, move) => user.turnData.battleStatsDecreased ? 2 : 1), new AttackMove(Moves.POLTERGEIST, Type.GHOST, MoveCategory.PHYSICAL, 110, 90, 5, -1, 0, 8) .attr(AttackedByItemAttr) .makesContact(false), @@ -9143,12 +9194,11 @@ export function initMoves() { new AttackMove(Moves.HARD_PRESS, Type.STEEL, MoveCategory.PHYSICAL, -1, 100, 10, -1, 0, 9) .attr(OpponentHighHpPowerAttr, 100), new StatusMove(Moves.DRAGON_CHEER, Type.DRAGON, -1, 15, -1, 0, 9) - .attr(AddBattlerTagAttr, BattlerTagType.CRIT_BOOST, false, true) - .target(MoveTarget.NEAR_ALLY) - .partial(), + .attr(AddBattlerTagAttr, BattlerTagType.DRAGON_CHEER, false, true) + .target(MoveTarget.NEAR_ALLY), new AttackMove(Moves.ALLURING_VOICE, Type.FAIRY, MoveCategory.SPECIAL, 80, 100, 10, -1, 0, 9) - .soundBased() - .partial(), + .attr(AddBattlerTagIfBoostedAttr, BattlerTagType.CONFUSED) + .soundBased(), new AttackMove(Moves.TEMPER_FLARE, Type.FIRE, MoveCategory.PHYSICAL, 75, 100, 10, -1, 0, 9) .attr(MovePowerMultiplierAttr, (user, target, move) => user.getLastXMoves(2)[1]?.result === MoveResult.MISS || user.getLastXMoves(2)[1]?.result === MoveResult.FAIL ? 2 : 1), new AttackMove(Moves.SUPERCELL_SLAM, Type.ELECTRIC, MoveCategory.PHYSICAL, 100, 95, 15, -1, 0, 9) diff --git a/src/data/pokemon-forms.ts b/src/data/pokemon-forms.ts index e4417f8e8bb..1420d8800aa 100644 --- a/src/data/pokemon-forms.ts +++ b/src/data/pokemon-forms.ts @@ -359,7 +359,7 @@ export class SpeciesDefaultFormMatchTrigger extends SpeciesFormChangeTrigger { /** * Class used for triggering form changes based on weather. - * Used by Castform. + * Used by Castform and Cherrim. * @extends SpeciesFormChangeTrigger */ export class SpeciesFormChangeWeatherTrigger extends SpeciesFormChangeTrigger { @@ -392,7 +392,7 @@ export class SpeciesFormChangeWeatherTrigger extends SpeciesFormChangeTrigger { /** * Class used for reverting to the original form when the weather runs out * or when the user loses the ability/is suppressed. - * Used by Castform. + * Used by Castform and Cherrim. * @extends SpeciesFormChangeTrigger */ export class SpeciesFormChangeRevertWeatherFormTrigger extends SpeciesFormChangeTrigger { @@ -930,6 +930,11 @@ export const pokemonFormChanges: PokemonFormChanges = { new SpeciesFormChange(Species.CASTFORM, "rainy", "", new SpeciesFormChangeActiveTrigger(), true), new SpeciesFormChange(Species.CASTFORM, "snowy", "", new SpeciesFormChangeActiveTrigger(), true), ], + [Species.CHERRIM]: [ + new SpeciesFormChange(Species.CHERRIM, "overcast", "sunshine", new SpeciesFormChangeWeatherTrigger(Abilities.FLOWER_GIFT, [ WeatherType.SUNNY, WeatherType.HARSH_SUN ]), true), + new SpeciesFormChange(Species.CHERRIM, "sunshine", "overcast", new SpeciesFormChangeRevertWeatherFormTrigger(Abilities.FLOWER_GIFT, [ WeatherType.NONE, WeatherType.SANDSTORM, WeatherType.STRONG_WINDS, WeatherType.FOG, WeatherType.HAIL, WeatherType.HEAVY_RAIN, WeatherType.SNOW, WeatherType.RAIN ]), true), + new SpeciesFormChange(Species.CHERRIM, "sunshine", "overcast", new SpeciesFormChangeActiveTrigger(), true), + ], }; export function initPokemonForms() { diff --git a/src/data/pokemon-species.ts b/src/data/pokemon-species.ts index db601935bfc..17f2de794ae 100644 --- a/src/data/pokemon-species.ts +++ b/src/data/pokemon-species.ts @@ -1132,7 +1132,7 @@ export function initSpecies() { ), new PokemonSpecies(Species.SNORLAX, 1, false, false, false, "Sleeping Pokémon", Type.NORMAL, null, 2.1, 460, Abilities.IMMUNITY, Abilities.THICK_FAT, Abilities.GLUTTONY, 540, 160, 110, 65, 65, 110, 30, 25, 50, 189, GrowthRate.SLOW, 87.5, false, true, new PokemonForm("Normal", "", Type.NORMAL, null, 2.1, 460, Abilities.IMMUNITY, Abilities.THICK_FAT, Abilities.GLUTTONY, 540, 160, 110, 65, 65, 110, 30, 25, 50, 189, false, null, true), - new PokemonForm("G-Max", SpeciesFormKey.GIGANTAMAX, Type.NORMAL, null, 35, 460, Abilities.THICK_FAT, Abilities.THICK_FAT, Abilities.THICK_FAT, 640, 200, 135, 85, 80, 125, 15, 25, 50, 189), + new PokemonForm("G-Max", SpeciesFormKey.GIGANTAMAX, Type.NORMAL, null, 35, 460, Abilities.HARVEST, Abilities.HARVEST, Abilities.HARVEST, 640, 200, 135, 80, 80, 125, 20, 25, 50, 189), ), new PokemonSpecies(Species.ARTICUNO, 1, true, false, false, "Freeze Pokémon", Type.ICE, Type.FLYING, 1.7, 55.4, Abilities.PRESSURE, Abilities.NONE, Abilities.SNOW_CLOAK, 580, 90, 85, 100, 95, 125, 85, 3, 35, 290, GrowthRate.SLOW, null, false), new PokemonSpecies(Species.ZAPDOS, 1, true, false, false, "Electric Pokémon", Type.ELECTRIC, Type.FLYING, 1.6, 52.6, Abilities.PRESSURE, Abilities.NONE, Abilities.STATIC, 580, 90, 90, 85, 125, 90, 100, 3, 35, 290, GrowthRate.SLOW, null, false), @@ -3573,7 +3573,7 @@ export const starterPassiveAbilities = { [Species.CHATOT]: Abilities.PUNK_ROCK, [Species.SPIRITOMB]: Abilities.VESSEL_OF_RUIN, [Species.GIBLE]: Abilities.SAND_STREAM, - [Species.MUNCHLAX]: Abilities.HARVEST, + [Species.MUNCHLAX]: Abilities.RIPEN, [Species.RIOLU]: Abilities.MINDS_EYE, [Species.HIPPOPOTAS]: Abilities.UNAWARE, [Species.SKORUPI]: Abilities.SUPER_LUCK, diff --git a/src/enums/battler-tag-type.ts b/src/enums/battler-tag-type.ts index 5cebacd43fc..20ceb1b331f 100644 --- a/src/enums/battler-tag-type.ts +++ b/src/enums/battler-tag-type.ts @@ -70,5 +70,6 @@ export enum BattlerTagType { GULP_MISSILE_PIKACHU = "GULP_MISSILE_PIKACHU", BEAK_BLAST_CHARGING = "BEAK_BLAST_CHARGING", SHELL_TRAP = "SHELL_TRAP", - NO_RETREAT = "NO_RETREAT" + DRAGON_CHEER = "DRAGON_CHEER", + NO_RETREAT = "NO_RETREAT", } diff --git a/src/field/arena.ts b/src/field/arena.ts index 7622b9a014f..e8defbd1a8e 100644 --- a/src/field/arena.ts +++ b/src/field/arena.ts @@ -339,7 +339,10 @@ export class Arena { */ triggerWeatherBasedFormChanges(): void { this.scene.getField(true).forEach( p => { - if (p.hasAbility(Abilities.FORECAST) && p.species.speciesId === Species.CASTFORM) { + const isCastformWithForecast = (p.hasAbility(Abilities.FORECAST) && p.species.speciesId === Species.CASTFORM); + const isCherrimWithFlowerGift = (p.hasAbility(Abilities.FLOWER_GIFT) && p.species.speciesId === Species.CHERRIM); + + if (isCastformWithForecast || isCherrimWithFlowerGift) { new ShowAbilityPhase(this.scene, p.getBattlerIndex()); this.scene.triggerPokemonFormChange(p, SpeciesFormChangeWeatherTrigger); } @@ -351,7 +354,10 @@ export class Arena { */ triggerWeatherBasedFormChangesToNormal(): void { this.scene.getField(true).forEach( p => { - if (p.hasAbility(Abilities.FORECAST, false, true) && p.species.speciesId === Species.CASTFORM) { + const isCastformWithForecast = (p.hasAbility(Abilities.FORECAST, false, true) && p.species.speciesId === Species.CASTFORM); + const isCherrimWithFlowerGift = (p.hasAbility(Abilities.FLOWER_GIFT, false, true) && p.species.speciesId === Species.CHERRIM); + + if (isCastformWithForecast || isCherrimWithFlowerGift) { new ShowAbilityPhase(this.scene, p.getBattlerIndex()); return this.scene.triggerPokemonFormChange(p, SpeciesFormChangeRevertWeatherFormTrigger); } diff --git a/src/field/pokemon.ts b/src/field/pokemon.ts index 79e5ca86fdc..d8acddecedf 100644 --- a/src/field/pokemon.ts +++ b/src/field/pokemon.ts @@ -18,11 +18,11 @@ import { Status, StatusEffect, getRandomStatus } from "../data/status-effect"; import { pokemonEvolutions, pokemonPrevolutions, SpeciesFormEvolution, SpeciesEvolutionCondition, FusionSpeciesFormEvolution } from "../data/pokemon-evolutions"; import { reverseCompatibleTms, tmSpecies, tmPoolTiers } from "../data/tms"; import { BattleStat } from "../data/battle-stat"; -import { BattlerTag, BattlerTagLapseType, EncoreTag, GroundedTag, HighestStatBoostTag, TypeImmuneTag, getBattlerTag, SemiInvulnerableTag, TypeBoostTag, ExposedTag, TrappedTag } from "../data/battler-tags"; +import { BattlerTag, BattlerTagLapseType, EncoreTag, GroundedTag, HighestStatBoostTag, TypeImmuneTag, getBattlerTag, SemiInvulnerableTag, TypeBoostTag, ExposedTag, DragonCheerTag, CritBoostTag, TrappedTag } from "../data/battler-tags"; import { WeatherType } from "../data/weather"; import { TempBattleStat } from "../data/temp-battle-stat"; import { ArenaTagSide, NoCritTag, WeakenMoveScreenTag } from "../data/arena-tag"; -import { Ability, AbAttr, BattleStatMultiplierAbAttr, BlockCritAbAttr, BonusCritAbAttr, BypassBurnDamageReductionAbAttr, FieldPriorityMoveImmunityAbAttr, IgnoreOpponentStatChangesAbAttr, MoveImmunityAbAttr, PreDefendFullHpEndureAbAttr, ReceivedMoveDamageMultiplierAbAttr, ReduceStatusEffectDurationAbAttr, StabBoostAbAttr, StatusEffectImmunityAbAttr, TypeImmunityAbAttr, WeightMultiplierAbAttr, allAbilities, applyAbAttrs, applyBattleStatMultiplierAbAttrs, applyPreApplyBattlerTagAbAttrs, applyPreAttackAbAttrs, applyPreDefendAbAttrs, applyPreSetStatusAbAttrs, UnsuppressableAbilityAbAttr, SuppressFieldAbilitiesAbAttr, NoFusionAbilityAbAttr, MultCritAbAttr, IgnoreTypeImmunityAbAttr, DamageBoostAbAttr, IgnoreTypeStatusEffectImmunityAbAttr, ConditionalCritAbAttr, applyFieldBattleStatMultiplierAbAttrs, FieldMultiplyBattleStatAbAttr, AddSecondStrikeAbAttr, IgnoreOpponentEvasionAbAttr, UserFieldStatusEffectImmunityAbAttr, UserFieldBattlerTagImmunityAbAttr, BattlerTagImmunityAbAttr, MoveTypeChangeAbAttr, applyCheckTrappedAbAttrs, CheckTrappedAbAttr } from "../data/ability"; +import { Ability, AbAttr, BattleStatMultiplierAbAttr, BlockCritAbAttr, BonusCritAbAttr, BypassBurnDamageReductionAbAttr, FieldPriorityMoveImmunityAbAttr, IgnoreOpponentStatChangesAbAttr, MoveImmunityAbAttr, PreDefendFullHpEndureAbAttr, ReceivedMoveDamageMultiplierAbAttr, ReduceStatusEffectDurationAbAttr, StabBoostAbAttr, StatusEffectImmunityAbAttr, TypeImmunityAbAttr, WeightMultiplierAbAttr, allAbilities, applyAbAttrs, applyBattleStatMultiplierAbAttrs, applyPreApplyBattlerTagAbAttrs, applyPreAttackAbAttrs, applyPreDefendAbAttrs, applyPreSetStatusAbAttrs, UnsuppressableAbilityAbAttr, SuppressFieldAbilitiesAbAttr, NoFusionAbilityAbAttr, MultCritAbAttr, IgnoreTypeImmunityAbAttr, DamageBoostAbAttr, IgnoreTypeStatusEffectImmunityAbAttr, ConditionalCritAbAttr, applyFieldBattleStatMultiplierAbAttrs, FieldMultiplyBattleStatAbAttr, AddSecondStrikeAbAttr, IgnoreOpponentEvasionAbAttr, UserFieldStatusEffectImmunityAbAttr, UserFieldBattlerTagImmunityAbAttr, BattlerTagImmunityAbAttr, MoveTypeChangeAbAttr, FullHpResistTypeAbAttr, applyCheckTrappedAbAttrs, CheckTrappedAbAttr } from "../data/ability"; import PokemonData from "../system/pokemon-data"; import { BattlerIndex } from "../battle"; import { Mode } from "../ui/ui"; @@ -1298,6 +1298,11 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container { } } + // Apply Tera Shell's effect to attacks after all immunities are accounted for + if (!ignoreAbility && move.category !== MoveCategory.STATUS) { + applyPreDefendAbAttrs(FullHpResistTypeAbAttr, this, source, move, cancelledHolder, simulated, typeMultiplier); + } + return (!cancelledHolder.value ? typeMultiplier.value : 0) as TypeDamageMultiplier; } @@ -2086,9 +2091,16 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container { critLevel.value += 1; } } - if (source.getTag(BattlerTagType.CRIT_BOOST)) { - critLevel.value += 2; + + const critBoostTag = source.getTag(CritBoostTag); + if (critBoostTag) { + if (critBoostTag instanceof DragonCheerTag) { + critLevel.value += critBoostTag.typesOnAdd.includes(Type.DRAGON) ? 2 : 1; + } else { + critLevel.value += 2; + } } + console.log(`crit stage: +${critLevel.value}`); const critChance = [24, 8, 2, 1][Math.max(0, Math.min(critLevel.value, 3))]; isCritical = critChance === 1 || !this.scene.randBattleSeedInt(critChance); @@ -4296,7 +4308,7 @@ export interface TurnMove { targets?: BattlerIndex[]; result: MoveResult; virtual?: boolean; - turn?: integer; + turn?: number; } export interface QueuedMove { @@ -4308,17 +4320,17 @@ export interface QueuedMove { export interface AttackMoveResult { move: Moves; result: DamageResult; - damage: integer; + damage: number; critical: boolean; - sourceId: integer; + sourceId: number; sourceBattlerIndex: BattlerIndex; } export class PokemonSummonData { - public battleStats: integer[] = [ 0, 0, 0, 0, 0, 0, 0 ]; + public battleStats: number[] = [ 0, 0, 0, 0, 0, 0, 0 ]; public moveQueue: QueuedMove[] = []; public disabledMove: Moves = Moves.NONE; - public disabledTurns: integer = 0; + public disabledTurns: number = 0; public tags: BattlerTag[] = []; public abilitySuppressed: boolean = false; public abilitiesApplied: Abilities[] = []; @@ -4328,14 +4340,14 @@ export class PokemonSummonData { public ability: Abilities = Abilities.NONE; public gender: Gender; public fusionGender: Gender; - public stats: integer[]; + public stats: number[]; public moveset: (PokemonMove | null)[]; // If not initialized this value will not be populated from save data. public types: Type[] = []; } export class PokemonBattleData { - public hitCount: integer = 0; + public hitCount: number = 0; public endured: boolean = false; public berriesEaten: BerryType[] = []; public abilitiesApplied: Abilities[] = []; @@ -4344,21 +4356,23 @@ export class PokemonBattleData { export class PokemonBattleSummonData { /** The number of turns the pokemon has passed since entering the battle */ - public turnCount: integer = 1; + public turnCount: number = 1; /** The list of moves the pokemon has used since entering the battle */ public moveHistory: TurnMove[] = []; } export class PokemonTurnData { - public flinched: boolean; - public acted: boolean; - public hitCount: integer; - public hitsLeft: integer; - public damageDealt: integer = 0; - public currDamageDealt: integer = 0; - public damageTaken: integer = 0; + public flinched: boolean = false; + public acted: boolean = false; + public hitCount: number; + public hitsLeft: number; + public damageDealt: number = 0; + public currDamageDealt: number = 0; + public damageTaken: number = 0; public attacksReceived: AttackMoveResult[] = []; public order: number; + public battleStatsIncreased: boolean = false; + public battleStatsDecreased: boolean = false; } export enum AiType { diff --git a/src/loading-scene.ts b/src/loading-scene.ts index b086b0cb002..e4a73414cd1 100644 --- a/src/loading-scene.ts +++ b/src/loading-scene.ts @@ -41,8 +41,6 @@ export class LoadingScene extends SceneBase { this.loadImage("loading_bg", "arenas"); this.loadImage("logo", ""); - // this.loadImage("pride-update", "events"); - this.loadImage("august-variant-update", "events"); // Load menu images this.loadAtlas("bg", "ui"); @@ -246,7 +244,12 @@ export class LoadingScene extends SceneBase { } else { this.loadAtlas("types", ""); } - + const availableLangs = ["en", "de", "it", "fr", "ja", "ko", "es", "pt_BR", "zh_CN"]; + if (lang && availableLangs.includes(lang)) { + this.loadImage("september-update-"+lang, "events"); + } else { + this.loadImage("september-update-en", "events"); + } this.loadAtlas("statuses", ""); this.loadAtlas("categories", ""); diff --git a/src/locales/en/ability-trigger.json b/src/locales/en/ability-trigger.json index 307ab70b85c..4f1d4dac766 100644 --- a/src/locales/en/ability-trigger.json +++ b/src/locales/en/ability-trigger.json @@ -12,6 +12,7 @@ "blockItemTheft": "{{pokemonNameWithAffix}}'s {{abilityName}}\nprevents item theft!", "typeImmunityHeal": "{{pokemonNameWithAffix}}'s {{abilityName}}\nrestored its HP a little!", "nonSuperEffectiveImmunity": "{{pokemonNameWithAffix}} avoided damage\nwith {{abilityName}}!", + "fullHpResistType": "{{pokemonNameWithAffix}} made its shell gleam!\nIt's distorting type matchups!", "moveImmunity": "It doesn't affect {{pokemonNameWithAffix}}!", "reverseDrain": "{{pokemonNameWithAffix}} sucked up the liquid ooze!", "postDefendTypeChange": "{{pokemonNameWithAffix}}'s {{abilityName}}\nmade it the {{typeName}} type!", diff --git a/src/locales/en/achv.json b/src/locales/en/achv.json index 0ed746c77b3..fae786e034a 100644 --- a/src/locales/en/achv.json +++ b/src/locales/en/achv.json @@ -10,19 +10,19 @@ }, "10K_MONEY": { "name": "Money Haver", - "name_female": null + "name_female": "Money Haver" }, "100K_MONEY": { "name": "Rich", - "name_female": null + "name_female": "Rich" }, "1M_MONEY": { "name": "Millionaire", - "name_female": null + "name_female": "Millionaire" }, "10M_MONEY": { "name": "One Percenter", - "name_female": null + "name_female": "One Percenter" }, "DamageAchv": { "description": "Inflict {{damageAmount}} damage in one hit" @@ -32,11 +32,11 @@ }, "1000_DMG": { "name": "Harder Hitter", - "name_female": null + "name_female": "Harder Hitter" }, "2500_DMG": { "name": "That's a Lotta Damage!", - "name_female": null + "name_female": "That's a Lotta Damage!" }, "10000_DMG": { "name": "One Punch Man", @@ -47,19 +47,19 @@ }, "250_HEAL": { "name": "Novice Healer", - "name_female": null + "name_female": "Novice Healer" }, "1000_HEAL": { "name": "Big Healer", - "name_female": null + "name_female": "Big Healer" }, "2500_HEAL": { "name": "Cleric", - "name_female": null + "name_female": "Cleric" }, "10000_HEAL": { "name": "Recovery Master", - "name_female": null + "name_female": "Recovery Master" }, "LevelAchv": { "description": "Level up a Pokémon to Lv{{level}}" @@ -69,7 +69,7 @@ }, "LV_250": { "name": "Elite", - "name_female": null + "name_female": "Elite" }, "LV_1000": { "name": "To Go Even Further Beyond" @@ -79,23 +79,23 @@ }, "10_RIBBONS": { "name": "Pokémon League Champion", - "name_female": null + "name_female": "Pokémon League Champion" }, "25_RIBBONS": { "name": "Great League Champion", - "name_female": null + "name_female": "Great League Champion" }, "50_RIBBONS": { "name": "Ultra League Champion", - "name_female": null + "name_female": "Ultra League Champion" }, "75_RIBBONS": { "name": "Rogue League Champion", - "name_female": null + "name_female": "Rogue League Champion" }, "100_RIBBONS": { "name": "Master League Champion", - "name_female": null + "name_female": "Master League Champion" }, "TRANSFER_MAX_BATTLE_STAT": { "name": "Teamwork", @@ -147,7 +147,7 @@ }, "SHINY_PARTY": { "name": "That's Dedication", - "name_female": null, + "name_female": "That's Dedication", "description": "Have a full party of shiny Pokémon" }, "HATCH_MYTHICAL": { @@ -176,7 +176,7 @@ }, "CLASSIC_VICTORY": { "name": "Undefeated", - "name_female": null, + "name_female": "Undefeated", "description": "Beat the game in classic mode" }, "UNEVOLVED_CLASSIC_VICTORY": { diff --git a/src/locales/en/dialogue-double-battle.json b/src/locales/en/dialogue-double-battle.json index 9484aa2edcc..4190af49d15 100644 --- a/src/locales/en/dialogue-double-battle.json +++ b/src/locales/en/dialogue-double-battle.json @@ -58,7 +58,7 @@ "iris_alder_double": { "encounter": { "1": "Iris: Welcome Challenger! I am THE Unova Champion!\n$Alder: Iris, aren't you a bit too excited?", - "1_female": null + "1_female": "Iris: Welcome Challenger! I am THE Unova Champion!\n$Alder: Iris, aren't you a bit too excited?" }, "victory": { "1": "Iris: A loss like this is not easy to take...\n$Alder: But we will only get stronger with every loss!" @@ -75,7 +75,7 @@ "marnie_piers_double": { "encounter": { "1": "Piers: Ready for a concert?\n$Marnie: Brother... They are here to fight, not to sing...", - "1_female": null + "1_female": "Piers: Ready for a concert?\n$Marnie: Brother... They are here to fight, not to sing..." }, "victory": { "1": "Piers: Now that was a great concert!\n$Marnie: Brother..." diff --git a/src/locales/en/dialogue-final-boss.json b/src/locales/en/dialogue-final-boss.json index 3abe4cd8831..6f99aae3e0c 100644 --- a/src/locales/en/dialogue-final-boss.json +++ b/src/locales/en/dialogue-final-boss.json @@ -1,6 +1,6 @@ { "encounter": "It appears the time has finally come once again.\nYou know why you have come here, do you not?\n$You were drawn here, because you have been here before.\nCountless times.\n$Though, perhaps it can be counted.\nTo be precise, this is in fact your {{cycleCount}} cycle.\n$Each cycle your mind reverts to its former state.\nEven so, somehow, remnants of your former selves remain.\n$Until now you have yet to succeed, but I sense a different presence in you this time.\n\n$You are the only one here, though it is as if there is… another.\n$Will you finally prove a formidable challenge to me?\nThe challenge I have longed after for millennia?\n$We begin.", - "encounter_female": null, + "encounter_female": "It appears the time has finally come once again.\nYou know why you have come here, do you not?\n$You were drawn here, because you have been here before.\nCountless times.\n$Though, perhaps it can be counted.\nTo be precise, this is in fact your {{cycleCount}} cycle.\n$Each cycle your mind reverts to its former state.\nEven so, somehow, remnants of your former selves remain.\n$Until now you have yet to succeed, but I sense a different presence in you this time.\n\n$You are the only one here, though it is as if there is… another.\n$Will you finally prove a formidable challenge to me?\nThe challenge I have longed after for millennia?\n$We begin.", "firstStageWin": "I see. The presence I felt was indeed real.\nIt appears I no longer need to hold back.\n$Do not disappoint me.", "secondStageWin": "…Magnificent.", "key_ordinal_one": "st", diff --git a/src/locales/en/dialogue.json b/src/locales/en/dialogue.json index e96a42daf1d..1f8919f11b5 100644 --- a/src/locales/en/dialogue.json +++ b/src/locales/en/dialogue.json @@ -3,31 +3,31 @@ "encounter": { "1": "Hey, wanna battle?", "2": "Are you a new trainer too?", - "2_female": null, + "2_female": "Are you a new trainer too?", "3": "Hey, I haven't seen you before. Let's battle!", "4": "I just lost, so I'm trying to find more Pokémon.\nWait! You look weak! Come on, let's battle!", - "4_female": null, + "4_female": "I just lost, so I'm trying to find more Pokémon.\nWait! You look weak! Come on, let's battle!", "5": "Have we met or not? I don't really remember. Well, I guess it's nice to meet you anyway!", "6": "All right! Let's go!", "7": "All right! Here I come! I'll show you my power!", "8": "Haw haw haw... I'll show you how hawesome my Pokémon are!", "9": "No need to waste time saying hello. Bring it on whenever you're ready!", - "9_female": null, + "9_female": "No need to waste time saying hello. Bring it on whenever you're ready!", "10": "Don't let your guard down, or you may be crying when a kid beats you.", "11": "I've raised my Pokémon with great care. You're not allowed to hurt them!", "12": "Glad you made it! It won't be an easy job from here.", - "12_female": null, + "12_female": "Glad you made it! It won't be an easy job from here.", "13": "The battles continue forever! Welcome to the world with no end!", - "13_female": null + "13_female": "The battles continue forever! Welcome to the world with no end!" }, "victory": { "1": "Wow! You're strong!", - "1_female": null, + "1_female": "Wow! You're strong!", "2": "I didn't stand a chance, huh?", "3": "I'll find you again when I'm older and beat you!", "4": "Ugh. I don't have any more Pokémon.", "5": "No way… NO WAY! How could I lose again…", - "5_female": null, + "5_female": "No way… NO WAY! How could I lose again…", "6": "No! I lost!", "7": "Whoa! You are incredible! I'm amazed and surprised!", "8": "Could it be… How… My Pokémon and I are the strongest, though…", @@ -42,12 +42,12 @@ "encounter": { "1": "Let's have a battle, shall we?", "2": "You look like a new trainer. Let's have a battle!", - "2_female": null, + "2_female": "You look like a new trainer. Let's have a battle!", "3": "I don't recognize you. How about a battle?", "4": "Let's have a fun Pokémon battle!", "5": "I'll show you the ropes of how to really use Pokémon!", "6": "A serious battle starts from a serious beginning! Are you sure you're ready?", - "6_female": null, + "6_female": "A serious battle starts from a serious beginning! Are you sure you're ready?", "7": "You're only young once. And you only get one shot at a given battle. Soon, you'll be nothing but a memory.", "8": "You'd better go easy on me, OK? Though I'll be seriously fighting!", "9": "School is boring. I've got nothing to do. Yawn. I'm only battling to kill the time." @@ -55,15 +55,15 @@ "victory": { "1": "That was impressive! I've got a lot to learn.", "2": "I didn't think you'd beat me that bad…", - "2_female": null, + "2_female": "I didn't think you'd beat me that bad…", "3": "I hope we get to have a rematch some day.", "4": "That was pretty amazingly fun! You've totally exhausted me…", "5": "You actually taught me a lesson! You're pretty amazing!", "6": "Seriously, I lost. That is, like, seriously depressing, but you were seriously cool.", - "6_female": null, + "6_female": "Seriously, I lost. That is, like, seriously depressing, but you were seriously cool.", "7": "I don't need memories like this. Deleting memory…", "8": "Hey! I told you to go easy on me! Still, you're pretty cool when you're serious.", - "8_female": null, + "8_female": "Hey! I told you to go easy on me! Still, you're pretty cool when you're serious.", "9": "I'm actually getting tired of battling… There's gotta be something new to do…" } }, @@ -154,7 +154,7 @@ "ace_trainer": { "encounter": { "1": "You seem quite confident.", - "1_female": null, + "1_female": "You seem quite confident.", "2": "Your Pokémon… Show them to me…", "3": "Because I'm an Ace Trainer, people think I'm strong.", "4": "Are you aware of what it takes to be an Ace Trainer?" @@ -163,9 +163,9 @@ "1": "Yes… You have good Pokémon…", "2": "What?! But I'm a battling genius!", "3": "Of course, you are the main character!", - "3_female": null, + "3_female": "Of course, you are the main character!", "4": "OK! OK! You could be an Ace Trainer!", - "4_female": null + "4_female": "OK! OK! You could be an Ace Trainer!" }, "defeat": { "1": "I am devoting my body and soul to Pokémon battles!", @@ -187,7 +187,7 @@ "1": "Get ready, because when we team up, it's double the trouble!", "2": "Two hearts, one strategy – let's see if you can keep up with our twin power!", "3": "Hope you're ready for double trouble, because we're about to bring the heat!", - "3_female": null + "3_female": "Hope you're ready for double trouble, because we're about to bring the heat!" }, "victory": { "1": "We may have lost this round, but our bond remains unbreakable!", @@ -216,7 +216,7 @@ "encounter": { "1": "I praise your courage in challenging me! For I am the one with the strongest kick!", "2": "Oh, I see. Would you like to be cut to pieces? Or do you prefer the role of punching bag?", - "2_female": null + "2_female": "Oh, I see. Would you like to be cut to pieces? Or do you prefer the role of punching bag?" }, "victory": { "1": "Oh. The Pokémon did the fighting. My strong kick didn't help a bit.", @@ -328,7 +328,7 @@ "defeat": { "1": "New age simply refers to twentieth century classical composers, right?", "2": "Don't get hung up on sadness or frustration. You can use your grudges to motivate yourself.", - "2_female": null + "2_female": "Don't get hung up on sadness or frustration. You can use your grudges to motivate yourself." } }, "psychic": { @@ -360,7 +360,7 @@ "baker": { "encounter": { "1": "Hope you're ready to taste defeat!", - "1_female": null + "1_female": "Hope you're ready to taste defeat!" }, "victory": { "1": "I'll bake a comeback." @@ -391,7 +391,7 @@ "1": "Matey, you're walking the plank if you lose!", "2": "Come on then! My sailor's pride is at stake!", "3": "Ahoy there! Are you seasick?", - "3_female": null + "3_female": "Ahoy there! Are you seasick?" }, "victory": { "1": "Argh! Beaten by a kid!", @@ -419,7 +419,7 @@ }, "victory": { "1": "Tch, you really are strong. It's too bad.\n$If you were to join Team Rocket, you could become an Executive.", - "1_female": null, + "1_female": "Tch, you really are strong. It's too bad.\n$If you were to join Team Rocket, you could become an Executive.", "2": "I... I'm shattered...", "3": "Aaaieeeee! This can't be happening! I fought hard, but I still lost…" } @@ -458,7 +458,7 @@ "1": "Hehehe! You might have beaten me, but you don't stand a chance against the boss!\n$If you get lost now, you won't have to face a sound whipping!", "2": "Hehehe... So, I lost, too...", "3": "Ahya! How could this be? For an Admin like me to lose to some random trainer...", - "3_female": null + "3_female": "Ahya! How could this be? For an Admin like me to lose to some random trainer..." } }, "courtney": { @@ -478,13 +478,13 @@ "1": "Ahahahaha! You're going to meddle in Team Aqua's affairs?\n$You're either absolutely fearless, simply ignorant, or both!\n$You're so cute, you're disgusting! I'll put you down", "2": "What's this? Who's this spoiled brat?", "3": "Cool your jets. Be patient. I'll crush you shortly.", - "3_female": null + "3_female": "Cool your jets. Be patient. I'll crush you shortly." }, "victory": { "1": "Ahahahaha! We got meddled with unexpectedly! We're out of options.\n$We'll have to pull out. But this isn't the last you'll see of Team Aqua!\n$We have other plans! Don't you forget it!", "2": "Ahhh?! Did I go too easy on you?!", "3": "Uh. Are you telling me you've upped your game even more during the fight?\n$You're a brat with a bright future… My Pokémon and I don't have any strength left to fight…\n$Go on… Go and be destroyed by Archie.", - "3_female": null + "3_female": "Uh. Are you telling me you've upped your game even more during the fight?\n$You're a brat with a bright future… My Pokémon and I don't have any strength left to fight…\n$Go on… Go and be destroyed by Archie." } }, "matt": { @@ -497,7 +497,7 @@ "1": "Muwuhahaha! That battle was fun even though I lost!", "2": "I can feel it! I can feel it, all right! The strength coming offa you!\n$More! I still want more! But looks like we're outta time...", "3": "Oho! That's a loss I can be proud of!", - "3_female": null + "3_female": "Oho! That's a loss I can be proud of!" } }, "mars": { @@ -505,7 +505,7 @@ "1": "I'm Mars, one of Team Galactic's top Commanders.", "2": "Team Galactic's vision for the future is unwavering. Opposition will be crushed without mercy!", "3": "Feeling nervous? You should be!", - "3_female": null + "3_female": "Feeling nervous? You should be!" }, "victory": { "1": "This can't be happening! How did I lose?!", @@ -540,25 +540,25 @@ "zinzolin": { "encounter": { "1": "You could become a threat to Team Plasma, so we will eliminate you here and now!", - "1_female": null, + "1_female": "You could become a threat to Team Plasma, so we will eliminate you here and now!", "2": "You don't have the sense to know when to quit, it seems. It's an act of mercy on my part to bring an end to this now!", "3": "You're an impressive Trainer to have made it this far. But it ends here.", - "3_female": null + "3_female": "You're an impressive Trainer to have made it this far. But it ends here." }, "victory": { "1": "Ghetsis... I have failed you...", "2": "It's bitter cold. I'm shivering. I'm suffering. Yet, we will stand victorious.", "3": "Hmph. You're a smarter Trainer than I expected, but not smart enough.", - "3_female": null + "3_female": "Hmph. You're a smarter Trainer than I expected, but not smart enough." } }, "rood": { "encounter": { "1": "You are a threat to Team Plasma. We cannot let you walk away from here and now!", - "1_female": null, + "1_female": "You are a threat to Team Plasma. We cannot let you walk away from here and now!", "2": "It seems you don't know when to give up. I'll make sure no one interferes with our plans!", "3": "You are a remarkable Trainer to have made it this far. But this is where it ends.", - "3_female": null + "3_female": "You are a remarkable Trainer to have made it this far. But this is where it ends." }, "victory": { "1": "Ghetsis... I have failed my mission...", @@ -569,15 +569,15 @@ "xerosic": { "encounter": { "1": "Ah ha ha! It would be my pleasure. Come on, little Trainer! Let's see what you've got!", - "1_female": null, + "1_female": "Ah ha ha! It would be my pleasure. Come on, little Trainer! Let's see what you've got!", "2": "Hmm... You're more powerful than you look. I wonder how much energy there is inside you.", - "2_female": null, + "2_female": "Hmm... You're more powerful than you look. I wonder how much energy there is inside you.", "3": "I've been waiting for you! I need to do a little research on you! Come, let us begin!" }, "victory": { "1": "Ah, you're quite strong. Oh yes—very strong, indeed.", "2": "Ding-ding-ding! You did it! To the victor go the spoils!", - "2_female": null, + "2_female": "Ding-ding-ding! You did it! To the victor go the spoils!", "3": "Wonderful! Amazing! You have tremendous skill and bravery!" } }, @@ -585,7 +585,7 @@ "encounter": { "1": "I am Bryony, and it would be my pleasure to battle you. Show me what you've got.", "2": "Impressive... You're more powerful than you appear. Let's see the true extent of your energy.", - "2_female": null, + "2_female": "Impressive... You're more powerful than you appear. Let's see the true extent of your energy.", "3": "I've anticipated your arrival. It's time for a little test. Shall we begin?" }, "victory": { @@ -598,11 +598,11 @@ "encounter": { "1": "Prepare for trouble!", "2": "We're pulling a big job here! Get lost, kid!", - "2_female": null, + "2_female": "We're pulling a big job here! Get lost, kid!", "3": "Hand over your Pokémon, or face the wrath of Team Rocket!", "4": "You're about to experience the true terror of Team Rocket!", "5": "Hey, kid! Me am a Team Rocket member kind of guy!", - "5_female": null + "5_female": "Hey, kid! Me am a Team Rocket member kind of guy!" }, "victory": { "1": "Team Rocket blasting off again!", @@ -624,7 +624,7 @@ "1": "Huh? I lost?!", "2": "I can't believe I lost! I even skipped lunch for this", "3": "No way! You're just a kid!", - "3_female": null, + "3_female": "No way! You're just a kid!", "4": "Urrrgh... I should've ducked into our hideout right away...", "5": "You beat me... Do you think the boss will dock my pay for this?" } @@ -652,7 +652,7 @@ "3": "In the name of Team Galactic, I'll eliminate anyone who stands in our way!", "4": "Get ready to lose!", "5": "Hope you're ready for a cosmic beatdown!", - "5_female": null + "5_female": "Hope you're ready for a cosmic beatdown!" }, "victory": { "1": "Shut down...", @@ -682,7 +682,7 @@ "encounter": { "1": "Your Pokémon are no match for the elegance of Team Flare.", "2": "Hope you brought your sunglasses, because things are about to get bright!", - "2_female": null, + "2_female": "Hope you brought your sunglasses, because things are about to get bright!", "3": "Team Flare will cleanse the world of imperfection!", "4": "Prepare to face the brilliance of Team Flare!", "5": "Fashion is most important to us!" @@ -784,7 +784,7 @@ }, "defeat": { "1": "Mark my words. Not being able to measure your own strength shows that you are still a child.", - "1_female": null + "1_female": "Mark my words. Not being able to measure your own strength shows that you are still a child." } }, "rocket_boss_giovanni_2": { @@ -845,7 +845,7 @@ "galactic_boss_cyrus_1": { "encounter": { "1": "You were compelled to come here by such vacuous sentimentality.\n$I will make you regret paying heed to your heart!", - "1_female": null + "1_female": "You were compelled to come here by such vacuous sentimentality.\n$I will make you regret paying heed to your heart!" }, "victory": { "1": "Interesting. And quite curious." @@ -995,7 +995,7 @@ "misty": { "encounter": { "1": "My policy is an all out offensive with Water-type Pokémon!", - "1_female": null, + "1_female": "My policy is an all out offensive with Water-type Pokémon!", "2": "Hiya, I'll show you the strength of my aquatic Pokémon!", "3": "My dream was to go on a journey and battle powerful trainers…\nWill you be a sufficient challenge?" }, @@ -1013,14 +1013,14 @@ "lt_surge": { "encounter": { "1": "My Electric Pokémon saved me during the war! I'll show you how!", - "1_female": null, + "1_female": "My Electric Pokémon saved me during the war! I'll show you how!", "2": "Ten-hut! I'll shock you into surrender!", "3": "I'll zap you just like I do to all my enemies in battle!" }, "victory": { "1": "Whoa! Your team's the real deal, kid!", "2": "Aaargh, you're strong! Even my electric tricks lost against you.", - "2_female": null, + "2_female": "Aaargh, you're strong! Even my electric tricks lost against you.", "3": "That was an absolutely shocking loss!" }, "defeat": { @@ -1045,7 +1045,7 @@ "defeat": { "1": "I was afraid I would doze off…", "2": "Oh my, it seems my Grass Pokémon overwhelmed you.", - "2_female": null, + "2_female": "Oh my, it seems my Grass Pokémon overwhelmed you.", "3": "That battle was such a soothing experience.", "4": "Oh… Is that all?" } @@ -1106,7 +1106,7 @@ "1": "I, the leader of Team Rocket, will make you feel a world of pain!", "2": "My training here will be vital before I am to face my old associates again.", "3": "I do not think you are prepared for the level of failure you are about to experience!", - "3_female": null + "3_female": "I do not think you are prepared for the level of failure you are about to experience!" }, "victory": { "1": "WHAT! Me, lose?! There is nothing I wish to say to you!", @@ -1139,7 +1139,7 @@ "brawly": { "encounter": { "1": "Oh man, a challenger!\nLet's see what you can do!", - "1_female": null, + "1_female": "Oh man, a challenger!\nLet's see what you can do!", "2": "You seem like a big splash.\nLet's battle!", "3": "Time to create a storm!\nLet's go!" }, @@ -1167,7 +1167,7 @@ }, "defeat": { "1": "Recharge your batteries and challenge me again sometime!\nWahahahaha!", - "1_female": null, + "1_female": "Recharge your batteries and challenge me again sometime!\nWahahahaha!", "2": "I hope you found our battle electrifying!\nWahahahaha!", "3": "Aren't you shocked I won?\nWahahahaha!" } @@ -1214,7 +1214,7 @@ }, "victory": { "1": "You're the first Trainer I've seen with more grace than I.\nExcellently played.", - "1_female": null, + "1_female": "You're the first Trainer I've seen with more grace than I.\nExcellently played.", "2": "Oh, my Flying Pokémon have plummeted!\nVery well.", "3": "Though I may have fallen, my Pokémon will continue to fly!" }, @@ -1227,7 +1227,7 @@ "tate": { "encounter": { "1": "Hehehe…\nWere you surprised to see me without my sister?", - "1_female": null, + "1_female": "Hehehe…\nWere you surprised to see me without my sister?", "2": "I can see what you're thinking…\nYou want to battle!", "3": "How can you defeat someone…\nWho knows your every move?" }, @@ -1245,7 +1245,7 @@ "liza": { "encounter": { "1": "Fufufu…\nWere you surprised to see me without my brother?", - "1_female": null, + "1_female": "Fufufu…\nWere you surprised to see me without my brother?", "2": "I can determine what you desire…\nYou want to battle, don't you?", "3": "How can you defeat someone…\nWho's one with their Pokémon?" }, @@ -1317,10 +1317,10 @@ "nessa": { "encounter": { "1": "No matter what kind of plan your refined mind may be plotting, my partner and I will be sure to sink it.", - "1_female": null, + "1_female": "No matter what kind of plan your refined mind may be plotting, my partner and I will be sure to sink it.", "2": "I'm not here to chat. I'm here to win!", "3": "This is a little gift from my Pokémon… I hope you can take it!", - "3_female": null + "3_female": "This is a little gift from my Pokémon… I hope you can take it!" }, "victory": { "1": "You and your Pokémon are just too much…", @@ -1341,7 +1341,7 @@ }, "victory": { "1": "You… You're pretty good, huh?", - "1_female": null, + "1_female": "You… You're pretty good, huh?", "2": "If you find Gordie around, be sure to give him a right trashing, would you?", "3": "I think you took breaking the ice a little too literally…" }, @@ -1355,12 +1355,12 @@ "encounter": { "1": "You look strong! Shoots! Let's start!", "2": "I'm strong like the ocean's wide. You're gonna get swept away, fo' sho'.", - "2_female": null, + "2_female": "I'm strong like the ocean's wide. You're gonna get swept away, fo' sho'.", "3": "Oh ho, so I'm facing you! That's off the wall." }, "victory": { "1": "You totally rocked that! You're raising some wicked Pokémon. You got this Trainer thing down!", - "1_female": null, + "1_female": "You totally rocked that! You're raising some wicked Pokémon. You got this Trainer thing down!", "2": "You don't just look strong, you're strong fo' reals! Eh, I was swept away, too!", "3": "You're strong as a gnarly wave!" }, @@ -1373,7 +1373,7 @@ "shauntal": { "encounter": { "1": "Excuse me. You're a challenger, right?\nI'm the Elite Four's Ghost-type Pokémon user, Shauntal, and I shall be your opponent.", - "1_female": null, + "1_female": "Excuse me. You're a challenger, right?\nI'm the Elite Four's Ghost-type Pokémon user, Shauntal, and I shall be your opponent.", "2": "I absolutely love writing about Trainers who come here and the Pokémon they train.\nCould I use you and your Pokémon as a subject?", "3": "Every person who works with Pokémon has a story to tell.\nWhat story is about to be told?" }, @@ -1391,7 +1391,7 @@ "marshal": { "encounter": { "1": "My mentor, Alder, sees your potential as a Trainer and is taking an interest in you.\nIt is my intention to test you--to take you to the limits of your strength. Kiai!", - "1_female": null, + "1_female": "My mentor, Alder, sees your potential as a Trainer and is taking an interest in you.\nIt is my intention to test you--to take you to the limits of your strength. Kiai!", "2": "Victory, decisive victory, is my intention! Challenger, here I come!", "3": "In myself, I seek to develop the strength of a fighter and shatter any weakness in myself!\nPrevailing with the force of my convictions!" }, @@ -1411,7 +1411,7 @@ "1": "You remind me of an old friend. That makes me excited about this Pokémon battle!", "2": "Pokémon battles have no meaning if you don't think why you battle.\n$Or better said, it makes battling together with Pokémon meaningless.", "3": "My name's Cheren! I'm a Gym Leader and a teacher! Pleasure to meet you.", - "3_female": null + "3_female": "My name's Cheren! I'm a Gym Leader and a teacher! Pleasure to meet you." }, "victory": { "1": "Thank you! I saw what was missing in me.", @@ -1427,65 +1427,65 @@ "chili": { "encounter": { "1": "Yeeeeooow! Time to play with FIRE!! I'm the strongest of us brothers!", - "1_female": null, + "1_female": "Yeeeeooow! Time to play with FIRE!! I'm the strongest of us brothers!", "2": "Ta-da! The Fire-type scorcher Chili--that's me--will be your opponent!", - "2_female": null, + "2_female": "Ta-da! The Fire-type scorcher Chili--that's me--will be your opponent!", "3": "I'm going to show you what me and my blazing Fire types can do!", - "3_female": null + "3_female": "I'm going to show you what me and my blazing Fire types can do!" }, "victory": { "1": "You got me. I am… burned… out…", - "1_female": null, + "1_female": "You got me. I am… burned… out…", "2": "Whoa ho! You're on fire!", - "2_female": null, + "2_female": "Whoa ho! You're on fire!", "3": "Augh! You got me!" }, "defeat": { "1": "I'm on fire! Play with me, and you'll get burned!", - "1_female": null, + "1_female": "I'm on fire! Play with me, and you'll get burned!", "2": "When you play with fire, you get burned!", "3": "I mean, c'mon, your opponent was me! You didn't have a chance!", - "3_female": null + "3_female": "I mean, c'mon, your opponent was me! You didn't have a chance!" } }, "cilan": { "encounter": { "1": "Nothing personal... No hard feelings... Me and my Grass-type Pokémon will...\n$Um... We're gonna battle come what may.", - "1_female": null, + "1_female": "Nothing personal... No hard feelings... Me and my Grass-type Pokémon will...\n$Um... We're gonna battle come what may.", "2": "So, um, if you're OK with me, I'll, um, put everything I've got into being, er, you know, your opponent.", - "2_female": null, + "2_female": "So, um, if you're OK with me, I'll, um, put everything I've got into being, er, you know, your opponent.", "3": "OK… So, um, I'm Cilan, I like Grass-type Pokémon.", - "3_female": null + "3_female": "OK… So, um, I'm Cilan, I like Grass-type Pokémon." }, "victory": { "1": "Er… Is it over now?", - "1_female": null, + "1_female": "Er… Is it over now?", "2": "…What a surprise. You are very strong, aren't you? \n$I guess my brothers wouldn't have been able to defeat you either…", - "2_female": null, + "2_female": "…What a surprise. You are very strong, aren't you? \n$I guess my brothers wouldn't have been able to defeat you either…", "3": "…Huh. Looks like my timing was, um, off?" }, "defeat": { "1": "Huh? Did I win?", - "1_female": null, + "1_female": "Huh? Did I win?", "2": "I guess… \n$I suppose I won, because I've been competing with my brothers Chili and Cress, and we all were able to get tougher.", - "2_female": null, + "2_female": "I guess… \n$I suppose I won, because I've been competing with my brothers Chili and Cress, and we all were able to get tougher.", "3": "It…it was quite a thrilling experience…", - "3_female": null + "3_female": "It…it was quite a thrilling experience…" } }, "roark": { "encounter": { "1": "I need to see your potential as a Trainer. And, I'll need to see the toughness of the Pokémon that battle with you!", - "1_female": null, + "1_female": "I need to see your potential as a Trainer. And, I'll need to see the toughness of the Pokémon that battle with you!", "2": "Here goes! These are my rocking Pokémon, my pride and joy!", "3": "Rock-type Pokémon are simply the best!", "4": "I need to see your potential as a Trainer. And, I'll need to see the toughness of the Pokémon that battle with you!", - "4_female": null + "4_female": "I need to see your potential as a Trainer. And, I'll need to see the toughness of the Pokémon that battle with you!" }, "victory": { "1": "W-what? That can't be! My buffed-up Pokémon!", "2": "…We lost control there. Next time I'd like to challenge you to a Fossil-digging race underground.", - "2_female": null, + "2_female": "…We lost control there. Next time I'd like to challenge you to a Fossil-digging race underground.", "3": "With skill like yours, it's natural for you to win.", "4": "Wh-what?! It can't be! Even that wasn't enough?", "5": "I blew it." @@ -1508,7 +1508,7 @@ "victory": { "1": "I'm not good enough yet…", "2": "I see… Your journey has taken you to far-away places and you have witnessed much more than I.\n$I envy you for that…", - "2_female": null, + "2_female": "I see… Your journey has taken you to far-away places and you have witnessed much more than I.\n$I envy you for that…", "3": "How is this possible…", "4": "I don't think our potentials are so different.\n$But you seem to have something more than that… So be it.", "5": "Guess I need more training.", @@ -1568,13 +1568,13 @@ }, "defeat": { "1": "Heh heh! Don't mind me, just scooping up a W over here. I get it if you're upset, but don't go full Kieran on me, OK?", - "1_female": null + "1_female": "Heh heh! Don't mind me, just scooping up a W over here. I get it if you're upset, but don't go full Kieran on me, OK?" } }, "ramos": { "encounter": { "1": "Did yeh enjoy the garden playground I made with all these sturdy plants o' mine?\n$Their strength is a sign o' my strength as a gardener and a Gym Leader! Yeh sure yer up to facing all that?", - "1_female": null + "1_female": "Did yeh enjoy the garden playground I made with all these sturdy plants o' mine?\n$Their strength is a sign o' my strength as a gardener and a Gym Leader! Yeh sure yer up to facing all that?" }, "victory": { "1": "Yeh believe in yer Pokémon… And they believe in yeh, too… It was a fine battle, sprout." @@ -1605,7 +1605,7 @@ "victory": { "1": "I must say, I'm warmed up to you! I might even admire you a little.", "2": "Wow! You're great! You've earned my respect! \n$I think your focus and will bowled us over totally. ", - "2_female": null + "2_female": "Wow! You're great! You've earned my respect! \n$I think your focus and will bowled us over totally. " }, "defeat": { "1": "I sensed your will to win, but I don't lose!", @@ -1618,7 +1618,7 @@ }, "victory": { "1": "Amazing! You're very good, aren't you?", - "1_female": null + "1_female": "Amazing! You're very good, aren't you?" }, "defeat": { "1": "Yes! My Pokémon and I are perfectly good!" @@ -1660,7 +1660,7 @@ "clay": { "encounter": { "1": "Harrumph! Kept me waitin', didn't ya, kid? All right, time to see what ya can do!", - "1_female": null + "1_female": "Harrumph! Kept me waitin', didn't ya, kid? All right, time to see what ya can do!" }, "victory": { "1": "Man oh man… It feels good to go all out and still be defeated!" @@ -1675,7 +1675,7 @@ }, "victory": { "1": "Vaultin' Veluza! Yer a lively one, aren't ya! A little TOO lively, if I do say so myself!", - "1_female": null + "1_female": "Vaultin' Veluza! Yer a lively one, aren't ya! A little TOO lively, if I do say so myself!" }, "defeat": { "1": "You come back to see me again now, ya hear?" @@ -1742,7 +1742,7 @@ }, "victory": { "1": "Bravo. I realize now your authenticity and magnificence as a Pokémon Trainer. \n$I find much joy in having met you and your Pokémon. You have proven yourself worthy.", - "1_female": null + "1_female": "Bravo. I realize now your authenticity and magnificence as a Pokémon Trainer. \n$I find much joy in having met you and your Pokémon. You have proven yourself worthy." }, "defeat": { "1": "A grand illusion!" @@ -1751,14 +1751,14 @@ "lorelei": { "encounter": { "1": "No one can best me when it comes to icy Pokémon! Freezing moves are powerful!\n$Your Pokémon will be at my mercy when they are frozen solid! Hahaha! Are you ready?", - "1_female": null + "1_female": "No one can best me when it comes to icy Pokémon! Freezing moves are powerful!\n$Your Pokémon will be at my mercy when they are frozen solid! Hahaha! Are you ready?" }, "victory": { "1": "How dare you!" }, "defeat": { "1": "There's nothing you can do once you're frozen.", - "1_female": null + "1_female": "There's nothing you can do once you're frozen." } }, "will": { @@ -1775,11 +1775,11 @@ "malva": { "encounter": { "1": "I feel like my heart might just burst into flames. \n$I'm burning up with my hatred for you, runt!", - "1_female": null + "1_female": "I feel like my heart might just burst into flames. \n$I'm burning up with my hatred for you, runt!" }, "victory": { "1": "What news… So a new challenger has defeated Malva!", - "1_female": null + "1_female": "What news… So a new challenger has defeated Malva!" }, "defeat": { "1": "I am delighted! Yes, delighted that I could squash you beneath my heel." @@ -1802,7 +1802,7 @@ }, "victory": { "1": "I certainly found an interesting Trainer to face!", - "1_female": null + "1_female": "I certainly found an interesting Trainer to face!" }, "defeat": { "1": "Ahaha. What an interesting battle." @@ -1814,11 +1814,11 @@ }, "victory": { "1": "Not bad, kiddo.", - "1_female": null + "1_female": "Not bad, kiddo." }, "defeat": { "1": "Nahahaha! You really are something else, kiddo!", - "1_female": null + "1_female": "Nahahaha! You really are something else, kiddo!" } }, "bruno": { @@ -1838,7 +1838,7 @@ }, "victory": { "1": "Whoa, amazing! You're an expert on Pokémon!\nMy research isn't complete yet. OK, you win.", - "1_female": null + "1_female": "Whoa, amazing! You're an expert on Pokémon!\nMy research isn't complete yet. OK, you win." }, "defeat": { "1": "Thanks! Thanks to our battle, I was also able to make progress in my research!" @@ -1869,11 +1869,11 @@ "lenora": { "encounter": { "1": "Well then, challenger, I'm going to research how you battle with the Pokémon you've so lovingly raised!", - "1_female": null + "1_female": "Well then, challenger, I'm going to research how you battle with the Pokémon you've so lovingly raised!" }, "victory": { "1": "My theory about you was correct. You're more than just talented… You're motivated! I salute you!", - "1_female": null + "1_female": "My theory about you was correct. You're more than just talented… You're motivated! I salute you!" }, "defeat": { "1": "Ah ha ha! If you lose, make sure to analyze why, and use that knowledge in your next battle!" @@ -1899,7 +1899,7 @@ }, "defeat": { "1": "Hey, c'mon! Get serious! You gotta put more out there!", - "1_female": null + "1_female": "Hey, c'mon! Get serious! You gotta put more out there!" } }, "olivia": { @@ -1938,7 +1938,7 @@ "flint": { "encounter": { "1": "Hope you're warmed up, cause here comes the Big Bang!", - "1_female": null + "1_female": "Hope you're warmed up, cause here comes the Big Bang!" }, "victory": { "1": "Incredible! Your moves are so hot, they make mine look lukewarm!" @@ -1961,7 +1961,7 @@ "caitlin": { "encounter": { "1": "It's me who appeared when the flower opened up. You who have been waiting…\n$You look like a Pokémon Trainer with refined strength and deepened kindness. \n$What I look for in my opponent is superb strength… \n$Please unleash your power to the fullest!", - "1_female": null + "1_female": "It's me who appeared when the flower opened up. You who have been waiting…\n$You look like a Pokémon Trainer with refined strength and deepened kindness. \n$What I look for in my opponent is superb strength… \n$Please unleash your power to the fullest!" }, "victory": { "1": "My Pokémon and I learned so much! I offer you my thanks." @@ -1984,15 +1984,15 @@ "wikstrom": { "encounter": { "1": "Well met, young challenger! Verily am I the famed blade of hardened steel, Duke Wikstrom! \n$Let the battle begin! En garde!", - "1_female": null + "1_female": "Well met, young challenger! Verily am I the famed blade of hardened steel, Duke Wikstrom! \n$Let the battle begin! En garde!" }, "victory": { "1": "Glorious! The trust that you share with your honorable Pokémon surpasses even mine!", - "1_female": null + "1_female": "Glorious! The trust that you share with your honorable Pokémon surpasses even mine!" }, "defeat": { "1": "What manner of magic is this? My heart, it doth hammer ceaselessly in my breast! \n$Winning against such a worthy opponent doth give my soul wings--thus do I soar!", - "1_female": null + "1_female": "What manner of magic is this? My heart, it doth hammer ceaselessly in my breast! \n$Winning against such a worthy opponent doth give my soul wings--thus do I soar!" } }, "acerola": { @@ -2024,14 +2024,14 @@ }, "victory": { "1": "You got me. You are magnificent!", - "1_female": null, + "1_female": "You got me. You are magnificent!", "2": "I never expected another trainer to beat me… I'm surprised.", - "2_female": null + "2_female": "I never expected another trainer to beat me… I'm surprised." }, "defeat": { "1": "That was close. Want to try again?", "2": "It's not that you are weak. Don't let it bother you.", - "2_female": null + "2_female": "It's not that you are weak. Don't let it bother you." } }, "karen": { @@ -2057,7 +2057,7 @@ }, "victory": { "1": "The power of Grass has wilted… What an incredible Challenger!", - "1_female": null + "1_female": "The power of Grass has wilted… What an incredible Challenger!" }, "defeat": { "1": "This'll really leave you in shock and awe." @@ -2077,7 +2077,7 @@ "drasna": { "encounter": { "1": "You must be a strong Trainer. Yes, quite strong indeed…\n$That's just wonderful news! Facing opponents like you and your team will make my Pokémon grow like weeds!", - "1_female": null + "1_female": "You must be a strong Trainer. Yes, quite strong indeed…\n$That's just wonderful news! Facing opponents like you and your team will make my Pokémon grow like weeds!" }, "victory": { "1": "Oh, dear me. That sure was a quick battle… I do hope you'll come back again sometime!" @@ -2111,7 +2111,7 @@ "blue": { "encounter": { "1": "You must be pretty good to get this far.", - "1_female": null + "1_female": "You must be pretty good to get this far." }, "victory": { "1": "I've only lost to him and now to you… Him? Hee, hee…" @@ -2159,7 +2159,7 @@ }, "victory": { "1": "This is the emergence of a new Champion.", - "1_female": null + "1_female": "This is the emergence of a new Champion." }, "defeat": { "1": "I successfully defended my Championship." @@ -2248,7 +2248,7 @@ }, "victory": { "1": "Waaah! Waaah! You're so mean!", - "1_female": null + "1_female": "Waaah! Waaah! You're so mean!" }, "defeat": { "1": "And that's that!" @@ -2257,7 +2257,7 @@ "chuck": { "encounter": { "1": "Hah! You want to challenge me? Are you brave or just ignorant?", - "1_female": null + "1_female": "Hah! You want to challenge me? Are you brave or just ignorant?" }, "victory": { "1": "You're strong! Would you please make me your apprentice?" @@ -2269,7 +2269,7 @@ "katy": { "encounter": { "1": "Don't let your guard down unless you would like to find yourself knocked off your feet!", - "1_female": null + "1_female": "Don't let your guard down unless you would like to find yourself knocked off your feet!" }, "victory": { "1": "All of my sweet little Pokémon dropped like flies!" @@ -2303,7 +2303,7 @@ "maylene": { "encounter": { "1": "I've come to challenge you now, and I won't hold anything back. \n$Please prepare yourself for battle!", - "1_female": null + "1_female": "I've come to challenge you now, and I won't hold anything back. \n$Please prepare yourself for battle!" }, "victory": { "1": "I admit defeat…" @@ -2326,7 +2326,7 @@ "byron": { "encounter": { "1": "Trainer! You're young, just like my son, Roark. \n$With more young Trainers taking charge, the future of Pokémon is bright! \n$So, as a wall for young people, I'll take your challenge!", - "1_female": null + "1_female": "Trainer! You're young, just like my son, Roark. \n$With more young Trainers taking charge, the future of Pokémon is bright! \n$So, as a wall for young people, I'll take your challenge!" }, "victory": { "1": "Hmm! My sturdy Pokémon--defeated!" @@ -2349,7 +2349,7 @@ "volkner": { "encounter": { "1": "Since you've come this far, you must be quite strong…\n$I hope you're the Trainer who'll make me remember how fun it is to battle!", - "1_female": null + "1_female": "Since you've come this far, you must be quite strong…\n$I hope you're the Trainer who'll make me remember how fun it is to battle!" }, "victory": { "1": "You've got me beat…\n$Your desire and the noble way your Pokémon battled for you… \n$I even felt thrilled during our match. That was a very good battle." @@ -2452,7 +2452,7 @@ "valerie": { "encounter": { "1": "Oh, if it isn't a young Trainer… It is lovely to get to meet you like this. \n$Then I suppose you have earned yourself the right to a battle, as a reward for your efforts. \n$The elusive Fairy may appear frail as the breeze and delicate as a bloom, but it is strong.", - "1_female": null + "1_female": "Oh, if it isn't a young Trainer… It is lovely to get to meet you like this. \n$Then I suppose you have earned yourself the right to a battle, as a reward for your efforts. \n$The elusive Fairy may appear frail as the breeze and delicate as a bloom, but it is strong." }, "victory": { "1": "I hope that you will find things worth smiling about tomorrow…" @@ -2500,7 +2500,7 @@ }, "victory": { "1": "Your pink is still lacking, but you're an excellent Trainer with excellent Pokémon.", - "1_female": null + "1_female": "Your pink is still lacking, but you're an excellent Trainer with excellent Pokémon." }, "defeat": { "1": "Too bad for you, I guess." @@ -2509,7 +2509,7 @@ "bede": { "encounter": { "1": "I suppose I should prove beyond doubt just how pathetic you are and how strong I am.", - "1_female": null + "1_female": "I suppose I should prove beyond doubt just how pathetic you are and how strong I am." }, "victory": { "1": "I see… Well, that's fine. I wasn't really trying all that hard anyway." @@ -2554,7 +2554,7 @@ "brassius": { "encounter": { "1": "I assume you are ready? Let our collaborative work of art begin!", - "1_female": null + "1_female": "I assume you are ready? Let our collaborative work of art begin!" }, "victory": { "1": "Ahhh…vant-garde!" @@ -2566,11 +2566,11 @@ "iono": { "encounter": { "1": "How're ya feelin' about this battle?\n$...\n$Let's get this show on the road! How strong is our challenger? \n$I 'unno! Let's find out together!", - "1_female": null + "1_female": "How're ya feelin' about this battle?\n$...\n$Let's get this show on the road! How strong is our challenger? \n$I 'unno! Let's find out together!" }, "victory": { "1": "You're as flashy and bright as a 10,000,000-volt Thunderbolt, friendo!", - "1_female": null + "1_female": "You're as flashy and bright as a 10,000,000-volt Thunderbolt, friendo!" }, "defeat": { "1": "Your eyeballs are MINE!" @@ -2593,7 +2593,7 @@ }, "victory": { "1": "You're cool, my friend—you move my SOUL!", - "1_female": null + "1_female": "You're cool, my friend—you move my SOUL!" }, "defeat": { "1": "Later, baby!" @@ -2627,9 +2627,9 @@ "nessa_elite": { "encounter": { "1": "The tides are turning in my favor. Ready to get swept away?", - "1_female": null, + "1_female": "The tides are turning in my favor. Ready to get swept away?", "2": "Let's make some waves with this battle! I hope you're prepared!", - "2_female": null + "2_female": "Let's make some waves with this battle! I hope you're prepared!" }, "victory": { "1": "You navigated those waters perfectly... Well done!", @@ -2657,7 +2657,7 @@ "allister_elite": { "encounter": { "1": "Shadows fall... Are you ready to face your fears?", - "1_female": null, + "1_female": "Shadows fall... Are you ready to face your fears?", "2": "Let's see if you can handle the darkness that I command." }, "victory": { @@ -2681,7 +2681,7 @@ "defeat": { "1": "Another storm weathered, another victory claimed! Well fought!", "2": "You got caught in my storm! Better luck next time!", - "2_female": null + "2_female": "You got caught in my storm! Better luck next time!" } }, "alder": { diff --git a/src/locales/es/modifier.json b/src/locales/es/modifier.json index 593b3df2f0f..a94e41a4574 100644 --- a/src/locales/es/modifier.json +++ b/src/locales/es/modifier.json @@ -1,3 +1,12 @@ { - "bypassSpeedChanceApply": "¡Gracias {{itemName}} {{pokemonName}} puede tener prioridad!" -} \ No newline at end of file + "surviveDamageApply": "{{pokemonNameWithAffix}} ha usado {{typeName}} y ha logrado resistir!", + "turnHealApply": "{{pokemonNameWithAffix}} ha recuperado unos pocos PS gracias a {{typeName}}!", + "hitHealApply": "{{pokemonNameWithAffix}} ha recuperado unos pocos PS gracias a {{typeName}}!", + "pokemonInstantReviveApply": "{{pokemonNameWithAffix}} ha sido revivido gracias a su {{typeName}}!", + "pokemonResetNegativeStatStageApply": "Las estadísticas bajadas de {{pokemonNameWithAffix}} fueron restauradas gracias a {{typeName}}!", + "moneyInterestApply": "Recibiste intereses de ₽{{moneyAmount}}\ngracias a {{typeName}}!", + "turnHeldItemTransferApply": "{{pokemonNameWithAffix}}'s {{itemName}} fue absorbido\npor {{pokemonName}}'s {{typeName}}!", + "contactHeldItemTransferApply": "{{pokemonNameWithAffix}}'s {{itemName}} fue robado por {{pokemonName}}'s {{typeName}}!", + "enemyTurnHealApply": "¡{{pokemonNameWithAffix}}\nrecuperó algunos PS!", + "bypassSpeedChanceApply": "¡Gracias a su {{itemName}}, {{pokemonName}} puede tener prioridad!" +} diff --git a/src/locales/es/splash-messages.json b/src/locales/es/splash-messages.json index 90ce3593b89..b1d4820b06e 100644 --- a/src/locales/es/splash-messages.json +++ b/src/locales/es/splash-messages.json @@ -3,12 +3,12 @@ "joinTheDiscord": "¡Únete al Discord!", "infiniteLevels": "¡Niveles infinitos!", "everythingStacks": "¡Todo se acumula!", - "optionalSaveScumming": "¡Trampas guardando (¡opcionales!)!", + "optionalSaveScumming": "¡Trampas de guardado opcionales!", "biomes": "¡35 biomas!", "openSource": "¡Código abierto!", "playWithSpeed": "¡Juega a velocidad 5x!", - "liveBugTesting": "¡Arreglo de bugs sobre la marcha!", - "heavyInfluence": "¡Influencia Alta en RoR2!", + "liveBugTesting": "¡Testeo de bugs en directo!", + "heavyInfluence": "¡Mucha Influencia de RoR2!", "pokemonRiskAndPokemonRain": "¡Pokémon Risk y Pokémon Rain!", "nowWithMoreSalt": "¡Con un 33% más de polémica!", "infiniteFusionAtHome": "¡Infinite Fusion en casa!", @@ -17,16 +17,16 @@ "mubstitute": "¡Mubstituto!", "thatsCrazy": "¡De locos!", "oranceJuice": "¡Zumo de narancia!", - "questionableBalancing": "¡Balance cuestionable!", + "questionableBalancing": "¡Cambios en balance cuestionables!", "coolShaders": "¡Shaders impresionantes!", "aiFree": "¡Libre de IA!", "suddenDifficultySpikes": "¡Saltos de dificultad repentinos!", "basedOnAnUnfinishedFlashGame": "¡Basado en un juego Flash inacabado!", - "moreAddictiveThanIntended": "¡Más adictivo de la cuenta!", + "moreAddictiveThanIntended": "¡Más adictivo de lo previsto!", "mostlyConsistentSeeds": "¡Semillas CASI consistentes!", "achievementPointsDontDoAnything": "¡Los Puntos de Logro no hacen nada!", "youDoNotStartAtLevel": "¡No empiezas al nivel 2000!", - "dontTalkAboutTheManaphyEggIncident": "¡No hablen del incidente del Huevo Manaphy!", + "dontTalkAboutTheManaphyEggIncident": "¡No se habla del Incidente Manaphy!", "alsoTryPokengine": "¡Prueba también Pokéngine!", "alsoTryEmeraldRogue": "¡Prueba también Emerald Rogue!", "alsoTryRadicalRed": "¡Prueba también Radical Red!", diff --git a/src/locales/es/terrain.json b/src/locales/es/terrain.json index 9e26dfeeb6e..912f5186180 100644 --- a/src/locales/es/terrain.json +++ b/src/locales/es/terrain.json @@ -1 +1,16 @@ -{} \ No newline at end of file +{ + "misty": "Niebla", + "mistyStartMessage": "¡La niebla ha envuelto el terreno de combate!", + "mistyClearMessage": "La niebla se ha disipado.", + "mistyBlockMessage": "¡El campo de niebla ha protegido a {{pokemonNameWithAffix}} ", + "electric": "Eléctrico", + "electricStartMessage": "¡Se ha formado un campo de corriente eléctrica en el terreno\nde combate!", + "electricClearMessage": "El campo de corriente eléctrica ha desaparecido.\t", + "grassy": "Hierba", + "grassyStartMessage": "¡El terreno de combate se ha cubierto de hierba!", + "grassyClearMessage": "La hierba ha desaparecido.", + "psychic": "Psíquico", + "psychicStartMessage": "¡El terreno de combate se ha vuelto muy extraño!", + "psychicClearMessage": "Ha desaparecido la extraña sensación que se percibía en el terreno\nde combate.", + "defaultBlockMessage": "¡El campo {{terrainName}} ha protegido a {{pokemonNameWithAffix}} " +} diff --git a/src/locales/es/trainer-names.json b/src/locales/es/trainer-names.json index c6758366db7..ce09a0c9037 100644 --- a/src/locales/es/trainer-names.json +++ b/src/locales/es/trainer-names.json @@ -1,7 +1,7 @@ { "brock": "Brock", "misty": "Misty", - "lt_surge": "Tt. Surge", + "lt_surge": "Teniente Surge", "erika": "Erika", "janine": "Sachiko", "sabrina": "Sabrina", @@ -23,7 +23,7 @@ "winona": "Alana", "tate": "Vito", "liza": "Leti", - "juan": "Galán", + "juan": "Galano", "roark": "Roco", "gardenia": "Gardenia", "maylene": "Brega", @@ -34,7 +34,7 @@ "volkner": "Lectro", "cilan": "Millo", "chili": "Zeo", - "cress": "Maiz", + "cress": "Maíz", "cheren": "Cheren", "lenora": "Aloe", "roxie": "Hiedra", @@ -57,7 +57,7 @@ "nessa": "Cathy", "kabu": "Naboru", "bea": "Judith", - "allister": "Allistair", + "allister": "Alistair", "opal": "Sally", "bede": "Berto", "gordie": "Morris", @@ -123,30 +123,28 @@ "leon": "Lionel", "rival": "Finn", "rival_female": "Ivy", - "archer": "Archer", - "ariana": "Ariana", - "proton": "Proton", + "archer": "Atlas", + "ariana": "Atenea", + "proton": "Protón", "petrel": "Petrel", - "tabitha": "Tabitha", - "courtney": "Courtney", - "shelly": "Shelly", - "matt": "Matt", - "mars": "Mars", - "jupiter": "Jupiter", - "saturn": "Saturn", - "zinzolin": "Zinzolin", - "rood": "Rood", - "xerosic": "Xerosic", - "bryony": "Bryony", + "tabitha": "Tatiano", + "courtney": "Carola", + "shelly": "Silvina", + "matt": "Matías", + "mars": "Venus", + "jupiter": "Ceres", + "saturn": "Saturno", + "zinzolin": "Menek", + "rood": "Ruga", + "xerosic": "Xero", + "bryony": "Begonia", + "maxie": "Magno", + "archie": "Aquiles", + "cyrus": "Helio", + "ghetsis": "Ghechis", + "lysandre": "Lysson", "faba": "Fabio", - - "maxie": "Maxie", - "archie": "Archie", - "cyrus": "Cyrus", - "ghetsis": "Ghetsis", - "lysandre": "Lysandre", "lusamine": "Samina", - "blue_red_double": "Azul y Rojo", "red_blue_double": "Rojo y Azul", "tate_liza_double": "Vito y Leti", diff --git a/src/locales/fr/pokemon-summary.json b/src/locales/fr/pokemon-summary.json index f0b4f5a474f..01e712c8468 100644 --- a/src/locales/fr/pokemon-summary.json +++ b/src/locales/fr/pokemon-summary.json @@ -13,5 +13,32 @@ "metFragment": { "normal": "rencontré au N.{{level}},\n{{biome}}.", "apparently": "apparemment rencontré au N.{{level}},\n{{biome}}." + }, + "natureFragment": { + "Hardy": "{{nature}}", + "Lonely": "{{nature}}", + "Brave": "{{nature}}", + "Adamant": "{{nature}}", + "Naughty": "{{nature}}", + "Bold": "{{nature}}", + "Docile": "{{nature}}", + "Relaxed": "{{nature}}", + "Impish": "{{nature}}", + "Lax": "{{nature}}", + "Timid": "{{nature}}", + "Hasty": "{{nature}}", + "Serious": "{{nature}}", + "Jolly": "{{nature}}", + "Naive": "{{nature}}", + "Modest": "{{nature}}", + "Mild": "{{nature}}", + "Quiet": "{{nature}}", + "Bashful": "{{nature}}", + "Rash": "{{nature}}", + "Calm": "{{nature}}", + "Gentle": "{{nature}}", + "Sassy": "{{nature}}", + "Careful": "{{nature}}", + "Quirky": "{{nature}}" } -} \ No newline at end of file +} diff --git a/src/locales/ko/achv.json b/src/locales/ko/achv.json index 8546dff949c..b9fd327ef3b 100644 --- a/src/locales/ko/achv.json +++ b/src/locales/ko/achv.json @@ -225,7 +225,7 @@ "name": "독침붕처럼 쏴라" }, "MONO_GHOST": { - "name": "누굴 부를 거야?" + "name": "무서운 게 딱 좋아!" }, "MONO_STEEL": { "name": "강철 심장" @@ -265,4 +265,4 @@ "name": "상성 전문가(였던 것)", "description": "거꾸로 배틀 챌린지 모드 클리어." } -} \ No newline at end of file +} diff --git a/src/phases/field-phase.ts b/src/phases/field-phase.ts index a9622271f14..02d1f1395d3 100644 --- a/src/phases/field-phase.ts +++ b/src/phases/field-phase.ts @@ -1,42 +1,9 @@ -import { BattlerIndex } from "#app/battle.js"; -import { TrickRoomTag } from "#app/data/arena-tag.js"; -import { Stat } from "#app/enums/stat.js"; -import Pokemon from "#app/field/pokemon.js"; import { BattlePhase } from "./battle-phase"; -import * as Utils from "#app/utils.js"; +import Pokemon from "#app/field/pokemon"; type PokemonFunc = (pokemon: Pokemon) => void; export abstract class FieldPhase extends BattlePhase { - getOrder(): BattlerIndex[] { - const playerField = this.scene.getPlayerField().filter(p => p.isActive()) as Pokemon[]; - const enemyField = this.scene.getEnemyField().filter(p => p.isActive()) as Pokemon[]; - - // We shuffle the list before sorting so speed ties produce random results - let orderedTargets: Pokemon[] = playerField.concat(enemyField); - // We seed it with the current turn to prevent an inconsistency where it - // was varying based on how long since you last reloaded - this.scene.executeWithSeedOffset(() => { - orderedTargets = Utils.randSeedShuffle(orderedTargets); - }, this.scene.currentBattle.turn, this.scene.waveSeed); - - orderedTargets.sort((a: Pokemon, b: Pokemon) => { - const aSpeed = a?.getBattleStat(Stat.SPD) || 0; - const bSpeed = b?.getBattleStat(Stat.SPD) || 0; - - return bSpeed - aSpeed; - }); - - const speedReversed = new Utils.BooleanHolder(false); - this.scene.arena.applyTags(TrickRoomTag, speedReversed); - - if (speedReversed.value) { - orderedTargets = orderedTargets.reverse(); - } - - return orderedTargets.map(t => t.getFieldIndex() + (!t.isPlayer() ? BattlerIndex.ENEMY : 0)); - } - executeForAll(func: PokemonFunc): void { const field = this.scene.getField(true).filter(p => p.summonData); field.forEach(pokemon => func(pokemon)); diff --git a/src/phases/stat-change-phase.ts b/src/phases/stat-change-phase.ts index 856d0a33eea..3116c49e8ef 100644 --- a/src/phases/stat-change-phase.ts +++ b/src/phases/stat-change-phase.ts @@ -1,14 +1,14 @@ -import BattleScene from "#app/battle-scene.js"; -import { BattlerIndex } from "#app/battle.js"; -import { applyPreStatChangeAbAttrs, ProtectStatAbAttr, applyAbAttrs, StatChangeMultiplierAbAttr, StatChangeCopyAbAttr, applyPostStatChangeAbAttrs, PostStatChangeAbAttr } from "#app/data/ability.js"; -import { MistTag, ArenaTagSide } from "#app/data/arena-tag.js"; -import { BattleStat, getBattleStatName, getBattleStatLevelChangeDescription } from "#app/data/battle-stat.js"; -import Pokemon from "#app/field/pokemon.js"; -import { getPokemonNameWithAffix } from "#app/messages.js"; -import { PokemonResetNegativeStatStageModifier } from "#app/modifier/modifier.js"; -import { handleTutorial, Tutorial } from "#app/tutorial.js"; +import { BattlerIndex } from "#app/battle"; +import BattleScene from "#app/battle-scene"; +import { applyAbAttrs, applyPostStatChangeAbAttrs, applyPreStatChangeAbAttrs, PostStatChangeAbAttr, ProtectStatAbAttr, StatChangeCopyAbAttr, StatChangeMultiplierAbAttr } from "#app/data/ability"; +import { ArenaTagSide, MistTag } from "#app/data/arena-tag"; +import { BattleStat, getBattleStatLevelChangeDescription, getBattleStatName } from "#app/data/battle-stat"; +import Pokemon from "#app/field/pokemon"; +import { getPokemonNameWithAffix } from "#app/messages"; +import { PokemonResetNegativeStatStageModifier } from "#app/modifier/modifier"; +import { handleTutorial, Tutorial } from "#app/tutorial"; +import * as Utils from "#app/utils"; import i18next from "i18next"; -import * as Utils from "#app/utils.js"; import { PokemonPhase } from "./pokemon-phase"; export type StatChangeCallback = (target: Pokemon | null, changed: BattleStat[], relativeChanges: number[]) => void; @@ -72,7 +72,7 @@ export class StatChangePhase extends PokemonPhase { } const battleStats = this.getPokemon().summonData.battleStats; - const relLevels = filteredStats.map(stat => (levels.value >= 1 ? Math.min(battleStats![stat] + levels.value, 6) : Math.max(battleStats![stat] + levels.value, -6)) - battleStats![stat]); + const relLevels = filteredStats.map(stat => (levels.value >= 1 ? Math.min(battleStats[stat] + levels.value, 6) : Math.max(battleStats[stat] + levels.value, -6)) - battleStats[stat]); this.onChange && this.onChange(this.getPokemon(), filteredStats, relLevels); @@ -85,6 +85,20 @@ export class StatChangePhase extends PokemonPhase { } for (const stat of filteredStats) { + if (levels.value > 0 && pokemon.summonData.battleStats[stat] < 6) { + if (!pokemon.turnData) { + // Temporary fix for missing turn data struct on turn 1 + pokemon.resetTurnData(); + } + pokemon.turnData.battleStatsIncreased = true; + } else if (levels.value < 0 && pokemon.summonData.battleStats[stat] > -6) { + if (!pokemon.turnData) { + // Temporary fix for missing turn data struct on turn 1 + pokemon.resetTurnData(); + } + pokemon.turnData.battleStatsDecreased = true; + } + pokemon.summonData.battleStats[stat] = Math.max(Math.min(pokemon.summonData.battleStats[stat] + levels.value, 6), -6); } diff --git a/src/phases/turn-start-phase.ts b/src/phases/turn-start-phase.ts index e4064fc784a..b2545e9ee30 100644 --- a/src/phases/turn-start-phase.ts +++ b/src/phases/turn-start-phase.ts @@ -1,12 +1,12 @@ -import BattleScene from "#app/battle-scene.js"; -import { applyAbAttrs, BypassSpeedChanceAbAttr, PreventBypassSpeedChanceAbAttr, ChangeMovePriorityAbAttr } from "#app/data/ability.js"; -import { allMoves, applyMoveAttrs, IncrementMovePriorityAttr, MoveHeaderAttr } from "#app/data/move.js"; -import { Abilities } from "#app/enums/abilities.js"; -import { Stat } from "#app/enums/stat.js"; -import { PokemonMove } from "#app/field/pokemon.js"; -import { BypassSpeedChanceModifier } from "#app/modifier/modifier.js"; -import { Command } from "#app/ui/command-ui-handler.js"; -import * as Utils from "#app/utils.js"; +import BattleScene from "#app/battle-scene"; +import { applyAbAttrs, BypassSpeedChanceAbAttr, PreventBypassSpeedChanceAbAttr, ChangeMovePriorityAbAttr } from "#app/data/ability"; +import { allMoves, applyMoveAttrs, IncrementMovePriorityAttr, MoveHeaderAttr } from "#app/data/move"; +import { Abilities } from "#app/enums/abilities"; +import { Stat } from "#app/enums/stat"; +import Pokemon, { PokemonMove } from "#app/field/pokemon"; +import { BypassSpeedChanceModifier } from "#app/modifier/modifier"; +import { Command } from "#app/ui/command-ui-handler"; +import * as Utils from "#app/utils"; import { AttemptCapturePhase } from "./attempt-capture-phase"; import { AttemptRunPhase } from "./attempt-run-phase"; import { BerryPhase } from "./berry-phase"; @@ -17,18 +17,59 @@ import { PostTurnStatusEffectPhase } from "./post-turn-status-effect-phase"; import { SwitchSummonPhase } from "./switch-summon-phase"; import { TurnEndPhase } from "./turn-end-phase"; import { WeatherEffectPhase } from "./weather-effect-phase"; +import { BattlerIndex } from "#app/battle"; +import { TrickRoomTag } from "#app/data/arena-tag"; export class TurnStartPhase extends FieldPhase { constructor(scene: BattleScene) { super(scene); } - start() { - super.start(); + /** + * This orders the active Pokemon on the field by speed into an BattlerIndex array and returns that array. + * It also checks for Trick Room and reverses the array if it is present. + * @returns {@linkcode BattlerIndex[]} the battle indices of all pokemon on the field ordered by speed + */ + getSpeedOrder(): BattlerIndex[] { + const playerField = this.scene.getPlayerField().filter(p => p.isActive()) as Pokemon[]; + const enemyField = this.scene.getEnemyField().filter(p => p.isActive()) as Pokemon[]; - const field = this.scene.getField(); - const order = this.getOrder(); + // We shuffle the list before sorting so speed ties produce random results + let orderedTargets: Pokemon[] = playerField.concat(enemyField); + // We seed it with the current turn to prevent an inconsistency where it + // was varying based on how long since you last reloaded + this.scene.executeWithSeedOffset(() => { + orderedTargets = Utils.randSeedShuffle(orderedTargets); + }, this.scene.currentBattle.turn, this.scene.waveSeed); + orderedTargets.sort((a: Pokemon, b: Pokemon) => { + const aSpeed = a?.getBattleStat(Stat.SPD) || 0; + const bSpeed = b?.getBattleStat(Stat.SPD) || 0; + + return bSpeed - aSpeed; + }); + + // Next, a check for Trick Room is applied. If Trick Room is present, the order is reversed. + const speedReversed = new Utils.BooleanHolder(false); + this.scene.arena.applyTags(TrickRoomTag, speedReversed); + + if (speedReversed.value) { + orderedTargets = orderedTargets.reverse(); + } + + return orderedTargets.map(t => t.getFieldIndex() + (!t.isPlayer() ? BattlerIndex.ENEMY : BattlerIndex.PLAYER)); + } + + /** + * This takes the result of getSpeedOrder and applies priority / bypass speed attributes to it. + * This also considers the priority levels of various commands and changes the result of getSpeedOrder based on such. + * @returns {@linkcode BattlerIndex[]} the final sequence of commands for this turn + */ + getCommandOrder(): BattlerIndex[] { + let moveOrder = this.getSpeedOrder(); + // The creation of the battlerBypassSpeed object contains checks for the ability Quick Draw and the held item Quick Claw + // The ability Mycelium Might disables Quick Claw's activation when using a status move + // This occurs before the main loop because of battles with more than two Pokemon const battlerBypassSpeed = {}; this.scene.getField(true).filter(p => p.summonData).map(p => { @@ -42,8 +83,9 @@ export class TurnStartPhase extends FieldPhase { battlerBypassSpeed[p.getBattlerIndex()] = bypassSpeed; }); - const moveOrder = order.slice(0); - + // The function begins sorting orderedTargets based on command priority, move priority, and possible speed bypasses. + // Non-FIGHT commands (SWITCH, BALL, RUN) have a higher command priority and will always occur before any FIGHT commands. + moveOrder = moveOrder.slice(0); moveOrder.sort((a, b) => { const aCommand = this.scene.currentBattle.turnCommands[a]; const bCommand = this.scene.currentBattle.turnCommands[b]; @@ -55,37 +97,50 @@ export class TurnStartPhase extends FieldPhase { return -1; } } else if (aCommand?.command === Command.FIGHT) { - const aMove = allMoves[aCommand.move!.move];//TODO: is the bang correct here? - const bMove = allMoves[bCommand!.move!.move];//TODO: is the bang correct here? + const aMove = allMoves[aCommand.move!.move]; + const bMove = allMoves[bCommand!.move!.move]; + // The game now considers priority and applies the relevant move and ability attributes const aPriority = new Utils.IntegerHolder(aMove.priority); const bPriority = new Utils.IntegerHolder(bMove.priority); - applyMoveAttrs(IncrementMovePriorityAttr, this.scene.getField().find(p => p?.isActive() && p.getBattlerIndex() === a)!, null, aMove, aPriority); //TODO: is the bang correct here? - applyMoveAttrs(IncrementMovePriorityAttr, this.scene.getField().find(p => p?.isActive() && p.getBattlerIndex() === b)!, null, bMove, bPriority); //TODO: is the bang correct here? + applyMoveAttrs(IncrementMovePriorityAttr, this.scene.getField().find(p => p?.isActive() && p.getBattlerIndex() === a)!, null, aMove, aPriority); + applyMoveAttrs(IncrementMovePriorityAttr, this.scene.getField().find(p => p?.isActive() && p.getBattlerIndex() === b)!, null, bMove, bPriority); - applyAbAttrs(ChangeMovePriorityAbAttr, this.scene.getField().find(p => p?.isActive() && p.getBattlerIndex() === a)!, null, false, aMove, aPriority); //TODO: is the bang correct here? - applyAbAttrs(ChangeMovePriorityAbAttr, this.scene.getField().find(p => p?.isActive() && p.getBattlerIndex() === b)!, null, false, bMove, bPriority); //TODO: is the bang correct here? + applyAbAttrs(ChangeMovePriorityAbAttr, this.scene.getField().find(p => p?.isActive() && p.getBattlerIndex() === a)!, null, false, aMove, aPriority); + applyAbAttrs(ChangeMovePriorityAbAttr, this.scene.getField().find(p => p?.isActive() && p.getBattlerIndex() === b)!, null, false, bMove, bPriority); + // The game now checks for differences in priority levels. + // If the moves share the same original priority bracket, it can check for differences in battlerBypassSpeed and return the result. + // This conditional is used to ensure that Quick Claw can still activate with abilities like Stall and Mycelium Might (attack moves only) + // Otherwise, the game returns the user of the move with the highest priority. + const isSameBracket = Math.ceil(aPriority.value) - Math.ceil(bPriority.value) === 0; if (aPriority.value !== bPriority.value) { - const bracketDifference = Math.ceil(aPriority.value) - Math.ceil(bPriority.value); - const hasSpeedDifference = battlerBypassSpeed[a].value !== battlerBypassSpeed[b].value; - if (bracketDifference === 0 && hasSpeedDifference) { + if (isSameBracket && battlerBypassSpeed[a].value !== battlerBypassSpeed[b].value) { return battlerBypassSpeed[a].value ? -1 : 1; } return aPriority.value < bPriority.value ? 1 : -1; } } + // If there is no difference between the move's calculated priorities, the game checks for differences in battlerBypassSpeed and returns the result. if (battlerBypassSpeed[a].value !== battlerBypassSpeed[b].value) { return battlerBypassSpeed[a].value ? -1 : 1; } - const aIndex = order.indexOf(a); - const bIndex = order.indexOf(b); + const aIndex = moveOrder.indexOf(a); + const bIndex = moveOrder.indexOf(b); return aIndex < bIndex ? -1 : aIndex > bIndex ? 1 : 0; }); + return moveOrder; + } + + start() { + super.start(); + + const field = this.scene.getField(); + const moveOrder = this.getCommandOrder(); let orderIndex = 0; @@ -150,10 +205,9 @@ export class TurnStartPhase extends FieldPhase { } } - this.scene.pushPhase(new WeatherEffectPhase(this.scene)); - for (const o of order) { + for (const o of moveOrder) { if (field[o].status && field[o].status.isPostTurn()) { this.scene.pushPhase(new PostTurnStatusEffectPhase(this.scene, o)); } diff --git a/src/test/abilities/flower_gift.test.ts b/src/test/abilities/flower_gift.test.ts new file mode 100644 index 00000000000..f8c1141386d --- /dev/null +++ b/src/test/abilities/flower_gift.test.ts @@ -0,0 +1,154 @@ +import { BattlerIndex } from "#app/battle"; +import { Abilities } from "#app/enums/abilities"; +import { Stat } from "#app/enums/stat"; +import { WeatherType } from "#app/enums/weather-type"; +import { Moves } from "#enums/moves"; +import { Species } from "#enums/species"; +import GameManager from "#test/utils/gameManager"; +import { SPLASH_ONLY } from "#test/utils/testUtils"; +import Phaser from "phaser"; +import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest"; + +describe("Abilities - Flower Gift", () => { + let phaserGame: Phaser.Game; + let game: GameManager; + const OVERCAST_FORM = 0; + const SUNSHINE_FORM = 1; + + /** + * Tests reverting to normal form when Cloud Nine/Air Lock is active on the field + * @param {GameManager} game The game manager instance + * @param {Abilities} ability The ability that is active on the field + */ + const testRevertFormAgainstAbility = async (game: GameManager, ability: Abilities) => { + game.override.starterForms({ [Species.CASTFORM]: SUNSHINE_FORM }).enemyAbility(ability); + await game.classicMode.startBattle([Species.CASTFORM]); + + game.move.select(Moves.SPLASH); + + expect(game.scene.getPlayerPokemon()?.formIndex).toBe(OVERCAST_FORM); + }; + + beforeAll(() => { + phaserGame = new Phaser.Game({ + type: Phaser.HEADLESS, + }); + }); + + afterEach(() => { + game.phaseInterceptor.restoreOg(); + }); + + beforeEach(() => { + game = new GameManager(phaserGame); + game.override + .moveset([Moves.SPLASH, Moves.RAIN_DANCE, Moves.SUNNY_DAY, Moves.SKILL_SWAP]) + .enemySpecies(Species.MAGIKARP) + .enemyMoveset(SPLASH_ONLY) + .enemyAbility(Abilities.BALL_FETCH); + }); + + // TODO: Uncomment expect statements when the ability is implemented - currently does not increase stats of allies + it("increases the Attack and Special Defense stats of the Pokémon with this Ability and its allies by 1.5× during Harsh Sunlight", async () => { + game.override.battleType("double"); + await game.classicMode.startBattle([Species.CHERRIM, Species.MAGIKARP]); + + const [ cherrim ] = game.scene.getPlayerField(); + const cherrimAtkStat = cherrim.getBattleStat(Stat.ATK); + const cherrimSpDefStat = cherrim.getBattleStat(Stat.SPDEF); + + // const magikarpAtkStat = magikarp.getBattleStat(Stat.ATK);; + // const magikarpSpDefStat = magikarp.getBattleStat(Stat.SPDEF); + + game.move.select(Moves.SUNNY_DAY, 0); + game.move.select(Moves.SPLASH, 1); + + await game.setTurnOrder([BattlerIndex.PLAYER, BattlerIndex.PLAYER_2, BattlerIndex.ENEMY, BattlerIndex.ENEMY_2]); + await game.phaseInterceptor.to("TurnEndPhase"); + + expect(cherrim.formIndex).toBe(SUNSHINE_FORM); + expect(cherrim.getBattleStat(Stat.ATK)).toBe(Math.floor(cherrimAtkStat * 1.5)); + expect(cherrim.getBattleStat(Stat.SPDEF)).toBe(Math.floor(cherrimSpDefStat * 1.5)); + // expect(magikarp.getBattleStat(Stat.ATK)).toBe(Math.floor(magikarpAtkStat * 1.5)); + // expect(magikarp.getBattleStat(Stat.SPDEF)).toBe(Math.floor(magikarpSpDefStat * 1.5)); + }); + + it("changes the Pokemon's form during Harsh Sunlight", async () => { + game.override.weather(WeatherType.HARSH_SUN); + await game.classicMode.startBattle([Species.CHERRIM]); + + const cherrim = game.scene.getPlayerPokemon()!; + expect(cherrim.formIndex).toBe(SUNSHINE_FORM); + + game.move.select(Moves.SPLASH); + }); + + it("reverts to Overcast Form if a Pokémon on the field has Air Lock", async () => { + await testRevertFormAgainstAbility(game, Abilities.AIR_LOCK); + }); + + it("reverts to Overcast Form if a Pokémon on the field has Cloud Nine", async () => { + await testRevertFormAgainstAbility(game, Abilities.CLOUD_NINE); + }); + + it("reverts to Overcast Form when the Pokémon loses Flower Gift, changes form under Harsh Sunlight/Sunny when it regains it", async () => { + game.override.enemyMoveset(Array(4).fill(Moves.SKILL_SWAP)).weather(WeatherType.HARSH_SUN); + + await game.classicMode.startBattle([Species.CHERRIM]); + + const cherrim = game.scene.getPlayerPokemon()!; + + game.move.select(Moves.SKILL_SWAP); + + await game.phaseInterceptor.to("TurnStartPhase"); + expect(cherrim.formIndex).toBe(SUNSHINE_FORM); + + await game.phaseInterceptor.to("MoveEndPhase"); + expect(cherrim.formIndex).toBe(OVERCAST_FORM); + + await game.phaseInterceptor.to("MoveEndPhase"); + expect(cherrim.formIndex).toBe(SUNSHINE_FORM); + }); + + it("reverts to Overcast Form when the Flower Gift is suppressed, changes form under Harsh Sunlight/Sunny when it regains it", async () => { + game.override.enemyMoveset(Array(4).fill(Moves.GASTRO_ACID)).weather(WeatherType.HARSH_SUN); + + await game.classicMode.startBattle([Species.CHERRIM, Species.MAGIKARP]); + + const cherrim = game.scene.getPlayerPokemon()!; + + expect(cherrim.formIndex).toBe(SUNSHINE_FORM); + + game.move.select(Moves.SPLASH); + await game.setTurnOrder([BattlerIndex.ENEMY, BattlerIndex.PLAYER]); + await game.phaseInterceptor.to("TurnEndPhase"); + + expect(cherrim.summonData.abilitySuppressed).toBe(true); + expect(cherrim.formIndex).toBe(OVERCAST_FORM); + + await game.toNextTurn(); + + game.doSwitchPokemon(1); + await game.toNextTurn(); + + game.doSwitchPokemon(1); + await game.phaseInterceptor.to("MovePhase"); + + expect(cherrim.summonData.abilitySuppressed).toBe(false); + expect(cherrim.formIndex).toBe(SUNSHINE_FORM); + }); + + it("should be in Overcast Form after the user is switched out", async () => { + game.override.weather(WeatherType.SUNNY); + + await game.classicMode.startBattle([Species.CASTFORM, Species.MAGIKARP]); + const cherrim = game.scene.getPlayerPokemon()!; + + expect(cherrim.formIndex).toBe(SUNSHINE_FORM); + + game.doSwitchPokemon(1); + await game.toNextTurn(); + + expect(cherrim.formIndex).toBe(OVERCAST_FORM); + }); +}); diff --git a/src/test/abilities/mycelium_might.test.ts b/src/test/abilities/mycelium_might.test.ts index 83396f7950f..d5bea185f59 100644 --- a/src/test/abilities/mycelium_might.test.ts +++ b/src/test/abilities/mycelium_might.test.ts @@ -1,6 +1,6 @@ import { BattleStat } from "#app/data/battle-stat"; -import { MovePhase } from "#app/phases/move-phase"; import { TurnEndPhase } from "#app/phases/turn-end-phase"; +import { TurnStartPhase } from "#app/phases/turn-start-phase"; import { Abilities } from "#enums/abilities"; import { Moves } from "#enums/moves"; import { Species } from "#enums/species"; @@ -8,7 +8,6 @@ import GameManager from "#test/utils/gameManager"; import Phaser from "phaser"; import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest"; - describe("Abilities - Mycelium Might", () => { let phaserGame: Phaser.Game; let game: GameManager; @@ -35,7 +34,7 @@ describe("Abilities - Mycelium Might", () => { }); /** - * Bulbapedia References: + * References: * https://bulbapedia.bulbagarden.net/wiki/Mycelium_Might_(Ability) * https://bulbapedia.bulbagarden.net/wiki/Priority * https://www.smogon.com/forums/threads/scarlet-violet-battle-mechanics-research.3709545/page-24 @@ -44,22 +43,22 @@ describe("Abilities - Mycelium Might", () => { it("will move last in its priority bracket and ignore protective abilities", async () => { await game.startBattle([Species.REGIELEKI]); - const leadIndex = game.scene.getPlayerPokemon()!.getBattlerIndex(); const enemyPokemon = game.scene.getEnemyPokemon(); + const playerIndex = game.scene.getPlayerPokemon()?.getBattlerIndex(); const enemyIndex = enemyPokemon?.getBattlerIndex(); game.move.select(Moves.BABY_DOLL_EYES); - await game.phaseInterceptor.to(MovePhase, false); + await game.phaseInterceptor.to(TurnStartPhase, false); + const phase = game.scene.getCurrentPhase() as TurnStartPhase; + const speedOrder = phase.getSpeedOrder(); + const commandOrder = phase.getCommandOrder(); // The opponent Pokemon (without Mycelium Might) goes first despite having lower speed than the player Pokemon. - expect((game.scene.getCurrentPhase() as MovePhase).pokemon.getBattlerIndex()).toBe(enemyIndex); - - await game.phaseInterceptor.run(MovePhase); - await game.phaseInterceptor.to(MovePhase, false); - // The player Pokemon (with Mycelium Might) goes last despite having higher speed than the opponent. - expect((game.scene.getCurrentPhase() as MovePhase).pokemon.getBattlerIndex()).toBe(leadIndex); + expect(speedOrder).toEqual([playerIndex, enemyIndex]); + expect(commandOrder).toEqual([enemyIndex, playerIndex]); await game.phaseInterceptor.to(TurnEndPhase); + // Despite the opponent's ability (Clear Body), its attack stat is still reduced. expect(enemyPokemon?.summonData.battleStats[BattleStat.ATK]).toBe(-1); }, 20000); @@ -67,39 +66,41 @@ describe("Abilities - Mycelium Might", () => { game.override.enemyMoveset([Moves.TACKLE, Moves.TACKLE, Moves.TACKLE, Moves.TACKLE]); await game.startBattle([Species.REGIELEKI]); - const leadIndex = game.scene.getPlayerPokemon()!.getBattlerIndex(); const enemyPokemon = game.scene.getEnemyPokemon(); + const playerIndex = game.scene.getPlayerPokemon()?.getBattlerIndex(); const enemyIndex = enemyPokemon?.getBattlerIndex(); game.move.select(Moves.BABY_DOLL_EYES); - await game.phaseInterceptor.to(MovePhase, false); + await game.phaseInterceptor.to(TurnStartPhase, false); + const phase = game.scene.getCurrentPhase() as TurnStartPhase; + const speedOrder = phase.getSpeedOrder(); + const commandOrder = phase.getCommandOrder(); // The player Pokemon (with M.M.) goes first because its move is still within a higher priority bracket than its opponent. - expect((game.scene.getCurrentPhase() as MovePhase).pokemon.getBattlerIndex()).toBe(leadIndex); - - await game.phaseInterceptor.run(MovePhase); - await game.phaseInterceptor.to(MovePhase, false); // The enemy Pokemon goes second because its move is in a lower priority bracket. - expect((game.scene.getCurrentPhase() as MovePhase).pokemon.getBattlerIndex()).toBe(enemyIndex); + expect(speedOrder).toEqual([playerIndex, enemyIndex]); + expect(commandOrder).toEqual([playerIndex, enemyIndex]); await game.phaseInterceptor.to(TurnEndPhase); + // Despite the opponent's ability (Clear Body), its attack stat is still reduced. expect(enemyPokemon?.summonData.battleStats[BattleStat.ATK]).toBe(-1); }, 20000); it("will not affect non-status moves", async () => { await game.startBattle([Species.REGIELEKI]); - const leadIndex = game.scene.getPlayerPokemon()!.getBattlerIndex(); + const playerIndex = game.scene.getPlayerPokemon()!.getBattlerIndex(); const enemyIndex = game.scene.getEnemyPokemon()!.getBattlerIndex(); game.move.select(Moves.QUICK_ATTACK); - await game.phaseInterceptor.to(MovePhase, false); + await game.phaseInterceptor.to(TurnStartPhase, false); + const phase = game.scene.getCurrentPhase() as TurnStartPhase; + const speedOrder = phase.getSpeedOrder(); + const commandOrder = phase.getCommandOrder(); // The player Pokemon (with M.M.) goes first because it has a higher speed and did not use a status move. - expect((game.scene.getCurrentPhase() as MovePhase).pokemon.getBattlerIndex()).toBe(leadIndex); - - await game.phaseInterceptor.run(MovePhase); - await game.phaseInterceptor.to(MovePhase, false); // The enemy Pokemon (without M.M.) goes second because its speed is lower. - expect((game.scene.getCurrentPhase() as MovePhase).pokemon.getBattlerIndex()).toBe(enemyIndex); + // This means that the commandOrder should be identical to the speedOrder + expect(speedOrder).toEqual([playerIndex, enemyIndex]); + expect(commandOrder).toEqual([playerIndex, enemyIndex]); }, 20000); }); diff --git a/src/test/abilities/stall.test.ts b/src/test/abilities/stall.test.ts index d8dbe9d0e06..7baf7c846f0 100644 --- a/src/test/abilities/stall.test.ts +++ b/src/test/abilities/stall.test.ts @@ -1,11 +1,10 @@ -import { MovePhase } from "#app/phases/move-phase"; import { Abilities } from "#enums/abilities"; import { Moves } from "#enums/moves"; import { Species } from "#enums/species"; import GameManager from "#test/utils/gameManager"; import Phaser from "phaser"; import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest"; - +import { TurnStartPhase } from "#app/phases/turn-start-phase"; describe("Abilities - Stall", () => { let phaserGame: Phaser.Game; @@ -32,7 +31,7 @@ describe("Abilities - Stall", () => { }); /** - * Bulbapedia References: + * References: * https://bulbapedia.bulbagarden.net/wiki/Stall_(Ability) * https://bulbapedia.bulbagarden.net/wiki/Priority **/ @@ -40,55 +39,56 @@ describe("Abilities - Stall", () => { it("Pokemon with Stall should move last in its priority bracket regardless of speed", async () => { await game.startBattle([Species.SHUCKLE]); - const leadIndex = game.scene.getPlayerPokemon()!.getBattlerIndex(); + const playerIndex = game.scene.getPlayerPokemon()!.getBattlerIndex(); const enemyIndex = game.scene.getEnemyPokemon()!.getBattlerIndex(); game.move.select(Moves.QUICK_ATTACK); - await game.phaseInterceptor.to(MovePhase, false); + await game.phaseInterceptor.to(TurnStartPhase, false); + const phase = game.scene.getCurrentPhase() as TurnStartPhase; + const speedOrder = phase.getSpeedOrder(); + const commandOrder = phase.getCommandOrder(); // The player Pokemon (without Stall) goes first despite having lower speed than the opponent. - expect((game.scene.getCurrentPhase() as MovePhase).pokemon.getBattlerIndex()).toBe(leadIndex); - - await game.phaseInterceptor.run(MovePhase); - await game.phaseInterceptor.to(MovePhase, false); // The opponent Pokemon (with Stall) goes last despite having higher speed than the player Pokemon. - expect((game.scene.getCurrentPhase() as MovePhase).pokemon.getBattlerIndex()).toBe(enemyIndex); + expect(speedOrder).toEqual([enemyIndex, playerIndex]); + expect(commandOrder).toEqual([playerIndex, enemyIndex]); }, 20000); it("Pokemon with Stall will go first if a move that is in a higher priority bracket than the opponent's move is used", async () => { await game.startBattle([Species.SHUCKLE]); - const leadIndex = game.scene.getPlayerPokemon()!.getBattlerIndex(); + const playerIndex = game.scene.getPlayerPokemon()!.getBattlerIndex(); const enemyIndex = game.scene.getEnemyPokemon()!.getBattlerIndex(); game.move.select(Moves.TACKLE); - await game.phaseInterceptor.to(MovePhase, false); + await game.phaseInterceptor.to(TurnStartPhase, false); + const phase = game.scene.getCurrentPhase() as TurnStartPhase; + const speedOrder = phase.getSpeedOrder(); + const commandOrder = phase.getCommandOrder(); // The opponent Pokemon (with Stall) goes first because its move is still within a higher priority bracket than its opponent. - expect((game.scene.getCurrentPhase() as MovePhase).pokemon.getBattlerIndex()).toBe(enemyIndex); - - await game.phaseInterceptor.run(MovePhase); - await game.phaseInterceptor.to(MovePhase, false); // The player Pokemon goes second because its move is in a lower priority bracket. - expect((game.scene.getCurrentPhase() as MovePhase).pokemon.getBattlerIndex()).toBe(leadIndex); + expect(speedOrder).toEqual([enemyIndex, playerIndex]); + expect(commandOrder).toEqual([enemyIndex, playerIndex]); }, 20000); it("If both Pokemon have stall and use the same move, speed is used to determine who goes first.", async () => { game.override.ability(Abilities.STALL); await game.startBattle([Species.SHUCKLE]); - const leadIndex = game.scene.getPlayerPokemon()!.getBattlerIndex(); + const playerIndex = game.scene.getPlayerPokemon()!.getBattlerIndex(); const enemyIndex = game.scene.getEnemyPokemon()!.getBattlerIndex(); game.move.select(Moves.TACKLE); - await game.phaseInterceptor.to(MovePhase, false); - // The opponent Pokemon (with Stall) goes first because it has a higher speed. - expect((game.scene.getCurrentPhase() as MovePhase).pokemon.getBattlerIndex()).toBe(enemyIndex); + await game.phaseInterceptor.to(TurnStartPhase, false); + const phase = game.scene.getCurrentPhase() as TurnStartPhase; + const speedOrder = phase.getSpeedOrder(); + const commandOrder = phase.getCommandOrder(); - await game.phaseInterceptor.run(MovePhase); - await game.phaseInterceptor.to(MovePhase, false); + // The opponent Pokemon (with Stall) goes first because it has a higher speed. // The player Pokemon (with Stall) goes second because its speed is lower. - expect((game.scene.getCurrentPhase() as MovePhase).pokemon.getBattlerIndex()).toBe(leadIndex); + expect(speedOrder).toEqual([enemyIndex, playerIndex]); + expect(commandOrder).toEqual([enemyIndex, playerIndex]); }, 20000); }); diff --git a/src/test/abilities/tera_shell.test.ts b/src/test/abilities/tera_shell.test.ts new file mode 100644 index 00000000000..f9cb2935619 --- /dev/null +++ b/src/test/abilities/tera_shell.test.ts @@ -0,0 +1,111 @@ +import { Abilities } from "#app/enums/abilities"; +import { Moves } from "#app/enums/moves"; +import { Species } from "#app/enums/species"; +import { HitResult } from "#app/field/pokemon.js"; +import GameManager from "#test/utils/gameManager"; +import Phaser from "phaser"; +import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest"; + +const TIMEOUT = 10 * 1000; // 10 second timeout + +describe("Abilities - Tera Shell", () => { + let phaserGame: Phaser.Game; + let game: GameManager; + + beforeAll(() => { + phaserGame = new Phaser.Game({ + type: Phaser.HEADLESS, + }); + }); + + afterEach(() => { + game.phaseInterceptor.restoreOg(); + }); + + beforeEach(() => { + game = new GameManager(phaserGame); + game.override + .battleType("single") + .ability(Abilities.TERA_SHELL) + .moveset([Moves.SPLASH]) + .enemySpecies(Species.SNORLAX) + .enemyAbility(Abilities.INSOMNIA) + .enemyMoveset(Array(4).fill(Moves.MACH_PUNCH)) + .startingLevel(100) + .enemyLevel(100); + }); + + it( + "should change the effectiveness of non-resisted attacks when the source is at full HP", + async () => { + await game.classicMode.startBattle([Species.SNORLAX]); + + const playerPokemon = game.scene.getPlayerPokemon()!; + vi.spyOn(playerPokemon, "getMoveEffectiveness"); + + game.move.select(Moves.SPLASH); + + await game.phaseInterceptor.to("MoveEndPhase"); + expect(playerPokemon.getMoveEffectiveness).toHaveLastReturnedWith(0.5); + + await game.toNextTurn(); + + game.move.select(Moves.SPLASH); + + await game.phaseInterceptor.to("MoveEndPhase"); + expect(playerPokemon.getMoveEffectiveness).toHaveLastReturnedWith(2); + }, TIMEOUT + ); + + it( + "should not override type immunities", + async () => { + game.override.enemyMoveset(Array(4).fill(Moves.SHADOW_SNEAK)); + + await game.classicMode.startBattle([Species.SNORLAX]); + + const playerPokemon = game.scene.getPlayerPokemon()!; + vi.spyOn(playerPokemon, "getMoveEffectiveness"); + + game.move.select(Moves.SPLASH); + + await game.phaseInterceptor.to("MoveEndPhase"); + expect(playerPokemon.getMoveEffectiveness).toHaveLastReturnedWith(0); + }, TIMEOUT + ); + + it( + "should not override type multipliers less than 0.5x", + async () => { + game.override.enemyMoveset(Array(4).fill(Moves.QUICK_ATTACK)); + + await game.classicMode.startBattle([Species.AGGRON]); + + const playerPokemon = game.scene.getPlayerPokemon()!; + vi.spyOn(playerPokemon, "getMoveEffectiveness"); + + game.move.select(Moves.SPLASH); + + await game.phaseInterceptor.to("MoveEndPhase"); + expect(playerPokemon.getMoveEffectiveness).toHaveLastReturnedWith(0.25); + }, TIMEOUT + ); + + it( + "should not affect the effectiveness of fixed-damage moves", + async () => { + game.override.enemyMoveset(Array(4).fill(Moves.DRAGON_RAGE)); + + await game.classicMode.startBattle([Species.CHARIZARD]); + + const playerPokemon = game.scene.getPlayerPokemon()!; + vi.spyOn(playerPokemon, "apply"); + + game.move.select(Moves.SPLASH); + + await game.phaseInterceptor.to("BerryPhase", false); + expect(playerPokemon.apply).toHaveLastReturnedWith(HitResult.EFFECTIVE); + expect(playerPokemon.hp).toBe(playerPokemon.getMaxHp() - 40); + }, TIMEOUT + ); +}); diff --git a/src/test/battle/battle-order.test.ts b/src/test/battle/battle-order.test.ts index 0129ecad254..e19168962dc 100644 --- a/src/test/battle/battle-order.test.ts +++ b/src/test/battle/battle-order.test.ts @@ -1,4 +1,3 @@ -import { Stat } from "#app/data/pokemon-stat"; import { EnemyCommandPhase } from "#app/phases/enemy-command-phase"; import { SelectTargetPhase } from "#app/phases/select-target-phase"; import { TurnStartPhase } from "#app/phases/turn-start-phase"; @@ -7,8 +6,7 @@ import { Moves } from "#enums/moves"; import { Species } from "#enums/species"; import GameManager from "#test/utils/gameManager"; import Phaser from "phaser"; -import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest"; - +import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest"; describe("Battle order", () => { let phaserGame: Phaser.Game; @@ -37,30 +35,42 @@ describe("Battle order", () => { await game.startBattle([ Species.BULBASAUR, ]); - game.scene.getParty()[0].stats[Stat.SPD] = 50; - game.scene.currentBattle.enemyParty[0].stats[Stat.SPD] = 150; + + const playerPokemon = game.scene.getPlayerPokemon()!; + const enemyPokemon = game.scene.getEnemyPokemon()!; + vi.spyOn(playerPokemon, "stats", "get").mockReturnValue([20, 20, 20, 20, 20, 50]); // set playerPokemon's speed to 50 + vi.spyOn(enemyPokemon, "stats", "get").mockReturnValue([20, 20, 20, 20, 20, 150]); // set enemyPokemon's speed to 150 game.move.select(Moves.TACKLE); await game.phaseInterceptor.run(EnemyCommandPhase); + + const playerPokemonIndex = playerPokemon.getBattlerIndex(); + const enemyPokemonIndex = enemyPokemon.getBattlerIndex(); const phase = game.scene.getCurrentPhase() as TurnStartPhase; - const order = phase.getOrder(); - expect(order[0]).toBe(2); - expect(order[1]).toBe(0); + const order = phase.getCommandOrder(); + expect(order[0]).toBe(enemyPokemonIndex); + expect(order[1]).toBe(playerPokemonIndex); }, 20000); it("Player faster than opponent 150 vs 50", async () => { await game.startBattle([ Species.BULBASAUR, ]); - game.scene.getParty()[0].stats[Stat.SPD] = 150; - game.scene.currentBattle.enemyParty[0].stats[Stat.SPD] = 50; + + const playerPokemon = game.scene.getPlayerPokemon()!; + const enemyPokemon = game.scene.getEnemyPokemon()!; + vi.spyOn(playerPokemon, "stats", "get").mockReturnValue([20, 20, 20, 20, 20, 150]); // set playerPokemon's speed to 150 + vi.spyOn(enemyPokemon, "stats", "get").mockReturnValue([20, 20, 20, 20, 20, 50]); // set enemyPokemon's speed to 50 game.move.select(Moves.TACKLE); await game.phaseInterceptor.run(EnemyCommandPhase); + + const playerPokemonIndex = playerPokemon.getBattlerIndex(); + const enemyPokemonIndex = enemyPokemon.getBattlerIndex(); const phase = game.scene.getCurrentPhase() as TurnStartPhase; - const order = phase.getOrder(); - expect(order[0]).toBe(0); - expect(order[1]).toBe(2); + const order = phase.getCommandOrder(); + expect(order[0]).toBe(playerPokemonIndex); + expect(order[1]).toBe(enemyPokemonIndex); }, 20000); it("double - both opponents faster than player 50/50 vs 150/150", async () => { @@ -69,20 +79,25 @@ describe("Battle order", () => { Species.BULBASAUR, Species.BLASTOISE, ]); - game.scene.getParty()[0].stats[Stat.SPD] = 50; - game.scene.getParty()[1].stats[Stat.SPD] = 50; - game.scene.currentBattle.enemyParty[0].stats[Stat.SPD] = 150; - game.scene.currentBattle.enemyParty[1].stats[Stat.SPD] = 150; + + const playerPokemon = game.scene.getPlayerField(); + const enemyPokemon = game.scene.getEnemyField(); + + playerPokemon.forEach(p => vi.spyOn(p, "stats", "get").mockReturnValue([20, 20, 20, 20, 20, 50])); // set both playerPokemons' speed to 50 + enemyPokemon.forEach(p => vi.spyOn(p, "stats", "get").mockReturnValue([20, 20, 20, 20, 20, 150])); // set both enemyPokemons' speed to 150 + const playerIndices = playerPokemon.map(p => p?.getBattlerIndex()); + const enemyIndices = enemyPokemon.map(p => p?.getBattlerIndex()); game.move.select(Moves.TACKLE); game.move.select(Moves.TACKLE, 1); await game.phaseInterceptor.runFrom(SelectTargetPhase).to(TurnStartPhase, false); + const phase = game.scene.getCurrentPhase() as TurnStartPhase; - const order = phase.getOrder(); - expect(order.indexOf(0)).toBeGreaterThan(order.indexOf(2)); - expect(order.indexOf(0)).toBeGreaterThan(order.indexOf(3)); - expect(order.indexOf(1)).toBeGreaterThan(order.indexOf(2)); - expect(order.indexOf(1)).toBeGreaterThan(order.indexOf(3)); + const order = phase.getCommandOrder(); + expect(order.slice(0, 2).includes(enemyIndices[0])).toBe(true); + expect(order.slice(0, 2).includes(enemyIndices[1])).toBe(true); + expect(order.slice(2, 4).includes(playerIndices[0])).toBe(true); + expect(order.slice(2, 4).includes(playerIndices[1])).toBe(true); }, 20000); it("double - speed tie except 1 - 100/100 vs 100/150", async () => { @@ -91,19 +106,25 @@ describe("Battle order", () => { Species.BULBASAUR, Species.BLASTOISE, ]); - game.scene.getParty()[0].stats[Stat.SPD] = 100; - game.scene.getParty()[1].stats[Stat.SPD] = 100; - game.scene.currentBattle.enemyParty[0].stats[Stat.SPD] = 100; - game.scene.currentBattle.enemyParty[1].stats[Stat.SPD] = 150; + + const playerPokemon = game.scene.getPlayerField(); + const enemyPokemon = game.scene.getEnemyField(); + playerPokemon.forEach(p => vi.spyOn(p, "stats", "get").mockReturnValue([20, 20, 20, 20, 20, 100])); //set both playerPokemons' speed to 100 + vi.spyOn(enemyPokemon[0], "stats", "get").mockReturnValue([20, 20, 20, 20, 20, 100]); // set enemyPokemon's speed to 100 + vi.spyOn(enemyPokemon[1], "stats", "get").mockReturnValue([20, 20, 20, 20, 20, 150]); // set enemyPokemon's speed to 150 + const playerIndices = playerPokemon.map(p => p?.getBattlerIndex()); + const enemyIndices = enemyPokemon.map(p => p?.getBattlerIndex()); game.move.select(Moves.TACKLE); game.move.select(Moves.TACKLE, 1); await game.phaseInterceptor.runFrom(SelectTargetPhase).to(TurnStartPhase, false); + const phase = game.scene.getCurrentPhase() as TurnStartPhase; - const order = phase.getOrder(); - expect(order.indexOf(3)).toBeLessThan(order.indexOf(0)); - expect(order.indexOf(3)).toBeLessThan(order.indexOf(1)); - expect(order.indexOf(3)).toBeLessThan(order.indexOf(2)); + const order = phase.getCommandOrder(); + expect(order[0]).toBe(enemyIndices[1]); + expect(order.slice(1, 4).includes(enemyIndices[0])).toBe(true); + expect(order.slice(1, 4).includes(playerIndices[0])).toBe(true); + expect(order.slice(1, 4).includes(playerIndices[1])).toBe(true); }, 20000); it("double - speed tie 100/150 vs 100/150", async () => { @@ -112,19 +133,25 @@ describe("Battle order", () => { Species.BULBASAUR, Species.BLASTOISE, ]); - game.scene.getParty()[0].stats[Stat.SPD] = 100; - game.scene.getParty()[1].stats[Stat.SPD] = 150; - game.scene.currentBattle.enemyParty[0].stats[Stat.SPD] = 100; - game.scene.currentBattle.enemyParty[1].stats[Stat.SPD] = 150; + + const playerPokemon = game.scene.getPlayerField(); + const enemyPokemon = game.scene.getEnemyField(); + vi.spyOn(playerPokemon[0], "stats", "get").mockReturnValue([20, 20, 20, 20, 20, 100]); // set one playerPokemon's speed to 100 + vi.spyOn(playerPokemon[1], "stats", "get").mockReturnValue([20, 20, 20, 20, 20, 150]); // set other playerPokemon's speed to 150 + vi.spyOn(enemyPokemon[0], "stats", "get").mockReturnValue([20, 20, 20, 20, 20, 100]); // set one enemyPokemon's speed to 100 + vi.spyOn(enemyPokemon[1], "stats", "get").mockReturnValue([20, 20, 20, 20, 20, 150]); // set other enemyPokemon's speed to 150 + const playerIndices = playerPokemon.map(p => p?.getBattlerIndex()); + const enemyIndices = enemyPokemon.map(p => p?.getBattlerIndex()); game.move.select(Moves.TACKLE); game.move.select(Moves.TACKLE, 1); await game.phaseInterceptor.runFrom(SelectTargetPhase).to(TurnStartPhase, false); + const phase = game.scene.getCurrentPhase() as TurnStartPhase; - const order = phase.getOrder(); - expect(order.indexOf(1)).toBeLessThan(order.indexOf(0)); - expect(order.indexOf(1)).toBeLessThan(order.indexOf(2)); - expect(order.indexOf(3)).toBeLessThan(order.indexOf(0)); - expect(order.indexOf(3)).toBeLessThan(order.indexOf(2)); + const order = phase.getCommandOrder(); + expect(order.slice(0, 2).includes(playerIndices[1])).toBe(true); + expect(order.slice(0, 2).includes(enemyIndices[1])).toBe(true); + expect(order.slice(2, 4).includes(playerIndices[0])).toBe(true); + expect(order.slice(2, 4).includes(enemyIndices[0])).toBe(true); }, 20000); }); diff --git a/src/test/endless_boss.test.ts b/src/test/endless_boss.test.ts index e983be245b6..8a564695e42 100644 --- a/src/test/endless_boss.test.ts +++ b/src/test/endless_boss.test.ts @@ -32,7 +32,7 @@ describe("Endless Boss", () => { it(`should spawn a minor boss every ${EndlessBossWave.Minor} waves in END biome in Endless`, async () => { game.override.startingWave(EndlessBossWave.Minor); - await game.runToFinalBossEncounter(game, [Species.BIDOOF], GameModes.ENDLESS); + await game.runToFinalBossEncounter([Species.BIDOOF], GameModes.ENDLESS); expect(game.scene.currentBattle.waveIndex).toBe(EndlessBossWave.Minor); expect(game.scene.arena.biomeType).toBe(Biome.END); @@ -44,7 +44,7 @@ describe("Endless Boss", () => { it(`should spawn a major boss every ${EndlessBossWave.Major} waves in END biome in Endless`, async () => { game.override.startingWave(EndlessBossWave.Major); - await game.runToFinalBossEncounter(game, [Species.BIDOOF], GameModes.ENDLESS); + await game.runToFinalBossEncounter([Species.BIDOOF], GameModes.ENDLESS); expect(game.scene.currentBattle.waveIndex).toBe(EndlessBossWave.Major); expect(game.scene.arena.biomeType).toBe(Biome.END); @@ -56,7 +56,7 @@ describe("Endless Boss", () => { it(`should spawn a minor boss every ${EndlessBossWave.Minor} waves in END biome in Spliced Endless`, async () => { game.override.startingWave(EndlessBossWave.Minor); - await game.runToFinalBossEncounter(game, [Species.BIDOOF], GameModes.SPLICED_ENDLESS); + await game.runToFinalBossEncounter([Species.BIDOOF], GameModes.SPLICED_ENDLESS); expect(game.scene.currentBattle.waveIndex).toBe(EndlessBossWave.Minor); expect(game.scene.arena.biomeType).toBe(Biome.END); @@ -68,7 +68,7 @@ describe("Endless Boss", () => { it(`should spawn a major boss every ${EndlessBossWave.Major} waves in END biome in Spliced Endless`, async () => { game.override.startingWave(EndlessBossWave.Major); - await game.runToFinalBossEncounter(game, [Species.BIDOOF], GameModes.SPLICED_ENDLESS); + await game.runToFinalBossEncounter([Species.BIDOOF], GameModes.SPLICED_ENDLESS); expect(game.scene.currentBattle.waveIndex).toBe(EndlessBossWave.Major); expect(game.scene.arena.biomeType).toBe(Biome.END); @@ -80,7 +80,7 @@ describe("Endless Boss", () => { it(`should NOT spawn major or minor boss outside wave ${EndlessBossWave.Minor}s in END biome`, async () => { game.override.startingWave(EndlessBossWave.Minor - 1); - await game.runToFinalBossEncounter(game, [Species.BIDOOF], GameModes.ENDLESS); + await game.runToFinalBossEncounter([Species.BIDOOF], GameModes.ENDLESS); expect(game.scene.currentBattle.waveIndex).not.toBe(EndlessBossWave.Minor); expect(game.scene.getEnemyPokemon()!.species.speciesId).not.toBe(Species.ETERNATUS); diff --git a/src/test/final_boss.test.ts b/src/test/final_boss.test.ts index 0f59572619b..5d006998a0b 100644 --- a/src/test/final_boss.test.ts +++ b/src/test/final_boss.test.ts @@ -1,8 +1,13 @@ +import { StatusEffect } from "#app/data/status-effect"; +import { Abilities } from "#app/enums/abilities"; import { Biome } from "#app/enums/biome"; +import { Moves } from "#app/enums/moves"; import { Species } from "#app/enums/species"; import { GameModes } from "#app/game-mode"; +import { TurnHeldItemTransferModifier } from "#app/modifier/modifier"; import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest"; import GameManager from "./utils/gameManager"; +import { SPLASH_ONLY } from "./utils/testUtils"; const FinalWave = { Classic: 200, @@ -20,7 +25,13 @@ describe("Final Boss", () => { beforeEach(() => { game = new GameManager(phaserGame); - game.override.startingWave(FinalWave.Classic).startingBiome(Biome.END).disableCrits(); + game.override + .startingWave(FinalWave.Classic) + .startingBiome(Biome.END) + .disableCrits() + .enemyMoveset(SPLASH_ONLY) + .moveset([ Moves.SPLASH, Moves.WILL_O_WISP, Moves.DRAGON_PULSE ]) + .startingLevel(10000); }); afterEach(() => { @@ -28,7 +39,7 @@ describe("Final Boss", () => { }); it("should spawn Eternatus on wave 200 in END biome", async () => { - await game.runToFinalBossEncounter(game, [Species.BIDOOF], GameModes.CLASSIC); + await game.runToFinalBossEncounter([Species.BIDOOF], GameModes.CLASSIC); expect(game.scene.currentBattle.waveIndex).toBe(FinalWave.Classic); expect(game.scene.arena.biomeType).toBe(Biome.END); @@ -37,7 +48,7 @@ describe("Final Boss", () => { it("should NOT spawn Eternatus before wave 200 in END biome", async () => { game.override.startingWave(FinalWave.Classic - 1); - await game.runToFinalBossEncounter(game, [Species.BIDOOF], GameModes.CLASSIC); + await game.runToFinalBossEncounter([Species.BIDOOF], GameModes.CLASSIC); expect(game.scene.currentBattle.waveIndex).not.toBe(FinalWave.Classic); expect(game.scene.arena.biomeType).toBe(Biome.END); @@ -46,7 +57,7 @@ describe("Final Boss", () => { it("should NOT spawn Eternatus outside of END biome", async () => { game.override.startingBiome(Biome.FOREST); - await game.runToFinalBossEncounter(game, [Species.BIDOOF], GameModes.CLASSIC); + await game.runToFinalBossEncounter([Species.BIDOOF], GameModes.CLASSIC); expect(game.scene.currentBattle.waveIndex).toBe(FinalWave.Classic); expect(game.scene.arena.biomeType).not.toBe(Biome.END); @@ -54,12 +65,81 @@ describe("Final Boss", () => { }); it("should not have passive enabled on Eternatus", async () => { - await game.runToFinalBossEncounter(game, [Species.BIDOOF], GameModes.CLASSIC); + await game.runToFinalBossEncounter([Species.BIDOOF], GameModes.CLASSIC); - const eternatus = game.scene.getEnemyPokemon(); - expect(eternatus?.species.speciesId).toBe(Species.ETERNATUS); - expect(eternatus?.hasPassive()).toBe(false); + const eternatus = game.scene.getEnemyPokemon()!; + expect(eternatus.species.speciesId).toBe(Species.ETERNATUS); + expect(eternatus.hasPassive()).toBe(false); + }); + + it("should change form on direct hit down to last boss fragment", async () => { + await game.runToFinalBossEncounter([Species.KYUREM], GameModes.CLASSIC); + await game.phaseInterceptor.to("CommandPhase"); + + // Eternatus phase 1 + const eternatus = game.scene.getEnemyPokemon()!; + const phase1Hp = eternatus.getMaxHp(); + expect(eternatus.species.speciesId).toBe(Species.ETERNATUS); + expect(eternatus.formIndex).toBe(0); + expect(eternatus.bossSegments).toBe(4); + expect(eternatus.bossSegmentIndex).toBe(3); + + game.move.select(Moves.DRAGON_PULSE); + await game.toNextTurn(); + + // Eternatus phase 2: changed form, healed and restored its shields + expect(eternatus.species.speciesId).toBe(Species.ETERNATUS); + expect(eternatus.hp).toBeGreaterThan(phase1Hp); + expect(eternatus.hp).toBe(eternatus.getMaxHp()); + expect(eternatus.formIndex).toBe(1); + expect(eternatus.bossSegments).toBe(5); + expect(eternatus.bossSegmentIndex).toBe(4); + const miniBlackHole = eternatus.getHeldItems().find(m => m instanceof TurnHeldItemTransferModifier); + expect(miniBlackHole).toBeDefined(); + expect(miniBlackHole?.stackCount).toBe(1); + }); + + it("should change form on status damage down to last boss fragment", async () => { + game.override.ability(Abilities.NO_GUARD); + + await game.runToFinalBossEncounter([Species.BIDOOF], GameModes.CLASSIC); + await game.phaseInterceptor.to("CommandPhase"); + + // Eternatus phase 1 + const eternatus = game.scene.getEnemyPokemon()!; + const phase1Hp = eternatus.getMaxHp(); + expect(eternatus.species.speciesId).toBe(Species.ETERNATUS); + expect(eternatus.formIndex).toBe(0); + expect(eternatus.bossSegments).toBe(4); + expect(eternatus.bossSegmentIndex).toBe(3); + + game.move.select(Moves.WILL_O_WISP); + await game.toNextTurn(); + expect(eternatus.status?.effect).toBe(StatusEffect.BURN); + + const tickDamage = phase1Hp - eternatus.hp; + const lastShieldHp = Math.ceil(phase1Hp / eternatus.bossSegments); + // Stall until the burn is one hit away from breaking the last shield + while (eternatus.hp - tickDamage > lastShieldHp) { + game.move.select(Moves.SPLASH); + await game.toNextTurn(); + } + + expect(eternatus.bossSegmentIndex).toBe(1); + + game.move.select(Moves.SPLASH); + await game.toNextTurn(); + + // Eternatus phase 2: changed form, healed and restored its shields + expect(eternatus.hp).toBeGreaterThan(phase1Hp); + expect(eternatus.hp).toBe(eternatus.getMaxHp()); + expect(eternatus.status).toBeFalsy(); + expect(eternatus.formIndex).toBe(1); + expect(eternatus.bossSegments).toBe(5); + expect(eternatus.bossSegmentIndex).toBe(4); + const miniBlackHole = eternatus.getHeldItems().find(m => m instanceof TurnHeldItemTransferModifier); + expect(miniBlackHole).toBeDefined(); + expect(miniBlackHole?.stackCount).toBe(1); }); - it.todo("should change form on direct hit down to last boss fragment", () => {}); }); diff --git a/src/test/moves/alluring_voice.test.ts b/src/test/moves/alluring_voice.test.ts new file mode 100644 index 00000000000..e6ece39524a --- /dev/null +++ b/src/test/moves/alluring_voice.test.ts @@ -0,0 +1,54 @@ +import { BattlerIndex } from "#app/battle"; +import { Abilities } from "#app/enums/abilities"; +import { BattlerTagType } from "#app/enums/battler-tag-type"; +import { BerryPhase } from "#app/phases/berry-phase"; +import { Moves } from "#enums/moves"; +import { Species } from "#enums/species"; +import GameManager from "#test/utils/gameManager"; +import Phaser from "phaser"; +import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest"; + +const TIMEOUT = 20 * 1000; + +describe("Moves - Alluring Voice", () => { + let phaserGame: Phaser.Game; + let game: GameManager; + + beforeAll(() => { + phaserGame = new Phaser.Game({ + type: Phaser.HEADLESS, + }); + }); + + afterEach(() => { + game.phaseInterceptor.restoreOg(); + }); + + beforeEach(() => { + game = new GameManager(phaserGame); + game.override + .battleType("single") + .disableCrits() + .enemySpecies(Species.MAGIKARP) + .enemyAbility(Abilities.ICE_SCALES) + .enemyMoveset(Array(4).fill(Moves.HOWL)) + .startingLevel(10) + .enemyLevel(10) + .starterSpecies(Species.FEEBAS) + .ability(Abilities.BALL_FETCH) + .moveset([Moves.ALLURING_VOICE]); + + }); + + it("should confuse the opponent if their stats were raised", async () => { + await game.classicMode.startBattle(); + + const enemy = game.scene.getEnemyPokemon()!; + + game.move.select(Moves.ALLURING_VOICE); + await game.setTurnOrder([BattlerIndex.ENEMY, BattlerIndex.PLAYER]); + await game.phaseInterceptor.to(BerryPhase); + + expect(enemy.getTag(BattlerTagType.CONFUSED)?.tagType).toBe("CONFUSED"); + }, TIMEOUT); +}); diff --git a/src/test/moves/burning_jealousy.test.ts b/src/test/moves/burning_jealousy.test.ts new file mode 100644 index 00000000000..2281fe74acb --- /dev/null +++ b/src/test/moves/burning_jealousy.test.ts @@ -0,0 +1,103 @@ +import { BattlerIndex } from "#app/battle"; +import { allMoves } from "#app/data/move"; +import { Abilities } from "#app/enums/abilities"; +import { StatusEffect } from "#app/enums/status-effect"; +import { Moves } from "#enums/moves"; +import { Species } from "#enums/species"; +import GameManager from "#test/utils/gameManager"; +import Phaser from "phaser"; +import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest"; +import { SPLASH_ONLY } from "../utils/testUtils"; + +const TIMEOUT = 20 * 1000; + +describe("Moves - Burning Jealousy", () => { + let phaserGame: Phaser.Game; + let game: GameManager; + + beforeAll(() => { + phaserGame = new Phaser.Game({ + type: Phaser.HEADLESS, + }); + }); + + afterEach(() => { + game.phaseInterceptor.restoreOg(); + }); + + beforeEach(() => { + game = new GameManager(phaserGame); + game.override + .battleType("single") + .disableCrits() + .enemySpecies(Species.MAGIKARP) + .enemyAbility(Abilities.ICE_SCALES) + .enemyMoveset(Array(4).fill(Moves.HOWL)) + .startingLevel(10) + .enemyLevel(10) + .starterSpecies(Species.FEEBAS) + .ability(Abilities.BALL_FETCH) + .moveset([Moves.BURNING_JEALOUSY, Moves.GROWL]); + + }); + + it("should burn the opponent if their stats were raised", async () => { + await game.classicMode.startBattle(); + + const enemy = game.scene.getEnemyPokemon()!; + + game.move.select(Moves.BURNING_JEALOUSY); + await game.setTurnOrder([BattlerIndex.ENEMY, BattlerIndex.PLAYER]); + await game.phaseInterceptor.to("BerryPhase"); + + expect(enemy.status?.effect).toBe(StatusEffect.BURN); + }, TIMEOUT); + + it("should still burn the opponent if their stats were both raised and lowered in the same turn", async () => { + game.override + .starterSpecies(0) + .battleType("double"); + await game.classicMode.startBattle([Species.FEEBAS, Species.ABRA]); + + const enemy = game.scene.getEnemyPokemon()!; + + game.move.select(Moves.BURNING_JEALOUSY); + game.move.select(Moves.GROWL, 1); + await game.setTurnOrder([BattlerIndex.ENEMY, BattlerIndex.PLAYER_2, BattlerIndex.PLAYER, BattlerIndex.ENEMY_2]); + await game.phaseInterceptor.to("BerryPhase"); + + expect(enemy.status?.effect).toBe(StatusEffect.BURN); + }, TIMEOUT); + + it("should ignore stats raised by imposter", async () => { + game.override + .enemySpecies(Species.DITTO) + .enemyAbility(Abilities.IMPOSTER) + .enemyMoveset(SPLASH_ONLY); + await game.classicMode.startBattle(); + + const enemy = game.scene.getEnemyPokemon()!; + + game.move.select(Moves.BURNING_JEALOUSY); + await game.phaseInterceptor.to("BerryPhase"); + + expect(enemy.status?.effect).toBeUndefined(); + }, TIMEOUT); + + it.skip("should ignore weakness policy", async () => { // TODO: Make this test if WP is implemented + await game.classicMode.startBattle(); + }, TIMEOUT); + + it("should be boosted by Sheer Force even if opponent didn't raise stats", async () => { + game.override + .ability(Abilities.SHEER_FORCE) + .enemyMoveset(SPLASH_ONLY); + vi.spyOn(allMoves[Moves.BURNING_JEALOUSY], "calculateBattlePower"); + await game.classicMode.startBattle(); + + game.move.select(Moves.BURNING_JEALOUSY); + await game.phaseInterceptor.to("BerryPhase"); + + expect(allMoves[Moves.BURNING_JEALOUSY].calculateBattlePower).toHaveReturnedWith(allMoves[Moves.BURNING_JEALOUSY].power * 5461 / 4096); + }, TIMEOUT); +}); diff --git a/src/test/moves/lash_out.test.ts b/src/test/moves/lash_out.test.ts new file mode 100644 index 00000000000..78f4b712cf0 --- /dev/null +++ b/src/test/moves/lash_out.test.ts @@ -0,0 +1,52 @@ +import { BattlerIndex } from "#app/battle"; +import { allMoves } from "#app/data/move"; +import { Abilities } from "#app/enums/abilities"; +import { Moves } from "#enums/moves"; +import { Species } from "#enums/species"; +import GameManager from "#test/utils/gameManager"; +import Phaser from "phaser"; +import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest"; + +const TIMEOUT = 20 * 1000; + +describe("Moves - Lash Out", () => { + let phaserGame: Phaser.Game; + let game: GameManager; + + beforeAll(() => { + phaserGame = new Phaser.Game({ + type: Phaser.HEADLESS, + }); + }); + + afterEach(() => { + game.phaseInterceptor.restoreOg(); + }); + + beforeEach(() => { + game = new GameManager(phaserGame); + game.override + .battleType("single") + .disableCrits() + .enemySpecies(Species.MAGIKARP) + .enemyAbility(Abilities.FUR_COAT) + .enemyMoveset(Array(4).fill(Moves.GROWL)) + .startingLevel(10) + .enemyLevel(10) + .starterSpecies(Species.FEEBAS) + .ability(Abilities.BALL_FETCH) + .moveset([Moves.LASH_OUT]); + + }); + + it("should deal double damage if the user's stats were lowered this turn", async () => { + vi.spyOn(allMoves[Moves.LASH_OUT], "calculateBattlePower"); + await game.classicMode.startBattle(); + + game.move.select(Moves.LASH_OUT); + await game.setTurnOrder([BattlerIndex.ENEMY, BattlerIndex.PLAYER]); + await game.phaseInterceptor.to("BerryPhase"); + + expect(allMoves[Moves.LASH_OUT].calculateBattlePower).toHaveReturnedWith(150); + }, TIMEOUT); +}); diff --git a/src/test/utils/gameManager.ts b/src/test/utils/gameManager.ts index 60d07065090..a9a71d16bf7 100644 --- a/src/test/utils/gameManager.ts +++ b/src/test/utils/gameManager.ts @@ -6,6 +6,7 @@ import { EnemyPokemon, PlayerPokemon } from "#app/field/pokemon"; import Trainer from "#app/field/trainer"; import { GameModes, getGameMode } from "#app/game-mode"; import { ModifierTypeOption, modifierTypes } from "#app/modifier/modifier-type"; +import overrides from "#app/overrides"; import { CommandPhase } from "#app/phases/command-phase"; import { EncounterPhase } from "#app/phases/encounter-phase"; import { FaintPhase } from "#app/phases/faint-phase"; @@ -148,28 +149,26 @@ export default class GameManager { * @param species * @param mode */ - async runToFinalBossEncounter(game: GameManager, species: Species[], mode: GameModes) { + async runToFinalBossEncounter(species: Species[], mode: GameModes) { console.log("===to final boss encounter==="); - await game.runToTitle(); + await this.runToTitle(); - game.onNextPrompt("TitlePhase", Mode.TITLE, () => { - game.scene.gameMode = getGameMode(mode); - const starters = generateStarter(game.scene, species); - const selectStarterPhase = new SelectStarterPhase(game.scene); - game.scene.pushPhase(new EncounterPhase(game.scene, false)); + this.onNextPrompt("TitlePhase", Mode.TITLE, () => { + this.scene.gameMode = getGameMode(mode); + const starters = generateStarter(this.scene, species); + const selectStarterPhase = new SelectStarterPhase(this.scene); + this.scene.pushPhase(new EncounterPhase(this.scene, false)); selectStarterPhase.initBattle(starters); }); - game.onNextPrompt("EncounterPhase", Mode.MESSAGE, async () => { - // This will skip all entry dialogue (I can't figure out a way to sequentially handle the 8 chained messages via 1 prompt handler) - game.setMode(Mode.MESSAGE); - const encounterPhase = game.scene.getCurrentPhase() as EncounterPhase; + // This will consider all battle entry dialog as seens and skip them + vi.spyOn(this.scene.ui, "shouldSkipDialogue").mockReturnValue(true); - // No need to end phase, this will do it for you - encounterPhase.doEncounterCommon(false); - }); + if (overrides.OPP_HELD_ITEMS_OVERRIDE.length === 0) { + this.removeEnemyHeldItems(); + } - await game.phaseInterceptor.to(EncounterPhase, true); + await this.phaseInterceptor.to(EncounterPhase); console.log("===finished run to final boss encounter==="); } @@ -381,7 +380,7 @@ export default class GameManager { } /** - * Intercepts `TurnStartPhase` and mocks the getOrder's return value {@linkcode TurnStartPhase.getOrder} + * Intercepts `TurnStartPhase` and mocks the getSpeedOrder's return value {@linkcode TurnStartPhase.getSpeedOrder} * Used to modify the turn order. * @param {BattlerIndex[]} order The turn order to set * @example @@ -392,7 +391,7 @@ export default class GameManager { async setTurnOrder(order: BattlerIndex[]): Promise { await this.phaseInterceptor.to(TurnStartPhase, false); - vi.spyOn(this.scene.getCurrentPhase() as TurnStartPhase, "getOrder").mockReturnValue(order); + vi.spyOn(this.scene.getCurrentPhase() as TurnStartPhase, "getSpeedOrder").mockReturnValue(order); } /** diff --git a/src/timed-event-manager.ts b/src/timed-event-manager.ts index 18de67bfa86..abdb2db232a 100644 --- a/src/timed-event-manager.ts +++ b/src/timed-event-manager.ts @@ -1,35 +1,39 @@ -import BattleScene from "#app/battle-scene.js"; -import { TextStyle, addTextObject } from "#app/ui/text.js"; +import BattleScene from "#app/battle-scene"; +import { TextStyle, addTextObject } from "#app/ui/text"; +import i18next from "i18next"; export enum EventType { - SHINY + SHINY, + GENERIC } -interface TimedEvent { - name: string; - eventType: EventType; - shinyMultiplier?: number; - startDate: Date; - endDate: Date; - bannerFilename?: string +interface EventBanner { + bannerKey?: string; + xPosition?: number; + yPosition?: number; + scale?: number; + availableLangs?: string[]; +} + +interface TimedEvent extends EventBanner { + name: string; + eventType: EventType; + shinyMultiplier?: number; + startDate: Date; + endDate: Date; } const timedEvents: TimedEvent[] = [ { - name: "Pride Update", - eventType: EventType.SHINY, - shinyMultiplier: 2, - startDate: new Date(Date.UTC(2024, 5, 14, 0)), - endDate: new Date(Date.UTC(2024, 5, 23, 0)), - bannerFilename: "pride-update" - }, - { - name: "August Variant Update", - eventType: EventType.SHINY, - shinyMultiplier: 2, - startDate: new Date(Date.UTC(2024, 7, 16, 0)), - endDate: new Date(Date.UTC(2024, 7, 22, 0)), - bannerFilename: "august-variant-update" + name: "September Update", + eventType: EventType.GENERIC, + startDate: new Date(Date.UTC(2024, 7, 28, 0)), + endDate: new Date(Date.UTC(2024, 8, 15, 0)), + bannerKey: "september-update", + xPosition: 19, + yPosition: 115, + scale: 0.30, + availableLangs: ["en", "de", "it", "fr", "ja", "ko", "es", "pt_BR", "zh_CN"] } ]; @@ -67,7 +71,7 @@ export class TimedEventManager { } getEventBannerFilename(): string { - return timedEvents.find((te: TimedEvent) => this.isActive(te))?.bannerFilename!; // TODO: is this bang correct? + return timedEvents.find((te: TimedEvent) => this.isActive(te))?.bannerKey!; // TODO: is this bang correct? } } @@ -85,38 +89,37 @@ export class TimedEventDisplay extends Phaser.GameObjects.Container { } setup() { - console.log(this.event?.bannerFilename); - this.banner = new Phaser.GameObjects.Image(this.scene, 29, 64, this.event!.bannerFilename!); // TODO: are the bangs correct here? - this.banner.setName("img-event-banner"); - this.banner.setOrigin(0.08, -0.35); - this.banner.setScale(0.18); - // this.bannerShadow = new Phaser.GameObjects.Rectangle( - // this.scene, - // this.banner.x - 2, - // this.banner.y + 2, - // this.banner.width, - // this.banner.height, - // 0x484848 - // ); - // this.bannerShadow.setName("rect-event-banner-shadow"); - // this.bannerShadow.setScale(0.07); - // this.bannerShadow.setAlpha(0.5); - // this.bannerShadow.setOrigin(0,0); - this.eventTimerText = addTextObject( - this.scene, - this.banner.x + 8, - this.banner.y + 100, - this.timeToGo(this.event!.endDate), // TODO: is the bang correct here? - TextStyle.WINDOW - ); - this.eventTimerText.setName("text-event-timer"); - this.eventTimerText.setScale(0.15); - this.eventTimerText.setOrigin(0, 0); + const lang = i18next.resolvedLanguage; + if (this.event && this.event.bannerKey) { + let key = this.event.bannerKey; + if (lang && this.event.availableLangs && this.event.availableLangs.length > 0) { + if (this.event.availableLangs.includes(lang)) { + key += "-"+lang; + } else { + key += "-en"; + } + } + console.log(this.event.bannerKey); + this.banner = new Phaser.GameObjects.Image(this.scene, this.event.xPosition ?? 29, this.event.yPosition ?? 64, key); + this.banner.setName("img-event-banner"); + this.banner.setOrigin(0.08, -0.35); + this.banner.setScale(this.event.scale ?? 0.18); + if (this.event.eventType !== EventType.GENERIC) { + this.eventTimerText = addTextObject( + this.scene, + this.banner.x + 8, + this.banner.y + 100, + this.timeToGo(this.event.endDate), + TextStyle.WINDOW + ); + this.eventTimerText.setName("text-event-timer"); + this.eventTimerText.setScale(0.15); + this.eventTimerText.setOrigin(0, 0); - this.add([ - this.eventTimerText, - // this.bannerShadow, - this.banner]); + this.add(this.eventTimerText); + } + this.add(this.banner); + } } show() { @@ -157,6 +160,8 @@ export class TimedEventDisplay extends Phaser.GameObjects.Container { } updateCountdown() { - this.eventTimerText.setText(this.timeToGo(this.event!.endDate)); // TODO: is the bang correct here? + if (this.event && this.event.eventType !== EventType.GENERIC) { + this.eventTimerText.setText(this.timeToGo(this.event.endDate)); + } } } diff --git a/src/ui/dropdown.ts b/src/ui/dropdown.ts index 1fef7259108..08d55b03cdb 100644 --- a/src/ui/dropdown.ts +++ b/src/ui/dropdown.ts @@ -23,6 +23,14 @@ export enum SortDirection { DESC = 1 } +export enum SortCriteria { + NUMBER = 0, + COST = 1, + CANDY = 2, + IV = 3, + NAME = 4 +} + export class DropDownLabel { public state: DropDownState; public text: string; diff --git a/src/ui/party-ui-handler.ts b/src/ui/party-ui-handler.ts index e7c4069c16e..a61037548e6 100644 --- a/src/ui/party-ui-handler.ts +++ b/src/ui/party-ui-handler.ts @@ -166,6 +166,8 @@ export default class PartyUiHandler extends MessageUiHandler { private iconAnimHandler: PokemonIconAnimHandler; + private blockInput: boolean; + private static FilterAll = (_pokemon: PlayerPokemon) => null; public static FilterNonFainted = (pokemon: PlayerPokemon) => { @@ -317,7 +319,7 @@ export default class PartyUiHandler extends MessageUiHandler { processInput(button: Button): boolean { const ui = this.getUi(); - if (this.pendingPrompt) { + if (this.pendingPrompt || this.blockInput) { return false; } @@ -485,7 +487,9 @@ export default class PartyUiHandler extends MessageUiHandler { this.clearOptions(); ui.playSelect(); if (this.cursor >= this.scene.currentBattle.getBattlerCount() || !pokemon.isAllowedInBattle()) { + this.blockInput = true; this.showText(i18next.t("partyUiHandler:releaseConfirmation", { pokemonName: getPokemonNameWithAffix(pokemon) }), null, () => { + this.blockInput = false; ui.setModeWithoutClear(Mode.CONFIRM, () => { ui.setMode(Mode.PARTY); this.doRelease(this.cursor); diff --git a/src/ui/starter-select-ui-handler.ts b/src/ui/starter-select-ui-handler.ts index 267a62104e3..ff76a467d25 100644 --- a/src/ui/starter-select-ui-handler.ts +++ b/src/ui/starter-select-ui-handler.ts @@ -39,12 +39,13 @@ import { Species } from "#enums/species"; import {Button} from "#enums/buttons"; import { EggSourceType } from "#app/enums/egg-source-types.js"; import AwaitableUiHandler from "./awaitable-ui-handler"; -import { DropDown, DropDownLabel, DropDownOption, DropDownState, DropDownType } from "./dropdown"; +import { DropDown, DropDownLabel, DropDownOption, DropDownState, DropDownType, SortCriteria } from "./dropdown"; import { StarterContainer } from "./starter-container"; import { DropDownColumn, FilterBar } from "./filter-bar"; import { ScrollBar } from "./scroll-bar"; import { SelectChallengePhase } from "#app/phases/select-challenge-phase.js"; import { TitlePhase } from "#app/phases/title-phase.js"; +import { Abilities } from "#app/enums/abilities"; export type StarterSelectCallback = (starters: Starter[]) => void; @@ -501,11 +502,11 @@ export default class StarterSelectUiHandler extends MessageUiHandler { // sort filter const sortOptions = [ - new DropDownOption(this.scene, 0, new DropDownLabel(i18next.t("filterBar:sortByNumber"), undefined, DropDownState.ON)), - new DropDownOption(this.scene, 1, new DropDownLabel(i18next.t("filterBar:sortByCost"))), - new DropDownOption(this.scene, 2, new DropDownLabel(i18next.t("filterBar:sortByCandies"))), - new DropDownOption(this.scene, 3, new DropDownLabel(i18next.t("filterBar:sortByIVs"))), - new DropDownOption(this.scene, 4, new DropDownLabel(i18next.t("filterBar:sortByName"))) + new DropDownOption(this.scene, SortCriteria.NUMBER, new DropDownLabel(i18next.t("filterBar:sortByNumber"), undefined, DropDownState.ON)), + new DropDownOption(this.scene, SortCriteria.COST, new DropDownLabel(i18next.t("filterBar:sortByCost"))), + new DropDownOption(this.scene, SortCriteria.CANDY, new DropDownLabel(i18next.t("filterBar:sortByCandies"))), + new DropDownOption(this.scene, SortCriteria.IV, new DropDownLabel(i18next.t("filterBar:sortByIVs"))), + new DropDownOption(this.scene, SortCriteria.NAME, new DropDownLabel(i18next.t("filterBar:sortByName"))) ]; this.filterBar.addFilter(DropDownColumn.SORT, i18next.t("filterBar:sortFilter"), new DropDown(this.scene, 0, 0, sortOptions, this.updateStarters, DropDownType.SINGLE)); this.filterBarContainer.add(this.filterBar); @@ -2363,6 +2364,7 @@ export default class StarterSelectUiHandler extends MessageUiHandler { // First, ensure you have the caught attributes for the species else default to bigint 0 const caughtAttr = this.scene.gameData.dexData[container.species.speciesId]?.caughtAttr || BigInt(0); const starterData = this.scene.gameData.starterData[container.species.speciesId]; + const isStarterProgressable = speciesEggMoves.hasOwnProperty(container.species.speciesId); // Gen filter const fitsGen = this.filterBar.getVals(DropDownColumn.GEN).includes(container.species.generation); @@ -2398,7 +2400,7 @@ export default class StarterSelectUiHandler extends MessageUiHandler { if (unlocks.val === "PASSIVE" && unlocks.state === DropDownState.ON) { return isPassiveUnlocked; } else if (unlocks.val === "PASSIVE" && unlocks.state === DropDownState.EXCLUDE) { - return !isPassiveUnlocked; + return isStarterProgressable && !isPassiveUnlocked; } else if (unlocks.val === "PASSIVE" && unlocks.state === DropDownState.UNLOCKABLE) { return isPassiveUnlockable; } else if (unlocks.val === "PASSIVE" && unlocks.state === DropDownState.OFF) { @@ -2413,7 +2415,7 @@ export default class StarterSelectUiHandler extends MessageUiHandler { if (unlocks.val === "COST_REDUCTION" && unlocks.state === DropDownState.ON) { return isCostReduced; } else if (unlocks.val === "COST_REDUCTION" && unlocks.state === DropDownState.EXCLUDE) { - return !isCostReduced; + return isStarterProgressable && !isCostReduced; } else if (unlocks.val === "COST_REDUCTION" && unlocks.state === DropDownState.UNLOCKABLE) { return isCostReductionUnlockable; } else if (unlocks.val === "COST_REDUCTION" && unlocks.state === DropDownState.OFF) { @@ -2450,12 +2452,13 @@ export default class StarterSelectUiHandler extends MessageUiHandler { }); // HA Filter + const speciesHasHiddenAbility = container.species.abilityHidden !== container.species.ability1 && container.species.abilityHidden !== Abilities.NONE; const hasHA = starterData.abilityAttr & AbilityAttr.ABILITY_HIDDEN; const fitsHA = this.filterBar.getVals(DropDownColumn.MISC).some(misc => { if (misc.val === "HIDDEN_ABILITY" && misc.state === DropDownState.ON) { return hasHA; } else if (misc.val === "HIDDEN_ABILITY" && misc.state === DropDownState.EXCLUDE) { - return !hasHA; + return speciesHasHiddenAbility && !hasHA; } else if (misc.val === "HIDDEN_ABILITY" && misc.state === DropDownState.OFF) { return true; } @@ -2467,7 +2470,7 @@ export default class StarterSelectUiHandler extends MessageUiHandler { if (misc.val === "EGG" && misc.state === DropDownState.ON) { return isEggPurchasable; } else if (misc.val === "EGG" && misc.state === DropDownState.EXCLUDE) { - return !isEggPurchasable; + return isStarterProgressable && !isEggPurchasable; } else if (misc.val === "EGG" && misc.state === DropDownState.OFF) { return true; } @@ -2498,19 +2501,19 @@ export default class StarterSelectUiHandler extends MessageUiHandler { switch (sort.val) { default: break; - case 0: + case SortCriteria.NUMBER: return (a.species.speciesId - b.species.speciesId) * -sort.dir; - case 1: + case SortCriteria.COST: return (a.cost - b.cost) * -sort.dir; - case 2: + case SortCriteria.CANDY: const candyCountA = this.scene.gameData.starterData[a.species.speciesId].candyCount; const candyCountB = this.scene.gameData.starterData[b.species.speciesId].candyCount; return (candyCountA - candyCountB) * -sort.dir; - case 3: + case SortCriteria.IV: const avgIVsA = this.scene.gameData.dexData[a.species.speciesId].ivs.reduce((a, b) => a + b, 0) / this.scene.gameData.dexData[a.species.speciesId].ivs.length; const avgIVsB = this.scene.gameData.dexData[b.species.speciesId].ivs.reduce((a, b) => a + b, 0) / this.scene.gameData.dexData[b.species.speciesId].ivs.length; return (avgIVsA - avgIVsB) * -sort.dir; - case 4: + case SortCriteria.NAME: return a.species.name.localeCompare(b.species.name) * -sort.dir; } return 0; diff --git a/src/ui/ui.ts b/src/ui/ui.ts index 7108a8dd480..8ec91b59480 100644 --- a/src/ui/ui.ts +++ b/src/ui/ui.ts @@ -317,10 +317,11 @@ export default class UI extends Phaser.GameObjects.Container { if (i18next.exists(keyOrText) ) { const i18nKey = keyOrText; hasi18n = true; + text = i18next.t(i18nKey, { context: genderStr }); // override text with translation // Skip dialogue if the player has enabled the option and the dialogue has been already seen - if (battleScene.skipSeenDialogues && battleScene.gameData.getSeenDialogues()[i18nKey] === true) { + if (this.shouldSkipDialogue(i18nKey)) { console.log(`Dialogue ${i18nKey} skipped`); callback(); return;