export const Rulesets: {[k: string]: ModdedFormatData} = { megadatamod: { effectType: 'Rule', name: 'Mega Data Mod', desc: 'Gives data on stats, Ability and types when a Pokémon Mega Evolves or undergoes Ultra Burst.', onSwitchIn(pokemon) { if (pokemon.illusion) { if (pokemon.illusion.species.forme.startsWith('Mega') || pokemon.illusion.species.forme.startsWith('Ultra')) { this.add('-start', pokemon, 'typechange', pokemon.illusion.getTypes(true).join('/'), '[silent]'); } } else { if (pokemon.species.forme.startsWith('Mega') || pokemon.species.forme.startsWith('Ultra')) { this.add('-start', pokemon, 'typechange', pokemon.getTypes(true).join('/'), '[silent]'); } } }, onDamagingHit(damage, target, source, move) { if (target.hasAbility('illusion')) { if (target.species.forme.startsWith('Mega') || target.species.forme.startsWith('Ultra')) { this.add('-start', target, 'typechange', target.getTypes(true).join('/'), '[silent]'); } else { const types = target.baseSpecies.types; if (target.getTypes().join() === types.join()) { this.add('-end', target, 'typechange', '[silent]'); } } } }, onAfterMega(pokemon) { this.add('-start', pokemon, 'typechange', pokemon.getTypes(true).join('/'), '[silent]'); const species = this.dex.species.get(pokemon.species.name); const abilities = species.abilities; const baseStats = species.baseStats; const type = species.types[0]; if (species.types[1]) { const type2 = species.types[1]; this.add(`raw|`); } else { this.add(`raw|`); } }, }, };