pokemon-showdown/data/mods/scootopiav2/rulesets.ts
Yoshiblaze 7fabf3ab4b
Add New Pet Mod of the Month, Scootopia Random Battle, and Remove Previous PMOTM (#11651)
* Scootopia: Initial Commit

* Scootopia: Fix errors

* Scootopia: Fix most new errors

* one more

* Update and fix

* Avoid double bans

* more duplicate bans

* fix name credit

* Scootopia: Add Sets and proper Generation of Super Types

* Fix new errors

* fix error perchance

* perchance.

* forgot to re-fix these

* Update data/mods/scootopiav2/rulesets.ts

* Update data/mods/scootopiav2/rulesets.ts

---------

Co-authored-by: Meijer,L. (Lucas) <l.meijer6@students.uu.nl>
Co-authored-by: Kris Johnson <11083252+KrisXV@users.noreply.github.com>
2026-01-01 19:30:50 -07:00

39 lines
1.4 KiB
TypeScript

export const Rulesets: import('../../../sim/dex-formats').ModdedFormatDataTable = {
supertypemovesrule: {
effectType: 'Rule',
name: 'Super Type Moves Rule',
desc: 'Prevents pokemon from using Crystal or Feral moves unless they have a matching type.',
onBeforeMove(pokemon, target, move) {
move = {
...this.dex.moves.get(move),
hit: move.hit,
};
if (move.type === "Crystal" && !pokemon.hasType("Crystal")) return false;
if (move.type === "Feral" && !pokemon.hasType("Feral")) return false;
},
onDisableMove(pokemon) {
for (const moveSlot of pokemon.moveSlots) {
const move = this.dex.moves.get(moveSlot.id);
if ((move.type === "Crystal" && !pokemon.hasType("Crystal")) || (move.type === "Feral" && !pokemon.hasType("Feral"))) {
pokemon.disableMove(moveSlot.id, false);
}
}
},
},
spriteviewer: {
effectType: 'ValidatorRule',
name: 'Sprite Viewer',
desc: "Displays a fakemon's sprite in chat when it is switched in for the first time",
onBegin() {
this.add('rule', 'Sprite Viewer: Displays sprites in chat');
},
onSwitchIn(pokemon) {
if (!this.effectState[pokemon.species.id]) {
this.add('-message', `${pokemon.species.name}'s Sprite:`);
this.add(`raw|<img src="https://raw.githubusercontent.com/scoopapa/DH2/refs/heads/main/data/mods/scootopia/sprites/front/${pokemon.species.id}.png" height="96" width="96">`);
this.effectState[pokemon.species.id] = true;
}
},
},
};