Update enum name

This commit is contained in:
Dean 2025-10-31 16:21:38 -07:00
parent 5c8c2151a8
commit c33f9723f5
3 changed files with 15 additions and 15 deletions

View File

@ -34,7 +34,7 @@ import { MoveCategory } from "#enums/move-category";
import { MoveFlags } from "#enums/move-flags";
import { MoveId } from "#enums/move-id";
import { MovePhaseTimingModifier } from "#enums/move-phase-timing-modifier";
import { MovePriorityModifier } from "#enums/move-priority-modifier";
import { MovePriorityInBracket } from "#enums/move-priority-modifier";
import { MoveResult } from "#enums/move-result";
import { MoveTarget } from "#enums/move-target";
import { MoveUseMode } from "#enums/move-use-mode";
@ -4143,11 +4143,11 @@ export class ChangeMovePriorityAbAttr extends AbAttr {
}
}
export class ChangeMovePriorityModifierAbAttr extends AbAttr {
private readonly newModifier: MovePriorityModifier;
export class ChangeMovePriorityInBracketAbAttr extends AbAttr {
private readonly newModifier: MovePriorityInBracket;
private readonly moveFunc: (pokemon: Pokemon, move: Move) => boolean;
constructor(moveFunc: (pokemon: Pokemon, move: Move) => boolean, newModifier: MovePriorityModifier) {
constructor(moveFunc: (pokemon: Pokemon, move: Move) => boolean, newModifier: MovePriorityInBracket) {
super(false);
this.newModifier = newModifier;
this.moveFunc = moveFunc;
@ -6741,7 +6741,7 @@ const AbilityAttrs = Object.freeze({
BlockStatusDamageAbAttr,
BlockOneHitKOAbAttr,
ChangeMovePriorityAbAttr,
ChangeMovePriorityModifierAbAttr,
ChangeMovePriorityInBracketAbAttr,
IgnoreContactAbAttr,
PreWeatherEffectAbAttr,
PreWeatherDamageAbAttr,
@ -7259,7 +7259,7 @@ export function initAbilities() {
.attr(DoubleBattleChanceAbAttr)
.build(),
new AbBuilder(AbilityId.STALL, 4)
.attr(ChangeMovePriorityModifierAbAttr, (_pokemon, _move: Move) => true, MovePriorityModifier.LAST_IN_BRACKET)
.attr(ChangeMovePriorityInBracketAbAttr, (_pokemon, _move: Move) => true, MovePriorityInBracket.LAST)
.build(),
new AbBuilder(AbilityId.TECHNICIAN, 4)
.attr(MovePowerBoostAbAttr, (user, target, move) => {
@ -8206,7 +8206,7 @@ export function initAbilities() {
.ignorable()
.build(),
new AbBuilder(AbilityId.MYCELIUM_MIGHT, 9)
.attr(ChangeMovePriorityModifierAbAttr, (_pokemon, move) => move.category === MoveCategory.STATUS, MovePriorityModifier.LAST_IN_BRACKET)
.attr(ChangeMovePriorityInBracketAbAttr, (_pokemon, move) => move.category === MoveCategory.STATUS, MovePriorityInBracket.LAST)
.attr(PreventBypassSpeedChanceAbAttr, (_pokemon, move) => move.category === MoveCategory.STATUS)
.attr(MoveAbilityBypassAbAttr, (_pokemon, move: Move) => move.category === MoveCategory.STATUS)
.build(),

View File

@ -101,7 +101,7 @@ import { MovePhaseTimingModifier } from "#enums/move-phase-timing-modifier";
import { inSpeedOrder } from "#utils/speed-order-generator";
import { canSpeciesTera, willTerastallize } from "#utils/pokemon-utils";
import type { ReadonlyGenericUint8Array } from "#types/typed-arrays";
import { MovePriorityModifier } from "#enums/move-priority-modifier";
import { MovePriorityInBracket } from "#enums/move-priority-modifier";
/**
* A function used to conditionally determine execution of a given {@linkcode MoveAttr}.
@ -1069,10 +1069,10 @@ export abstract class Move implements Localizable {
public getPriorityModifier(user: Pokemon, simulated = true) {
if (user.getTag(BattlerTagType.BYPASS_SPEED)) {
return MovePriorityModifier.FIRST_IN_BRACKET;
return MovePriorityInBracket.FIRST;
}
const modifierHolder = new NumberHolder(MovePriorityModifier.NORMAL);
applyAbAttrs("ChangeMovePriorityModifierAbAttr", { pokemon: user, simulated, move: this, priority: modifierHolder });
const modifierHolder = new NumberHolder(MovePriorityInBracket.NORMAL);
applyAbAttrs("ChangeMovePriorityInBracketAbAttr", { pokemon: user, simulated, move: this, priority: modifierHolder });
return modifierHolder.value;
}

View File

@ -3,11 +3,11 @@ import type { ObjectValues } from "#types/type-helpers";
/**
* Enum representing modifiers for Move priorities.
*/
export const MovePriorityModifier = Object.freeze({
export const MovePriorityInBracket = Object.freeze({
/** Used when moves go last in their priority bracket, but before moves of lower priority. */
LAST_IN_BRACKET: 0,
LAST: 0,
NORMAL: 1,
/** Used when moves go first in their priority bracket, but before moves of lower priority. */
FIRST_IN_BRACKET: 2,
FIRST: 2,
});
export type MovePriorityModifier = ObjectValues<typeof MovePriorityModifier>;
export type MovePriorityInBracket = ObjectValues<typeof MovePriorityInBracket>;