[MIC] Implemented Ravenous Rotbelly

This commit is contained in:
Evan Kranzler 2021-09-14 09:38:28 -04:00
parent b58f7dbfc4
commit c935520570
2 changed files with 96 additions and 0 deletions

View file

@ -0,0 +1,95 @@
package mage.cards.r;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.common.EntersBattlefieldTriggeredAbility;
import mage.abilities.common.delayed.ReflexiveTriggeredAbility;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.SacrificeOpponentsEffect;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.Outcome;
import mage.constants.SubType;
import mage.filter.FilterPermanent;
import mage.filter.StaticFilters;
import mage.filter.common.FilterControlledPermanent;
import mage.game.Game;
import mage.game.permanent.Permanent;
import mage.players.Player;
import mage.target.TargetPermanent;
import java.util.UUID;
/**
* @author TheElk801
*/
public final class RavenousRotbelly extends CardImpl {
public RavenousRotbelly(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{4}{B}");
this.subtype.add(SubType.ZOMBIE);
this.subtype.add(SubType.HORROR);
this.power = new MageInt(4);
this.toughness = new MageInt(5);
// When Ravenous Rotbelly enters the battlefield, you may sacrifice up to three Zombies. When you sacrifice one or more Zombies this way, each opponent sacrifices that many creatures.
this.addAbility(new EntersBattlefieldTriggeredAbility(new RavenousRotbellyEffect()));
}
private RavenousRotbelly(final RavenousRotbelly card) {
super(card);
}
@Override
public RavenousRotbelly copy() {
return new RavenousRotbelly(this);
}
}
class RavenousRotbellyEffect extends OneShotEffect {
private static final FilterPermanent filter
= new FilterControlledPermanent(SubType.ZOMBIE, "Zombies you control");
RavenousRotbellyEffect() {
super(Outcome.Benefit);
staticText = "you may sacrifice up to three Zombies. When you sacrifice " +
"one or more Zombies this way, each opponent sacrifices that many creatures";
}
private RavenousRotbellyEffect(final RavenousRotbellyEffect effect) {
super(effect);
}
@Override
public RavenousRotbellyEffect copy() {
return new RavenousRotbellyEffect(this);
}
@Override
public boolean apply(Game game, Ability source) {
Player player = game.getPlayer(source.getControllerId());
if (player == null) {
return false;
}
TargetPermanent target = new TargetPermanent(0, 3, filter, true);
player.choose(outcome, target, source.getSourceId(), game);
int amount = 0;
for (UUID permanentId : target.getTargets()) {
Permanent permanent = game.getPermanent(permanentId);
if (permanent != null && permanent.sacrifice(source, game)) {
amount++;
}
}
if (amount < 1) {
return false;
}
game.fireReflexiveTriggeredAbility(new ReflexiveTriggeredAbility(
new SacrificeOpponentsEffect(amount, StaticFilters.FILTER_PERMANENT_CREATURES),
false, "each opponent sacrifices that many creatures"
), source);
return true;
}
}

View file

@ -22,6 +22,7 @@ public final class MidnightHuntCommander extends ExpansionSet {
cards.add(new SetCardInfo("Avacyn's Memorial", 31, Rarity.MYTHIC, mage.cards.a.AvacynsMemorial.class)); cards.add(new SetCardInfo("Avacyn's Memorial", 31, Rarity.MYTHIC, mage.cards.a.AvacynsMemorial.class));
cards.add(new SetCardInfo("Kyler, Sigardian Emissary", 4, Rarity.MYTHIC, mage.cards.k.KylerSigardianEmissary.class)); cards.add(new SetCardInfo("Kyler, Sigardian Emissary", 4, Rarity.MYTHIC, mage.cards.k.KylerSigardianEmissary.class));
cards.add(new SetCardInfo("Leinore, Autumn Sovereign", 1, Rarity.MYTHIC, mage.cards.l.LeinoreAutumnSovereign.class)); cards.add(new SetCardInfo("Leinore, Autumn Sovereign", 1, Rarity.MYTHIC, mage.cards.l.LeinoreAutumnSovereign.class));
cards.add(new SetCardInfo("Ravenous Rotbelly", 22, Rarity.RARE, mage.cards.r.RavenousRotbelly.class));
cards.add(new SetCardInfo("Wilhelt, the Rotcleaver", 2, Rarity.MYTHIC, mage.cards.w.WilheltTheRotcleaver.class)); cards.add(new SetCardInfo("Wilhelt, the Rotcleaver", 2, Rarity.MYTHIC, mage.cards.w.WilheltTheRotcleaver.class));
cards.add(new SetCardInfo("Zombie Apocalypse", 131, Rarity.RARE, mage.cards.z.ZombieApocalypse.class)); cards.add(new SetCardInfo("Zombie Apocalypse", 131, Rarity.RARE, mage.cards.z.ZombieApocalypse.class));
} }