Skip to content

Commit

Permalink
Improvements to BD/SP Random Battles
Browse files Browse the repository at this point in the history
  • Loading branch information
AnnikaCodes committed Nov 25, 2021
1 parent 93661e1 commit a3c4c69
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 22 deletions.
12 changes: 7 additions & 5 deletions data/mods/gen8bdsp/formats-data.ts
Expand Up @@ -31,7 +31,7 @@ export const FormatsData: {[k: string]: ModdedSpeciesFormatsData} = {
blastoise: {
tier: "OU",
doublesTier: "DOU",
randomBattleMoves: ["scald", "rapidspin", "protect", "icebeam", "roar"],
randomBattleMoves: ["earthquake", "icebeam", "protect", "rapidspin", "roar", "scald"],
},
caterpie: {
tier: "LC",
Expand All @@ -42,7 +42,7 @@ export const FormatsData: {[k: string]: ModdedSpeciesFormatsData} = {
butterfree: {
tier: "OU",
doublesTier: "DOU",
randomBattleMoves: ["quiverdance", "bugbuzz", "airslash", "sleeppowder", "airslash", "gigadrain"],
randomBattleMoves: ["quiverdance", "bugbuzz", "airslash", "sleeppowder", "gigadrain"],
},
weedle: {
tier: "LC",
Expand Down Expand Up @@ -902,13 +902,15 @@ export const FormatsData: {[k: string]: ModdedSpeciesFormatsData} = {
honchkrow: {
tier: "OU",
doublesTier: "DOU",
randomBattleMoves: ["bravebird", "suckerpunch", "roost", "taunt"],
},
misdreavus: {
tier: "LC",
},
mismagius: {
tier: "OU",
doublesTier: "DOU",
randomBattleMoves: ["dazzlinggleam", "destinybond", "nastyplot", "shadowball", "substitute", "thunderwave"],
},
unown: {
tier: "OU",
Expand Down Expand Up @@ -1031,7 +1033,7 @@ export const FormatsData: {[k: string]: ModdedSpeciesFormatsData} = {
mantine: {
tier: "OU",
doublesTier: "DOU",
randomBattleMoves: ["scald", "icebeam", "defog", "rest", "sleeptalk"],
randomBattleMoves: ["scald", "icebeam", "defog", "roost"],
},
skarmory: {
tier: "OU",
Expand Down Expand Up @@ -1398,7 +1400,7 @@ export const FormatsData: {[k: string]: ModdedSpeciesFormatsData} = {
wailord: {
tier: "OU",
doublesTier: "DOU",
randomBattleMoves: ["icebeam", "hydropump", "icebeam", "waterspout"],
randomBattleMoves: ["icebeam", "hydropump", "rest", "sleeptalk", "waterspout"],
},
numel: {
tier: "LC",
Expand Down Expand Up @@ -1805,7 +1807,7 @@ export const FormatsData: {[k: string]: ModdedSpeciesFormatsData} = {
wormadamtrash: {
tier: "OU",
doublesTier: "DOU",
randomBattleMoves: ["bugbuzz", "dig", "ironhead", "stealthrock"],
randomBattleMoves: ["bugbuzz", "dig", "flashcannon", "quiverdance", "stealthrock"],
},
mothim: {
tier: "OU",
Expand Down
13 changes: 12 additions & 1 deletion data/mods/gen8bdsp/random-teams.ts
Expand Up @@ -36,7 +36,7 @@ export class RandomBDSPTeams extends RandomTeams {
if ((moves.has('bellydrum') || moves.has('tailglow')) && moves.has('substitute')) return 'Salac Berry';

// Ability based logic and miscellaneous logic
if (species.name === 'Wobbuffet' || ability === 'Ripen') return 'Sitrus Berry';
if (species.name === 'Wobbuffet' || ability === 'Ripen' || ability === 'Harvest') return 'Sitrus Berry';
if (ability === 'Gluttony') return this.sample(['Aguav', 'Figy', 'Iapapa', 'Mago', 'Wiki']) + ' Berry';
if (ability === 'Imposter') return 'Choice Scarf';
if (ability === 'Guts' && counter.get('Physical') > 2) {
Expand Down Expand Up @@ -70,6 +70,17 @@ export class RandomBDSPTeams extends RandomTeams {
isNoDynamax: boolean
): string | undefined {
// Choice items
if (moves.size === 1) {
switch (this.dex.moves.get([...moves][0]).category) {
case 'Status':
return 'Choice Scarf';
case 'Physical':
return 'Choice Band';
case 'Special':
return 'Choice Specs';
}
}

if (
counter.get('Physical') >= 4 && ability !== 'Serene Grace' &&
['fakeout', 'flamecharge', 'rapidspin'].every(m => !moves.has(m))
Expand Down
18 changes: 2 additions & 16 deletions data/random-teams.ts
Expand Up @@ -1994,22 +1994,8 @@ export class RandomTeams {
level = customScale[species.id] || tierScale[tier];
// BDSP tier levelling
} else if (this.dex.currentMod === 'gen8bdsp') {
const tierScale: {[k: string]: number} = {
Uber: 76,
OU: 80,
UUBL: 81,
UU: 82,
RUBL: 83,
RU: 84,
NUBL: 85,
NU: 86,
PUBL: 87,
PU: 88, "(PU)": 88, NFE: 88,
};
// to override tier scaling if needed
const customScale: {[k: string]: number} = {};

level = customScale[species.id] || tierScale[species.tier];
// TODO: figure out BDSP levelling based on the in-room poll
level = 80;
// Arbitrary levelling base on data files (typically winrate-influenced)
} else if (species.randomBattleLevel) {
level = species.randomBattleLevel;
Expand Down
11 changes: 11 additions & 0 deletions test/random-battles/gen8.js
Expand Up @@ -209,4 +209,15 @@ describe('[Gen 8 BDSP] Random Battle', () => {
});
});
}

it('should give Tropius Harvest + Sitrus Berry', () => {
testSet('tropius', options, set => {
assert.equal(set.item, 'Sitrus Berry');
assert.equal(set.ability, 'Harvest');
});
});

it('should give Unown a Choice item', () => {
testSet('unown', options, set => assert.match(set.item, /^Choice /));
});
});

0 comments on commit a3c4c69

Please sign in to comment.