Gens 1 & 2: Fix bug with substitute on <25% hp

An improper check caused damage on substitutes when the user had <=25%hp to be lowered.
This commit is contained in:
Joimer 2014-12-29 02:27:39 +01:00
parent 91f5f5f6b2
commit 1aedf0ee71
2 changed files with 2 additions and 2 deletions

View File

@ -777,7 +777,7 @@ exports.BattleScripts = {
if (damage > 1) {
damage *= this.random(217, 256);
damage = Math.floor(damage / 255);
if (damage > target.hp) damage = target.hp;
if (damage > target.hp && !target.volatiles['substitute']) damage = target.hp;
}
// We are done, this is the final damage.

View File

@ -449,7 +449,7 @@ exports.BattleScripts = {
if (damage > 1) {
damage *= this.random(217, 256);
damage = Math.floor(damage / 255);
if (damage > target.hp) damage = target.hp;
if (damage > target.hp && !target.volatiles['substitute']) damage = target.hp;
}
// If damage is less than 1, we return 1