Random Battles updates (#9393)

* Random Battles updates

* rip shadow force i guess

* Update random-sets.json

* readd cm arc ghost

* revert wet tauros changes due to technical diff

* Random Battles: Don't count Raging Bull as a normal move on Tauros-Paldea formes

* linting

* add raging bull to tauros aqua

* Random Battles: Shuffle moves at the end of generation

* articuno update

* quick updates

* Update random-sets.json

* fully revert raichu changes, av is good

* tera blast user shenanigans

* Update random-teams.ts

remove extraneous hardcode for sylveon
add new framework for bulkier tera blast users

---------

Co-authored-by: adrivrie <adriaan.de.vries@hotmail.com>
This commit is contained in:
ACakeWearingAHat 2023-02-12 17:37:32 -06:00 committed by GitHub
parent cf26f3f3f4
commit 6704dcdfa6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 95 additions and 100 deletions

View File

@ -329,12 +329,12 @@
"sets": [
{
"role": "Fast Bulky Setup",
"movepool": ["Bulk Up", "Close Combat", "Liquidation", "Substitute"],
"movepool": ["Bulk Up", "Close Combat", "Liquidation", "Raging Bull", "Substitute"],
"teraTypes": ["Water"]
},
{
"role": "Wallbreaker",
"movepool": ["Aqua Jet", "Bulk Up", "Close Combat", "Liquidation", "Stone Edge", "Wave Crash"],
"movepool": ["Aqua Jet", "Bulk Up", "Close Combat", "Raging Bull", "Stone Edge", "Wave Crash"],
"teraTypes": ["Water"]
}
]
@ -406,7 +406,7 @@
{
"role": "Bulky Support",
"movepool": ["Air Slash", "Freeze-Dry", "Haze", "Hurricane", "Roost", "Substitute", "U-turn"],
"teraTypes": ["Flying", "Steel"]
"teraTypes": ["Flying", "Steel", "Ground", "Poison"]
}
]
},
@ -745,7 +745,7 @@
"sets": [
{
"role": "Setup Sweeper",
"movepool": ["Close Combat", "Facade", "Swords Dance", "Throat Chop"],
"movepool": ["Close Combat", "Facade", "Throat Chop", "Trailblaze"],
"teraTypes": ["Normal"]
},
{
@ -761,7 +761,7 @@
{
"role": "Bulky Attacker",
"movepool": ["Body Slam", "Crunch", "Earthquake", "Rest", "Sleep Talk"],
"teraTypes": ["Ground", "Normal"]
"teraTypes": ["Ground", "Ghost"]
}
]
},
@ -1317,11 +1317,6 @@
"role": "Fast Attacker",
"movepool": ["Close Combat", "Gunk Shot", "Ice Punch", "Sucker Punch", "Swords Dance"],
"teraTypes": ["Dark", "Fighting"]
},
{
"role": "Setup Sweeper",
"movepool": ["Dark Pulse", "Focus Blast", "Nasty Plot", "Sludge Bomb", "Vacuum Wave"],
"teraTypes": ["Dark", "Fighting", "Poison"]
}
]
},
@ -1381,7 +1376,7 @@
{
"role": "Tera Blast user",
"movepool": ["Flash Cannon", "Tera Blast", "Thunderbolt", "Volt Switch"],
"teraTypes": ["Fire"]
"teraTypes": ["Water", "Fire"]
}
]
},
@ -1641,7 +1636,7 @@
{
"role": "Bulky Setup",
"movepool": ["Calm Mind", "Fire Blast", "Judgment", "Recover", "Sludge Bomb"],
"teraTypes": ["Dark", "Poison", "Fire"]
"teraTypes": ["Ghost", "Poison", "Fire"]
}
]
},
@ -1652,6 +1647,11 @@
"role": "Setup Sweeper",
"movepool": ["Earthquake", "Extreme Speed", "Gunk Shot", "Outrage", "Swords Dance"],
"teraTypes": ["Ground"]
},
{
"role": "Bulky Setup",
"movepool": ["Calm Mind", "Fire Blast", "Judgment", "Sludge Bomb"],
"teraTypes": ["Fire"]
}
]
},
@ -1671,7 +1671,7 @@
{
"role": "Bulky Setup",
"movepool": ["Calm Mind", "Earth Power", "Fire Blast", "Judgment", "Recover"],
"teraTypes": ["Fairy", "Ground", "Fire"]
"teraTypes": ["Steel", "Ground", "Fire"]
}
]
},
@ -1681,7 +1681,7 @@
{
"role": "Bulky Setup",
"movepool": ["Body Press", "Cosmic Power", "Recover", "Stored Power"],
"teraTypes": ["Steel"]
"teraTypes": ["Steel", "Psychic"]
}
]
},
@ -1692,6 +1692,11 @@
"role": "Setup Sweeper",
"movepool": ["Earthquake", "Extreme Speed", "Flare Blitz", "Liquidation", "Recover", "Swords Dance"],
"teraTypes": ["Fire", "Ground", "Water"]
},
{
"role": "Fast Bulky Setup",
"movepool": ["Calm Mind", "Earth Power", "Ice Beam", "Judgment", "Recover", "Thunderbolt"],
"teraTypes": ["Ground", "Electric"]
}
]
},
@ -1700,18 +1705,23 @@
"sets": [
{
"role": "Bulky Setup",
"movepool": ["Calm Mind", "Earth Power", "Fire Blast", "Judgment", "Recover"],
"teraTypes": ["Flying", "Ground"]
"movepool": ["Calm Mind", "Earth Power", "Judgment", "Recover"],
"teraTypes": ["Steel", "Ground"]
}
]
},
"arceusghost": {
"level": 70,
"sets": [
{
"role": "Bulky Support",
"movepool": ["Focus Blast", "Hex", "Recover", "Will-O-Wisp"],
"teraTypes": ["Fighting", "Normal"]
},
{
"role": "Bulky Setup",
"movepool": ["Calm Mind", "Focus Blast", "Judgment", "Recover"],
"teraTypes": ["Fighting", "Ghost"]
"teraTypes": ["Fighting", "Normal", "Ghost"]
}
]
},
@ -1721,12 +1731,12 @@
{
"role": "Setup Sweeper",
"movepool": ["Calm Mind", "Earth Power", "Ice Beam", "Judgment"],
"teraTypes": ["Grass", "Ground"]
"teraTypes": ["Ground"]
},
{
"role": "Bulky Setup",
"movepool": ["Calm Mind", "Fire Blast", "Judgment", "Recover"],
"teraTypes": ["Grass", "Fire"]
"teraTypes": ["Fire"]
}
]
},
@ -1736,7 +1746,12 @@
{
"role": "Bulky Setup",
"movepool": ["Calm Mind", "Fire Blast", "Ice Beam", "Judgment", "Recover"],
"teraTypes": ["Ground"]
"teraTypes": ["Ground", "Dragon"]
},
{
"role": "Setup Sweeper",
"movepool": ["Earthquake", "Extreme Speed", "Stone Edge", "Swords Dance"],
"teraTypes": ["Normal"]
}
]
},
@ -1756,7 +1771,7 @@
{
"role": "Setup Sweeper",
"movepool": ["Earthquake", "Flare Blitz", "Gunk Shot", "Liquidation", "Recover", "Swords Dance"],
"teraTypes": ["Poison", "Ground", "Fire", "Water"]
"teraTypes": ["Ground", "Fire", "Water"]
}
]
},
@ -1775,8 +1790,8 @@
"sets": [
{
"role": "Bulky Setup",
"movepool": ["Calm Mind", "Earth Power", "Fire Blast", "Ice Beam", "Judgment", "Recover"],
"teraTypes": ["Ground", "Rock"]
"movepool": ["Calm Mind", "Earth Power", "Fire Blast", "Judgment", "Recover"],
"teraTypes": ["Ground", "Dragon"]
}
]
},
@ -1795,7 +1810,7 @@
"sets": [
{
"role": "Bulky Support",
"movepool": ["Judgment", "Recover", "Taunt", "Will-O-Wisp"],
"movepool": ["Ice Beam", "Judgment", "Recover", "Taunt", "Will-O-Wisp"],
"teraTypes": ["Steel"]
}
]
@ -2023,7 +2038,7 @@
"sets": [
{
"role": "Fast Support",
"movepool": ["Calm Mind", "Defog", "Heat Wave", "Hurricane", "Psychic"],
"movepool": ["Defog", "Heat Wave", "Hurricane", "Psychic"],
"teraTypes": ["Psychic", "Flying"]
},
{
@ -2220,6 +2235,11 @@
"role": "Bulky Setup",
"movepool": ["Calm Mind", "Moonblast", "Protect", "Wish"],
"teraTypes": ["Steel"]
},
{
"role": "Tera Blast user",
"movepool": ["Calm Mind", "Moonblast", "Synthesis", "Tera Blast"],
"teraTypes": ["Ground"]
}
]
},
@ -2259,12 +2279,7 @@
{
"role": "Bulky Setup",
"movepool": ["Calm Mind", "Hyper Voice", "Protect", "Wish"],
"teraTypes": ["Fairy", "Steel"]
},
{
"role": "Tera Blast user",
"movepool": ["Calm Mind", "Hyper Voice", "Tera Blast", "Trailblaze"],
"teraTypes": ["Ground"]
"teraTypes": ["Steel"]
}
]
},
@ -2333,7 +2348,7 @@
"sets": [
{
"role": "Bulky Support",
"movepool": ["Foul Play", "Magnet Rise", "Play Rough", "Spikes", "Thunder Wave"],
"movepool": ["Magnet Rise", "Play Rough", "Spikes", "Thunder Wave"],
"teraTypes": ["Water"]
}
]
@ -2604,7 +2619,7 @@
{
"role": "Fast Support",
"movepool": ["High Jump Kick", "Play Rough", "Power Whip", "Rapid Spin", "Synthesis", "U-turn"],
"teraTypes": ["Fighting", "Grass"]
"teraTypes": ["Fighting", "Steel"]
}
]
},
@ -2799,12 +2814,12 @@
{
"role": "Bulky Setup",
"movepool": ["Coil", "Earthquake", "Glare", "Rest", "Stone Edge"],
"teraTypes": ["Ground"]
"teraTypes": ["Dragon", "Steel"]
},
{
"role": "Bulky Support",
"movepool": ["Earthquake", "Glare", "Rest", "Stealth Rock", "Stone Edge"],
"teraTypes": ["Ground"]
"teraTypes": ["Dragon", "Water"]
}
]
},
@ -2899,7 +2914,12 @@
{
"role": "Fast Attacker",
"movepool": ["Close Combat", "Megahorn", "No Retreat", "Poison Jab", "Rock Slide"],
"teraTypes": ["Fighting"]
"teraTypes": ["Fighting", "Ghost"]
},
{
"role": "Tera Blast user",
"movepool": ["Close Combat", "No Retreat", "Poison Jab", "Tera Blast"],
"teraTypes": ["Ghost"]
}
]
},
@ -3576,11 +3596,6 @@
"tatsugiri": {
"level": 84,
"sets": [
{
"role": "Tera Blast user",
"movepool": ["Draco Meteor", "Dragon Pulse", "Hydro Pump", "Nasty Plot", "Tera Blast"],
"teraTypes": ["Fire"]
},
{
"role": "Fast Support",
"movepool": ["Draco Meteor", "Hydro Pump", "Nasty Plot", "Rapid Spin", "Surf"],
@ -3794,7 +3809,7 @@
{
"role": "Bulky Attacker",
"movepool": ["Make It Rain", "Recover", "Shadow Ball", "Thunder Wave"],
"teraTypes": ["Steel", "Water"]
"teraTypes": ["Dark", "Water"]
}
]
},
@ -4083,7 +4098,7 @@
"sets": [
{
"role": "Bulky Support",
"movepool": ["Earth Power", "Giga Drain", "Knock Off", "Leaf Storm", "Rapid Spin", "Spore", "Toxic", "Toxic Spikes"],
"movepool": ["Earth Power", "Giga Drain", "Knock Off", "Leaf Storm", "Rapid Spin", "Spore", "Toxic"],
"teraTypes": ["Water"]
}
]

View File

@ -337,15 +337,7 @@ export class RandomTeams {
for (const moveid of moves) {
const move = this.dex.moves.get(moveid);
let moveType = move.type;
if (['judgment', 'revelationdance'].includes(moveid)) moveType = types[0];
if (moveType === 'Normal') {
if (abilities.has('Aerilate')) moveType = 'Flying';
if (abilities.has('Galvanize')) moveType = 'Electric';
if (abilities.has('Pixilate')) moveType = 'Fairy';
if (abilities.has('Refrigerate')) moveType = 'Ice';
}
if (moveid === 'terablast') moveType = teraType;
const moveType = this.getMoveType(move, species, abilities, teraType);
if (move.damage || move.damageCallback) {
// Moves that do a set amount of damage:
counter.add('damage');
@ -480,7 +472,7 @@ export class RandomTeams {
// These attacks are redundant with each other
this.incompatibleMoves(moves, movePool, 'psychic', 'psyshock');
this.incompatibleMoves(moves, movePool, 'surf', 'hydropump');
this.incompatibleMoves(moves, movePool, 'wavecrash', 'liquidation');
this.incompatibleMoves(moves, movePool, ['liquidation', 'ragingbull'], ['liquidation', 'wavecrash']);
this.incompatibleMoves(moves, movePool, ['airslash', 'bravebird', 'hurricane'], ['airslash', 'bravebird', 'hurricane']);
this.incompatibleMoves(moves, movePool, 'knockoff', 'foulplay');
this.incompatibleMoves(moves, movePool, 'doubleedge', 'headbutt');
@ -572,6 +564,27 @@ export class RandomTeams {
return counter;
}
// Returns the type of a given move for STAB/coverage enforcement purposes
getMoveType(move: Move, species: Species, abilities: Set<string>, teraType: string): string {
if (move.id === 'terablast') return teraType;
if (['judgment', 'revelationdance'].includes(move.id)) return species.types[0];
if (move.name === "Raging Bull" && species.name.startsWith("Tauros-Paldea")) {
if (species.name.endsWith("Combat")) return "Fighting";
if (species.name.endsWith("Blaze")) return "Fire";
if (species.name.endsWith("Aqua")) return "Water";
}
const moveType = move.type;
if (moveType === 'Normal') {
if (abilities.has('Aerilate')) return 'Flying';
if (abilities.has('Galvanize')) return 'Electric';
if (abilities.has('Pixilate')) return 'Fairy';
if (abilities.has('Refrigerate')) return 'Ice';
}
return moveType;
}
// Generate random moveset for a given species, role, tera type.
randomMoveset(
types: string[],
@ -651,13 +664,7 @@ export class RandomTeams {
const priorityMoves = [];
for (const moveid of movePool) {
const move = this.dex.moves.get(moveid);
let moveType = move.type;
if (moveType === 'Normal') {
if (abilities.has('Aerilate')) moveType = 'Flying';
if (abilities.has('Galvanize')) moveType = 'Electric';
if (abilities.has('Pixilate')) moveType = 'Fairy';
if (abilities.has('Refrigerate')) moveType = 'Ice';
}
const moveType = this.getMoveType(move, species, abilities, teraType);
if (types.includes(moveType) && move.priority > 0 && move.category !== 'Status') {
priorityMoves.push(moveid);
}
@ -676,15 +683,7 @@ export class RandomTeams {
const stabMoves = [];
for (const moveid of movePool) {
const move = this.dex.moves.get(moveid);
let moveType = move.type;
if (['judgment', 'revelationdance'].includes(moveid)) moveType = types[0];
if (moveType === 'Normal') {
if (abilities.has('Aerilate')) moveType = 'Flying';
if (abilities.has('Galvanize')) moveType = 'Electric';
if (abilities.has('Pixilate')) moveType = 'Fairy';
if (abilities.has('Refrigerate')) moveType = 'Ice';
}
if (moveid === 'terablast') moveType = teraType;
const moveType = this.getMoveType(move, species, abilities, teraType);
if (type === moveType &&
(move.basePower > 30 || move.multihit || move.basePowerCallback) &&
(!this.noStab.includes(moveid) || abilities.has('Technician') && moveid === 'machpunch')) {
@ -704,15 +703,7 @@ export class RandomTeams {
const stabMoves = [];
for (const moveid of movePool) {
const move = this.dex.moves.get(moveid);
let moveType = move.type;
if (['judgment', 'revelationdance'].includes(moveid)) moveType = types[0];
if (moveType === 'Normal') {
if (abilities.has('Aerilate')) moveType = 'Flying';
if (abilities.has('Galvanize')) moveType = 'Electric';
if (abilities.has('Pixilate')) moveType = 'Fairy';
if (abilities.has('Refrigerate')) moveType = 'Ice';
}
if (moveid === 'terablast') moveType = teraType;
const moveType = this.getMoveType(move, species, abilities, teraType);
if (!this.noStab.includes(moveid) && (move.basePower > 30 || move.multihit || move.basePowerCallback)) {
if (types.includes(moveType)) {
stabMoves.push(moveid);
@ -731,8 +722,7 @@ export class RandomTeams {
const stabMoves = [];
for (const moveid of movePool) {
const move = this.dex.moves.get(moveid);
let moveType = move.type;
if (['judgment', 'revelationdance'].includes(moveid)) moveType = types[0];
const moveType = this.getMoveType(move, species, abilities, teraType);
if (!this.noStab.includes(moveid) && (move.basePower > 30 || move.multihit || move.basePowerCallback)) {
if (teraType === moveType) {
stabMoves.push(moveid);
@ -783,30 +773,15 @@ export class RandomTeams {
for (const moveid of moves) {
const move = this.dex.moves.get(moveid);
if (move.basePower > 30 || move.multihit || move.basePowerCallback) {
let moveType = move.type;
if (['judgment', 'revelationdance'].includes(moveid)) moveType = types[0];
if (moveType === 'Normal') {
if (abilities.has('Aerilate')) moveType = 'Flying';
if (abilities.has('Galvanize')) moveType = 'Electric';
if (abilities.has('Pixilate')) moveType = 'Fairy';
if (abilities.has('Refrigerate')) moveType = 'Ice';
}
if (moveid === 'terablast') moveType = teraType;
currentAttackType = move.type;
const moveType = this.getMoveType(move, species, abilities, teraType);
currentAttackType = moveType;
}
}
// Choose an attacking move that is of different type to the current single attack
const coverageMoves = [];
for (const moveid of movePool) {
const move = this.dex.moves.get(moveid);
let moveType = move.type;
if (['judgment', 'revelationdance'].includes(moveid)) moveType = types[0];
if (moveType === 'Normal') {
if (abilities.has('Aerilate')) moveType = 'Flying';
if (abilities.has('Galvanize')) moveType = 'Electric';
if (abilities.has('Pixilate')) moveType = 'Fairy';
if (abilities.has('Refrigerate')) moveType = 'Ice';
}
const moveType = this.getMoveType(move, species, abilities, teraType);
if (!this.noStab.includes(moveid) && (move.basePower > 30 || move.multihit || move.basePowerCallback)) {
if (currentAttackType! !== moveType) coverageMoves.push(moveid);
}
@ -1241,8 +1216,9 @@ export class RandomTeams {
if (role === 'Fast Support' || role === 'Fast Bulky Setup') {
return (counter.damagingMoves.size >= 3 && !moves.has('nuzzle')) ? 'Life Orb' : 'Leftovers';
}
if (role === 'Tera Blast user' && counter.get('recovery') && counter.damagingMoves.size < 3) return 'Leftovers';
if (
['flamecharge', 'rapidspin', 'trailblaze'].every(m => !moves.has(m)) &&
['flamecharge', 'rapidspin'].every(m => !moves.has(m)) &&
['Fast Attacker', 'Setup Sweeper', 'Tera Blast user', 'Wallbreaker'].some(m => role === (m))
) return 'Life Orb';
if (isDoubles) return 'Sitrus Berry';
@ -1391,13 +1367,17 @@ export class RandomTeams {
evs.spe = 0;
ivs.spe = 0;
}
// shuffle moves to add more randomness to camomons
const shuffledMoves = Array.from(moves);
this.prng.shuffle(shuffledMoves);
return {
name: species.baseSpecies,
species: forme,
gender: species.gender,
shiny: this.randomChance(1, 1024),
level,
moves: Array.from(moves),
moves: shuffledMoves,
ability,
evs,
ivs,