diff --git a/src/data/move.ts b/src/data/move.ts index 2d39f598eb9..99279fd3c41 100644 --- a/src/data/move.ts +++ b/src/data/move.ts @@ -16,6 +16,7 @@ import { UnswappableAbilityAbAttr, UncopiableAbilityAbAttr, UnsuppressableAbilit import { Abilities } from "./enums/abilities"; import { allAbilities } from './ability'; import { PokemonHeldItemModifier } from "../modifier/modifier"; +import { modifierTypes } from '../modifier/modifier-type'; import { BattlerIndex } from "../battle"; import { Stat } from "./pokemon-stat"; import { TerrainType } from "./terrain"; @@ -1871,6 +1872,42 @@ export class TurnDamagedDoublePowerAttr extends VariablePowerAttr { } } +export class NoHeldItemDoublePowerAttr extends VariablePowerAttr { + heldItemModifierTypes: (keyof typeof modifierTypes)[] = [ + 'REVIVER_SEED', + 'BERRY', + 'SOOTHE_BELL', + 'GRIP_CLAW', + 'FOCUS_BAND', + 'KINGS_ROCK', + 'LEFTOVERS', + 'SHELL_BELL', + 'BATON', + 'LUCKY_EGG', + 'GOLDEN_EGG', + ]; + + apply(user: Pokemon, target: Pokemon, move: Move, args: any[]): boolean { + const heldItems = this.getUserHeldItems(user); + + if (!heldItems.length) { + (args[0] as Utils.NumberHolder).value *= 2; + return true; + } + + return false; + } + + countsAsHeldItem(item: PokemonHeldItemModifier) { + return this.heldItemModifierTypes.includes(item.type.id as keyof typeof modifierTypes); + } + + getUserHeldItems(user: Pokemon) { + return user.scene.findModifiers(m => m instanceof PokemonHeldItemModifier + && (m as PokemonHeldItemModifier).pokemonId === user.id && this.countsAsHeldItem(m), user.isPlayer()) as PokemonHeldItemModifier[]; + } +} + const magnitudeMessageFunc = (user: Pokemon, target: Pokemon, move: Move) => { let message: string; user.scene.executeWithSeedOffset(() => { @@ -5143,7 +5180,7 @@ export function initMoves() { new StatusMove(Moves.QUASH, Type.DARK, 100, 15, -1, 0, 5) .unimplemented(), new AttackMove(Moves.ACROBATICS, Type.FLYING, MoveCategory.PHYSICAL, 55, 100, 15, -1, 0, 5) - .partial(), + .attr(NoHeldItemDoublePowerAttr), new StatusMove(Moves.REFLECT_TYPE, Type.NORMAL, -1, 15, -1, 0, 5) .attr(CopyTypeAttr), new AttackMove(Moves.RETALIATE, Type.NORMAL, MoveCategory.PHYSICAL, 70, 100, 5, -1, 0, 5)