Implemented Cavalcade of Calamity

This commit is contained in:
Evan Kranzler 2019-01-10 19:32:50 -05:00
parent 0404be994e
commit e0cb67f493
2 changed files with 73 additions and 0 deletions

View file

@ -0,0 +1,72 @@
package mage.cards.c;
import mage.abilities.Ability;
import mage.abilities.common.AttacksAllTriggeredAbility;
import mage.abilities.effects.OneShotEffect;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.*;
import mage.filter.common.FilterCreaturePermanent;
import mage.filter.predicate.mageobject.PowerPredicate;
import mage.filter.predicate.permanent.ControllerPredicate;
import mage.game.Game;
import java.util.UUID;
/**
* @author TheElk801
*/
public final class CavalcadeOfCalamity extends CardImpl {
private static final FilterCreaturePermanent filter
= new FilterCreaturePermanent("creaure you control with power 1 or less");
static {
filter.add(new ControllerPredicate(TargetController.YOU));
filter.add(new PowerPredicate(ComparisonType.FEWER_THAN, 2));
}
public CavalcadeOfCalamity(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{1}{R}");
// Whenever a creature you control with power 1 or less attacks, Cavalcade of Calamity deals 1 damage to the player or planeswalker that creature is attacking.
this.addAbility(new AttacksAllTriggeredAbility(
new CavalcadeOfCalamityEffect(), false, filter,
SetTargetPointer.PERMANENT, false, false
));
}
private CavalcadeOfCalamity(final CavalcadeOfCalamity card) {
super(card);
}
@Override
public CavalcadeOfCalamity copy() {
return new CavalcadeOfCalamity(this);
}
}
class CavalcadeOfCalamityEffect extends OneShotEffect {
CavalcadeOfCalamityEffect() {
super(Outcome.Benefit);
staticText = "{this} deals 1 damage to the player or planeswalker that creature is attacking.";
}
private CavalcadeOfCalamityEffect(final CavalcadeOfCalamityEffect effect) {
super(effect);
}
@Override
public CavalcadeOfCalamityEffect copy() {
return new CavalcadeOfCalamityEffect(this);
}
@Override
public boolean apply(Game game, Ability source) {
return game.damagePlayerOrPlaneswalker(
game.getCombat().getDefenderId(source.getFirstTarget()), 1,
source.getSourceId(), game, false, true
) > 0;
}
}

View file

@ -60,6 +60,7 @@ public final class RavnicaAllegiance extends ExpansionSet {
cards.add(new SetCardInfo("Burning-Tree Vandal", 94, Rarity.COMMON, mage.cards.b.BurningTreeVandal.class));
cards.add(new SetCardInfo("Captive Audience", 160, Rarity.MYTHIC, mage.cards.c.CaptiveAudience.class));
cards.add(new SetCardInfo("Carnival // Carnage", 222, Rarity.UNCOMMON, mage.cards.c.CarnivalCarnage.class));
cards.add(new SetCardInfo("Cavalcade of Calamity", 95, Rarity.UNCOMMON, mage.cards.c.CavalcadeOfCalamity.class));
cards.add(new SetCardInfo("Charging War Boar", 271, Rarity.UNCOMMON, mage.cards.c.ChargingWarBoar.class));
cards.add(new SetCardInfo("Cindervines", 161, Rarity.RARE, mage.cards.c.Cindervines.class));
cards.add(new SetCardInfo("Clamor Shaman", 96, Rarity.UNCOMMON, mage.cards.c.ClamorShaman.class));