Skip to content

Commit

Permalink
Gen II: Fix critical hit interaction with screens
Browse files Browse the repository at this point in the history
  • Loading branch information
Marty-D committed Feb 16, 2016
1 parent 6775515 commit afe31af
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions mods/gen2/scripts.js
Expand Up @@ -44,8 +44,10 @@ exports.BattleScripts = {
stat = this.battle.clampIntRange(stat, 1, 999);

// Screens
if ((this.side.sideConditions['reflect'] && statName === 'def') || (this.side.sideConditions['lightscreen'] && statName === 'spd')) {
stat *= 2;
if (!unboosted) {
if ((this.side.sideConditions['reflect'] && statName === 'def') || (this.side.sideConditions['lightscreen'] && statName === 'spd')) {
stat *= 2;
}
}

// Treat here the items.
Expand Down Expand Up @@ -381,8 +383,6 @@ exports.BattleScripts = {
// Level is doubled for damage calculation.
level *= 2;
if (!suppressMessages) this.add('-crit', target);
// If the attacker is burned, stat level modifications are always ignored. This includes screens.
if (attacker.status === 'brn') unboosted = true;
// Stat level modifications are ignored if they are neutral to or favour the defender.
// Reflect and Light Screen defensive boosts are only ignored if stat level modifications were also ignored as a result of that.
if (attacker.boosts[atkType] <= defender.boosts[defType]) {
Expand Down

0 comments on commit afe31af

Please sign in to comment.