Fix doodle with a fainted ally in doubles

This commit is contained in:
Xavion3 2024-04-14 09:15:18 +10:00
parent 3233b8b7cb
commit c05182b181

View File

@ -2957,7 +2957,7 @@ export class AbilityCopyAttr extends MoveEffectAttr {
user.scene.queueMessage(getPokemonMessage(user, ` copied the `) + getPokemonMessage(target, `'s\n${allAbilities[target.getAbility().id].name}!`)); user.scene.queueMessage(getPokemonMessage(user, ` copied the `) + getPokemonMessage(target, `'s\n${allAbilities[target.getAbility().id].name}!`));
if (this.copyToPartner && user.scene.currentBattle?.double) { if (this.copyToPartner && user.scene.currentBattle?.double && user.getAlly().hp) {
user.getAlly().summonData.ability = target.getAbility().id; user.getAlly().summonData.ability = target.getAbility().id;
user.getAlly().scene.queueMessage(getPokemonMessage(user.getAlly(), ` copied the `) + getPokemonMessage(target, `'s\n${allAbilities[target.getAbility().id].name}!`)); user.getAlly().scene.queueMessage(getPokemonMessage(user.getAlly(), ` copied the `) + getPokemonMessage(target, `'s\n${allAbilities[target.getAbility().id].name}!`));
} }
@ -2969,7 +2969,7 @@ export class AbilityCopyAttr extends MoveEffectAttr {
return (user, target, move) => { return (user, target, move) => {
let ret = !target.getAbility().hasAttr(UncopiableAbilityAbAttr) && !user.getAbility().hasAttr(UnsuppressableAbilityAbAttr); let ret = !target.getAbility().hasAttr(UncopiableAbilityAbAttr) && !user.getAbility().hasAttr(UnsuppressableAbilityAbAttr);
if (this.copyToPartner && user.scene.currentBattle?.double) if (this.copyToPartner && user.scene.currentBattle?.double)
ret = ret && !user.getAlly().getAbility().hasAttr(UnsuppressableAbilityAbAttr); ret = ret && (!user.getAlly().hp || !user.getAlly().getAbility().hasAttr(UnsuppressableAbilityAbAttr));
else else
ret = ret && user.getAbility().id !== target.getAbility().id; ret = ret && user.getAbility().id !== target.getAbility().id;
return ret; return ret;