fix for Psychic Terrain blocking Protect Moves
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