pokemon-showdown/mods/gennext/statuses.js
Guangcong Luo b8aa7ab3f6 NEXT: lots of changes
(as usual, see the diff of GEN-NEXT.md for details)
2012-08-29 02:28:41 -07:00

33 lines
928 B
JavaScript

exports.BattleStatuses = {
lockedmove: {
// Outrage, Thrash, Petal Dance...
durationCallback: function() {
return this.random(2,4);
},
onResidual: function(target) {
var move = this.getMove(target.lastMove);
if (!move.self || move.self.volatileStatus !== 'lockedmove') {
// don't lock, and bypass confusion for calming
delete target.volatiles['lockedmove'];
} else if (target.ability === 'owntempo') {
// Own Tempo prevents locking
delete target.volatiles['lockedmove'];
}
},
onEnd: function(target) {
this.add('-end', target, 'rampage');
target.addVolatile('confusion');
},
onLockMove: function(pokemon) {
return pokemon.lastMove;
},
onBeforeTurn: function(pokemon) {
var move = this.getMove(pokemon.lastMove);
if (pokemon.lastMove) {
this.debug('Forcing into '+pokemon.lastMove);
this.changeDecision(pokemon, {move: pokemon.lastMove});
}
}
}
};