Skip to content

Commit

Permalink
Refactor noMetronome lists to metronome flag (smogon#10110)
Browse files Browse the repository at this point in the history
  • Loading branch information
Karthik99999 authored Jan 13, 2024
1 parent eb8f5ff commit 73041e4
Show file tree
Hide file tree
Showing 16 changed files with 1,011 additions and 1,000 deletions.
14 changes: 6 additions & 8 deletions data/mods/gen1/moves.ts
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,7 @@ export const Moves: {[k: string]: ModdedMoveData} = {

return 2 * this.lastDamage;
},
flags: {contact: 1, protect: 1, metronome: 1},
},
crabhammer: {
inherit: true,
Expand Down Expand Up @@ -235,7 +236,7 @@ export const Moves: {[k: string]: ModdedMoveData} = {
name: "Disable",
pp: 20,
priority: 0,
flags: {protect: 1, mirror: 1, bypasssub: 1},
flags: {protect: 1, mirror: 1, bypasssub: 1, metronome: 1},
volatileStatus: 'disable',
onTryHit(target) {
// This function should not return if the checks are met. Adding && undefined ensures this happens.
Expand Down Expand Up @@ -469,7 +470,7 @@ export const Moves: {[k: string]: ModdedMoveData} = {
name: "Light Screen",
pp: 30,
priority: 0,
flags: {},
flags: {metronome: 1},
volatileStatus: 'lightscreen',
onTryHit(pokemon) {
if (pokemon.volatiles['lightscreen']) {
Expand All @@ -484,12 +485,9 @@ export const Moves: {[k: string]: ModdedMoveData} = {
target: "self",
type: "Psychic",
},
metronome: {
inherit: true,
noMetronome: ["Metronome", "Struggle"],
},
mimic: {
inherit: true,
flags: {protect: 1, bypasssub: 1, metronome: 1},
onHit(target, source) {
const moveslot = source.moves.indexOf('mimic');
if (moveslot < 0) return false;
Expand Down Expand Up @@ -649,7 +647,7 @@ export const Moves: {[k: string]: ModdedMoveData} = {
name: "Reflect",
pp: 20,
priority: 0,
flags: {},
flags: {metronome: 1},
volatileStatus: 'reflect',
onTryHit(pokemon) {
if (pokemon.volatiles['reflect']) {
Expand Down Expand Up @@ -802,6 +800,7 @@ export const Moves: {[k: string]: ModdedMoveData} = {
name: "Substitute",
pp: 10,
priority: 0,
flags: {metronome: 1},
volatileStatus: 'substitute',
onTryHit(target) {
if (target.volatiles['substitute']) {
Expand Down Expand Up @@ -899,7 +898,6 @@ export const Moves: {[k: string]: ModdedMoveData} = {
secondary: null,
target: "self",
type: "Normal",
flags: {},
},
superfang: {
inherit: true,
Expand Down
11 changes: 4 additions & 7 deletions data/mods/gen2/moves.ts
Original file line number Diff line number Diff line change
Expand Up @@ -398,14 +398,11 @@ export const Moves: {[k: string]: ModdedMoveData} = {
},
meanlook: {
inherit: true,
flags: {reflectable: 1, mirror: 1},
flags: {reflectable: 1, mirror: 1, metronome: 1},
},
metronome: {
inherit: true,
flags: {failencore: 1},
noMetronome: [
"Counter", "Destiny Bond", "Detect", "Endure", "Metronome", "Mimic", "Mirror Coat", "Protect", "Sketch", "Sleep Talk", "Struggle", "Thief",
],
noSketch: true,
},
mimic: {
Expand Down Expand Up @@ -439,7 +436,7 @@ export const Moves: {[k: string]: ModdedMoveData} = {
},
mirrormove: {
inherit: true,
flags: {failencore: 1},
flags: {metronome: 1, failencore: 1},
onHit(pokemon) {
const noMirror = ['metronome', 'mimic', 'mirrormove', 'sketch', 'sleeptalk', 'transform'];
const target = pokemon.side.foe.active[0];
Expand All @@ -462,7 +459,7 @@ export const Moves: {[k: string]: ModdedMoveData} = {
name: "Mist",
pp: 30,
priority: 0,
flags: {},
flags: {metronome: 1},
volatileStatus: 'mist',
condition: {
onStart(pokemon) {
Expand Down Expand Up @@ -787,7 +784,7 @@ export const Moves: {[k: string]: ModdedMoveData} = {
},
spiderweb: {
inherit: true,
flags: {reflectable: 1, mirror: 1},
flags: {reflectable: 1, mirror: 1, metronome: 1},
},
spikes: {
inherit: true,
Expand Down
25 changes: 15 additions & 10 deletions data/mods/gen3/moves.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,11 @@ export const Moves: {[k: string]: ModdedMoveData} = {
},
ancientpower: {
inherit: true,
flags: {contact: 1, protect: 1, mirror: 1},
flags: {contact: 1, protect: 1, mirror: 1, metronome: 1},
},
assist: {
inherit: true,
flags: {metronome: 1, noassist: 1, nosleeptalk: 1},
},
astonish: {
inherit: true,
Expand Down Expand Up @@ -196,7 +200,7 @@ export const Moves: {[k: string]: ModdedMoveData} = {
disable: {
inherit: true,
accuracy: 55,
flags: {protect: 1, mirror: 1, bypasssub: 1},
flags: {protect: 1, mirror: 1, bypasssub: 1, metronome: 1},
volatileStatus: 'disable',
condition: {
durationCallback() {
Expand Down Expand Up @@ -253,7 +257,7 @@ export const Moves: {[k: string]: ModdedMoveData} = {
name: "Doom Desire",
basePower: 120,
category: "Physical",
flags: {},
flags: {metronome: 1, futuremove: 1},
willCrit: false,
type: '???',
} as unknown as ActiveMove;
Expand All @@ -269,7 +273,7 @@ export const Moves: {[k: string]: ModdedMoveData} = {
basePower: 0,
damage: damage,
category: "Physical",
flags: {futuremove: 1},
flags: {metronome: 1, futuremove: 1},
effectType: 'Move',
type: '???',
},
Expand Down Expand Up @@ -335,11 +339,11 @@ export const Moves: {[k: string]: ModdedMoveData} = {
},
fakeout: {
inherit: true,
flags: {protect: 1, mirror: 1},
flags: {protect: 1, mirror: 1, metronome: 1},
},
feintattack: {
inherit: true,
flags: {protect: 1, mirror: 1},
flags: {protect: 1, mirror: 1, metronome: 1},
},
flash: {
inherit: true,
Expand Down Expand Up @@ -473,6 +477,7 @@ export const Moves: {[k: string]: ModdedMoveData} = {
},
mirrormove: {
inherit: true,
flags: {metronome: 1, failencore: 1, nosleeptalk: 1, noassist: 1},
onTryHit() { },
onHit(pokemon) {
const noMirror = [
Expand Down Expand Up @@ -517,7 +522,7 @@ export const Moves: {[k: string]: ModdedMoveData} = {
},
overheat: {
inherit: true,
flags: {contact: 1, protect: 1, mirror: 1},
flags: {contact: 1, protect: 1, mirror: 1, metronome: 1},
},
petaldance: {
inherit: true,
Expand Down Expand Up @@ -602,7 +607,7 @@ export const Moves: {[k: string]: ModdedMoveData} = {
},
taunt: {
inherit: true,
flags: {protect: 1, bypasssub: 1},
flags: {protect: 1, bypasssub: 1, metronome: 1},
condition: {
duration: 2,
onStart(target) {
Expand Down Expand Up @@ -630,11 +635,11 @@ export const Moves: {[k: string]: ModdedMoveData} = {
},
teeterdance: {
inherit: true,
flags: {protect: 1},
flags: {protect: 1, metronome: 1},
},
tickle: {
inherit: true,
flags: {protect: 1, reflectable: 1, mirror: 1, bypasssub: 1},
flags: {protect: 1, reflectable: 1, mirror: 1, bypasssub: 1, metronome: 1},
},
uproar: {
inherit: true,
Expand Down
Loading

0 comments on commit 73041e4

Please sign in to comment.