General Thread for OM Code

Pikachuun

the entire waruda machine
config/formats.js
Code:
{
        name: "Retaliation",
        section: "Other Metagames",

        ruleset: ['Pokemon', 'Standard', 'Team Preview', 'Swagger Clause', 'Baton Pass Clause'],
        banlist: ['Uber', 'Soul Dew', 'Gengarite', 'Kangaskhanite', 'Lucarionite', 'Mawilite'],
        onModifyMove: function (basePower, pokemon, move) {
            if (move.id === 'retaliate') {
                return;
            } else if (move && pokemon.side.faintedLastTurn) {
                this.debug('Boosted for a faint last turn');
                move.basePower = move.basePower*2;
            }
        },
    },
config/formats.js
Code:
    {
        name: "Playstyle Reversal",
        section: "Other Metagames",

        ruleset: ['Pokemon', 'Standard', 'Team Preview', 'Swagger Clause', 'Baton Pass Clause'],
        banlist: ['Uber', 'Soul Dew', 'Gengarite', 'Kangaskhanite', 'Lucarionite', 'Mawilite'],
        onModifyMove: function (move) {
            if (move && move.self) {
                if (move.category === "Status") {
                    move.onHit = function(source) {
                        return this.boost({atk: 1, spa: 1, def: -1, spd: -1});
                    }
                } else {
                    move.onHit = function(attacker, defender) {
                        return this.boost({atk: -1, spa: -1, def: 1, spd: 1}, defender, attacker);
                    }
                }
            } else if (move && move.category === "Status") {
                if (move.target === "self" && move.boosts) {
                    move.self = {boosts: {atk: -1, spa: -1, def: 1, spd: 1}};
                } else {
                    move.self = {boosts: {atk: 1, spa: 1, def: -1, spd: -1}};
                }
            } else if (move) {
                move.self = {boosts: {atk: -1, spa: -1, def: 1, spd: 1}};
            }
        }
    },
config/formats.js
Code:
    {
        name: "Reliablemons",
        section: "Other Metagames",

        ruleset: ['Pokemon', 'Standard', 'Team Preview'],
        banlist: ['Uber', 'Soul Dew', 'Gengarite', 'Kangaskhanite', 'Lucarionite'],
        onModifyMove: function(move, pokemon) {
            var moves = pokemon.moves;
            if (move.id === moves[0]) {
                var cheese = 0;
                var crackers = true;
            } else if (move.id === moves[1] && pokemon.typesData[1]) {
                var cheese = 1;
                var crackers = true;
            } else {
                var crackers = false;
            }
            if (crackers) {
                move.type = pokemon.typesData[cheese].type;
            }
        }
    },
Thanks to 00001111a for getting this started! I just fixed an error.
config/formats.js
Code:
    {
        name: "No Legends pls",
        section: "Other Metagames",

        ruleset: ['Pokemon', 'Standard', 'Team Preview', 'Swagger Clause', 'Baton Pass Clause'],
        banlist: ['Uber', 'Gengarite', 'Kangaskhanite', 'Lucarionite', 'Mawilite', 'Articuno', 'Zapdos', 'Moltres', 'Mew', 'Entei', 'Suicune', 'Raikou', 'Celebi', 'Regirock', 'Regice', 'Registeel', 'Latios', 'Latias', 'Jirachi', 'Azelf', 'Mesprit', 'Uxie', 'Manaphy', 'Phione', 'Heatran', 'Regigigas', 'Shaymin', 'Victini', 'Cobalion', 'Terrakion', 'Virizion', 'Keldeo', 'Tornadus', 'Tornadus-Therian', 'Thundurus', 'Thundurus-Therian', 'Landorus', 'Landorus-Therian', 'Kyurem', 'Kyurem-Black', 'Meloetta', 'Zygarde']
    },
config/formats.js
Code:
    {
        name: "Balanced Hackmons Challenge Cup",
        section: 'Other Metagames',

        team: 'randomCCBH',
        searchShow: false,
        ruleset: ['Pokemon', 'HP Percentage Mod']
    },
data/scripts.js
Code:
    randomCCBHTeam: function (side) {
        var teamdexno = [];
        var team = [];

        //pick six random pokmeon--no repeats, even among formes
        //also need to either normalize for formes or select formes at random
        //unreleased are okay. No CAP for now, but maybe at some later date
        for (var i = 0; i < 6; i++)
        {
            while (true) {
                var x = Math.floor(Math.random() * 718) + 1;
                teamdexno.push(x);
                break;
            }
        }

        for (var i = 0; i < 6; i++) {

            //choose forme
            var formes = [];
            for (var j in this.data.Pokedex) {
                if (this.data.Pokedex[j].num === teamdexno[i] && this.data.Pokedex[j].species !== 'Pichu-Spiky-eared') {
                    formes.push(this.data.Pokedex[j].species);
                }
            }
            var poke = formes.sample();
            var template = this.getTemplate(poke);

            //level balance--calculate directly from stats rather than using some silly lookup table
            var mbstmin = 1307; //sunkern has the lowest modified base stat total, and that total is 807

            var stats = template.baseStats;

            //modified base stat total assumes 31 IVs, 85 EVs in every stat
            var mbst = (stats["hp"] * 2 + 31 + 21 + 100) + 10;
            mbst += (stats["atk"] * 2 + 31 + 21 + 100) + 5;
            mbst += (stats["def"] * 2 + 31 + 21 + 100) + 5;
            mbst += (stats["spa"] * 2 + 31 + 21 + 100) + 5;
            mbst += (stats["spd"] * 2 + 31 + 21 + 100) + 5;
            mbst += (stats["spe"] * 2 + 31 + 21 + 100) + 5;

            var level = Math.floor(100 * mbstmin/mbst); //initial level guess will underestimate

            while (level < 100) {
                mbst = Math.floor((stats["hp"] * 2 + 31 + 21 + 100) * level / 100 + 10);
                mbst += Math.floor(((stats["atk"] * 2 + 31 + 21 + 100) * level / 100 + 5) * level / 100); //since damage is roughly proportional to lvl
                mbst += Math.floor((stats["def"] * 2 + 31 + 21 + 100) * level / 100 + 5);
                mbst += Math.floor(((stats["spa"] * 2 + 31 + 21 + 100) * level / 100 + 5) * level / 100);
                mbst += Math.floor((stats["spd"] * 2 + 31 + 21 + 100) * level / 100 + 5);
                mbst += Math.floor((stats["spe"] * 2 + 31 + 21 + 100) * level/100 + 5);

                if (mbst >= mbstmin)
                    break;
                level++;
            }


            //random gender--already handled by PS?

            //random ability (unreleased hidden are par for the course)
            var abilities = Object.keys(this.data.Abilities).exclude('arenatrap', 'hugepower', 'mountaineer', 'parentalbond', 'persistent', 'purepower', 'rebound', 'shadowtag', 'wonderguard');
            var ability = abilities.sample();

            //random nature
            var nature = ["Adamant", "Bashful", "Bold", "Brave", "Calm", "Careful", "Docile", "Gentle", "Hardy", "Hasty", "Impish", "Jolly", "Lax", "Lonely", "Mild", "Modest", "Naive", "Naughty", "Quiet", "Quirky", "Rash", "Relaxed", "Sassy", "Serious", "Timid"].sample();

            //random item--I guess if it's in items.js, it's okay
            var item = Object.keys(this.data.Items).sample();



            //random IVs
            var ivs = {
                hp: Math.floor(Math.random() * 32),
                atk: Math.floor(Math.random() * 32),
                def: Math.floor(Math.random() * 32),
                spa: Math.floor(Math.random() * 32),
                spd: Math.floor(Math.random() * 32),
                spe: Math.floor(Math.random() * 32)
            };

            //random EVs
            var evs = {
                hp: 0,
                atk: 0,
                def: 0,
                spa: 0,
                spd: 0,
                spe: 0
            };
            var s = ["hp", "atk", "def", "spa", "spd", "spe"];
            var evpool = 510;
            do
            {
                var x = s.sample();
                var y = Math.floor(Math.random() * Math.min(256 - evs[x], evpool + 1));
                evs[x] += y;
                evpool -= y;
            } while (evpool > 0);

            //random happiness--useless, since return/frustration is currently a "cheat"
            var happiness = Math.floor(Math.random() * 256);

            //random shininess?
            var shiny = (Math.random() * 1024 <= 1);

            //four random unique moves from movepool. don't worry about "attacking" or "viable"
            var moves;
            var pool = Object.keys(this.data.Movedex).exclude('fissure', 'guillotine', 'horndrill', 'magikarpsrevenge', 'paleowave', 'shadowstrike', 'sheercold', 'minimize', 'doubleteam');
            moves = pool.sample(4);

            team.push({
                name: poke,
                moves: moves,
                ability: ability,
                evs: evs,
                ivs: ivs,
                nature: nature,
                item: item,
                level: level,
                happiness: happiness,
                shiny: shiny
            });
        }

        //console.log(team);
        return team;
    },
I did this one for fun. Nobody requested it, but I thought I'd share it anyway FOR SOME REASON
config/formats.js
Code:
    {
        name: "Priority Cup",
        section: "Other Metagames",
     
        mod: 'prioritycup',
        ruleset: ['Pokemon', 'Standard', 'Team Preview', 'Swagger Clause', 'Baton Pass Clause'],
        banlist: ['Uber', 'Soul Dew', 'Gengarite', 'Kangaskhanite', 'Lucarionite']
    },
mods/prioritycup/scripts.js
Code:
exports.BattleScripts = {
    init: function() {
        for (var i in this.data.Movedex) {
            var move = this.data.Movedex[i];
            var basePower = move.basePower;
            var priority = move.priority;
            var category = move.category;
            if (basePower <= 40 && priority === 0 && category !== "Status" && !move.basePowerCallback) {
                this.modData('Movedex', i).priority = 1;
            }
        }
    }
}
 
Last edited:
I made this in a couple minutes for bam.psim.us and figured I may as well post it here:

Pre EV Limit BH
Code:
    {
          name: "Pre-EV Limit Balanced Hackmons",
          section: "Other Metagames",
          ruleset: ['Ability Clause', 'OHKO Clause', 'Evasion Moves Clause', 'Team Preview', 'HP Percentage Mod'],
          banlist: ['Arena Trap', 'Huge Power', 'Parental Bond', 'Pure Power', 'Shadow Tag', 'Wonder Guard'],
          validateSet: function (set) {
              var template = this.getTemplate(set.species);
              var item = this.getItem(set.item);
              var problems = [];
              if (set.species === set.name) delete set.name;
              if (template.isNonstandard) {
                  problems.push(set.species + ' is not a real Pokemon.');
              }
              if (item.isNonstandard) {
                  problems.push(item.name + ' is not a real item.');
              }
              var ability = {};
            if (set.ability) ability = this.getAbility(set.ability);
              if (ability.isNonstandard) {
                problems.push(ability.name + ' is not a real ability.');
              }
              if (set.moves) {
                  for (var i = 0; i < set.moves.length; i++) {
                  var move = this.getMove(set.moves[i]);
                  if (move.isNonstandard) {
                      problems.push(move.name + ' is not a real move.');
                    }
                  }
                  if (set.moves.length > 4) {
                  problems.push((set.name || set.species) + ' has more than four moves.');
                  }
              }
              if (set.level && set.level > 100) {
                  problems.push((set.name || set.species) + ' is higher than level 100.');
              }
            return problems;
          }
    }

Basically balanced hackmons before the 510 EV limit was imposed.

Also, I'm working on hosting all of these on my server.

Edit: My code wasn't working, but I fixed it. Edited the above.
 
Last edited:

Snaquaza

KACAW
is a Community Contributor Alumnusis a Smogon Media Contributor Alumnusis a Battle Simulator Moderator Alumnus
There seems to be an error in the Immunimons code.
Other than that, Immunimons is now playable (possibly with a bug but w/e) at: http://84.85.13.2.psim.us/

00001111a
offler joined.
Snaquaza joined.
Format:
Immunimons
Sleep Clause Mod: Limit one foe put to sleep
Species Clause: Limit one of each Pokémon
OHKO Clause: OHKO moves are banned
Moody Clause: Moody is banned
Evasion Moves Clause: Evasion moves are banned
Endless Battle Clause: Forcing endless battles is banned
HP Percentage Mod: HP is shown in percentages
Swagger Clause: Swagger is banned
Baton Pass Clause: Limit one Pokémon knowing Baton Pass
Snaquaza's team:Emboar / Azumarill / Absol / Tangrowth / Salamence / Heatran
offler's team:Doublade / Clawitzer / Rotom-Mow / Alomomola / Amoonguss / Tyrantrum
★Snaquaza: gl hf
★offler: u2 :3
★Snaquaza: btw took a random Stat Switch team
★Snaquaza: so this is really gimmicky
★offler: i took an RU team qq
★offler: xp
★Snaquaza: lel
★Snaquaza: is this coded anywhere yet?
★Snaquaza: besdies here?
Battle between offler and Snaquaza started!

offler sent out Rotom-Mow!

Go! Salamence!
Salamence intimidates the opposing Rotom-Mow!
The opposing Rotom-Mow's Attack fell!
Turn 1
★offler: no :>
★Snaquaza: yay
★Snaquaza: then I'll put it in the thread

The opposing Rotom-Mow used Trick!
The opposing Rotom-Mow switched items with its target!
Salamence obtained one Choice Scarf.
The opposing Rotom-Mow obtained one Leftovers.

Salamence used Dragon Pulse!
The opposing Rotom-Mow lost 43% of its health!

The opposing Rotom-Mow restored a little HP using its Leftovers!
Turn 2
★offler: nicu

Salamence used Dragon Pulse!
The opposing Rotom-Mow lost 44% of its health!

The opposing Rotom-Mow used Will-O-Wisp!
Salamence avoided the attack!

The opposing Rotom-Mow restored a little HP using its Leftovers!
Turn 3

offler withdrew Rotom-Mow!

offler sent out Amoonguss!

Salamence used Dragon Pulse!
The opposing Amoonguss lost 21% of its health!

The opposing Amoonguss restored HP using its Black Sludge!
Turn 4
★Snaquaza: trick scarf seems good in immunimons
★offler: y
★offler: o shit
★offler: i forgot
★offler: i couldve gone into rant

Salamence used Dragon Pulse!
The opposing Amoonguss lost 23% of its health!

The opposing Amoonguss used Sludge Bomb!
Salamence lost 23.1% of its health!

The opposing Amoonguss restored HP using its Black Sludge!
Turn 5

Salamence, come back!

Go! Heatran!

The opposing Amoonguss used Spore!
Heatran fell asleep!

The opposing Amoonguss restored HP using its Black Sludge!
Turn 6
★Snaquaza: rip

offler withdrew Amoonguss!

offler sent out Tyrantrum!

Heatran is fast asleep.
Turn 7
★offler: rip

Heatran, come back!

Go! Tangrowth!

The opposing Tyrantrum used Dragon Dance!
The opposing Tyrantrum's Attack rose!
The opposing Tyrantrum's Speed rose!
Turn 8

The opposing Tyrantrum used Fire Fang!
It's super effective! Tangrowth lost 78.2% of its health!

Tangrowth used Focus Blast!
A critical hit! It's super effective! The opposing Tyrantrum hung on using its Focus Sash!
The opposing Tyrantrum lost 99% of its health!
Turn 9

The opposing Tyrantrum used Ice Fang!
It's super effective! Tangrowth lost 21.8% of its health!

Tangrowth fainted!

Go! Emboar!
Turn 10

offler withdrew Tyrantrum!

offler sent out Alomomola!

Emboar used Fire Blast!
It's not very effective... The opposing Alomomola lost 30% of its health!
Turn 11

The opposing Alomomola used Wish!

Emboar used Sunny Day!
The sunlight turned harsh!
Turn 12

The opposing Alomomola used Pain Split!
The battlers shared their pain!

Emboar used SolarBeam!
Emboar absorbed light!
It's super effective! The opposing Alomomola lost 75% of its health!

The opposing Alomomola fainted!

Emboar restored a little HP using its Leftovers!
★offler: oh my
★Snaquaza: !data emboar
  • RUEmboar
    BlazeRecklessHP
    110Atk
    123Def
    65SpA
    100SpD
    65Spe
    65BST
    528

offler sent out Rotom-Mow!
Turn 13
★offler: im so screwed
★offler: xD
★Snaquaza: In Stat Switch it is 110/65/123/100/123/123
★offler: op

The opposing Rotom-Mow used Thunderbolt!
Emboar lost 46.2% of its health!

Emboar used Fire Blast!
It's super effective! The opposing Rotom-Mow lost 25% of its health!

The opposing Rotom-Mow fainted!

Emboar restored a little HP using its Leftovers!

offler sent out Tyrantrum!
Turn 14
The battle crashed
You can keep playing but it might crash again.
★Snaquaza: wat
★offler: O_O
★Snaquaza: I'll see what's wrong
★offler: k
Turn 15
★Snaquaza: oh the battle doesn't continue
The battle crashed
You can keep playing but it might crash again.
★offler: oh dear
★offler: we broke it
★Snaquaza: nah the coder did
★offler: o
★offler hurt coder
★offler: bad

Tie between offler and Snaquaza!
★offler: !

|gametype|singles

|gen|6

|tier|Immunimons

|rule|Sleep Clause Mod: Limit one foe put to sleep

|rule|Species Clause: Limit one of each Pokémon

|rule|OHKO Clause: OHKO moves are banned

|rule|Moody Clause: Moody is banned

|rule|Evasion Moves Clause: Evasion moves are banned

|rule|Endless Battle Clause: Forcing endless battles is banned

|rule|HP Percentage Mod: HP is shown in percentages

|clearpoke

|poke|p1|Doublade, M

|poke|p1|Clawitzer, M

|poke|p1|Rotom-Mow

|poke|p1|Alomomola, F

|poke|p1|Amoonguss, M

|poke|p1|Tyrantrum, F

|poke|p2|Emboar, M

|poke|p2|Azumarill, M

|poke|p2|Absol, F

|poke|p2|Tangrowth, F

|poke|p2|Salamence, F

|poke|p2|Heatran, M

|rule|Swagger Clause: Swagger is banned

|rule|Baton Pass Clause: Limit one Pokémon knowing Baton Pass

|teampreview

|

|start

|switch|p1a: Rotom-Mow|Rotom-Mow|241/241

|switch|p2a: Salamence|Salamence, F|394/394

|-ability|p2a: Salamence|Intimidate|[of] p1a: Rotom-Mow

|-unboost|p1a: Rotom-Mow|atk|1

|turn|1

|

|move|p1a: Rotom-Mow|Trick|p2a: Salamence

|-activate|p1a: Rotom-Mow|move: Trick|[of] p2a: Salamence

|-item|p2a: Salamence|Choice Scarf|[from] move: Trick

|-item|p1a: Rotom-Mow|Leftovers|[from] move: Trick

|move|p2a: Salamence|Dragon Pulse|p1a: Rotom-Mow

|-damage|p1a: Rotom-Mow|135/241

|

|-heal|p1a: Rotom-Mow|150/241|[from] item: Leftovers

|turn|2

|

|move|p2a: Salamence|Dragon Pulse|p1a: Rotom-Mow

|-damage|p1a: Rotom-Mow|45/241

|move|p1a: Rotom-Mow|Will-O-Wisp|p2a: Salamence|[miss]

|-miss|p1a: Rotom-Mow|p2a: Salamence

|

|-heal|p1a: Rotom-Mow|60/241|[from] item: Leftovers

|turn|3

|

|switch|p1a: Amoonguss|Amoonguss, M|432/432

|move|p2a: Salamence|Dragon Pulse|p1a: Amoonguss

|-damage|p1a: Amoonguss|341/432

|

|-heal|p1a: Amoonguss|368/432|[from] item: Black Sludge

|turn|4

|

|move|p2a: Salamence|Dragon Pulse|p1a: Amoonguss

|-damage|p1a: Amoonguss|268/432

|move|p1a: Amoonguss|Sludge Bomb|p2a: Salamence

|-damage|p2a: Salamence|303/394

|

|-heal|p1a: Amoonguss|295/432|[from] item: Black Sludge

|turn|5

|

|switch|p2a: Heatran|Heatran, M|386/386

|move|p1a: Amoonguss|Spore|p2a: Heatran

|-status|p2a: Heatran|slp

|

|-heal|p1a: Amoonguss|322/432|[from] item: Black Sludge

|turn|6

|

|switch|p1a: Tyrantrum|Tyrantrum, F|306/306

|cant|p2a: Heatran|slp

|

|turn|7

|

|switch|p2a: Tangrowth|Tangrowth, F|404/404

|move|p1a: Tyrantrum|Dragon Dance|p1a: Tyrantrum

|-boost|p1a: Tyrantrum|atk|1

|-boost|p1a: Tyrantrum|spe|1

|

|turn|8

|

|move|p1a: Tyrantrum|Fire Fang|p2a: Tangrowth

|-supereffective|p2a: Tangrowth

|-damage|p2a: Tangrowth|88/404

|move|p2a: Tangrowth|Focus Blast|p1a: Tyrantrum

|-crit|p1a: Tyrantrum

|-supereffective|p1a: Tyrantrum

|-enditem|p1a: Tyrantrum|Focus Sash

|-damage|p1a: Tyrantrum|1/306

|

|turn|9

|

|move|p1a: Tyrantrum|Ice Fang|p2a: Tangrowth

|-supereffective|p2a: Tangrowth

|-damage|p2a: Tangrowth|0 fnt

|faint|p2a: Tangrowth

|

|

|switch|p2a: Emboar|Emboar, M|424/424

|turn|10

|

|switch|p1a: Alomomola|Alomomola, F|534/534

|move|p2a: Emboar|Fire Blast|p1a: Alomomola

|-resisted|p1a: Alomomola

|-damage|p1a: Alomomola|369/534

|

|turn|11

|

|move|p1a: Alomomola|Wish|p1a: Alomomola

|move|p2a: Emboar|Sunny Day|p2a: Emboar

|-weather|SunnyDay

|

|-weather|SunnyDay|[upkeep]

|turn|12

|

|move|p1a: Alomomola|Pain Split|p2a: Emboar

|-sethp|p2a: Emboar|396/424|p1a: Alomomola|396/534|[from] move: Pain Split

|move|p2a: Emboar|Solar Beam|p1a: Alomomola|[still]

|-prepare|p2a: Emboar|Solar Beam|p1a: Alomomola

|-anim|p2a: Emboar|Solar Beam|p1a: Alomomola

|-supereffective|p1a: Alomomola

|-damage|p1a: Alomomola|0 fnt

|faint|p1a: Alomomola

|

|-weather|SunnyDay|[upkeep]

|-heal|p2a: Emboar|422/424|[from] item: Leftovers

|

|switch|p1a: Rotom-Mow|Rotom-Mow|60/241

|turn|13

|

|move|p1a: Rotom-Mow|Thunderbolt|p2a: Emboar

|-damage|p2a: Emboar|226/424

|move|p2a: Emboar|Fire Blast|p1a: Rotom-Mow

|-supereffective|p1a: Rotom-Mow

|-damage|p1a: Rotom-Mow|0 fnt

|faint|p1a: Rotom-Mow

|

|-weather|SunnyDay|[upkeep]

|-heal|p2a: Emboar|252/424|[from] item: Leftovers

|

|switch|p1a: Tyrantrum|Tyrantrum, F|1/306

|turn|14

|

|move|p1a: Tyrantrum|Poison Fang|p2a: Emboar

|-damage|p2a: Emboar|127/424

|-status|p2a: Emboar|tox

|move|p2a: Emboar|Solar Beam|p1a: Tyrantrum|[still]

|-prepare|p2a: Emboar|Solar Beam|p1a: Tyrantrum

|-anim|p2a: Emboar|Solar Beam|p1a: Tyrantrum

|-damage|p1a: Tyrantrum|0 fnt

|faint|p1a: Tyrantrum

|

|-weather|SunnyDay|[upkeep]

|-heal|p2a: Emboar|153/424 tox|[from] item: Leftovers

|html|<div class="broadcast-red"><b>The battle crashed</b><br />You can keep playing but it might crash again.</div>

|

|turn|15

|

|move|p2a: Emboar|Solar Beam|p1: Tyrantrum|[still]|[from]Immunimons|[notarget]

|-prepare|p2a: Emboar|Solar Beam|p1: Tyrantrum

|-anim|p2a: Emboar|Solar Beam|p1: Tyrantrum

|-notarget

|

|-weather|none

|-heal|p2a: Emboar|179/424 tox|[from] item: Leftovers


Edit: Somewhere else it mentions it can't find movetype undefined
 
Last edited:

Inspirited

There is usually higher ground.
is a Contributor Alumnus
So AWailOfATail forgot to post this, so I thought I would do so since it is a pretty significant OM:
Code:
{
                name: "FU",
                section: "Other Metagames",

                ruleset: ['PU'],
                banlist: ['NU', 'Raichu', 'Throh', 'Poliwrath', 'Sneasel', 'Electrode', 'Garbodor', 'Haunter', 'Basculin', 'Camerupt', 'Piloswine', 'Musharna', 'Scyther', 'Bouffalant', 'Bastiodon', 'Avalugg', 'Golem', 'Tauros', 'Barbaracle', 'Lickilicky', 'Marowak', 'Chatot', 'Gourgeist-Super', 'Flareon', 'Tangela', 'Pelipper', 'Mantine', 'Torterra', 'Togetic', 'Beeheeyem', 'Mr. Mime', 'Kadabra', 'Rotom-Frost', 'Dusknoir', 'Carracosta', 'Serperior', 'Rampardos', 'Altaria', 'Zebstrika', 'Dodrio', 'Ursaring', 'Lumineon', 'Wartortle', 'Luxray', 'Rapidash', 'Kecleon', 'Stoutland', 'Mightyena', 'Ninetales', 'Purugly', 'Regice', 'Vigoroth', 'Kricketune', 'Victreebel', 'Roselia', 'Misdreavus', 'Sawsbuck', 'Drifblim', 'Arbok', 'Stunfisk', 'Relicanth']
        },
We got this to work on our server, so it is functional and whatnot. Just want to reassure, this is AWailOfATail's work, not mine.
 

AWailOfATail

viva la darmz
So AWailOfATail forgot to post this, so I thought I would do so since it is a pretty significant OM:
Code:
{
                name: "FU",
                section: "Other Metagames",

                ruleset: ['PU'],
                banlist: ['NU', 'Raichu', 'Throh', 'Poliwrath', 'Sneasel', 'Electrode', 'Garbodor', 'Haunter', 'Basculin', 'Camerupt', 'Piloswine', 'Musharna', 'Scyther', 'Bouffalant', 'Bastiodon', 'Avalugg', 'Golem', 'Tauros', 'Barbaracle', 'Lickilicky', 'Marowak', 'Chatot', 'Gourgeist-Super', 'Flareon', 'Tangela', 'Pelipper', 'Mantine', 'Torterra', 'Togetic', 'Beeheeyem', 'Mr. Mime', 'Kadabra', 'Rotom-Frost', 'Dusknoir', 'Carracosta', 'Serperior', 'Rampardos', 'Altaria', 'Zebstrika', 'Dodrio', 'Ursaring', 'Lumineon', 'Wartortle', 'Luxray', 'Rapidash', 'Kecleon', 'Stoutland', 'Mightyena', 'Ninetales', 'Purugly', 'Regice', 'Vigoroth', 'Kricketune', 'Victreebel', 'Roselia', 'Misdreavus', 'Sawsbuck', 'Drifblim', 'Arbok', 'Stunfisk', 'Relicanth']
        },
We got this to work on our server, so it is functional and whatnot. Just want to reassure, this is AWailOfATail's work, not mine.
yeah forgot about that
So yeah, unless the Pokemon data is updated with FU tiers, all of the Pokemon have to be added in manually. And when usage stats come, the drops/rises will have to be put in. Not hard to do at all if you understand it.
 
I just wrote a script that is able to process a CSV file (which is one of the extensions supported by MS Excel and Google Docs) and generates a pokedex.js file readable by Pokémon Showdown.

By default, when it's ran using Node.js, it will read the pokedex.csv file in the same directory, and generate a file named pokedex.js.out, which you will need to rename and move to the appropriate path in its mod directory.

Any part of the Pokedex can be edited using this (no learnsets/tiers).

  • Create a spreadsheet (see valid format below), and save it as a CSV file. How to: In Google Sheets: File -> Download as -> Comma-separated values (.csv, current sheet). In Microsoft Excel: File -> Save as -> Save as type -> CSV (comma delimited) -> Save.
  • Download Node.js and install it.
  • Download the script to the path where your CSV file is (default pokedex.csv).
  • Open the command line. (In Windows / In OS X / If you are using Linux you'd better know.)
  • Navigate to the path where the script and CSV files are (In Windows / In OS X).
  • Type the following:
Code:
node pokedex-generator.js
It's done! Rename the file, which by default is originally named pokedex.js.out, and move it to the mod folder.


What's a valid format for the data?

Basically, you need a spreadsheet where the headers (the first row) say what kind of data each column contains.
If you don't need to edit a type of data for any Pokémon, you may just remove that column. If you don't need to edit a value for some Pokémon, you may leave the cell blank.
Furthermore, for any kind of data that can accept multiple subvalues, they should be separated by slashes (/).
Anyway, I guess it's better to see it by yourself.


First results of this script:

Wonkymons:
- Google Docs spreadsheet
- Downloaded as CSV
- Processed

UPDATE: Added details about usage and changed most links for clarity.
This looks incredibly complicated and I'm kind of curious what the value is over just opening Pokedex in Notepad and manually editing. Other than being easy on the eyes, I mean.

Also I'm surprised to find that Stat Switch's code hasn't been posted here. I'd hoped to take a look at it, though it's probably in Stat Switch's thread so whatever...
 
This looks incredibly complicated and I'm kind of curious what the value is over just opening Pokedex in Notepad and manually editing. Other than being easy on the eyes, I mean.
Collaborative work via Google Docs or any other similar platform.

Of course, there is Github, but not everyone interested in creating/editting an OM will be used to it.
 
Here! I thought I had posted it :|

config/formats.js

Code:
{
    name: "350 Cup",

    mod: '350cup',
    ruleset: ['Ubers', 'Evasion Moves Clause'],
    banlist: ['Abra', 'Cranidos', 'Darumaka', 'Gastly', 'Pawniard', 'Smeargle', 'Spritzee', 'DeepSeaScale', 'DeepSeaTooth', 'Light Ball', 'Thick Club'],
    validateSet: function (set) {
        var template = Tools.getTemplate(set.species);
        var item = this.getItem(set.item);
        if (item.name === 'Eviolite' && Object.values(template.baseStats).sum() <= 350) {
            return ['Eviolite is banned on Pokémon with 350 or lower BST.'];
        }
    }
}
mods/350cup/scripts.js

Code:
exports.BattleScripts = {
    init: function () {
        for (var i in this.data.Pokedex) {
            if (Object.values(this.data.Pokedex[i].baseStats).sum() <= 350) {
                this.modData('Pokedex', i).baseStats['hp'] = this.data.Pokedex[i].baseStats['hp'] * 2;
                this.modData('Pokedex', i).baseStats['atk'] = this.data.Pokedex[i].baseStats['atk'] * 2;
                this.modData('Pokedex', i).baseStats['def'] = this.data.Pokedex[i].baseStats['def'] * 2;
                this.modData('Pokedex', i).baseStats['spa'] = this.data.Pokedex[i].baseStats['spa'] * 2;
                this.modData('Pokedex', i).baseStats['spd'] = this.data.Pokedex[i].baseStats['spd'] * 2;
                this.modData('Pokedex', i).baseStats['spe'] = this.data.Pokedex[i].baseStats['spe'] * 2;
            }
        }
        this.modData('Pokedex', 'shedinja').baseStats['hp'] = 1;
    }
};
 
A quick question also: would it be possible to use a + instead of a * and get a functional result? That is, would that code with a +40 actually add 40 to a given base stat or would that not work for some reason?
 
Yes, it is possible. Also, it's possible to code it in a briefer way:

Code:
exports.BattleScripts = {
    init: function () {
        for (var i in this.data.Pokedex) {
            if (Object.sum(this.data.Pokedex[i].baseStats) <= 350) {
                this.modData('Pokedex', i).baseStats['hp'] *= 2;
                this.modData('Pokedex', i).baseStats['atk'] *= 2;
                this.modData('Pokedex', i).baseStats['def'] *= 2;
                this.modData('Pokedex', i).baseStats['spa'] *= 2;
                this.modData('Pokedex', i).baseStats['spd'] *= 2;
                this.modData('Pokedex', i).baseStats['spe'] *= 2;
            }
        }
        this.modData('Pokedex', 'shedinja').baseStats['hp'] = 1;
    }
};
For the 40 points increase:

Code:
this.modData('Pokedex', i).baseStats['hp'] += 40;
All these: =, +=, -=, *=, and /= are called assignment operators, as they give some value to the expression on the left.
While in the case of =, it's just the result of the expression on the right that is assigned, the other operators are a shorthand notation:
myVar *= 2 is equivalent to myVar = myVar * 2.
 
config/formats.js
Code:
 {
        name: "The Power Within",
        section: "XY Singles",

        ruleset: ['OU'],
        banlist: ['The Power Within']
    },
team-validator.js
Code:
if (format.banlistTable && format.banlistTable['thepowerwithin']) {
    var hpTypesX,
        hpTypes = ['Fighting', 'Flying', 'Poison', 'Ground', 'Rock', 'Bug', 'Ghost', 'Steel', 'Fire', 'Water', 'Grass', 'Electric', 'Psychic', 'Ice', 'Dragon', 'Dark'],
        tpwType;
    for (var s in template.baseStats) {
        hpTypeX += i * (set.ivs[s] % 2);
    }
    tpwType = hpTypes[Math.floor(hpTypeX * 15 / 63)];
    if (tpwType === tools.getMove(move).type) {
        return false;
    }
}

("alreadyChecked[template.speciesid] = true;")
 

Pikachuun

the entire waruda machine
config/formats.js
Code:
    {
        name: "Protect: The Metagame",
        section: 'Other Metagames',

        ruleset: ['Pokemon', 'Standard', 'Team Preview', 'Swagger Clause', 'Baton Pass Clause'],
        banlist: ['Uber', 'Soul Dew', 'Gengarite', 'Kangaskhanite', 'Lucarionite', 'Mawilite'],
        onModifyMove: function (move) {
            if (move.id === 'protect' || move.id === 'detect') {
                move.onPrepareHit = {};
                move.onHit = {};
            }
        }
    },
config/formats.js
Code:
    {
        name: "Five Items",
        section: "Other Metagames",
     
        ruleset: ['Pokemon', 'Standard', 'Team Preview'],
        banlist: ['Uber', 'Soul Dew', 'Gengarite', 'Kangaskhanite', 'Lucarionite'],
        mod: 'fiveitems'
    },
mods/fiveitems/items.js
Code:
exports.BattleItems = {
    "armorfossil": {
        inherit: true,
        onModifyDefPriority: 1,
        onModifyDef: function (def) {
            return this.chainModify(1.5);
        },
        onModifyPokemon: function (pokemon) {
            var moves = pokemon.moveset;
            for (var i = 0; i < moves.length; i++) {
                if (this.getMove(moves[i].move).category === 'Status') {
                    moves[i].disabled = true;
                }
            }
        },
        desc: "Can be revived into Shieldon. Holder's Def is 1.5x, but it can only use damaging moves."
    },
    "brightpowder": {
        inherit: true,
        onAccuracy: function (accuracy) {
            return accuracy;
        },
        onModifyMove: function (move) {
            if (move.category === "Status" && move.priority === 0) {
                move.selfSwitch = true;
            }
        },
        desc: "Holder's non-damaging attacks with 0 priority switch out the holder with a chosen ally."
    },
    "dragonfang": {
        inherit: true,
        onBasePower: function (basePower) {
            return basePower;
        },
        onModifyDamage: function (damage, source, target, move) {
            if (source) {
                source.addVolatile('dragonfang');
                return this.chainModify(1.33);
            }          
        },
        onModifySpe: function (speMod) {
            return this.chain(speMod, 1.33);
        },
        effect: {
            duration: 1,
            onAfterMoveSecondarySelf: function (source, target, move) {
                if (move && move.effectType === 'Move' && source && source.volatiles['dragonfang']) {
                    if (source.hp - source.maxhp/4 <= 3) {
                        this.damage(source.hp, source, source, this.getItem('dragonfang'));
                    } else {
                        this.damage(source.maxhp / 4, source, source, this.getItem('dragonfang'));
                    }
                    source.removeVolatile('dragonfang');
                }
            }
        },
        desc: "Holder's damaging attacks have 1.33x power; holder's Speed is 1.33x; loses 1/4 max HP after the attack."
    },
    "laggingtail": {
        inherit: true,
        onModifyMove: function (move) {
            if (move.id === "dragontail") {
                move.forceSwitch = false;
                move.self = {
                    onHit: function (pokemon) {
                        if (pokemon.hp && pokemon.removeVolatile('leechseed')) {
                            this.add('-end', pokemon, 'Leech Seed', '[from] move: Dragon Tail', '[of] ' + pokemon);
                        }
                        var sideConditions = {spikes:1, toxicspikes:1, stealthrock:1, stickyweb:1};
                        for (var i in sideConditions) {
                            if (pokemon.hp && pokemon.side.removeSideCondition(i)) {
                                this.add('-sideend', pokemon.side, this.getEffect(i).name, '[from] move: Dragon Tail', '[of] ' + pokemon);
                            }
                        }
                        if (pokemon.hp && pokemon.volatiles['partiallytrapped']) {
                            this.add('-remove', pokemon, pokemon.volatiles['partiallytrapped'].sourceEffect.name, '[from] move: Dragon Tail', '[of] ' + pokemon, '[partiallytrapped]');
                            delete pokemon.volatiles['partiallytrapped'];
                        }
                    }
                };
            }
        },
        onModifyPriority: function (priority, pokemon, target, move) {
            if (move && move.id === "dragontail") {
                return 0;
            } else {
                return priority;
            }
        },
        desc: "Dragon Tail frees the holder from hazards/partial trap/Leech Seed, and has 0 priority when used by the holder."
    },
    "spelltag": {
        inherit: true,
        onBasePower: function (basePower) {
            return basePower;
        },
        onModifyMove: function (move) {
            if (move.secondaries && move.id !== 'secretpower') {
                for (var i = 0; i < move.secondaries.length; i++) {
                    var t = 0;
                    if (move.secondaries[i].status) {
                        this.debug('doubling secondary chance');
                        t = 1;
                    } else if (move.secondaries[i].boosts && !move.secondaries[i].boosts.accuracy) {
                        this.debug('doubling secondary chance');
                        t = 1;
                    } else if (move.secondaries[i].boosts && move.secondaries[i].boosts.accuracy) {
                        this.debug('zeroing secondary chance');
                        t = -1;
                    }
                    move.secondaries[i].chance *= t + 1;
                }
            }
        },
        desc: "Holder's moves have their secondary effects doubled, if they inflict status or modify stats, but cannot lower accuracy."
    }
};
 
Last edited:
So I was working on a small script for adding the top 599 used Pokemon to a banlist (for BH NU for my friends), and I figured I may as well post it because it might be useful for other people.

https://gist.github.com/ABrambleNinja/359e8811c0cd8885bb31

After you run it, it'll prompt for a link to the relevant usage stats (in my case http://www.smogon.com/stats/2014-12/balancedhackmons-1630.txt), and then an interactive Ruby shell opens, alllowing you to have easy access to the data. The Pokemon from the list are stored in an array called data. If you want to get the top 599 used Pokemon in a Javascript-style array, for example, you'd run this command:
Code:
puts to_list(pokemon[0..598])
And there you go! I'll be working on this code some more so that one can access more of the stats found in the file, such as usage by percentage, actual usage numbers, and much more.

Edit: Updated code so that you can access more variables from the data. Changed example code to match updates (variable was renamed for logical reasons)

Edit 2: Released under MIT license and made a few minor changes.
 
Last edited:

Snaquaza

KACAW
is a Community Contributor Alumnusis a Smogon Media Contributor Alumnusis a Battle Simulator Moderator Alumnus
Code for Little Legend Cup. I tried to code it and made one file, then NotACoolName came around and helped me get a more quick way to program it n.n
exports.BattleScripts = {
init: function () {
for (var i in this.data.Pokedex) {
// legendary only
var legendaries = {Articuno:1,Zapdos:1,Moltres:1,Mewtwo:1,Mew:1,Entei:1,Suicune:1,Raikou:1,Lugia:1,Hooh:1,Celebi:1,Regirock:1,Regice:1,Registeel:1,Latios:1,Latias:1,Kyogre:1,Groudon:1,Rayquaza:1,Jirachi:1,Azelf:1,Mesprit:1,Uxie:1,Dialga:1,Palkia:1,Giratina:1,Arceus:1,Cresselia:1,Manaphy:1,Phione:1,Heatran:1,Regigigas:1,Shaymin:1,Victini:1,Cobalion:1,Terrakion:1,Virizion:1,Keldeo:1,Tornadus:1,Thundurus:1,Landorus:1,Zekrom:1,Reshiram:1,Kyurem:1,Meloetta:1,Yveltal:1,Xerneas:1,Zygarde:1,Diancie:1,Volcanion:1,Hoopa:1};
var template = this.getTemplate(i);
if (!template.baseTemplate.name in legendaries) continue;

var tier = '';
var adjustment = 0;
// mega evolutions get the same stat boost as their base forme
if (this.data.FormatsData) tier = this.data.FormatsData.tier || this.data.FormatsData[toId(template.baseSpecies)].tier;
switch (tier) {
case 'Uber':
adjustment = 5;
break;
case 'OU':
case 'BL':
adjustment = 10;
break;
case 'UU':
case 'BL2':
adjustment = 15;
break;
case 'RU':
case 'BL3':
adjustment = 20;
break;
case 'NU':
case 'PU':
adjustment = 25;
}

for (var j in this.data.Pokedex.baseStats) {
this.modData('Pokedex', i).baseStats[j] = (this.data.Pokedex.baseStats[j] / 2) + adjustment;
}
// eviolite & littlecup hacks
this.modData('Pokedex', i).nfe = true;
this.modData('Pokedex', i).prevo = '';
}
}
};

exports.BattleFormatsData = {
arceus: {
tier: LC
},
darkrai: {
tier: LC
},
deoxys: {
tier: LC
},
deoxysattack: {
tier: LC
},
deoxysdefense: {
tier: LC
},
deoxysspeed: {
tier: LC
},
dialga: {
tier: LC
},
genesect: {
tier: LC
},
giratina: {
tier: LC
},
giratinaorigin: {
tier: LC
},
groudon: {
tier: LC
},
hooh: {
tier: LC
},
kyogre: {
tier: LC
},
kyuremwhite: {
tier: LC
},
lugia: {
tier: LC
},
mewtwo: {
tier: LC
},
palkia: {
tier: LC
},
rayquaza: {
tier: LC
},
reshiram: {
tier: LC
},
shayminsky: {
tier: LC
},
xerneas: {
tier: LC
},
yveltal: {
tier: LC
},
zekrom: {
tier: LC
},
diancie: {
tier: LC
},
heatran: {
tier: LC
},
keldeo: {
tier: LC
},
kyuremblack: {
tier: LC
},
landorus: {
tier: LC
},
landorustherian: {
tier: LC
},
latias: {
tier: LC
},
latios: {
tier: LC
},
manaphy: {
tier: LC
},
mew: {
tier: LC
},
terrakion: {
tier: LC
},
thundurus: {
tier: LC
},
thundurustherian: {
tier: LC
},
tornadustherian: {
tier: LC
},
zapdos: {
tier: LC
},
zygarde: {
tier: LC
},
azelf: {
tier: LC
},
celebi: {
tier: LC
},
entei: {
tier: LC
},
jirachi: {
tier: LC
},
kyurem: {
tier: LC
},
raikou: {
tier: LC
},
shaymin: {
tier: LC
},
suicune: {
tier: LC
},
tornadus: {
tier: LC
},
cobalion: {
tier: LC
},
cresselia: {
tier: LC
},
meloetta: {
tier: LC
},
registeel: {
tier: LC
},
virizion: {
tier: LC
},
articuno: {
tier: LC
},
mesprit: {
tier: LC
},
regice: {
tier: LC
},
regigigas: {
tier: LC
},
regirock: {
tier: LC
}
};

{
name: "Little Legend Cup",
section: "Other Metagames",

mod: "littlelegendcup"
maxLevel: 5,
ruleset: ['Pokemon', 'Standard', 'Team Preview', 'Little Cup'],
banlist: ['Dragon Rage', 'Sonic Boom', 'Swagger', 'LC Uber', 'Gligar']
},
 
Gods and Followers

Code:
{
   name: "Gods and Followers",
   section: "Other Metagames",

   mod: 'godsandfollowers',
   ruleset: ['Pokemon', 'Sleep Clause Mod', 'Species Clause', 'OHKO Clause', 'Moody Clause', 'Evasion Moves Clause', 'Endless Battle Clause', 'HP Percentage Mod', 'Team Preview', 'Swagger Clause', 'Baton Pass Clause', 'Followers Clause', 'Cancel Mod'],
   banlist: ['Illegal']
}
Code:
exports.BattleFormats = {
   followersclause: {
     effectType: 'Rule',
     onValidateTeam: function (team) {
       var problems = [];
       var god = team[0];
       var godName = god.name || god.species;
       var godTemplate = this.getTemplate(god.species);
       var godFormes = godTemplate.otherFormes || [];
       // Look for item changing a forme, if one exists (for example mega
       // stones or Red Orb).
       for (var i = 0; i < godFormes.length; i++) {
         var forme = this.getTemplate(godFormes[i]);
         if (forme.requiredItem === god.item) {
           godTemplate = forme;
           break;
         }
       }

       for (var i = 1; i < team.length; i++) {
         var pokemon = team[i];
         var name = pokemon.name || pokemon.species;
         var template = this.getTemplate(pokemon.species);
         if (template.types.intersect(godTemplate.types).isEmpty()) {
           problems.push("Your " + name + " must share a type with " + godName + ".");
         }
         if (template.tier === 'Uber' || template.isUnreleased) {
           problems.push("You cannot use " + name + " as non-god.");
         }
         var bannedItems = {
           'Soul Dew': true,
           'Gengarite': true,
           'Kangaskhanite': true,
           'Lucarionite': true,
           'Mawilite': true,
           'Salamencite': true
         }
         if (bannedItems[pokemon.item]) {
           problems.push(name + "'s item " + pokemon.item + " is banned for non-gods.");
         }
       }
       // Item check
       for (var i = 0; i < team.length; i++) {
         var pokemon = team[i];
         var name = pokemon.name || pokemon.species;
         var item = this.getItem(pokemon.item);
         if (item.isUnreleased) {
           problems.push(name + "'s item " + set.item + " is unreleased.");
         }
       }
       return problems;
     },
     onStart: function () {
       // Set up god, because the Pokemon positions during battle switch around.
       for (var i = 0; i < this.sides.length; i++) {
         this.sides[i].god = this.sides[i].pokemon[0];
       }
     },
     onFaint: function (pokemon) {
       if (pokemon.side.god === pokemon) {
         this.add('-message', pokemon.name + " has fallen! "
           + pokemon.side.name + "'s team has been Cursed!");
       }
     },
     onSwitchIn: function (pokemon) {
       if (pokemon.side.god.hp === 0) {
         // What a horrible night to have a Curse.
         pokemon.addVolatile('curse', pokemon);
       }
     }
   }
};
Code:
exports.BattleFormats = {
   followersclause: {
     effectType: 'Rule',
     onValidateTeam: function (team) {
       var problems = [];
       var god = team[0];
       var godName = god.name || god.species;
       var godTemplate = this.getTemplate(god.species);
       var godFormes = godTemplate.otherFormes || [];
       // Look for item changing a forme, if one exists (for example mega
       // stones or Red Orb).
       for (var i = 0; i < godFormes.length; i++) {
         var forme = this.getTemplate(godFormes[i]);
         if (forme.requiredItem === god.item) {
           godTemplate = forme;
           break;
         }
       }

       for (var i = 1; i < team.length; i++) {
         var pokemon = team[i];
         var name = pokemon.name || pokemon.species;
         var template = this.getTemplate(pokemon.species);
         if (template.types.intersect(godTemplate.types).isEmpty()) {
           problems.push("Your " + name + " must share a type with " + godName + ".");
         }
         if (template.tier === 'Uber' || template.isUnreleased) {
           problems.push("You cannot use " + name + " as non-god.");
         }
         var bannedItems = {
           'Soul Dew': true,
           'Gengarite': true,
           'Kangaskhanite': true,
           'Lucarionite': true,
           'Mawilite': true,
           'Salamencite': true
         }
         if (bannedItems[pokemon.item]) {
           problems.push(name + "'s item " + pokemon.item + " is banned for non-gods.");
         }
       }
       // Item check
       for (var i = 0; i < team.length; i++) {
         var pokemon = team[i];
         var name = pokemon.name || pokemon.species;
         var item = this.getItem(pokemon.item);
         if (item.isUnreleased) {
           problems.push(name + "'s item " + set.item + " is unreleased.");
         }
       }
       return problems;
     },
     onStart: function () {
       // Set up god, because the Pokemon positions during battle switch around.
       for (var i = 0; i < this.sides.length; i++) {
         this.sides[i].god = this.sides[i].pokemon[0];
       }
     },
     onModifyPriority: function (priority, pokemon) {
       if (pokemon.side.god.hp === 0) {
         return priority - 1;
       }
     }
   }
};
 
Last edited:
Turnmons

PHP:
{
        name: "Turnmons",
        section: "Other Metagames",
    
        mod: ['turnmons'],
        ruleset: ['OU'],
        banlist: ['Taunt'],
    
        validateSet: function (set) {
            var hasAtkMove = false;
            var hasDefMove = false;
            for (var i = 0; i < set.moves.length; i++)
            {
                var move = this.getMove(set.moves[i]);
                if (move.category === 'Status') {
                    hasDefMove = true;
                }
                else {
                    hasAtkMove = true;
                }
            }
            // Check if it has at least one of each
            if (!hasAtkMove) {
                return set.species + " doesn't know any offensive moves.";
            }
            if (!hasDefMove) {
                return set.species + " doesn't know any defensive moves.";
            }
        
            // Complex ban: Klutz + AV + Trick/Switcheroo
            if (set.ability === "Klutz" && set.item === "Assault Vest")
            {
                for (var i = 0; i < set.moves.length; i++)
                {
                    var move = this.getMove(set.moves[i]);
                    if (move.id === "trick" || move.id === "switcheroo") {
                        return "The combination of Klutz + Assault Vest + " + move.name + " is banned by Turnmons.";
                    }
                }
            }
        }
    }

PHP:
exports.BattleStatuses =
{
    pokemon:
    {
        onModifyPokemon: function (pokemon)
        {
            var atkTurns = [0, 6, 7, 8, 9];
            var defTurns = [1, 2, 3, 4, 5];
            var moves = pokemon.moveset;
            for (var i = 0; i < moves.length; i++) {
                    var move = this.getMove(moves[i].move);
                    // Exceptions: Assist, Metronome, Sleep Talk
                    if (move.id === "assist" || move.id === "metronome" || move.id === "sleeptalk") {
                        continue;
                    }
                    // Attacking turns
                    if (atkTurns.indexOf(this.turn % 10) > -1)
                    {
                        if (move.category === 'Status')
                        {
                            pokemon.disableMove(moves[i].id);
                        }
                    }
                    // Defending turns
                    else
                    {
                        if (move.category !== 'Status')
                        {
                            pokemon.disableMove(moves[i].id);
                        }
                    }
                }
        }
    }

}
PHP:
exports.BattleMovedex =
{
    assist:
    {
        inherit: true,
        onHit: function (target) {
            var moves = [];
            for (var j = 0; j < target.side.pokemon.length; j++) {
                var pokemon = target.side.pokemon[j];
                if (pokemon === target) continue;
                for (var i = 0; i < pokemon.moveset.length; i++) {
                    var move = this.getMove(pokemon.moveset[i].id);
                    var noAssist = {
                        assist:1, belch:1, bestow:1, bounce:1, chatter:1, circlethrow:1, copycat:1, counter:1, covet:1, destinybond:1, detect:1, dig:1, dive:1, dragontail:1, endure:1, feint:1, fly:1, focuspunch:1, followme:1, helpinghand:1, kingsshield:1, matblock:1, mefirst:1, metronome:1, mimic:1, mirrorcoat:1, mirrormove:1, naturepower:1, phantomforce:1, protect:1, ragepowder:1, roar:1, shadowforce:1, sketch:1, sleeptalk:1, snatch:1, spikyshield:1, struggle:1, switcheroo:1, thief:1, transform:1, trick:1, whirlwind:1
                    };
                    // Can only call defensive moves in defensive turns, and vice-versa
                    var atkTurns = [0, 6, 7, 8, 9];
                    var turnIndex = this.turn % 10;
                    if (!noAssist[move.id] && ((move.category === "Status" && atkTurns.indexOf(turnIndex) === -1) || (move.category !== "Status" && atkTurns.indexOf(turnIndex) > -1))) {
                        moves.push(move);
                    }
                }
            }
            var move = '';
            if (moves.length) move = moves[this.random(moves.length)];
            if (!move) {
                return false;
            }
            this.useMove(move, target);
        }
    },
    metronome:
    {
        inherit: true,
        onHit: function (target) {
            var moves = [];
            for (var i in exports.BattleMovedex) {
                var move = exports.BattleMovedex[i];
                if (i !== move.id) continue;
                if (move.isNonstandard) continue;
                var noMetronome = {
                    afteryou:1, assist:1, belch:1, bestow:1, celebrate:1, chatter:1, copycat:1, counter:1, covet:1, craftyshield:1, destinybond:1, detect:1, diamondstorm:1, dragonascent:1, endure:1, feint:1, focuspunch:1, followme:1, freezeshock:1, happyhour:1, helpinghand:1, holdhands:1, hyperspacefury:1, hyperspacehole:1, iceburn:1, kingsshield:1, lightofruin:1, matblock:1, mefirst:1, metronome:1, mimic:1, mirrorcoat:1, mirrormove:1, naturepower:1, originpulse:1, precipiceblades:1, protect:1, quash:1, quickguard:1, ragepowder:1, relicsong:1, secretsword:1, sketch:1, sleeptalk:1, snarl:1, snatch:1, snore:1, spikyshield:1, steameruption:1, struggle:1, switcheroo:1, technoblast:1, thief:1, thousandarrows:1, thousandwaves:1, transform:1, trick:1, vcreate:1, wideguard:1
                };
                // Can only call defensive moves in defensive turns, and vice-versa
                var atkTurns = [0, 6, 7, 8, 9];
                var turnIndex = this.turn % 10;
                if (!noMetronome[move.id] && ((move.category === "Status" && atkTurns.indexOf(turnIndex) === -1) || (move.category !== "Status" && atkTurns.indexOf(turnIndex) > -1))) {
                    moves.push(move);
                }
            }
            var move = '';
            if (moves.length) {
                moves.sort(function (a, b) {return a.num - b.num;});
                move = moves[this.random(moves.length)].id;
            }
            if (!move) {
                return false;
            }
            this.useMove(move, target);
        }
    },
    naturepower:
    {
        inherit: true,
        category: "Special"
    },
    sleeptalk:
    {
        inherit: true,
        onHit: function (pokemon) {
            var moves = [];
            for (var i = 0; i < pokemon.moveset.length; i++) {
                var move = this.getMove(pokemon.moveset[i].id);
                var NoSleepTalk = {
                    assist:1, bide:1, chatter:1, copycat:1, focuspunch:1, mefirst:1, metronome:1, mimic:1, mirrormove:1, naturepower:1, sketch:1, sleeptalk:1, uproar:1
                };
                // Can only call defensive moves in defensive turns, and vice-versa
                var atkTurns = [0, 6, 7, 8, 9];
                var turnIndex = this.turn % 10;
                if (move && !(NoSleepTalk[move.id] || move.isTwoTurnMove) && ((move.category === "Status" && atkTurns.indexOf(turnIndex) === -1) || (move.category !== "Status" && atkTurns.indexOf(turnIndex) > -1))) {
                    moves.push(move);
                }
            }
            var move = '';
            if (moves.length) move = moves[this.random(moves.length)];
            if (!move) {
                return false;
            }
            this.useMove(move, pokemon);
        }
    },
    struggle:
    {
        inherit: true,
        basePower: 0
    }
}
 
Last edited:

Pikachuun

the entire waruda machine
config/formats.js
Code:
    {
        name: "VoltTurn Mayhem",
        section: "Other Metagames",
    
        ruleset: ['Pokemon', 'Standard', 'Team Preview'],
        banlist: ['Uber', 'Soul Dew', 'Gengarite', 'Kangaskhanite', 'Lucarionite'],
        onModifyMove: function (move) {
            if (move.target && !move.nonGhostTarget && (move.target === "normal" || move.target === "any" || move.target === "randomNormal" || move.target === "allAdjacent" || move.target === "allAdjacentFoes")) {
                move.selfSwitch = true;
            }
        }
    },
 
Last edited:

dhelmise

banend doosre
is a Site Content Manageris a Battle Simulator Administratoris a Top Social Media Contributoris a Community Leaderis a Programmeris a Community Contributoris a Top Contributoris a Top Smogon Media Contributoris a Top Dedicated Tournament Hostis a Smogon Discord Contributor Alumnus
Social Media Head
Megamorph
Thread

TheBurgerKing99 Snaquaza Monte Cristo

config/formats.js

Code:
    {
        name: "Megamorph",
        section: "New Other Metagames",

        mod: 'megamorph',
        ruleset: ['OU'],
        banlist: ['Uber', 'Soul Dew']
    }
mods/megamorph/scripts.js

Code:
exports.BattleScripts = {
    init: function () {
        this.modData('Pokedex', 'venusaurmega').abilities['0'] = 'Unaware';
        this.modData('Pokedex', 'venusaurmega').baseStats = {hp:80,atk:92,def:133,spa:110,spd:120,spe:90};

        this.modData('Pokedex', 'charizardmegax').abilities['0'] = 'Levitate';
        this.modData('Pokedex', 'charizardmegax').types = ['Fire', 'Dark'];
        this.modData('Pokedex', 'charizardmegax').baseStats = {hp:78,atk:94,def:88,spa:159,spd:105,spe:110};

        this.modData('Pokedex', 'charizardmegay').abilities['0'] = 'Aerilate';
        this.modData('Pokedex', 'charizardmegay').baseStats = {hp:78,atk:144,def:98,spa:109,spd:95,spe:100};

        this.modData('Pokedex', 'blastoisemega').abilities['0'] = 'Sheer Force';
        this.modData('Pokedex', 'blastoisemega').types = ['Water', 'Steel'];
        this.modData('Pokedex', 'blastoisemega').baseStats = {hp:79,atk:83,def:110,spa:145,spd:115,spe:98};

        this.modData('Pokedex', 'beedrillmega').abilities['0'] = 'Mold Breaker';
        this.modData('Pokedex', 'beedrillmega').types = ['Bug', 'Ground'];
        this.modData('Pokedex', 'beedrillmega').baseStats = {hp:65,atk:160,def:40,spa:25,spd:70,spe:135};

        this.modData('Pokedex', 'pidgeotmega').abilities['0'] = 'Pixilate';
        this.modData('Pokedex', 'pidgeotmega').types = ['Fairy', 'Flying'];
        this.modData('Pokedex', 'pidgeotmega').baseStats = {hp:83,atk:120,def:85,spa:60,spd:80,spe:151};

        this.modData('Pokedex', 'alakazammega').abilities['0'] = 'Levitate';
        this.modData('Pokedex', 'alakazammega').baseStats = {hp:55,atk:40,def:75,spa:190,spd:95,spe:145};

        this.modData('Pokedex', 'slobromega').abilities['0'] = 'Rough Skin';
        this.modData('Pokedex', 'slobromega').baseStats = {hp:95,atk:75,def:150,spa:130,spd:120,spe:20};

        this.modData('Pokedex', 'gengarmega').abilities['0'] = 'Dark Aura';
        this.modData('Pokedex', 'gengarmega').types = ['Ghost', 'Dark'];
        this.modData('Pokedex', 'gengarmega').baseStats = {hp:60,atk:65,def:90,spa:160,spd:105,spe:120};

        this.modData('Pokedex', 'steelixmega').abilities['0'] = 'Sheer Force';
        this.modData('Pokedex', 'steelixmega').types = ['Steel', 'Dragon'];
        this.modData('Pokedex', 'steelixmega').baseStats = {hp:75,atk:155,def:150,spa:55,spd:65,spe:110};

        this.modData('Pokedex', 'kangaskhanmega').abilities['0'] = 'Iron Fist';
        this.modData('Pokedex', 'kangaskhanmega').baseStats = {hp:105,atk:145,def:110,spa:40,spd:110,spe:800};

        this.modData('Pokedex', 'scizormega').types = ['Steel', 'Flying'];
        this.modData('Pokedex', 'scizormega').baseStats = {hp:70,atk:160,def:110,spa:55,spd:90,spe:110};

        this.modData('Pokedex', 'pinsirmega').abilities['0'] = 'Levitate';
        this.modData('Pokedex', 'pinsirmega').types = ['Bug', 'Fighting'];
        this.modData('Pokedex', 'pinsirmega').baseStats = {hp:65,atk:165,def:120,spa:55,spd:95,spe:100};

        this.modData('Pokedex', 'gyaradosmega').abilities['0'] = 'Water Veil';
        this.modData('Pokedex', 'gyaradosmega').types = ['Water', 'Dragon'];
        this.modData('Pokedex', 'gyaradosmega').baseStats = {hp:95,atk:145,def:119,spa:60,spd:130,spe:91};

        this.modData('Pokedex', 'aerodactylmega').abilities['0'] = 'Levitate';
        this.modData('Pokedex', 'aerodactylmega').types = ['Rock', 'Dragon'];
        this.modData('Pokedex', 'aerodactylmega').baseStats = {hp:80,atk:135,def:100,spa:60,spd:110,spe:130};

        this.modData('Pokedex', 'mewtwomegax').abilities['0'] = 'Limber';
        this.modData('Pokedex', 'megamewtwox').baseStats = {hp:106,atk:170,def:120,spa:134,spd:120,spe:130};

        this.modData('Pokedex', 'megamewtwoy').abilities['0'] = 'Trace';
        this.modData('Pokedex', 'megamewtwoy').baseStats = {hp:106,atk:130,def:90,spa:184,spd:90,spe:170};

        this.modData('Pokedex', 'ampharosmega').abilities['0'] = 'Fur Coat';
        this.modData('Pokedex', 'ampharosmega').baseStats = {hp:90,atk:105,def:75,spa:145,spd:140,spe:55};

        this.modData('Pokedex', 'heracrossmega').abilities['0'] = 'Technician';
        this.modData('Pokedex', 'heracrossmega').baseStats = {hp:80,atk:185,def:95,spa:40,spd:115,spe:85};

        this.modData('Pokedex', 'houndoommega').abilities['0'] = 'Turboblaze';
        this.modData('Pokedex', 'houndoommega').baseStats = {hp:75,atk:125,def:50,spa:145,spd:80,spe:125};

        this.modData('Pokedex', 'tyranitarmega').abilities['0'] = 'Sand Force';
        this.modData('Pokedex', 'tyranitarmega').baseStats = {hp:100,atk:154,def:130,spa:115,spd:120,spe:81};

        this.modData('Pokedex', 'sceptilemega').abilities['0'] = 'Solar Power';
        this.modData('Pokedex', 'sceptilemega').baseStats = {hp:70,atk:145,def:65,spa:115,spd:85,spe:150};

        this.modData('Pokedex', 'blazikenmega').abilities['0'] = 'Tough Claws';
        this.modData('Pokedex', 'blazikenmega').baseStats = {hp:80,atk:140,def:80,spa:160,spd:80,spe:90};

        this.modData('Pokedex', 'swampertmega').abilities['0'] = 'Guts';
        this.modData('Pokedex', 'swampertmega').baseStats = {hp:100,atk:170,def:100,spa:95,spd:100,spe:70};

        this.modData('Pokedex', 'gardevoirmega').abilities['0'] = 'Magic Bounce';
        this.modData('Pokedex', 'gardevoirmega').baseStats = {hp:68,atk:65,def:95,spa:165,spd:145,spe:80};

        this.modData('Pokedex', 'gallademega').abilities['0'] = 'Magic Guard';
        this.modData('Pokedex', 'gallademega').baseStats = {hp:68,atk:165,def:95,spa:65,spd:145,spe:80};

        this.modData('Pokedex', 'sableyemega').abilities['0'] = 'Solid Rock';
        this.modData('Pokedex', 'sableyemega').types = ['ghost', 'rock'];
        this.modData('Pokedex', 'sableyemega').baseStats = {hp:50,atk:55,def:125,spa:85,spd:115,spe:50};

        this.modData('Pokedex', 'mawilemega').abilities['0'] = 'Strong Jaw';
        this.modData('Pokedex', 'mawilemega').baseStats = {hp:50,atk:135,def:115,spa:35,spd:95,spe:50};

        this.modData('Pokedex', 'aggronmega').abilities['0'] = 'Heavy Metal';
        this.modData('Pokedex', 'aggronmega').types = ['Rock', 'Fighting'];
        this.modData('Pokedex', 'aggronmega').baseStats = {hp:70,atk:150,def:200,spa:60,spd:100,spe:50};

        this.modData('Pokedex', 'medichammega').baseStats = {hp:60,atk:90,def:95,spa:60,spd:95,spe:110};

        this.modData('Pokedex', 'manectricmega').abilities['0'] = 'Teravolt';
        this.modData('Pokedex', 'manectricmega').baseStats = {hp:70,atk:75,def:70,spa:155,spd:70,spe:135};

        this.modData('Pokedex', 'sharpedomega').abilities['0'] = 'Drizzle';
        this.modData('Pokedex', 'sharpedomega').baseStats = {hp:70,atk:150,def:40,spa:135,spd:40,spe:125};

        this.modData('Pokedex', 'cameruptmega').abilities['0'] = 'Drought';
        this.modData('Pokedex', 'cameruptmega').baseStats = {hp:70,atk:120,def:110,spa:135,spd:115,spe:10};

        this.modData('Pokedex', 'altariamega').abilities['0'] = 'Thick Fat';
        this.modData('Pokedex', 'altariamega').types = ['Dragon', 'Flying'];
        this.modData('Pokedex', 'altariamega').baseStats = {hp:75,atk:70,def:130,spa:90,spd:145,spe:80};

        this.modData('Pokedex', 'banettemega').abilities['0'] = 'Tough Claws';
        this.modData('Pokedex', 'banettemega').types = ['Ghost', 'Normal'];
        this.modData('Pokedex', 'banettemega').baseStats = {hp:64,atk:125,def:85,spa:73,spd:83,spe:125};

        this.modData('Pokedex', 'absolmega').abilities['0'] = 'Justified';
        this.modData('Pokedex', 'absolmega').types = ['Dark', 'Fairy'];
        this.modData('Pokedex', 'absolmega').baseStats = {hp:65,atk:160,def:70,spa:85,spd:70,spe:115};

        this.modData('Pokedex', 'salamencemega').abilities['0'] = 'Gale Wings';
        this.modData('Pokedex', 'glaliemega').baseStats = {hp:95,atk:155,def:120,spa:110,spd:120,spe:100};

        this.modData('Pokedex', 'metagrossmega').abilities['0'] = 'Levitate';
        this.modData('Pokedex', 'metagrossmega').baseStats = {hp:80,atk:165,def:160,spa:95,spd:130,spe:70};

        this.modData('Pokedex', 'latiasmega').abilities['0'] = 'Plus';
        this.modData('Pokedex', 'latiasmega').baseStats = {hp:80,atk:70,def:110,spa:140,spd:170,spe:130};

        this.modData('Pokedex', 'latiosmega').abilities['0'] = 'Minus';
        this.modData('Pokedex', 'latiosmega').baseStats = {hp:80,atk:110,def:70,spa:170,spd:140,spe:130};

        this.modData('Pokedex', 'kyogreprimal').types = ['Water', 'Electric'];
        this.modData('Pokedex', 'kyogreprimal').baseStats = {hp:100,atk:120,def:110,spa:180,spd:160,spe:100};

        this.modData('Pokedex', 'groudonprimal').baseStats = {hp:100,atk:180,def:160,spa:120,spd:110,spe:100};

        this.modData('Pokedex', 'rayquazamega').baseStats = {hp:105,atk:180,def:110,spa:180,spd:110,spe:95};

        this.modData('Pokedex', 'lopunnymega').abilities['0'] = 'Reckless';
        this.modData('Pokedex', 'lopunnymega').types = ['Normal'];
        this.modData('Pokedex', 'lopunnymega').baseStats = {hp:65,atk:126,def:84,spa:54,spd:106,spe:145};

        this.modData('Pokedex', 'lucariomega').abilities['0'] = 'Aura Break';
        this.modData('Pokedex', 'lucariomega').baseStats = {hp:70,atk:130,def:80,spa:135,spd:80,spe:130};

        this.modData('Pokedex', 'abomasnowmega').abilities['0'] = 'Adaptability';
        this.modData('Pokedex', 'abomasnowmega').baseStats = {hp:90,atk:122,def:75,spa:122,spd:85,spe:100};

        this.modData('Pokedex', 'audinomega').abilities['0'] = 'Fairy Aura';
        this.modData('Pokedex', 'audinomega').baseStats = {hp:103,atk:60,def:116,spa:100,spd:116,spe:50};

        this.modData('Pokedex', 'dianciemega').abilities['0'] = 'Pixilate';
        this.modData('Pokedex', 'dianciemega').baseStats = {hp:50,atk:170,def:120,spa:170,spd:120,spe:70};
    }
};
 
Last edited:

Pikachuun

the entire waruda machine
Thread
config/formats.js
Code:
    {
        name: "Nature's Blessing",
        section: "Other Metagames",

        ruleset: ['Pokemon', 'Standard', 'Team Preview'],
        banlist: ['Uber', 'Soul Dew', 'Gengarite', 'Kangaskhanite', 'Lucarionite'],
        onTryHit: function (target, source, move) {
            if (target !== source && target.item && !target.ignore['Item'] && !(!source.ignore['Ability'] && source.ability === "unnerve")) {
                var item = Tools.getItem(target.item);
                if (item.isBerry && item.onSourceModifyDamage && item.naturalGift && move.type === item.naturalGift.type) {
                    this.add('-immune', target, '[msg]');
                    return null;
                }
            }
        }
    },
Snaquaza Djqubi

EDIT: This was apparently already coded using a different method, but I'm keeping this here just in case others want this code as well (so you don't have to ask)


Thread
config/formats.js
Code:
    {
        name: "Brackets",
        section: "Other Metagames",

        ruleset: ['Pokemon', 'Standard', 'Team Preview'],
        banlist: ['Uber', 'Soul Dew', 'Gengarite', 'Kangaskhanite', 'Lucarionite'],
        onModifyPriority: function (priority, pokemon, target, move) {
            if (move && pokemon.speed > 0) {
                return priority + Math.floor((pokemon.speed - 1)/150);
            } else if (move && pokemon.speed < 0) {
                return -(priority + Math.floor((-pokemon.speed - 1)/150));
            } else {
                return priority;
            }
        }
    },
Thread
config/formats.js
Code:
    {
        name: "Burning 'Mon",
        section: "Other Metagames",

        ruleset: ['Pokemon', 'Standard', 'Team Preview'],
        banlist: ['Mewtwo', 'Lugia', 'Ho-Oh', 'Blaziken', 'Kyogre', 'Rayquaza', 'Deoxys', 'Deoxys-Attack', 'Deoxys-Defense', 'Deoxys-Speed', 'Dialga', 'Palkia', 'Giratina', 'Girainta-Origin', 'Darkrai', 'Shaymin-Sky', 'Arceus', 'Reshiram', 'Kyurem-White', 'Xerneas', 'Yveltal', 'Soul Dew', 'Gengarite', 'Salamencite', 'Red Orb'],
        onBegin: function () {
            this.add('-message', "Hah! You better have BURN HEAL!"); //This message is optional. Feel free to get rid of it if you don't want it.
            for (var i = 0; i < this.p1.pokemon.length; i++) {
                if (this.p1.pokemon[i].runImmunity('brn')) {
                    this.p1.pokemon[i].status = 'brn';
                }
            }
            for (var j = 0; j < this.p2.pokemon.length; j++) {
                if (this.p2.pokemon[j].runImmunity('brn')) {
                    this.p2.pokemon[j].status = 'brn';
                }
            }
        },
        onResidualOrder: 999, //This will always occur as the last possible occurence of the turn's residual phase.
        onResidual: function () {
            this.p1.pokemon[0].trySetStatus('brn');
            this.p2.pokemon[0].trySetStatus('brn');
            //Trust me I tried pokemon.trySetStatus it doesn't work ;_;
        }
    },
 
Last edited:

Users Who Are Viewing This Thread (Users: 1, Guests: 0)

Top