diff --git a/data/mods/gen4/moves.ts b/data/mods/gen4/moves.ts index 795aa6e7c8..0c9077d542 100644 --- a/data/mods/gen4/moves.ts +++ b/data/mods/gen4/moves.ts @@ -1030,6 +1030,23 @@ export const Moves: import('../../../sim/dex-moves').ModdedMoveDataTable = { }, }, }, + psychoshift: { + inherit: true, + onTryHit(target, source, move) { + if (!source.status) return false; + source.addVolatile('psychoshift'); + move.status = source.status; + }, + self: null, + condition: { + duration: 1, + onSourceSetStatus(status, target, source, sourceEffect) { + if (sourceEffect.effectType !== 'Move' || sourceEffect.id !== this.effectState.id) return; + source.cureStatus(); + source.removeVolatile('psychoshift'); + }, + }, + }, psychup: { inherit: true, flags: { snatch: 1, bypasssub: 1, metronome: 1 }, diff --git a/test/sim/moves/psychoshift.js b/test/sim/moves/psychoshift.js new file mode 100644 index 0000000000..a1f93a70b9 --- /dev/null +++ b/test/sim/moves/psychoshift.js @@ -0,0 +1,34 @@ +'use strict'; + +const assert = require('./../../assert'); +const common = require('./../../common'); + +let battle; + +describe('Psycho Shift', () => { + afterEach(() => { + battle.destroy(); + }); + + it(`should cure the user after transferring status`, () => { + battle = common.createBattle([[ + { species: 'gardevoir', ability: 'synchronize', moves: ['toxic'] }, + ], [ + { species: 'noctowl', moves: ['psycho shift'] }, + ]]); + battle.makeChoices(); + assert.false(battle.p2.active[0].status); + }); + + describe('[Gen 4]', () => { + it(`should cure the user before transferring status`, () => { + battle = common.gen(4).createBattle([[ + { species: 'gardevoir', ability: 'synchronize', moves: ['toxic'] }, + ], [ + { species: 'noctowl', moves: ['psycho shift'] }, + ]]); + battle.makeChoices(); + assert.equal(battle.p2.active[0].status, 'psn'); + }); + }); +});