Make the move fail in boss battles

This commit is contained in:
Jakub Hanko 2024-05-19 11:25:23 +02:00
parent 727db35c7a
commit 8343426110
No known key found for this signature in database
GPG Key ID: 775D427937A306CC

View File

@ -4261,9 +4261,14 @@ export class DestinyBondAttr extends MoveEffectAttr {
* @param {Pokemon} target N/A
* @param {Move} move {@linkcode Move.DESTINY_BOND}
* @param {any[]} args N/A
* @returns true
* @returns false in boss battle, true otherwise
*/
apply(user: Pokemon, target: Pokemon, move: Move, args: any[]): boolean {
if (user.scene.getField().some(p => p.isBossImmune())) {
user.scene.queueMessage('But it failed!');
return false;
}
user.scene.queueMessage(`${getPokemonMessage(user, ' is trying\nto take its foe down with it!')}`);
user.addTag(BattlerTagType.DESTINY_BOND, undefined, move.id, user.id);
return true;
@ -4964,8 +4969,7 @@ export function initMoves() {
.unimplemented(),
new SelfStatusMove(Moves.DESTINY_BOND, Type.GHOST, -1, 5, -1, 0, 2)
.ignoresProtect()
.attr(DestinyBondAttr)
.condition(failOnBossCondition),
.attr(DestinyBondAttr),
new StatusMove(Moves.PERISH_SONG, Type.NORMAL, -1, 5, -1, 0, 2)
.attr(FaintCountdownAttr)
.ignoresProtect()