From d7cc8a6e5cc4afdaa9fe0327d221fa6f4ef70c95 Mon Sep 17 00:00:00 2001 From: frutescens Date: Sun, 1 Sep 2024 15:33:10 -0700 Subject: [PATCH 1/4] Fixed pt-BR and zh-CN --- ...-update-pt_BR.png => september-update-pt-BR.png} | Bin ...-update-zh_CN.png => september-update-zh-CN.png} | Bin src/loading-scene.ts | 2 +- src/timed-event-manager.ts | 2 +- 4 files changed, 2 insertions(+), 2 deletions(-) rename public/images/events/{september-update-pt_BR.png => september-update-pt-BR.png} (100%) rename public/images/events/{september-update-zh_CN.png => september-update-zh-CN.png} (100%) diff --git a/public/images/events/september-update-pt_BR.png b/public/images/events/september-update-pt-BR.png similarity index 100% rename from public/images/events/september-update-pt_BR.png rename to public/images/events/september-update-pt-BR.png diff --git a/public/images/events/september-update-zh_CN.png b/public/images/events/september-update-zh-CN.png similarity index 100% rename from public/images/events/september-update-zh_CN.png rename to public/images/events/september-update-zh-CN.png diff --git a/src/loading-scene.ts b/src/loading-scene.ts index e4a73414cd1..f5b44f03458 100644 --- a/src/loading-scene.ts +++ b/src/loading-scene.ts @@ -244,7 +244,7 @@ export class LoadingScene extends SceneBase { } else { this.loadAtlas("types", ""); } - const availableLangs = ["en", "de", "it", "fr", "ja", "ko", "es", "pt_BR", "zh_CN"]; + 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 { diff --git a/src/timed-event-manager.ts b/src/timed-event-manager.ts index abdb2db232a..874bf6a8b46 100644 --- a/src/timed-event-manager.ts +++ b/src/timed-event-manager.ts @@ -33,7 +33,7 @@ const timedEvents: TimedEvent[] = [ xPosition: 19, yPosition: 115, scale: 0.30, - availableLangs: ["en", "de", "it", "fr", "ja", "ko", "es", "pt_BR", "zh_CN"] + availableLangs: ["en", "de", "it", "fr", "ja", "ko", "es", "pt-BR", "zh-CN"] } ]; From ac1c29facaedc572f7cdcf2c69aeb3a379c0c153 Mon Sep 17 00:00:00 2001 From: Frederico Santos Date: Mon, 2 Sep 2024 00:03:51 +0100 Subject: [PATCH 2/4] fix: Fix missing comma in biomeLinks array --- src/data/biomes.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/data/biomes.ts b/src/data/biomes.ts index 721231f9cb0..0e37cc94ff5 100644 --- a/src/data/biomes.ts +++ b/src/data/biomes.ts @@ -1,6 +1,6 @@ import { Type } from "./type"; import * as Utils from "../utils"; -import {pokemonEvolutions, SpeciesFormEvolution} from "./pokemon-evolutions"; +import { pokemonEvolutions, SpeciesFormEvolution } from "./pokemon-evolutions"; import i18next from "i18next"; import { Biome } from "#enums/biome"; import { Species } from "#enums/species"; @@ -46,7 +46,7 @@ export const biomeLinks: BiomeLinks = { [Biome.SEABED]: [ Biome.CAVE, [ Biome.VOLCANO, 3 ] ], [Biome.MOUNTAIN]: [ Biome.VOLCANO, [ Biome.WASTELAND, 2 ], [ Biome.SPACE, 3 ] ], [Biome.BADLANDS]: [ Biome.DESERT, Biome.MOUNTAIN ], - [Biome.CAVE]: [ Biome.BADLANDS, Biome.LAKE [ Biome.LABORATORY, 2 ] ], + [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 ], From 51ab51cc645b60b494ed1333c42a260e563145ca Mon Sep 17 00:00:00 2001 From: Blitzy <118096277+Blitz425@users.noreply.github.com> Date: Sun, 1 Sep 2024 23:08:43 -0500 Subject: [PATCH 3/4] [Balance Hotfix] GMax Butterfree tinted lens -> compound eyes (#3967) --- src/data/pokemon-species.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/data/pokemon-species.ts b/src/data/pokemon-species.ts index 17f2de794ae..3335f8112f8 100644 --- a/src/data/pokemon-species.ts +++ b/src/data/pokemon-species.ts @@ -944,7 +944,7 @@ export function initSpecies() { new PokemonSpecies(Species.METAPOD, 1, false, false, false, "Cocoon Pokémon", Type.BUG, null, 0.7, 9.9, Abilities.SHED_SKIN, Abilities.NONE, Abilities.SHED_SKIN, 205, 50, 20, 55, 25, 25, 30, 120, 50, 72, GrowthRate.MEDIUM_FAST, 50, false), new PokemonSpecies(Species.BUTTERFREE, 1, false, false, false, "Butterfly Pokémon", Type.BUG, Type.FLYING, 1.1, 32, Abilities.COMPOUND_EYES, Abilities.NONE, Abilities.TINTED_LENS, 395, 60, 45, 50, 90, 80, 70, 45, 50, 198, GrowthRate.MEDIUM_FAST, 50, true, true, new PokemonForm("Normal", "", Type.BUG, Type.FLYING, 1.1, 32, Abilities.COMPOUND_EYES, Abilities.NONE, Abilities.TINTED_LENS, 395, 60, 45, 50, 90, 80, 70, 45, 50, 198, true, null, true), - new PokemonForm("G-Max", SpeciesFormKey.GIGANTAMAX, Type.BUG, Type.FLYING, 17, 32, Abilities.TINTED_LENS, Abilities.TINTED_LENS, Abilities.TINTED_LENS, 495, 85, 35, 80, 120, 90, 85, 45, 50, 198, true), + new PokemonForm("G-Max", SpeciesFormKey.GIGANTAMAX, Type.BUG, Type.FLYING, 17, 32, Abilities.COMPOUND_EYES, Abilities.COMPOUND_EYES, Abilities.COMPOUND_EYES, 495, 85, 35, 80, 120, 90, 85, 45, 50, 198, true), ), new PokemonSpecies(Species.WEEDLE, 1, false, false, false, "Hairy Bug Pokémon", Type.BUG, Type.POISON, 0.3, 3.2, Abilities.SHIELD_DUST, Abilities.NONE, Abilities.RUN_AWAY, 195, 40, 35, 30, 20, 20, 50, 255, 70, 39, GrowthRate.MEDIUM_FAST, 50, false), new PokemonSpecies(Species.KAKUNA, 1, false, false, false, "Cocoon Pokémon", Type.BUG, Type.POISON, 0.6, 10, Abilities.SHED_SKIN, Abilities.NONE, Abilities.SHED_SKIN, 205, 45, 25, 50, 25, 25, 35, 120, 70, 72, GrowthRate.MEDIUM_FAST, 50, false), From 4ac7f7005acd42a194dbefd375104e174f691639 Mon Sep 17 00:00:00 2001 From: new name Date: Mon, 2 Sep 2024 02:13:47 -0400 Subject: [PATCH 4/4] electric terrain --- src/data/battler-tags.ts | 8 ++++++-- src/data/move.ts | 8 +------- src/field/pokemon.ts | 30 +++++++++++++++++++++++++++--- 3 files changed, 34 insertions(+), 12 deletions(-) diff --git a/src/data/battler-tags.ts b/src/data/battler-tags.ts index 92df6fc294f..6aa82e3a7dd 100644 --- a/src/data/battler-tags.ts +++ b/src/data/battler-tags.ts @@ -7,7 +7,7 @@ import * as Utils from "../utils"; import { ChargeAttr, MoveFlags, allMoves } from "./move"; import { Type } from "./type"; import { BlockNonDirectDamageAbAttr, FlinchEffectAbAttr, ReverseDrainAbAttr, applyAbAttrs } from "./ability"; -import { TerrainType } from "./terrain"; +import { getTerrainName, TerrainType } from "./terrain"; import { WeatherType } from "./weather"; import { BattleStat } from "./battle-stat"; import { allAbilities } from "./ability"; @@ -839,7 +839,11 @@ export class DrowsyTag extends BattlerTag { } canAdd(pokemon: Pokemon): boolean { - return pokemon.scene.arena.terrain?.terrainType !== TerrainType.ELECTRIC || !pokemon.isGrounded(); + const isElectricTerrainProtected = (pokemon.scene.arena.terrain?.terrainType === TerrainType.ELECTRIC && pokemon.isGrounded()); + if (isElectricTerrainProtected) { + pokemon.scene.queueMessage(i18next.t("terrain:defaultBlockMessage", { pokemonNameWithAffix: getPokemonNameWithAffix(pokemon), terrainName: getTerrainName(TerrainType.ELECTRIC) })); + } + return !isElectricTerrainProtected; } onAdd(pokemon: Pokemon): void { diff --git a/src/data/move.ts b/src/data/move.ts index 1dc715f264a..5bfba140386 100644 --- a/src/data/move.ts +++ b/src/data/move.ts @@ -1954,14 +1954,8 @@ export class StatusEffectAttr extends MoveEffectAttr { } } - if (user !== target && target.scene.arena.getTagOnSide(ArenaTagType.SAFEGUARD, target.isPlayer() ? ArenaTagSide.PLAYER : ArenaTagSide.ENEMY)) { - if (move.category === MoveCategory.STATUS) { - user.scene.queueMessage(i18next.t("moveTriggers:safeguard", { targetName: getPokemonNameWithAffix(target)})); - } - return false; - } if ((!pokemon.status || (pokemon.status.effect === this.effect && moveChance < 0)) - && pokemon.trySetStatus(this.effect, true, user, this.cureTurn)) { + && pokemon.checkIfCanSetStatus(this.effect, false, false, user) && pokemon.trySetStatus(this.effect, true, user, this.cureTurn, null)) { applyPostAttackAbAttrs(ConfusionOnStatusEffectAbAttr, user, target, move, null, false, this.effect); return true; } diff --git a/src/field/pokemon.ts b/src/field/pokemon.ts index 8594d5b769b..d4413a22de0 100644 --- a/src/field/pokemon.ts +++ b/src/field/pokemon.ts @@ -34,7 +34,7 @@ import { DexAttr, StarterDataEntry, StarterMoveset } from "../system/game-data"; import { QuantizerCelebi, argbFromRgba, rgbaFromArgb } from "@material/material-color-utilities"; import { Nature, getNatureStatMultiplier } from "../data/nature"; import { SpeciesFormChange, SpeciesFormChangeActiveTrigger, SpeciesFormChangeMoveLearnedTrigger, SpeciesFormChangePostMoveTrigger, SpeciesFormChangeStatusEffectTrigger } from "../data/pokemon-forms"; -import { TerrainType } from "../data/terrain"; +import { getTerrainName, TerrainType } from "../data/terrain"; import { TrainerSlot } from "../data/trainer-config"; import Overrides from "#app/overrides"; import i18next from "i18next"; @@ -2775,7 +2775,15 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container { return this.gender !== Gender.GENDERLESS && pokemon.gender === (this.gender === Gender.MALE ? Gender.FEMALE : Gender.MALE); } - canSetStatus(effect: StatusEffect | undefined, quiet: boolean = false, overrideStatus: boolean = false, sourcePokemon: Pokemon | null = null): boolean { + /** + * Checks if it is possible for a pokemon to be afflicted with the given status + * @param effect {@linkcode StatusEffect} the status effect being checked. + * @param quiet a boolean value that is sometimes used as the asPhase boolean which causes unshifting the phase. + * @param overrideStatus a boolean value to determine whether a status should be overriden. If true, the pokemon cannot be statused essentially + * @param sourcePokemon {@linkcode Pokemon} The pokemon causing the status. The target pokemon is 'this'. + * @returns true if the pokemon can be affected by the status, false if not. + */ + checkIfCanSetStatus(effect: StatusEffect | undefined, quiet: boolean = false, overrideStatus: boolean = false, sourcePokemon: Pokemon | null = null): boolean { if (effect !== StatusEffect.FAINT) { if (overrideStatus ? this.status?.effect === effect : this.status) { return false; @@ -2827,6 +2835,9 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container { break; case StatusEffect.SLEEP: if (this.isGrounded() && this.scene.arena.terrain?.terrainType === TerrainType.ELECTRIC) { + if (!quiet) { + this.scene.queueMessage(i18next.t("terrain:defaultBlockMessage", { pokemonNameWithAffix: getPokemonNameWithAffix(this), terrainName: getTerrainName(TerrainType.ELECTRIC) })); + } return false; } break; @@ -2841,6 +2852,19 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container { } break; } + return true; + } + + /** + * Checks if it is possible for a pokemon to be afflicted with the given status + * @param effect {@linkcode StatusEffect} the status effect being checked. + * @param quiet a boolean value that is sometimes used as the asPhase boolean which in this case affects that. + * @param overrideStatus a boolean value to determine whether a status should be overriden. If true, the pokemon cannot be statused essentially + * @param sourcePokemon {@linkcode Pokemon} The pokemon causing the status. The target pokemon is 'this'. + * @returns true if the pokemon can be affected by the status, false if not. + */ + canSetStatus(effect: StatusEffect | undefined, quiet: boolean = false, overrideStatus: boolean = false, sourcePokemon: Pokemon | null = null): boolean { + const canSetStatus = this.checkIfCanSetStatus(effect, quiet, overrideStatus, sourcePokemon); const cancelled = new Utils.BooleanHolder(false); applyPreSetStatusAbAttrs(StatusEffectImmunityAbAttr, this, effect, cancelled, quiet); @@ -2852,7 +2876,7 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container { return false; } - return true; + return canSetStatus; } trySetStatus(effect: StatusEffect | undefined, asPhase: boolean = false, sourcePokemon: Pokemon | null = null, cureTurn: integer | null = 0, sourceText: string | null = null): boolean {