mirror of
https://github.com/magefree/mage.git
synced 2025-12-23 03:51:58 -08:00
fix #13615 (Vampiric Embrace)
revise setTargetPointer logic of DealtDamageAttachedAndDiedTriggeredAbility
This commit is contained in:
parent
09d3ec060a
commit
87ab0a3fcc
3 changed files with 17 additions and 9 deletions
|
|
@ -13,6 +13,7 @@ import mage.cards.Card;
|
||||||
import mage.cards.CardImpl;
|
import mage.cards.CardImpl;
|
||||||
import mage.cards.CardSetInfo;
|
import mage.cards.CardSetInfo;
|
||||||
import mage.constants.*;
|
import mage.constants.*;
|
||||||
|
import mage.filter.StaticFilters;
|
||||||
import mage.game.Game;
|
import mage.game.Game;
|
||||||
import mage.players.Player;
|
import mage.players.Player;
|
||||||
import mage.target.targetpointer.FixedTarget;
|
import mage.target.targetpointer.FixedTarget;
|
||||||
|
|
@ -34,7 +35,8 @@ public final class ScytheOfTheWretched extends CardImpl {
|
||||||
this.addAbility(new SimpleStaticAbility(new BoostEquippedEffect(2, 2, Duration.WhileOnBattlefield)));
|
this.addAbility(new SimpleStaticAbility(new BoostEquippedEffect(2, 2, Duration.WhileOnBattlefield)));
|
||||||
|
|
||||||
// Whenever a creature dealt damage by equipped creature this turn dies, return that card to the battlefield under your control. Attach Scythe of the Wretched to that creature.
|
// Whenever a creature dealt damage by equipped creature this turn dies, return that card to the battlefield under your control. Attach Scythe of the Wretched to that creature.
|
||||||
this.addAbility(new DealtDamageAttachedAndDiedTriggeredAbility(new ScytheOfTheWretchedReanimateEffect(), false));
|
this.addAbility(new DealtDamageAttachedAndDiedTriggeredAbility(new ScytheOfTheWretchedReanimateEffect(), false,
|
||||||
|
StaticFilters.FILTER_PERMANENT_CREATURE, SetTargetPointer.CARD, AttachmentType.EQUIPMENT));
|
||||||
|
|
||||||
// Equip {4}
|
// Equip {4}
|
||||||
this.addAbility(new EquipAbility(Outcome.AddAbility, new GenericManaCost(4), false));
|
this.addAbility(new EquipAbility(Outcome.AddAbility, new GenericManaCost(4), false));
|
||||||
|
|
|
||||||
|
|
@ -13,6 +13,7 @@ import mage.cards.Card;
|
||||||
import mage.cards.CardImpl;
|
import mage.cards.CardImpl;
|
||||||
import mage.cards.CardSetInfo;
|
import mage.cards.CardSetInfo;
|
||||||
import mage.constants.*;
|
import mage.constants.*;
|
||||||
|
import mage.filter.StaticFilters;
|
||||||
import mage.game.Game;
|
import mage.game.Game;
|
||||||
import mage.game.permanent.token.ZombieToken;
|
import mage.game.permanent.token.ZombieToken;
|
||||||
import mage.players.Player;
|
import mage.players.Player;
|
||||||
|
|
@ -38,7 +39,8 @@ public final class UnscytheKillerOfKings extends CardImpl {
|
||||||
this.addAbility(ability);
|
this.addAbility(ability);
|
||||||
|
|
||||||
// Whenever a creature dealt damage by equipped creature this turn dies, you may exile that card. If you do, create a 2/2 black Zombie creature token.
|
// Whenever a creature dealt damage by equipped creature this turn dies, you may exile that card. If you do, create a 2/2 black Zombie creature token.
|
||||||
this.addAbility(new DealtDamageAttachedAndDiedTriggeredAbility(new UnscytheEffect(), true));
|
this.addAbility(new DealtDamageAttachedAndDiedTriggeredAbility(new UnscytheEffect(), true,
|
||||||
|
StaticFilters.FILTER_PERMANENT_CREATURE, SetTargetPointer.CARD, AttachmentType.EQUIPMENT));
|
||||||
|
|
||||||
// Equip {2}
|
// Equip {2}
|
||||||
this.addAbility(new EquipAbility(Outcome.BoostCreature, new GenericManaCost(2), new TargetControlledCreaturePermanent(), false));
|
this.addAbility(new EquipAbility(Outcome.BoostCreature, new GenericManaCost(2), new TargetControlledCreaturePermanent(), false));
|
||||||
|
|
|
||||||
|
|
@ -7,7 +7,6 @@ import mage.abilities.effects.Effect;
|
||||||
import mage.constants.AttachmentType;
|
import mage.constants.AttachmentType;
|
||||||
import mage.constants.SetTargetPointer;
|
import mage.constants.SetTargetPointer;
|
||||||
import mage.constants.Zone;
|
import mage.constants.Zone;
|
||||||
import mage.filter.StaticFilters;
|
|
||||||
import mage.filter.common.FilterCreaturePermanent;
|
import mage.filter.common.FilterCreaturePermanent;
|
||||||
import mage.game.Game;
|
import mage.game.Game;
|
||||||
import mage.game.events.GameEvent;
|
import mage.game.events.GameEvent;
|
||||||
|
|
@ -21,10 +20,6 @@ public class DealtDamageAttachedAndDiedTriggeredAbility extends TriggeredAbility
|
||||||
private final FilterCreaturePermanent filter;
|
private final FilterCreaturePermanent filter;
|
||||||
private final SetTargetPointer setTargetPointer;
|
private final SetTargetPointer setTargetPointer;
|
||||||
|
|
||||||
public DealtDamageAttachedAndDiedTriggeredAbility(Effect effect, boolean optional) {
|
|
||||||
this(effect, optional, StaticFilters.FILTER_PERMANENT_CREATURE, SetTargetPointer.PERMANENT, AttachmentType.EQUIPMENT);
|
|
||||||
}
|
|
||||||
|
|
||||||
public DealtDamageAttachedAndDiedTriggeredAbility(Effect effect, boolean optional, FilterCreaturePermanent filter,
|
public DealtDamageAttachedAndDiedTriggeredAbility(Effect effect, boolean optional, FilterCreaturePermanent filter,
|
||||||
SetTargetPointer setTargetPointer, AttachmentType attachmentType) {
|
SetTargetPointer setTargetPointer, AttachmentType attachmentType) {
|
||||||
super(Zone.ALL, effect, optional);
|
super(Zone.ALL, effect, optional);
|
||||||
|
|
@ -72,8 +67,17 @@ public class DealtDamageAttachedAndDiedTriggeredAbility extends TriggeredAbility
|
||||||
})) {
|
})) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (this.setTargetPointer == SetTargetPointer.PERMANENT) {
|
switch (setTargetPointer) {
|
||||||
getEffects().setTargetPointer(new FixedTarget(event.getTargetId(), game));
|
case PERMANENT:
|
||||||
|
getEffects().setTargetPointer(new FixedTarget(creatureMOR));
|
||||||
|
break;
|
||||||
|
case CARD:
|
||||||
|
getEffects().setTargetPointer(new FixedTarget(event.getTargetId(), game));
|
||||||
|
break;
|
||||||
|
case NONE:
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
throw new IllegalArgumentException("Unsupported setTargetPointer value in DealtDamageAttachedAndDiedTriggeredAbility");
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue