- Fixed Animate Dead.

- Fixed Dance of the Dead description.
- Added a couple related NPE prevention checks.
This commit is contained in:
Agetian
2018-08-07 19:21:39 +03:00
parent cb5222c997
commit 331d173a93
4 changed files with 8 additions and 6 deletions

View File

@@ -156,7 +156,7 @@ public class ChangeZoneAllEffect extends SpellAbilityEffect {
// Auras without Candidates stay in their current location // Auras without Candidates stay in their current location
if (c.isAura()) { if (c.isAura()) {
final SpellAbility saAura = c.getFirstAttachSpell(); final SpellAbility saAura = c.getFirstAttachSpell();
if (!saAura.getTargetRestrictions().hasCandidates(saAura, false)) { if (saAura != null && !saAura.getTargetRestrictions().hasCandidates(saAura, false)) {
continue; continue;
} }
} }

View File

@@ -555,11 +555,13 @@ public class ChangeZoneEffect extends SpellAbilityEffect {
// location // location
if (tgtC.isAura()) { if (tgtC.isAura()) {
final SpellAbility saAura = tgtC.getFirstAttachSpell(); final SpellAbility saAura = tgtC.getFirstAttachSpell();
if (saAura != null) {
saAura.setActivatingPlayer(sa.getActivatingPlayer()); saAura.setActivatingPlayer(sa.getActivatingPlayer());
if (!saAura.getTargetRestrictions().hasCandidates(saAura, false)) { if (!saAura.getTargetRestrictions().hasCandidates(saAura, false)) {
continue; continue;
} }
} }
}
movedCard = game.getAction().moveTo( movedCard = game.getAction().moveTo(
tgtC.getController().getZone(destination), tgtC, sa, null); tgtC.getController().getZone(destination), tgtC, sa, null);

View File

@@ -2161,7 +2161,7 @@ public class Card extends GameEntity implements Comparable<Card> {
*/ */
public final SpellAbility getFirstAttachSpell() { public final SpellAbility getFirstAttachSpell() {
for (final SpellAbility sa : getSpells()) { for (final SpellAbility sa : getSpells()) {
if (sa.getApi() == ApiType.Attach) { if (sa.getApi() == ApiType.Attach && !sa.isSuppressed()) {
return sa; return sa;
} }
} }

View File

@@ -3,7 +3,7 @@ ManaCost:1 B
Types:Enchantment Aura Types:Enchantment Aura
K:Enchant creature card in a graveyard K:Enchant creature card in a graveyard
A:SP$ Attach | Cost$ 1 B | ValidTgts$ Creature | TgtZone$ Graveyard | AILogic$ Reanimate A:SP$ Attach | Cost$ 1 B | ValidTgts$ Creature | TgtZone$ Graveyard | AILogic$ Reanimate
T:Mode$ ChangesZone | Origin$ Any | Destination$ Battlefield | ValidCard$ Card.Self | Execute$ TrigReanimate | TriggerDescription$ When CARDNAME enters the battlefield, if it's on the battlefield, it loses "enchant creature card in a graveyard" and gains "enchant creature put onto the battlefield with CARDNAME." Put enchanted creature card onto the battlefield under your control and attach CARDNAME to it. T:Mode$ ChangesZone | Origin$ Any | Destination$ Battlefield | ValidCard$ Card.Self | Execute$ TrigReanimate | TriggerDescription$ When CARDNAME enters the battlefield, if it's on the battlefield, it loses "enchant creature card in a graveyard" and gains "enchant creature put onto the battlefield with CARDNAME." Put enchanted creature card onto the battlefield tapped under your control and attach CARDNAME to it.
SVar:TrigReanimate:DB$ ChangeZone | Origin$ Graveyard | Destination$ Battlefield | Defined$ Enchanted | RememberChanged$ True | GainControl$ True | Tapped$ True | SubAbility$ DBAnimate SVar:TrigReanimate:DB$ ChangeZone | Origin$ Graveyard | Destination$ Battlefield | Defined$ Enchanted | RememberChanged$ True | GainControl$ True | Tapped$ True | SubAbility$ DBAnimate
SVar:DBAnimate:DB$ Animate | Defined$ Self | OverwriteSpells$ True | Abilities$ NewAttach | Keywords$ Enchant creature put onto the battlefield with CARDNAME | RemoveKeywords$ Enchant creature card in a graveyard | Permanent$ True | SubAbility$ DBAttach SVar:DBAnimate:DB$ Animate | Defined$ Self | OverwriteSpells$ True | Abilities$ NewAttach | Keywords$ Enchant creature put onto the battlefield with CARDNAME | RemoveKeywords$ Enchant creature card in a graveyard | Permanent$ True | SubAbility$ DBAttach
SVar:DBAttach:DB$ Attach | Defined$ Remembered SVar:DBAttach:DB$ Attach | Defined$ Remembered