diff --git a/data/abilities.js b/data/abilities.js index 33888d271d..4ef686f26d 100644 --- a/data/abilities.js +++ b/data/abilities.js @@ -2151,7 +2151,9 @@ exports.BattleAbilities = { "rockhead": { desc: "This Pokemon does not take recoil damage besides Struggle, Life Orb, and crash damage.", shortDesc: "This Pokemon does not take recoil damage besides Struggle/Life Orb/crash damage.", - // Implemented in scripts.js + onDamage: function (damage, target, source, effect) { + if (effect.id === 'recoil' && this.activeMove.id !== 'struggle') return null; + }, id: "rockhead", name: "Rock Head", rating: 3, diff --git a/data/moves.js b/data/moves.js index 242b3be5ee..19e8c7b5b1 100644 --- a/data/moves.js +++ b/data/moves.js @@ -13486,7 +13486,7 @@ exports.BattleMovedex = { } else { this.add('-activate', target, 'Substitute', '[damage]'); } - if (move.recoil && (!source.hasAbility('rockhead') || move.id === 'struggle')) { + if (move.recoil) { this.damage(Math.round(damage * move.recoil[0] / move.recoil[1]), source, target, 'recoil'); } if (move.drain) { diff --git a/data/scripts.js b/data/scripts.js index 1088d71e44..5e4996d63b 100644 --- a/data/scripts.js +++ b/data/scripts.js @@ -314,7 +314,7 @@ exports.BattleScripts = { totalDamage = damage; } - if (move.recoil && (!pokemon.hasAbility('rockhead') || move.id === 'struggle')) { + if (move.recoil) { this.damage(this.clampIntRange(Math.round(totalDamage * move.recoil[0] / move.recoil[1]), 1), pokemon, target, 'recoil'); } diff --git a/mods/gen5/moves.js b/mods/gen5/moves.js index 7bd3d6efd3..706adafce5 100644 --- a/mods/gen5/moves.js +++ b/mods/gen5/moves.js @@ -869,7 +869,7 @@ exports.BattleMovedex = { } else { this.add('-activate', target, 'Substitute', '[damage]'); } - if (move.recoil && (!source.hasAbility('rockhead') || move.id === 'struggle')) { + if (move.recoil) { this.damage(Math.round(damage * move.recoil[0] / move.recoil[1]), source, target, 'recoil'); } if (move.drain) { diff --git a/mods/gennext/abilities.js b/mods/gennext/abilities.js index dd9ae50ec1..4c267d9b28 100644 --- a/mods/gennext/abilities.js +++ b/mods/gennext/abilities.js @@ -314,11 +314,8 @@ exports.BattleAbilities = { }, "rockhead": { inherit: true, - onModifyMove: function (move) { - delete move.recoil; - }, onDamage: function (damage, target, source, effect) { - if (effect && effect.id === 'lifeorb') return false; + if (effect && effect.id in {lifeorb: 1, recoil: 1}) return false; } }, "download": {