Fix Curse targeting for non ghost types
parent
79a87e1c65
commit
b662ff842c
|
@ -51,7 +51,8 @@ export enum MoveTarget {
|
||||||
USER_SIDE,
|
USER_SIDE,
|
||||||
ENEMY_SIDE,
|
ENEMY_SIDE,
|
||||||
BOTH_SIDES,
|
BOTH_SIDES,
|
||||||
PARTY
|
PARTY,
|
||||||
|
CURSE
|
||||||
}
|
}
|
||||||
|
|
||||||
export enum MoveFlags {
|
export enum MoveFlags {
|
||||||
|
@ -4096,7 +4097,7 @@ export function getMoveTargets(user: Pokemon, move: Moves): MoveTargetSet {
|
||||||
switch (moveTarget) {
|
switch (moveTarget) {
|
||||||
case MoveTarget.USER:
|
case MoveTarget.USER:
|
||||||
case MoveTarget.PARTY:
|
case MoveTarget.PARTY:
|
||||||
set = [ user];
|
set = [ user ];
|
||||||
break;
|
break;
|
||||||
case MoveTarget.NEAR_OTHER:
|
case MoveTarget.NEAR_OTHER:
|
||||||
case MoveTarget.OTHER:
|
case MoveTarget.OTHER:
|
||||||
|
@ -4132,6 +4133,9 @@ export function getMoveTargets(user: Pokemon, move: Moves): MoveTargetSet {
|
||||||
set = [ user, user.getAlly() ].concat(opponents);
|
set = [ user, user.getAlly() ].concat(opponents);
|
||||||
multiple = true;
|
multiple = true;
|
||||||
break;
|
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 };
|
return { targets: set.filter(p => p?.isActive(true)).map(p => p.getBattlerIndex()).filter(t => t !== undefined), multiple };
|
||||||
|
@ -4613,7 +4617,8 @@ export function initMoves() {
|
||||||
.soundBased(),
|
.soundBased(),
|
||||||
new StatusMove(Moves.CURSE, Type.GHOST, -1, 10, -1, 0, 2)
|
new StatusMove(Moves.CURSE, Type.GHOST, -1, 10, -1, 0, 2)
|
||||||
.attr(CurseAttr)
|
.attr(CurseAttr)
|
||||||
.ignoresProtect(true),
|
.ignoresProtect(true)
|
||||||
|
.target(MoveTarget.CURSE),
|
||||||
new AttackMove(Moves.FLAIL, Type.NORMAL, MoveCategory.PHYSICAL, -1, 100, 15, -1, 0, 2)
|
new AttackMove(Moves.FLAIL, Type.NORMAL, MoveCategory.PHYSICAL, -1, 100, 15, -1, 0, 2)
|
||||||
.attr(LowHpPowerAttr),
|
.attr(LowHpPowerAttr),
|
||||||
new StatusMove(Moves.CONVERSION_2, Type.NORMAL, -1, 30, -1, 0, 2)
|
new StatusMove(Moves.CONVERSION_2, Type.NORMAL, -1, 30, -1, 0, 2)
|
||||||
|
|
Loading…
Reference in New Issue