mirror of
https://github.com/correl/mage.git
synced 2024-11-16 03:00:12 +00:00
* Neightveil Spector - Fixed a bug that casting with the Spector exiled Enchantment Auras were not handled correctly.
This commit is contained in:
parent
126d628d63
commit
f77e709f6b
3 changed files with 11 additions and 2 deletions
|
@ -70,7 +70,7 @@ public class EtherealArmor extends CardImpl<EtherealArmor> {
|
|||
this.color.setWhite(true);
|
||||
|
||||
// Enchant creature
|
||||
TargetPermanent auraTarget = new TargetCreaturePermanent();
|
||||
TargetPermanent auraTarget = new TargetCreaturePermanent(true);
|
||||
this.getSpellAbility().addTarget(auraTarget);
|
||||
this.getSpellAbility().addEffect(new AttachEffect(Outcome.BoostCreature));
|
||||
Ability ability = new EnchantAbility(auraTarget.getTargetName());
|
||||
|
|
|
@ -44,6 +44,7 @@ import mage.players.Player;
|
|||
import mage.target.Target;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.game.stack.Spell;
|
||||
|
||||
/**
|
||||
* Cards with the Aura subtype don't change the zone they are in, if there is no
|
||||
|
@ -89,12 +90,20 @@ public class AuraReplacementEffect extends ReplacementEffectImpl<AuraReplacement
|
|||
|
||||
UUID targetId = null;
|
||||
MageObject sourceObject = game.getObject(sourceId);
|
||||
|
||||
if (sourceObject instanceof Spell) {
|
||||
if (fromZone.equals(Zone.EXILED)) {
|
||||
// cast from exile (e.g. Neightveil Spector) -> no replacement
|
||||
return false;
|
||||
}
|
||||
}
|
||||
if (sourceObject instanceof StackAbility) {
|
||||
StackAbility stackAbility = (StackAbility) sourceObject;
|
||||
if (!stackAbility.getEffects().isEmpty()) {
|
||||
targetId = stackAbility.getEffects().get(0).getTargetPointer().getFirst(game, stackAbility);
|
||||
}
|
||||
}
|
||||
|
||||
if (targetId == null) {
|
||||
Target target = card.getSpellAbility().getTargets().get(0);
|
||||
Player player = game.getPlayer(card.getOwnerId());
|
||||
|
|
|
@ -107,7 +107,7 @@ public class Spell<T extends Spell<T>> implements StackObject, Card {
|
|||
this.spellCards.add(spellCard.copy());
|
||||
}
|
||||
if (spell.spellAbilities.get(0).equals(spell.ability)) {
|
||||
this.ability = spellAbilities.get(0);
|
||||
this.ability = this.spellAbilities.get(0);
|
||||
} else {
|
||||
this.ability = spell.ability.copy();
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue