mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2025-07-08 17:32:18 +02:00
Avoid disabling virtual moves
This commit is contained in:
parent
14de49e8be
commit
8923720cda
@ -135,7 +135,7 @@ export abstract class DisablingBattlerTag extends BattlerTag {
|
|||||||
*/
|
*/
|
||||||
export class DisabledTag extends DisablingBattlerTag {
|
export class DisabledTag extends DisablingBattlerTag {
|
||||||
/** The move being disabled. Gets set when {@linkcode onAdd} is called for this tag. */
|
/** The move being disabled. Gets set when {@linkcode onAdd} is called for this tag. */
|
||||||
public moveId: integer = 0;
|
public moveId: Moves = Moves.NONE;
|
||||||
|
|
||||||
public override moveIsDisabled(move: Moves): boolean {
|
public override moveIsDisabled(move: Moves): boolean {
|
||||||
return move === this.moveId;
|
return move === this.moveId;
|
||||||
@ -152,13 +152,9 @@ export class DisabledTag extends DisablingBattlerTag {
|
|||||||
override onAdd(pokemon: Pokemon): void {
|
override onAdd(pokemon: Pokemon): void {
|
||||||
super.onAdd(pokemon);
|
super.onAdd(pokemon);
|
||||||
|
|
||||||
const history = pokemon.getLastXMoves();
|
const move = pokemon.getLastXMoves()
|
||||||
if (history.length === 0) {
|
.find(m => m.move !== Moves.NONE && m.move !== Moves.STRUGGLE && !m.virtual);
|
||||||
return;
|
if (move === undefined) {
|
||||||
}
|
|
||||||
|
|
||||||
const move = history.find(m => m.move !== Moves.NONE);
|
|
||||||
if (move === undefined || move.move === Moves.STRUGGLE) {
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user