diff --git a/Mage.Sets/src/mage/sets/gatecrash/MurderInvestigation.java b/Mage.Sets/src/mage/sets/gatecrash/MurderInvestigation.java index a089d6e859..7234a561b5 100644 --- a/Mage.Sets/src/mage/sets/gatecrash/MurderInvestigation.java +++ b/Mage.Sets/src/mage/sets/gatecrash/MurderInvestigation.java @@ -27,6 +27,7 @@ */ package mage.sets.gatecrash; +import java.util.UUID; import mage.abilities.Ability; import mage.abilities.common.DiesAttachedTriggeredAbility; import mage.abilities.dynamicvalue.DynamicValue; @@ -41,11 +42,10 @@ import mage.constants.Rarity; import mage.constants.Zone; import mage.game.Game; import mage.game.permanent.Permanent; +import mage.game.permanent.token.SoldierToken; import mage.target.TargetPermanent; import mage.target.common.TargetControlledCreaturePermanent; -import java.util.UUID; - /** * * @author LevelX2 diff --git a/Mage.Sets/src/mage/sets/khansoftarkir/SidisiBroodTyrant.java b/Mage.Sets/src/mage/sets/khansoftarkir/SidisiBroodTyrant.java index 0e55e8c14c..767d90370a 100644 --- a/Mage.Sets/src/mage/sets/khansoftarkir/SidisiBroodTyrant.java +++ b/Mage.Sets/src/mage/sets/khansoftarkir/SidisiBroodTyrant.java @@ -58,9 +58,6 @@ public class SidisiBroodTyrant extends CardImpl { this.subtype.add("Naga"); this.subtype.add("Shaman"); - this.color.setBlue(true); - this.color.setGreen(true); - this.color.setBlack(true); this.power = new MageInt(3); this.toughness = new MageInt(3); @@ -123,8 +120,7 @@ class SidisiBroodTyrantTriggeredAbility extends ZoneChangeTriggeredAbility { UUID lastStackObjectId = null; public SidisiBroodTyrantTriggeredAbility() { - super(Zone.LIBRARY, Zone.GRAVEYARD, new CreateTokenEffect(new ZombieToken("KTK")), "", false); - this.zone = Zone.BATTLEFIELD; + super(Zone.BATTLEFIELD, Zone.LIBRARY, Zone.GRAVEYARD, new CreateTokenEffect(new ZombieToken("KTK")), "", false); } public SidisiBroodTyrantTriggeredAbility(final SidisiBroodTyrantTriggeredAbility ability) { diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/abilities/keywords/MorphTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/abilities/keywords/MorphTest.java index 6eaca52135..d3dfc96350 100644 --- a/Mage.Tests/src/test/java/org/mage/test/cards/abilities/keywords/MorphTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/cards/abilities/keywords/MorphTest.java @@ -99,7 +99,7 @@ public class MorphTest extends CardTestPlayerBase { castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Pine Walker"); setChoice(playerA, "Yes"); // cast it face down as 2/2 creature - attack(3, playerA, ""); + attack(3, playerA, "face down creature"); activateAbility(3, PhaseStep.POSTCOMBAT_MAIN, playerA, "{4}{G}: Turn this face-down permanent face up."); setStopAt(3, PhaseStep.END_TURN); @@ -133,8 +133,8 @@ public class MorphTest extends CardTestPlayerBase { castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Icefeather Aven"); setChoice(playerA, "Yes"); // cast it face down as 2/2 creature - attack(3, playerA, ""); - attack(3, playerA, ""); + attack(3, playerA, "face down creature"); + attack(3, playerA, "face down creature"); activateAbility(3, PhaseStep.DECLARE_BLOCKERS, playerA, "{1}{G}{U}: Turn this face-down permanent face up."); setChoice(playerA, "No"); // Don't use return permanent to hand effect diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/replacement/prevent/DeflectingPalmTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/replacement/prevent/DeflectingPalmTest.java index ecafce3fa8..4f50777cfd 100644 --- a/Mage.Tests/src/test/java/org/mage/test/cards/replacement/prevent/DeflectingPalmTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/cards/replacement/prevent/DeflectingPalmTest.java @@ -43,7 +43,7 @@ import org.mage.test.serverside.base.CardTestPlayerBase; public class DeflectingPalmTest extends CardTestPlayerBase { /** - * Tests if a damage spell is selected as source the damge is prevented and is dealt to the controller of the damage spell + * Tests if a damage spell is selected as source the damage is prevented and is dealt to the controller of the damage spell */ @Test public void testPreventDamageFromSpell() { diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/single/GutterGrimeTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/single/GutterGrimeTest.java index 0dcf98fcc5..d869f5ed17 100644 --- a/Mage.Tests/src/test/java/org/mage/test/cards/single/GutterGrimeTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/cards/single/GutterGrimeTest.java @@ -36,7 +36,10 @@ public class GutterGrimeTest extends CardTestPlayerBase { @Test public void testScenario2() { + // Creature tokens you control get +1/+1 and have vigilance. addCard(Zone.BATTLEFIELD, playerA, "Intangible Virtue"); + // Whenever a nontoken creature you control dies, put a slime counter on Gutter Grime, then put a green Ooze creature token onto + // the battlefield with "This creature's power and toughness are each equal to the number of slime counters on Gutter Grime." addCard(Zone.BATTLEFIELD, playerA, "Gutter Grime"); addCard(Zone.BATTLEFIELD, playerA, "Runeclaw Bear", 1); addCard(Zone.BATTLEFIELD, playerA, "Mountain", 1); @@ -44,8 +47,15 @@ public class GutterGrimeTest extends CardTestPlayerBase { castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Lightning Bolt", "Runeclaw Bear"); - setStopAt(3, PhaseStep.END_TURN); + setStopAt(1, PhaseStep.END_TURN); execute(); + + assertGraveyardCount(playerA, "Runeclaw Bear", 1); + assertGraveyardCount(playerA, "Lightning Bolt", 1); + assertPermanentCount(playerA, "Gutter Grime", 1); + assertPermanentCount(playerA, "Intangible Virtue", 1); + + assertPermanentCount(playerA, "Ooze", 1); assertPowerToughness(playerA, "Ooze", 2, 2, Filter.ComparisonScope.Any); } } diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/triggers/dies/ServantOfTheScaleTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/triggers/dies/ServantOfTheScaleTest.java index 4b53180518..a4804b84ad 100644 --- a/Mage.Tests/src/test/java/org/mage/test/cards/triggers/dies/ServantOfTheScaleTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/cards/triggers/dies/ServantOfTheScaleTest.java @@ -72,7 +72,6 @@ public class ServantOfTheScaleTest extends CardTestPlayerBase { assertPermanentCount(playerA, "Silvercoat Lion", 1); assertPowerToughness(playerA, "Silvercoat Lion", 3,3); - assertGraveyardCount(playerB, "Lightning Bolt", 1); } } diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/triggers/dies/SidisiBroodTyrantTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/triggers/dies/SidisiBroodTyrantTest.java new file mode 100644 index 0000000000..2971d74545 --- /dev/null +++ b/Mage.Tests/src/test/java/org/mage/test/cards/triggers/dies/SidisiBroodTyrantTest.java @@ -0,0 +1,76 @@ +/* + * 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.triggers.dies; + +import mage.constants.PhaseStep; +import mage.constants.Zone; +import org.junit.Test; +import org.mage.test.serverside.base.CardTestPlayerBase; + +/** + * + * @author LevelX2 + */ + +public class SidisiBroodTyrantTest extends CardTestPlayerBase { + + /** + * Tests that if Sidisi, Brood Tyrant leaves the battlefield + * before it's first ability resolves, there will be no Zombie token added to the battlefield + * + */ + @Test + public void testDiesTriggeredAbility() { + // {1}{B}{G}{U} + // Whenever Sidisi, Brood Tyrant enters the battlefield or attacks, put the top three cards of your library into your graveyard + // Whenever one or more creature cards are put into your graveyard from your library, put a 2/2 black Zombie creature token onto the battlefield. + addCard(Zone.HAND, playerA, "Sidisi, Brood Tyrant"); + addCard(Zone.BATTLEFIELD, playerA, "Swamp"); + addCard(Zone.BATTLEFIELD, playerA, "Forest"); + addCard(Zone.BATTLEFIELD, playerA, "Island", 2); + addCard(Zone.LIBRARY, playerA, "Silvercoat Lion", 2); + skipInitShuffling(); + + addCard(Zone.BATTLEFIELD, playerB, "Mountain"); + addCard(Zone.HAND, playerB, "Lightning Bolt"); + + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Sidisi, Brood Tyrant"); + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerB, "Lightning Bolt", "Sidisi, Brood Tyrant", "Whenever {this} enters the battlefield"); + + setStopAt(1, PhaseStep.BEGIN_COMBAT); + execute(); + + assertGraveyardCount(playerB, "Lightning Bolt", 1); + assertGraveyardCount(playerA, "Sidisi, Brood Tyrant", 1); + + assertGraveyardCount(playerA, 4); + assertPermanentCount(playerA, "Zombie", 0); + + } + +} diff --git a/Mage.Tests/src/test/java/org/mage/test/lki/LastKnownInformationTest.java b/Mage.Tests/src/test/java/org/mage/test/lki/LastKnownInformationTest.java index 26249229be..74a23b175b 100644 --- a/Mage.Tests/src/test/java/org/mage/test/lki/LastKnownInformationTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/lki/LastKnownInformationTest.java @@ -48,7 +48,7 @@ public class LastKnownInformationTest extends CardTestPlayerBase { castSpell(1, PhaseStep.POSTCOMBAT_MAIN, playerB, "Lightning Bolt", "Safehold Elite"); // choose triggered ability order playerA.addChoice("When enchanted creature dies"); - castSpell(1, PhaseStep.POSTCOMBAT_MAIN, playerB, "Lightning Bolt", "Safehold Elite", "When enchanted creature dies, put X 1/1 red and white Soldier creature token with haste onto the battlefield, where X is its power"); + castSpell(1, PhaseStep.POSTCOMBAT_MAIN, playerB, "Lightning Bolt", "Safehold Elite", "When enchanted creature dies"); setStopAt(1, PhaseStep.END_TURN); execute(); diff --git a/Mage/src/mage/abilities/TriggeredAbilities.java b/Mage/src/mage/abilities/TriggeredAbilities.java index bb56c328d1..59f6482970 100644 --- a/Mage/src/mage/abilities/TriggeredAbilities.java +++ b/Mage/src/mage/abilities/TriggeredAbilities.java @@ -76,7 +76,8 @@ public class TriggeredAbilities extends ConcurrentHashMap { } /** - * Onl used for diagnostic purposes of tests + * Only used for diagnostic purposes of tests * @return */ public TriggeredAbilities getTriggers() { diff --git a/Mage/src/mage/game/events/GameEvent.java b/Mage/src/mage/game/events/GameEvent.java index c182a808a6..e22e86b431 100644 --- a/Mage/src/mage/game/events/GameEvent.java +++ b/Mage/src/mage/game/events/GameEvent.java @@ -79,6 +79,13 @@ public class GameEvent { AT_END_OF_TURN, //player events + /* ZONE_CHANGE + targetId id of the zone chaning object + sourceId sourceId of the ability with the object moving effect + playerId controller of the moved object + amount not used for this event + flag not used for this event + */ ZONE_CHANGE, DRAW_CARD, DREW_CARD, MIRACLE_CARD_REVEALED, @@ -142,7 +149,17 @@ public class GameEvent { TURNFACEDOWN, TURNEDFACEDOWN, DAMAGE_CREATURE, DAMAGED_CREATURE, DAMAGE_PLANESWALKER, DAMAGED_PLANESWALKER, - DESTROY_PERMANENT, DESTROYED_PERMANENT, + DESTROY_PERMANENT, + + /* DESTROYED_PERMANENT + targetId id of the destroyed creature + sourceId sourceId of the ability with the destroy effect + playerId controller of the creature + amount not used for this event + flag true if no regeneration is allowed + */ + DESTROYED_PERMANENT, + SACRIFICE_PERMANENT, SACRIFICED_PERMANENT, FIGHTED_PERMANENT, EXPLOITED_CREATURE,