[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>
This commit is contained in:
Carson 2024-07-30 17:24:01 -04:00 committed by GitHub
parent 2900f22289
commit 64ca6dd827
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1917,7 +1917,7 @@ export class PsychoShiftEffectAttr extends MoveEffectAttr {
} }
apply(user: Pokemon, target: Pokemon, move: Move, args: any[]): boolean { 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) { if (target.status) {
return false; return false;
@ -1925,7 +1925,9 @@ export class PsychoShiftEffectAttr extends MoveEffectAttr {
if (!target.status || (target.status.effect === statusToApply && move.chance < 0)) { if (!target.status || (target.status.effect === statusToApply && move.chance < 0)) {
const statusAfflictResult = target.trySetStatus(statusToApply, true, user); const statusAfflictResult = target.trySetStatus(statusToApply, true, user);
if (statusAfflictResult) { if (statusAfflictResult) {
if (user.status) {
user.scene.queueMessage(getStatusEffectHealText(user.status.effect, getPokemonNameWithAffix(user))); user.scene.queueMessage(getStatusEffectHealText(user.status.effect, getPokemonNameWithAffix(user)));
}
user.resetStatus(); user.resetStatus();
user.updateInfo(); user.updateInfo();
} }
@ -7033,12 +7035,13 @@ export function initMoves() {
.unimplemented(), .unimplemented(),
new StatusMove(Moves.PSYCHO_SHIFT, Type.PSYCHIC, 100, 10, -1, 0, 4) new StatusMove(Moves.PSYCHO_SHIFT, Type.PSYCHIC, 100, 10, -1, 0, 4)
.attr(PsychoShiftEffectAttr) .attr(PsychoShiftEffectAttr)
.condition((user, target, move) => (user.status?.effect === StatusEffect.BURN .condition((user, target, move) => {
|| user.status?.effect === StatusEffect.POISON let statusToApply = user.hasAbility(Abilities.COMATOSE) ? StatusEffect.SLEEP : undefined;
|| user.status?.effect === StatusEffect.TOXIC if (user.status?.effect && isNonVolatileStatusEffect(user.status.effect)) {
|| user.status?.effect === StatusEffect.PARALYSIS statusToApply = user.status.effect;
|| user.status?.effect === StatusEffect.SLEEP) }
&& target.canSetStatus(user.status?.effect, false, false, user) return statusToApply && target.canSetStatus(statusToApply, false, false, user);
}
), ),
new AttackMove(Moves.TRUMP_CARD, Type.NORMAL, MoveCategory.SPECIAL, -1, -1, 5, -1, 0, 4) new AttackMove(Moves.TRUMP_CARD, Type.NORMAL, MoveCategory.SPECIAL, -1, -1, 5, -1, 0, 4)
.makesContact() .makesContact()