Add TSDocs

This commit is contained in:
Jakub Hanko 2024-05-18 20:29:27 +02:00
parent bedd5f3492
commit 727db35c7a
No known key found for this signature in database
GPG Key ID: 775D427937A306CC
2 changed files with 23 additions and 1 deletions

View File

@ -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);

View File

@ -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;
}
}