Implemented Chevill, Bane of Monsters

This commit is contained in:
Evan Kranzler 2020-04-07 21:24:10 -04:00
parent 24b646c05a
commit 59bc7519b0
2 changed files with 89 additions and 0 deletions

View file

@ -0,0 +1,88 @@
package mage.cards.c;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.common.BeginningOfUpkeepTriggeredAbility;
import mage.abilities.common.DiesCreatureTriggeredAbility;
import mage.abilities.condition.Condition;
import mage.abilities.condition.common.PermanentsOnTheBattlefieldCondition;
import mage.abilities.decorator.ConditionalInterveningIfTriggeredAbility;
import mage.abilities.effects.common.GainLifeEffect;
import mage.abilities.effects.common.counter.AddCountersTargetEffect;
import mage.abilities.keyword.DeathtouchAbility;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.*;
import mage.counters.CounterType;
import mage.filter.FilterPermanent;
import mage.filter.common.FilterCreatureOrPlaneswalkerPermanent;
import mage.filter.predicate.Predicate;
import mage.filter.predicate.permanent.CounterPredicate;
import mage.target.TargetPermanent;
import java.util.UUID;
/**
* @author TheElk801
*/
public final class ChevillBaneOfMonsters extends CardImpl {
private static final FilterPermanent filter
= new FilterPermanent();
private static final FilterPermanent filter2
= new FilterCreatureOrPlaneswalkerPermanent("creature or planeswalker an opponent controls");
private static final FilterPermanent filter3
= new FilterPermanent("a permanent an opponent controls with a bounty counter on it");
private static final Predicate predicate = new CounterPredicate(CounterType.BOUNTY);
static {
filter.add(TargetController.OPPONENT.getControllerPredicate());
filter.add(predicate);
filter2.add(TargetController.OPPONENT.getControllerPredicate());
filter3.add(TargetController.OPPONENT.getControllerPredicate());
filter3.add(predicate);
}
private static final Condition condition = new PermanentsOnTheBattlefieldCondition(filter, ComparisonType.EQUAL_TO, 0);
public ChevillBaneOfMonsters(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{B}{G}");
this.addSuperType(SuperType.LEGENDARY);
this.subtype.add(SubType.HUMAN);
this.subtype.add(SubType.ROGUE);
this.power = new MageInt(1);
this.toughness = new MageInt(3);
// Deathtouch
this.addAbility(DeathtouchAbility.getInstance());
// At the beginning of your upkeep, if your opponents control no permanents with bounty counters on them, put a bounty counter on target creature or planeswalker an opponent controls.
Ability ability = new ConditionalInterveningIfTriggeredAbility(
new BeginningOfUpkeepTriggeredAbility(
new AddCountersTargetEffect(CounterType.BOUNTY.createInstance()),
TargetController.YOU, false
), condition, "At the beginning of your upkeep, " +
"if your opponents control no permanents with bounty counters on them, " +
"put a bounty counter on target creature or planeswalker an opponent controls."
);
ability.addTarget(new TargetPermanent(filter2));
this.addAbility(ability);
// Whenever a permanent an opponent controls with a bounty counter on it dies, you gain 3 life and draw card.
ability = new DiesCreatureTriggeredAbility(new GainLifeEffect(3), false, filter3);
ability.addEffect(new GainLifeEffect(1).concatBy("and"));
this.addAbility(ability);
}
private ChevillBaneOfMonsters(final ChevillBaneOfMonsters card) {
super(card);
}
@Override
public ChevillBaneOfMonsters copy() {
return new ChevillBaneOfMonsters(this);
}
}

View file

@ -74,6 +74,7 @@ public final class IkoriaLairOfBehemoths extends ExpansionSet {
cards.add(new SetCardInfo("Cathartic Reunion", 110, Rarity.COMMON, mage.cards.c.CatharticReunion.class));
cards.add(new SetCardInfo("Cavern Whisperer", 79, Rarity.COMMON, mage.cards.c.CavernWhisperer.class));
cards.add(new SetCardInfo("Charge of the Forever-Beast", 147, Rarity.UNCOMMON, mage.cards.c.ChargeOfTheForeverBeast.class));
cards.add(new SetCardInfo("Chevill, Bane of Monsters", 181, Rarity.MYTHIC, mage.cards.c.ChevillBaneOfMonsters.class));
cards.add(new SetCardInfo("Chittering Harvester", 80, Rarity.UNCOMMON, mage.cards.c.ChitteringHarvester.class));
cards.add(new SetCardInfo("Cloudpiercer", 112, Rarity.COMMON, mage.cards.c.Cloudpiercer.class));
cards.add(new SetCardInfo("Colossification", 148, Rarity.RARE, mage.cards.c.Colossification.class));