From df7cb209f70093ac898dc2ecae1c0c566e96e714 Mon Sep 17 00:00:00 2001 From: Jaime Date: Sun, 19 May 2024 19:40:56 +0200 Subject: [PATCH] Fix Curse targeting for non ghost types (#782) --- src/data/move.ts | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/data/move.ts b/src/data/move.ts index 026585b346b..d94c0dcb19f 100644 --- a/src/data/move.ts +++ b/src/data/move.ts @@ -58,7 +58,8 @@ export enum MoveTarget { /** {@link https://bulbapedia.bulbagarden.net/wiki/Category:Entry_hazard-creating_moves Entry hazard-creating moves} */ ENEMY_SIDE, BOTH_SIDES, - PARTY + PARTY, + CURSE } export enum MoveFlags { @@ -4461,7 +4462,7 @@ export function getMoveTargets(user: Pokemon, move: Moves): MoveTargetSet { switch (moveTarget) { case MoveTarget.USER: case MoveTarget.PARTY: - set = [ user]; + set = [ user ]; break; case MoveTarget.NEAR_OTHER: case MoveTarget.OTHER: @@ -4497,6 +4498,9 @@ export function getMoveTargets(user: Pokemon, move: Moves): MoveTargetSet { set = [ user, user.getAlly() ].concat(opponents); multiple = true; break; + case MoveTarget.CURSE: + set = user.getTypes(true).includes(Type.GHOST) ? (opponents.concat([ user.getAlly() ])) : [ user ]; + break; } return { targets: set.filter(p => p?.isActive(true)).map(p => p.getBattlerIndex()).filter(t => t !== undefined), multiple }; @@ -4983,7 +4987,8 @@ export function initMoves() { .soundBased(), new StatusMove(Moves.CURSE, Type.GHOST, -1, 10, -1, 0, 2) .attr(CurseAttr) - .ignoresProtect(true), + .ignoresProtect(true) + .target(MoveTarget.CURSE), new AttackMove(Moves.FLAIL, Type.NORMAL, MoveCategory.PHYSICAL, -1, 100, 15, -1, 0, 2) .attr(LowHpPowerAttr), new StatusMove(Moves.CONVERSION_2, Type.NORMAL, -1, 30, -1, 0, 2)