Skip to content

Commit

Permalink
fix #12928 (The Mindskinner)
Browse files Browse the repository at this point in the history
  • Loading branch information
xenohedron committed Sep 29, 2024
1 parent efed3a3 commit 554ba87
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 1 deletion.
3 changes: 2 additions & 1 deletion Mage.Sets/src/mage/cards/t/TheMindskinner.java
Original file line number Diff line number Diff line change
Expand Up @@ -66,11 +66,12 @@ public TheMindskinnerEffect copy() {

@Override
public boolean replaceEvent(GameEvent event, Ability source, Game game) {
int amount = event.getAmount();
preventDamageAction(event, source, game);
for (UUID playerId : game.getOpponents(source.getControllerId())) {
Player player = game.getPlayer(playerId);
if (player != null) {
player.millCards(event.getAmount(), source, game);
player.millCards(amount, source, game);
}
}
return true;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
package org.mage.test.cards.replacement.prevent;

import mage.constants.PhaseStep;
import mage.constants.Zone;
import org.junit.Test;
import org.mage.test.serverside.base.CardTestPlayerBase;

public class TheMindskinnerTest extends CardTestPlayerBase {

private static final String mindskinner = "The Mindskinner"; // 10/1 can't be blocked
// If a source you control would deal damage to an opponent, prevent that damage and each opponent mills that many cards.

private static final String piker = "Goblin Piker"; // 2/1

private static final String bolt = "Lightning Bolt";

@Test
public void testPreventionAndMill() {
addCard(Zone.BATTLEFIELD, playerA, mindskinner);
addCard(Zone.BATTLEFIELD, playerA, piker);
addCard(Zone.HAND, playerA, bolt);
addCard(Zone.BATTLEFIELD, playerA, "Mountain");

castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, bolt, playerB);

attack(1, playerA, piker, playerB);

setStrictChooseMode(true);
setStopAt(1, PhaseStep.POSTCOMBAT_MAIN);
execute();

assertLife(playerA, 20);
assertLife(playerB, 20);

assertGraveyardCount(playerA, 1); // bolt
assertGraveyardCount(playerB, 5);
}

}

0 comments on commit 554ba87

Please sign in to comment.