mirror of
https://github.com/smogon/pokemon-showdown.git
synced 2026-06-02 22:08:36 -05:00
Implement Mirror Move correctly for gens 1 and 2
Also fixed lastMove not being an id.
This commit is contained in:
parent
bf3898273e
commit
cca9688b2a
|
|
@ -564,11 +564,12 @@ exports.BattleMovedex = {
|
|||
},
|
||||
mirrormove: {
|
||||
inherit: true,
|
||||
onTryHit: function (target) {
|
||||
var noMirrorMove = {mirrormove: 1, struggle: 1};
|
||||
if (!target.lastMove || noMirrorMove[target.lastMove]) {
|
||||
onHit: function (pokemon) {
|
||||
var foe = pokemon.side.foe.active[0];
|
||||
if (!foe || !foe.lastMove || foe.lastMove === 'mirrormove') {
|
||||
return false;
|
||||
}
|
||||
this.useMove(foe.lastMove, pokemon);
|
||||
}
|
||||
},
|
||||
nightshade: {
|
||||
|
|
|
|||
|
|
@ -104,8 +104,8 @@ exports.BattleScripts = {
|
|||
if (!lockedMove && (!pokemon.volatiles['partialtrappinglock'] || pokemon.volatiles['partialtrappinglock'].locked !== target)) {
|
||||
pokemon.deductPP(move, null, target);
|
||||
// On gen 1 moves are stored when they are chosen and a PP is deducted.
|
||||
pokemon.side.lastMove = move;
|
||||
pokemon.lastMove = move;
|
||||
pokemon.side.lastMove = move.id;
|
||||
pokemon.lastMove = move.id;
|
||||
}
|
||||
this.useMove(move, pokemon, target, sourceEffect);
|
||||
this.runEvent('AfterMove', target, pokemon, move);
|
||||
|
|
|
|||
|
|
@ -178,6 +178,17 @@ exports.BattleMovedex = {
|
|||
}
|
||||
}
|
||||
},
|
||||
mirrormove: {
|
||||
inherit: true,
|
||||
onHit: function (pokemon) {
|
||||
var noMirror = {metronome: 1, mimic: 1, mirrormove: 1, sketch: 1, sleeptalk: 1, transform: 1};
|
||||
var foe = pokemon.side.foe.active[0];
|
||||
if (!foe || !foe.lastMove || (!pokemon.activeTurns && !foe.moveThisTurn) || noMirror[foe.lastMove] || pokemon.moves.indexOf(foe.lastMove) !== -1) {
|
||||
return false;
|
||||
}
|
||||
this.useMove(foe.lastMove, pokemon);
|
||||
}
|
||||
},
|
||||
moonlight: {
|
||||
inherit: true,
|
||||
onHit: function (pokemon) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user