mirror of
https://github.com/magefree/mage.git
synced 2026-01-26 21:29:17 -08:00
fix #12928 (The Mindskinner)
This commit is contained in:
parent
efed3a3715
commit
554ba8739e
2 changed files with 41 additions and 1 deletions
|
|
@ -66,11 +66,12 @@ class TheMindskinnerEffect extends PreventionEffectImpl {
|
|||
|
||||
@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;
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
}
|
||||
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue