From 7d8e97d5611ee17705f06d78e7b3240d125c84aa Mon Sep 17 00:00:00 2001 From: Kris Johnson <11083252+KrisXV@users.noreply.github.com> Date: Tue, 8 Sep 2020 23:56:03 -0600 Subject: [PATCH] Implement Gigantamaxing properly --- calc/src/data/species.ts | 327 +++++---------------------------- calc/src/desc.ts | 4 +- calc/src/move.ts | 73 ++++---- calc/src/pokemon.ts | 2 +- calc/src/state.ts | 3 +- calc/src/test/gen.ts | 21 +-- calc/src/test/pokemon.test.ts | 2 +- import/src/sets.ts | 2 - src/honkalculate.template.html | 8 + src/index.template.html | 18 ++ src/js/moveset_import.js | 4 + src/js/shared_controls.js | 23 ++- src/randoms.template.html | 18 ++ 13 files changed, 153 insertions(+), 352 deletions(-) diff --git a/calc/src/data/species.ts b/calc/src/data/species.ts index 97bd22bde..8c18ad673 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,31 @@ 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']}, + 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 +7534,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 +7550,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 +7607,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 +7620,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 +7656,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 +7676,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 +7691,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 +7713,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 +7817,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 +7844,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 +7902,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 +7910,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 +7941,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 +7997,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 +8006,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 +8014,6 @@ const SS_PATCH: {[name: string]: DeepPartial} = { nfe: true, baseSpecies: 'Linoone', }, - Magearna: {otherFormes: ['Magearna-Original']}, 'Magearna-Original': { baseSpecies: 'Magearna', types: ['Steel', 'Fairy'], @@ -8169,21 +8022,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 +8030,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 +8111,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 +8119,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 +8160,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 +8188,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 +8229,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 +8319,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 +8371,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 +8380,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 +8396,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 +8414,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}, 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..00badc081 100644 --- a/calc/src/move.ts +++ b/calc/src/move.ts @@ -14,6 +14,7 @@ export class Move implements State.Move { species?: I.SpeciesName; useZ?: boolean; useMax?: 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.isGmax ); const maxMove = gen.moves.get(toID(maxMoveName)); const maxPower = () => { @@ -110,6 +112,7 @@ export class Move implements State.Move { this.item = options.item; this.useZ = options.useZ; this.useMax = options.useMax; + this.isGmax = options.useMax; this.overrides = options.overrides; this.species = options.species; @@ -175,6 +178,7 @@ export class Move implements State.Move { species: this.species, useZ: this.useZ, useMax: this.useMax, + isGmax: this.isGmax, isCrit: this.isCrit, hits: this.hits, timesUsed: this.timesUsed, @@ -239,64 +243,65 @@ 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 === 'Pikachu' && isGmax) return 'G-Max Volt Crash'; if (pokemonSpecies?.startsWith('Toxtricity') && pokemonSpecies?.endsWith('Gmax')) 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..a1b4f9bb9 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; diff --git a/calc/src/state.ts b/calc/src/state.ts index 6e051143f..457725278 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; @@ -27,6 +27,7 @@ export namespace State { name: I.MoveName; useZ?: boolean; useMax?: boolean; + isGmax?: boolean; isCrit?: boolean; hits?: number; timesUsed?: number; diff --git a/calc/src/test/gen.ts b/calc/src/test/gen.ts index e1ea6e010..0308d1799 100644 --- a/calc/src/test/gen.ts +++ b/calc/src/test/gen.ts @@ -324,30 +324,11 @@ 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 (dex.gen > 2) this.abilities = {0: species.abilities[0] as I.AbilityName}; } @@ -505,7 +486,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..ea2d0cb4d 100644 --- a/src/honkalculate.template.html +++ b/src/honkalculate.template.html @@ -438,7 +438,15 @@ /341 ( %) +<<<<<<< HEAD +======= +
+ + + + +>>>>>>> Implement Gigantamaxing properly

Health
diff --git a/src/index.template.html b/src/index.template.html index 201ebcf31..d4eb92e59 100644 --- a/src/index.template.html +++ b/src/index.template.html @@ -501,10 +501,19 @@ /341 ( %) +<<<<<<< HEAD
+======= +
+ + + + +
+>>>>>>> Implement Gigantamaxing properly
Health
@@ -1380,10 +1389,19 @@ /341 ( %) +<<<<<<< HEAD
+======= +
+ + + + +
+>>>>>>> Implement Gigantamaxing properly
Health
diff --git a/src/js/moveset_import.js b/src/js/moveset_import.js index 93ad398af..66c8dfb45 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.isGigantamaxed ? "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..fe4949737 100644 --- a/src/js/shared_controls.js +++ b/src/js/shared_controls.js @@ -838,12 +838,15 @@ function createPokemon(pokeInfo) { var ability = pokeInfo.find(".ability").val(); var item = pokeInfo.find(".item").val(); var isDynamaxed = pokeInfo.find(".max").prop("checked"); + var isGigantamaxed = isDynamaxed && pokeInfo.find(".gmax").prop("checked"); var teraType = pokeInfo.find(".teraToggle").is(":checked") ? pokeInfo.find(".teraType").val() : undefined; pokeInfo.isDynamaxed = isDynamaxed; + pokeInfo.isGigantamaxed = isGigantamaxed; + if (pokeInfo.isGigantamaxed) pokeInfo.isDynamaxed = true; 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 (isDynamaxed || isGigantamaxed) 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 +857,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, @@ -863,10 +866,10 @@ function createPokemon(pokeInfo) { status: CALC_STATUS[pokeInfo.find(".status").val()], toxicCounter: status === 'Badly Poisoned' ? ~~pokeInfo.find(".toxic-counter").val() : 0, moves: [ - getMoveDetails(pokeInfo.find(".move1"), name, ability, item, isDynamaxed), - getMoveDetails(pokeInfo.find(".move2"), name, ability, item, isDynamaxed), - getMoveDetails(pokeInfo.find(".move3"), name, ability, item, isDynamaxed), - getMoveDetails(pokeInfo.find(".move4"), name, ability, item, isDynamaxed) + getMoveDetails(pokeInfo.find(".move1"), name, ability, item, isDynamaxed, isGigantamaxed), + getMoveDetails(pokeInfo.find(".move2"), name, ability, item, isDynamaxed, isGigantamaxed), + getMoveDetails(pokeInfo.find(".move3"), name, ability, item, isDynamaxed, isGigantamaxed), + getMoveDetails(pokeInfo.find(".move4"), name, ability, item, isDynamaxed, isGigantamaxed) ], overrides: { baseStats: baseStats, @@ -882,7 +885,7 @@ function getGender(gender) { return 'F'; } -function getMoveDetails(moveInfo, species, ability, item, useMax) { +function getMoveDetails(moveInfo, species, ability, item, useMax, isGmax) { var moveName = moveInfo.find("select.move-selector").val(); var isZMove = gen > 6 && moveInfo.find("input.move-z").prop("checked"); var isCrit = moveInfo.find(".move-crit").prop("checked"); @@ -895,8 +898,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, isGmax: isGmax }); } @@ -993,7 +996,7 @@ function calcStat(poke, StatID) { } // Shedinja still has 1 max HP during the effect even if its Dynamax Level is maxed (DaWoblefet) var total = calc.calcStat(gen, legacyStatToStat(StatID), base, ivs, evs, level, nature); - if (gen > 7 && StatID === "hp" && poke.isDynamaxed && total !== 1) { + if (gen > 7 && StatID === "hp" && (poke.isDynamaxed || poke.isGigantamaxed) && total !== 1) { total *= 2; } stat.find(".total").text(total); diff --git a/src/randoms.template.html b/src/randoms.template.html index d1a4942a6..d44bd943a 100644 --- a/src/randoms.template.html +++ b/src/randoms.template.html @@ -518,10 +518,19 @@ /341 ( %) +<<<<<<< HEAD
+======= +
+ + + + +
+>>>>>>> Implement Gigantamaxing properly
Health
@@ -1370,10 +1379,19 @@ /341 ( %) +<<<<<<< HEAD
+======= +
+ + + + +
+>>>>>>> Implement Gigantamaxing properly
Health