[BRO] Implemented Carrion Locust

This commit is contained in:
Daniel Bomar 2022-11-04 19:53:36 -05:00
parent 5de3030507
commit 7c741eb0dd
No known key found for this signature in database
GPG key ID: C86C8658F4023918
2 changed files with 91 additions and 0 deletions

View file

@ -0,0 +1,90 @@
package mage.cards.c;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.common.EntersBattlefieldTriggeredAbility;
import mage.abilities.effects.OneShotEffect;
import mage.cards.Card;
import mage.constants.Outcome;
import mage.constants.SubType;
import mage.abilities.keyword.FlyingAbility;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.Zone;
import mage.filter.FilterCard;
import mage.game.Game;
import mage.players.Player;
import mage.target.common.TargetCardInOpponentsGraveyard;
/**
*
* @author weirddan455
*/
public final class CarrionLocust extends CardImpl {
private static final FilterCard filter = new FilterCard("card from an opponent's graveyard");
public CarrionLocust(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{2}{B}");
this.subtype.add(SubType.INSECT);
this.subtype.add(SubType.HORROR);
this.power = new MageInt(2);
this.toughness = new MageInt(1);
// Flying
this.addAbility(FlyingAbility.getInstance());
// When Carrion Locust enters the battlefield, exile target card from an opponent's graveyard. If it was a creature card, that player loses 1 life.
Ability ability = new EntersBattlefieldTriggeredAbility(new CarrionLocustEffect());
ability.addTarget(new TargetCardInOpponentsGraveyard(filter));
this.addAbility(ability);
}
private CarrionLocust(final CarrionLocust card) {
super(card);
}
@Override
public CarrionLocust copy() {
return new CarrionLocust(this);
}
}
class CarrionLocustEffect extends OneShotEffect {
public CarrionLocustEffect() {
super(Outcome.Exile);
this.staticText = "exile target card from an opponent's graveyard. If it was a creature card, that player loses 1 life";
}
private CarrionLocustEffect(final CarrionLocustEffect effect) {
super(effect);
}
@Override
public CarrionLocustEffect copy() {
return new CarrionLocustEffect(this);
}
@Override
public boolean apply(Game game, Ability source) {
Card targetCard = game.getCard(source.getFirstTarget());
if (targetCard == null) {
return false;
}
Player controller = game.getPlayer(source.getControllerId());
if (controller == null) {
return false;
}
boolean creature = targetCard.isCreature(game);
Player owner = game.getPlayer(targetCard.getOwnerId());
controller.moveCards(targetCard, Zone.EXILED, source, game);
if (creature && owner != null) {
owner.loseLife(1, game, source, false);
}
return true;
}
}

View file

@ -50,6 +50,7 @@ public final class TheBrothersWar extends ExpansionSet {
cards.add(new SetCardInfo("Brotherhood's End", 128, Rarity.RARE, mage.cards.b.BrotherhoodsEnd.class));
cards.add(new SetCardInfo("Brushland", 259, Rarity.RARE, mage.cards.b.Brushland.class));
cards.add(new SetCardInfo("Bushwhack", 174, Rarity.UNCOMMON, mage.cards.b.Bushwhack.class));
cards.add(new SetCardInfo("Carrion Locust", 87, Rarity.COMMON, mage.cards.c.CarrionLocust.class));
cards.add(new SetCardInfo("Citanul Stalwart", 175, Rarity.COMMON, mage.cards.c.CitanulStalwart.class));
cards.add(new SetCardInfo("Clay Champion", 230, Rarity.MYTHIC, mage.cards.c.ClayChampion.class));
cards.add(new SetCardInfo("Clay Revenant", 118, Rarity.COMMON, mage.cards.c.ClayRevenant.class));