mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2024-11-25 08:16:04 +00:00
fix for Psychic Terrain blocking Protect Moves
This commit is contained in:
parent
58ef8f5aec
commit
07ff22e53d
@ -3,6 +3,7 @@ import Move from "./move";
|
||||
import { Type } from "./type";
|
||||
import * as Utils from "../utils";
|
||||
import { IncrementMovePriorityAbAttr, applyAbAttrs } from "./ability";
|
||||
import { ProtectAttr } from "./move";
|
||||
|
||||
export enum TerrainType {
|
||||
NONE,
|
||||
@ -50,10 +51,13 @@ export class Terrain {
|
||||
isMoveTerrainCancelled(user: Pokemon, move: Move): boolean {
|
||||
switch (this.terrainType) {
|
||||
case TerrainType.PSYCHIC:
|
||||
if (!move.getAttrs(ProtectAttr).length )
|
||||
{
|
||||
const priority = new Utils.IntegerHolder(move.priority);
|
||||
applyAbAttrs(IncrementMovePriorityAbAttr, user, null, move, priority);
|
||||
return priority.value > 0;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user