[OTJ] Implement Tinybones, the Pickpocket + refactor MayCastTargetThenExileEffect (#12040)

This commit is contained in:
Susucre 2024-04-05 00:16:53 +02:00 committed by GitHub
parent 3e75f93c20
commit d1de8b8cd3
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
26 changed files with 412 additions and 150 deletions

View file

@ -0,0 +1,59 @@
package org.mage.test.cards.single.otj;
import mage.constants.PhaseStep;
import mage.constants.Zone;
import org.junit.Test;
import org.mage.test.serverside.base.CardTestPlayerBase;
/**
* @author Susucr
*/
public class TinybonesThePickpocketTest extends CardTestPlayerBase {
/**
* {@link mage.cards.t.TinybonesThePickpocket Tinybones, the Pickpocket} {B}
* Legendary Creature Skeleton Rogue
* Deathtouch
* Whenever Tinybones, the Pickpocket deals combat damage to a player, you may cast target nonland permanent card from that player's graveyard, and mana of any type can be spent to cast that spell.
* 1/1
*/
private static final String tinybones = "Tinybones, the Pickpocket";
@Test
public void test_CastPermanent_WithOtherType() {
setStrictChooseMode(true);
addCard(Zone.BATTLEFIELD, playerA, tinybones);
addCard(Zone.GRAVEYARD, playerB, "Raging Goblin");
addCard(Zone.BATTLEFIELD, playerA, "Swamp");
attack(1, playerA, tinybones, playerB);
addTarget(playerA, "Raging Goblin"); // target card for the trigger
setChoice(playerA, true); // yes to "you may cast"
setStopAt(1, PhaseStep.END_COMBAT);
execute();
assertPermanentCount(playerA, "Raging Goblin", 1);
assertTapped("Swamp", true); // It did cost 1 mana
}
@Test
public void test_NoToCast() {
setStrictChooseMode(true);
addCard(Zone.BATTLEFIELD, playerA, tinybones);
addCard(Zone.GRAVEYARD, playerB, "Raging Goblin");
addCard(Zone.BATTLEFIELD, playerA, "Swamp");
attack(1, playerA, tinybones, playerB);
addTarget(playerA, "Raging Goblin"); // target card for the trigger
setChoice(playerA, false); // no to "you may cast"
setStopAt(1, PhaseStep.END_COMBAT);
execute();
assertGraveyardCount(playerB, "Raging Goblin", 1); // card did not move.
assertTapped("Swamp", false);
}
}