holy cow this is long
https://github.com/Zarel/Pokemon-Showdown/blob/master/data/random-teams.js <- Scroll down to "items" to read the code for how they're generated
sorry about not including the closing bracket
else if (this.getEffectiveness('Ground', template) >= 2 && ability !== 'Levitate' && !hasMove['magnetrise']) {
item = 'Air Balloon';
maybe make balloon only spawn if number of attacks is 3 or more and the mon is quad weak to ground, wasted slot when it gets put onto anything with a ground weak
else if (hasType['Grass'] && template.baseStats.spe <= 70 && hasMove['sleeppowder'] && counter.setupType && !teamDetails.zMove) {
item = 'Grassium Z';
I guess this causes z-grass on sleep powder bellossom and sleep powder carnivine; they're too slow to make this work (is that supposed to be a greater than?) and I don't really understand the logic
else if (slot === 0 && ability !== 'Regenerator' && ability !== 'Sturdy' && !counter['recoil'] && !counter['recovery'] && template.baseStats.hp + template.baseStats.def + template.baseStats.spd < 285) {
item = 'Focus Sash';
maybe add a check for pain split (not in the recovery counter but kind of like a recovery move?)? also restrict if there are hazard clearing moves
else if (ability === 'Super Luck') {
item = 'Scope Lens';
move this below the leftovers line or just delete? this is why unfezant always gets scope lens... I would genuinely be more enthused by silk scarf unfezant even
else if (hasMove['raindance']) {
item = (ability === 'Swift Swim' && counter.Status < 2) ? 'Life Orb' : 'Damp Rock';
} else if (hasMove['sunnyday']) {
item = (ability === 'Chlorophyll' && counter.Status < 2) ? 'Life Orb' : 'Heat Rock';
the rocks are kind of bad on anything that isn't phione; they end up on swanna (which has rain dance / roost or defog to proc this despite doing just fine with LO + 2 attacks) as well as some other mons that don't need them, they want to sweep with LO instead of not having that crucial 1.3 boost then just dying because they can't do enough damage
else if (counter.damagingMoves.length >= 3 && ability !== 'Sturdy' && !hasMove['acidspray'] && !hasMove['dragontail'] && !hasMove['foulplay'] && !hasMove['rapidspin'] && !hasMove['superfang']) {
item = (template.baseStats.hp + template.baseStats.def + template.baseStats.spd < 285 || !!counter['speedsetup'] || hasMove['trickroom']) ? 'Life Orb' : 'Leftovers';
this stat total is on the high end; this is why pokemon like lanturn (259), gastrodon (261), quagsire (245), escavalier (280) and a lot of others have life orb when they should have leftovers. maybe factor in speed also?
scald with SpA < 80 shouldn't count (lumineon uses scald to fish for burns, not for the damage), clear smog shouldn't count as an attack (gastro has this problem), u-turn and knock off shouldn't count for pokemon with no STAB & low attack (arbitrarily, <80)... gastrodon especially is a tangle of different issues as even recover + 3 attacks will still give it LO unless the stat total is changed
exclude if the mon has hazard clearing moves in general (good that rapid spin doesn't allow LO, bad that defog doesn't also since the combo of LO damage + hazards damage doesn't allow a hazard clearing mon to clear hazards without losing half of its health switching in)
else if (counter.Physical + counter.Special >= 4 && template.baseStats.spd >= 65 && template.baseStats.hp + template.baseStats.def + template.baseStats.spd >= 235) {
item = 'Assault Vest';
I guess this is why a bunch of garbage has assault vest; restrict if it has rapid spin, why is this total so low but the leftovers one is so high
} else if (ability === 'Sheer Force') {
rejectAbility = !counter['sheerforce'] || template.isMega || (abilities.includes('Iron Fist') && counter['ironfist'] > counter['sheerforce']);
maybe if one of the sheer force moves is STAB, ok, else, if the number of sheer force moves is greater than 1, ok, else reject (removes hariyama / braviary / conkeldurr, keeps gunk shot + fire punch druddigon)
reject natural cure if the pokemon has regenerator? I hope you don't mind hard coding just for corsola
will stop for now but maybe will post a bit more later