small bug fixes

This commit is contained in:
ImperialSympathizer 2024-07-11 18:31:48 -04:00
parent c0a900cd02
commit 4412769cd9
4 changed files with 7 additions and 20 deletions

View File

@ -2364,7 +2364,7 @@ export default class BattleScene extends SceneBase {
} }
party.every((enemyPokemon: EnemyPokemon, i: integer) => { 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)); customHeldModifiers[i].forEach(mt => mt.newModifier(enemyPokemon).add(this.enemyModifiers, false, this));
return true; return true;
} }

View File

@ -117,9 +117,9 @@ export const EGG_GACHA_PULL_COUNT_OVERRIDE: number = 0;
*/ */
// 1 to 256, set to null to ignore // 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_TIER_OVERRIDE: MysteryEncounterTier = null;
export const MYSTERY_ENCOUNTER_OVERRIDE: MysteryEncounterType = null; export const MYSTERY_ENCOUNTER_OVERRIDE: MysteryEncounterType = MysteryEncounterType.SHADY_VITAMIN_DEALER;
/** /**
* MODIFIER / ITEM OVERRIDES * MODIFIER / ITEM OVERRIDES

View File

@ -5363,7 +5363,7 @@ export class SelectModifierPhase extends BattlePhase {
this.scene.ui.revertMode(); this.scene.ui.revertMode();
this.scene.ui.setMode(Mode.MESSAGE); this.scene.ui.setMode(Mode.MESSAGE);
super.end(); super.end();
break; return;
} }
modifierType = typeOptions[cursor].type; modifierType = typeOptions[cursor].type;
break; break;

View File

@ -5,7 +5,7 @@ import { Mode } from "../ui/ui";
import { import {
getEncounterText getEncounterText
} from "../data/mystery-encounters/mystery-encounter-utils"; } 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 MysteryEncounterOption from "../data/mystery-encounters/mystery-encounter-option";
import { MysteryEncounterVariant } from "../data/mystery-encounters/mystery-encounter"; import { MysteryEncounterVariant } from "../data/mystery-encounters/mystery-encounter";
import { getCharVariantFromDialogue } from "../data/dialogue"; import { getCharVariantFromDialogue } from "../data/dialogue";
@ -285,22 +285,9 @@ export class MysteryEncounterBattlePhase extends Phase {
const enemyField = scene.getEnemyField(); const enemyField = scene.getEnemyField();
const encounterVariant = scene.currentBattle.mysteryEncounter.encounterVariant; const encounterVariant = scene.currentBattle.mysteryEncounter.encounterVariant;
// PostSummon and ShinySparkle phases are handled by SummonPhase
if (encounterVariant !== MysteryEncounterVariant.TRAINER_BATTLE) { 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); const ivScannerModifier = this.scene.findModifier(m => m instanceof IvScannerModifier);
if (ivScannerModifier) { if (ivScannerModifier) {
enemyField.map(p => this.scene.pushPhase(new ScanIvsPhase(this.scene, p.getBattlerIndex(), Math.min(ivScannerModifier.getStackCount() * 2, 6)))); enemyField.map(p => this.scene.pushPhase(new ScanIvsPhase(this.scene, p.getBattlerIndex(), Math.min(ivScannerModifier.getStackCount() * 2, 6))));