changes to input variables and documentation

This commit is contained in:
geeil-han 2024-12-04 20:35:15 +01:00
parent 97b7e9d9bf
commit 96a4fdbb77
3 changed files with 6 additions and 6 deletions

View File

@ -2835,10 +2835,10 @@ export class StuffCheeksTag extends MoveRestrictionBattlerTag {
// Stuff Cheeks // Stuff Cheeks
private moveId: Moves = Moves.STUFF_CHEEKS; private moveId: Moves = Moves.STUFF_CHEEKS;
/** /**
* This Tag only lasts the turn the {@linkcode MoveUnselectableTag} was added. * This Tag only lasts the turn the {@linkcode StuffCheeksTag} was added.
* @param move {@linkcode Moves} that is selected * @param move {@linkcode Moves} that is selected
*/ */
constructor(move: Moves) { constructor() {
super(BattlerTagType.STUFF_CHEEKS, BattlerTagLapseType.TURN_END, 0, Moves.STUFF_CHEEKS); super(BattlerTagType.STUFF_CHEEKS, BattlerTagLapseType.TURN_END, 0, Moves.STUFF_CHEEKS);
} }
@ -3201,7 +3201,7 @@ export function getBattlerTag(tagType: BattlerTagType, turnCount: number, source
case BattlerTagType.PSYCHO_SHIFT: case BattlerTagType.PSYCHO_SHIFT:
return new PsychoShiftTag(); return new PsychoShiftTag();
case BattlerTagType.STUFF_CHEEKS: case BattlerTagType.STUFF_CHEEKS:
return new StuffCheeksTag(sourceMove); return new StuffCheeksTag();
case BattlerTagType.NONE: case BattlerTagType.NONE:
default: default:
return new BattlerTag(tagType, BattlerTagLapseType.CUSTOM, turnCount, sourceMove, sourceId); return new BattlerTag(tagType, BattlerTagLapseType.CUSTOM, turnCount, sourceMove, sourceId);

View File

@ -7772,7 +7772,7 @@ export class StuffCheeksCondition extends MoveSelectCondition {
* @returns true if the user is holding a berry, otherwise false * @returns true if the user is holding a berry, otherwise false
*/ */
private selectableCondition(user: Pokemon): boolean { private selectableCondition(user: Pokemon): boolean {
return user?.getHeldItems()?.filter(m => m instanceof BerryModifier, user.isPlayer())?.length > 0; return user.getHeldItems().filter(m => m instanceof BerryModifier, user.isPlayer()).length > 0;
} }
/** /**
@ -7791,7 +7791,7 @@ export class StuffCheeksCondition extends MoveSelectCondition {
} }
} }
const hasBerryCondition: MoveConditionFunc = (user: Pokemon, target: Pokemon, move: Move) => user.scene.findModifiers(m => m instanceof BerryModifier, user.isPlayer()).length > 0; const hasBerryCondition: MoveConditionFunc = (user: Pokemon, target: Pokemon, move: Move) => user.getHeldItems().filter(m => m instanceof BerryModifier, user.isPlayer()).length > 0;
export class MoveCondition { export class MoveCondition {
protected func: MoveConditionFunc; protected func: MoveConditionFunc;

View File

@ -149,7 +149,7 @@ export class CommandPhase extends FieldPhase {
const move = playerPokemon.getMoveset()[cursor]!; //TODO: is this bang correct? const move = playerPokemon.getMoveset()[cursor]!; //TODO: is this bang correct?
this.scene.ui.setMode(Mode.MESSAGE); this.scene.ui.setMode(Mode.MESSAGE);
// Decides between a Disabled, not selectable, Not Implemented, or No PP translation message // Decides between a Disabled, Not Implemented, or No PP translation message
const errorMessage = const errorMessage =
playerPokemon.isMoveRestricted(move.moveId, playerPokemon) playerPokemon.isMoveRestricted(move.moveId, playerPokemon)
? playerPokemon.getRestrictingTag(move.moveId, playerPokemon)!.selectionDeniedText(playerPokemon, move.moveId) ? playerPokemon.getRestrictingTag(move.moveId, playerPokemon)!.selectionDeniedText(playerPokemon, move.moveId)