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);
|
this.color.setWhite(true);
|
||||||
|
|
||||||
// Enchant creature
|
// Enchant creature
|
||||||
TargetPermanent auraTarget = new TargetCreaturePermanent();
|
TargetPermanent auraTarget = new TargetCreaturePermanent(true);
|
||||||
this.getSpellAbility().addTarget(auraTarget);
|
this.getSpellAbility().addTarget(auraTarget);
|
||||||
this.getSpellAbility().addEffect(new AttachEffect(Outcome.BoostCreature));
|
this.getSpellAbility().addEffect(new AttachEffect(Outcome.BoostCreature));
|
||||||
Ability ability = new EnchantAbility(auraTarget.getTargetName());
|
Ability ability = new EnchantAbility(auraTarget.getTargetName());
|
||||||
|
|
|
@ -44,6 +44,7 @@ import mage.players.Player;
|
||||||
import mage.target.Target;
|
import mage.target.Target;
|
||||||
|
|
||||||
import java.util.UUID;
|
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
|
* 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;
|
UUID targetId = null;
|
||||||
MageObject sourceObject = game.getObject(sourceId);
|
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) {
|
if (sourceObject instanceof StackAbility) {
|
||||||
StackAbility stackAbility = (StackAbility) sourceObject;
|
StackAbility stackAbility = (StackAbility) sourceObject;
|
||||||
if (!stackAbility.getEffects().isEmpty()) {
|
if (!stackAbility.getEffects().isEmpty()) {
|
||||||
targetId = stackAbility.getEffects().get(0).getTargetPointer().getFirst(game, stackAbility);
|
targetId = stackAbility.getEffects().get(0).getTargetPointer().getFirst(game, stackAbility);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (targetId == null) {
|
if (targetId == null) {
|
||||||
Target target = card.getSpellAbility().getTargets().get(0);
|
Target target = card.getSpellAbility().getTargets().get(0);
|
||||||
Player player = game.getPlayer(card.getOwnerId());
|
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());
|
this.spellCards.add(spellCard.copy());
|
||||||
}
|
}
|
||||||
if (spell.spellAbilities.get(0).equals(spell.ability)) {
|
if (spell.spellAbilities.get(0).equals(spell.ability)) {
|
||||||
this.ability = spellAbilities.get(0);
|
this.ability = this.spellAbilities.get(0);
|
||||||
} else {
|
} else {
|
||||||
this.ability = spell.ability.copy();
|
this.ability = spell.ability.copy();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue