From 7cd105b9517a2499218040ade6d96ccfc6feff2d Mon Sep 17 00:00:00 2001 From: LevelX2 Date: Sat, 12 Nov 2016 08:45:43 +0100 Subject: [PATCH] Rite of the Raging Storm - Fixed some minor bugs (fixes #2584). --- .../mage/cards/r/RiteOfTheRagingStorm.java | 9 ++--- .../cards/replacement/DoublingSeasonTest.java | 34 +++++++++++++++++++ 2 files changed, 37 insertions(+), 6 deletions(-) diff --git a/Mage.Sets/src/mage/cards/r/RiteOfTheRagingStorm.java b/Mage.Sets/src/mage/cards/r/RiteOfTheRagingStorm.java index cd883841dfc..8b44a6e1ced 100644 --- a/Mage.Sets/src/mage/cards/r/RiteOfTheRagingStorm.java +++ b/Mage.Sets/src/mage/cards/r/RiteOfTheRagingStorm.java @@ -89,12 +89,10 @@ public class RiteOfTheRagingStorm extends CardImpl { class RiteOfTheRagingStormEffect extends OneShotEffect { - private static final String effectText = "that player creates a 5/1 red Elemental creature token named Lightning Rager. " - + "It has trample, haste, and \"At the beginning of the end step, sacrifice this creature.\""; - RiteOfTheRagingStormEffect() { super(Outcome.Sacrifice); - staticText = effectText; + staticText = "that player creates a 5/1 red Elemental creature token named Lightning Rager. " + + "It has trample, haste, and \"At the beginning of the end step, sacrifice this creature.\""; } RiteOfTheRagingStormEffect(RiteOfTheRagingStormEffect effect) { @@ -105,8 +103,7 @@ class RiteOfTheRagingStormEffect extends OneShotEffect { public boolean apply(Game game, Ability source) { Player player = game.getPlayer(targetPointer.getFirst(game, source)); if (player != null) { - Token lightningRagerToken = new LightningRagerToken(); - lightningRagerToken.putOntoBattlefield(1, game, this.getId(), player.getId()); + return new LightningRagerToken().putOntoBattlefield(1, game, source.getSourceId(), player.getId()); } return false; } diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/replacement/DoublingSeasonTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/replacement/DoublingSeasonTest.java index 207fa859f13..73b86da1526 100644 --- a/Mage.Tests/src/test/java/org/mage/test/cards/replacement/DoublingSeasonTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/cards/replacement/DoublingSeasonTest.java @@ -132,4 +132,38 @@ public class DoublingSeasonTest extends CardTestPlayerBase { assertPermanentCount(playerA, "Venerable Monk", 10); } + + /** + * Doubling Season doesn't create two tokens from opponent's Rite of Raging + * Storm + */ + @Test + public void testDoubleRiteOfRagingStorm() { + // At the beginning of each player's upkeep, that player creates a 5/1 red Elemental creature token named Lightning Rager. + // It has trample, haste, and "At the beginning of the end step, sacrifice this creature." + addCard(Zone.HAND, playerA, "Rite of the Raging Storm");// {3}{R}{R} + addCard(Zone.BATTLEFIELD, playerA, "Mountain", 5); + // If an effect would put one or more tokens onto the battlefield under your control, it puts twice that many of those tokens onto the battlefield instead. + // If an effect would place one or more counters on a permanent you control, it places twice that many of those counters on that permanent instead. + addCard(Zone.BATTLEFIELD, playerA, "Doubling Season"); + + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Rite of the Raging Storm"); + + attack(2, playerB, "Lightning Rager"); // Can't attack + + attack(3, playerA, "Lightning Rager"); + attack(3, playerA, "Lightning Rager"); + + setStopAt(3, PhaseStep.POSTCOMBAT_MAIN); + execute(); + + assertPermanentCount(playerA, "Rite of the Raging Storm", 1); + + assertPermanentCount(playerA, "Lightning Rager", 2); + + assertLife(playerB, 10); + assertLife(playerA, 20); + + } + }