mirror of
https://github.com/correl/mage.git
synced 2025-01-12 11:08:01 +00:00
* Ajani's Chosen - fixed error in combo with Estrid, the Masked's token (#5285);
This commit is contained in:
parent
0d6be669de
commit
2d387801a2
1 changed files with 9 additions and 9 deletions
|
@ -1,4 +1,3 @@
|
|||
|
||||
package mage.cards.a;
|
||||
|
||||
import mage.MageInt;
|
||||
|
@ -12,14 +11,12 @@ import mage.filter.common.FilterControlledEnchantmentPermanent;
|
|||
import mage.game.Game;
|
||||
import mage.game.permanent.Permanent;
|
||||
import mage.game.permanent.token.CatToken;
|
||||
import mage.game.permanent.token.TokenImpl;
|
||||
import mage.game.permanent.token.Token;
|
||||
import mage.players.Player;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Plopman
|
||||
*/
|
||||
public final class AjanisChosen extends CardImpl {
|
||||
|
@ -76,18 +73,21 @@ class AjanisChosenEffect extends OneShotEffect {
|
|||
Permanent tokenPermanent = game.getPermanent(tokenId);
|
||||
if (tokenPermanent != null) {
|
||||
Permanent oldCreature = game.getPermanent(enchantment.getAttachedTo());
|
||||
if (oldCreature != null && enchantment.getSpellAbility().getTargets().get(0).canTarget(tokenPermanent.getId(), game) && controller.chooseUse(Outcome.Neutral, "Attach " + enchantment.getName() + " to the token ?", source, game)) {
|
||||
if (oldCreature.removeAttachment(enchantment.getId(), game)) {
|
||||
tokenPermanent.addAttachment(enchantment.getId(), game);
|
||||
if (oldCreature != null) {
|
||||
boolean canAttach = enchantment.getSpellAbility() == null
|
||||
|| (!enchantment.getSpellAbility().getTargets().isEmpty() && enchantment.getSpellAbility().getTargets().get(0).canTarget(tokenPermanent.getId(), game));
|
||||
if (canAttach && controller.chooseUse(Outcome.Neutral, "Attach " + enchantment.getName() + " to the token ?", source, game)) {
|
||||
if (oldCreature.removeAttachment(enchantment.getId(), game)) {
|
||||
tokenPermanent.addAttachment(enchantment.getId(), game);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
Loading…
Reference in a new issue