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 { Type } from "./type";
|
||||||
import * as Utils from "../utils";
|
import * as Utils from "../utils";
|
||||||
import { IncrementMovePriorityAbAttr, applyAbAttrs } from "./ability";
|
import { IncrementMovePriorityAbAttr, applyAbAttrs } from "./ability";
|
||||||
|
import { ProtectAttr } from "./move";
|
||||||
|
|
||||||
export enum TerrainType {
|
export enum TerrainType {
|
||||||
NONE,
|
NONE,
|
||||||
@ -50,9 +51,12 @@ export class Terrain {
|
|||||||
isMoveTerrainCancelled(user: Pokemon, move: Move): boolean {
|
isMoveTerrainCancelled(user: Pokemon, move: Move): boolean {
|
||||||
switch (this.terrainType) {
|
switch (this.terrainType) {
|
||||||
case TerrainType.PSYCHIC:
|
case TerrainType.PSYCHIC:
|
||||||
const priority = new Utils.IntegerHolder(move.priority);
|
if (!move.getAttrs(ProtectAttr).length )
|
||||||
applyAbAttrs(IncrementMovePriorityAbAttr, user, null, move, priority);
|
{
|
||||||
return priority.value > 0;
|
const priority = new Utils.IntegerHolder(move.priority);
|
||||||
|
applyAbAttrs(IncrementMovePriorityAbAttr, user, null, move, priority);
|
||||||
|
return priority.value > 0;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
|
Loading…
Reference in New Issue
Block a user