From 50b0b98c1e731495c8213339e710e5745b5fa69d Mon Sep 17 00:00:00 2001 From: NickMP Date: Sat, 14 Jun 2014 04:25:30 -0400 Subject: [PATCH] NEXT: Fix Substitute/Skull Bash Update Substitute to be bypassed by sound moves. Update Skull Bash to fix a bug involving Defense being raised by 1 stage too many. --- mods/gennext/moves.js | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/mods/gennext/moves.js b/mods/gennext/moves.js index f92789d30b..99960785f6 100644 --- a/mods/gennext/moves.js +++ b/mods/gennext/moves.js @@ -145,7 +145,7 @@ exports.BattleMovedex = { return; } if (move.category === 'Status') { - if (move.notSubBlocked) { + if (move.notSubBlocked || move.isSoundBased) { return; } var SubBlocked = { @@ -290,12 +290,19 @@ exports.BattleMovedex = { onTryHit: function (target) { target.removeVolatile('substitute'); }, - effect: { - duration: 2, - onLockMove: 'skullbash', - onStart: function (pokemon) { - this.boost({def:1, spd:1, accuracy:1}, pokemon, pokemon, this.getMove('skullbash')); + onTry: function (attacker, defender, move) { + if (attacker.removeVolatile(move.id)) { + return; } + this.add('-prepare', attacker, move.name, defender); + if (!this.runEvent('ChargeMove', attacker, defender, move)) { + this.add('-anim', attacker, move.name, defender); + attacker.removeVolatile(move.id); + return; + } + attacker.addVolatile('twoturnmove', defender); + this.boost({def:1, spd:1, accuracy:1}, attacker, attacker, this.getMove('skullbash')); + return null; }, breaksProtect: true },