pokemon-showdown/data/mods/gen3colosseum/scripts.ts
EvGym 3b326cfa83
Adding Gen 3 Hoenn Stadium format (#11797)
* Adding gen 3 colosseum format, updating win check

* Update formats.ts

* Adding Gen 3 Hoenn Stadium format

* They want open team sheets on the format

* Fixing selfKO clause code for the gen3colosseum mod.
- Perish song only cares if the user is the last mon, we had that wrong.
- Corrected the game resolution code to properly calculate winners/draws (Has been tested on a dev server)

* forgot Destiny bond

* Cleaning up ban and unban lists for hoenn stadium

* Deoxys is not nonstandard

---------

Co-authored-by: Kris Johnson <11083252+KrisXV@users.noreply.github.com>
2026-03-13 19:32:36 -06:00

28 lines
710 B
TypeScript

export const Scripts: ModdedBattleScriptsData = {
inherit: 'gen3',
gen: 3,
checkWin(faintData?: Battle['faintQueue'][0]) {
if (this.sides.every(side => !side.pokemonLeft)) {
let isSelfKo = false;
if (faintData?.effect) {
isSelfKo = isSelfKo || this.dex.moves.getByID(faintData?.effect?.id).selfdestruct !== undefined;
isSelfKo = isSelfKo || this.dex.moves.getByID(faintData?.effect?.id).recoil !== undefined;
}
if (isSelfKo) {
this.win(faintData ? faintData.target.side : null);
return true;
} else {
this.win(undefined);
return true;
}
}
for (const side of this.sides) {
if (!side.foePokemonLeft()) {
this.win(side);
return true;
}
}
},
};