From 64ca6dd827d760551941219761bcc22f4af8ba55 Mon Sep 17 00:00:00 2001 From: Carson <59876651+CarsonVB@users.noreply.github.com> Date: Tue, 30 Jul 2024 17:24:01 -0400 Subject: [PATCH] [Move] Psycho Shift treats Comatose as Sleep (#1780) * comotose + psycho_shift * condensed conditional for psycho shift --------- Co-authored-by: Tempoanon <163687446+Tempo-anon@users.noreply.github.com> --- src/data/move.ts | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/src/data/move.ts b/src/data/move.ts index fdf2efcd13f..3754b0acd3b 100644 --- a/src/data/move.ts +++ b/src/data/move.ts @@ -1917,7 +1917,7 @@ export class PsychoShiftEffectAttr extends MoveEffectAttr { } apply(user: Pokemon, target: Pokemon, move: Move, args: any[]): boolean { - const statusToApply: StatusEffect = user.status?.effect; + const statusToApply: StatusEffect = user.status?.effect ?? (user.hasAbility(Abilities.COMATOSE) ? StatusEffect.SLEEP : undefined); if (target.status) { return false; @@ -1925,7 +1925,9 @@ export class PsychoShiftEffectAttr extends MoveEffectAttr { if (!target.status || (target.status.effect === statusToApply && move.chance < 0)) { const statusAfflictResult = target.trySetStatus(statusToApply, true, user); if (statusAfflictResult) { - user.scene.queueMessage(getStatusEffectHealText(user.status.effect, getPokemonNameWithAffix(user))); + if (user.status) { + user.scene.queueMessage(getStatusEffectHealText(user.status.effect, getPokemonNameWithAffix(user))); + } user.resetStatus(); user.updateInfo(); } @@ -7033,12 +7035,13 @@ export function initMoves() { .unimplemented(), new StatusMove(Moves.PSYCHO_SHIFT, Type.PSYCHIC, 100, 10, -1, 0, 4) .attr(PsychoShiftEffectAttr) - .condition((user, target, move) => (user.status?.effect === StatusEffect.BURN - || user.status?.effect === StatusEffect.POISON - || user.status?.effect === StatusEffect.TOXIC - || user.status?.effect === StatusEffect.PARALYSIS - || user.status?.effect === StatusEffect.SLEEP) - && target.canSetStatus(user.status?.effect, false, false, user) + .condition((user, target, move) => { + let statusToApply = user.hasAbility(Abilities.COMATOSE) ? StatusEffect.SLEEP : undefined; + if (user.status?.effect && isNonVolatileStatusEffect(user.status.effect)) { + statusToApply = user.status.effect; + } + return statusToApply && target.canSetStatus(statusToApply, false, false, user); + } ), new AttackMove(Moves.TRUMP_CARD, Type.NORMAL, MoveCategory.SPECIAL, -1, -1, 5, -1, 0, 4) .makesContact()