mirror of
https://github.com/smogon/pokemon-showdown.git
synced 2026-09-13 11:45:40 -05:00
Fix Last Respects and Supreme Overlord (#9111)
This commit is contained in:
@@ -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);
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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",
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user