Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
Ishaan0132 committed Jul 26, 2024
2 parents 47d7667 + 7b1f2d8 commit 65808ef
Show file tree
Hide file tree
Showing 16 changed files with 81 additions and 71 deletions.
21 changes: 11 additions & 10 deletions config/formats.ts
Original file line number Diff line number Diff line change
Expand Up @@ -499,11 +499,11 @@ export const Formats: import('../sim/dex-formats').FormatList = [
mod: 'gen9',
ruleset: ['Standard OMs', 'Sleep Clause Mod', 'Category Swap Mod'],
banlist: [
'Arceus', 'Calyrex-Ice', 'Calyrex-Shadow', 'Chi-Yu', 'Darkrai', 'Deoxys-Base', 'Deoxys-Attack', 'Deoxys-Speed', 'Dialga', 'Dialga-Origin', 'Eternatus', 'Giratina',
'Giratina-Origin', 'Groudon', 'Ho-Oh', 'Iron Valiant', 'Koraidon', 'Kyogre', 'Kyurem', 'Kyurem-Black', 'Kyurem-White', 'Landorus-Base', 'Lugia', 'Lunala', 'Magearna',
'Mewtwo', 'Miraidon', 'Necrozma-Dawn-Wings', 'Necrozma-Dusk-Mane', 'Palkia', 'Palkia-Origin', 'Rayquaza', 'Regieleki', 'Reshiram', 'Solgaleo', 'Spectrier', 'Terapagos',
'Volcarona', 'Zacian', 'Zacian-Crowned', 'Zamazenta-Crowned', 'Zekrom', 'Arena Trap', 'Moody', 'Shadow Tag', 'King\'s Rock', 'Razor Fang', 'Baton Pass', 'Draco Meteor',
'Last Respects', 'Overheat', 'Shed Tail',
'Arceus', 'Calyrex-Ice', 'Calyrex-Shadow', 'Chi-Yu', 'Darkrai', 'Deoxys-Base', 'Deoxys-Attack', 'Deoxys-Speed', 'Dialga', 'Dialga-Origin', 'Dragapult', 'Eternatus',
'Giratina', 'Giratina-Origin', 'Groudon', 'Ho-Oh', 'Iron Valiant', 'Koraidon', 'Kyogre', 'Kyurem', 'Kyurem-Black', 'Kyurem-White', 'Landorus-Base', 'Lugia', 'Lunala',
'Magearna', 'Mewtwo', 'Miraidon', 'Necrozma-Dawn-Wings', 'Necrozma-Dusk-Mane', 'Palkia', 'Palkia-Origin', 'Rayquaza', 'Regieleki', 'Reshiram', 'Roaring Moon', 'Solgaleo',
'Spectrier', 'Terapagos', 'Volcarona', 'Zacian', 'Zacian-Crowned', 'Zamazenta-Crowned', 'Zekrom', 'Arena Trap', 'Moody', 'Shadow Tag', 'Damp Rock', 'King\'s Rock',
'Razor Fang', 'Baton Pass', 'Draco Meteor', 'Last Respects', 'Overheat', 'Shed Tail',
],
},
{
Expand Down Expand Up @@ -970,7 +970,7 @@ export const Formats: import('../sim/dex-formats').FormatList = [
'Zamazenta-Crowned', 'Zekrom', 'Zoroark-Hisui', 'Arena Trap', 'Moody', 'Shadow Tag', 'King\'s Rock', 'Razor Fang', 'Baton Pass', 'Shed Tail',
],
restricted: [
'Acupressure', 'Belly Drum', 'Clangorous Soul', 'Dire Claw', 'Extreme Speed', 'Fillet Away', 'Gigaton Hammer', 'Last Respects', 'No Retreat',
'Acupressure', 'Belly Drum', 'Clangorous Soul', 'Dire Claw', 'Electro Shot', 'Extreme Speed', 'Fillet Away', 'Gigaton Hammer', 'Last Respects', 'No Retreat',
'Revival Blessing', 'Shell Smash', 'Shift Gear', 'Triple Arrows', 'V-create', 'Victory Dance', 'Wicked Blow',
],
},
Expand Down Expand Up @@ -2093,11 +2093,12 @@ export const Formats: import('../sim/dex-formats').FormatList = [
searchShow: false,
ruleset: ['[Gen 9] National Dex Ubers'],
banlist: [
'Arceus-Base', 'Arceus-Dark', 'Arceus-Ground', 'Calyrex-Ice', 'Deoxys-Attack', 'Deoxys-Speed', 'Ditto', 'Eternatus', 'Giratina-Origin', 'Glimmora',
'Groudon-Primal', 'Hatterene', 'Ho-Oh', 'Kyogre-Primal', 'Lunala', 'Marshadow', 'Melmetal', 'Mewtwo-Mega-Y', 'Necrozma-Dusk-Mane', 'Necrozma-Ultra',
'Rayquaza', 'Salamence-Mega', 'Yveltal', 'Zacian-Crowned', 'Zygarde-Base',
'Arceus-Base', 'Arceus-Dark', 'Arceus-Ground', 'Calyrex-Ice', 'Chansey', 'Deoxys-Attack', 'Ditto', 'Dondozo', 'Eternatus', 'Giratina-Origin', 'Glimmora',
'Groudon-Primal', 'Ho-Oh', 'Kyogre-Primal', 'Lunala', 'Marshadow', 'Melmetal', 'Mewtwo-Mega-Y', 'Necrozma-Dusk-Mane', 'Necrozma-Ultra', 'Rayquaza',
'Salamence-Mega', 'Smeargle', 'Yveltal', 'Zacian-Crowned', 'Zygarde-Base',
// UUBL
'Arceus-Fairy', 'Arceus-Ghost', 'Chi-Yu', 'Flutter Mane', 'Kyurem-Black', 'Shaymin-Sky', 'Zacian', 'Power Construct', 'Light Clay', 'Ultranecrozium Z', 'Last Respects',
'Arceus-Fairy', 'Arceus-Ghost', 'Blaziken-Mega', 'Chi-Yu', 'Flutter Mane', 'Kyogre', 'Kyurem-Black', 'Shaymin-Sky', 'Zacian', 'Zekrom',
'Power Construct', 'Light Clay', 'Ultranecrozium Z', 'Last Respects',
],
},
{
Expand Down
2 changes: 1 addition & 1 deletion data/formats-data.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3511,7 +3511,7 @@ export const FormatsData: import('../sim/dex-species').SpeciesFormatsDataTable =
mienshao: {
tier: "NU",
doublesTier: "(DUU)",
natDexTier: "RU",
natDexTier: "RUBL",
},
druddigon: {
isNonstandard: "Past",
Expand Down
10 changes: 5 additions & 5 deletions data/learnsets.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52310,27 +52310,27 @@ export const Learnsets: import('../sim/dex-species').LearnsetDataTable = {
},
rotomheat: {
learnset: {
overheat: ["9L1", "8L1", "7R", "6R", "5R", "4R"],
overheat: ["9R", "8R", "7R", "6R", "5R", "4R"],
},
},
rotomwash: {
learnset: {
hydropump: ["9L1", "8L1", "7R", "6R", "5R", "4R"],
hydropump: ["9R", "8R", "7R", "6R", "5R", "4R"],
},
},
rotomfrost: {
learnset: {
blizzard: ["9L1", "8L1", "7R", "6R", "5R", "4R"],
blizzard: ["9R", "8R", "7R", "6R", "5R", "4R"],
},
},
rotomfan: {
learnset: {
airslash: ["9L1", "8L1", "7R", "6R", "5R", "4R"],
airslash: ["9R", "8R", "7R", "6R", "5R", "4R"],
},
},
rotommow: {
learnset: {
leafstorm: ["9L1", "8L1", "7R", "6R", "5R", "4R"],
leafstorm: ["9R", "8R", "7R", "6R", "5R", "4R"],
},
},
uxie: {
Expand Down
2 changes: 1 addition & 1 deletion data/mods/gen1/formats-data.ts
Original file line number Diff line number Diff line change
Expand Up @@ -429,7 +429,7 @@ export const FormatsData: import('../../../sim/dex-species').ModdedSpeciesFormat
tier: "OU",
},
articuno: {
tier: "UU",
tier: "UUBL",
},
zapdos: {
tier: "OU",
Expand Down
2 changes: 1 addition & 1 deletion data/mods/gen4/moves.ts
Original file line number Diff line number Diff line change
Expand Up @@ -980,7 +980,7 @@ export const Moves: import('../../../sim/dex-moves').ModdedMoveDataTable = {
mimic: {
inherit: true,
flags: {
protect: 1, bypasssub: 1, allyanim: 1, noassist: 1, failcopycat: 1, failencore: 1, failinstruct: 1, failmimic: 1,
protect: 1, allyanim: 1, noassist: 1, failcopycat: 1, failencore: 1, failinstruct: 1, failmimic: 1,
},
onHit(target, source) {
if (source.transformed || !target.lastMove || target.volatiles['substitute']) {
Expand Down
10 changes: 5 additions & 5 deletions data/mods/gen8bdsp/learnsets.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24396,27 +24396,27 @@ export const Learnsets: import('../../../sim/dex-species').ModdedLearnsetDataTab
},
rotomheat: {
learnset: {
overheat: ["8T"],
overheat: ["8R"],
},
},
rotomwash: {
learnset: {
hydropump: ["8T"],
hydropump: ["8R"],
},
},
rotomfrost: {
learnset: {
blizzard: ["8T"],
blizzard: ["8R"],
},
},
rotomfan: {
learnset: {
airslash: ["8T"],
airslash: ["8R"],
},
},
rotommow: {
learnset: {
leafstorm: ["8T"],
leafstorm: ["8R"],
},
},
uxie: {
Expand Down
2 changes: 2 additions & 0 deletions data/mods/gen8linked/scripts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -307,11 +307,13 @@ export const Scripts: ModdedBattleScriptsData = {
pokemon.activeMoveActions++;
let target = this.battle.getTarget(pokemon, maxMove || zMove || moveOrMoveName, targetLoc, originalTarget);
let baseMove = this.dex.getActiveMove(moveOrMoveName);
const priority = baseMove.priority;
const pranksterBoosted = baseMove.pranksterBoosted;
if (baseMove.id !== 'struggle' && !zMove && !maxMove && !externalMove) {
const changedMove = this.battle.runEvent('OverrideAction', pokemon, target, baseMove);
if (changedMove && changedMove !== true) {
baseMove = this.dex.getActiveMove(changedMove);
baseMove.priority = priority;
if (pranksterBoosted) baseMove.pranksterBoosted = pranksterBoosted;
target = this.battle.getRandomTarget(pokemon, baseMove);
}
Expand Down
2 changes: 2 additions & 0 deletions data/mods/gen9ssb/scripts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1123,11 +1123,13 @@ export const Scripts: ModdedBattleScriptsData = {
pokemon.activeMoveActions++;
let target = this.battle.getTarget(pokemon, maxMove || zMove || moveOrMoveName, targetLoc, originalTarget);
let baseMove = this.dex.getActiveMove(moveOrMoveName);
const priority = baseMove.priority;
const pranksterBoosted = baseMove.pranksterBoosted;
if (baseMove.id !== 'struggle' && !zMove && !maxMove && !externalMove) {
const changedMove = this.battle.runEvent('OverrideAction', pokemon, target, baseMove);
if (changedMove && changedMove !== true) {
baseMove = this.dex.getActiveMove(changedMove);
baseMove.priority = priority;
if (pranksterBoosted) baseMove.pranksterBoosted = pranksterBoosted;
target = this.battle.getRandomTarget(pokemon, baseMove);
}
Expand Down
7 changes: 4 additions & 3 deletions data/moves.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15586,9 +15586,10 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = {
priority: 0,
flags: {protect: 1, mirror: 1, dance: 1, metronome: 1},
onModifyType(move, pokemon) {
let type = pokemon.getTypes()[0];
if (type === "Bird") type = "???";
if (type === "Stellar") type = pokemon.getTypes(false, true)[0];
const types = pokemon.getTypes();
let type = types[0];
if (type === 'Bird') type = '???';
if (type === '???' && types[1]) type = types[1];
move.type = type;
},
secondary: null,
Expand Down
2 changes: 1 addition & 1 deletion server/chat-commands/info.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2132,7 +2132,7 @@ export const commands: Chat.ChatCommands = {
buffer.push(`<a href="https://pokemonshowdown.com/${this.tr`pages/privacy`}">${this.tr`Pokémon Showdown privacy policy`}</a>`);
}
if (showAll || ['lostpassword', 'password', 'lostpass'].includes(target)) {
buffer.push(`If you need your Pokémon Showdown password reset, you can fill out a <a href="https://www.smogon.com/forums/password-reset-form/">${this.tr`Password Reset Form`}</a>. You will need to make a Smogon account to be able to fill out the form, as password resets are processed through the Smogon forums.`);
buffer.push(`If you need your Pokémon Showdown password reset, you can fill out a <a href="https://www.smogon.com/forums/password-reset-form/">${this.tr`Password Reset Form`}</a>. <b>You will need to make a Smogon account to be able to fill out a form</b>; that's what the email address you sign in to Smogon with is for (PS accounts for regular users don't have emails associated with them).`);
}
if (!buffer.length && target) {
this.errorReply(`'${target}' is an invalid FAQ.`);
Expand Down
20 changes: 7 additions & 13 deletions server/chat-plugins/auction.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,29 +37,23 @@ class Team {
}

getManagers() {
const managers = [];
for (const manager of this.auction.managers.values()) {
if (manager.team !== this) continue;
const user = Users.getExact(manager.id);
if (user) {
managers.push(user.name);
} else {
managers.push(manager.id);
}
}
return managers;
return [...this.auction.managers.values()]
.filter(m => m.team === this)
.map(m => Users.getExact(m.id)?.name || m.id);
}

addPlayer(player: Player, price = 0) {
if (player.team) player.team.removePlayer(player);
player.team?.removePlayer(player);
this.players.push(player);
this.credits -= price;
player.team = this;
player.price = price;
}

removePlayer(player: Player) {
this.players.splice(this.players.indexOf(player), 1);
const pIndex = this.players.indexOf(player);
if (pIndex === -1) return;
this.players.splice(pIndex, 1);
delete player.team;
player.price = 0;
}
Expand Down
50 changes: 22 additions & 28 deletions server/chat-plugins/helptickets.ts
Original file line number Diff line number Diff line change
Expand Up @@ -909,13 +909,9 @@ export async function getOpponent(link: string, submitter: ID): Promise<string |
}
}
if (!room) {
const replayUrl = Net(`https://${Config.routes.replays}/${link.slice(link.indexOf('-') + 1)}.json`);
try {
const body = await replayUrl.get();
const data = JSON.parse(body);
return data.p1id === submitter ? data.p2id : data.p1id;
} catch {
return null;
const battleData = await getBattleLog(link);
if (battleData) {
return battleData.players.p1 === submitter ? battleData.players.p2 : battleData.players.p1;
}
}
return null;
Expand Down Expand Up @@ -1350,30 +1346,28 @@ export const textTickets: {[k: string]: TextTicketInfo} = {
buf += `<p><strong>Battle links given:</strong><p>`;
links = links.filter((url, i) => links.indexOf(url) === i);
buf += links.map(uri => Chat.formatText(`<<${uri}>>`)).join(', ');
const battleRooms = links.map(r => Rooms.get(r)).filter(room => room?.battle) as GameRoom[];
if (battleRooms.length) {
buf += `<div class="infobox"><strong>Names in given battles:</strong><hr />`;
for (const room of battleRooms) {
const names = [];
for (const id in room.battle!.playerTable) {
const user = Users.get(id);
if (!user) continue;
const team = await room.battle!.getTeam(user);
if (team) {
const teamNames = team.map(p => (
p.name !== p.species ? Utils.html`${p.name} (${p.species})` : p.species
));
names.push(`<strong>${user.id}:</strong> ${teamNames.join(', ')}`);
}
}
if (names.length) {
buf += `<a href="/${room.roomid}">${room.title}</a><br />`;
buf += names.join('<br />');
buf += `<hr />`;
buf += `<div class="infobox"><strong>Names in given battles:</strong><hr />`;
for (const link of links) {
const names = [];
const roomData = await getBattleLog(link);
if (!roomData) continue;
for (const id of Object.values(roomData.players)) {
const user = Users.get(id)?.name || id;
const team = roomData.pokemon[id];
if (team) {
const teamNames = team.map(p => (
p.name !== p.species ? Utils.html`${p.name} (${p.species})` : p.species
));
names.push(`<strong>${user}:</strong> ${teamNames.join(', ')}`);
}
}
buf += `</div>`;
if (names.length) {
buf += `<a href="/${getBattleLinks(link)[0]}">${roomData.title}</a><br />`;
buf += names.join('<br />');
buf += `<hr />`;
}
}
buf += `</div>`;
return buf;
},
onSubmit(ticket, text, submitter, conn) {
Expand Down
2 changes: 2 additions & 0 deletions sim/battle-actions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -226,11 +226,13 @@ export class BattleActions {
pokemon.activeMoveActions++;
let target = this.battle.getTarget(pokemon, maxMove || zMove || moveOrMoveName, targetLoc, originalTarget);
let baseMove = this.dex.getActiveMove(moveOrMoveName);
const priority = baseMove.priority;
const pranksterBoosted = baseMove.pranksterBoosted;
if (baseMove.id !== 'struggle' && !zMove && !maxMove && !externalMove) {
const changedMove = this.battle.runEvent('OverrideAction', pokemon, target, baseMove);
if (changedMove && changedMove !== true) {
baseMove = this.dex.getActiveMove(changedMove);
baseMove.priority = priority;
if (pranksterBoosted) baseMove.pranksterBoosted = pranksterBoosted;
target = this.battle.getRandomTarget(pokemon, baseMove);
}
Expand Down
11 changes: 9 additions & 2 deletions sim/team-validator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -838,8 +838,11 @@ export class TeamValidator {
let eventOnlyData;

if (!setSources.sourcesBefore && setSources.sources.length) {
let skippedEggSource = true;
const legalSources = [];
for (const source of setSources.sources) {
if (['2E', '3E'].includes(source) && set.level < 5) continue;
skippedEggSource = false;
if (this.validateSource(set, source, setSources, outOfBattleSpecies)) continue;
legalSources.push(source);
}
Expand All @@ -855,8 +858,12 @@ export class TeamValidator {
}
if (!nonEggSource) {
// all egg moves
problems.push(`${name} can't get its egg move combination (${setSources.limitedEggMoves!.join(', ')}) from any possible father.`);
problems.push(`(Is this incorrect? If so, post the chainbreeding instructions in Bug Reports)`);
if (skippedEggSource) {
problems.push(`${name} is from a Gen 2 or 3 egg, which cannot be obtained at levels below 5.`);
} else {
problems.push(`${name} can't get its egg move combination (${setSources.limitedEggMoves!.join(', ')}) from any possible father.`);
problems.push(`(Is this incorrect? If so, post the chainbreeding instructions in Bug Reports)`);
}
} else {
if (species.id === 'mew' && pokemonGoProblems && !pokemonGoProblems.length) {
// Whitelist Pokemon GO Mew, which cannot be sent to Let's Go
Expand Down
2 changes: 1 addition & 1 deletion test/sim/moves/encore.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ describe('Encore', function () {
assert.fainted(eleki, `Encore + Quick Attack being selected gives Headlong Rush priority.`);
});

it.skip(`should cause the target to move with its Encored attack at the priority of the originally selected move once and get blocked when appropriate`, function () {
it(`should cause the target to move with its Encored attack at the priority of the originally selected move once and get blocked when appropriate`, function () {
battle = common.createBattle({gameType: 'doubles'}, [[
{species: 'regieleki', moves: ['psychicterrain']},
{species: 'pichu', moves: ['sleeptalk']},
Expand Down
7 changes: 7 additions & 0 deletions test/sim/team-validator/breeding.js
Original file line number Diff line number Diff line change
Expand Up @@ -251,4 +251,11 @@ describe('Team Validator', function () {
];
assert.false.legalTeam(team, 'gen7anythinggoes');
});

it('should not allow egg Pokemon below level 5 in Gens 2-3', function () {
team = [
{species: 'totodile', level: 1, ability: 'torrent', moves: ['ancientpower']},
];
assert.false.legalTeam(team, 'gen3ou');
});
});

0 comments on commit 65808ef

Please sign in to comment.