[SLD] Implemented Negan, the Cold Blooded

This commit is contained in:
Evan Kranzler 2020-09-28 20:01:38 -04:00
parent bd5d3954b1
commit a95b518800
2 changed files with 121 additions and 0 deletions

View file

@ -0,0 +1,120 @@
package mage.cards.n;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.common.EntersBattlefieldTriggeredAbility;
import mage.abilities.common.SacrificeAllTriggeredAbility;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.CreateTokenEffect;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.*;
import mage.filter.FilterPermanent;
import mage.filter.StaticFilters;
import mage.filter.common.FilterCreaturePermanent;
import mage.filter.predicate.permanent.ControllerIdPredicate;
import mage.game.Game;
import mage.game.permanent.Permanent;
import mage.game.permanent.token.TreasureToken;
import mage.players.Player;
import mage.target.TargetPermanent;
import mage.target.common.TargetOpponent;
import java.util.HashSet;
import java.util.Set;
import java.util.UUID;
/**
* @author TheElk801
*/
public final class NeganTheColdBlooded extends CardImpl {
public NeganTheColdBlooded(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{2}{R}{W}{B}");
this.addSuperType(SuperType.LEGENDARY);
this.subtype.add(SubType.HUMAN);
this.subtype.add(SubType.ROGUE);
this.power = new MageInt(4);
this.toughness = new MageInt(3);
// When Negan enters the battlefield, you and target opponent each secretly choose a creature that player controls. Then those choices are revealed, and that player sacrifices those creatures.
Ability ability = new EntersBattlefieldTriggeredAbility(new NeganTheColdBloodedEffect());
ability.addTarget(new TargetOpponent());
this.addAbility(ability);
// Whenever an opponent sacrifices a creature, you create a Treasure token.
this.addAbility(new SacrificeAllTriggeredAbility(
new CreateTokenEffect(new TreasureToken()),
StaticFilters.FILTER_PERMANENT_A_CREATURE,
TargetController.OPPONENT, false
));
}
private NeganTheColdBlooded(final NeganTheColdBlooded card) {
super(card);
}
@Override
public NeganTheColdBlooded copy() {
return new NeganTheColdBlooded(this);
}
}
class NeganTheColdBloodedEffect extends OneShotEffect {
NeganTheColdBloodedEffect() {
super(Outcome.Benefit);
staticText = "you and target opponent each secretly choose a creature that player controls. " +
"Then those choices are revealed, and that player sacrifices those creatures";
}
private NeganTheColdBloodedEffect(final NeganTheColdBloodedEffect effect) {
super(effect);
}
@Override
public NeganTheColdBloodedEffect copy() {
return new NeganTheColdBloodedEffect(this);
}
@Override
public boolean apply(Game game, Ability source) {
Player controller = game.getPlayer(source.getControllerId());
Player opponent = game.getPlayer(source.getFirstTarget());
if (controller == null || opponent == null) {
return false;
}
FilterPermanent filter = new FilterCreaturePermanent("creature controlled by " + opponent.getName());
filter.add(new ControllerIdPredicate(opponent.getId()));
TargetPermanent target = new TargetPermanent(filter);
target.setNotTarget(true);
if (!target.canChoose(source.getSourceId(), source.getControllerId(), game)) {
return false;
}
Set<UUID> choices = new HashSet<>();
controller.choose(Outcome.DestroyPermanent, target, source.getSourceId(), game);
UUID controllerChoice = target.getFirstTarget();
choices.add(controllerChoice);
target.clearChosen();
opponent.choose(Outcome.DestroyPermanent, target, source.getSourceId(), game);
UUID opponentChoice = target.getFirstTarget();
choices.add(opponentChoice);
for (UUID creatureId : choices) {
Permanent permanent = game.getPermanent(creatureId);
if (permanent == null) {
continue;
}
if (controllerChoice.equals(creatureId)) {
game.informPlayers(controller.getName() + " chose " + permanent.getIdName());
}
if (opponent.equals(creatureId)) {
game.informPlayers(opponent.getName() + " chose " + permanent.getIdName());
}
permanent.sacrifice(source.getSourceId(), game);
}
return true;
}
}

View file

@ -75,6 +75,7 @@ public class SecretLairDrop extends ExpansionSet {
cards.add(new SetCardInfo("Mudhole", 62, Rarity.RARE, mage.cards.m.Mudhole.class, FULL_ART));
cards.add(new SetCardInfo("Narset, Enlightened Master", 53, Rarity.MYTHIC, mage.cards.n.NarsetEnlightenedMaster.class));
cards.add(new SetCardInfo("Necrotic Ooze", 133, Rarity.RARE, mage.cards.n.NecroticOoze.class));
cards.add(new SetCardInfo("Negan, the Cold-Blooded", 147, Rarity.MYTHIC, mage.cards.n.NeganTheColdBlooded.class));
cards.add(new SetCardInfo("Nylea, God of the Hunt", 80, Rarity.MYTHIC, mage.cards.n.NyleaGodOfTheHunt.class, FULL_ART));
cards.add(new SetCardInfo("Oona, Queen of the Fae", 54, Rarity.MYTHIC, mage.cards.o.OonaQueenOfTheFae.class));
cards.add(new SetCardInfo("Pack Rat", 35, Rarity.RARE, mage.cards.p.PackRat.class));