mirror of
https://github.com/magefree/mage.git
synced 2025-12-21 19:11:59 -08:00
[MKM] Implement Conspiracy Unraveler
This commit is contained in:
parent
aa00ce96a8
commit
acf5f47fe7
3 changed files with 114 additions and 0 deletions
94
Mage.Sets/src/mage/cards/c/ConspiracyUnraveler.java
Normal file
94
Mage.Sets/src/mage/cards/c/ConspiracyUnraveler.java
Normal file
|
|
@ -0,0 +1,94 @@
|
|||
package mage.cards.c;
|
||||
|
||||
import mage.MageInt;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.SimpleStaticAbility;
|
||||
import mage.abilities.condition.common.SourceIsSpellCondition;
|
||||
import mage.abilities.costs.AlternativeCostSourceAbility;
|
||||
import mage.abilities.costs.common.CollectEvidenceCost;
|
||||
import mage.abilities.effects.ContinuousEffectImpl;
|
||||
import mage.abilities.keyword.FlyingAbility;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.*;
|
||||
import mage.game.Game;
|
||||
import mage.players.Player;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
* @author Susucr
|
||||
*/
|
||||
public final class ConspiracyUnraveler extends CardImpl {
|
||||
|
||||
public ConspiracyUnraveler(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{5}{U}{U}");
|
||||
|
||||
this.subtype.add(SubType.SPHINX);
|
||||
this.subtype.add(SubType.DETECTIVE);
|
||||
this.power = new MageInt(6);
|
||||
this.toughness = new MageInt(6);
|
||||
|
||||
// Flying
|
||||
this.addAbility(FlyingAbility.getInstance());
|
||||
|
||||
// You may collect evidence 10 rather than pay the mana cost for spells that you cast.
|
||||
this.addAbility(new SimpleStaticAbility(new ConspiracyUnravelerInsteadEffect()));
|
||||
}
|
||||
|
||||
private ConspiracyUnraveler(final ConspiracyUnraveler card) {
|
||||
super(card);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ConspiracyUnraveler copy() {
|
||||
return new ConspiracyUnraveler(this);
|
||||
}
|
||||
}
|
||||
|
||||
// Inspired by WUBRGInsteadEffect
|
||||
class ConspiracyUnravelerInsteadEffect extends ContinuousEffectImpl {
|
||||
|
||||
private final AlternativeCostSourceAbility alternativeCastingCostAbility = new AlternativeCostSourceAbility(new CollectEvidenceCost(10), SourceIsSpellCondition.instance);
|
||||
|
||||
ConspiracyUnravelerInsteadEffect() {
|
||||
super(Duration.WhileOnBattlefield, Outcome.Detriment);
|
||||
staticText = "You may collect evidence 10 rather than pay the mana cost for spells that you cast";
|
||||
}
|
||||
|
||||
protected ConspiracyUnravelerInsteadEffect(final ConspiracyUnravelerInsteadEffect effect) {
|
||||
super(effect);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ConspiracyUnravelerInsteadEffect copy() {
|
||||
return new ConspiracyUnravelerInsteadEffect(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void init(Ability source, Game game, UUID activePlayerId) {
|
||||
super.init(source, game, activePlayerId);
|
||||
alternativeCastingCostAbility.setSourceId(source.getSourceId());
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean apply(Layer layer, SubLayer sublayer, Ability source, Game game) {
|
||||
Player controller = game.getPlayer(source.getControllerId());
|
||||
if (controller != null) {
|
||||
controller.getAlternativeSourceCosts().add(alternativeCastingCostAbility);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasLayer(Layer layer) {
|
||||
return layer == Layer.RulesEffects;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -82,6 +82,7 @@ public final class MurdersAtKarlovManor extends ExpansionSet {
|
|||
cards.add(new SetCardInfo("Concealed Weapon", 117, Rarity.UNCOMMON, mage.cards.c.ConcealedWeapon.class));
|
||||
cards.add(new SetCardInfo("Connecting the Dots", 118, Rarity.RARE, mage.cards.c.ConnectingTheDots.class, NON_FULL_USE_VARIOUS));
|
||||
cards.add(new SetCardInfo("Connecting the Dots", 403, Rarity.RARE, mage.cards.c.ConnectingTheDots.class, NON_FULL_USE_VARIOUS));
|
||||
cards.add(new SetCardInfo("Conspiracy Unraveler", 47, Rarity.MYTHIC, mage.cards.c.ConspiracyUnraveler.class));
|
||||
cards.add(new SetCardInfo("Convenient Target", 119, Rarity.UNCOMMON, mage.cards.c.ConvenientTarget.class));
|
||||
cards.add(new SetCardInfo("Cornered Crook", 120, Rarity.UNCOMMON, mage.cards.c.CorneredCrook.class));
|
||||
cards.add(new SetCardInfo("Crime Novelist", 121, Rarity.UNCOMMON, mage.cards.c.CrimeNovelist.class));
|
||||
|
|
|
|||
|
|
@ -21,6 +21,7 @@ public class CollectEvidenceTest extends CardTestPlayerBase {
|
|||
private static final String effigy = "Fuming Effigy";
|
||||
private static final String sprite = "Crimestopper Sprite";
|
||||
private static final String monitor = "Surveillance Monitor";
|
||||
private static final String unraveler = "Conspiracy Unraveler";
|
||||
|
||||
@Test
|
||||
public void testNoPay() {
|
||||
|
|
@ -291,4 +292,22 @@ public class CollectEvidenceTest extends CardTestPlayerBase {
|
|||
assertTapped(sprite, true);
|
||||
assertCounterCount(sprite, CounterType.STUN, 1);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testConspiracyUnraveler() {
|
||||
addCard(Zone.BATTLEFIELD, playerA, unraveler);
|
||||
addCard(Zone.HAND, playerA, "Colossal Dreadmaw");
|
||||
addCard(Zone.GRAVEYARD, playerA, ogre, 4);
|
||||
|
||||
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Colossal Dreadmaw");
|
||||
setChoice(playerA, true); // use alternative cast from unraveler
|
||||
setChoice(playerA, ogre, 4); // pay for collect evidence
|
||||
|
||||
setStrictChooseMode(true);
|
||||
setStopAt(1, PhaseStep.END_TURN);
|
||||
execute();
|
||||
|
||||
assertExileCount(ogre, 4);
|
||||
assertPermanentCount(playerA, "Colossal Dreadmaw", 1);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue