Created
December 30, 2016 07:11
-
-
Save Spandamn/4f7826f1a47fbaf902032d73c1d6356a to your computer and use it in GitHub Desktop.
This is the code for Modless Tier Shift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
name: "Tier Shift", | |
onBegin: function () { | |
let allPokemon = this.p1.pokemon.concat(this.p2.pokemon); | |
let boosts = { | |
'UU': 5, | |
'BL2': 5, | |
'RU': 10, | |
'BL3': 10, | |
'NU': 15, | |
'BL4': 15, | |
'PU': 20, | |
'NFE': 20, | |
'LC Uber': 20, | |
'LC': 20, | |
}; | |
for (let i = 0, len = allPokemon.length; i < len; i++) { | |
let pokemon = allPokemon[i]; | |
let template = pokemon.baseTemplate; | |
let tier = template.tier; | |
if (pokemon.set.item) { | |
let item = this.getItem(pokemon.set.item); | |
if (item.megaEvolves === template.species) tier = this.getTemplate(item.megaStone).tier; | |
} | |
if (tier.charAt(0) === '(') tier = tier.slice(1, -1); | |
let boost = (tier in boosts) ? boosts[tier] : 0; | |
let baseStats = {}; | |
for (let statName in template.baseStats) { | |
baseStats[statName] = this.clampIntRange(template.baseStats[statName] + boost, 1, 255); | |
} | |
pokemon.hp = pokemon.maxhp = Math.floor(Math.floor(2 * template.baseStats['hp'] + pokemon.set.ivs['hp'] + Math.floor(pokemon.set.evs['hp'] >> 2) + 100) * pokemon.level / 100 + 10); | |
pokemon.template = template; | |
pokemon.formeChange(template); | |
} | |
}, | |
ruleset: ['OU'], | |
}, |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment