Skip to content

Commit

Permalink
Fix Pomeg glitch for event eggs (smogon#9716)
Browse files Browse the repository at this point in the history
  • Loading branch information
dot-Comfey authored Aug 17, 2023
1 parent 3c01ebf commit cbfca62
Show file tree
Hide file tree
Showing 4 changed files with 54 additions and 19 deletions.
38 changes: 19 additions & 19 deletions data/learnsets.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2305,10 +2305,10 @@ export const Learnsets: {[speciesid: string]: LearnsetData} = {
zapcannon: ["7V"],
},
eventData: [
{generation: 3, level: 5, shiny: 1, moves: ["thundershock", "charm", "surf"], pokeball: "pokeball"},
{generation: 3, level: 5, shiny: 1, moves: ["thundershock", "charm", "surf"], pokeball: "pokeball", emeraldEventEgg: true},
{generation: 3, level: 5, shiny: 1, moves: ["thundershock", "charm", "wish"], pokeball: "pokeball"},
{generation: 3, level: 5, shiny: 1, moves: ["thundershock", "charm", "teeterdance"], pokeball: "pokeball"},
{generation: 3, level: 5, shiny: 1, moves: ["thundershock", "charm", "followme"], pokeball: "pokeball"},
{generation: 3, level: 5, shiny: 1, moves: ["thundershock", "charm", "followme"], pokeball: "pokeball", emeraldEventEgg: true},
{generation: 4, level: 1, moves: ["volttackle", "thunderbolt", "grassknot", "return"], pokeball: "pokeball"},
{generation: 4, level: 30, shiny: true, gender: "M", nature: "Jolly", moves: ["charge", "volttackle", "endeavor", "endure"], pokeball: "cherishball"},
{generation: 9, level: 30, shiny: true, gender: "M", nature: "Jolly", moves: ["charge", "volttackle", "endure", "helpinghand"], pokeball: "cherishball"},
Expand Down Expand Up @@ -5471,7 +5471,7 @@ export const Learnsets: {[speciesid: string]: LearnsetData} = {
zapcannon: ["7V"],
},
eventData: [
{generation: 3, level: 5, shiny: 1, abilities: ["cutecharm"], moves: ["sing", "charm", "defensecurl", "tickle"], pokeball: "pokeball"},
{generation: 3, level: 5, shiny: 1, abilities: ["cutecharm"], moves: ["sing", "charm", "defensecurl", "tickle"], pokeball: "pokeball", emeraldEventEgg: true},
],
},
jigglypuff: {
Expand Down Expand Up @@ -7777,7 +7777,7 @@ export const Learnsets: {[speciesid: string]: LearnsetData} = {
},
eventData: [
{generation: 3, level: 27, gender: "M", nature: "Lax", ivs: {hp: 31, atk: 16, def: 12, spa: 29, spd: 31, spe: 14}, abilities: ["damp"], moves: ["tailwhip", "confusion", "disable", "screech"], pokeball: "pokeball"},
{generation: 3, level: 5, shiny: 1, moves: ["watersport", "scratch", "tailwhip", "mudsport"], pokeball: "pokeball"},
{generation: 3, level: 5, shiny: 1, moves: ["watersport", "scratch", "tailwhip", "mudsport"], pokeball: "pokeball", emeraldEventEgg: true},
],
encounters: [
{generation: 1, level: 15},
Expand Down Expand Up @@ -27021,7 +27021,7 @@ export const Learnsets: {[speciesid: string]: LearnsetData} = {
tickle: ["3S0"],
},
eventData: [
{generation: 3, level: 5, shiny: 1, moves: ["splash", "charm", "encore", "tickle"], pokeball: "pokeball"},
{generation: 3, level: 5, shiny: 1, moves: ["splash", "charm", "encore", "tickle"], pokeball: "pokeball", emeraldEventEgg: true},
],
},
wobbuffet: {
Expand Down Expand Up @@ -29488,7 +29488,7 @@ export const Learnsets: {[speciesid: string]: LearnsetData} = {
whirlpool: ["8M", "7V", "4M"],
},
eventData: [
{generation: 3, level: 5, shiny: 1, moves: ["tackle", "mudsport"], pokeball: "pokeball"},
{generation: 3, level: 5, shiny: 1, moves: ["tackle", "mudsport"], pokeball: "pokeball", emeraldEventEgg: true},
{generation: 7, level: 50, gender: "F", nature: "Serious", abilities: ["hustle"], moves: ["tackle", "powergem"], pokeball: "ultraball"},
],
},
Expand Down Expand Up @@ -32946,7 +32946,7 @@ export const Learnsets: {[speciesid: string]: LearnsetData} = {
},
eventData: [
{generation: 3, level: 5, shiny: true, abilities: ["pickup"], moves: ["tackle", "growl", "tailwhip"], pokeball: "pokeball"},
{generation: 3, level: 5, shiny: 1, abilities: ["pickup"], moves: ["tackle", "growl", "tailwhip", "extremespeed"], pokeball: "pokeball"},
{generation: 3, level: 5, shiny: 1, abilities: ["pickup"], moves: ["tackle", "growl", "tailwhip", "extremespeed"], pokeball: "pokeball", emeraldEventEgg: true},
],
encounters: [
{generation: 3, level: 2},
Expand Down Expand Up @@ -34056,7 +34056,7 @@ export const Learnsets: {[speciesid: string]: LearnsetData} = {
workup: ["7M", "5M"],
},
eventData: [
{generation: 3, level: 5, shiny: 1, moves: ["peck", "growl", "focusenergy", "featherdance"], pokeball: "pokeball"},
{generation: 3, level: 5, shiny: 1, moves: ["peck", "growl", "focusenergy", "featherdance"], pokeball: "pokeball", emeraldEventEgg: true},
],
encounters: [
{generation: 3, level: 4},
Expand Down Expand Up @@ -34866,7 +34866,7 @@ export const Learnsets: {[speciesid: string]: LearnsetData} = {
watersport: ["7L14", "6L14", "5L19", "4L19", "3L19"],
},
eventData: [
{generation: 3, level: 5, shiny: 1, moves: ["bubble", "mudsport"], pokeball: "pokeball"},
{generation: 3, level: 5, shiny: 1, moves: ["bubble", "mudsport"], pokeball: "pokeball", emeraldEventEgg: true},
{generation: 3, level: 10, gender: "M", moves: ["bubble", "quickattack"], pokeball: "pokeball"},
],
encounters: [
Expand Down Expand Up @@ -35759,7 +35759,7 @@ export const Learnsets: {[speciesid: string]: LearnsetData} = {
zenheadbutt: ["8M", "7T", "6T", "5T", "5D", "4T"],
},
eventData: [
{generation: 3, level: 5, shiny: 1, moves: ["pound", "uproar", "teeterdance"], pokeball: "pokeball"},
{generation: 3, level: 5, shiny: 1, moves: ["pound", "uproar", "teeterdance"], pokeball: "pokeball", emeraldEventEgg: true},
],
},
loudred: {
Expand Down Expand Up @@ -36402,8 +36402,8 @@ export const Learnsets: {[speciesid: string]: LearnsetData} = {
zenheadbutt: ["7T", "7E", "6T", "6E", "5T", "5E", "4T", "4E"],
},
eventData: [
{generation: 3, level: 5, shiny: 1, abilities: ["cutecharm"], moves: ["tackle", "growl", "tailwhip", "payday"], pokeball: "pokeball"},
{generation: 3, level: 5, shiny: 1, abilities: ["cutecharm"], moves: ["growl", "tackle", "tailwhip", "rollout"], pokeball: "pokeball"},
{generation: 3, level: 5, shiny: 1, abilities: ["cutecharm"], moves: ["tackle", "growl", "tailwhip", "payday"], pokeball: "pokeball", emeraldEventEgg: true},
{generation: 3, level: 5, shiny: 1, abilities: ["cutecharm"], moves: ["growl", "tackle", "tailwhip", "rollout"], pokeball: "pokeball", emeraldEventEgg: true},
{generation: 3, level: 10, gender: "M", abilities: ["cutecharm"], moves: ["growl", "tackle", "tailwhip", "attract"], pokeball: "pokeball"},
],
encounters: [
Expand Down Expand Up @@ -37498,7 +37498,7 @@ export const Learnsets: {[speciesid: string]: LearnsetData} = {
wish: ["7E", "6E", "5E", "4E", "3E"],
},
eventData: [
{generation: 3, level: 5, shiny: 1, moves: ["growl", "thunderwave", "watersport"], pokeball: "pokeball"},
{generation: 3, level: 5, shiny: 1, moves: ["growl", "thunderwave", "watersport"], pokeball: "pokeball", emeraldEventEgg: true},
{generation: 3, level: 10, gender: "M", moves: ["growl", "thunderwave", "quickattack"], pokeball: "pokeball"},
],
},
Expand Down Expand Up @@ -37585,7 +37585,7 @@ export const Learnsets: {[speciesid: string]: LearnsetData} = {
wish: ["7E", "6E", "5E", "4E", "3E"],
},
eventData: [
{generation: 3, level: 5, shiny: 1, moves: ["growl", "thunderwave", "mudsport"], pokeball: "pokeball"},
{generation: 3, level: 5, shiny: 1, moves: ["growl", "thunderwave", "mudsport"], pokeball: "pokeball", emeraldEventEgg: true},
{generation: 3, level: 10, gender: "M", moves: ["growl", "thunderwave", "quickattack"], pokeball: "pokeball"},
],
},
Expand Down Expand Up @@ -38861,7 +38861,7 @@ export const Learnsets: {[speciesid: string]: LearnsetData} = {
zenheadbutt: ["9M", "9E", "7T", "7L26", "7E", "6T", "6L26", "6E", "5T", "5L26", "5E", "4T", "4L26", "4E"],
},
eventData: [
{generation: 3, level: 5, shiny: 1, abilities: ["owntempo"], moves: ["splash", "uproar"], pokeball: "pokeball"},
{generation: 3, level: 5, shiny: 1, abilities: ["owntempo"], moves: ["splash", "uproar"], pokeball: "pokeball", emeraldEventEgg: true},
],
},
grumpig: {
Expand Down Expand Up @@ -39091,7 +39091,7 @@ export const Learnsets: {[speciesid: string]: LearnsetData} = {
zenheadbutt: ["7T", "6T", "5T", "4T"],
},
eventData: [
{generation: 3, level: 5, shiny: 1, moves: ["tackle", "uproar", "sing"], pokeball: "pokeball"},
{generation: 3, level: 5, shiny: 1, moves: ["tackle", "uproar", "sing"], pokeball: "pokeball", emeraldEventEgg: true},
],
},
trapinch: {
Expand Down Expand Up @@ -39456,7 +39456,7 @@ export const Learnsets: {[speciesid: string]: LearnsetData} = {
worryseed: ["7T", "7E", "6T", "6E", "5T", "5E", "4T"],
},
eventData: [
{generation: 3, level: 5, shiny: 1, moves: ["poisonsting", "leer", "absorb", "encore"], pokeball: "pokeball"},
{generation: 3, level: 5, shiny: 1, moves: ["poisonsting", "leer", "absorb", "encore"], pokeball: "pokeball", emeraldEventEgg: true},
],
},
cacturne: {
Expand Down Expand Up @@ -39657,7 +39657,7 @@ export const Learnsets: {[speciesid: string]: LearnsetData} = {
uproar: ["8M", "7T", "6T", "5T", "4T"],
},
eventData: [
{generation: 3, level: 5, shiny: 1, moves: ["peck", "growl", "falseswipe"], pokeball: "pokeball"},
{generation: 3, level: 5, shiny: 1, moves: ["peck", "growl", "falseswipe"], pokeball: "pokeball", emeraldEventEgg: true},
{generation: 5, level: 1, shiny: true, moves: ["peck", "growl"], pokeball: "pokeball"},
{generation: 6, level: 1, isHidden: true, moves: ["peck", "growl", "hypervoice"], pokeball: "pokeball"},
],
Expand Down Expand Up @@ -40464,7 +40464,7 @@ export const Learnsets: {[speciesid: string]: LearnsetData} = {
xscissor: ["8M", "7M", "6M", "5M", "4M"],
},
eventData: [
{generation: 3, level: 5, shiny: 1, moves: ["bubble", "watersport"], pokeball: "pokeball"},
{generation: 3, level: 5, shiny: 1, moves: ["bubble", "watersport"], pokeball: "pokeball", emeraldEventEgg: true},
],
},
crawdaunt: {
Expand Down
2 changes: 2 additions & 0 deletions sim/global-types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,8 @@ interface EventInfo {
from?: string;
/** Japan-only events can't be transferred to international games in Gen 1 */
japan?: boolean;
/** For Emerald event eggs to allow Pomeg glitched moves */
emeraldEventEgg?: boolean;
}

type Effect = Ability | Item | ActiveMove | Species | Condition | Format;
Expand Down
26 changes: 26 additions & 0 deletions sim/team-validator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,12 @@ export class PokemonSources {
* particular parent to learn
*/
pomegEggMoves?: ID[] | null;
/**
* Event egg source that may be used with the Pomeg glitch
*
* `null` = definitely not an event egg that can be used with the Pomeg glitch
*/
pomegEventEgg?: string | null;
/**
* Some Pokemon evolve by having a move in their learnset (like Piloswine
* with Ancient Power). These can only carry three other moves from their
Expand Down Expand Up @@ -152,6 +158,22 @@ export class PokemonSources {
return max;
}
intersectWith(other: PokemonSources) {
if (this.pomegEventEgg && other.pomegEggMoves) {
const newSources = [];
for (const source of other.sources) {
newSources.push(source.substr(0, 2) === '3E' ? this.pomegEventEgg : source);
}
other.sources = newSources;
} else if (other.pomegEventEgg && this.pomegEventEgg !== null) {
const newSources = [];
for (const source of this.sources) {
newSources.push(source.substr(0, 2) === '3E' ? other.pomegEventEgg : source);
}
this.sources = newSources;
this.pomegEventEgg = other.pomegEventEgg;
} else if (!other.pomegEggMoves && !other.sourcesBefore) {
this.pomegEventEgg = null;
}
if (other.sourcesBefore || this.sourcesBefore) {
// having sourcesBefore is the equivalent of having everything before that gen
// in sources, so we fill the other array in preparation for intersection
Expand Down Expand Up @@ -2476,6 +2498,10 @@ export class TeamValidator {
moveSources.add('1ST' + learned.slice(2) + ' ' + species.id);
}
moveSources.add(learned + ' ' + species.id);
const eventLearnset = dex.species.getLearnsetData(species.id);
if (eventLearnset.eventData?.[parseInt(learned.charAt(2))].emeraldEventEgg && learnedGen === 3) {
moveSources.pomegEventEgg = learned + ' ' + species.id;
}
} else if (learned.charAt(1) === 'D') {
// DW moves:
// only if that was the source
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 @@ -196,6 +196,13 @@ describe('Team Validator', function () {
assert.legalTeam(team, 'gen7lc');
});

it("should allow Pomeg glitch with event egg moves", function () {
team = [
{species: 'zigzagoon', level: 5, ability: 'pickup', moves: ['bellydrum', 'extremespeed'], evs: {hp: 1}},
];
assert.legalTeam(team, 'gen3ou');
});

it.skip('should reject Volbeat with both Lunge and Dizzy Punch in Gen 7', function () {
team = [
{species: 'volbeat', ability: 'swarm', moves: ['lunge', 'dizzypunch'], evs: {hp: 1}},
Expand Down

0 comments on commit cbfca62

Please sign in to comment.