mirror of
https://github.com/smogon/pokemon-showdown.git
synced 2026-06-02 22:08:36 -05:00
Merge 8dddfb0352 into 6765d8422d
This commit is contained in:
commit
a9c1a9d5fd
|
|
@ -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 },
|
||||
|
|
|
|||
34
test/sim/moves/psychoshift.js
Normal file
34
test/sim/moves/psychoshift.js
Normal file
|
|
@ -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');
|
||||
});
|
||||
});
|
||||
});
|
||||
Loading…
Reference in New Issue
Block a user