Implemented Kaya's Wrath

This commit is contained in:
Evan Kranzler 2019-01-07 20:30:50 -05:00
parent b73529fbc4
commit b9618fe5be
2 changed files with 70 additions and 0 deletions

View file

@ -0,0 +1,69 @@
package mage.cards.k;
import mage.abilities.Ability;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.GainLifeEffect;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.Outcome;
import mage.filter.StaticFilters;
import mage.game.Game;
import mage.game.permanent.Permanent;
import java.util.UUID;
/**
* @author TheElk801
*/
public final class KayasWrath extends CardImpl {
public KayasWrath(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{W}{W}{B}{B}");
// Destroy all creatures. You gain life equal to the number of creatures you controlled that were destroyed this way.
this.getSpellAbility().addEffect(new KayasWrathEffect());
}
private KayasWrath(final KayasWrath card) {
super(card);
}
@Override
public KayasWrath copy() {
return new KayasWrath(this);
}
}
class KayasWrathEffect extends OneShotEffect {
KayasWrathEffect() {
super(Outcome.Benefit);
staticText = "Destroy all creatures. You gain life equal to the number of " +
"creatures you controlled that were destroyed this way.";
}
private KayasWrathEffect(final KayasWrathEffect effect) {
super(effect);
}
@Override
public KayasWrathEffect copy() {
return new KayasWrathEffect(this);
}
@Override
public boolean apply(Game game, Ability source) {
int counter = 0;
for (Permanent permanent : game.getBattlefield().getActivePermanents(
StaticFilters.FILTER_PERMANENT_CREATURE,
source.getControllerId(), source.getSourceId(), game
)) {
boolean isMine = permanent != null && permanent.getControllerId().equals(source.getControllerId());
if (permanent.destroy(source.getSourceId(), game, false) && isMine) {
counter++;
}
}
return new GainLifeEffect(counter).apply(game, source);
}
}

View file

@ -82,6 +82,7 @@ public final class RavnicaAllegiance extends ExpansionSet {
cards.add(new SetCardInfo("Imperious Oligarch", 184, Rarity.COMMON, mage.cards.i.ImperiousOligarch.class));
cards.add(new SetCardInfo("Incubation // Incongruity", 226, Rarity.UNCOMMON, mage.cards.i.IncubationIncongruity.class));
cards.add(new SetCardInfo("Judith, the Scourge Diva", 185, Rarity.RARE, mage.cards.j.JudithTheScourgeDiva.class));
cards.add(new SetCardInfo("Kaya's Wrath", 187, Rarity.RARE, mage.cards.k.KayasWrath.class));
cards.add(new SetCardInfo("Kaya, Orzhov Usurper", 186, Rarity.MYTHIC, mage.cards.k.KayaOrzhovUsurper.class));
cards.add(new SetCardInfo("Lavinia, Azorius Renegade", 189, Rarity.RARE, mage.cards.l.LaviniaAzoriusRenegade.class));
cards.add(new SetCardInfo("Light Up the Stage", 107, Rarity.UNCOMMON, mage.cards.l.LightUpTheStage.class));