diff --git a/src/data/battler-tags.ts b/src/data/battler-tags.ts index 355bbb5a231..87b63386ea9 100644 --- a/src/data/battler-tags.ts +++ b/src/data/battler-tags.ts @@ -254,11 +254,25 @@ export class ConfusedTag extends BattlerTag { } } +/** + * Tag applied to the {@linkcode Move.DESTINY_BOND} user. + * See {@linkcode apply} + */ export class DestinyBondTag extends BattlerTag { constructor(sourceMove: Moves, sourceId: integer) { super(BattlerTagType.DESTINY_BOND, BattlerTagLapseType.PRE_MOVE, 1, sourceMove, sourceId); } + /** + * Destiny bond tag. + * Lapses either before the user's move and does nothing + * or after receiving damage. If the damage received from foe + * is fatal, it takes down the foe as well. + * + * @param {Pokemon} pokemon Pokemon that is attacking the Destiny Bond user. + * @param {BattlerTagLapseType} lapseType CUSTOM or PRE_MOVE + * @returns + */ lapse(pokemon: Pokemon, lapseType: BattlerTagLapseType): boolean { if (lapseType !== BattlerTagLapseType.CUSTOM) { return super.lapse(pokemon, lapseType); diff --git a/src/data/move.ts b/src/data/move.ts index 9754a29583a..469d863207a 100644 --- a/src/data/move.ts +++ b/src/data/move.ts @@ -4255,9 +4255,17 @@ export class DestinyBondAttr extends MoveEffectAttr { super(true, MoveEffectTrigger.PRE_APPLY); } + /** + * Applies {@linkcode BattlerTagType.DESTINY_BOND} to the user. + * @param {Pokemon} user User that is having the tag applied to. + * @param {Pokemon} target N/A + * @param {Move} move {@linkcode Move.DESTINY_BOND} + * @param {any[]} args N/A + * @returns true + */ apply(user: Pokemon, target: Pokemon, move: Move, args: any[]): boolean { user.scene.queueMessage(`${getPokemonMessage(user, ' is trying\nto take its foe down with it!')}`); - target.addTag(BattlerTagType.DESTINY_BOND, undefined, move.id, user.id); + user.addTag(BattlerTagType.DESTINY_BOND, undefined, move.id, user.id); return true; } }