From 4412769cd99e1faacdfcf5b8e2a00418d1b14f30 Mon Sep 17 00:00:00 2001 From: ImperialSympathizer Date: Thu, 11 Jul 2024 18:31:48 -0400 Subject: [PATCH] small bug fixes --- src/battle-scene.ts | 2 +- src/overrides.ts | 4 ++-- src/phases.ts | 2 +- src/phases/mystery-encounter-phase.ts | 19 +++---------------- 4 files changed, 7 insertions(+), 20 deletions(-) diff --git a/src/battle-scene.ts b/src/battle-scene.ts index d3eac7fc973..2edec910f7b 100644 --- a/src/battle-scene.ts +++ b/src/battle-scene.ts @@ -2364,7 +2364,7 @@ export default class BattleScene extends SceneBase { } party.every((enemyPokemon: EnemyPokemon, i: integer) => { - if (customHeldModifiers && i < customHeldModifiers.length && customHeldModifiers[i].length > 0) { + if (customHeldModifiers && i < customHeldModifiers.length && customHeldModifiers[i] && customHeldModifiers[i].length > 0) { customHeldModifiers[i].forEach(mt => mt.newModifier(enemyPokemon).add(this.enemyModifiers, false, this)); return true; } diff --git a/src/overrides.ts b/src/overrides.ts index e19a5bf20dd..485f9c14864 100644 --- a/src/overrides.ts +++ b/src/overrides.ts @@ -117,9 +117,9 @@ export const EGG_GACHA_PULL_COUNT_OVERRIDE: number = 0; */ // 1 to 256, set to null to ignore -export const MYSTERY_ENCOUNTER_RATE_OVERRIDE: number = null; +export const MYSTERY_ENCOUNTER_RATE_OVERRIDE: number = 256; export const MYSTERY_ENCOUNTER_TIER_OVERRIDE: MysteryEncounterTier = null; -export const MYSTERY_ENCOUNTER_OVERRIDE: MysteryEncounterType = null; +export const MYSTERY_ENCOUNTER_OVERRIDE: MysteryEncounterType = MysteryEncounterType.SHADY_VITAMIN_DEALER; /** * MODIFIER / ITEM OVERRIDES diff --git a/src/phases.ts b/src/phases.ts index 6c64cc9454f..4be1305c8b7 100644 --- a/src/phases.ts +++ b/src/phases.ts @@ -5363,7 +5363,7 @@ export class SelectModifierPhase extends BattlePhase { this.scene.ui.revertMode(); this.scene.ui.setMode(Mode.MESSAGE); super.end(); - break; + return; } modifierType = typeOptions[cursor].type; break; diff --git a/src/phases/mystery-encounter-phase.ts b/src/phases/mystery-encounter-phase.ts index d84a5eb6b2f..3db7816387a 100644 --- a/src/phases/mystery-encounter-phase.ts +++ b/src/phases/mystery-encounter-phase.ts @@ -5,7 +5,7 @@ import { Mode } from "../ui/ui"; import { getEncounterText } from "../data/mystery-encounters/mystery-encounter-utils"; -import { CheckSwitchPhase, NewBattlePhase, PostSummonPhase, ReturnPhase, ScanIvsPhase, SelectModifierPhase, SummonPhase, ToggleDoublePositionPhase } from "../phases"; +import { CheckSwitchPhase, NewBattlePhase, ReturnPhase, ScanIvsPhase, SelectModifierPhase, SummonPhase, ToggleDoublePositionPhase } from "../phases"; import MysteryEncounterOption from "../data/mystery-encounters/mystery-encounter-option"; import { MysteryEncounterVariant } from "../data/mystery-encounters/mystery-encounter"; import { getCharVariantFromDialogue } from "../data/dialogue"; @@ -285,22 +285,9 @@ export class MysteryEncounterBattlePhase extends Phase { const enemyField = scene.getEnemyField(); const encounterVariant = scene.currentBattle.mysteryEncounter.encounterVariant; + // PostSummon and ShinySparkle phases are handled by SummonPhase + if (encounterVariant !== MysteryEncounterVariant.TRAINER_BATTLE) { - enemyField.map(p => this.scene.pushConditionalPhase(new PostSummonPhase(this.scene, p.getBattlerIndex()), () => { - // if there is not a player party, we can't continue - if (!this.scene.getParty()?.length) { - return false; - } - // how many player pokemon are on the field ? - const pokemonsOnFieldCount = this.scene.getParty().filter(p => p.isOnField()).length; - // if it's a 2vs1, there will never be a 2nd pokemon on our field even - const requiredPokemonsOnField = Math.min(this.scene.getParty().filter((p) => !p.isFainted()).length, 2); - // if it's a double, there should be 2, otherwise 1 - if (this.scene.currentBattle.double) { - return pokemonsOnFieldCount === requiredPokemonsOnField; - } - return pokemonsOnFieldCount === 1; - })); const ivScannerModifier = this.scene.findModifier(m => m instanceof IvScannerModifier); if (ivScannerModifier) { enemyField.map(p => this.scene.pushPhase(new ScanIvsPhase(this.scene, p.getBattlerIndex(), Math.min(ivScannerModifier.getStackCount() * 2, 6))));