From ca3106a7ef7bec6c7bbbf3033569791b32900e50 Mon Sep 17 00:00:00 2001 From: Karthik99999 Date: Wed, 13 Sep 2023 12:30:24 -0700 Subject: [PATCH] Support Teal Mask DLC changes --- js/client-teambuilder.js | 22 ++++++++++++++-------- src/battle-animations.ts | 1 + src/battle-dex-data.ts | 10 ++++++---- src/battle-tooltips.ts | 14 ++++++++++++++ src/battle.ts | 2 +- 5 files changed, 36 insertions(+), 13 deletions(-) diff --git a/js/client-teambuilder.js b/js/client-teambuilder.js index c96a8f39bc..11108bb952 100644 --- a/js/client-teambuilder.js +++ b/js/client-teambuilder.js @@ -1241,7 +1241,7 @@ } } if (this.curTeam.gen === 9) { - buf += '' + (set.teraType || species.types[0]) + ''; + buf += '' + (species.forceTeraType || set.teraType || species.types[0]) + ''; } } buf += ''; @@ -2689,13 +2689,19 @@ } if (this.curTeam.gen === 9) { - buf += '
'; + var types = Dex.types.all(); + var teraType = set.teraType || species.types[0]; + for (var i = 0; i < types.length; i++) { + buf += ''; + } + buf += ''; } - buf += '
'; + buf += ''; } buf += ''; @@ -2806,7 +2812,7 @@ } } if (this.curTeam.gen === 9) { - buf += '' + (set.teraType || species.types[0]) + ''; + buf += '' + (species.forceTeraType || set.teraType || species.types[0]) + ''; } } this.$('button[name=details]').html(buf); diff --git a/src/battle-animations.ts b/src/battle-animations.ts index b88bb4bf29..7a6fc1b459 100644 --- a/src/battle-animations.ts +++ b/src/battle-animations.ts @@ -1807,6 +1807,7 @@ export class PokemonSprite extends Sprite { octolock: ['Octolock', 'bad'], tarshot: ['Tar Shot', 'bad'], saltcure: ['Salt Cure', 'bad'], + syrupbomb: ['Syrupy', 'bad'], doomdesire: null, futuresight: null, mimic: ['Mimic', 'good'], diff --git a/src/battle-dex-data.ts b/src/battle-dex-data.ts index 11463ccdf0..9850b75779 100644 --- a/src/battle-dex-data.ts +++ b/src/battle-dex-data.ts @@ -1412,9 +1412,10 @@ class Species implements Effect { readonly tier: string; readonly isTotem: boolean; readonly isMega: boolean; - readonly cannotDynamax: boolean; - readonly canGigantamax: boolean; readonly isPrimal: boolean; + readonly canGigantamax: boolean; + readonly cannotDynamax: boolean; + readonly forceTeraType: TypeName; readonly battleOnly: string | string[] | undefined; readonly isNonstandard: string | null; readonly unreleasedHidden: boolean | 'Past'; @@ -1466,9 +1467,10 @@ class Species implements Effect { this.isTotem = false; this.isMega = !!(this.forme && ['-mega', '-megax', '-megay'].includes(this.formeid)); - this.cannotDynamax = !!data.cannotDynamax; - this.canGigantamax = !!data.canGigantamax; this.isPrimal = !!(this.forme && this.formeid === '-primal'); + this.canGigantamax = !!data.canGigantamax; + this.cannotDynamax = !!data.cannotDynamax; + this.forceTeraType = data.forceTeraType || ''; this.battleOnly = data.battleOnly || undefined; this.isNonstandard = data.isNonstandard || null; this.unreleasedHidden = data.unreleasedHidden || false; diff --git a/src/battle-tooltips.ts b/src/battle-tooltips.ts index 566e794f3f..48110d9bbe 100644 --- a/src/battle-tooltips.ts +++ b/src/battle-tooltips.ts @@ -1479,6 +1479,20 @@ class BattleTooltips { break; } } + // Ivy Cudgel's type depends on the Ogerpon forme + if (move.id === 'ivycudgel') { + switch (pokemon.getSpeciesForme()) { + case 'Ogerpon-Wellspring': case 'Ogerpon-Wellspring-Tera': + moveType = 'Water'; + break; + case 'Ogerpon-Hearthflame': case 'Ogerpon-Hearthflame-Tera': + moveType = 'Fire'; + break; + case 'Ogerpon-Cornerstone': case 'Ogerpon-Cornerstone-Tera': + moveType = 'Rock'; + break; + } + } // Other abilities that change the move type. const noTypeOverride = [ diff --git a/src/battle.ts b/src/battle.ts index 35c2c02d00..2845a7d6d8 100644 --- a/src/battle.ts +++ b/src/battle.ts @@ -440,7 +440,7 @@ export class Pokemon implements PokemonDetails, PokemonHealth { // this.lastMove = pokemon.lastMove; // I think if (!copySource) { const volatilesToRemove = [ - 'airballoon', 'attract', 'autotomize', 'disable', 'encore', 'foresight', 'gmaxchistrike', 'imprison', 'laserfocus', 'mimic', 'miracleeye', 'nightmare', 'saltcure', 'smackdown', 'stockpile1', 'stockpile2', 'stockpile3', 'torment', 'typeadd', 'typechange', 'yawn', + 'airballoon', 'attract', 'autotomize', 'disable', 'encore', 'foresight', 'gmaxchistrike', 'imprison', 'laserfocus', 'mimic', 'miracleeye', 'nightmare', 'saltcure', 'smackdown', 'stockpile1', 'stockpile2', 'stockpile3', 'syrupbomb', 'torment', 'typeadd', 'typechange', 'yawn', ]; for (const statName of Dex.statNamesExceptHP) { volatilesToRemove.push('protosynthesis' + statName);