diff --git a/calc/bundle b/calc/bundle index bfdc984b1..a3ab8bb15 100755 --- a/calc/bundle +++ b/calc/bundle @@ -13,9 +13,9 @@ const exports = {}; `; bundled += bundler.read('util.js', 3, 1); const species = bundler.read('data/species.js').split('\n'); -bundled += species.slice(1, 64).join('\n'); // generator + iterator + spreadArray polyfill +bundled += species.slice(1, 39).join('\n'); // generator + iterator polyfill bundled += '\nvar e_1, _a, e_2, _b;\nvar util_1 = exports;\n'; -bundled += species.slice(68, -2).join('\n'); +bundled += species.slice(43, -2).join('\n'); const types = bundler.read('data/types.js').split('\n'); bundled += types.slice(1, 12).join('\n'); // __assign polyfill @@ -25,7 +25,9 @@ bundled += natures.slice(28, 44).join('\n'); // __read polyfill bundled += natures.slice(47, -2).join('\n'); bundled += bundler.read('data/abilities.js', 43, 1); bundled += bundler.read('data/moves.js', 43, 1); -bundled += bundler.read('data/items.js', 68, 1); +const items = bundler.read('data/items.js').split('\n'); +bundled += items.slice(44, 53).join('\n'); // __spreadArray polyfill +bundled += items.slice(68, -2).join('\n'); bundled += ` var abilities_1 = exports; var items_1 = exports; diff --git a/calc/src/data/interface.ts b/calc/src/data/interface.ts index 060f2829d..f03571c23 100644 --- a/calc/src/data/interface.ts +++ b/calc/src/data/interface.ts @@ -146,6 +146,7 @@ export interface Specie extends Data { readonly nfe?: boolean; readonly gender?: GenderName; readonly otherFormes?: SpeciesName[]; + readonly canGigantamax?: MoveName; readonly baseSpecies?: SpeciesName; readonly abilities?: {0: AbilityName | ''}; } diff --git a/calc/src/data/moves.ts b/calc/src/data/moves.ts index eaf00d0d2..bfa68858c 100644 --- a/calc/src/data/moves.ts +++ b/calc/src/data/moves.ts @@ -4750,6 +4750,10 @@ const SV_PATCH: {[name: string]: DeepPartial} = { const SV: {[name: string]: MoveData} = extend(true, {}, SS, SV_PATCH); +for (const moveName in SV) { + if (moveName.startsWith('G-Max')) delete SV[moveName]; +} + export const MOVES = [{}, RBY, GSC, ADV, DPP, BW, XY, SM, SS, SV]; export class Moves implements I.Moves { diff --git a/calc/src/data/species.ts b/calc/src/data/species.ts index 97bd22bde..54104e087 100644 --- a/calc/src/data/species.ts +++ b/calc/src/data/species.ts @@ -15,6 +15,7 @@ export interface SpeciesData { }; readonly weightkg: number; // weight readonly nfe?: boolean; + readonly canGigantamax?: string; readonly gender?: I.GenderName; readonly otherFormes?: string[]; readonly baseSpecies?: string; @@ -7496,31 +7497,32 @@ const SS_PATCH: {[name: string]: DeepPartial} = { 'Aegislash-Both': {bs: {at: 140, df: 140, sa: 140, sd: 140}}, 'Aegislash-Shield': {bs: {df: 140, sd: 140}}, Articuno: {otherFormes: ['Articuno-Galar']}, - Blastoise: {otherFormes: ['Blastoise-Gmax', 'Blastoise-Mega']}, - Butterfree: {otherFormes: ['Butterfree-Gmax']}, - Charizard: {otherFormes: ['Charizard-Gmax', 'Charizard-Mega-X', 'Charizard-Mega-Y']}, + Blastoise: {canGigantamax: "G-Max Cannonade"}, + Butterfree: {canGigantamax: "G-Max Befuddle"}, + Charizard: {canGigantamax: "G-Max Wildfire"}, Corsola: {otherFormes: ['Corsola-Galar']}, Darmanitan: { otherFormes: ['Darmanitan-Galar', 'Darmanitan-Galar-Zen', 'Darmanitan-Zen'], }, Darumaka: {otherFormes: ['Darumaka-Galar']}, - Eevee: {otherFormes: ['Eevee-Gmax']}, + Eevee: {canGigantamax: "G-Max Cuddle"}, Equilibra: {bs: {sa: 133}}, 'Farfetch\u2019d': {otherFormes: ['Farfetch\u2019d-Galar']}, - Garbodor: {otherFormes: ['Garbodor-Gmax']}, - Gengar: {otherFormes: ['Gengar-Gmax', 'Gengar-Mega']}, - Kingler: {otherFormes: ['Kingler-Gmax']}, - Lapras: {otherFormes: ['Lapras-Gmax']}, + Garbodor: {canGigantamax: "G-Max Malodor"}, + Gengar: {canGigantamax: "G-Max Terror"}, + Kingler: {canGigantamax: "G-Max Foam Burst"}, + Lapras: {canGigantamax: "G-Max Resonance"}, Linoone: {otherFormes: ['Linoone-Galar']}, - Machamp: {otherFormes: ['Machamp-Gmax']}, - Melmetal: {otherFormes: ['Melmetal-Gmax']}, - Meowth: {otherFormes: ['Meowth-Alola', 'Meowth-Galar', 'Meowth-Gmax']}, + Machamp: {canGigantamax: "G-Max Chi-Strike"}, + Magearna: {otherFormes: ["Magearna-Original"]}, + Melmetal: {canGigantamax: "G-Max Meltdown"}, + Meowth: {canGigantamax: "G-Max Gold Rush", otherFormes: ['Meowth-Alola', 'Meowth-Galar']}, Moltres: {otherFormes: ['Moltres-Galar']}, 'Mr. Mime': {otherFormes: ['Mr. Mime-Galar']}, Pikachu: { + canGigantamax: "G-Max Volt crash", otherFormes: [ 'Pikachu-Alola', - 'Pikachu-Gmax', 'Pikachu-Hoenn', 'Pikachu-Kalos', 'Pikachu-Original', @@ -7533,12 +7535,12 @@ const SS_PATCH: {[name: string]: DeepPartial} = { Ponyta: {otherFormes: ['Ponyta-Galar']}, Pyroak: {bs: {sa: 70, sd: 65}}, Rapidash: {otherFormes: ['Rapidash-Galar']}, - Slowbro: {otherFormes: ['Slowbro-Galar', 'Slowbro-Mega']}, + Slowbro: {otherFormes: ['Slowbro-Mega', 'Slowbro-Galar']}, Slowking: {otherFormes: ['Slowking-Galar']}, Slowpoke: {otherFormes: ['Slowpoke-Galar']}, - Snorlax: {otherFormes: ['Snorlax-Gmax']}, + Snorlax: {canGigantamax: "G-Max Replenish"}, Stunfisk: {otherFormes: ['Stunfisk-Galar']}, - Venusaur: {otherFormes: ['Venusaur-Gmax', 'Venusaur-Mega']}, + Venusaur: {canGigantamax: "G-Max Vine Lash"}, Voodoom: {bs: {sa: 130}}, Weezing: {otherFormes: ['Weezing-Galar']}, Yamask: {otherFormes: ['Yamask-Galar']}, @@ -7549,28 +7551,14 @@ const SS_PATCH: {[name: string]: DeepPartial} = { bs: {hp: 65, at: 60, df: 75, sa: 110, sd: 121, sp: 64}, weightkg: 0.5, abilities: {0: 'Sweet Veil'}, - otherFormes: ['Alcremie-Gmax'], - }, - 'Alcremie-Gmax': { - types: ['Fairy'], - bs: {hp: 65, at: 60, df: 75, sa: 110, sd: 121, sp: 64}, - weightkg: 0, - abilities: {0: 'Sweet Veil'}, - baseSpecies: 'Alcremie', + canGigantamax: "G-Max Finale", }, Appletun: { types: ['Grass', 'Dragon'], bs: {hp: 110, at: 85, df: 80, sa: 100, sd: 80, sp: 30}, weightkg: 13, abilities: {0: 'Ripen'}, - otherFormes: ['Appletun-Gmax'], - }, - 'Appletun-Gmax': { - types: ['Grass', 'Dragon'], - bs: {hp: 110, at: 85, df: 80, sa: 100, sd: 80, sp: 30}, - weightkg: 0, - abilities: {0: 'Ripen'}, - baseSpecies: 'Appletun', + canGigantamax: "G-Max Sweetness", }, Applin: { types: ['Grass', 'Dragon'], @@ -7620,13 +7608,6 @@ const SS_PATCH: {[name: string]: DeepPartial} = { weightkg: 30, abilities: {0: 'Swift Swim'}, }, - 'Blastoise-Gmax': { - types: ['Water'], - bs: {hp: 79, at: 83, df: 100, sa: 85, sd: 105, sp: 78}, - weightkg: 0, - abilities: {0: 'Torrent'}, - baseSpecies: 'Blastoise', - }, Blipbug: { types: ['Bug'], bs: {hp: 25, at: 20, df: 20, sa: 25, sd: 45, sp: 45}, @@ -7640,13 +7621,6 @@ const SS_PATCH: {[name: string]: DeepPartial} = { weightkg: 34, abilities: {0: 'Strong Jaw'}, }, - 'Butterfree-Gmax': { - types: ['Bug', 'Flying'], - bs: {hp: 60, at: 45, df: 50, sa: 90, sd: 80, sp: 70}, - weightkg: 0, - abilities: {0: 'Compound Eyes'}, - baseSpecies: 'Butterfree', - }, Calyrex: { types: ['Psychic', 'Grass'], bs: {hp: 100, at: 80, df: 80, sa: 80, sd: 80, sp: 80}, @@ -7683,21 +7657,7 @@ const SS_PATCH: {[name: string]: DeepPartial} = { bs: {hp: 100, at: 115, df: 65, sa: 90, sd: 90, sp: 65}, weightkg: 120, abilities: {0: 'Flash Fire'}, - otherFormes: ['Centiskorch-Gmax'], - }, - 'Centiskorch-Gmax': { - types: ['Fire', 'Bug'], - bs: {hp: 100, at: 115, df: 65, sa: 90, sd: 90, sp: 65}, - weightkg: 0, - abilities: {0: 'Flash Fire'}, - baseSpecies: 'Centiskorch', - }, - 'Charizard-Gmax': { - types: ['Fire', 'Flying'], - bs: {hp: 78, at: 84, df: 78, sa: 109, sd: 85, sp: 100}, - weightkg: 0, - abilities: {0: 'Blaze'}, - baseSpecies: 'Charizard', + canGigantamax: "G-Max Centiferno", }, Chewtle: { types: ['Water'], @@ -7717,15 +7677,8 @@ const SS_PATCH: {[name: string]: DeepPartial} = { types: ['Fire'], bs: {hp: 80, at: 116, df: 75, sa: 65, sd: 75, sp: 119}, weightkg: 33, - abilities: {0: 'Blaze'}, - otherFormes: ['Cinderace-Gmax'], - }, - 'Cinderace-Gmax': { - types: ['Fire'], - bs: {hp: 80, at: 116, df: 75, sa: 65, sd: 75, sp: 119}, - weightkg: 0, - abilities: {0: 'Blaze'}, - baseSpecies: 'Cinderace', + abilities: {0: 'Libero'}, + canGigantamax: "G-Max Fireball", }, Clobbopus: { types: ['Fighting'], @@ -7739,28 +7692,14 @@ const SS_PATCH: {[name: string]: DeepPartial} = { bs: {hp: 110, at: 80, df: 120, sa: 80, sd: 90, sp: 30}, weightkg: 310.5, abilities: {0: 'Steam Engine'}, - otherFormes: ['Coalossal-Gmax'], - }, - 'Coalossal-Gmax': { - types: ['Rock', 'Fire'], - bs: {hp: 110, at: 80, df: 120, sa: 80, sd: 90, sp: 30}, - weightkg: 0, - abilities: {0: 'Steam Engine'}, - baseSpecies: 'Coalossal', + canGigantamax: "G-Max Volcalith", }, Copperajah: { types: ['Steel'], bs: {hp: 122, at: 130, df: 69, sa: 80, sd: 69, sp: 30}, weightkg: 650, abilities: {0: 'Sheer Force'}, - otherFormes: ['Copperajah-Gmax'], - }, - 'Copperajah-Gmax': { - types: ['Steel'], - bs: {hp: 122, at: 130, df: 69, sa: 80, sd: 69, sp: 30}, - weightkg: 0, - abilities: {0: 'Sheer Force'}, - baseSpecies: 'Copperajah', + canGigantamax: "G-Max Steelsurge", }, 'Corsola-Galar': { types: ['Ghost'], @@ -7775,14 +7714,7 @@ const SS_PATCH: {[name: string]: DeepPartial} = { bs: {hp: 98, at: 87, df: 105, sa: 53, sd: 85, sp: 67}, weightkg: 75, abilities: {0: 'Pressure'}, - otherFormes: ['Corviknight-Gmax'], - }, - 'Corviknight-Gmax': { - types: ['Flying', 'Steel'], - bs: {hp: 98, at: 87, df: 105, sa: 53, sd: 85, sp: 67}, - weightkg: 0, - abilities: {0: 'Pressure'}, - baseSpecies: 'Corviknight', + canGigantamax: "G-Max Wind Rage", }, Corvisquire: { types: ['Flying'], @@ -7886,14 +7818,7 @@ const SS_PATCH: {[name: string]: DeepPartial} = { bs: {hp: 90, at: 115, df: 90, sa: 48, sd: 68, sp: 74}, weightkg: 115.5, abilities: {0: 'Strong Jaw'}, - otherFormes: ['Drednaw-Gmax'], - }, - 'Drednaw-Gmax': { - types: ['Water', 'Rock'], - bs: {hp: 90, at: 115, df: 90, sa: 48, sd: 68, sp: 74}, - weightkg: 0, - abilities: {0: 'Strong Jaw'}, - baseSpecies: 'Drednaw', + canGigantamax: "G-Max Stonesurge", }, Dreepy: { types: ['Dragon', 'Ghost'], @@ -7920,21 +7845,7 @@ const SS_PATCH: {[name: string]: DeepPartial} = { bs: {hp: 70, at: 95, df: 115, sa: 120, sd: 50, sp: 85}, weightkg: 40, abilities: {0: 'Light Metal'}, - otherFormes: ['Duraludon-Gmax'], - }, - 'Duraludon-Gmax': { - types: ['Steel', 'Dragon'], - bs: {hp: 70, at: 95, df: 115, sa: 120, sd: 50, sp: 85}, - weightkg: 0, - abilities: {0: 'Light Metal'}, - baseSpecies: 'Duraludon', - }, - 'Eevee-Gmax': { - types: ['Normal'], - bs: {hp: 55, at: 55, df: 50, sa: 45, sd: 65, sp: 55}, - weightkg: 0, - abilities: {0: 'Run Away'}, - baseSpecies: 'Eevee', + canGigantamax: "G-Max Depletion", }, Eiscue: { types: ['Ice'], @@ -7992,14 +7903,7 @@ const SS_PATCH: {[name: string]: DeepPartial} = { bs: {hp: 70, at: 110, df: 80, sa: 95, sd: 60, sp: 70}, weightkg: 1, abilities: {0: 'Ripen'}, - otherFormes: ['Flapple-Gmax'], - }, - 'Flapple-Gmax': { - types: ['Grass', 'Dragon'], - bs: {hp: 70, at: 110, df: 80, sa: 95, sd: 60, sp: 70}, - weightkg: 0, - abilities: {0: 'Ripen'}, - baseSpecies: 'Flapple', + canGigantamax: "G-Max Tartness", }, Frosmoth: { types: ['Ice', 'Bug'], @@ -8007,20 +7911,6 @@ const SS_PATCH: {[name: string]: DeepPartial} = { weightkg: 42, abilities: {0: 'Shield Dust'}, }, - 'Garbodor-Gmax': { - types: ['Poison'], - bs: {hp: 80, at: 95, df: 82, sa: 60, sd: 82, sp: 75}, - weightkg: 0, - abilities: {0: 'Stench'}, - baseSpecies: 'Garbodor', - }, - 'Gengar-Gmax': { - types: ['Ghost', 'Poison'], - bs: {hp: 60, at: 65, df: 60, sa: 130, sd: 75, sp: 110}, - weightkg: 0, - abilities: {0: 'Cursed Body'}, - baseSpecies: 'Gengar', - }, Glastrier: { types: ['Ice'], bs: {hp: 100, at: 145, df: 130, sa: 65, sd: 110, sp: 30}, @@ -8052,48 +7942,34 @@ const SS_PATCH: {[name: string]: DeepPartial} = { bs: {hp: 95, at: 120, df: 65, sa: 95, sd: 75, sp: 60}, weightkg: 61, abilities: {0: 'Prankster'}, - otherFormes: ['Grimmsnarl-Gmax'], - }, - 'Grimmsnarl-Gmax': { - types: ['Dark', 'Fairy'], - bs: {hp: 95, at: 120, df: 65, sa: 95, sd: 75, sp: 60}, - weightkg: 0, - abilities: {0: 'Prankster'}, - baseSpecies: 'Grimmsnarl', + canGigantamax: "G-Max Snooze", }, Grookey: { types: ['Grass'], bs: {hp: 50, at: 65, df: 50, sa: 40, sd: 40, sp: 65}, weightkg: 5, - abilities: {0: 'Overgrow'}, + abilities: {0: 'Grassy Surge'}, nfe: true, }, Hatenna: { types: ['Psychic'], bs: {hp: 42, at: 30, df: 45, sa: 56, sd: 53, sp: 39}, weightkg: 3.4, - abilities: {0: 'Healer'}, + abilities: {0: 'Magic Bounce'}, nfe: true, }, Hatterene: { types: ['Psychic', 'Fairy'], bs: {hp: 57, at: 90, df: 95, sa: 136, sd: 103, sp: 29}, weightkg: 5.1, - abilities: {0: 'Healer'}, - otherFormes: ['Hatterene-Gmax'], - }, - 'Hatterene-Gmax': { - types: ['Psychic', 'Fairy'], - bs: {hp: 57, at: 90, df: 95, sa: 136, sd: 103, sp: 29}, - weightkg: 0, - abilities: {0: 'Healer'}, - baseSpecies: 'Hatterene', + abilities: {0: 'Magic Bounce'}, + canGigantamax: "G-Max Smite", }, Hattrem: { types: ['Psychic'], bs: {hp: 57, at: 40, df: 65, sa: 86, sd: 73, sp: 49}, weightkg: 4.8, - abilities: {0: 'Healer'}, + abilities: {0: 'Magic Bounce'}, nfe: true, }, Impidimp: { @@ -8122,21 +7998,7 @@ const SS_PATCH: {[name: string]: DeepPartial} = { bs: {hp: 70, at: 85, df: 65, sa: 125, sd: 65, sp: 120}, weightkg: 45.2, abilities: {0: 'Torrent'}, - otherFormes: ['Inteleon-Gmax'], - }, - 'Inteleon-Gmax': { - types: ['Water'], - bs: {hp: 70, at: 85, df: 65, sa: 125, sd: 65, sp: 120}, - weightkg: 0, - abilities: {0: 'Torrent'}, - baseSpecies: 'Inteleon', - }, - 'Kingler-Gmax': { - types: ['Water'], - bs: {hp: 55, at: 130, df: 115, sa: 50, sd: 50, sp: 75}, - weightkg: 0, - abilities: {0: 'Hyper Cutter'}, - baseSpecies: 'Kingler', + canGigantamax: "G-Max Hydrosnipe", }, 'Kubfu': { types: ['Fighting'], @@ -8145,13 +8007,6 @@ const SS_PATCH: {[name: string]: DeepPartial} = { nfe: true, abilities: {0: 'Inner Focus'}, }, - 'Lapras-Gmax': { - types: ['Water', 'Ice'], - bs: {hp: 130, at: 85, df: 80, sa: 85, sd: 95, sp: 60}, - weightkg: 0, - abilities: {0: 'Water Absorb'}, - baseSpecies: 'Lapras', - }, 'Linoone-Galar': { types: ['Dark', 'Normal'], bs: {hp: 78, at: 70, df: 61, sa: 50, sd: 61, sp: 100}, @@ -8160,7 +8015,6 @@ const SS_PATCH: {[name: string]: DeepPartial} = { nfe: true, baseSpecies: 'Linoone', }, - Magearna: {otherFormes: ['Magearna-Original']}, 'Magearna-Original': { baseSpecies: 'Magearna', types: ['Steel', 'Fairy'], @@ -8169,21 +8023,6 @@ const SS_PATCH: {[name: string]: DeepPartial} = { gender: 'N', abilities: {0: 'Soul-Heart'}, }, - 'Machamp-Gmax': { - types: ['Fighting'], - bs: {hp: 90, at: 130, df: 80, sa: 65, sd: 85, sp: 55}, - weightkg: 0, - abilities: {0: 'Guts'}, - baseSpecies: 'Machamp', - }, - 'Melmetal-Gmax': { - types: ['Steel'], - bs: {hp: 135, at: 143, df: 143, sa: 80, sd: 65, sp: 34}, - weightkg: 0, - abilities: {0: 'Iron Fist'}, - baseSpecies: 'Melmetal', - gender: 'N', - }, 'Meowth-Galar': { types: ['Steel'], bs: {hp: 50, at: 65, df: 55, sa: 40, sd: 40, sp: 40}, @@ -8192,13 +8031,6 @@ const SS_PATCH: {[name: string]: DeepPartial} = { nfe: true, baseSpecies: 'Meowth', }, - 'Meowth-Gmax': { - types: ['Normal'], - bs: {hp: 40, at: 45, df: 35, sa: 40, sd: 40, sp: 90}, - weightkg: 0, - abilities: {0: 'Pickup'}, - baseSpecies: 'Meowth', - }, Miasmaw: { types: ['Bug', 'Dragon'], bs: {hp: 85, at: 135, df: 60, sa: 88, sd: 105, sp: 99}, @@ -8280,14 +8112,7 @@ const SS_PATCH: {[name: string]: DeepPartial} = { bs: {hp: 60, at: 45, df: 110, sa: 80, sd: 120, sp: 90}, weightkg: 40.8, abilities: {0: 'Swarm'}, - otherFormes: ['Orbeetle-Gmax'], - }, - 'Orbeetle-Gmax': { - types: ['Bug', 'Psychic'], - bs: {hp: 60, at: 45, df: 110, sa: 80, sd: 120, sp: 90}, - weightkg: 0, - abilities: {0: 'Swarm'}, - baseSpecies: 'Orbeetle', + canGigantamax: "G-Max Gravitas", }, Perrserker: { types: ['Steel'], @@ -8295,13 +8120,6 @@ const SS_PATCH: {[name: string]: DeepPartial} = { weightkg: 28, abilities: {0: 'Battle Armor'}, }, - 'Pikachu-Gmax': { - types: ['Electric'], - bs: {hp: 35, at: 55, df: 40, sa: 50, sd: 50, sp: 90}, - weightkg: 0, - abilities: {0: 'Static'}, - baseSpecies: 'Pikachu', - }, 'Pikachu-World': { types: ['Electric'], bs: {hp: 35, at: 55, df: 40, sa: 50, sd: 50, sp: 90}, @@ -8343,7 +8161,7 @@ const SS_PATCH: {[name: string]: DeepPartial} = { types: ['Fire'], bs: {hp: 65, at: 86, df: 60, sa: 55, sd: 60, sp: 94}, weightkg: 9, - abilities: {0: 'Blaze'}, + abilities: {0: 'Libero'}, nfe: true, }, 'Rapidash-Galar': { @@ -8371,15 +8189,8 @@ const SS_PATCH: {[name: string]: DeepPartial} = { types: ['Grass'], bs: {hp: 100, at: 125, df: 90, sa: 60, sd: 70, sp: 85}, weightkg: 90, - abilities: {0: 'Overgrow'}, - otherFormes: ['Rillaboom-Gmax'], - }, - 'Rillaboom-Gmax': { - types: ['Grass'], - bs: {hp: 100, at: 125, df: 90, sa: 60, sd: 70, sp: 85}, - weightkg: 0, - abilities: {0: 'Overgrow'}, - baseSpecies: 'Rillaboom', + abilities: {0: 'Grassy Surge'}, + canGigantamax: "G-Max Drum Solo", }, Rolycoly: { types: ['Rock'], @@ -8419,20 +8230,13 @@ const SS_PATCH: {[name: string]: DeepPartial} = { bs: {hp: 72, at: 107, df: 125, sa: 65, sd: 70, sp: 71}, weightkg: 65.5, abilities: {0: 'Sand Spit'}, - otherFormes: ['Sandaconda-Gmax'], - }, - 'Sandaconda-Gmax': { - types: ['Ground'], - bs: {hp: 72, at: 107, df: 125, sa: 65, sd: 70, sp: 71}, - weightkg: 0, - abilities: {0: 'Sand Spit'}, - baseSpecies: 'Sandaconda', + canGigantamax: "G-Max Sandblast", }, Scorbunny: { types: ['Fire'], bs: {hp: 50, at: 71, df: 40, sa: 40, sd: 40, sp: 69}, weightkg: 4.5, - abilities: {0: 'Blaze'}, + abilities: {0: 'Libero'}, nfe: true, }, Silicobra: { @@ -8516,13 +8320,6 @@ const SS_PATCH: {[name: string]: DeepPartial} = { abilities: {0: 'Shield Dust'}, nfe: true, }, - 'Snorlax-Gmax': { - types: ['Normal'], - bs: {hp: 160, at: 110, df: 65, sa: 65, sd: 110, sp: 30}, - weightkg: 0, - abilities: {0: 'Immunity'}, - baseSpecies: 'Snorlax', - }, Sobble: { types: ['Water'], bs: {hp: 50, at: 40, df: 40, sa: 70, sd: 40, sp: 70}, @@ -8575,14 +8372,8 @@ const SS_PATCH: {[name: string]: DeepPartial} = { bs: {hp: 75, at: 98, df: 70, sa: 114, sd: 70, sp: 75}, weightkg: 40, abilities: {0: 'Punk Rock'}, - otherFormes: ['Toxtricity-Gmax', 'Toxtricity-Low-Key', 'Toxtricity-Low-Key-Gmax'], - }, - 'Toxtricity-Gmax': { - types: ['Electric', 'Poison'], - bs: {hp: 75, at: 98, df: 70, sa: 114, sd: 70, sp: 75}, - weightkg: 0, - abilities: {0: 'Punk Rock'}, - baseSpecies: 'Toxtricity', + otherFormes: ['Toxtricity-Low-Key'], + canGigantamax: "G-Max Stun Shock", }, 'Toxtricity-Low-Key': { types: ['Electric', 'Poison'], @@ -8590,20 +8381,15 @@ const SS_PATCH: {[name: string]: DeepPartial} = { weightkg: 40, abilities: {0: 'Punk Rock'}, baseSpecies: 'Toxtricity', - }, - 'Toxtricity-Low-Key-Gmax': { - types: ['Electric', 'Poison'], - bs: {hp: 75, at: 98, df: 70, sa: 114, sd: 70, sp: 75}, - weightkg: 0, - abilities: {0: 'Punk Rock'}, - baseSpecies: 'Toxtricity', + canGigantamax: "G-Max Stun Shock", }, Urshifu: { types: ['Fighting', 'Dark'], bs: {hp: 100, at: 130, df: 100, sa: 63, sd: 60, sp: 97}, weightkg: 105, abilities: {0: 'Unseen Fist'}, - otherFormes: ['Urshifu-Gmax', 'Urshifu-Rapid-Strike', 'Urshifu-Rapid-Strike-Gmax'], + otherFormes: ['Urshifu-Rapid-Strike'], + canGigantamax: "G-Max One Blow", }, 'Urshifu-Rapid-Strike': { types: ['Fighting', 'Water'], @@ -8611,20 +8397,7 @@ const SS_PATCH: {[name: string]: DeepPartial} = { weightkg: 105, abilities: {0: 'Unseen Fist'}, baseSpecies: 'Urshifu', - }, - 'Urshifu-Rapid-Strike-Gmax': { - types: ['Fighting', 'Water'], - bs: {hp: 100, at: 130, df: 100, sa: 63, sd: 60, sp: 97}, - weightkg: 105, - abilities: {0: 'Unseen Fist'}, - baseSpecies: 'Urshifu', - }, - 'Urshifu-Gmax': { - types: ['Fighting', 'Dark'], - bs: {hp: 100, at: 130, df: 100, sa: 63, sd: 60, sp: 97}, - weightkg: 0, - abilities: {0: 'Unseen Fist'}, - baseSpecies: 'Urshifu', + canGigantamax: "G-Max Rapid Flow", }, Venomicon: { types: ['Poison', 'Flying'], @@ -8642,13 +8415,6 @@ const SS_PATCH: {[name: string]: DeepPartial} = { baseSpecies: 'Venomicon', gender: 'N', }, - 'Venusaur-Gmax': { - types: ['Grass', 'Poison'], - bs: {hp: 80, at: 82, df: 83, sa: 100, sd: 100, sp: 80}, - weightkg: 0, - abilities: {0: 'Overgrow'}, - baseSpecies: 'Venusaur', - }, 'Weezing-Galar': { types: ['Poison', 'Fairy'], bs: {hp: 65, at: 90, df: 120, sa: 85, sd: 70, sp: 60}, @@ -8746,6 +8512,12 @@ const SS_PATCH: {[name: string]: DeepPartial} = { const SS: {[name: string]: SpeciesData} = extend(true, {}, SM, SS_PATCH); +for (const speciesName in SS) { + if (SS[speciesName].canGigantamax) { + SS[speciesName + '-Gmax'] = SS[speciesName]; + } +} + delete SS['Pikachu-Starter']; delete SS['Eevee-Starter']; @@ -9755,6 +9527,13 @@ const SV_PATCH: {[name: string]: DeepPartial} = { const SV: {[name: string]: SpeciesData} = extend(true, {}, SS, SV_PATCH, PLA_PATCH); +for (const speciesName in SV) { + if (SV[speciesName].canGigantamax) { + // @ts-ignore readonly + delete SV[speciesName].canGigantamax; + } +} + export const SPECIES = [{}, RBY, GSC, ADV, DPP, BW, XY, SM, SS, SV]; export class Species implements I.Species { @@ -9785,10 +9564,11 @@ class Specie implements I.Specie { readonly nfe?: boolean; readonly gender?: I.GenderName; readonly otherFormes?: I.SpeciesName[]; + readonly canGigantamax?: I.MoveName; readonly baseSpecies?: I.SpeciesName; readonly abilities?: {0: I.AbilityName}; // ability - private static readonly EXCLUDE = new Set(['bs', 'otherFormes']); + private static readonly EXCLUDE = new Set(['bs']); constructor(name: string, data: SpeciesData) { this.kind = 'Species'; @@ -9803,15 +9583,6 @@ class Specie implements I.Specie { baseStats.spd = gen >= 2 ? data.bs.sd : data.bs.sl; baseStats.spe = data.bs.sp; this.baseStats = baseStats as I.StatsTable; - // Hack for getting Gmax pokemon out of existence in Gen 9+ - if (data.otherFormes) { - this.otherFormes = data.otherFormes as I.SpeciesName[]; - if (gen >= 9 && !['toxtricity', 'urshifu'].includes(this.id)) { - this.otherFormes = this.otherFormes.filter(f => !f.endsWith('-Gmax')); - if (!this.otherFormes.length) this.otherFormes = undefined; - if (this.otherFormes) this.otherFormes = [...new Set(this.otherFormes)]; - } - } assignWithout(this, data, Specie.EXCLUDE); } diff --git a/calc/src/desc.ts b/calc/src/desc.ts index 89bb7f331..5231f1322 100644 --- a/calc/src/desc.ts +++ b/calc/src/desc.ts @@ -48,7 +48,7 @@ export interface RawDesc { rivalry?: 'buffed' | 'nerfed'; terrain?: Terrain; weather?: Weather; - isDefenderDynamaxed?: boolean; + isDefenderDynamaxed?: 'gmax' | boolean; } export function display( @@ -914,7 +914,7 @@ function buildDescription(description: RawDesc, attacker: Pokemon, defender: Pok output += 'protected '; } if (description.isDefenderDynamaxed) { - output += 'Dynamax '; + output += description.isDefenderDynamaxed === 'gmax' ? 'Gigantamax ' : 'Dynamax '; } if (description.defenderTera) { output += `Tera ${description.defenderTera} `; diff --git a/calc/src/move.ts b/calc/src/move.ts index 1f4d72994..31757313b 100644 --- a/calc/src/move.ts +++ b/calc/src/move.ts @@ -13,7 +13,8 @@ export class Move implements State.Move { item?: I.ItemName; species?: I.SpeciesName; useZ?: boolean; - useMax?: boolean; + useMax?: 'gmax' | boolean; + isGmax?: boolean; overrides?: Partial; hits: number; @@ -62,7 +63,8 @@ export class Move implements State.Move { data.type, options.species, !!(data.category === 'Status'), - options.ability + options.ability, + !!(options.useMax === 'gmax') ); const maxMove = gen.moves.get(toID(maxMoveName)); const maxPower = () => { @@ -239,64 +241,64 @@ export function getMaxMoveName( moveType: I.TypeName, pokemonSpecies?: string, isStatus?: boolean, - pokemonAbility?: string + pokemonAbility?: string, + isGmax?: boolean, ) { if (isStatus) return 'Max Guard'; if (pokemonAbility === 'Normalize') return 'Max Strike'; if (moveType === 'Fire') { - if (pokemonSpecies === 'Charizard-Gmax') return 'G-Max Wildfire'; - if (pokemonSpecies === 'Centiskorch-Gmax') return 'G-Max Centiferno'; - if (pokemonSpecies === 'Cinderace-Gmax') return 'G-Max Fire Ball'; + if (pokemonSpecies === 'Charizard' && isGmax) return 'G-Max Wildfire'; + if (pokemonSpecies === 'Centiskorch' && isGmax) return 'G-Max Centiferno'; + if (pokemonSpecies === 'Cinderace' && isGmax) return 'G-Max Fireball'; } if (moveType === 'Normal') { - if (pokemonSpecies === 'Eevee-Gmax') return 'G-Max Cuddle'; - if (pokemonSpecies === 'Meowth-Gmax') return 'G-Max Gold Rush'; - if (pokemonSpecies === 'Snorlax-Gmax') return 'G-Max Replenish'; + if (pokemonSpecies === 'Eevee' && isGmax) return 'G-Max Cuddle'; + if (pokemonSpecies === 'Meowth' && isGmax) return 'G-Max Gold Rush'; + if (pokemonSpecies === 'Snorlax' && isGmax) return 'G-Max Replenish'; if (pokemonAbility === 'Pixilate') return 'Max Starfall'; if (pokemonAbility === 'Aerilate') return 'Max Airstream'; if (pokemonAbility === 'Refrigerate') return 'Max Hailstorm'; if (pokemonAbility === 'Galvanize') return 'Max Lightning'; } if (moveType === 'Fairy') { - if (pokemonSpecies === 'Alcremie-Gmax') return 'G-Max Finale'; - if (pokemonSpecies === 'Hatterene-Gmax') return 'G-Max Smite'; + if (pokemonSpecies === 'Alcremie' && isGmax) return 'G-Max Finale'; + if (pokemonSpecies === 'Hatterene' && isGmax) return 'G-Max Smite'; } if (moveType === 'Steel') { - if (pokemonSpecies === 'Copperajah-Gmax') return 'G-Max Steelsurge'; - if (pokemonSpecies === 'Melmetal-Gmax') return 'G-Max Meltdown'; + if (pokemonSpecies === 'Copperajah' && isGmax) return 'G-Max Steelsurge'; + if (pokemonSpecies === 'Melmetal' && isGmax) return 'G-Max Meltdown'; } if (moveType === 'Electric') { - if (pokemonSpecies === 'Pikachu-Gmax') return 'G-Max Volt Crash'; - if (pokemonSpecies?.startsWith('Toxtricity') && - pokemonSpecies?.endsWith('Gmax')) return 'G-Max Stun Shock'; + if (pokemonSpecies === 'Pikachu' && isGmax) return 'G-Max Volt Crash'; + if (pokemonSpecies?.startsWith('Toxtricity') && isGmax) return 'G-Max Stun Shock'; } if (moveType === 'Grass') { - if (pokemonSpecies === 'Appletun-Gmax') return 'G-Max Sweetness'; - if (pokemonSpecies === 'Flapple-Gmax') return 'G-Max Tartness'; - if (pokemonSpecies === 'Rillaboom-Gmax') return 'G-Max Drum Solo'; - if (pokemonSpecies === 'Venusaur-Gmax') return 'G-Max Vine Lash'; + if (pokemonSpecies === 'Appletun' && isGmax) return 'G-Max Sweetness'; + if (pokemonSpecies === 'Flapple' && isGmax) return 'G-Max Tartness'; + if (pokemonSpecies === 'Rillaboom' && isGmax) return 'G-Max Drum Solo'; + if (pokemonSpecies === 'Venusaur' && isGmax) return 'G-Max Vine Lash'; } if (moveType === 'Water') { - if (pokemonSpecies === 'Blastoise-Gmax') return 'G-Max Cannonade'; - if (pokemonSpecies === 'Drednaw-Gmax') return 'G-Max Stonesurge'; - if (pokemonSpecies === 'Inteleon-Gmax') return 'G-Max Hydrosnipe'; - if (pokemonSpecies === 'Kingler-Gmax') return 'G-Max Foam Burst'; - if (pokemonSpecies === 'Urshifu-Rapid-Strike-Gmax') return 'G-Max Rapid Flow'; + if (pokemonSpecies === 'Blastoise' && isGmax) return 'G-Max Cannonade'; + if (pokemonSpecies === 'Drednaw' && isGmax) return 'G-Max Stonesurge'; + if (pokemonSpecies === 'Inteleon' && isGmax) return 'G-Max Hydrosnipe'; + if (pokemonSpecies === 'Kingler' && isGmax) return 'G-Max Foam Burst'; + if (pokemonSpecies === 'Urshifu-Rapid-Strike' && isGmax) return 'G-Max Rapid Flow'; } if (moveType === 'Dark') { - if (pokemonSpecies === 'Grimmsnarl-Gmax') return 'G-Max Snooze'; - if (pokemonSpecies === 'Urshifu-Gmax') return 'G-Max One Blow'; + if (pokemonSpecies === 'Grimmsnarl' && isGmax) return 'G-Max Snooze'; + if (pokemonSpecies === 'Urshifu' && isGmax) return 'G-Max One Blow'; } - if (moveType === 'Poison' && pokemonSpecies === 'Garbodor-Gmax') return 'G-Max Malodor'; - if (moveType === 'Fighting' && pokemonSpecies === 'Machamp-Gmax') return 'G-Max Chi Strike'; - if (moveType === 'Ghost' && pokemonSpecies === 'Gengar-Gmax') return 'G-Max Terror'; - if (moveType === 'Ice' && pokemonSpecies === 'Lapras-Gmax') return 'G-Max Resonance'; - if (moveType === 'Flying' && pokemonSpecies === 'Corviknight-Gmax') return 'G-Max Wind Rage'; - if (moveType === 'Dragon' && pokemonSpecies === 'Duraludon-Gmax') return 'G-Max Depletion'; - if (moveType === 'Psychic' && pokemonSpecies === 'Orbeetle-Gmax') return 'G-Max Gravitas'; - if (moveType === 'Rock' && pokemonSpecies === 'Coalossal-Gmax') return 'G-Max Volcalith'; - if (moveType === 'Ground' && pokemonSpecies === 'Sandaconda-Gmax') return 'G-Max Sandblast'; - if (moveType === 'Dark' && pokemonSpecies === 'Grimmsnarl-Gmax') return 'G-Max Snooze'; + if (moveType === 'Poison' && pokemonSpecies === 'Garbodor' && isGmax) return 'G-Max Malodor'; + if (moveType === 'Fighting' && pokemonSpecies === 'Machamp' && isGmax) return 'G-Max Chi Strike'; + if (moveType === 'Ghost' && pokemonSpecies === 'Gengar' && isGmax) return 'G-Max Terror'; + if (moveType === 'Ice' && pokemonSpecies === 'Lapras' && isGmax) return 'G-Max Resonance'; + if (moveType === 'Flying' && pokemonSpecies === 'Corviknight' && isGmax) return 'G-Max Wind Rage'; + if (moveType === 'Dragon' && pokemonSpecies === 'Duraludon' && isGmax) return 'G-Max Depletion'; + if (moveType === 'Psychic' && pokemonSpecies === 'Orbeetle' && isGmax) return 'G-Max Gravitas'; + if (moveType === 'Rock' && pokemonSpecies === 'Coalossal' && isGmax) return 'G-Max Volcalith'; + if (moveType === 'Ground' && pokemonSpecies === 'Sandaconda' && isGmax) return 'G-Max Sandblast'; + if (moveType === 'Dark' && pokemonSpecies === 'Grimmsnarl' && isGmax) return 'G-Max Snooze'; return 'Max ' + MAXMOVES_TYPING[moveType]; } diff --git a/calc/src/pokemon.ts b/calc/src/pokemon.ts index b20fe86ad..00f47fa9d 100644 --- a/calc/src/pokemon.ts +++ b/calc/src/pokemon.ts @@ -19,7 +19,7 @@ export class Pokemon implements State.Pokemon { gender?: I.GenderName; ability?: I.AbilityName; abilityOn?: boolean; - isDynamaxed?: boolean; + isDynamaxed?: 'gmax' | boolean; isSaltCure?: boolean; alliesFainted?: number; item?: I.ItemName; @@ -53,7 +53,6 @@ export class Pokemon implements State.Pokemon { this.gen = gen; this.name = options.name || name as I.SpeciesName; this.types = this.species.types; - this.weightkg = this.species.weightkg; this.level = options.level || 100; this.gender = options.gender || this.species.gender || 'M'; @@ -61,6 +60,7 @@ export class Pokemon implements State.Pokemon { this.abilityOn = !!options.abilityOn; this.isDynamaxed = !!options.isDynamaxed; + this.weightkg = this.isDynamaxed ? 0 : this.species.weightkg; this.isSaltCure = !!options.isSaltCure; this.alliesFainted = options.alliesFainted; this.teraType = options.teraType; @@ -70,12 +70,6 @@ export class Pokemon implements State.Pokemon { this.evs = Pokemon.withDefault(gen, options.evs, gen.num >= 3 ? 0 : 252); this.boosts = Pokemon.withDefault(gen, options.boosts, 0, false); - // Gigantamax 'forms' inherit weight from their base species when not dynamaxed - // TODO: clean this up with proper Gigantamax support - if (this.weightkg === 0 && !this.isDynamaxed && this.species.baseSpecies) { - this.weightkg = gen.species.get(toID(this.species.baseSpecies))!.weightkg; - } - if (gen.num < 3) { this.ivs.hp = Stats.DVToIV( Stats.getHPDV({ diff --git a/calc/src/state.ts b/calc/src/state.ts index 6e051143f..69e96e40e 100644 --- a/calc/src/state.ts +++ b/calc/src/state.ts @@ -6,7 +6,7 @@ export namespace State { level?: number; ability?: I.AbilityName; abilityOn?: boolean; - isDynamaxed?: boolean; + isDynamaxed?: 'gmax' | boolean; isSaltCure?: boolean; alliesFainted?: number; item?: I.ItemName; @@ -26,7 +26,7 @@ export namespace State { export interface Move { name: I.MoveName; useZ?: boolean; - useMax?: boolean; + useMax?: 'gmax' | boolean; isCrit?: boolean; hits?: number; timesUsed?: number; diff --git a/calc/src/test/gen.ts b/calc/src/test/gen.ts index e1ea6e010..384ec77b1 100644 --- a/calc/src/test/gen.ts +++ b/calc/src/test/gen.ts @@ -301,6 +301,7 @@ class Specie implements I.Specie { readonly weightkg: number; readonly nfe?: boolean; readonly gender?: I.GenderName; + readonly canGigantamax?: I.MoveName; readonly otherFormes?: I.SpeciesName[]; readonly baseSpecies?: I.SpeciesName; readonly abilities?: {0: I.AbilityName}; @@ -324,30 +325,12 @@ class Specie implements I.Specie { } else { this.baseSpecies = 'Aegislash-Blade' as I.SpeciesName; } - } else if (species.id === 'toxtricity') { - this.otherFormes = [ - 'Toxtricity-Gmax', 'Toxtricity-Low-Key', 'Toxtricity-Low-Key-Gmax', - ] as I.SpeciesName[]; - } else if (species.id === 'toxtricitylowkey') { - this.baseSpecies = 'Toxtricity' as I.SpeciesName; - } else if (species.id === 'urshifu') { - this.otherFormes = [ - 'Urshifu-Gmax', 'Urshifu-Rapid-Strike', 'Urshifu-Rapid-Strike-Gmax', - ] as I.SpeciesName[]; - } else if (species.id === 'eternatus') { - this.otherFormes = ['Eternatus-Eternamax'] as I.SpeciesName[]; } else if (formes?.length) { this.otherFormes = [...formes].sort() as I.SpeciesName[]; } else if (species.baseSpecies !== this.name) { this.baseSpecies = species.baseSpecies as I.SpeciesName; } - // TODO: clean this up with proper Gigantamax support - if (dex.gen === 8 && species.canGigantamax && - !(species.id.startsWith('toxtricity') || species.id.startsWith('urshifu'))) { - const formes = this.otherFormes || []; - const gmax = dex.species.get(`${species.name}-Gmax`); - if (exists(gmax, dex.gen)) this.otherFormes = [...formes, gmax.name].sort(); - } + if (species.canGigantamax) this.canGigantamax = species.canGigantamax; if (dex.gen > 2) this.abilities = {0: species.abilities[0] as I.AbilityName}; } @@ -505,7 +488,7 @@ function exists(val: D.Ability| D.Item | D.Move | D.Species | D.Type, gen: I.Gen } if (gen >= 6 && ['floetteeternal'].includes(val.id)) return true; // TODO: clean this up with proper Gigantamax support - if (val.isNonstandard && !['CAP', 'Unobtainable', 'Gigantamax'].includes(val.isNonstandard)) { + if (val.isNonstandard && !['CAP', 'Unobtainable'].includes(val.isNonstandard)) { return false; } return !('tier' in val && ['Illegal', 'Unreleased'].includes(val.tier)); diff --git a/calc/src/test/pokemon.test.ts b/calc/src/test/pokemon.test.ts index eae3faa55..b35efa35f 100644 --- a/calc/src/test/pokemon.test.ts +++ b/calc/src/test/pokemon.test.ts @@ -115,7 +115,7 @@ describe('Pokemon', () => { test('Gigantamx weights', () => { expect(new Pokemon(8, 'Venusaur-Gmax').weightkg).toBe(100); - expect(new Pokemon(8, 'Venusaur-Gmax', {isDynamaxed: true}).weightkg).toBe(0); + expect(new Pokemon(8, 'Venusaur', {isDynamaxed: 'gmax'}).weightkg).toBe(0); expect(new Pokemon(8, 'Venusaur-Gmax', {overrides: {weightkg: 50}}).weightkg).toBe(50); }); }); diff --git a/import/src/sets.ts b/import/src/sets.ts index 9c0a44b96..cda576ce7 100644 --- a/import/src/sets.ts +++ b/import/src/sets.ts @@ -171,10 +171,8 @@ const FORMES: {[name: string]: string} = { 'Keldeo-Resolute': 'Keldeo', }; -// TODO handle Gmax function toForme(pokemon: string) { if (pokemon.endsWith('-Totem')) return pokemon.slice(0, -6); - if (pokemon.endsWith('-Gmax')) return pokemon.slice(0, -5); return FORMES[pokemon] || pokemon; } diff --git a/src/honkalculate.template.html b/src/honkalculate.template.html index 3954d6e66..f16bb003e 100644 --- a/src/honkalculate.template.html +++ b/src/honkalculate.template.html @@ -438,7 +438,20 @@ /341 ( %) - +
+
+
+ + +
+
+
+
+ + + + +


Health
diff --git a/src/index.template.html b/src/index.template.html index 201ebcf31..8841e1b10 100644 --- a/src/index.template.html +++ b/src/index.template.html @@ -501,10 +501,20 @@ /341 ( %) - - -
+
+
+
+ + +
+
+
+
+ + + + +

Health
@@ -1380,10 +1390,20 @@ /341 ( %) - - -
+
+
+
+ + +
+
+
+
+ + + + +

Health
diff --git a/src/js/moveset_import.js b/src/js/moveset_import.js index 93ad398af..2677244f8 100644 --- a/src/js/moveset_import.js +++ b/src/js/moveset_import.js @@ -18,6 +18,7 @@ function ExportPokemon(pokeInfo) { finalText += pokemon.nature && gen > 2 ? pokemon.nature + " Nature" + "\n" : ""; finalText += pokemon.teraType && gen > 8 ? "Tera Type: " + pokemon.teraType : ""; finalText += pokemon.ability ? "Ability: " + pokemon.ability + "\n" : ""; + finalText += pokemon.isDynamaxed === 'gmax' ? "Gigantamax: Yes\n" : ""; if (gen > 2) { var EVs_Array = []; for (var stat in pokemon.evs) { @@ -344,6 +345,9 @@ function checkExeptions(poke) { poke = "Florges"; break; } + if (poke.endsWith('-Gmax')) { + return poke.slice(0, -5); + } return poke; } diff --git a/src/js/shared_controls.js b/src/js/shared_controls.js index 517455737..70717665f 100644 --- a/src/js/shared_controls.js +++ b/src/js/shared_controls.js @@ -617,6 +617,18 @@ $(".set-selector").change(function () { } else { formeObj.hide(); } + if (gen === 8) { + if (pokemon.canGigantamax) { + $(this).closest('.poke-info').find('.dynamaxOnly').hide(); + $(this).closest('.poke-info').find('.dynamaxAndGigantamax').show(); + } else { + $(this).closest('.poke-info').find('.dynamaxOnly').show(); + $(this).closest('.poke-info').find('.dynamaxAndGigantamax').hide(); + } + } else { + $(this).closest('.poke-info').find('.dynamaxOnly').hide(); + $(this).closest('.poke-info').find('.dynamaxAndGigantamax').hide(); + } calcHP(pokeObj); calcStats(pokeObj); abilityObj.change(); @@ -838,12 +850,17 @@ function createPokemon(pokeInfo) { var ability = pokeInfo.find(".ability").val(); var item = pokeInfo.find(".item").val(); var isDynamaxed = pokeInfo.find(".max").prop("checked"); + var isGigantamaxed = pokeInfo.find(".gmax").prop("checked"); + if (isGigantamaxed) { + pokeInfo.find(".max").prop("checked", true); + isDynamaxed = pokeInfo.find(".max").prop("checked"); + } var teraType = pokeInfo.find(".teraToggle").is(":checked") ? pokeInfo.find(".teraType").val() : undefined; - pokeInfo.isDynamaxed = isDynamaxed; + pokeInfo.isDynamaxed = isGigantamaxed ? 'gmax' : !!isDynamaxed; calcHP(pokeInfo); var curHP = ~~pokeInfo.find(".current-hp").val(); // FIXME the Pokemon constructor expects non-dynamaxed HP - if (isDynamaxed) curHP = Math.floor(curHP / 2); + if (pokeInfo.isDynamaxed) curHP = Math.floor(curHP / 2); var types = [pokeInfo.find(".type1").val(), pokeInfo.find(".type2").val()]; return new calc.Pokemon(gen, name, { level: ~~pokeInfo.find(".level").val(), @@ -854,7 +871,7 @@ function createPokemon(pokeInfo) { nature: pokeInfo.find(".nature").val(), ivs: ivs, evs: evs, - isDynamaxed: isDynamaxed, + isDynamaxed: isGigantamaxed ? 'gmax' : !!isDynamaxed, isSaltCure: pokeInfo.find(".saltcure").is(":checked"), alliesFainted: parseInt(pokeInfo.find(".alliesFainted").val()), teraType: teraType, @@ -895,8 +912,8 @@ function getMoveDetails(moveInfo, species, ability, item, useMax) { }; if (gen >= 4) overrides.category = moveInfo.find(".move-cat").val(); return new calc.Move(gen, moveName, { - ability: ability, item: item, useZ: isZMove, species: species, isCrit: isCrit, hits: hits, - timesUsed: timesUsed, timesUsedWithMetronome: timesUsedWithMetronome, overrides: overrides, useMax: useMax + ability: ability, item: item, useZ: isZMove, species: species, isCrit: isCrit, hits: hits, timesUsed: timesUsed, + timesUsedWithMetronome: timesUsedWithMetronome, overrides: overrides, useMax: useMax, }); } diff --git a/src/randoms.template.html b/src/randoms.template.html index d1a4942a6..3b99119ad 100644 --- a/src/randoms.template.html +++ b/src/randoms.template.html @@ -518,10 +518,20 @@ /341 ( %) - - -
+
+
+
+ + +
+
+
+
+ + + + +

Health
@@ -1370,10 +1380,20 @@ /341 ( %) - - -
+
+
+
+ + +
+
+
+ + +
+ + +

Health