Curious about what we're currently doing about bots? Check out the latest updates from staff in this thread.
Welcome to Smogon! Take a moment to read the Introduction to Smogon for a run-down on everything Smogon, and make sure you take some time to read the global rules.
I made this in a couple minutes for bam.psim.us and figured I may as well post it here:
Pre EV Limit BH Hide
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.
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/
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
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: !
Log in Terminal
|gametype|singles
|gen|6
|tier|Immunimons
|rule|Sleep Clause Mod: Limit one foe put to sleep
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.
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).
How to run
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.
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.
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.
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.
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.
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 mods/littlelegendcup/scripts.js
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;
}
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);
}
}
}
};
Old version (with lowered priority)
mods/godsandfollowers/rulesets.js
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;
}
}
}
};
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)
{
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 ;_;
}
},