Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- {
- name: "Mix and Mega",
- desc: ["• <a href=\"https://www.smogon.com/forums/threads/3540979/\">Mix and Mega</a>"],
- section: 'Other Metagames',
- mod: 'mixandmega',
- ruleset: ['Ubers', 'Baton Pass Clause'],
- banlist: ['Gengarite', 'Shadow Tag', 'Dynamic Punch', 'Zap Cannon'],
- onValidateTeam: function (team, format) {
- var itemTable = {};
- for (var i = 0; i < team.length; i++) {
- var item = this.getItem(team[i].item);
- if (!item) continue;
- if (itemTable[item] && item.megaStone) return ["You are limited to one of each Mega Stone.", "(You have more than one " + this.getItem(item).name + ")"];
- if (itemTable[item] && (item.id === 'redorb' || item.id === 'blueorb')) return ["You are limited to one of each Primal Orb.", "(You have more than one " + this.getItem(item).name + ")"];
- itemTable[item] = true;
- }
- },
- onValidateSet: function (set) {
- var template = this.getTemplate(set.species || set.name);
- var item = this.getItem(set.item);
- if (!item.megaEvolves && item.id !== 'blueorb' && item.id !== 'redorb') return;
- if (template.baseSpecies === item.megaEvolves || (item.id === 'redorb' && template.baseSpecies === 'Groudon') || (item.id === 'blueorb' && template.baseSpecies === 'Kyogre')) return;
- if (template.evos.length) return ["" + template.species + " no puede portar " + item.name + " ya que no está completamente evolucionado."];
- if (template.tier === 'Uber') return ["" + template.species + " no puede portar " + item.name + " ya que es Uber."];
- if (template.species === 'Shuckle' && ['abomasite', 'aggronite', 'audinite', 'cameruptite', 'charizarditex', 'charizarditey', 'galladite', 'gyaradosite', 'heracronite', 'houndoominite', 'latiasite', 'mewtwonitey', 'sablenite', 'salamencite', 'scizorite', 'sharpedonite', 'slowbronite', 'steelixite', 'tyranitarite', 'venusaurite'].indexOf(item.id) >= 0) {
- return ["" + template.species + " no puede portar " + item.name + "."];
- }
- var bannedMons = {'Cresselia':1, 'Dragonite':1, 'Kyurem-Black':1, 'Lucario':1, 'Slaking':1, 'Smeargle':1, 'Regigigas':1};
- if (template.species in bannedMons) {
- return ["" + template.species + " is not allowed to hold a Mega Stone."];
- }
- if (item.id === 'beedrillite' || item.id === 'kangaskhanite') {
- return ["" + item.name + " can only allowed be held by " + item.megaEvolves + "."];
- }
- switch (item.id) {
- case 'blazikenite':
- if (set.ability !== 'Speed Boost') return ["" + template.species + " is not allowed to hold " + item.name + "."];
- break;
- case 'mawilite': case 'medichamite':
- var powerAbilities = {'Huge Power':1, 'Pure Power':1};
- if (powerAbilities.hasOwnProperty(set.ability)) break;
- if (!template.otherFormes) return ["" + template.species + " is not allowed to hold " + item.name + "."];
- var allowedPower = false;
- for (var i = 0; i < template.otherFormes.length; i++) {
- var altTemplate = this.getTemplate(template.otherFormes[i]);
- if ((altTemplate.isMega || altTemplate.isPrimal) && powerAbilities.hasOwnProperty(altTemplate.abilities['0'])) {
- allowedPower = true;
- break;
- }
- }
- if (!allowedPower) return ["" + template.species + " is not allowed to hold " + item.name + "."];
- break;
- case 'slowbronite':
- if (template.species === 'Regirock' || template.species === 'Steelix') return ["" + template.species + " is not allowed to hold " + item.name + "."];
- break;
- case 'mewtwonitey':
- if (template.baseStats.def <= 20) return ["" + template.species + " does not have enough Defense to hold " + item.name + "."];
- break;
- case 'diancite':
- if (template.baseStats.def <= 40 || template.baseStats.spd <= 40) return ["" + template.species + " no tiene suficiente Defensa o Defensa Especial para portar " + item.name + "."];
- break;
- case 'ampharosite': case 'garchompite': case 'heracronite':
- if (template.baseStats.spe <= 10) return ["" + template.species + " does not have enough Speed to hold " + item.name + "."];
- break;
- case 'cameruptite':
- if (template.baseStats.spe <= 20) return ["" + template.species + " does not have enough Speed to hold " + item.name + "."];
- break;
- case 'abomasite': case 'sablenite':
- if (template.baseStats.spe <= 30) return ["" + template.species + " does not have enough Speed to hold " + item.name + "."];
- break;
- }
- },
- onBegin: function () {
- var allPokemon = this.p1.pokemon.concat(this.p2.pokemon);
- for (var i = 0, len = allPokemon.length; i < len; i++) {
- var pokemon = allPokemon[i];
- pokemon.originalSpecies = pokemon.baseTemplate.species;
- }
- },
- onSwitchInPriority: -6,
- onSwitchIn: function (pokemon) {
- var item = pokemon.getItem();
- if (pokemon.isActive && !pokemon.template.isMega && !pokemon.template.isPrimal && (item.id === 'redorb' || item.id === 'blueorb') && pokemon.baseTemplate.tier !== 'Uber' && !pokemon.template.evos.length) {
- // Primal Reversion
- var bannedMons = {'Cresselia':1, 'Dragonite':1, 'Kyurem-Black':1, 'Lucario':1, 'Regigigas':1, 'Slaking':1, 'Smeargle':1};
- if (!(pokemon.baseTemplate.baseSpecies in bannedMons)) {
- var template = this.getMixedTemplate(pokemon.originalSpecies, item.id === 'redorb' ? 'Groudon-Primal' : 'Kyogre-Primal');
- pokemon.formeChange(template);
- pokemon.baseTemplate = template;
- // Do we have a proper sprite for it?
- if (pokemon.originalSpecies === (item.id === 'redorb' ? 'Groudon' : 'Kyogre')) {
- pokemon.details = template.species + (pokemon.level === 100 ? '' : ', L' + pokemon.level) + (pokemon.gender === '' ? '' : ', ' + pokemon.gender) + (pokemon.set.shiny ? ', shiny' : '');
- this.add('detailschange', pokemon, pokemon.details);
- } else {
- var oTemplate = this.getTemplate(pokemon.originalSpecies);
- this.add('-formechange', pokemon, oTemplate.species, template.requiredItem);
- this.add('-start', pokemon, this.getTemplate(template.originalMega).requiredItem, '[silent]');
- if (oTemplate.types.length !== pokemon.template.types.length || oTemplate.types[1] !== pokemon.template.types[1]) {
- this.add('-start', pokemon, 'typechange', pokemon.template.types.join('/'), '[silent]');
- }
- }
- this.add('message', pokemon.name + "'s " + pokemon.getItem().name + " se activó!");
- this.add('message', pokemon.name + " volvió a su Forma Primigenia!");
- pokemon.setAbility(template.abilities['0']);
- pokemon.baseAbility = pokemon.ability;
- pokemon.canMegaEvo = false;
- }
- } else {
- var oMegaTemplate = this.getTemplate(pokemon.template.originalMega);
- if (oMegaTemplate.exists && pokemon.originalSpecies !== oMegaTemplate.baseSpecies) {
- // Place volatiles on the Pokémon to show its mega-evolved condition and details
- this.add('-start', pokemon, oMegaTemplate.requiredItem || oMegaTemplate.requiredMove, '[silent]');
- var oTemplate = this.getTemplate(pokemon.originalSpecies);
- if (oTemplate.types.length !== pokemon.template.types.length || oTemplate.types[1] !== pokemon.template.types[1]) {
- this.add('-start', pokemon, 'typechange', pokemon.template.types.join('/'), '[silent]');
- }
- }
- }
- },
- onSwitchOut: function (pokemon) {
- var oMegaTemplate = this.getTemplate(pokemon.template.originalMega);
- if (oMegaTemplate.exists && pokemon.originalSpecies !== oMegaTemplate.baseSpecies) {
- this.add('-end', pokemon, oMegaTemplate.requiredItem || oMegaTemplate.requiredMove, '[silent]');
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement