Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
ShivaD173 committed Nov 25, 2024
2 parents 9124202 + 9f62079 commit 3aedd08
Show file tree
Hide file tree
Showing 8 changed files with 70 additions and 19 deletions.
10 changes: 5 additions & 5 deletions config/formats.ts
Original file line number Diff line number Diff line change
Expand Up @@ -560,7 +560,7 @@ export const Formats: import('../sim/dex-formats').FormatList = [
desc: "The Create-A-Pokémon project is a community dedicated to exploring and understanding the competitive Pokémon metagame by designing, creating, and playtesting new Pokémon concepts.",
mod: 'gen9',
ruleset: ['[Gen 9] OU', '+CAP'],
banlist: ['Crucibellite'],
banlist: ['Crucibellite', 'Rage Fist'],
},
{
name: "[Gen 9] BSS Reg G",
Expand Down Expand Up @@ -1283,9 +1283,9 @@ export const Formats: import('../sim/dex-formats').FormatList = [
],
restricted: [
'Arceus', 'Basculegion-M', 'Calyrex-Ice', 'Deoxys-Normal', 'Deoxys-Attack', 'Dialga', 'Dragapult', 'Eternatus', 'Flutter Mane',
'Gengar', 'Gholdengo', 'Giratina', 'Gouging Fire', 'Groudon', 'Ho-Oh', 'Iron Bundle', 'Kyurem-Black', 'Kyurem-White', 'Lunala',
'Manaphy', 'Mewtwo', 'Necrozma-Dawn-Wings', 'Necrozma-Dusk-Mane', 'Palkia', 'Rayquaza', 'Regigigas', 'Reshiram', 'Slaking',
'Sneasler', 'Solgaleo', 'Ursaluna-Bloodmoon', 'Urshifu-Single-Strike', 'Zacian', 'Zekrom',
'Gengar', 'Gholdengo', 'Giratina', 'Gouging Fire', 'Groudon', 'Ho-Oh', 'Iron Bundle', 'Kyurem-Black', 'Kyurem-White', 'Lugia',
'Lunala', 'Manaphy', 'Mewtwo', 'Necrozma-Dawn-Wings', 'Necrozma-Dusk-Mane', 'Palkia', 'Rayquaza', 'Regigigas', 'Reshiram',
'Slaking', 'Sneasler', 'Solgaleo', 'Ursaluna-Bloodmoon', 'Urshifu-Single-Strike', 'Zacian', 'Zekrom',
],
onValidateTeam(team) {
const itemTable = new Set<ID>();
Expand Down Expand Up @@ -2782,7 +2782,7 @@ export const Formats: import('../sim/dex-formats').FormatList = [
searchShow: false,
ruleset: ['-Nonexistent', 'Standard NatDex', 'Forme Clause', 'Sleep Moves Clause', 'Ability Clause = 2', 'OHKO Clause', 'Evasion Moves Clause', 'Dynamax Clause', 'CFZ Clause', 'Terastal Clause', '!Obtainable'],
banlist: [
'Cramorant-Gorging', 'Calyrex-Shadow', 'Darmanitan-Galar-Zen', 'Eternatus-Eternamax', 'Greninja-Ash', 'Groudon-Primal', 'Rayquaza-Mega', 'Shedinja', 'Terapagos-Terastal', 'Arena Trap',
'Cramorant-Gorging', 'Calyrex-Shadow', 'Darmanitan-Galar-Zen', 'Eternatus-Eternamax', 'Greninja-Ash', 'Groudon-Primal', 'Rayquaza-Mega', 'Shedinja', 'Terapagos-Stellar', 'Arena Trap',
'Contrary', 'Gorilla Tactics', 'Hadron Engine', 'Huge Power', 'Illusion', 'Innards Out', 'Magnet Pull', 'Moody', 'Neutralizing Gas', 'Parental Bond', 'Pure Power', 'Shadow Tag', 'Stakeout',
'Water Bubble', 'Wonder Guard', 'Gengarite', 'Berserk Gene', 'Belly Drum', 'Bolt Beak', 'Ceaseless Edge', 'Chatter', 'Double Iron Bash', 'Electrify', 'Last Respects', 'Octolock', 'Rage Fist',
'Revival Blessing', 'Shed Tail', 'Shell Smash', 'Comatose + Sleep Talk', 'Imprison + Transform',
Expand Down
4 changes: 2 additions & 2 deletions data/formats-data.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1383,7 +1383,7 @@ export const FormatsData: import('../sim/dex-species').SpeciesFormatsDataTable =
tier: "NFE",
},
yanmega: {
tier: "RU",
tier: "RUBL",
doublesTier: "(DUU)",
natDexTier: "ZU",
},
Expand Down Expand Up @@ -3740,7 +3740,7 @@ export const FormatsData: import('../sim/dex-species').SpeciesFormatsDataTable =
greninja: {
tier: "UU",
doublesTier: "(DUU)",
natDexTier: "UU",
natDexTier: "UUBL",
},
greninjaash: {
isNonstandard: "Past",
Expand Down
9 changes: 6 additions & 3 deletions data/text/moves.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4129,8 +4129,11 @@ export const MovesText: {[id: IDEntry]: MoveText} = {
},
minimize: {
name: "Minimize",
desc: "Raises the user's evasiveness by 2 stages. Whether or not the user's evasiveness was changed, Body Slam, Dragon Rush, Flying Press, Heat Crash, Heavy Slam, Malicious Moonsault, Steamroller, and Stomp will not check accuracy and have their damage doubled if used against the user while it is active.",
desc: "Raises the user's evasiveness by 2 stages. Whether or not the user's evasiveness was changed, Body Slam, Dragon Rush, Flying Press, Heat Crash, Heavy Slam, Malicious Moonsault, Steamroller, Stomp, and Supercell Slam will not check accuracy and have their damage doubled if used against the user while it is active.",
shortDesc: "Raises the user's evasiveness by 2.",
gen8: {
desc: "Raises the user's evasiveness by 2 stages. Whether or not the user's evasiveness was changed, Body Slam, Dragon Rush, Flying Press, Heat Crash, Heavy Slam, Malicious Moonsault, Steamroller, and Stomp will not check accuracy and have their damage doubled if used against the user while it is active.",
},
gen6: {
desc: "Raises the user's evasiveness by 2 stages. Whether or not the user's evasiveness was changed, Body Slam, Dragon Rush, Flying Press, Heat Crash, Phantom Force, Shadow Force, Steamroller, and Stomp will not check accuracy and have their damage doubled if used against the user while it is active.",
},
Expand Down Expand Up @@ -4494,7 +4497,7 @@ export const MovesText: {[id: IDEntry]: MoveText} = {
},
orderup: {
name: "Order Up",
desc: "If an ally Tatsugiri has activated its Commander Ability, this move raises the user's Attack by 1 stage if the Tatsugiri is Curly Form, Defense by 1 stage if Droopy Form, or Speed by 1 stage if Stretchy Form. The effect happens whether or not this move is successful, and even if the Tatsugiri that activated the effect has since fainted.",
desc: "If an ally Tatsugiri has activated its Commander Ability, this move raises the user's Attack by 1 stage if the Tatsugiri is Curly Form, Defense by 1 stage if Droopy Form, or Speed by 1 stage if Stretchy Form. The effect happens even if the Tatsugiri that activated the effect has since fainted.",
shortDesc: "Curly|Droopy|Stretchy eaten: +1 Atk|Def|Spe.",
},
originpulse: {
Expand Down Expand Up @@ -6494,7 +6497,7 @@ export const MovesText: {[id: IDEntry]: MoveText} = {
},
supercellslam: {
name: "Supercell Slam",
desc: "If this attack is not successful, the user loses half of its maximum HP, rounded down, as crash damage. Pokemon with the Magic Guard Ability are unaffected by crash damage.",
desc: "If this attack is not successful, the user loses half of its maximum HP, rounded down, as crash damage. Pokemon with the Magic Guard Ability are unaffected by crash damage. Damage doubles and no accuracy check is done if the target has used Minimize while active.",
shortDesc: "User is hurt by 50% of its max HP if it misses.",

damage: "#crash",
Expand Down
4 changes: 2 additions & 2 deletions server/chat-formatter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ REGEXFREE SOURCE FOR LINKREGEX
(
# characters allowed inside URL paths
(
[^\s()&<>] | &amp; | &quot;
[^\s()&<>[\]] | &amp; | &quot;
|
# parentheses in URLs should be matched, so they're not confused
# for parentheses around URLs
Expand All @@ -60,7 +60,7 @@ REGEXFREE SOURCE FOR LINKREGEX
(?! [^ ]*&gt; )
*/
export const linkRegex = /(?:(?:https?:\/\/[a-z0-9-]+(?:\.[a-z0-9-]+)*|www\.[a-z0-9-]+(?:\.[a-z0-9-]+)+|\b[a-z0-9-]+(?:\.[a-z0-9-]+)*\.(?:(?:com?|org|net|edu|info|us|jp)\b|[a-z]{2,3}(?=:[0-9]|\/)))(?::[0-9]+)?(?:\/(?:(?:[^\s()&<>]|&amp;|&quot;|\((?:[^\s()<>&[\]]|&amp;)*\)|\[(?:[^\s()<>&[\]]|&amp;)*])*(?:[^\s()[\]{}".,!?;:&<>*`^~\\]|\((?:[^\s()<>&[\]]|&amp;)*\)))?)?|[a-z0-9.]+@[a-z0-9-]+(?:\.[a-z0-9-]+)*\.[a-z]{2,})(?![^ ]*&gt;)/ig;
export const linkRegex = /(?:(?:https?:\/\/[a-z0-9-]+(?:\.[a-z0-9-]+)*|www\.[a-z0-9-]+(?:\.[a-z0-9-]+)+|\b[a-z0-9-]+(?:\.[a-z0-9-]+)*\.(?:(?:com?|org|net|edu|info|us|jp)\b|[a-z]{2,3}(?=:[0-9]|\/)))(?::[0-9]+)?(?:\/(?:(?:[^\s()&<>[\]]|&amp;|&quot;|\((?:[^\s()<>&[\]]|&amp;)*\)|\[(?:[^\s()<>&[\]]|&amp;)*])*(?:[^\s()[\]{}".,!?;:&<>*`^~\\]|\((?:[^\s()<>&[\]]|&amp;)*\)))?)?|[a-z0-9.]+@[a-z0-9-]+(?:\.[a-z0-9-]+)*\.[a-z]{2,})(?![^ ]*&gt;)/ig;

/**
* A span is a part of the text that's formatted. In the text:
Expand Down
5 changes: 4 additions & 1 deletion server/chat-plugins/auction.ts
Original file line number Diff line number Diff line change
Expand Up @@ -820,6 +820,9 @@ export const commands: Chat.ChatCommands = {
},
settypehelp: [
`/auction settype [auction|blind|snake] - Sets the auction type. Requires: # ~ auction owner`,
`- auction: Standard auction with credits and bidding.`,
`- blind: Same as auction, but bids are hidden until the end of the nomination.`,
`- snake: Standard snake draft with no credits or bidding.`,
],
addowner: 'addowners',
addowners(target, room, user) {
Expand Down Expand Up @@ -1081,7 +1084,7 @@ export const commands: Chat.ChatCommands = {
`- minplayers [amount]: Sets the minimum number of players.<br/>` +
`- nomtimer [seconds]: Sets the nomination timer to [seconds] seconds.<br/>` +
`- bidtimer [seconds]: Sets the bid timer to [seconds] seconds.<br/>` +
`- blindmode [on/off]: Enables or disables blind mode.<br/>` +
`- settype [auction|blind|snake]: Sets the auction type.<br/>` +
`- addowners [user1], [user2], ...: Adds users as auction owners.<br/>` +
`- removeowners [user1], [user2], ...: Removes users as auction owners.<br/>` +
`- importplayers [pastebin url]: Imports a list of players from a pastebin.<br/>` +
Expand Down
23 changes: 17 additions & 6 deletions server/chat-plugins/scavengers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -978,23 +978,26 @@ export class ScavengerHunt extends Rooms.RoomGame<ScavengerHuntPlayer> {
return hosts;
}

static parseQuestions(questionArray: string[]): AnyObject {
if (questionArray.length % 2 === 1) return {err: "Your final question is missing an answer"};
if (questionArray.length < 6) return {err: "You must have at least 3 hints and answers"};
static parseQuestions(questionArray: string[], force = false): AnyObject {
if (questionArray.length % 2 === 1 && !force) return {err: "Your final question is missing an answer"};
if (questionArray.length < 6 && !force) return {err: "You must have at least 3 hints and answers"};

const formattedQuestions = [];

for (let [i, question] of questionArray.entries()) {
if (i % 2) {
const answers = question.split(';').map(p => p.trim());
formattedQuestions[i] = answers;
if (!answers.length || answers.some(a => !toID(a))) {
if (!force && (!answers.length || answers.some(a => !toID(a)))) {
return {err: "Empty answer - only alphanumeric characters will count in answers."};
}
} else {
// Skip last question if there is no answer
if (i + 1 === questionArray.length) continue;

question = question.trim();
formattedQuestions[i] = question;
if (!question) return {err: "Empty question."};
if (!question && !force) return {err: "Empty question."};
}
}

Expand Down Expand Up @@ -1750,6 +1753,14 @@ const ScavengerCommands: Chat.ChatCommands = {
queuehtmlrated: 'queue',
queuehtmlrecycled: 'queue',
queuehtml: 'queue',
forcequeueunrated: 'queue',
forcequeuerated: 'queue',
forcequeuerecycled: 'queue',
forcequeuehtmlunrated: 'queue',
forcequeuehtmlrated: 'queue',
forcequeuehtmlrecycled: 'queue',
forcequeuehtml: 'queue',
forcequeue: 'queue',
queue(target, room, user) {
room = this.requireRoom();
if (!getScavsRoom(room)) {
Expand Down Expand Up @@ -1801,7 +1812,7 @@ const ScavengerCommands: Chat.ChatCommands = {
return this.errorReply("The user(s) you specified as the host is not online, or is not in the room.");
}

const results = ScavengerHunt.parseQuestions(params);
const results = ScavengerHunt.parseQuestions(params, this.cmd.includes('force'));
if (results.err) return this.errorReply(results.err);

if (!room.settings.scavQueue) room.settings.scavQueue = [];
Expand Down
3 changes: 3 additions & 0 deletions sim/battle.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2283,6 +2283,9 @@ export class Battle {
return target;
}
if (target.isAlly(pokemon)) {
if (move.target === 'adjacentAllyOrSelf' && this.gen !== 5) {
return pokemon;
}
// Target is a fainted ally: attack shouldn't retarget
return target;
}
Expand Down
31 changes: 31 additions & 0 deletions test/sim/moves/acupressure.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,4 +37,35 @@ describe('Acupressure', function () {
assert.cantMove(() => battle.choose('p1', 'move acupressure 2'));
assert.cantMove(() => battle.choose('p1', 'move acupressure -2'));
});

// https://www.smogon.com/forums/threads/acupressure-targeting.3733779/post-9920405
it(`should redirect to the user if a targetted ally faints`, () => {
battle = common.createBattle({gameType: 'doubles'}, [[
{species: 'Pincurchin', moves: ['acupressure']},
{species: 'Flutter Mane', moves: ['memento']},
], [
{species: 'Furret', moves: ['sleeptalk']},
{species: 'Chien-Pao', moves: ['haze']},
]]);

battle.makeChoices('move acupressure -2, move memento 1', 'auto');
assert(Object.values(battle.p1.active[0].boosts).some(n => n === 2));
battle.makeChoices('move acupressure -2, pass', 'auto');
assert(Object.values(battle.p1.active[0].boosts).some(n => n === 2));
});

it(`in Gen 5, should not redirect to the uesr if a targetted ally faints`, () => {
battle = common.gen(5).createBattle({gameType: 'doubles'}, [[
{species: 'Shuckle', moves: ['acupressure']},
{species: 'Dugtrio', moves: ['memento']},
], [
{species: 'Marshtomp', moves: ['sleeptalk']},
{species: 'Nincada', moves: ['sleeptalk']},
]]);

battle.makeChoices('move acupressure -2, move memento 1', 'auto');
assert(Object.values(battle.p1.active[0].boosts).every(n => n === 0));
battle.makeChoices('move acupressure -2, pass', 'auto');
assert(Object.values(battle.p1.active[0].boosts).every(n => n === 0));
});
});

0 comments on commit 3aedd08

Please sign in to comment.