diff --git a/config/formats.ts b/config/formats.ts index 1ef265a594..f4d5754372 100644 --- a/config/formats.ts +++ b/config/formats.ts @@ -1684,6 +1684,7 @@ export const Formats: FormatList = [ this.runEvent('BeforeFaint', pokemon, faintData.source, faintData.effect)) { this.add('faint', pokemon); pokemon.side.pokemonLeft--; + if (pokemon.side.totalFainted < 100) pokemon.side.totalFainted++; this.runEvent('Faint', pokemon, faintData.source, faintData.effect); this.singleEvent('End', pokemon.getAbility(), pokemon.abilityState, pokemon); pokemon.clearVolatile(false); diff --git a/data/abilities.ts b/data/abilities.ts index dc445d0aa2..dde22007df 100644 --- a/data/abilities.ts +++ b/data/abilities.ts @@ -4294,17 +4294,18 @@ export const Abilities: {[abilityid: string]: AbilityData} = { }, supremeoverlord: { onStart(pokemon) { - const faintedAllies = pokemon.side.pokemon.filter(ally => ally.fainted).length; - if (faintedAllies) { + if (pokemon.side.totalFainted) { this.add('-activate', pokemon, 'ability: Supreme Overlord'); + this.effectState.fallen = Math.min(pokemon.side.totalFainted, 5); } }, - onBasePower(basePower, source, target, move) { - const faintedAllies = Math.min(5, source.side.pokemon.filter(ally => ally.fainted).length); - if (faintedAllies) return this.chainModify(1 + (0.1 * faintedAllies)); - }, - onAllyFaint() { - this.add('-activate', this.effectState.target, 'ability: Supreme Overlord'); + onBasePowerPriority: 21, + onBasePower(basePower, attacker, defender, move) { + if (this.effectState.fallen) { + const powMod = [4096, 4506, 4915, 5325, 5734, 6144]; + this.debug(`Supreme Overlord boost: ${powMod[this.effectState.fallen]}/4096`); + return this.chainModify([powMod[this.effectState.fallen], 4096]); + } }, name: "Supreme Overlord", rating: 3.5, diff --git a/data/mods/gen2stadium2/scripts.ts b/data/mods/gen2stadium2/scripts.ts index d7899b470c..041f2b599c 100644 --- a/data/mods/gen2stadium2/scripts.ts +++ b/data/mods/gen2stadium2/scripts.ts @@ -530,6 +530,7 @@ export const Scripts: ModdedBattleScriptsData = { this.runEvent('BeforeFaint', pokemon, faintData.source, faintData.effect)) { this.add('faint', pokemon); pokemon.side.pokemonLeft--; + if (pokemon.side.totalFainted < 100) pokemon.side.totalFainted++; this.runEvent('Faint', pokemon, faintData.source, faintData.effect); this.singleEvent('End', pokemon.getAbility(), pokemon.abilityState, pokemon); pokemon.clearVolatile(false); diff --git a/data/moves.ts b/data/moves.ts index f07004def5..99e6727950 100644 --- a/data/moves.ts +++ b/data/moves.ts @@ -10194,7 +10194,7 @@ export const Moves: {[moveid: string]: MoveData} = { accuracy: 100, basePower: 50, basePowerCallback(pokemon, target, move) { - return 50 + 50 * pokemon.side.pokemon.filter(ally => ally.fainted).length; + return 50 + 50 * pokemon.side.totalFainted; }, category: "Physical", name: "Last Respects", diff --git a/sim/battle.ts b/sim/battle.ts index 4a3129543c..2476c5f1a1 100644 --- a/sim/battle.ts +++ b/sim/battle.ts @@ -2307,6 +2307,7 @@ export class Battle { this.runEvent('BeforeFaint', pokemon, faintData.source, faintData.effect)) { this.add('faint', pokemon); if (pokemon.side.pokemonLeft) pokemon.side.pokemonLeft--; + if (pokemon.side.totalFainted < 100) pokemon.side.totalFainted++; this.runEvent('Faint', pokemon, faintData.source, faintData.effect); this.singleEvent('End', pokemon.getAbility(), pokemon.abilityState, pokemon); pokemon.clearVolatile(false); diff --git a/sim/side.ts b/sim/side.ts index 399486d1ba..b47e299295 100644 --- a/sim/side.ts +++ b/sim/side.ts @@ -84,6 +84,7 @@ export class Side { faintedLastTurn: Pokemon | null; faintedThisTurn: Pokemon | null; + totalFainted: number; /** only used by Gen 1 Counter */ lastSelectedMove: ID = ''; @@ -134,6 +135,7 @@ export class Side { this.pokemonLeft = this.pokemon.length; this.faintedLastTurn = null; this.faintedThisTurn = null; + this.totalFainted = 0; this.zMoveUsed = false; this.dynamaxUsed = this.battle.gen !== 8;