Fixed handling and initialization of Fixedtarget object. Fixing a problem of ReturnToBattlefieldUnderYourControlTargetEffect that caused objects to return taht already left the zone they should be moved from.

This commit is contained in:
LevelX2 2015-06-29 18:34:53 +02:00
parent 148fd0e6ae
commit f45c5cedeb
16 changed files with 398 additions and 209 deletions

View file

@ -0,0 +1,62 @@
/*
* Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification, are
* permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this list of
* conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
* of conditions and the following disclaimer in the documentation and/or other materials
* provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* The views and conclusions contained in the software and documentation are those of the
* authors and should not be interpreted as representing official policies, either expressed
* or implied, of BetaSteward_at_googlemail.com.
*/
package org.mage.test.AI.basic;
import mage.constants.PhaseStep;
import mage.constants.Zone;
import org.junit.Ignore;
import org.junit.Test;
import org.mage.test.serverside.base.CardTestPlayerBaseAI;
/**
*
* @author LevelX2
*/
public class CastAlternateCastingCostsTest extends CardTestPlayerBaseAI {
/**
* Tests that if a spell has alternate casting costs, this option is also calculated
*/
@Test
@Ignore // AI only gets the cast ability yet, but does always say yes to use evoke
// TODO: Get the AI both options to calculate
public void testEvoke() {
// Flying
// When Mulldrifter enters the battlefield, draw two cards.
// Evoke (You may cast this spell for its evoke cost. If you do, it's sacrificed when it enters the battlefield.)
addCard(Zone.HAND, playerA, "Mulldrifter");
addCard(Zone.BATTLEFIELD, playerA, "Island", 5);
setStopAt(1, PhaseStep.BEGIN_COMBAT);
execute();
assertPermanentCount(playerA, "Mulldrifter", 1);
}
}

View file

@ -38,22 +38,22 @@ import org.mage.test.serverside.base.CardTestPlayerBase;
*
* @author LevelX2
*/
public class ScytheOfTheWretchedTest extends CardTestPlayerBase {
/**
* Test that the creature taht died returns to battlefield under your control
* if the previous equiped creature does not die
* Test that the creature that died returns to battlefield under your
* control if the previous equipped creature does not die
*/
@Test
public void testEquipAlive() {
addCard(Zone.BATTLEFIELD, playerA, "Soulmender", 1);
// {T}: You gain 1 life.
addCard(Zone.BATTLEFIELD, playerA, "Soulmender", 1); // 1/1
addCard(Zone.BATTLEFIELD, playerB, "Plains", 4);
addCard(Zone.BATTLEFIELD, playerB, "Silvercoat Lion");
addCard(Zone.BATTLEFIELD, playerB, "Silvercoat Lion");
// Equipped creature gets +2/+2.
// 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.
// Equip {4}
// Equip {4}
addCard(Zone.BATTLEFIELD, playerB, "Scythe of the Wretched");
activateAbility(2, PhaseStep.PRECOMBAT_MAIN, playerB, "Equip {4}", "Silvercoat Lion");
@ -66,29 +66,31 @@ public class ScytheOfTheWretchedTest extends CardTestPlayerBase {
assertLife(playerA, 20);
assertLife(playerB, 20);
assertPermanentCount(playerA, "Soulmender", 0);
assertPermanentCount(playerB, "Soulmender", 1);
assertPowerToughness(playerB, "Soulmender", 3, 3);
assertPowerToughness(playerB, "Silvercoat Lion", 2, 2);
Permanent silvercoatLion = getPermanent("Silvercoat Lion", playerB.getId());
Assert.assertTrue("Silvercoat Lion may not have any attachments", silvercoatLion.getAttachments().isEmpty());
}
/**
* Test that the creature that died returns to battlefield under your control
* if the previous equiped creature does die after equipment is removed
/**
* Test that the creature that died returns to battlefield under your
* control if the previous equiped creature does die after equipment is
* removed
*/
@Test
public void testEquipDied() {
addCard(Zone.BATTLEFIELD, playerA, "Oreskos Swiftclaw", 1); // 3/1
addCard(Zone.BATTLEFIELD, playerA, "Oreskos Swiftclaw", 1); // 3/1
addCard(Zone.BATTLEFIELD, playerB, "Plains", 4);
addCard(Zone.BATTLEFIELD, playerB, "Silvercoat Lion");
addCard(Zone.BATTLEFIELD, playerB, "Silvercoat Lion");
// Equipped creature gets +2/+2.
// 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.
// Equip {4}
// Equip {4}
addCard(Zone.BATTLEFIELD, playerB, "Scythe of the Wretched");
activateAbility(2, PhaseStep.PRECOMBAT_MAIN, playerB, "Equip {4}", "Silvercoat Lion");
@ -101,27 +103,27 @@ public class ScytheOfTheWretchedTest extends CardTestPlayerBase {
assertLife(playerA, 20);
assertLife(playerB, 20);
assertPermanentCount(playerA, "Oreskos Swiftclaw", 0);
assertPermanentCount(playerB, "Oreskos Swiftclaw", 1);
assertPowerToughness(playerB, "Oreskos Swiftclaw", 5, 3);
assertGraveyardCount(playerB, "Silvercoat Lion", 1);
}
/**
* Test that the creature that died returns to battlefield under your control
* if the previous equiped creature does die already in combat
/**
* Test that the creature that died returns to battlefield under your
* control if the previous equiped creature does die already in combat
*/
@Test
public void testEquipDiedInCombat() {
addCard(Zone.BATTLEFIELD, playerA, "Serra Angel", 1); // 4/4
addCard(Zone.BATTLEFIELD, playerB, "Plains", 4);
addCard(Zone.BATTLEFIELD, playerB, "Silvercoat Lion");
addCard(Zone.BATTLEFIELD, playerB, "Silvercoat Lion");
// Equipped creature gets +2/+2.
// 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.
// Equip {4}
// Equip {4}
addCard(Zone.BATTLEFIELD, playerB, "Scythe of the Wretched");
activateAbility(2, PhaseStep.PRECOMBAT_MAIN, playerB, "Equip {4}", "Silvercoat Lion");
@ -134,18 +136,18 @@ public class ScytheOfTheWretchedTest extends CardTestPlayerBase {
assertLife(playerA, 20);
assertLife(playerB, 20);
assertPermanentCount(playerA, "Serra Angel", 0);
assertPermanentCount(playerB, "Serra Angel", 1);
assertPowerToughness(playerB, "Serra Angel", 6, 6);
assertGraveyardCount(playerB, "Silvercoat Lion", 1);
}
/**
* Test that the creature that died returns to battlefield under your control
* if the previous equiped creature does die already in combat and the equipment was destroyed meanwhile
}
/**
* Test that the creature that died returns to battlefield under your
* control if the previous equiped creature does die already in combat and
* the equipment was destroyed meanwhile
*/
@Test
public void testEquipDiedInCombat2() {
@ -154,17 +156,17 @@ public class ScytheOfTheWretchedTest extends CardTestPlayerBase {
addCard(Zone.HAND, playerA, "Disenchant", 1);
addCard(Zone.BATTLEFIELD, playerB, "Plains", 4);
addCard(Zone.BATTLEFIELD, playerB, "Silvercoat Lion");
addCard(Zone.BATTLEFIELD, playerB, "Silvercoat Lion");
// Equipped creature gets +2/+2.
// 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.
// Equip {4}
// Equip {4}
addCard(Zone.BATTLEFIELD, playerB, "Scythe of the Wretched");
activateAbility(2, PhaseStep.PRECOMBAT_MAIN, playerB, "Equip {4}", "Silvercoat Lion");
attack(2, playerB, "Silvercoat Lion");
block(2, playerA, "Serra Angel", "Silvercoat Lion");
castSpell(2, PhaseStep.COMBAT_DAMAGE, playerA, "Disenchant", "Scythe of the Wretched", "Whenever a creature dealt damage");
setStopAt(2, PhaseStep.POSTCOMBAT_MAIN);
@ -172,14 +174,14 @@ public class ScytheOfTheWretchedTest extends CardTestPlayerBase {
assertLife(playerA, 20);
assertLife(playerB, 20);
assertGraveyardCount(playerA, "Disenchant", 1);
assertGraveyardCount(playerB, "Scythe of the Wretched", 1);
assertPermanentCount(playerA, "Serra Angel", 0);
assertPermanentCount(playerB, "Serra Angel", 1);
assertPowerToughness(playerB, "Serra Angel", 4, 4);
assertGraveyardCount(playerB, "Silvercoat Lion", 1);
}
}
}
}

View file

@ -8,18 +8,21 @@ import org.mage.test.serverside.base.CardTestPlayerBase;
/**
*
* also tests regenerate and
* tests that permanents with protection can be sacrificed
*
* also tests regenerate and tests that permanents with protection can be
* sacrificed
*
* @author BetaSteward
*/
public class SpitefulShadowsTest extends CardTestPlayerBase {
@Test
public void testCard() {
// Infect (This creature deals damage to creatures in the form of -1/-1 counters and to players in the form of poison counters.)
addCard(Zone.BATTLEFIELD, playerA, "Glistener Elf");
addCard(Zone.BATTLEFIELD, playerA, "Swamp", 2);
addCard(Zone.BATTLEFIELD, playerA, "Mountain", 2);
// Enchant creature
// Whenever enchanted creature is dealt damage, it deals that much damage to its controller.
addCard(Zone.HAND, playerA, "Spiteful Shadows");
addCard(Zone.HAND, playerA, "Lightning Bolt");

View file

@ -0,0 +1,63 @@
/*
* Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification, are
* permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this list of
* conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
* of conditions and the following disclaimer in the documentation and/or other materials
* provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* The views and conclusions contained in the software and documentation are those of the
* authors and should not be interpreted as representing official policies, either expressed
* or implied, of BetaSteward_at_googlemail.com.
*/
package org.mage.test.cards.mana;
import mage.constants.PhaseStep;
import mage.constants.Zone;
import org.junit.Assert;
import org.junit.Test;
import org.mage.test.serverside.base.CardTestPlayerBase;
/**
*
* @author LevelX2
*/
public class EmptyOnlyOnTurnsEndManaTest extends CardTestPlayerBase {
@Test
public void testDaxosOfMeletis() {
// At the beginning of each player's upkeep, that player adds {G}{G}{G} to his or her mana pool. Until end of turn, this mana doesn't empty from that player's mana pool as steps and phases end.
addCard(Zone.BATTLEFIELD, playerA, "Shizuko, Caller of Autumn", 1);
addCard(Zone.HAND, playerA, "Birds of Paradise", 1);
addCard(Zone.HAND, playerB, "Birds of Paradise", 1);
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Birds of Paradise");
castSpell(2, PhaseStep.PRECOMBAT_MAIN, playerB, "Birds of Paradise");
setStopAt(2, PhaseStep.POSTCOMBAT_MAIN);
execute();
assertPermanentCount(playerA, "Birds of Paradise", 1);
assertPermanentCount(playerB, "Birds of Paradise", 1);
Assert.assertEquals("2 {G} have to be still im Mana Pool", "{G}{G}", playerB.getManaPool().getMana().toString());
}
}

View file

@ -25,7 +25,6 @@
* authors and should not be interpreted as representing official policies, either expressed
* or implied, of BetaSteward_at_googlemail.com.
*/
package org.mage.test.cards.single.rtr;
import mage.constants.PhaseStep;
@ -35,36 +34,32 @@ import org.junit.Test;
import org.mage.test.serverside.base.CardTestPlayerBase;
/**
* Jace, Architect of Thought {2}{U}{U}
* Planeswalker Jace
* Loyalty 4
* +1: Until your next turn, whenever a creature an opponent controls attacks, it gets
* -1/-0 until end of turn.
* -2: Reveal the top three cards of your library. An opponent separates those cards into
* two piles. Put one pile into your hand and the other on the bottom of your library
* in any order.
* -8: For each player, search that player's library for a nonland card and exile it, then
* that player shuffles his or her library. You may cast those cards without paying
* their mana costs.
*
* Jace, Architect of Thought {2}{U}{U} Planeswalker Jace Loyalty 4 +1: Until
* your next turn, whenever a creature an opponent controls attacks, it gets
* -1/-0 until end of turn. -2: Reveal the top three cards of your library. An
* opponent separates those cards into two piles. Put one pile into your hand
* and the other on the bottom of your library in any order. -8: For each
* player, search that player's library for a nonland card and exile it, then
* that player shuffles his or her library. You may cast those cards without
* paying their mana costs.
*
* @author LevelX2
*/
public class JaceArchitectOfThoughtTest extends CardTestPlayerBase {
@Test
public void testAbility1normal() {
addCard(Zone.BATTLEFIELD, playerA, "Jace, Architect of Thought");
addCard(Zone.BATTLEFIELD, playerB, "Silvercoat Lion", 1);
activateAbility(1, PhaseStep.PRECOMBAT_MAIN, playerA, "+1: Until your next turn, whenever a creature an opponent controls attacks, it gets -1/-0 until end of turn.");
attack(2, playerB, "Silvercoat Lion");
setStopAt(2, PhaseStep.END_COMBAT);
execute();
assertCounterCount("Jace, Architect of Thought", CounterType.LOYALTY, 5);
assertPowerToughness(playerB, "Silvercoat Lion", 1, 2);
@ -72,53 +67,56 @@ public class JaceArchitectOfThoughtTest extends CardTestPlayerBase {
assertLife(playerB, 20);
}
@Test
public void testAbilit1lastOnlyUntilNextTurn() {
addCard(Zone.BATTLEFIELD, playerA, "Jace, Architect of Thought");
addCard(Zone.BATTLEFIELD, playerB, "Silvercoat Lion", 1);
activateAbility(1, PhaseStep.PRECOMBAT_MAIN, playerA, "+1: Until your next turn, whenever a creature an opponent controls attacks, it gets -1/-0 until end of turn.");
attack(2, playerB, "Silvercoat Lion");
attack(4, playerB, "Silvercoat Lion");
setStopAt(4, PhaseStep.END_COMBAT);
execute();
assertCounterCount("Jace, Architect of Thought", CounterType.LOYALTY, 5);
assertPowerToughness(playerB, "Silvercoat Lion", 2, 2);
assertLife(playerA, 17);
assertLife(playerB, 20);
}
}
/*
Ability 1 has still to trigger next turn if used also if Jace left the battlefield.
*/
Ability 1 has still to trigger next turn if used also if Jace left the battlefield.
*/
@Test
public void testAbility1AfterJacesWasExiled() {
addCard(Zone.BATTLEFIELD, playerA, "Jace, Architect of Thought");
// Sorcery {R}{B}
// Destroy target creature or planeswalker.
addCard(Zone.HAND, playerB, "Dreadbore");
addCard(Zone.BATTLEFIELD, playerB, "Mountain");
addCard(Zone.BATTLEFIELD, playerB, "Swamp");
addCard(Zone.BATTLEFIELD, playerB, "Silvercoat Lion", 1);
activateAbility(1, PhaseStep.PRECOMBAT_MAIN, playerA, "+1: Until your next turn, whenever a creature an opponent controls attacks, it gets -1/-0 until end of turn.");
// +1: Until your next turn, whenever a creature an opponent controls attacks, it gets -1/-0 until end of turn.
activateAbility(1, PhaseStep.PRECOMBAT_MAIN, playerA, "+1: Until your next turn");
castSpell(2, PhaseStep.PRECOMBAT_MAIN, playerB, "Dreadbore", "Jace, Architect of Thought");
attack(2, playerB, "Silvercoat Lion");
setStopAt(2, PhaseStep.END_COMBAT);
execute();
assertLife(playerA, 19);
assertLife(playerB, 20);
assertPermanentCount(playerB, "Jace, Architect of Thought", 0);
assertPermanentCount(playerA, "Jace, Architect of Thought", 0);
assertPowerToughness(playerB, "Silvercoat Lion", 1, 2);
}

View file

@ -36,7 +36,6 @@ import org.mage.test.serverside.base.CardTestPlayerBase;
*
* @author LevelX2
*/
public class ReturnToBattlefieldEffectsTest extends CardTestPlayerBase {
@Test
@ -82,9 +81,10 @@ public class ReturnToBattlefieldEffectsTest extends CardTestPlayerBase {
assertGraveyardCount(playerB, "Lightning Bolt", 1);
assertPermanentCount(playerA, "Arcbound Worker", 1);
}
/**
* That that the creature with a +1/+1 counter does not return
* if the card was removed from graveyard meanwhile
* Test that the creature with a +1/+1 counter does not return if the card
* was removed from graveyard meanwhile by Relic of Progenitus
*/
@Test
public void testMarchesatheBlackRoseAfterExile() {
@ -100,10 +100,10 @@ public class ReturnToBattlefieldEffectsTest extends CardTestPlayerBase {
// {T}: Target player exiles a card from his or her graveyard.
// {1}, Exile Relic of Progenitus: Exile all cards from all graveyards. Draw a card.
addCard(Zone.BATTLEFIELD, playerB, "Relic of Progenitus", 1);
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Arcbound Worker");
castSpell(1, PhaseStep.END_COMBAT, playerB, "Lightning Bolt", "Arcbound Worker");
activateAbility(1, PhaseStep.POSTCOMBAT_MAIN, playerB, "{T}: Target player exiles", playerA);
setStopAt(1, PhaseStep.END_TURN);
@ -113,13 +113,15 @@ public class ReturnToBattlefieldEffectsTest extends CardTestPlayerBase {
assertPermanentCount(playerA, "Arcbound Worker", 0);
assertExileCount("Arcbound Worker", 1);
}
/**
* With my opponent's Deathmist Raptor return-to-battlefield trigger on the stack,
* I exiled the Deathmist Raptor with Pharika, God of Affliction. However, the Deathmist Raptor
* returned to the battlefield from exile, though it should not have because it had
* changed zones so was a different object.
* With my opponent's Deathmist Raptor return-to-battlefield trigger on the
* stack, I exiled the Deathmist Raptor with Pharika, God of Affliction.
* However, the Deathmist Raptor returned to the battlefield from exile,
* though it should not have because it had changed zones so was a different
* object.
*/
@Test
public void testDeathmistRaptor() {
@ -129,20 +131,20 @@ public class ReturnToBattlefieldEffectsTest extends CardTestPlayerBase {
addCard(Zone.GRAVEYARD, playerA, "Deathmist Raptor");
addCard(Zone.HAND, playerA, "Pine Walker");
addCard(Zone.BATTLEFIELD, playerA, "Forest", 5);
addCard(Zone.BATTLEFIELD, playerB, "Forest", 1);
addCard(Zone.BATTLEFIELD, playerB, "Swamp", 1);
// {B}{G}: Exile target creature card from a graveyard. It's owner puts a 1/1 black and green Snake enchantment creature token with deathtouch onto the battlefield.
// {B}{G}: Exile target creature card from a graveyard. It's owner puts a 1/1 black and green Snake enchantment creature token with deathtouch onto the battlefield.
addCard(Zone.BATTLEFIELD, playerB, "Pharika, God of Affliction", 1);
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Pine Walker");
setChoice(playerA, "Yes"); // cast it face down as 2/2 creature
activateAbility(3, PhaseStep.POSTCOMBAT_MAIN, playerA, "{4}{G}: Turn this face-down permanent face up.");
activateAbility(3, PhaseStep.POSTCOMBAT_MAIN, playerB, "{B}{G}: Exile target creature card from a graveyard",
activateAbility(3, PhaseStep.POSTCOMBAT_MAIN, playerA, "{4}{G}: Turn this face-down permanent face up.");
activateAbility(3, PhaseStep.POSTCOMBAT_MAIN, playerB, "{B}{G}: Exile target creature card from a graveyard",
"Deathmist Raptor", "Whenever a permanent you control is turned face up");
setStopAt(3, PhaseStep.END_TURN);
setStopAt(3, PhaseStep.END_TURN);
execute();
assertPermanentCount(playerB, "Pharika, God of Affliction", 1);
@ -150,6 +152,37 @@ public class ReturnToBattlefieldEffectsTest extends CardTestPlayerBase {
assertPermanentCount(playerA, "Pine Walker", 1);
assertExileCount("Deathmist Raptor", 1);
}
}
}
/**
* Reassembling Skeleton is blocked by Necroskitter, and dies. Necroskitter
* triggers. With the trigger on the stack, activate Skeleton and return it
* to play. Expected result: trigger can't find Skeleton since it changed
* zones. Actual result: trigger steals control of Skeleton when it's
* already on the battlefield.
*/
@Test
public void testNecroskitter1() {
// Wither (This deals damage to creatures in the form of -1/-1 counters.)
// Whenever a creature an opponent controls with a -1/-1 counter on it dies, you may return that card to the battlefield under your control.
addCard(Zone.BATTLEFIELD, playerA, "Necroskitter", 1); // 1/4
// {1}{B}: Return Reassembling Skeleton from your graveyard to the battlefield tapped.
addCard(Zone.BATTLEFIELD, playerB, "Reassembling Skeleton");
addCard(Zone.BATTLEFIELD, playerB, "Swamp", 2);
attack(2, playerB, "Reassembling Skeleton");
block(2, playerA, "Necroskitter", "Reassembling Skeleton");
activateAbility(2, PhaseStep.COMBAT_DAMAGE, playerB, "{1}{B}: Return", NO_TARGET, "Whenever a creature");
setStopAt(2, PhaseStep.POSTCOMBAT_MAIN);
execute();
assertLife(playerA, 20);
assertPermanentCount(playerB, "Reassembling Skeleton", 1);
}
}