mirror of
https://github.com/correl/mage.git
synced 2024-11-15 19:19:33 +00:00
Implemented Bushmeat Poacher
This commit is contained in:
parent
92b252d036
commit
bf2c98571a
2 changed files with 104 additions and 0 deletions
103
Mage.Sets/src/mage/cards/b/BushmeatPoacher.java
Normal file
103
Mage.Sets/src/mage/cards/b/BushmeatPoacher.java
Normal file
|
@ -0,0 +1,103 @@
|
|||
package mage.cards.b;
|
||||
|
||||
import mage.MageInt;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.SimpleActivatedAbility;
|
||||
import mage.abilities.costs.common.SacrificeTargetCost;
|
||||
import mage.abilities.costs.common.TapSourceCost;
|
||||
import mage.abilities.costs.mana.GenericManaCost;
|
||||
import mage.abilities.effects.OneShotEffect;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Outcome;
|
||||
import mage.constants.SubType;
|
||||
import mage.filter.common.FilterControlledCreaturePermanent;
|
||||
import mage.filter.common.FilterControlledPermanent;
|
||||
import mage.filter.predicate.permanent.AnotherPredicate;
|
||||
import mage.game.Game;
|
||||
import mage.game.permanent.Permanent;
|
||||
import mage.players.Player;
|
||||
import mage.target.common.TargetControlledPermanent;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
* @author TheElk801
|
||||
*/
|
||||
public final class BushmeatPoacher extends CardImpl {
|
||||
|
||||
private static final FilterControlledPermanent filter = new FilterControlledCreaturePermanent("another creature");
|
||||
|
||||
static {
|
||||
filter.add(AnotherPredicate.instance);
|
||||
}
|
||||
|
||||
public BushmeatPoacher(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{3}{B}");
|
||||
|
||||
this.subtype.add(SubType.HUMAN);
|
||||
this.subtype.add(SubType.SOLDIER);
|
||||
this.power = new MageInt(2);
|
||||
this.toughness = new MageInt(4);
|
||||
|
||||
// {1}, {T}: Sacrifice another creature: You gain life equal to that creature's toughness. Draw a card.
|
||||
Ability ability = new SimpleActivatedAbility(new BushmeatPoacherEffect(), new GenericManaCost(1));
|
||||
ability.addCost(new TapSourceCost());
|
||||
ability.addCost(new SacrificeTargetCost(new TargetControlledPermanent(filter)));
|
||||
this.addAbility(ability);
|
||||
}
|
||||
|
||||
private BushmeatPoacher(final BushmeatPoacher card) {
|
||||
super(card);
|
||||
}
|
||||
|
||||
@Override
|
||||
public BushmeatPoacher copy() {
|
||||
return new BushmeatPoacher(this);
|
||||
}
|
||||
}
|
||||
|
||||
class BushmeatPoacherEffect extends OneShotEffect {
|
||||
|
||||
BushmeatPoacherEffect() {
|
||||
super(Outcome.Benefit);
|
||||
staticText = "you gain life equal to that creature's toughness. Draw a card";
|
||||
}
|
||||
|
||||
private BushmeatPoacherEffect(final BushmeatPoacherEffect effect) {
|
||||
super(effect);
|
||||
}
|
||||
|
||||
@Override
|
||||
public BushmeatPoacherEffect copy() {
|
||||
return new BushmeatPoacherEffect(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
Player player = game.getPlayer(source.getControllerId());
|
||||
if (player == null) {
|
||||
return false;
|
||||
}
|
||||
SacrificeTargetCost cost = source
|
||||
.getCosts()
|
||||
.stream()
|
||||
.filter(SacrificeTargetCost.class::isInstance)
|
||||
.map(SacrificeTargetCost.class::cast)
|
||||
.findFirst()
|
||||
.orElse(null);
|
||||
if (cost == null) {
|
||||
return false;
|
||||
}
|
||||
Permanent permanent = cost.getPermanents().get(0);
|
||||
if (permanent == null) {
|
||||
return false;
|
||||
}
|
||||
int amount = permanent.getToughness().getValue();
|
||||
if (amount > 0) {
|
||||
player.gainLife(amount, game, source);
|
||||
}
|
||||
return player.drawCards(1, game) > 0;
|
||||
}
|
||||
}
|
|
@ -68,6 +68,7 @@ public final class IkoriaLairOfBehemoths extends ExpansionSet {
|
|||
cards.add(new SetCardInfo("Boneyard Lurker", 178, Rarity.UNCOMMON, mage.cards.b.BoneyardLurker.class));
|
||||
cards.add(new SetCardInfo("Boon of the Wish-Giver", 43, Rarity.UNCOMMON, mage.cards.b.BoonOfTheWishGiver.class));
|
||||
cards.add(new SetCardInfo("Bristling Boar", 146, Rarity.COMMON, mage.cards.b.BristlingBoar.class));
|
||||
cards.add(new SetCardInfo("Bushmeat Poacher", 77, Rarity.COMMON, mage.cards.b.BushmeatPoacher.class));
|
||||
cards.add(new SetCardInfo("Call of the Death-Dweller", 78, Rarity.UNCOMMON, mage.cards.c.CallOfTheDeathDweller.class));
|
||||
cards.add(new SetCardInfo("Capture Sphere", 44, Rarity.COMMON, mage.cards.c.CaptureSphere.class));
|
||||
cards.add(new SetCardInfo("Cathartic Reunion", 110, Rarity.COMMON, mage.cards.c.CatharticReunion.class));
|
||||
|
|
Loading…
Reference in a new issue