[NCC] Implemented Dogged Detective

This commit is contained in:
Daniel Bomar 2022-06-29 11:55:30 -05:00
parent 5413389c7d
commit c6cc9bd83f
No known key found for this signature in database
GPG key ID: C86C8658F4023918
3 changed files with 60 additions and 1 deletions

View file

@ -0,0 +1,45 @@
package mage.cards.d;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.common.DrawSecondCardTriggeredAbility;
import mage.abilities.common.EntersBattlefieldTriggeredAbility;
import mage.abilities.effects.common.ReturnSourceFromGraveyardToHandEffect;
import mage.abilities.effects.keyword.SurveilEffect;
import mage.constants.SubType;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.TargetController;
import mage.constants.Zone;
/**
*
* @author weirddan455
*/
public final class DoggedDetective extends CardImpl {
public DoggedDetective(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{1}{B}");
this.subtype.add(SubType.HUMAN);
this.subtype.add(SubType.ROGUE);
this.power = new MageInt(2);
this.toughness = new MageInt(1);
// When Dogged Detective enters the battlefield, surveil 2.
this.addAbility(new EntersBattlefieldTriggeredAbility(new SurveilEffect(2)));
// Whenever an opponent draws their second card each turn, you may return Dogged Detective from your graveyard to your hand.
this.addAbility(new DrawSecondCardTriggeredAbility(Zone.GRAVEYARD, new ReturnSourceFromGraveyardToHandEffect(), true, TargetController.OPPONENT));
}
private DoggedDetective(final DoggedDetective card) {
super(card);
}
@Override
public DoggedDetective copy() {
return new DoggedDetective(this);
}
}

View file

@ -104,6 +104,7 @@ public final class NewCapennaCommander extends ExpansionSet {
cards.add(new SetCardInfo("Dimir Signet", 365, Rarity.COMMON, mage.cards.d.DimirSignet.class)); cards.add(new SetCardInfo("Dimir Signet", 365, Rarity.COMMON, mage.cards.d.DimirSignet.class));
cards.add(new SetCardInfo("Disciple of Bolas", 247, Rarity.RARE, mage.cards.d.DiscipleOfBolas.class)); cards.add(new SetCardInfo("Disciple of Bolas", 247, Rarity.RARE, mage.cards.d.DiscipleOfBolas.class));
cards.add(new SetCardInfo("Dodgy Jalopy", 58, Rarity.RARE, mage.cards.d.DodgyJalopy.class)); cards.add(new SetCardInfo("Dodgy Jalopy", 58, Rarity.RARE, mage.cards.d.DodgyJalopy.class));
cards.add(new SetCardInfo("Dogged Detective", 35, Rarity.RARE, mage.cards.d.DoggedDetective.class));
cards.add(new SetCardInfo("Double Vision", 267, Rarity.RARE, mage.cards.d.DoubleVision.class)); cards.add(new SetCardInfo("Double Vision", 267, Rarity.RARE, mage.cards.d.DoubleVision.class));
cards.add(new SetCardInfo("Dragonlord Ojutai", 337, Rarity.MYTHIC, mage.cards.d.DragonlordOjutai.class)); cards.add(new SetCardInfo("Dragonlord Ojutai", 337, Rarity.MYTHIC, mage.cards.d.DragonlordOjutai.class));
cards.add(new SetCardInfo("Drana, Liberator of Malakir", 248, Rarity.MYTHIC, mage.cards.d.DranaLiberatorOfMalakir.class)); cards.add(new SetCardInfo("Drana, Liberator of Malakir", 248, Rarity.MYTHIC, mage.cards.d.DranaLiberatorOfMalakir.class));

View file

@ -10,6 +10,7 @@ import mage.constants.WatcherScope;
import mage.constants.Zone; import mage.constants.Zone;
import mage.game.Game; import mage.game.Game;
import mage.game.events.GameEvent; import mage.game.events.GameEvent;
import mage.players.Player;
import mage.watchers.Watcher; import mage.watchers.Watcher;
import java.util.*; import java.util.*;
@ -29,7 +30,11 @@ public class DrawSecondCardTriggeredAbility extends TriggeredAbilityImpl {
} }
public DrawSecondCardTriggeredAbility(Effect effect, boolean optional, TargetController targetController) { public DrawSecondCardTriggeredAbility(Effect effect, boolean optional, TargetController targetController) {
super(Zone.BATTLEFIELD, effect, optional); this(Zone.BATTLEFIELD, effect, optional, targetController);
}
public DrawSecondCardTriggeredAbility(Zone zone, Effect effect, boolean optional, TargetController targetController) {
super(zone, effect, optional);
this.addWatcher(new DrawSecondCardWatcher()); this.addWatcher(new DrawSecondCardWatcher());
this.targetController = targetController; this.targetController = targetController;
this.addHint(hint); this.addHint(hint);
@ -58,6 +63,12 @@ public class DrawSecondCardTriggeredAbility extends TriggeredAbilityImpl {
return false; return false;
} }
break; break;
case OPPONENT:
Player controller = game.getPlayer(controllerId);
if (controller == null || !controller.hasOpponent(event.getPlayerId(), game)) {
return false;
}
break;
default: default:
throw new IllegalArgumentException("TargetController " + targetController + " not supported"); throw new IllegalArgumentException("TargetController " + targetController + " not supported");
} }
@ -71,6 +82,8 @@ public class DrawSecondCardTriggeredAbility extends TriggeredAbilityImpl {
return "Whenever you draw your second card each turn, "; return "Whenever you draw your second card each turn, ";
case ACTIVE: case ACTIVE:
return "Whenever a player draws their second card during their turn, "; return "Whenever a player draws their second card during their turn, ";
case OPPONENT:
return "Whenever an opponent draws their second card each turn, ";
default: default:
throw new IllegalArgumentException("TargetController " + targetController + " not supported"); throw new IllegalArgumentException("TargetController " + targetController + " not supported");
} }