[Bug] Fix quick claw message showing if command is not fight (#1819)

This commit is contained in:
Adrian T 2024-06-05 21:38:43 +08:00 committed by GitHub
parent 219f227cab
commit bd34fc0b47
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 5 additions and 1 deletions

View File

@ -22,6 +22,7 @@ import { Nature } from "#app/data/nature";
import { BattlerTagType } from "#app/data/enums/battler-tag-type";
import * as Overrides from "../overrides";
import { ModifierType, modifierTypes } from "./modifier-type";
import { Command } from "#app/ui/command-ui-handler.js";
export type ModifierPredicate = (modifier: Modifier) => boolean;
@ -776,7 +777,10 @@ export class BypassSpeedChanceModifier extends PokemonHeldItemModifier {
if (!bypassSpeed.value && pokemon.randSeedInt(10) < this.getStackCount()) {
bypassSpeed.value = true;
if (this.type instanceof ModifierTypes.PokemonHeldItemModifierType && this.type.id === "QUICK_CLAW") {
const isCommandFight = pokemon.scene.currentBattle.turnCommands[pokemon.getBattlerIndex()]?.command === Command.FIGHT;
const hasQuickClaw = this.type instanceof ModifierTypes.PokemonHeldItemModifierType && this.type.id === "QUICK_CLAW";
if (isCommandFight && hasQuickClaw) {
pokemon.scene.queueMessage(getPokemonMessage(pokemon, " used its quick claw to move faster!"));
}
return true;