mirror of
https://github.com/smogon/pokemon-showdown.git
synced 2026-05-09 04:23:45 -05:00
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:
parent
91f5f5f6b2
commit
1aedf0ee71
|
|
@ -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.
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user