* Fixed not unique target setting.

This commit is contained in:
LevelX2 2015-05-05 00:50:47 +02:00
parent 6403fff12b
commit 8eae24051a
4 changed files with 15 additions and 9 deletions

View file

@ -116,7 +116,7 @@ class OrzhovCharmReturnToHandEffect extends OneShotEffect {
public boolean apply(Game game, Ability source) { public boolean apply(Game game, Ability source) {
Permanent target = game.getPermanent(getTargetPointer().getFirst(game, source)); Permanent target = game.getPermanent(getTargetPointer().getFirst(game, source));
if (target != null) { if (target != null) {
LinkedList<UUID> attachments = new LinkedList<UUID>(); LinkedList<UUID> attachments = new LinkedList<>();
attachments.addAll(target.getAttachments()); attachments.addAll(target.getAttachments());
for (UUID attachmentId : attachments) { for (UUID attachmentId : attachments) {
Permanent attachment = game.getPermanent(attachmentId); Permanent attachment = game.getPermanent(attachmentId);

View file

@ -50,9 +50,11 @@ public class MoggFanatic extends CardImpl {
super(ownerId, 190, "Mogg Fanatic", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{R}"); super(ownerId, 190, "Mogg Fanatic", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{R}");
this.expansionSetCode = "TMP"; this.expansionSetCode = "TMP";
this.subtype.add("Goblin"); this.subtype.add("Goblin");
this.color.setRed(true);
this.power = new MageInt(1); this.power = new MageInt(1);
this.toughness = new MageInt(1); this.toughness = new MageInt(1);
// Sacrifice Mogg Fanatic: Mogg Fanatic deals 1 damage to target creature or player.
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new DamageTargetEffect(1), new SacrificeSourceCost()); Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new DamageTargetEffect(1), new SacrificeSourceCost());
ability.addTarget(new TargetCreatureOrPlayer()); ability.addTarget(new TargetCreatureOrPlayer());
this.addAbility(ability); this.addAbility(ability);

View file

@ -123,6 +123,12 @@ public class BurrentonForgeTenderTest extends CardTestPlayerBase {
addCard(Zone.BATTLEFIELD, playerA, "Soldier of the Pantheon"); addCard(Zone.BATTLEFIELD, playerA, "Soldier of the Pantheon");
// Sacrifice Mogg Fanatic: Mogg Fanatic deals 1 damage to target creature or player. // Sacrifice Mogg Fanatic: Mogg Fanatic deals 1 damage to target creature or player.
addCard(Zone.BATTLEFIELD, playerA, "Mogg Fanatic"); addCard(Zone.BATTLEFIELD, playerA, "Mogg Fanatic");
addCard(Zone.BATTLEFIELD, playerA, "Swamp", 1);
addCard(Zone.BATTLEFIELD, playerA, "Plains", 1);
// Choose one - Return target creature you control and all Auras you control attached to it to their owner's hand;
// or destroy target creature and you lose life equal to its toughness;
// or return target creature card with converted mana cost 1 or less from your graveyard to the battlefield.
addCard(Zone.HAND, playerA, "Orzhov Charm");
// Kicker {5} (You may pay an additional as you cast this spell.) // Kicker {5} (You may pay an additional as you cast this spell.)
// Put a token onto the battlefield that's a copy of target creature. If Rite of Replication was kicked, put five of those tokens onto the battlefield instead. // Put a token onto the battlefield that's a copy of target creature. If Rite of Replication was kicked, put five of those tokens onto the battlefield instead.
@ -132,8 +138,9 @@ public class BurrentonForgeTenderTest extends CardTestPlayerBase {
castSpell(2, PhaseStep.PRECOMBAT_MAIN, playerB, "Rite of Replication", "Mogg Fanatic"); castSpell(2, PhaseStep.PRECOMBAT_MAIN, playerB, "Rite of Replication", "Mogg Fanatic");
setChoice(playerB, "No"); // no kicker setChoice(playerB, "No"); // no kicker
activateAbility(2, PhaseStep.BEGIN_COMBAT, playerA, "Sacrifice {this}: {source} deals 1 damage to target creature or player.",playerB); castSpell(2, PhaseStep.BEGIN_COMBAT, playerA, "Orzhov Charm", "Mogg Fanatic");
setModeChoice(playerA, "1");
activateAbility(2, PhaseStep.END_COMBAT, playerA, "Sacrifice {this}: Prevent all damage a red source of your choice would deal this turn."); activateAbility(2, PhaseStep.END_COMBAT, playerA, "Sacrifice {this}: Prevent all damage a red source of your choice would deal this turn.");
playerA.addChoice("Mogg Fanatic"); playerA.addChoice("Mogg Fanatic");
@ -141,11 +148,10 @@ public class BurrentonForgeTenderTest extends CardTestPlayerBase {
setStopAt(2, PhaseStep.END_TURN); setStopAt(2, PhaseStep.END_TURN);
execute(); execute();
assertLife(playerB, 19);
assertPermanentCount(playerB, "Mogg Fanatic", 0); assertPermanentCount(playerB, "Mogg Fanatic", 0);
assertGraveyardCount(playerA, "Mogg Fanatic", 1); assertGraveyardCount(playerA, "Orzhov Charm", 1);
assertHandCount(playerA, "Mogg Fanatic", 1);
assertGraveyardCount(playerB, "Rite of Replication", 1); assertGraveyardCount(playerB, "Rite of Replication", 1);
assertGraveyardCount(playerA, "Burrenton Forge-Tender", 1); assertGraveyardCount(playerA, "Burrenton Forge-Tender", 1);

View file

@ -31,14 +31,12 @@ import mage.MageObject;
import mage.MageObjectReference; import mage.MageObjectReference;
import mage.abilities.Ability; import mage.abilities.Ability;
import mage.abilities.effects.PreventionEffectImpl; import mage.abilities.effects.PreventionEffectImpl;
import mage.cards.Card;
import mage.constants.Duration; import mage.constants.Duration;
import mage.constants.Outcome; import mage.constants.Outcome;
import mage.filter.FilterObject; import mage.filter.FilterObject;
import mage.game.Game; import mage.game.Game;
import mage.game.events.GameEvent; import mage.game.events.GameEvent;
import mage.target.TargetSource; import mage.target.TargetSource;
import mage.target.targetpointer.FixedTarget;
/** /**
* *