mirror of
https://github.com/correl/mage.git
synced 2025-04-13 17:00:09 -09:00
update cabal therapy complying CR 708.4a
This commit is contained in:
parent
38a80207cc
commit
63c3689d47
2 changed files with 27 additions and 5 deletions
Mage.Sets/src/mage/cards/c
Mage.Tests/src/test/java/org/mage/test/cards/abilities/keywords
|
@ -27,17 +27,13 @@
|
||||||
*/
|
*/
|
||||||
package mage.cards.c;
|
package mage.cards.c;
|
||||||
|
|
||||||
import java.util.UUID;
|
|
||||||
import mage.MageObject;
|
import mage.MageObject;
|
||||||
import mage.abilities.Ability;
|
import mage.abilities.Ability;
|
||||||
import mage.abilities.costs.common.SacrificeTargetCost;
|
import mage.abilities.costs.common.SacrificeTargetCost;
|
||||||
import mage.abilities.effects.OneShotEffect;
|
import mage.abilities.effects.OneShotEffect;
|
||||||
import mage.abilities.effects.common.NameACardEffect;
|
import mage.abilities.effects.common.NameACardEffect;
|
||||||
import mage.abilities.keyword.FlashbackAbility;
|
import mage.abilities.keyword.FlashbackAbility;
|
||||||
import mage.cards.Card;
|
import mage.cards.*;
|
||||||
import mage.cards.CardImpl;
|
|
||||||
import mage.cards.CardSetInfo;
|
|
||||||
import mage.cards.Cards;
|
|
||||||
import mage.constants.CardType;
|
import mage.constants.CardType;
|
||||||
import mage.constants.Outcome;
|
import mage.constants.Outcome;
|
||||||
import mage.constants.TimingRule;
|
import mage.constants.TimingRule;
|
||||||
|
@ -47,6 +43,8 @@ import mage.players.Player;
|
||||||
import mage.target.TargetPlayer;
|
import mage.target.TargetPlayer;
|
||||||
import mage.target.common.TargetControlledCreaturePermanent;
|
import mage.target.common.TargetControlledCreaturePermanent;
|
||||||
|
|
||||||
|
import java.util.UUID;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @author jonubuu
|
* @author jonubuu
|
||||||
|
@ -98,6 +96,15 @@ class CabalTherapyEffect extends OneShotEffect {
|
||||||
Cards hand = targetPlayer.getHand();
|
Cards hand = targetPlayer.getHand();
|
||||||
|
|
||||||
for (Card card : hand.getCards(game)) {
|
for (Card card : hand.getCards(game)) {
|
||||||
|
if(card.isSplitCard()){
|
||||||
|
SplitCard splitCard = (SplitCard) card;
|
||||||
|
if(splitCard.getLeftHalfCard().getName().equals(cardName)){
|
||||||
|
targetPlayer.discard(card, source, game);
|
||||||
|
}
|
||||||
|
else if(splitCard.getRightHalfCard().getName().equals(cardName)){
|
||||||
|
targetPlayer.discard(card, source, game);
|
||||||
|
}
|
||||||
|
}
|
||||||
if (card.getName().equals(cardName)) {
|
if (card.getName().equals(cardName)) {
|
||||||
targetPlayer.discard(card, source, game);
|
targetPlayer.discard(card, source, game);
|
||||||
}
|
}
|
||||||
|
|
|
@ -131,4 +131,19 @@ public class DiscardTest extends CardTestPlayerBase {
|
||||||
assertLife(playerB, 18);
|
assertLife(playerB, 18);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void testCabalTherapyAfterMathCard(){
|
||||||
|
addCard(Zone.HAND, playerA, "Cabal Therapy", 1);
|
||||||
|
addCard(Zone.BATTLEFIELD, playerA, "Swamp", 10);
|
||||||
|
addCard(Zone.HAND, playerB, "Driven // Despair");
|
||||||
|
|
||||||
|
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Cabal Therapy", playerB);
|
||||||
|
|
||||||
|
setChoice(playerA, "Driven");
|
||||||
|
setStopAt(1, PhaseStep.POSTCOMBAT_MAIN);
|
||||||
|
execute();
|
||||||
|
|
||||||
|
assertHandCount(playerB, "Driven // Despair", 0);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue