chore: fix merge conflicts from Biome update

This commit is contained in:
Sirz Benjie 2025-09-08 12:08:52 -05:00
parent ec34c975bb
commit 2561b7ea67
No known key found for this signature in database
GPG Key ID: 4A524B4D196C759E
10 changed files with 78 additions and 78 deletions

View File

@ -1152,8 +1152,8 @@ export class PowderTag extends BattlerTag {
const move = currentPhase.move.getMove(); const move = currentPhase.move.getMove();
const weather = globalScene.arena.weather; const weather = globalScene.arena.weather;
if ( if (
pokemon.getMoveType(move) !== PokemonType.FIRE || pokemon.getMoveType(move) !== PokemonType.FIRE
(weather?.weatherType === WeatherType.HEAVY_RAIN && !weather.isEffectSuppressed()) // Since gen 7, Heavy rain takes priority over powder || (weather?.weatherType === WeatherType.HEAVY_RAIN && !weather.isEffectSuppressed()) // Since gen 7, Heavy rain takes priority over powder
) { ) {
return true; return true;
} }

View File

@ -128,9 +128,9 @@ export const failIfTargetNotAttackingCondition = new MoveCondition((_user, targe
return false; return false;
} }
return ( return (
turnCommand.command === Command.FIGHT && turnCommand.command === Command.FIGHT
!target.turnData.acted && && !target.turnData.acted
allMoves[turnCommand.move.move].category !== MoveCategory.STATUS && allMoves[turnCommand.move.move].category !== MoveCategory.STATUS
); );
}); });
@ -145,8 +145,8 @@ export const failAgainstFinalBossCondition = new MoveCondition((_user, target) =
const gameMode = globalScene.gameMode; const gameMode = globalScene.gameMode;
const currentWave = globalScene.currentBattle.waveIndex; const currentWave = globalScene.currentBattle.waveIndex;
return !( return !(
target.isEnemy() && target.isEnemy()
(gameMode.isBattleClassicFinalBoss(currentWave) || gameMode.isEndlessMinorBoss(currentWave)) && (gameMode.isBattleClassicFinalBoss(currentWave) || gameMode.isEndlessMinorBoss(currentWave))
); );
}); });
@ -159,11 +159,11 @@ export const failAgainstFinalBossCondition = new MoveCondition((_user, target) =
export const upperHandCondition = new MoveCondition((_user, target) => { export const upperHandCondition = new MoveCondition((_user, target) => {
const targetCommand = globalScene.currentBattle.turnCommands[target.getBattlerIndex()]; const targetCommand = globalScene.currentBattle.turnCommands[target.getBattlerIndex()];
return ( return (
targetCommand?.command === Command.FIGHT && targetCommand?.command === Command.FIGHT
!target.turnData.acted && && !target.turnData.acted
!!targetCommand.move?.move && && !!targetCommand.move?.move
allMoves[targetCommand.move.move].category !== MoveCategory.STATUS && && allMoves[targetCommand.move.move].category !== MoveCategory.STATUS
allMoves[targetCommand.move.move].getPriority(target) > 0 && allMoves[targetCommand.move.move].getPriority(target) > 0
); );
}); });
@ -180,7 +180,7 @@ export const upperHandCondition = new MoveCondition((_user, target) => {
*/ */
export const lastResortCondition = new MoveCondition((user, _target, move) => { export const lastResortCondition = new MoveCondition((user, _target, move) => {
const otherMovesInMoveset = new Set<MoveId>(user.getMoveset().map(m => m.moveId)); const otherMovesInMoveset = new Set<MoveId>(user.getMoveset().map(m => m.moveId));
if (!otherMovesInMoveset.delete(move.id) || !otherMovesInMoveset.size) { if (!otherMovesInMoveset.delete(move.id) || otherMovesInMoveset.size === 0) {
return false; // Last resort fails if used when not in user's moveset or no other moves exist return false; // Last resort fails if used when not in user's moveset or no other moves exist
} }

View File

@ -148,9 +148,9 @@ export function getCounterAttackTarget(user: Pokemon, damageCategory?: MoveDamag
const moveCategory = allMoves[attackRecord.move].category; const moveCategory = allMoves[attackRecord.move].category;
const sourceBattlerIndex = attackRecord.sourceBattlerIndex; const sourceBattlerIndex = attackRecord.sourceBattlerIndex;
if ( if (
moveCategory !== MoveCategory.STATUS && moveCategory !== MoveCategory.STATUS
!areAllies(sourceBattlerIndex, user.getBattlerIndex()) && && !areAllies(sourceBattlerIndex, user.getBattlerIndex())
(damageCategory === undefined || moveCategory === damageCategory) && (damageCategory === undefined || moveCategory === damageCategory)
) { ) {
return sourceBattlerIndex; return sourceBattlerIndex;
} }

View File

@ -51,11 +51,8 @@ import { MoveEffectTrigger } from "#enums/move-effect-trigger";
import { MoveFlags } from "#enums/move-flags"; import { MoveFlags } from "#enums/move-flags";
import { MoveId } from "#enums/move-id"; import { MoveId } from "#enums/move-id";
import { MoveResult } from "#enums/move-result"; import { MoveResult } from "#enums/move-result";
import { MoveId } from "#enums/move-id";
import { MoveResult } from "#enums/move-result";
import { MoveTarget } from "#enums/move-target"; import { MoveTarget } from "#enums/move-target";
import { isVirtual, MoveUseMode } from "#enums/move-use-mode"; import { isVirtual, MoveUseMode } from "#enums/move-use-mode";
import { isVirtual, MoveUseMode } from "#enums/move-use-mode";
import { MultiHitType } from "#enums/multi-hit-type"; import { MultiHitType } from "#enums/multi-hit-type";
import { PokemonType } from "#enums/pokemon-type"; import { PokemonType } from "#enums/pokemon-type";
import { PositionalTagType } from "#enums/positional-tag-type"; import { PositionalTagType } from "#enums/positional-tag-type";
@ -92,7 +89,7 @@ import type { ChargingMove, MoveAttrMap, MoveAttrString, MoveClassMap, MoveKindS
import type { TurnMove } from "#types/turn-move"; import type { TurnMove } from "#types/turn-move";
import type { AbstractConstructor } from "#types/type-helpers"; import type { AbstractConstructor } from "#types/type-helpers";
import { applyChallenges } from "#utils/challenge-utils"; import { applyChallenges } from "#utils/challenge-utils";
import { BooleanHolder, coerceArray, type Constructor, isNullOrUndefined, NumberHolder, randSeedFloat, randSeedInt, randSeedItem, toDmgValue } from "#utils/common"; import { BooleanHolder, coerceArray, type Constructor, NumberHolder, randSeedFloat, randSeedInt, randSeedItem, toDmgValue } from "#utils/common";
import { getEnumValues } from "#utils/enums"; import { getEnumValues } from "#utils/enums";
import { areAllies } from "#utils/pokemon-utils"; import { areAllies } from "#utils/pokemon-utils";
import { toCamelCase, toTitleCase } from "#utils/strings"; import { toCamelCase, toTitleCase } from "#utils/strings";
@ -172,14 +169,9 @@ export abstract class Move implements Localizable {
* @see {@link https://www.smogon.com/forums/threads/sword-shield-battle-mechanics-research.3655528/page-54#post-8548957} * @see {@link https://www.smogon.com/forums/threads/sword-shield-battle-mechanics-research.3655528/page-54#post-8548957}
*/ */
private conditionsSeq3: MoveCondition[] = []; private conditionsSeq3: MoveCondition[] = [];
<<<<<<< HEAD
/** Conditions that must be false for a move to be able to be selected.
*
=======
/** /**
* Conditions that must be false for a move to be able to be selected. * Conditions that must be false for a move to be able to be selected.
* *
>>>>>>> 02f941b3a05 (PR review changes)
* @remarks Different from {@linkcode conditions}, which is checked when the move is invoked * @remarks Different from {@linkcode conditions}, which is checked when the move is invoked
*/ */
private restrictions: MoveRestriction[] = []; private restrictions: MoveRestriction[] = [];

View File

@ -21,7 +21,7 @@ export enum BattlerTagLapseType {
* Note tags with this lapse type will lapse immediately after the first failure check sequence, * Note tags with this lapse type will lapse immediately after the first failure check sequence,
* regardless of whether the move was successful or not, but is skipped if the move is a * regardless of whether the move was successful or not, but is skipped if the move is a
* {@linkcode MoveUseMode.FOLLOW_UP | follow-up} move. * {@linkcode MoveUseMode.FOLLOW_UP | follow-up} move.
* *
* To only lapse the tag between the first and second failure check sequences, use * To only lapse the tag between the first and second failure check sequences, use
* {@linkcode BattlerTagLapseType.MOVE} instead. * {@linkcode BattlerTagLapseType.MOVE} instead.
*/ */
@ -50,12 +50,12 @@ export enum BattlerTagLapseType {
* The tag has some other custom activation or removal condition. * The tag has some other custom activation or removal condition.
* @remarks * @remarks
* Tags can use this lapse type to prevent them from automatically lapsing during automatic lapse instances, * Tags can use this lapse type to prevent them from automatically lapsing during automatic lapse instances,
* such as before a move is used or at the end of a turn. * such as before a move is used or at the end of a turn.
* Such tags will only trigger upon being specifically lapsed with the tag and lapse type via * Such tags will only trigger upon being specifically lapsed with the tag and lapse type via
* {@linkcode Pokemon.lapseTag}. * {@linkcode Pokemon.lapseTag}.
* */ */
CUSTOM, CUSTOM,
} }
/** Same type as {@linkcode BattlerTagLapseType}, but excludes the {@linkcode BattlerTagLapseType.CUSTOM} type */ /** Same type as {@linkcode BattlerTagLapseType}, but excludes the {@linkcode BattlerTagLapseType.CUSTOM} type */
export type NonCustomBattlerTagLapseType = Exclude<BattlerTagLapseType, BattlerTagLapseType.CUSTOM>; export type NonCustomBattlerTagLapseType = Exclude<BattlerTagLapseType, BattlerTagLapseType.CUSTOM>;

View File

@ -5,4 +5,4 @@ export enum MoveCategory {
} }
/** Type of damage categories */ /** Type of damage categories */
export type MoveDamageCategory = Exclude<MoveCategory, MoveCategory.STATUS>; export type MoveDamageCategory = Exclude<MoveCategory, MoveCategory.STATUS>;

View File

@ -6523,8 +6523,8 @@ export class EnemyPokemon extends Pokemon {
move.category !== MoveCategory.STATUS move.category !== MoveCategory.STATUS
&& moveTargets.some(p => { && moveTargets.some(p => {
const doesNotFail = const doesNotFail =
move.applyConditions(this, p, -1) || move.applyConditions(this, p, -1)
[MoveId.SUCKER_PUNCH, MoveId.UPPER_HAND, MoveId.THUNDERCLAP].includes(move.id); || [MoveId.SUCKER_PUNCH, MoveId.UPPER_HAND, MoveId.THUNDERCLAP].includes(move.id);
return ( return (
doesNotFail doesNotFail
&& p.getAttackDamage({ && p.getAttackDamage({
@ -6584,8 +6584,8 @@ export class EnemyPokemon extends Pokemon {
* target score to -20 * target score to -20
*/ */
if ( if (
(move.name.endsWith(" (N)") || !move.applyConditions(this, target, -1)) && (move.name.endsWith(" (N)") || !move.applyConditions(this, target, -1))
![MoveId.SUCKER_PUNCH, MoveId.UPPER_HAND, MoveId.THUNDERCLAP].includes(move.id) && ![MoveId.SUCKER_PUNCH, MoveId.UPPER_HAND, MoveId.THUNDERCLAP].includes(move.id)
) { ) {
targetScore = -20; targetScore = -20;
} else if (move.is("AttackMove")) { } else if (move.is("AttackMove")) {

View File

@ -121,9 +121,9 @@ export class CommandPhase extends FieldPhase {
for (const queuedMove of moveQueue) { for (const queuedMove of moveQueue) {
const movesetQueuedMove = moveset.find(m => m.moveId === queuedMove.move); const movesetQueuedMove = moveset.find(m => m.moveId === queuedMove.move);
if ( if (
queuedMove.move !== MoveId.NONE && queuedMove.move !== MoveId.NONE
!isVirtual(queuedMove.useMode) && && !isVirtual(queuedMove.useMode)
!movesetQueuedMove?.isUsable(playerPokemon, isIgnorePP(queuedMove.useMode), true) && !movesetQueuedMove?.isUsable(playerPokemon, isIgnorePP(queuedMove.useMode), true)
) { ) {
entriesToDelete++; entriesToDelete++;
} else { } else {

View File

@ -3,7 +3,6 @@ import type { Move, PreUseInterruptAttr } from "#types/move-types";
// biome-ignore-end lint/correctness/noUnusedImports: Used in a tsdoc comment // biome-ignore-end lint/correctness/noUnusedImports: Used in a tsdoc comment
import { applyAbAttrs } from "#abilities/apply-ab-attrs"; import { applyAbAttrs } from "#abilities/apply-ab-attrs";
import { MOVE_COLOR } from "#app/constants/colors";
import { globalScene } from "#app/global-scene"; import { globalScene } from "#app/global-scene";
import { getPokemonNameWithAffix } from "#app/messages"; import { getPokemonNameWithAffix } from "#app/messages";
import Overrides from "#app/overrides"; import Overrides from "#app/overrides";
@ -32,6 +31,7 @@ import type { Pokemon } from "#field/pokemon";
import { applyMoveAttrs } from "#moves/apply-attrs"; import { applyMoveAttrs } from "#moves/apply-attrs";
import { frenzyMissFunc } from "#moves/move-utils"; import { frenzyMissFunc } from "#moves/move-utils";
import type { PokemonMove } from "#moves/pokemon-move"; import type { PokemonMove } from "#moves/pokemon-move";
import type { TurnMove } from "#types/turn-move";
import { applyChallenges } from "#utils/challenge-utils"; import { applyChallenges } from "#utils/challenge-utils";
import { BooleanHolder, NumberHolder } from "#utils/common"; import { BooleanHolder, NumberHolder } from "#utils/common";
import { enumValueToKey } from "#utils/enums"; import { enumValueToKey } from "#utils/enums";
@ -44,7 +44,7 @@ export class MovePhase extends PokemonPhase {
protected _targets: BattlerIndex[]; protected _targets: BattlerIndex[];
public readonly useMode: MoveUseMode; // Made public for quash public readonly useMode: MoveUseMode; // Made public for quash
/** The timing modifier of the move (used by Quash and to force called moves to the front of their queue) */ /** The timing modifier of the move (used by Quash and to force called moves to the front of their queue) */
public timingModifier: MovePhaseTimingModifier; public readonly timingModifier: MovePhaseTimingModifier;
/** Whether the current move should fail but still use PP. */ /** Whether the current move should fail but still use PP. */
protected failed = false; protected failed = false;
/** Whether the current move should fail and retain PP. */ /** Whether the current move should fail and retain PP. */
@ -53,6 +53,13 @@ export class MovePhase extends PokemonPhase {
/** Flag set to `true` during {@linkcode checkFreeze} that indicates that the pokemon will thaw if it passes the failure conditions */ /** Flag set to `true` during {@linkcode checkFreeze} that indicates that the pokemon will thaw if it passes the failure conditions */
private declare thaw?: boolean; private declare thaw?: boolean;
/** The move history entry object that is pushed to the pokemon's move history
*
* @remarks
* Can be edited _after_ being pushed to the history to adjust the result, targets, etc, for this move phase.
*/
protected readonly moveHistoryEntry: TurnMove;
public get pokemon(): Pokemon { public get pokemon(): Pokemon {
return this._pokemon; return this._pokemon;
} }
@ -101,12 +108,14 @@ export class MovePhase extends PokemonPhase {
/** Signifies the current move should fail but still use PP */ /** Signifies the current move should fail but still use PP */
public fail(): void { public fail(): void {
this.moveHistoryEntry.result = MoveResult.FAIL;
this.failed = true; this.failed = true;
} }
/** Signifies the current move should cancel and retain PP */ /** Signifies the current move should cancel and retain PP */
public cancel(): void { public cancel(): void {
this.cancelled = true; this.cancelled = true;
this.moveHistoryEntry.result = MoveResult.FAIL;
} }
/** /**
@ -138,22 +147,22 @@ export class MovePhase extends PokemonPhase {
protected firstFailureCheck(): boolean { protected firstFailureCheck(): boolean {
// A big if statement will handle the checks (that each have side effects!) in the correct order // A big if statement will handle the checks (that each have side effects!) in the correct order
return ( return (
this.checkSleep() || this.checkSleep()
this.checkFreeze() || || this.checkFreeze()
this.checkPP() || || this.checkPP()
this.checkValidity() || || this.checkValidity()
this.checkTagCancel(BattlerTagType.TRUANT) || || this.checkTagCancel(BattlerTagType.TRUANT)
this.checkPreUseInterrupt() || || this.checkPreUseInterrupt()
this.checkTagCancel(BattlerTagType.FLINCHED) || || this.checkTagCancel(BattlerTagType.FLINCHED)
this.checkTagCancel(BattlerTagType.DISABLED) || || this.checkTagCancel(BattlerTagType.DISABLED)
this.checkTagCancel(BattlerTagType.HEAL_BLOCK) || || this.checkTagCancel(BattlerTagType.HEAL_BLOCK)
this.checkTagCancel(BattlerTagType.THROAT_CHOPPED) || || this.checkTagCancel(BattlerTagType.THROAT_CHOPPED)
this.checkGravity() || || this.checkGravity()
this.checkTagCancel(BattlerTagType.TAUNT) || || this.checkTagCancel(BattlerTagType.TAUNT)
this.checkTagCancel(BattlerTagType.IMPRISON) || || this.checkTagCancel(BattlerTagType.IMPRISON)
this.checkTagCancel(BattlerTagType.CONFUSED) || || this.checkTagCancel(BattlerTagType.CONFUSED)
this.checkPara() || || this.checkPara()
this.checkTagCancel(BattlerTagType.INFATUATED) || this.checkTagCancel(BattlerTagType.INFATUATED)
); );
} }
@ -171,9 +180,9 @@ export class MovePhase extends PokemonPhase {
*/ */
protected followUpMoveFirstFailureCheck(): boolean { protected followUpMoveFirstFailureCheck(): boolean {
return ( return (
this.checkTagCancel(BattlerTagType.HEAL_BLOCK) || this.checkTagCancel(BattlerTagType.HEAL_BLOCK)
this.checkTagCancel(BattlerTagType.THROAT_CHOPPED) || || this.checkTagCancel(BattlerTagType.THROAT_CHOPPED)
this.checkGravity() || this.checkGravity()
); );
} }
@ -419,11 +428,12 @@ export class MovePhase extends PokemonPhase {
const moveQueue = this.pokemon.getMoveQueue(); const moveQueue = this.pokemon.getMoveQueue();
if ( if (
(targets.length === 0 && !this.move.getMove().hasAttr("AddArenaTrapTagAttr")) || (targets.length === 0 && !this.move.getMove().hasAttr("AddArenaTrapTagAttr"))
(moveQueue.length > 0 && moveQueue[0].move === MoveId.NONE) || (moveQueue.length > 0 && moveQueue[0].move === MoveId.NONE)
) { ) {
this.showFailedText(); this.showFailedText();
this.fail(); this.fail();
this.pokemon.pushMoveHistory(this.moveHistoryEntry);
return true; return true;
} }
this.pokemon.lapseTags(BattlerTagLapseType.MOVE); this.pokemon.lapseTags(BattlerTagLapseType.MOVE);
@ -536,20 +546,18 @@ export class MovePhase extends PokemonPhase {
// Check if the move will heal // Check if the move will heal
const move = this.move.getMove(); const move = this.move.getMove();
if ( if (
move.findAttr( move.findAttr(attr => attr.selfTarget && attr.is("HealStatusEffectAttr") && attr.isOfEffect(StatusEffect.FREEZE))
attr => attr.selfTarget && attr.is("HealStatusEffectAttr") && attr.isOfEffect(StatusEffect.FREEZE), && (move.id !== MoveId.BURN_UP || this.pokemon.isOfType(PokemonType.FIRE, true, true))
) &&
(move.id !== MoveId.BURN_UP || this.pokemon.isOfType(PokemonType.FIRE, true, true))
) { ) {
this.thaw = true; this.thaw = true;
return false; return false;
} }
if ( if (
Overrides.STATUS_ACTIVATION_OVERRIDE === false || Overrides.STATUS_ACTIVATION_OVERRIDE === false
this.move || this.move
.getMove() .getMove()
.findAttr(attr => attr.selfTarget && attr.is("HealStatusEffectAttr") && attr.isOfEffect(StatusEffect.FREEZE)) || .findAttr(attr => attr.selfTarget && attr.is("HealStatusEffectAttr") && attr.isOfEffect(StatusEffect.FREEZE))
(!this.pokemon.randBattleSeedInt(5) && Overrides.STATUS_ACTIVATION_OVERRIDE !== true) || (!this.pokemon.randBattleSeedInt(5) && Overrides.STATUS_ACTIVATION_OVERRIDE !== true)
) { ) {
this.cureStatus(StatusEffect.FREEZE); this.cureStatus(StatusEffect.FREEZE);
return false; return false;
@ -606,10 +614,9 @@ export class MovePhase extends PokemonPhase {
return true; return true;
} else if ( } else if (
this.pokemon.isPlayer() && this.pokemon.isPlayer()
applyChallenges(ChallengeType.POKEMON_MOVE, moveId, usability) && && applyChallenges(ChallengeType.POKEMON_MOVE, moveId, usability) // check the value inside of usability after calling applyChallenges
// check the value inside of usability after calling applyChallenges && !usability.value
!usability.value
) { ) {
failedText = i18next.t("battle:moveCannotUseChallenge", { moveName }); failedText = i18next.t("battle:moveCannotUseChallenge", { moveName });
} else { } else {
@ -683,8 +690,8 @@ export class MovePhase extends PokemonPhase {
return false; return false;
} }
const proc = const proc =
(this.pokemon.randBattleSeedInt(4) === 0 || Overrides.STATUS_ACTIVATION_OVERRIDE === true) && (this.pokemon.randBattleSeedInt(4) === 0 || Overrides.STATUS_ACTIVATION_OVERRIDE === true)
Overrides.STATUS_ACTIVATION_OVERRIDE !== false; && Overrides.STATUS_ACTIVATION_OVERRIDE !== false;
if (!proc) { if (!proc) {
return false; return false;
} }
@ -777,7 +784,7 @@ export class MovePhase extends PokemonPhase {
const dancerModes: MoveUseMode[] = [MoveUseMode.INDIRECT, MoveUseMode.REFLECTED] as const; const dancerModes: MoveUseMode[] = [MoveUseMode.INDIRECT, MoveUseMode.REFLECTED] as const;
if (this.move.getMove().hasFlag(MoveFlags.DANCE_MOVE) && !dancerModes.includes(this.useMode)) { if (this.move.getMove().hasFlag(MoveFlags.DANCE_MOVE) && !dancerModes.includes(this.useMode)) {
globalScene.getField(true).forEach(pokemon => { globalScene.getField(true).forEach(pokemon => {
applyAbAttrs("PostMoveUsedAbAttr", { pokemon, move: this.move, source: user, targets: targets }); applyAbAttrs("PostMoveUsedAbAttr", { pokemon, move: this.move, source: user, targets });
}); });
} }
} }
@ -815,6 +822,7 @@ export class MovePhase extends PokemonPhase {
result: MoveResult.FAIL, result: MoveResult.FAIL,
useMode: this.useMode, useMode: this.useMode,
}); });
console.log("==========PUSHING MOVE HISTORY WITH FAIL FOR %s=============", MoveId[this.move.moveId]);
// Use move-specific failure messages if present before checking terrain/weather blockage // Use move-specific failure messages if present before checking terrain/weather blockage
// and falling back to the classic "But it failed!". // and falling back to the classic "But it failed!".

View File

@ -141,7 +141,7 @@ export function areAllies(a: BattlerIndex, b: BattlerIndex): boolean {
return false; return false;
} }
return ( return (
(a === BattlerIndex.PLAYER || a === BattlerIndex.PLAYER_2) === (a === BattlerIndex.PLAYER || a === BattlerIndex.PLAYER_2)
(b === BattlerIndex.PLAYER || b === BattlerIndex.PLAYER_2) === (b === BattlerIndex.PLAYER || b === BattlerIndex.PLAYER_2)
); );
} }