diff --git a/src/data/battler-tags.ts b/src/data/battler-tags.ts index 1e6da41e001..23a1300d64e 100644 --- a/src/data/battler-tags.ts +++ b/src/data/battler-tags.ts @@ -544,6 +544,7 @@ export class AquaRingTag extends BattlerTag { } } +/** Tag used to allow moves that interact with {@link Moves.MINIMIZE} to function */ export class MinimizeTag extends BattlerTag { constructor() { super(BattlerTagType.MINIMIZED, BattlerTagLapseType.TURN_END, 1, Moves.MINIMIZE, undefined); @@ -1385,7 +1386,7 @@ export function getBattlerTag(tagType: BattlerTagType, turnCount: integer, sourc case BattlerTagType.MAGNET_RISEN: return new MagnetRisenTag(tagType, sourceMove); case BattlerTagType.MINIMIZED: - return new MinimizeTag() + return new MinimizeTag(); case BattlerTagType.NONE: default: return new BattlerTag(tagType, BattlerTagLapseType.CUSTOM, turnCount, sourceMove, sourceId); diff --git a/src/data/move.ts b/src/data/move.ts index 3c3434b3451..379a6c668ad 100644 --- a/src/data/move.ts +++ b/src/data/move.ts @@ -2374,17 +2374,15 @@ export class ThunderAccuracyAttr extends VariableAccuracyAttr { /** * Attribute used for moves which never miss - * against pokemon that used Minimize + * against Pokemon with the {@link BattlerTagType.MINIMIZED} + * @param user N/A + * @param target Target of the move + * @param move N/A + * @param args [0] Accuracy of the move to be modified + * @returns true if the function succeeds */ export class MinimizeAccuracyAttr extends VariableAccuracyAttr{ - /** - * Swaps the user and the target's stat changes. - * @param user Pokemon that used the move - * @param target The target of the move - * @param move Move that never misses against Minimized targets - * @param args Accuracy of the move being used - * @returns true if the function succeeds - */ + apply(user: Pokemon, target: Pokemon, move: Move, args: any[]): boolean { if (target.getTag(BattlerTagType.MINIMIZED)){ const accuracy = args[0] as Utils.NumberHolder @@ -3111,8 +3109,11 @@ export class FaintCountdownAttr extends AddBattlerTagAttr { } } +/** Attribute used when a move hits a {@link BattlerTagType} for double damage */ export class HitsTagAttr extends MoveAttr { + /** The {@link BattlerTagType} this move hits */ public tagType: BattlerTagType; + /** Should this move deal double damage against {@link HitsTagAttr.tagType}? */ public doubleDamage: boolean; constructor(tagType: BattlerTagType, doubleDamage?: boolean) { diff --git a/src/field/pokemon.ts b/src/field/pokemon.ts index 245820484bd..0620b95cf59 100644 --- a/src/field/pokemon.ts +++ b/src/field/pokemon.ts @@ -1550,6 +1550,12 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container { applyPreAttackAbAttrs(DamageBoostAbAttr, source, this, battlerMove, damage); + /** + * For each {@link HitsTagAttr} the move has, doubles the damage of the move if: + * The target has a {@link BattlerTagType} that this move interacts with + * AND + * The move doubles damage when used against that tag + * */ move.getAttrs(HitsTagAttr).map(hta => hta as HitsTagAttr).filter(hta => hta.doubleDamage).forEach(hta => { if (this.getTag(hta.tagType)) damage.value *= 2;