From b49c994d2d6eb09cbce708b29462c6e46848e695 Mon Sep 17 00:00:00 2001 From: AJ Fontaine <36677462+Fontbane@users.noreply.github.com> Date: Wed, 23 Apr 2025 15:48:04 -0400 Subject: [PATCH 01/18] [Balance][Refactor] Move fixed boss waves enum to file, adjust GL templates (#5689) * Move fixed boss waves enum to file, adjust GL templates * Move post return to default case * Address comment --------- Co-authored-by: Wlowscha <54003515+Wlowscha@users.noreply.github.com> --- src/battle.ts | 24 +------- src/data/challenge.ts | 3 +- src/data/trainers/TrainerPartyTemplate.ts | 73 +++++++++++++++++------ src/enums/fixed-boss-waves.ts | 22 +++++++ src/phases/victory-phase.ts | 2 +- 5 files changed, 80 insertions(+), 44 deletions(-) create mode 100644 src/enums/fixed-boss-waves.ts diff --git a/src/battle.ts b/src/battle.ts index 6630d53bd67..07e520d6bc0 100644 --- a/src/battle.ts +++ b/src/battle.ts @@ -31,29 +31,7 @@ import type { CustomModifierSettings } from "#app/modifier/modifier-type"; import { ModifierTier } from "#app/modifier/modifier-tier"; import type { MysteryEncounterType } from "#enums/mystery-encounter-type"; import { BattleType } from "#enums/battle-type"; - -export enum ClassicFixedBossWaves { - TOWN_YOUNGSTER = 5, - RIVAL_1 = 8, - RIVAL_2 = 25, - EVIL_GRUNT_1 = 35, - RIVAL_3 = 55, - EVIL_GRUNT_2 = 62, - EVIL_GRUNT_3 = 64, - EVIL_ADMIN_1 = 66, - RIVAL_4 = 95, - EVIL_GRUNT_4 = 112, - EVIL_ADMIN_2 = 114, - EVIL_BOSS_1 = 115, - RIVAL_5 = 145, - EVIL_BOSS_2 = 165, - ELITE_FOUR_1 = 182, - ELITE_FOUR_2 = 184, - ELITE_FOUR_3 = 186, - ELITE_FOUR_4 = 188, - CHAMPION = 190, - RIVAL_6 = 195, -} +import { ClassicFixedBossWaves } from "#enums/fixed-boss-waves"; export enum BattlerIndex { ATTACKER = -1, diff --git a/src/data/challenge.ts b/src/data/challenge.ts index f786152ca3d..7388f397c7e 100644 --- a/src/data/challenge.ts +++ b/src/data/challenge.ts @@ -8,7 +8,8 @@ import { speciesStarterCosts } from "#app/data/balance/starters"; import type Pokemon from "#app/field/pokemon"; import { PokemonMove } from "#app/field/pokemon"; import type { FixedBattleConfig } from "#app/battle"; -import { ClassicFixedBossWaves, getRandomTrainerFunc } from "#app/battle"; +import { getRandomTrainerFunc } from "#app/battle"; +import { ClassicFixedBossWaves } from "#enums/fixed-boss-waves"; import { BattleType } from "#enums/battle-type"; import Trainer, { TrainerVariant } from "#app/field/trainer"; import { PokemonType } from "#enums/pokemon-type"; diff --git a/src/data/trainers/TrainerPartyTemplate.ts b/src/data/trainers/TrainerPartyTemplate.ts index 5d02ffdc6af..e4c8ddf4c58 100644 --- a/src/data/trainers/TrainerPartyTemplate.ts +++ b/src/data/trainers/TrainerPartyTemplate.ts @@ -1,6 +1,8 @@ import { startingWave } from "#app/starting-wave"; import { globalScene } from "#app/global-scene"; import { PartyMemberStrength } from "#enums/party-member-strength"; +import { GameModes } from "#app/game-mode"; +import { ClassicFixedBossWaves } from "#enums/fixed-boss-waves"; export class TrainerPartyTemplate { public size: number; @@ -165,6 +167,11 @@ export const trainerPartyTemplates = { new TrainerPartyTemplate(1, PartyMemberStrength.STRONGER), ), GYM_LEADER_5: new TrainerPartyCompoundTemplate( + new TrainerPartyTemplate(4, PartyMemberStrength.AVERAGE), + new TrainerPartyTemplate(1, PartyMemberStrength.STRONG), + new TrainerPartyTemplate(1, PartyMemberStrength.STRONGER), + ), + GYM_LEADER_6: new TrainerPartyCompoundTemplate( new TrainerPartyTemplate(3, PartyMemberStrength.AVERAGE), new TrainerPartyTemplate(2, PartyMemberStrength.STRONG), new TrainerPartyTemplate(1, PartyMemberStrength.STRONGER), @@ -222,19 +229,18 @@ export const trainerPartyTemplates = { */ export function getEvilGruntPartyTemplate(): TrainerPartyTemplate { const waveIndex = globalScene.currentBattle?.waveIndex; - if (waveIndex < 40) { - return trainerPartyTemplates.TWO_AVG; + switch (waveIndex) { + case ClassicFixedBossWaves.EVIL_GRUNT_1: + return trainerPartyTemplates.TWO_AVG; + case ClassicFixedBossWaves.EVIL_GRUNT_2: + return trainerPartyTemplates.THREE_AVG; + case ClassicFixedBossWaves.EVIL_GRUNT_3: + return trainerPartyTemplates.TWO_AVG_ONE_STRONG; + case ClassicFixedBossWaves.EVIL_ADMIN_1: + return trainerPartyTemplates.GYM_LEADER_4; // 3avg 1 strong 1 stronger + default: + return trainerPartyTemplates.GYM_LEADER_6; // 3 avg 2 strong 1 stronger } - if (waveIndex < 63) { - return trainerPartyTemplates.THREE_AVG; - } - if (waveIndex < 65) { - return trainerPartyTemplates.TWO_AVG_ONE_STRONG; - } - if (waveIndex < 112) { - return trainerPartyTemplates.GYM_LEADER_4; // 3avg 1 strong 1 stronger - } - return trainerPartyTemplates.GYM_LEADER_5; // 3 avg 2 strong 1 stronger } export function getWavePartyTemplate(...templates: TrainerPartyTemplate[]) { @@ -245,11 +251,40 @@ export function getWavePartyTemplate(...templates: TrainerPartyTemplate[]) { } export function getGymLeaderPartyTemplate() { - return getWavePartyTemplate( - trainerPartyTemplates.GYM_LEADER_1, - trainerPartyTemplates.GYM_LEADER_2, - trainerPartyTemplates.GYM_LEADER_3, - trainerPartyTemplates.GYM_LEADER_4, - trainerPartyTemplates.GYM_LEADER_5, - ); + const { currentBattle, gameMode } = globalScene; + switch (gameMode.modeId) { + case GameModes.DAILY: + if (currentBattle?.waveIndex <= 20) { + return trainerPartyTemplates.GYM_LEADER_2 + } + return trainerPartyTemplates.GYM_LEADER_3; + case GameModes.CHALLENGE: // In the future, there may be a ChallengeType to call here. For now, use classic's. + case GameModes.CLASSIC: + if (currentBattle?.waveIndex <= 20) { + return trainerPartyTemplates.GYM_LEADER_1; // 1 avg 1 strong + } + else if (currentBattle?.waveIndex <= 30) { + return trainerPartyTemplates.GYM_LEADER_2; // 1 avg 1 strong 1 stronger + } + else if (currentBattle?.waveIndex <= 60) { // 50 and 60 + return trainerPartyTemplates.GYM_LEADER_3; // 2 avg 1 strong 1 stronger + } + else if (currentBattle?.waveIndex <= 80) { + return trainerPartyTemplates.GYM_LEADER_4; // 3 avg 1 strong 1 stronger + } + else if (currentBattle?.waveIndex <= 90) { + return trainerPartyTemplates.GYM_LEADER_5; // 4 avg 1 strong 1 stronger + } + // 110+ + return trainerPartyTemplates.GYM_LEADER_6; // 3 avg 2 strong 1 stronger + default: + return getWavePartyTemplate( + trainerPartyTemplates.GYM_LEADER_1, + trainerPartyTemplates.GYM_LEADER_2, + trainerPartyTemplates.GYM_LEADER_3, + trainerPartyTemplates.GYM_LEADER_4, + trainerPartyTemplates.GYM_LEADER_5, + trainerPartyTemplates.GYM_LEADER_6, + ); + } } diff --git a/src/enums/fixed-boss-waves.ts b/src/enums/fixed-boss-waves.ts new file mode 100644 index 00000000000..623d9035472 --- /dev/null +++ b/src/enums/fixed-boss-waves.ts @@ -0,0 +1,22 @@ +export enum ClassicFixedBossWaves { + TOWN_YOUNGSTER = 5, + RIVAL_1 = 8, + RIVAL_2 = 25, + EVIL_GRUNT_1 = 35, + RIVAL_3 = 55, + EVIL_GRUNT_2 = 62, + EVIL_GRUNT_3 = 64, + EVIL_ADMIN_1 = 66, + RIVAL_4 = 95, + EVIL_GRUNT_4 = 112, + EVIL_ADMIN_2 = 114, + EVIL_BOSS_1 = 115, + RIVAL_5 = 145, + EVIL_BOSS_2 = 165, + ELITE_FOUR_1 = 182, + ELITE_FOUR_2 = 184, + ELITE_FOUR_3 = 186, + ELITE_FOUR_4 = 188, + CHAMPION = 190, + RIVAL_6 = 195 +} diff --git a/src/phases/victory-phase.ts b/src/phases/victory-phase.ts index 6e1837a4749..1204877fec2 100644 --- a/src/phases/victory-phase.ts +++ b/src/phases/victory-phase.ts @@ -1,5 +1,5 @@ import type { BattlerIndex } from "#app/battle"; -import { ClassicFixedBossWaves } from "#app/battle"; +import { ClassicFixedBossWaves } from "#enums/fixed-boss-waves"; import { BattleType } from "#enums/battle-type"; import type { CustomModifierSettings } from "#app/modifier/modifier-type"; import { modifierTypes } from "#app/modifier/modifier-type"; From c7265543bdd7d5ee53af596d40ca05c36d48a931 Mon Sep 17 00:00:00 2001 From: Blitzy <118096277+Blitz425@users.noreply.github.com> Date: Wed, 23 Apr 2025 16:15:45 -0500 Subject: [PATCH 02/18] [Balance] Update Transistor to Gen IX version (#5700) Update ability.ts --- src/data/abilities/ability.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/data/abilities/ability.ts b/src/data/abilities/ability.ts index d8b648ebe82..b018a87a08d 100644 --- a/src/data/abilities/ability.ts +++ b/src/data/abilities/ability.ts @@ -7227,7 +7227,7 @@ export function initAbilities() { new Ability(Abilities.CURIOUS_MEDICINE, 8) .attr(PostSummonClearAllyStatStagesAbAttr), new Ability(Abilities.TRANSISTOR, 8) - .attr(MoveTypePowerBoostAbAttr, PokemonType.ELECTRIC), + .attr(MoveTypePowerBoostAbAttr, PokemonType.ELECTRIC, 1.3), new Ability(Abilities.DRAGONS_MAW, 8) .attr(MoveTypePowerBoostAbAttr, PokemonType.DRAGON), new Ability(Abilities.CHILLING_NEIGH, 8) @@ -7412,4 +7412,4 @@ export function initAbilities() { .unreplaceable() // TODO is this true? .attr(ConfusionOnStatusEffectAbAttr, StatusEffect.POISON, StatusEffect.TOXIC) ); -} \ No newline at end of file +} From 5de567a3db84d791641c39ac0bbbfbb7a19320b6 Mon Sep 17 00:00:00 2001 From: AJ Fontaine <36677462+Fontbane@users.noreply.github.com> Date: Wed, 23 Apr 2025 17:18:03 -0400 Subject: [PATCH 03/18] [Balance] Wave 90 gym leader has 5 mons (#5699) 5 mons on wave 90 --- src/data/trainers/TrainerPartyTemplate.ts | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) diff --git a/src/data/trainers/TrainerPartyTemplate.ts b/src/data/trainers/TrainerPartyTemplate.ts index e4c8ddf4c58..1952bcc179e 100644 --- a/src/data/trainers/TrainerPartyTemplate.ts +++ b/src/data/trainers/TrainerPartyTemplate.ts @@ -167,11 +167,6 @@ export const trainerPartyTemplates = { new TrainerPartyTemplate(1, PartyMemberStrength.STRONGER), ), GYM_LEADER_5: new TrainerPartyCompoundTemplate( - new TrainerPartyTemplate(4, PartyMemberStrength.AVERAGE), - new TrainerPartyTemplate(1, PartyMemberStrength.STRONG), - new TrainerPartyTemplate(1, PartyMemberStrength.STRONGER), - ), - GYM_LEADER_6: new TrainerPartyCompoundTemplate( new TrainerPartyTemplate(3, PartyMemberStrength.AVERAGE), new TrainerPartyTemplate(2, PartyMemberStrength.STRONG), new TrainerPartyTemplate(1, PartyMemberStrength.STRONGER), @@ -239,7 +234,7 @@ export function getEvilGruntPartyTemplate(): TrainerPartyTemplate { case ClassicFixedBossWaves.EVIL_ADMIN_1: return trainerPartyTemplates.GYM_LEADER_4; // 3avg 1 strong 1 stronger default: - return trainerPartyTemplates.GYM_LEADER_6; // 3 avg 2 strong 1 stronger + return trainerPartyTemplates.GYM_LEADER_5; // 3 avg 2 strong 1 stronger } } @@ -269,14 +264,11 @@ export function getGymLeaderPartyTemplate() { else if (currentBattle?.waveIndex <= 60) { // 50 and 60 return trainerPartyTemplates.GYM_LEADER_3; // 2 avg 1 strong 1 stronger } - else if (currentBattle?.waveIndex <= 80) { + else if (currentBattle?.waveIndex <= 90) { // 80 and 90 return trainerPartyTemplates.GYM_LEADER_4; // 3 avg 1 strong 1 stronger } - else if (currentBattle?.waveIndex <= 90) { - return trainerPartyTemplates.GYM_LEADER_5; // 4 avg 1 strong 1 stronger - } // 110+ - return trainerPartyTemplates.GYM_LEADER_6; // 3 avg 2 strong 1 stronger + return trainerPartyTemplates.GYM_LEADER_5; // 3 avg 2 strong 1 stronger default: return getWavePartyTemplate( trainerPartyTemplates.GYM_LEADER_1, @@ -284,7 +276,6 @@ export function getGymLeaderPartyTemplate() { trainerPartyTemplates.GYM_LEADER_3, trainerPartyTemplates.GYM_LEADER_4, trainerPartyTemplates.GYM_LEADER_5, - trainerPartyTemplates.GYM_LEADER_6, ); } } From 75400a39ed16e2f86e9c82b930827a3590cf6b39 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?In=C3=AAs=20Sim=C3=B5es?= Date: Wed, 23 Apr 2025 22:29:44 +0100 Subject: [PATCH 04/18] [Bug] [UI/UX] Status moves now play a No Effect Message Against Immune Type Pokemon (#5533) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Fix #5085 Moves dont play a No Effect Message Against Immune Type When using non-volatile status move like: Will-O-Wisp, Thunder Wave, Toxic, or Poison Gas against a Pokémon whose type is immune to that Status condition, no "It doesn't affect" message plays. My proposed fixes: In move.ts: Removed a redudant if statement in StatusEffectAttr class In pokemon.ts: Renamed the "messageIsImmune" function to "queueImmuneMessage" --- src/data/moves/move.ts | 9 +-------- src/field/pokemon.ts | 45 ++++++++++++++++++++++++++++++++---------- 2 files changed, 36 insertions(+), 18 deletions(-) diff --git a/src/data/moves/move.ts b/src/data/moves/move.ts index 5d57bb6dc49..903b2726676 100644 --- a/src/data/moves/move.ts +++ b/src/data/moves/move.ts @@ -2459,14 +2459,7 @@ export class StatusEffectAttr extends MoveEffectAttr { const statusCheck = moveChance < 0 || moveChance === 100 || user.randSeedInt(100) < moveChance; if (statusCheck) { const pokemon = this.selfTarget ? user : target; - if (pokemon.status && !this.overrideStatus) { - return false; - } - - if (user !== target && target.isSafeguarded(user)) { - if (move.category === MoveCategory.STATUS) { - globalScene.queueMessage(i18next.t("moveTriggers:safeguard", { targetName: getPokemonNameWithAffix(target) })); - } + if (user !== target && move.category === MoveCategory.STATUS && !target.canSetStatus(this.effect, false, false, user, true)) { return false; } if (((!pokemon.status || this.overrideStatus) || (pokemon.status.effect === this.effect && moveChance < 0)) diff --git a/src/field/pokemon.ts b/src/field/pokemon.ts index d565a590792..2de8cc150c9 100644 --- a/src/field/pokemon.ts +++ b/src/field/pokemon.ts @@ -248,6 +248,7 @@ import { PLAYER_PARTY_MAX_SIZE } from "#app/constants"; import { CustomPokemonData } from "#app/data/custom-pokemon-data"; import { SwitchType } from "#enums/switch-type"; import { SpeciesFormKey } from "#enums/species-form-key"; +import {getStatusEffectOverlapText } from "#app/data/status-effect"; import { BASE_HIDDEN_ABILITY_CHANCE, BASE_SHINY_CHANCE, @@ -5364,6 +5365,18 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container { ); } + queueImmuneMessage(quiet: boolean, effect?: StatusEffect): void { + if (!effect || quiet) { + return; + } + const message = effect && this.status?.effect === effect + ? getStatusEffectOverlapText(effect ?? StatusEffect.NONE, getPokemonNameWithAffix(this)) + : i18next.t("abilityTriggers:moveImmunity", { + pokemonNameWithAffix: getPokemonNameWithAffix(this), + }); + globalScene.queueMessage(message); + } + /** * Checks if a status effect can be applied to the Pokemon. * @@ -5382,6 +5395,7 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container { ): boolean { if (effect !== StatusEffect.FAINT) { if (overrideStatus ? this.status?.effect === effect : this.status) { + this.queueImmuneMessage(quiet, effect); return false; } if ( @@ -5389,18 +5403,11 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container { !ignoreField && globalScene.arena.terrain?.terrainType === TerrainType.MISTY ) { + this.queueImmuneMessage(quiet, effect); return false; } } - if ( - sourcePokemon && - sourcePokemon !== this && - this.isSafeguarded(sourcePokemon) - ) { - return false; - } - const types = this.getTypes(true, true); switch (effect) { @@ -5429,17 +5436,19 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container { } } - return true; + return true; }); if (this.isOfType(PokemonType.POISON) || this.isOfType(PokemonType.STEEL)) { if (poisonImmunity.includes(true)) { + this.queueImmuneMessage(quiet, effect); return false; } } break; case StatusEffect.PARALYSIS: if (this.isOfType(PokemonType.ELECTRIC)) { + this.queueImmuneMessage(quiet, effect); return false; } break; @@ -5448,6 +5457,7 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container { this.isGrounded() && globalScene.arena.terrain?.terrainType === TerrainType.ELECTRIC ) { + this.queueImmuneMessage(quiet, effect); return false; } break; @@ -5460,11 +5470,13 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container { globalScene.arena.weather.weatherType, )) ) { + this.queueImmuneMessage(quiet, effect); return false; } break; case StatusEffect.BURN: if (this.isOfType(PokemonType.FIRE)) { + this.queueImmuneMessage(quiet, effect); return false; } break; @@ -5499,6 +5511,19 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container { return false; } + if ( + sourcePokemon && + sourcePokemon !== this && + this.isSafeguarded(sourcePokemon) + ) { + if(!quiet){ + globalScene.queueMessage( + i18next.t("moveTriggers:safeguard", { targetName: getPokemonNameWithAffix(this) + })); + } + return false; + } + return true; } @@ -5510,7 +5535,7 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container { sourceText: string | null = null, overrideStatus?: boolean ): boolean { - if (!this.canSetStatus(effect, asPhase, overrideStatus, sourcePokemon)) { + if (!this.canSetStatus(effect, false, overrideStatus, sourcePokemon)) { return false; } if (this.isFainted() && effect !== StatusEffect.FAINT) { From 6ea5b4fa9da940e31564097f849eee9eae2f5d64 Mon Sep 17 00:00:00 2001 From: NightKev <34855794+DayKev@users.noreply.github.com> Date: Wed, 23 Apr 2025 17:22:25 -0700 Subject: [PATCH 05/18] [Bug] Fix doubles trainers not initializing properly (#5702) * [Bug] Fix doubles trainers not initializing properly * Add missing override in Whirlwind test --- src/battle-scene.ts | 4 ++-- test/moves/whirlwind.test.ts | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/battle-scene.ts b/src/battle-scene.ts index 2ff5d718ede..8fe6c85263d 100644 --- a/src/battle-scene.ts +++ b/src/battle-scene.ts @@ -1394,9 +1394,9 @@ export default class BattleScene extends SceneBase { if (double === undefined && newWaveIndex > 1) { if (newBattleType === BattleType.WILD && !this.gameMode.isWaveFinal(newWaveIndex)) { newDouble = !randSeedInt(this.getDoubleBattleChance(newWaveIndex, playerField)); + } else if (newBattleType === BattleType.TRAINER) { + newDouble = newTrainer?.variant === TrainerVariant.DOUBLE; } - } else if (double === undefined && newBattleType === BattleType.TRAINER) { - newDouble = newTrainer?.variant === TrainerVariant.DOUBLE; } else if (!battleConfig) { newDouble = !!double; } diff --git a/test/moves/whirlwind.test.ts b/test/moves/whirlwind.test.ts index b0ca1783f2f..6b5133ec7b1 100644 --- a/test/moves/whirlwind.test.ts +++ b/test/moves/whirlwind.test.ts @@ -163,6 +163,7 @@ describe("Moves - Whirlwind", () => { it("should not pull in the other trainer's pokemon in a partner trainer battle", async () => { game.override + .startingWave(2) .battleType(BattleType.TRAINER) .randomTrainer({ trainerType: TrainerType.BREEDER, From 793d89fa2491ee4c734983b2b91b445c35777350 Mon Sep 17 00:00:00 2001 From: damocleas Date: Thu, 24 Apr 2025 16:04:17 -0400 Subject: [PATCH 06/18] [i18n] Update locales submodule Update locales submodule --- public/locales | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/public/locales b/public/locales index e98f0eb9c20..18c1963ef30 160000 --- a/public/locales +++ b/public/locales @@ -1 +1 @@ -Subproject commit e98f0eb9c2022bc78b53f0444424c636498e725a +Subproject commit 18c1963ef309612a5a7fef76f9879709a7202189 From 6dc2a7fddc523b73bdb1af6c38be2ded47f1f689 Mon Sep 17 00:00:00 2001 From: Sirz Benjie <142067137+SirzBenjie@users.noreply.github.com> Date: Thu, 24 Apr 2025 15:30:00 -0500 Subject: [PATCH 07/18] [Dev] Update phaser to 3.88 and fix graphical bug (#5704) --- package-lock.json | 18 +++++++++--------- package.json | 4 ++-- src/main.ts | 2 +- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/package-lock.json b/package-lock.json index 622eac908de..07fed79969e 100644 --- a/package-lock.json +++ b/package-lock.json @@ -18,8 +18,8 @@ "i18next-korean-postposition-processor": "^1.0.0", "json-stable-stringify": "^1.2.0", "jszip": "^3.10.1", - "phaser": "^3.70.0", - "phaser3-rex-plugins": "^1.80.14" + "phaser": "^3.88.2", + "phaser3-rex-plugins": "^1.80.15" }, "devDependencies": { "@biomejs/biome": "1.9.4", @@ -48,7 +48,7 @@ "vitest-canvas-mock": "^0.3.3" }, "engines": { - "node": ">=20.0.0" + "node": ">=22.0.0" } }, "node_modules/@ampproject/remapping": { @@ -6227,18 +6227,18 @@ } }, "node_modules/phaser": { - "version": "3.80.1", - "resolved": "https://registry.npmjs.org/phaser/-/phaser-3.80.1.tgz", - "integrity": "sha512-VQGAWoDOkEpAWYkI+PUADv5Ql+SM0xpLuAMBJHz9tBcOLqjJ2wd8bUhxJgOqclQlLTg97NmMd9MhS75w16x1Cw==", + "version": "3.88.2", + "resolved": "https://registry.npmjs.org/phaser/-/phaser-3.88.2.tgz", + "integrity": "sha512-UBgd2sAFuRJbF2xKaQ5jpMWB8oETncChLnymLGHcrnT53vaqiGrQWbUKUDBawKLm24sghjKo4Bf+/xfv8espZQ==", "license": "MIT", "dependencies": { "eventemitter3": "^5.0.1" } }, "node_modules/phaser3-rex-plugins": { - "version": "1.80.14", - "resolved": "https://registry.npmjs.org/phaser3-rex-plugins/-/phaser3-rex-plugins-1.80.14.tgz", - "integrity": "sha512-eHi3VgryO9umNu6D1yQU5IS6tH4TyC2Y6RgJ495nNp37X2fdYnmYpBfgFg+YaumvtaoOvCkUVyi/YqWNPf2X2A==", + "version": "1.80.15", + "resolved": "https://registry.npmjs.org/phaser3-rex-plugins/-/phaser3-rex-plugins-1.80.15.tgz", + "integrity": "sha512-Ur973N1W5st6XEYBcJko8eTcEbdDHMM+m7VqvT3j/EJeJwYyJ3bVb33JJDsFgefk3A2iAz2itP/UY7CzxJOJVA==", "license": "MIT", "dependencies": { "dagre": "^0.8.5", diff --git a/package.json b/package.json index ffe4c06bea0..4758e6c5182 100644 --- a/package.json +++ b/package.json @@ -63,8 +63,8 @@ "i18next-korean-postposition-processor": "^1.0.0", "json-stable-stringify": "^1.2.0", "jszip": "^3.10.1", - "phaser": "^3.70.0", - "phaser3-rex-plugins": "^1.80.14" + "phaser": "^3.88.2", + "phaser3-rex-plugins": "^1.80.15" }, "engines": { "node": ">=22.0.0" diff --git a/src/main.ts b/src/main.ts index 3d3965cad08..7db663d14c7 100644 --- a/src/main.ts +++ b/src/main.ts @@ -93,7 +93,7 @@ const startGame = async (manifest?: any) => { dom: { createContainer: true, }, - pixelArt: true, + antialias: false, pipeline: [InvertPostFX] as unknown as Phaser.Types.Core.PipelineConfig, scene: [LoadingScene, BattleScene], version: version, From 30e74eaaa8e6faa64e85023205849aae9a9b42dd Mon Sep 17 00:00:00 2001 From: zaccie Date: Sat, 26 Apr 2025 08:33:59 +1200 Subject: [PATCH 08/18] [Bug] Fix boss level location (#5688) --- src/ui/battle-info.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ui/battle-info.ts b/src/ui/battle-info.ts index 4f9e59c8c89..99a91a9330e 100644 --- a/src/ui/battle-info.ts +++ b/src/ui/battle-info.ts @@ -557,11 +557,11 @@ export default class BattleInfo extends Phaser.GameObjects.Container { this.ownedIcon, this.championRibbon, this.statusIndicator, - this.levelContainer, this.statValuesContainer, ].map(e => (e.x += 48 * (boss ? -1 : 1))); this.hpBar.x += 38 * (boss ? -1 : 1); this.hpBar.y += 2 * (this.boss ? -1 : 1); + this.levelContainer.x += 2 * (boss ? -1 : 1); this.hpBar.setTexture(`overlay_hp${boss ? "_boss" : ""}`); this.box.setTexture(this.getTextureName()); this.statsBox.setTexture(`${this.getTextureName()}_stats`); From 38d75897bb000343d9285f342507fb24cbbabac3 Mon Sep 17 00:00:00 2001 From: Xavion3 Date: Sat, 26 Apr 2025 11:28:52 +1000 Subject: [PATCH 09/18] [Balance] Remove Dynamax Cannon being a discouraged move for AI (#5708) Remove dynamax cannon from being discouraged on Eternatus Phase 2 --- src/data/moves/move.ts | 17 +---------------- 1 file changed, 1 insertion(+), 16 deletions(-) diff --git a/src/data/moves/move.ts b/src/data/moves/move.ts index 903b2726676..bc047762fb6 100644 --- a/src/data/moves/move.ts +++ b/src/data/moves/move.ts @@ -7665,20 +7665,6 @@ export class AverageStatsAttr extends MoveEffectAttr { } } -export class DiscourageFrequentUseAttr extends MoveAttr { - getUserBenefitScore(user: Pokemon, target: Pokemon, move: Move): number { - const lastMoves = user.getLastXMoves(4); - console.log(lastMoves); - for (let m = 0; m < lastMoves.length; m++) { - if (lastMoves[m].move === move.id) { - return (4 - (m + 1)) * -10; - } - } - - return 0; - } -} - export class MoneyAttr extends MoveEffectAttr { constructor() { super(true, {firstHitOnly: true }); @@ -10517,8 +10503,7 @@ export function initMoves() { } else { return 1; } - }) - .attr(DiscourageFrequentUseAttr), + }), new AttackMove(Moves.SNIPE_SHOT, PokemonType.WATER, MoveCategory.SPECIAL, 80, 100, 15, -1, 0, 8) .attr(HighCritAttr) From 42f291eab3d35475a25c9b4eb32e019eef57e69f Mon Sep 17 00:00:00 2001 From: AndrewErting <55897803+AndrewErting@users.noreply.github.com> Date: Fri, 25 Apr 2025 18:34:57 -0700 Subject: [PATCH 10/18] [Bug] [UI/UX] Make `,` `.` `/` and `\` Bindable Keys (#5707) Added , . / and \ to the key atlas, json mapping, and cfg_keyboard_qwerty.ts --- public/images/inputs/keyboard.json | 30 +++++++++++++++++++- public/images/inputs/keyboard.png | Bin 1282 -> 1641 bytes src/configs/inputs/cfg_keyboard_qwerty.ts | 32 +++++++++++++++++----- 3 files changed, 54 insertions(+), 8 deletions(-) diff --git a/public/images/inputs/keyboard.json b/public/images/inputs/keyboard.json index c9b3c79fbfb..1e8e415b72f 100644 --- a/public/images/inputs/keyboard.json +++ b/public/images/inputs/keyboard.json @@ -516,8 +516,36 @@ "trimmed": true, "spriteSourceSize": { "x": 0, "y": 0, "w": 28, "h": 11 }, "sourceSize": { "w": 28, "h": 11 } + }, + "BACK_SLASH.png": { + "frame": { "x": 147, "y": 66, "w": 12, "h": 11 }, + "rotated": false, + "trimmed": true, + "spriteSourceSize": { "x": 0, "y": 0, "w": 12, "h": 11 }, + "sourceSize": { "w": 12, "h": 11 } + }, + "FORWARD_SLASH.png": { + "frame": { "x": 144, "y": 55, "w": 12, "h": 11 }, + "rotated": false, + "trimmed": true, + "spriteSourceSize": { "x": 0, "y": 0, "w": 12, "h": 11 }, + "sourceSize": { "w": 12, "h": 11 } + }, + "COMMA.png": { + "frame": { "x": 144, "y": 44, "w": 12, "h": 11 }, + "rotated": false, + "trimmed": true, + "spriteSourceSize": { "x": 0, "y": 0, "w": 12, "h": 11 }, + "sourceSize": { "w": 12, "h": 11 } + }, + "PERIOD.png": { + "frame": { "x": 143, "y": 22, "w": 11, "h": 11 }, + "rotated": false, + "trimmed": true, + "spriteSourceSize": { "x": 0, "y": 0, "w": 11, "h": 11 }, + "sourceSize": { "w": 11, "h": 11 } } - }, + }, "meta": { "app": "https://www.aseprite.org/", "version": "1.3.7-dev", diff --git a/public/images/inputs/keyboard.png b/public/images/inputs/keyboard.png index e4d849be0fb26b2ba1a8e790abee68e9bbedadbe..0c33e5790069e7caad424933bdbf831f3d673246 100644 GIT binary patch literal 1641 zcmV-v2A27WP)002!01^@s6Ar)_N000IsNkl<949&yl1|Iy5~c>70AdQK`D_fbdLne1hU?bpvg+sl7HXV2x%;fy~sHuUrE?Wdp4zkm8-ZCl5-Tr={` z$mP!Aj6WkbT!6Q#-JHLD|M7oA|L(nh|NAY^DBq(W+b1Sh=5Hj&{aAXhG4qAad(V!! z7D&#$*l+=Uc>ia2fR7d4Dw4fUK2GSCYcC&qQF@ac$%Xve$~($2x~Y178O2BEy_HWf zKdrgB#SRx>uj5PsK2Abw(7hG4l@nP3kzB~?-pY&QczkUX8z~ZWl^U&pk@@M3QC5Je z74Xq!`&@wDb&(bD{`I|F>?$-`0Y~G>u7JJx?5d6QJ^Iej>Niz@n-g;9FrU+U1$dv2 zecN^9ihR~Vav;fy~cHeG--+WnxP zA(uOcGrl`ET!5RyZ8>(gTL+&dmpg|uzB@KmfYqw08%0A_#XKv=Q^iumSs_LU!#Pl# z8uP3iPZdiMXN4FvhRdS3)-F4OsP;BrTZ395UIzKKwndcauonZ_!eZw}g5g>l(ah#B zgLy`KNqf{F8jnF}>^QS{F^VapXi$Y0dt5t2K_Uf+tbiHh7R73rc)f8dkl&~fGiZ!0 z!0fd{5TAVo>Q^iumSs?~ZL0l+Kjd@m%r;4SBvqB8I03A3+ zjd@m%r;4SBvqB7-f)qBYb|{8ZV3#xb&-T5t5416z#V%*`pY3~PpCO)OFj7Pn#-by1 z8-&e2Qk*db$f)6>sLko)=-X(%B$^OZwS{1)(a!y-FOmGc+@t+O2AiRRtlmbm%SV9$ zd-JzffZe@8Mis|ms3`yJ$qXZ^G~_~|niMo|7PXztM^=F73K+#U2!29P9h*Pu8^u)_ zWarG|@)?mQi7F1kM=ZAK54PK9lb@Sp8_WuGA( z$zqqY`p@>gvQM`Fv)JXV{irH$ev_Kdp6mn4|Gfly0nGpHb^M;w$Xa1*pJZt6-?n z9j>-_UvO7{BK>d8k7WhS;4cP4x$zM45X;sDci1Bjjhq=@(VtKOs!|7YCx1zD? zI3zxzzGD=2k@%VMD*7M#7JNmdRQ4YGZ~#P4rX~o26`X3oD+aG4Uy^ZRYiqJXU2x_F%akEiW z?}9K&HAEQ0^q+~(_Qyp^TB<*Ud^oQ!h3XV2%3Xj_X&`$+9Ox?Zpv=q@P@^bKG2V0m zI#E<>l1C^FJ?|{qfA%~zmpy~VSk>YTv`34RvM36f;E{3)QL05ySLVT#>i#ef%0&B* z7GM@NMo=9r&n&c5_J^XnLQ7?TD5@*8RQ89Wy23}*4o7u`j>`Tp)m)*YvR@9xIaO6| z)aO>Iu_$iFe6FUNOQATHBt+5ISygJIo&MP>wJ2Gdf#M+1(vd1MS3x;hZR8L{=lskl zK(;@<`Jqr8gI*XE7e!?*v^E1JUIlH^Bt)UAV(eLT6j716Rc-7Ubnf|dqD{5Ru25Xr z7m6$ULUD!S%DzxswL)=)jzsp)WQ)#$1j`jV(w&EPcH6zZzKk7&9!VZ%xq1Pzs41%A z$~@4K!HC(ok(+>dn5VJ;N7qiOiet_?8y)?nP^~d&Dr?VRtk%5j6-wkxHdTL_m??$a zY!rkPRK`A|LSs?lS!^Q;K_+GtyB3NQpNDpK+sB(QYX@PuLPxsu(4Ns&ZTAYx6*|(L nhxUxNYP(lhuJBN`BeC2+T!Qh!VedA{00000NkvXXu0mjfDQqXi literal 1282 zcmV+d1^xPoP)Px#7*I@9MF0Q*4htw67ceI!J|iGPGB8FzJ7v<|<$92jQ2+n{2y{|TQvm<}|NsC0 z|JBM=G5`Psgh@m}RA_4wZ(|CNP>|1;=s10KEPT1 zbW-WL2M>99*K|5^IldqDK4SgsdY%aJpAv0>%n#+U>izUA(&3bneUz0=S^K`Sr`})* z@@;X5FS$fHus<}JNSp;%BhRTDxh#8IyOH`!5x2EH9wEGrc3Ua9tt4)Xx57DCMB2(q zgoVQQ*0v{gk8ewd#CHV;cn5AU-&=5wDl5I*AE|Aa-{3KgJxgtw+?;?3t&!y3keddm!JV2|l3}>ZBUZ)e-sDADd|L`T zk~c~tCXG$&WdWpmS^DW1N$R$;L`VmY*2)bgds`|E6+s-2SUq7`6fA%V)UNedp(b`J zVo5~;ij+{xI{d|jkH>^T%}PeO6t*Vs!^dO7pk^hbTnbxRZuj??FsNC{D3`+4XPvrq-@oObxpPh{3s@m07X$?1Sz)~4CfI&w=9 z@fvQO3^>y#6w(n=bCY1x-rsv!S(TN!MI$KGWW!Iu{S=}aI>U~CTap90gQ6y2T)L7X z3PVA}akwlokysAYxWy6=G=23bL8{m%53y}Ib7CfEpGGQz{UEME#NbOi)ZXbOgRIP6{9ay= z<%|%rwO`sapc@80(i%0CwgU_)5K97OqK6oU2o`=dH zcWL57FGRC@2eZvMkGEU>#>9Y;do+EenZqUV^ebkaQj9A7KMv>OW!(q(1owc#wbx zb(>HJklai|P}=L07n9(_ImIR6)Xf=MKT zQZ(Hle8Mv?CLn01gq=MA(TPp4mponM2y%?WC$a@_0uBP8qI1HsayDfh8Fr#Un}1WH zffK@N4rmA;IiUbd1eAPeAgtQUJ3BJ~TFd!^&mH>@K6ln*@R=}IX*~g-`{vQG!15*^ z{67HX>(UnRp>Y$BL$O?!g$Z}+R+gD?#I)0Ma)!^s@K-{ZOjgZ8ERBA&EQCgmfg@O@ zRZ%y5f_GY$0ZSd8ya|V58(5Nh0jb}XmkVNP^k;D3Qk1Qxnk?WmYU0r-ma={vAotDv sb)oePeCABBo`KJt3DzgV=XLPsA7BZsSvU_`Q~&?~07*qoM6N<$f_(8;_W%F@ diff --git a/src/configs/inputs/cfg_keyboard_qwerty.ts b/src/configs/inputs/cfg_keyboard_qwerty.ts index 2ad04ab418d..4f0353971e0 100644 --- a/src/configs/inputs/cfg_keyboard_qwerty.ts +++ b/src/configs/inputs/cfg_keyboard_qwerty.ts @@ -31,6 +31,7 @@ const cfg_keyboard_qwerty = { KEY_X: Phaser.Input.Keyboard.KeyCodes.X, KEY_Y: Phaser.Input.Keyboard.KeyCodes.Y, KEY_Z: Phaser.Input.Keyboard.KeyCodes.Z, + KEY_0: Phaser.Input.Keyboard.KeyCodes.ZERO, KEY_1: Phaser.Input.Keyboard.KeyCodes.ONE, KEY_2: Phaser.Input.Keyboard.KeyCodes.TWO, @@ -41,11 +42,7 @@ const cfg_keyboard_qwerty = { KEY_7: Phaser.Input.Keyboard.KeyCodes.SEVEN, KEY_8: Phaser.Input.Keyboard.KeyCodes.EIGHT, KEY_9: Phaser.Input.Keyboard.KeyCodes.NINE, - KEY_CTRL: Phaser.Input.Keyboard.KeyCodes.CTRL, - KEY_DEL: Phaser.Input.Keyboard.KeyCodes.DELETE, - KEY_END: Phaser.Input.Keyboard.KeyCodes.END, - KEY_ENTER: Phaser.Input.Keyboard.KeyCodes.ENTER, - KEY_ESC: Phaser.Input.Keyboard.KeyCodes.ESC, + KEY_F1: Phaser.Input.Keyboard.KeyCodes.F1, KEY_F2: Phaser.Input.Keyboard.KeyCodes.F2, KEY_F3: Phaser.Input.Keyboard.KeyCodes.F3, @@ -58,24 +55,41 @@ const cfg_keyboard_qwerty = { KEY_F10: Phaser.Input.Keyboard.KeyCodes.F10, KEY_F11: Phaser.Input.Keyboard.KeyCodes.F11, KEY_F12: Phaser.Input.Keyboard.KeyCodes.F12, - KEY_HOME: Phaser.Input.Keyboard.KeyCodes.HOME, - KEY_INSERT: Phaser.Input.Keyboard.KeyCodes.INSERT, + KEY_PAGE_DOWN: Phaser.Input.Keyboard.KeyCodes.PAGE_DOWN, KEY_PAGE_UP: Phaser.Input.Keyboard.KeyCodes.PAGE_UP, + + KEY_CTRL: Phaser.Input.Keyboard.KeyCodes.CTRL, + KEY_DEL: Phaser.Input.Keyboard.KeyCodes.DELETE, + KEY_END: Phaser.Input.Keyboard.KeyCodes.END, + KEY_ENTER: Phaser.Input.Keyboard.KeyCodes.ENTER, + KEY_ESC: Phaser.Input.Keyboard.KeyCodes.ESC, + KEY_HOME: Phaser.Input.Keyboard.KeyCodes.HOME, + KEY_INSERT: Phaser.Input.Keyboard.KeyCodes.INSERT, + KEY_PLUS: Phaser.Input.Keyboard.KeyCodes.NUMPAD_ADD, // Assuming numpad plus KEY_MINUS: Phaser.Input.Keyboard.KeyCodes.NUMPAD_SUBTRACT, // Assuming numpad minus KEY_QUOTATION: Phaser.Input.Keyboard.KeyCodes.QUOTES, KEY_SHIFT: Phaser.Input.Keyboard.KeyCodes.SHIFT, + KEY_SPACE: Phaser.Input.Keyboard.KeyCodes.SPACE, KEY_TAB: Phaser.Input.Keyboard.KeyCodes.TAB, KEY_TILDE: Phaser.Input.Keyboard.KeyCodes.BACKTICK, + KEY_ARROW_UP: Phaser.Input.Keyboard.KeyCodes.UP, KEY_ARROW_DOWN: Phaser.Input.Keyboard.KeyCodes.DOWN, KEY_ARROW_LEFT: Phaser.Input.Keyboard.KeyCodes.LEFT, KEY_ARROW_RIGHT: Phaser.Input.Keyboard.KeyCodes.RIGHT, + KEY_LEFT_BRACKET: Phaser.Input.Keyboard.KeyCodes.OPEN_BRACKET, KEY_RIGHT_BRACKET: Phaser.Input.Keyboard.KeyCodes.CLOSED_BRACKET, + KEY_SEMICOLON: Phaser.Input.Keyboard.KeyCodes.SEMICOLON, + KEY_COMMA: Phaser.Input.Keyboard.KeyCodes.COMMA, + KEY_PERIOD: Phaser.Input.Keyboard.KeyCodes.PERIOD, + KEY_BACK_SLASH: Phaser.Input.Keyboard.KeyCodes.BACK_SLASH, + KEY_FORWARD_SLASH: Phaser.Input.Keyboard.KeyCodes.FORWARD_SLASH, + KEY_BACKSPACE: Phaser.Input.Keyboard.KeyCodes.BACKSPACE, KEY_ALT: Phaser.Input.Keyboard.KeyCodes.ALT, }, @@ -160,6 +174,10 @@ const cfg_keyboard_qwerty = { KEY_RIGHT_BRACKET: "RIGHT_BRACKET.png", KEY_SEMICOLON: "SEMICOLON.png", + KEY_COMMA: "COMMA.png", + KEY_PERIOD: "PERIOD.png", + KEY_BACK_SLASH: "BACK_SLASH.png", + KEY_FORWARD_SLASH: "FORWARD_SLASH.png", KEY_BACKSPACE: "BACK.png", KEY_ALT: "ALT.png", From a288de700d083ab1c3ac17df9a2f8776c14a1234 Mon Sep 17 00:00:00 2001 From: Sirz Benjie <142067137+SirzBenjie@users.noreply.github.com> Date: Sat, 26 Apr 2025 00:14:08 -0500 Subject: [PATCH 11/18] [Docs][Dev] Update linting docs (#5709) --- docs/linting.md | 44 +++++++++++++++++++------------------------- 1 file changed, 19 insertions(+), 25 deletions(-) diff --git a/docs/linting.md b/docs/linting.md index 39b30b7a1c0..ff512740a80 100644 --- a/docs/linting.md +++ b/docs/linting.md @@ -1,40 +1,34 @@ -# ESLint +# Biome + ## Key Features 1. **Automation**: - - A pre-commit hook has been added to automatically run ESLint on the added or modified files, ensuring code quality before commits. + - A pre-commit hook has been added to automatically run Biome on the added or modified files, ensuring code quality before commits. 2. **Manual Usage**: - - If you prefer not to use the pre-commit hook, you can manually run ESLint to automatically fix issues using the command: + - If you prefer not to use the pre-commit hook, you can manually run biome to automatically fix issues using the command: + ```sh - npx eslint --fix . or npm run eslint + npx @biomejs/biome --write ``` + - Running this command will lint all files in the repository. 3. **GitHub Action**: - - A GitHub Action has been added to automatically run ESLint on every push and pull request, ensuring code quality in the CI/CD pipeline. + - A GitHub Action has been added to automatically run Biome on every push and pull request, ensuring code quality in the CI/CD pipeline. -## Summary of ESLint Rules +If you are getting linting errors from biome and want to see which files they are coming from, you can find that out by running biome in a way that is configured to only show the errors for that specific rule: ``npx @biomejs/biome lint --only=category/ruleName`` -1. **General Rules**: - - **Equality**: Use `===` and `!==` instead of `==` and `!=` (`eqeqeq`). - - **Indentation**: Enforce 2-space indentation (`indent`). - - **Quotes**: Use doublequotes for strings (`quotes`). - - **Variable Declarations**: - - Disallow `var`; use `let` or `const` (`no-var`). - - Prefer `const` for variables that are never reassigned (`prefer-const`). - - **Unused Variables**: Allow unused function parameters but enforce error for other unused variables (`@typescript-eslint/no-unused-vars`). - - **End of Line**: Ensure at least one newline at the end of files (`eol-last`). - - **Curly Braces**: Enforce the use of curly braces for all control statements (`curly`). - - **Brace Style**: Use one true brace style (`1tbs`) for TypeScript-specific syntax (`@typescript-eslint/brace-style`). +## Summary of Biome Rules -2. **TypeScript-Specific Rules**: - - **Semicolons**: - - Enforce semicolons for TypeScript-specific syntax (`@typescript-eslint/semi`). - - Disallow unnecessary semicolons (`@typescript-eslint/no-extra-semi`). +We use the [recommended ruleset](https://biomejs.dev/linter/rules/) for Biome, with some customizations to better suit our project's needs. -## Benefits +For a complete list of rules and their configurations, refer to the `biome.jsonc` file in the project root. -- **Consistency**: Ensures consistent coding style across the project. -- **Code Quality**: Helps catch potential errors and improve overall code quality. -- **Readability**: Makes the codebase easier to read and maintain. \ No newline at end of file +Some things to consider: + +- We have disabled rules that prioritize style over performance, such as `useTemplate` +- Some rules are currently marked as warnings (`warn`) to allow for gradual refactoring without blocking development. Do not write new code that triggers these warnings. +- The linter is configured to ignore specific files and folders, such as large or complex files that are pending refactors, to improve performance and focus on actionable areas. + +Formatting is also handled by Biome. You should not have to worry about manually formatting your code. From 0a48726e70469ecf091aaa0be29a705e42601f17 Mon Sep 17 00:00:00 2001 From: Wlowscha <54003515+Wlowscha@users.noreply.github.com> Date: Sat, 26 Apr 2025 07:24:11 +0200 Subject: [PATCH 12/18] =?UTF-8?q?[UI/UX]=20Move=20Pok=C3=A9mon=20sprite=20?= =?UTF-8?q?below=20name=20and=20other=20text=20in=20dex=20pages=20(#5698)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Moved sprite below name --- src/ui/pokedex-page-ui-handler.ts | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/ui/pokedex-page-ui-handler.ts b/src/ui/pokedex-page-ui-handler.ts index d0b85544494..4888e14b24f 100644 --- a/src/ui/pokedex-page-ui-handler.ts +++ b/src/ui/pokedex-page-ui-handler.ts @@ -292,6 +292,13 @@ export default class PokedexPageUiHandler extends MessageUiHandler { starterSelectBg.setOrigin(0, 0); this.starterSelectContainer.add(starterSelectBg); + this.pokemonSprite = globalScene.add.sprite(53, 63, "pkmn__sub"); + this.pokemonSprite.setPipeline(globalScene.spritePipeline, { + tone: [0.0, 0.0, 0.0, 0.0], + ignoreTimeTint: true, + }); + this.starterSelectContainer.add(this.pokemonSprite); + this.shinyOverlay = globalScene.add.image(6, 6, "summary_overlay_shiny"); this.shinyOverlay.setOrigin(0, 0); this.shinyOverlay.setVisible(false); @@ -343,13 +350,6 @@ export default class PokedexPageUiHandler extends MessageUiHandler { this.starterSelectContainer.add(starterBoxContainer); - this.pokemonSprite = globalScene.add.sprite(53, 63, "pkmn__sub"); - this.pokemonSprite.setPipeline(globalScene.spritePipeline, { - tone: [0.0, 0.0, 0.0, 0.0], - ignoreTimeTint: true, - }); - this.starterSelectContainer.add(this.pokemonSprite); - this.type1Icon = globalScene.add.sprite(8, 98, getLocalizedSpriteKey("types")); this.type1Icon.setScale(0.5); this.type1Icon.setOrigin(0, 0); From a036f865f05822576652d624dd6f0ea7cc12b4a9 Mon Sep 17 00:00:00 2001 From: Sirz Benjie <142067137+SirzBenjie@users.noreply.github.com> Date: Sat, 26 Apr 2025 01:17:42 -0500 Subject: [PATCH 13/18] [Bug] Fix improper critical hit key in move effect phase (#5713) --- src/phases/move-effect-phase.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/phases/move-effect-phase.ts b/src/phases/move-effect-phase.ts index 01085834ba5..4b4e62db71b 100644 --- a/src/phases/move-effect-phase.ts +++ b/src/phases/move-effect-phase.ts @@ -859,7 +859,7 @@ export class MoveEffectPhase extends PokemonPhase { }); if (isCritical) { - globalScene.queueMessage(i18next.t("battle:criticalHit")); + globalScene.queueMessage(i18next.t("battle:hitResultCriticalHit")); } if (damage <= 0) { From 423bab1057945e10f1871a3fa9d6907ecbb8e0b7 Mon Sep 17 00:00:00 2001 From: Wlowscha <54003515+Wlowscha@users.noreply.github.com> Date: Sat, 26 Apr 2025 19:17:54 +0200 Subject: [PATCH 14/18] =?UTF-8?q?[UI/UX]=20Move=20Pok=C3=A9mon=20sprite=20?= =?UTF-8?q?below=20name=20and=20other=20text=20in=20starter=20select=20(#5?= =?UTF-8?q?714)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Moving the sprite down --- src/ui/starter-select-ui-handler.ts | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/ui/starter-select-ui-handler.ts b/src/ui/starter-select-ui-handler.ts index 1902c691715..7c345f1735e 100644 --- a/src/ui/starter-select-ui-handler.ts +++ b/src/ui/starter-select-ui-handler.ts @@ -596,6 +596,13 @@ export default class StarterSelectUiHandler extends MessageUiHandler { this.iconAnimHandler = new PokemonIconAnimHandler(); this.iconAnimHandler.setup(); + this.pokemonSprite = globalScene.add.sprite(53, 63, "pkmn__sub"); + this.pokemonSprite.setPipeline(globalScene.spritePipeline, { + tone: [0.0, 0.0, 0.0, 0.0], + ignoreTimeTint: true, + }); + this.starterSelectContainer.add(this.pokemonSprite); + this.pokemonNumberText = addTextObject(17, 1, "0000", TextStyle.SUMMARY); this.pokemonNumberText.setOrigin(0, 0); this.starterSelectContainer.add(this.pokemonNumberText); @@ -825,13 +832,6 @@ export default class StarterSelectUiHandler extends MessageUiHandler { return icon; }); - this.pokemonSprite = globalScene.add.sprite(53, 63, "pkmn__sub"); - this.pokemonSprite.setPipeline(globalScene.spritePipeline, { - tone: [0.0, 0.0, 0.0, 0.0], - ignoreTimeTint: true, - }); - this.starterSelectContainer.add(this.pokemonSprite); - this.type1Icon = globalScene.add.sprite(8, 98, getLocalizedSpriteKey("types")); this.type1Icon.setScale(0.5); this.type1Icon.setOrigin(0, 0); From ab7d010a17f46bab0a0c9d72ce4d29fdaf8752ef Mon Sep 17 00:00:00 2001 From: Dean <69436131+emdeann@users.noreply.github.com> Date: Sat, 26 Apr 2025 13:32:49 -0700 Subject: [PATCH 15/18] [Bug] Fix message for `StatusEffectImmunityAbAttr` (#5701) Use class var for getTriggerMessage --- src/data/abilities/ability.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/data/abilities/ability.ts b/src/data/abilities/ability.ts index b018a87a08d..9a6094f4649 100644 --- a/src/data/abilities/ability.ts +++ b/src/data/abilities/ability.ts @@ -3172,6 +3172,7 @@ export class PreSetStatusAbAttr extends AbAttr { */ export class PreSetStatusEffectImmunityAbAttr extends PreSetStatusAbAttr { protected immuneEffects: StatusEffect[]; + private lastEffect: StatusEffect; /** * @param immuneEffects - The status effects to which the Pokémon is immune. @@ -3197,6 +3198,7 @@ export class PreSetStatusEffectImmunityAbAttr extends PreSetStatusAbAttr { */ override applyPreSetStatus(pokemon: Pokemon, passive: boolean, simulated: boolean, effect: StatusEffect, cancelled: BooleanHolder, args: any[]): void { cancelled.value = true; + this.lastEffect = effect; } getTriggerMessage(pokemon: Pokemon, abilityName: string, ...args: any[]): string { @@ -3204,7 +3206,7 @@ export class PreSetStatusEffectImmunityAbAttr extends PreSetStatusAbAttr { i18next.t("abilityTriggers:statusEffectImmunityWithName", { pokemonNameWithAffix: getPokemonNameWithAffix(pokemon), abilityName, - statusEffectName: getStatusEffectDescriptor(args[0] as StatusEffect) + statusEffectName: getStatusEffectDescriptor(this.lastEffect) }) : i18next.t("abilityTriggers:statusEffectImmunity", { pokemonNameWithAffix: getPokemonNameWithAffix(pokemon), From 6460d46a5d01bf48df82af5c4f5e8fa29d60b57d Mon Sep 17 00:00:00 2001 From: NightKev <34855794+DayKev@users.noreply.github.com> Date: Sat, 26 Apr 2025 15:01:46 -0700 Subject: [PATCH 16/18] [Bug] API / Save data hotfix (#5716) * Loading data now checks statusCode not error string * Bump version to 1.8.5 --------- Co-authored-by: Sirz Benjie <142067137+SirzBenjie@users.noreply.github.com> --- package.json | 2 +- src/plugins/api/pokerogue-system-savedata-api.ts | 9 ++++++--- src/system/game-data.ts | 16 ++++++++++------ 3 files changed, 17 insertions(+), 10 deletions(-) diff --git a/package.json b/package.json index 4758e6c5182..341bca80c2e 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "pokemon-rogue-battle", "private": true, - "version": "1.8.4", + "version": "1.8.5", "type": "module", "scripts": { "start": "vite", diff --git a/src/plugins/api/pokerogue-system-savedata-api.ts b/src/plugins/api/pokerogue-system-savedata-api.ts index 659584776c4..d6fbb39ae0a 100644 --- a/src/plugins/api/pokerogue-system-savedata-api.ts +++ b/src/plugins/api/pokerogue-system-savedata-api.ts @@ -15,14 +15,17 @@ export class PokerogueSystemSavedataApi extends ApiBase { /** * Get a system savedata. * @param params The {@linkcode GetSystemSavedataRequest} to send - * @returns The system savedata as `string` or `null` on error + * @returns The system savedata as `string` or either the status code or `null` on error */ - public async get(params: GetSystemSavedataRequest) { + public async get(params: GetSystemSavedataRequest): Promise { try { const urlSearchParams = this.toUrlSearchParams(params); const response = await this.doGet(`/savedata/system/get?${urlSearchParams}`); const rawSavedata = await response.text(); - + if (!response.ok) { + console.warn("Could not get system savedata!", response.status, rawSavedata); + return response.status; + } return rawSavedata; } catch (err) { console.warn("Could not get system savedata!", err); diff --git a/src/system/game-data.ts b/src/system/game-data.ts index 8b7987556ee..8573c774054 100644 --- a/src/system/game-data.ts +++ b/src/system/game-data.ts @@ -462,8 +462,13 @@ export class GameData { if (!bypassLogin) { pokerogueApi.savedata.system.get({ clientSessionId }).then(saveDataOrErr => { - if (!saveDataOrErr || saveDataOrErr.length === 0 || saveDataOrErr[0] !== "{") { - if (saveDataOrErr?.startsWith("sql: no rows in result set")) { + if ( + typeof saveDataOrErr === "number" || + !saveDataOrErr || + saveDataOrErr.length === 0 || + saveDataOrErr[0] !== "{" + ) { + if (saveDataOrErr === 404) { globalScene.queueMessage( "Save data could not be found. If this is a new account, you can safely ignore this message.", null, @@ -471,7 +476,7 @@ export class GameData { ); return resolve(true); } - if (saveDataOrErr?.includes("Too many connections")) { + if (typeof saveDataOrErr === "string" && saveDataOrErr?.includes("Too many connections")) { globalScene.queueMessage( "Too many people are trying to connect and the server is overloaded. Please try again later.", null, @@ -479,7 +484,6 @@ export class GameData { ); return resolve(false); } - console.error(saveDataOrErr); return resolve(false); } @@ -1500,7 +1504,7 @@ export class GameData { link.remove(); }; if (!bypassLogin && dataType < GameDataType.SETTINGS) { - let promise: Promise = Promise.resolve(null); + let promise: Promise = Promise.resolve(null); if (dataType === GameDataType.SYSTEM) { promise = pokerogueApi.savedata.system.get({ clientSessionId }); @@ -1512,7 +1516,7 @@ export class GameData { } promise.then(response => { - if (!response?.length || response[0] !== "{") { + if (typeof response === "number" || !response?.length || response[0] !== "{") { console.error(response); resolve(false); return; From c6e7dd660e1482c7901396b584b121bb666a2966 Mon Sep 17 00:00:00 2001 From: Sirz Benjie <142067137+SirzBenjie@users.noreply.github.com> Date: Sat, 26 Apr 2025 18:04:40 -0500 Subject: [PATCH 17/18] [Bug] Hotfix 1.8.5 (#5715) * Loading data now checks statusCode not error string * Bump version to 1.8.5 --- package.json | 2 +- src/plugins/api/pokerogue-system-savedata-api.ts | 9 ++++++--- src/system/game-data.ts | 16 ++++++++++------ 3 files changed, 17 insertions(+), 10 deletions(-) diff --git a/package.json b/package.json index 6b1c73db158..9a74fdcbb53 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "pokemon-rogue-battle", "private": true, - "version": "1.8.4", + "version": "1.8.5", "type": "module", "scripts": { "start": "vite", diff --git a/src/plugins/api/pokerogue-system-savedata-api.ts b/src/plugins/api/pokerogue-system-savedata-api.ts index 659584776c4..d6fbb39ae0a 100644 --- a/src/plugins/api/pokerogue-system-savedata-api.ts +++ b/src/plugins/api/pokerogue-system-savedata-api.ts @@ -15,14 +15,17 @@ export class PokerogueSystemSavedataApi extends ApiBase { /** * Get a system savedata. * @param params The {@linkcode GetSystemSavedataRequest} to send - * @returns The system savedata as `string` or `null` on error + * @returns The system savedata as `string` or either the status code or `null` on error */ - public async get(params: GetSystemSavedataRequest) { + public async get(params: GetSystemSavedataRequest): Promise { try { const urlSearchParams = this.toUrlSearchParams(params); const response = await this.doGet(`/savedata/system/get?${urlSearchParams}`); const rawSavedata = await response.text(); - + if (!response.ok) { + console.warn("Could not get system savedata!", response.status, rawSavedata); + return response.status; + } return rawSavedata; } catch (err) { console.warn("Could not get system savedata!", err); diff --git a/src/system/game-data.ts b/src/system/game-data.ts index 391ceec503d..998f56efbde 100644 --- a/src/system/game-data.ts +++ b/src/system/game-data.ts @@ -461,8 +461,13 @@ export class GameData { if (!bypassLogin) { pokerogueApi.savedata.system.get({ clientSessionId }).then(saveDataOrErr => { - if (!saveDataOrErr || saveDataOrErr.length === 0 || saveDataOrErr[0] !== "{") { - if (saveDataOrErr?.startsWith("sql: no rows in result set")) { + if ( + typeof saveDataOrErr === "number" || + !saveDataOrErr || + saveDataOrErr.length === 0 || + saveDataOrErr[0] !== "{" + ) { + if (saveDataOrErr === 404) { globalScene.queueMessage( "Save data could not be found. If this is a new account, you can safely ignore this message.", null, @@ -470,7 +475,7 @@ export class GameData { ); return resolve(true); } - if (saveDataOrErr?.includes("Too many connections")) { + if (typeof saveDataOrErr === "string" && saveDataOrErr?.includes("Too many connections")) { globalScene.queueMessage( "Too many people are trying to connect and the server is overloaded. Please try again later.", null, @@ -478,7 +483,6 @@ export class GameData { ); return resolve(false); } - console.error(saveDataOrErr); return resolve(false); } @@ -1499,7 +1503,7 @@ export class GameData { link.remove(); }; if (!bypassLogin && dataType < GameDataType.SETTINGS) { - let promise: Promise = Promise.resolve(null); + let promise: Promise = Promise.resolve(null); if (dataType === GameDataType.SYSTEM) { promise = pokerogueApi.savedata.system.get({ clientSessionId }); @@ -1511,7 +1515,7 @@ export class GameData { } promise.then(response => { - if (!response?.length || response[0] !== "{") { + if (typeof response === "number" || !response?.length || response[0] !== "{") { console.error(response); resolve(false); return; From 89a9d55d3c4cd540f8a80aca8e72c541f62ad23d Mon Sep 17 00:00:00 2001 From: NightKev <34855794+DayKev@users.noreply.github.com> Date: Sat, 26 Apr 2025 23:22:56 -0700 Subject: [PATCH 18/18] [Dev] Add enemy pokemon level to encounter logging (#5718) --- .../mystery-encounters/utils/encounter-phase-utils.ts | 1 + src/phases/encounter-phase.ts | 8 +++++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/src/data/mystery-encounters/utils/encounter-phase-utils.ts b/src/data/mystery-encounters/utils/encounter-phase-utils.ts index 65051b937f8..67904fc856c 100644 --- a/src/data/mystery-encounters/utils/encounter-phase-utils.ts +++ b/src/data/mystery-encounters/utils/encounter-phase-utils.ts @@ -424,6 +424,7 @@ export async function initBattleWithEnemyConfig(partyConfig: EnemyPartyConfig): console.log( `Pokemon: ${getPokemonNameWithAffix(enemyPokemon)}`, `| Species ID: ${enemyPokemon.species.speciesId}`, + `| Level: ${enemyPokemon.level}`, `| Nature: ${getNatureName(enemyPokemon.nature, true, true, true)}`, ); console.log(`Stats (IVs): ${stats}`); diff --git a/src/phases/encounter-phase.ts b/src/phases/encounter-phase.ts index 6fd11c416a2..20ed69119f9 100644 --- a/src/phases/encounter-phase.ts +++ b/src/phases/encounter-phase.ts @@ -2,7 +2,12 @@ import { BattlerIndex } from "#app/battle"; import { BattleType } from "#enums/battle-type"; import { globalScene } from "#app/global-scene"; import { PLAYER_PARTY_MAX_SIZE } from "#app/constants"; -import { applyAbAttrs, SyncEncounterNatureAbAttr, applyPreSummonAbAttrs, PreSummonAbAttr } from "#app/data/abilities/ability"; +import { + applyAbAttrs, + SyncEncounterNatureAbAttr, + applyPreSummonAbAttrs, + PreSummonAbAttr, +} from "#app/data/abilities/ability"; import { initEncounterAnims, loadEncounterAnimAssets } from "#app/data/battle-anims"; import { getCharVariantFromDialogue } from "#app/data/dialogue"; import { getEncounterText } from "#app/data/mystery-encounters/utils/encounter-dialogue-utils"; @@ -196,6 +201,7 @@ export class EncounterPhase extends BattlePhase { console.log( `Pokemon: ${getPokemonNameWithAffix(enemyPokemon)}`, `| Species ID: ${enemyPokemon.species.speciesId}`, + `| Level: ${enemyPokemon.level}`, `| Nature: ${getNatureName(enemyPokemon.nature, true, true, true)}`, ); console.log(`Stats (IVs): ${stats}`);