Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed Emrakul Mindslaver ability #2127

Merged
merged 2 commits into from
Jul 29, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.CastSourceTriggeredAbility;
import mage.abilities.effects.common.cost.CostModificationEffectImpl;
import mage.abilities.effects.common.turn.ControlTargetPlayerNextTurnEffect;
import mage.abilities.keyword.FlyingAbility;
import mage.abilities.keyword.ProtectionAbility;
import mage.abilities.keyword.TrampleAbility;
Expand Down Expand Up @@ -143,10 +144,10 @@ public EmrakulThePromisedEndCostReductionEffect copy() {
}
}

class EmrakulThePromisedEndGainControlEffect extends OneShotEffect {
class EmrakulThePromisedEndGainControlEffect extends ControlTargetPlayerNextTurnEffect {

EmrakulThePromisedEndGainControlEffect() {
super(Outcome.GainControl);
super();
this.staticText = "you gain control of target opponent during that player's next turn. After that turn, that player takes an extra turn";
}

Expand All @@ -165,9 +166,7 @@ public boolean apply(Game game, Ability source) {
Player targetPlayer = game.getPlayer(this.getTargetPointer().getFirst(game, source));
if (controller != null && targetPlayer != null) {
game.getState().getTurnMods().add(new TurnMod(targetPlayer.getId(), false));
game.getState().getTurnMods().add(new TurnMod(targetPlayer.getId(), controller.getId()));
return true;
}
return false;
return super.apply(game, source);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -120,4 +120,37 @@ public void testDoubleUseWithKruphix() {
Assert.assertEquals("amount of colorless mana", 10, playerA.getManaPool().getColorless()); // 6 - 2 (2.Activation) = 4 + 6 = 10 colorless mana
assertPowerToughness(playerA, "Kruphix, God of Horizons", 4,7);
}

@Test
public void testNormalUseWithTokens() {
addCard(Zone.BATTLEFIELD, playerA, "Forest", 2);
addCard(Zone.BATTLEFIELD, playerA, "Island", 3);
addCard(Zone.BATTLEFIELD, playerA, "Nykthos, Shrine to Nyx", 1);
// Green mana doesn't empty from your mana pool as steps and phases end.
// Omnath, Locus of Mana gets +1/+1 for each green mana in your mana pool.
addCard(Zone.BATTLEFIELD, playerA, "Omnath, Locus of Mana", 1);
// Simic Guildmage {G/U}{G/U}
// Creature - Elf Wizard
// {1}{G}: Move a +1/+1 counter from target creature onto another target creature with the same controller.
// {1}{U}: Attach target Aura enchanting a permanent to another permanent with the same controller.
addCard(Zone.BATTLEFIELD, playerA, "Simic Guildmage");
// Cackling Counterpart {1}{U}{U}
// Instant
// Put a token onto the battlefield that's a copy of target creature you control.
// Flashback {5}{U}{U} (You may cast this card from your graveyard for its flashback cost. Then exile it.)
addCard(Zone.HAND, playerA, "Cackling Counterpart");

castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Cackling Counterpart");
addTarget(playerA, "Simic Guildmage");

activateManaAbility(1, PhaseStep.BEGIN_COMBAT, playerA, "{2},{T}: Choose a color. Add to your mana pool an amount of mana of that color equal to your devotion to that color.");
setChoice(playerA, "Green");

setStopAt(1, PhaseStep.BEGIN_COMBAT);
execute();

assertPermanentCount(playerA, "Simic Guildmage", 2);
Assert.assertEquals("amount of green mana", 5, playerA.getManaPool().getGreen()); // 6 green mana
assertPowerToughness(playerA, "Omnath, Locus of Mana", 6, 6);
}
}