Implemented Thieves' Guild Enforcer

This commit is contained in:
Evan Kranzler 2020-06-11 19:34:54 -04:00
parent 1141a4685d
commit a383bffc9b
2 changed files with 90 additions and 0 deletions

View file

@ -0,0 +1,89 @@
package mage.cards.t;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.common.EntersBattlefieldControlledTriggeredAbility;
import mage.abilities.common.SimpleStaticAbility;
import mage.abilities.condition.Condition;
import mage.abilities.decorator.ConditionalContinuousEffect;
import mage.abilities.effects.common.PutTopCardOfLibraryIntoGraveEachPlayerEffect;
import mage.abilities.effects.common.continuous.BoostSourceEffect;
import mage.abilities.effects.common.continuous.GainAbilityControlledEffect;
import mage.abilities.keyword.DeathtouchAbility;
import mage.abilities.keyword.FlashAbility;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.Duration;
import mage.constants.SubType;
import mage.constants.TargetController;
import mage.filter.FilterPermanent;
import mage.game.Game;
import mage.players.Library;
import mage.players.Player;
import java.util.Objects;
import java.util.UUID;
/**
* @author TheElk801
*/
public final class ThievesGuildEnforcer extends CardImpl {
private static final FilterPermanent filter = new FilterPermanent(SubType.ROGUE, "{this} or another Rogue");
public ThievesGuildEnforcer(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{B}");
this.subtype.add(SubType.HUMAN);
this.subtype.add(SubType.ROGUE);
this.power = new MageInt(1);
this.toughness = new MageInt(1);
// Flash
this.addAbility(FlashAbility.getInstance());
// Whenever Thieves' Guild Enforcer or another Rogue enters the battlefield under your control, each opponent mills two cards.
this.addAbility(new EntersBattlefieldControlledTriggeredAbility(
new PutTopCardOfLibraryIntoGraveEachPlayerEffect(
2, TargetController.OPPONENT
), filter
));
// As long as an opponent has eight or more cards in their graveyard, Thieves' Guild Enforcer gets +2/+1 and has deathtouch.
Ability ability = new SimpleStaticAbility(new ConditionalContinuousEffect(
new BoostSourceEffect(2, 1, Duration.WhileOnBattlefield),
ThievesGuildEnforcerCondition.instance, "as long as an opponent " +
"has eight or more cards in their graveyard, {this} gets +2/+1"
));
ability.addEffect(new ConditionalContinuousEffect(new GainAbilityControlledEffect(
DeathtouchAbility.getInstance(), Duration.WhileOnBattlefield
), ThievesGuildEnforcerCondition.instance, "and has deathtouch"));
this.addAbility(ability);
}
private ThievesGuildEnforcer(final ThievesGuildEnforcer card) {
super(card);
}
@Override
public ThievesGuildEnforcer copy() {
return new ThievesGuildEnforcer(this);
}
}
enum ThievesGuildEnforcerCondition implements Condition {
instance;
@Override
public boolean apply(Game game, Ability source) {
return game
.getOpponents(source.getControllerId())
.stream()
.map(game::getPlayer)
.filter(Objects::nonNull)
.map(Player::getLibrary)
.mapToInt(Library::size)
.anyMatch(i -> i >= 8);
}
}

View file

@ -137,6 +137,7 @@ public final class CoreSet2021 extends ExpansionSet {
cards.add(new SetCardInfo("Temple of Mystery", 254, Rarity.RARE, mage.cards.t.TempleOfMystery.class));
cards.add(new SetCardInfo("Temple of Silence", 255, Rarity.RARE, mage.cards.t.TempleOfSilence.class));
cards.add(new SetCardInfo("Temple of Triumph", 256, Rarity.RARE, mage.cards.t.TempleOfTriumph.class));
cards.add(new SetCardInfo("Thieves' Guild Enforcer", 125, Rarity.RARE, mage.cards.t.ThievesGuildEnforcer.class));
cards.add(new SetCardInfo("Tide Skimmer", 79, Rarity.UNCOMMON, mage.cards.t.TideSkimmer.class));
cards.add(new SetCardInfo("Tormod's Crypt", 241, Rarity.UNCOMMON, mage.cards.t.TormodsCrypt.class));
cards.add(new SetCardInfo("Ugin, the Spirit Dragon", 1, Rarity.MYTHIC, mage.cards.u.UginTheSpiritDragon.class));