Skip to content

Commit

Permalink
Gen 9 Random Battle updates (#9977)
Browse files Browse the repository at this point in the history
* Randomized set updates

* Code cleanup

* Minior tera types

* Fix Doubles Torterra

* Apply suggestions from code review

---------

Co-authored-by: Kris Johnson <[email protected]>
  • Loading branch information
livid-washed and KrisXV authored Dec 17, 2023
1 parent 88d8572 commit e59bdc3
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 58 deletions.
24 changes: 7 additions & 17 deletions data/random-sets.json
Original file line number Diff line number Diff line change
Expand Up @@ -1013,14 +1013,14 @@
"level": 87,
"sets": [
{
"role": "Bulky Setup",
"role": "Fast Bulky Setup",
"movepool": ["Giga Drain", "Quiver Dance", "Sleep Powder", "Strength Sap"],
"teraTypes": ["Poison", "Steel", "Water"]
},
{
"role": "Fast Bulky Setup",
"movepool": ["Giga Drain", "Quiver Dance", "Sludge Bomb", "Strength Sap"],
"teraTypes": ["Poison"]
"role": "Bulky Setup",
"movepool": ["Giga Drain", "Moonblast", "Quiver Dance", "Sludge Bomb", "Strength Sap"],
"teraTypes": ["Fairy", "Poison"]
},
{
"role": "Tera Blast user",
Expand Down Expand Up @@ -2804,7 +2804,7 @@
"sets": [
{
"role": "Bulky Support",
"movepool": ["Encore", "Knock Off", "Light Screen", "Psychic Noise", "Reflect", "Stealth Rock", "Thunder Wave", "U-turn", "Yawn"],
"movepool": ["Encore", "Knock Off", "Light Screen", "Psychic", "Psychic Noise", "Reflect", "Stealth Rock", "Thunder Wave", "U-turn", "Yawn"],
"teraTypes": ["Dark", "Electric", "Steel"]
}
]
Expand Down Expand Up @@ -3369,7 +3369,7 @@
},
{
"role": "Setup Sweeper",
"movepool": ["Petal Dance", "Pollen Puff", "Quiver Dance", "Sleep Powder"],
"movepool": ["Alluring Voice", "Petal Dance", "Quiver Dance", "Sleep Powder"],
"teraTypes": ["Grass"]
}
]
Expand Down Expand Up @@ -3941,11 +3941,6 @@
"role": "Bulky Setup",
"movepool": ["Calm Mind", "Hydro Pump", "Secret Sword", "Substitute", "Surf"],
"teraTypes": ["Steel"]
},
{
"role": "Tera Blast user",
"movepool": ["Calm Mind", "Hydro Pump", "Secret Sword", "Tera Blast"],
"teraTypes": ["Ice"]
}
]
},
Expand Down Expand Up @@ -4186,11 +4181,6 @@
"role": "AV Pivot",
"movepool": ["Draco Meteor", "Dragon Tail", "Earthquake", "Fire Blast", "Heavy Slam", "Hydro Pump", "Knock Off", "Thunderbolt"],
"teraTypes": ["Electric", "Fire", "Ground", "Water"]
},
{
"role": "Bulky Setup",
"movepool": ["Body Press", "Curse", "Heavy Slam", "Rest"],
"teraTypes": ["Fighting"]
}
]
},
Expand Down Expand Up @@ -4635,7 +4625,7 @@
{
"role": "Setup Sweeper",
"movepool": ["Acrobatics", "Earthquake", "Power Gem", "Shell Smash"],
"teraTypes": ["Flying", "Ground"]
"teraTypes": ["Flying", "Ground", "Steel", "Water"]
}
]
},
Expand Down
61 changes: 20 additions & 41 deletions data/random-teams.ts
Original file line number Diff line number Diff line change
Expand Up @@ -520,11 +520,10 @@ export class RandomTeams {
[SETUP, HAZARDS],
[SETUP, ['defog', 'nuzzle', 'toxic', 'waterspout', 'yawn', 'haze']],
[PHYSICAL_SETUP, PHYSICAL_SETUP],
['curse', 'irondefense'],
[SPECIAL_SETUP, 'thunderwave'],
['substitute', PIVOT_MOVES],
[SPEED_SETUP, ['aquajet', 'rest', 'trickroom']],
['curse', 'rapidspin'],
['curse', ['irondefense', 'rapidspin']],
['dragondance', 'dracometeor'],

// These attacks are redundant with each other
Expand All @@ -550,7 +549,6 @@ export class RandomTeams {
['taunt', 'disable'],
['toxic', ['willowisp', 'thunderwave']],
[['thunderwave', 'toxic', 'willowisp'], 'toxicspikes'],
['thunderwave', 'yawn'],

// This space reserved for assorted hardcodes that otherwise make little sense out of context
// Landorus and Thundurus
Expand All @@ -577,6 +575,8 @@ export class RandomTeams {

if (!types.includes('Dark') && teraType !== 'Dark') this.incompatibleMoves(moves, movePool, 'knockoff', 'suckerpunch');

if (!abilities.has('Prankster')) this.incompatibleMoves(moves, movePool, 'thunderwave', 'yawn');

// This space reserved for assorted hardcodes that otherwise make little sense out of context
if (species.id === 'luvdisc') {
this.incompatibleMoves(moves, movePool, ['charm', 'flipturn', 'icebeam'], ['charm', 'flipturn']);
Expand Down Expand Up @@ -714,28 +714,12 @@ export class RandomTeams {
movePool, teraType, role);
}

// Enforce Sticky Web
if (movePool.includes('stickyweb')) {
counter = this.addMove('stickyweb', moves, types, abilities, teamDetails, species, isLead, isDoubles,
movePool, teraType, role);
}

// Enforce Revelation Dance
if (movePool.includes('revelationdance')) {
counter = this.addMove('revelationdance', moves, types, abilities, teamDetails, species, isLead, isDoubles,
movePool, teraType, role);
}

// Enforce Revival Blessing
if (movePool.includes('revivalblessing')) {
counter = this.addMove('revivalblessing', moves, types, abilities, teamDetails, species, isLead, isDoubles,
movePool, teraType, role);
}

// Enforce Salt Cure
if (movePool.includes('saltcure')) {
counter = this.addMove('saltcure', moves, types, abilities, teamDetails, species, isLead, isDoubles,
movePool, teraType, role);
// Enforce Night Shade, Revelation Dance, Revival Blessing, and Sticky Web
for (const moveid of ['nightshade', 'revelationdance', 'revivalblessing', 'stickyweb']) {
if (movePool.includes(moveid)) {
counter = this.addMove(moveid, moves, types, abilities, teamDetails, species, isLead, isDoubles,
movePool, teraType, role);
}
}

// Enforce Trick Room on Doubles Wallbreaker
Expand Down Expand Up @@ -780,14 +764,6 @@ export class RandomTeams {
}
}

// Apparently, nothing else currently in Random Battles requires special code to enforce Night Shade/Stoss
if (species.id === 'deoxysdefense') {
if (movePool.includes('nightshade')) {
counter = this.addMove('nightshade', moves, types, abilities, teamDetails, species, isLead, isDoubles,
movePool, teraType, role);
}
}

// Enforce moves in doubles
if (isDoubles) {
const doublesEnforcedMoves = ['auroraveil', 'mortalspin', 'spore'];
Expand Down Expand Up @@ -1024,8 +1000,8 @@ export class RandomTeams {
): boolean {
if ([
'Armor Tail', 'Battle Bond', 'Early Bird', 'Flare Boost', 'Galvanize', 'Gluttony', 'Harvest', 'Hydration', 'Ice Body', 'Immunity',
'Marvel Scale', 'Misty Surge', 'Moody', 'Own Tempo', 'Pressure', 'Quick Feet', 'Rain Dish', 'Sand Veil', 'Sniper', 'Snow Cloak',
'Steadfast', 'Steam Engine',
'Liquid Voice', 'Marvel Scale', 'Misty Surge', 'Moody', 'Own Tempo', 'Pressure', 'Quick Feet', 'Rain Dish', 'Sand Veil', 'Shed Skin',
'Sniper', 'Snow Cloak', 'Steadfast', 'Steam Engine',
].includes(ability)) return true;

switch (ability) {
Expand Down Expand Up @@ -1099,8 +1075,6 @@ export class RandomTeams {
return species.id === 'wyrdeer';
case 'Seed Sower':
return role === 'Bulky Support';
case 'Shed Skin':
return species.id === 'seviper' || species.id === 'arbok';
case 'Sheer Force':
const braviaryCase = (species.id === 'braviaryhisui' && (role === 'Wallbreaker' || role === 'Bulky Protect'));
const abilitiesCase = (abilities.has('Guts') || abilities.has('Sharpness'));
Expand Down Expand Up @@ -1165,13 +1139,18 @@ export class RandomTeams {
if (species.id === 'florges') return 'Flower Veil';
if (species.id === 'scovillain') return 'Chlorophyll';
if (species.id === 'empoleon') return 'Competitive';
if (species.id === 'dodrio') return 'Early Bird';
if (species.id === 'chandelure') return 'Flash Fire';
if (species.id === 'golemalola' && moves.has('doubleedge')) return 'Galvanize';
if (abilities.has('Guts') && (moves.has('facade') || moves.has('sleeptalk') || species.id === 'gurdurr')) return 'Guts';
if (species.id === 'copperajah' && moves.has('heavyslam')) return 'Heavy Metal';
if (species.id === 'jumpluff') return 'Infiltrator';
if (species.id === 'toucannon' && !counter.get('sheerforce') && !counter.get('skillink')) return 'Keen Eye';
if (species.id === 'reuniclus') return (role === 'AV Pivot') ? 'Regenerator' : 'Magic Guard';
if (species.id === 'smeargle') return 'Own Tempo';
// If Ambipom doesn't qualify for Technician, Skill Link is useless on it
if (species.id === 'ambipom' && !counter.get('technician')) return 'Pickup';
if (species.id === 'sandaconda' || moves.has('rest')) return 'Shed Skin';
if (species.id === 'cetitan' && (role === 'Wallbreaker' || isDoubles)) return 'Sheer Force';
if (species.id === 'ribombee') return 'Shield Dust';
if (species.id === 'dipplin') return 'Sticky Hold';
Expand Down Expand Up @@ -1355,7 +1334,7 @@ export class RandomTeams {
if (moves.has('populationbomb')) return 'Wide Lens';
if (
(moves.has('scaleshot') && role !== 'Choice Item user') ||
(counter.get('setup') && (species.id === 'torterra' || species.id === 'cinccino'))
(counter.get('setup') && ((species.id === 'torterra' && !isDoubles) || species.id === 'cinccino'))
) return 'Loaded Dice';
if (ability === 'Unburden') return moves.has('closecombat') ? 'White Herb' : 'Sitrus Berry';
if (moves.has('shellsmash') && ability !== 'Weak Armor') return 'White Herb';
Expand Down Expand Up @@ -1486,18 +1465,18 @@ export class RandomTeams {
);
return (scarfReqs && this.randomChance(1, 2)) ? 'Choice Scarf' : 'Choice Specs';
}
if (counter.get('speedsetup') && role === 'Bulky Setup') return 'Weakness Policy';
if (
!counter.get('Status') &&
(moves.has('rapidspin') || !['Fast Attacker', 'Wallbreaker', 'Tera Blast user'].includes(role))
) {
return 'Assault Vest';
}
if (counter.get('speedsetup') && role === 'Bulky Setup') return 'Weakness Policy';
if (species.id === 'golem') return 'Custap Berry';
if (species.id === 'urshifurapidstrike') return 'Punching Glove';
if (species.id === 'palkia') return 'Lustrous Orb';
if (moves.has('substitute') || ability === 'Moody') return 'Leftovers';
if (moves.has('stickyweb') && isLead) return 'Focus Sash';
if (moves.has('substitute')) return 'Leftovers';
if (moves.has('stickyweb') && species.id !== 'araquanid' && isLead) return 'Focus Sash';
if (this.dex.getEffectiveness('Rock', species) >= 1) return 'Heavy-Duty Boots';
if (
(moves.has('chillyreception') || (
Expand Down

0 comments on commit e59bdc3

Please sign in to comment.