diff --git a/data/abilities.ts b/data/abilities.ts index 223ffa6982..adccdbfbc3 100644 --- a/data/abilities.ts +++ b/data/abilities.ts @@ -56,12 +56,12 @@ export const Abilities: {[abilityid: string]: AbilityData} = { if (move.type === 'Normal' && !noModifyType.includes(move.id) && !(move.isZ && move.category !== 'Status') && !(move.name === 'Tera Blast' && pokemon.terastallized)) { move.type = 'Flying'; - move.aerilateBoosted = true; + move.typeChangerBoosted = this.effect; } }, onBasePowerPriority: 23, onBasePower(basePower, pokemon, target, move) { - if (move.aerilateBoosted) return this.chainModify([4915, 4096]); + if (move.typeChangerBoosted === this.effect) return this.chainModify([4915, 4096]); }, name: "Aerilate", rating: 4, @@ -1427,12 +1427,12 @@ export const Abilities: {[abilityid: string]: AbilityData} = { if (move.type === 'Normal' && !noModifyType.includes(move.id) && !(move.isZ && move.category !== 'Status') && !(move.name === 'Tera Blast' && pokemon.terastallized)) { move.type = 'Electric'; - move.galvanizeBoosted = true; + move.typeChangerBoosted = this.effect; } }, onBasePowerPriority: 23, onBasePower(basePower, pokemon, target, move) { - if (move.galvanizeBoosted) return this.chainModify([4915, 4096]); + if (move.typeChangerBoosted === this.effect) return this.chainModify([4915, 4096]); }, name: "Galvanize", rating: 4, @@ -2699,12 +2699,12 @@ export const Abilities: {[abilityid: string]: AbilityData} = { // TODO: Figure out actual interaction !(move.name === 'Tera Blast' && pokemon.terastallized)) { move.type = 'Normal'; - move.normalizeBoosted = true; + move.typeChangerBoosted = this.effect; } }, onBasePowerPriority: 23, onBasePower(basePower, pokemon, target, move) { - if (move.normalizeBoosted) return this.chainModify([4915, 4096]); + if (move.typeChangerBoosted === this.effect) return this.chainModify([4915, 4096]); }, name: "Normalize", rating: 0, @@ -2975,12 +2975,12 @@ export const Abilities: {[abilityid: string]: AbilityData} = { if (move.type === 'Normal' && !noModifyType.includes(move.id) && !(move.isZ && move.category !== 'Status') && !(move.name === 'Tera Blast' && pokemon.terastallized)) { move.type = 'Fairy'; - move.pixilateBoosted = true; + move.typeChangerBoosted = this.effect; } }, onBasePowerPriority: 23, onBasePower(basePower, pokemon, target, move) { - if (move.pixilateBoosted) return this.chainModify([4915, 4096]); + if (move.typeChangerBoosted === this.effect) return this.chainModify([4915, 4096]); }, name: "Pixilate", rating: 4, @@ -3472,12 +3472,12 @@ export const Abilities: {[abilityid: string]: AbilityData} = { if (move.type === 'Normal' && !noModifyType.includes(move.id) && !(move.isZ && move.category !== 'Status') && !(move.name === 'Tera Blast' && pokemon.terastallized)) { move.type = 'Ice'; - move.refrigerateBoosted = true; + move.typeChangerBoosted = this.effect; } }, onBasePowerPriority: 23, onBasePower(basePower, pokemon, target, move) { - if (move.refrigerateBoosted) return this.chainModify([4915, 4096]); + if (move.typeChangerBoosted === this.effect) return this.chainModify([4915, 4096]); }, name: "Refrigerate", rating: 4, diff --git a/data/mods/gen6/abilities.ts b/data/mods/gen6/abilities.ts index 1f8e38547e..def809f0ac 100644 --- a/data/mods/gen6/abilities.ts +++ b/data/mods/gen6/abilities.ts @@ -2,7 +2,7 @@ export const Abilities: {[k: string]: ModdedAbilityData} = { aerilate: { inherit: true, onBasePower(basePower, pokemon, target, move) { - if (move.aerilateBoosted) return this.chainModify([5325, 4096]); + if (move.typeChangerBoosted === this.effect) return this.chainModify([5325, 4096]); }, rating: 4.5, }, @@ -64,14 +64,14 @@ export const Abilities: {[k: string]: ModdedAbilityData} = { pixilate: { inherit: true, onBasePower(basePower, pokemon, target, move) { - if (move.pixilateBoosted) return this.chainModify([5325, 4096]); + if (move.typeChangerBoosted === this.effect) return this.chainModify([5325, 4096]); }, rating: 4.5, }, refrigerate: { inherit: true, onBasePower(basePower, pokemon, target, move) { - if (move.refrigerateBoosted) return this.chainModify([5325, 4096]); + if (move.typeChangerBoosted === this.effect) return this.chainModify([5325, 4096]); }, rating: 4.5, }, diff --git a/data/mods/joltemons/abilities.ts b/data/mods/joltemons/abilities.ts index f6c439e07b..959c8b3d01 100644 --- a/data/mods/joltemons/abilities.ts +++ b/data/mods/joltemons/abilities.ts @@ -1419,12 +1419,12 @@ export const Abilities: {[k: string]: ModdedAbilityData} = { ]; if (move.type === 'Normal' && !noModifyType.includes(move.id) && !(move.isZ && move.category !== 'Status')) { move.type = 'Fairy'; - move.pixilateBoosted = true; + move.typeChangerBoosted = this.effect; } }, onBasePowerPriority: 23, onBasePower(basePower, pokemon, target, move) { - if (move.pixilateBoosted) return this.chainModify([0x1333, 0x1000]); + if (move.typeChangerBoosted === this.effect) return this.chainModify([0x1333, 0x1000]); }, isPermanent: true, name: "Power of Alchemy (Sylveon)", diff --git a/data/mods/ssb/abilities.ts b/data/mods/ssb/abilities.ts index 53d5c0b003..fa33d6cbf5 100644 --- a/data/mods/ssb/abilities.ts +++ b/data/mods/ssb/abilities.ts @@ -576,14 +576,12 @@ export const Abilities: {[k: string]: ModdedAbilityData} = { ]; if (move.type === 'Normal' && !noModifyType.includes(move.id) && !(move.isZ && move.category !== 'Status')) { move.type = 'Dragon'; - // @ts-ignore - move.drakeskinBoosted = true; + move.typeChangerBoosted = this.effect; } }, onBasePowerPriority: 23, onBasePower(basePower, pokemon, target, move) { - // @ts-ignore - if (move.drakeskinBoosted) return this.chainModify([4915, 4096]); + if (move.typeChangerBoosted === this.effect) return this.chainModify([4915, 4096]); }, gen: 8, }, @@ -797,16 +795,16 @@ export const Abilities: {[k: string]: ModdedAbilityData} = { ]; if (move.type === 'Normal' && !noModifyType.includes(move.id) && !(move.isZ && move.category !== 'Status')) { move.type = 'Ice'; - move.refrigerateBoosted = true; + move.typeChangerBoosted = this.effect; } }, onBasePowerPriority: 23, onBasePower(basePower, pokemon, target, move) { - if (move.refrigerateBoosted) return this.chainModify([4915, 4096]); + if (move.typeChangerBoosted === this.effect) return this.chainModify([4915, 4096]); }, onModifyMovePriority: -2, onModifyMove(move, attacker) { - if (move.refrigerateBoosted) return; + if (move.typeChangerBoosted === this.effect) return; move.onTry = function () { this.field.addPseudoWeather('echoedvoiceclone'); this.field.pseudoWeather.echoedvoiceclone.lastmove = move.name; @@ -1039,14 +1037,12 @@ export const Abilities: {[k: string]: ModdedAbilityData} = { ]; if (move.type === 'Normal' && !noModifyType.includes(move.id) && !(move.isZ && move.category !== 'Status')) { move.type = 'Poison'; - // @ts-ignore - move.venomizeBoosted = true; + move.typeChangerBoosted = this.effect; } }, onBasePowerPriority: 23, onBasePower(basePower, pokemon, target, move) { - // @ts-ignore - if (move.venomizeBoosted) return this.chainModify([4915, 4096]); + if (move.typeChangerBoosted === this.effect) return this.chainModify([4915, 4096]); }, name: "Venomize", gen: 8, diff --git a/sim/dex-moves.ts b/sim/dex-moves.ts index e4883e404d..1754d5b9b5 100644 --- a/sim/dex-moves.ts +++ b/sim/dex-moves.ts @@ -304,12 +304,10 @@ export interface ActiveMove extends MutableMove, RuinableMove { hit: number; moveHitData?: MoveHitData; ability?: Ability; - aerilateBoosted?: boolean; allies?: Pokemon[]; auraBooster?: Pokemon; causedCrashDamage?: boolean; forceStatus?: ID; - galvanizeBoosted?: boolean; hasAuraBreak?: boolean; hasBounced?: boolean; hasSheerForce?: boolean; @@ -318,16 +316,14 @@ export interface ActiveMove extends MutableMove, RuinableMove { lastHit?: boolean; magnitude?: number; negateSecondary?: boolean; - normalizeBoosted?: boolean; - pixilateBoosted?: boolean; pranksterBoosted?: boolean; - refrigerateBoosted?: boolean; selfDropped?: boolean; selfSwitch?: 'copyvolatile' | 'shedtail' | boolean; spreadHit?: boolean; stab?: number; statusRoll?: string; totalDamage?: number | false; + typeChangerBoosted?: Effect; willChangeForme?: boolean; infiltrates?: boolean; diff --git a/test/sim/misc/ateabilities.js b/test/sim/misc/ateabilities.js new file mode 100644 index 0000000000..0d767b791e --- /dev/null +++ b/test/sim/misc/ateabilities.js @@ -0,0 +1,36 @@ +'use strict'; + +const assert = require('../../assert'); +const common = require('../../common'); + +let battle; + +const ates = {Refrigerate: 'Ice', Pixilate: 'Fairy', Aerilate: 'Flying', Galvanize: 'Electric'}; + +for (const ate in ates) { + describe(ate, function () { + afterEach(function () { + battle.destroy(); + }); + + it(`should make most Normal type moves become ${ates[ate]} type`, function () { + battle = common.createBattle([[ + {species: 'Genesect', ability: ate, moves: ['hypervoice']}, + ], [ + {species: 'Gengar', moves: ['sleeptalk']}, + ]]); + battle.makeChoices(); + assert.false.fullHP(battle.p2.active[0]); + }); + + it('should boost the power of Normal type attacks by 20% when changing their type', function () { + battle = common.createBattle([[ + {species: 'Genesect', ability: ate, moves: ['hypervoice']}, + ], [ + {species: 'Blissey', ability: 'shellarmor', moves: ['sleeptalk']}, + ]]); + battle.makeChoices(); + assert.bounded(battle.p2.active[0].hp, [651 - 83, 651 - 70]); + }); + }); +}