[CLB] Implemented Blood Money

This commit is contained in:
Evan Kranzler 2022-05-31 09:03:36 -04:00
parent 8c4145e7f9
commit c3adff6bc9
2 changed files with 72 additions and 0 deletions

View file

@ -0,0 +1,71 @@
package mage.cards.b;
import mage.abilities.Ability;
import mage.abilities.effects.OneShotEffect;
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 mage.game.permanent.PermanentToken;
import mage.game.permanent.token.TreasureToken;
import java.util.UUID;
/**
* @author TheElk801
*/
public final class BloodMoney extends CardImpl {
public BloodMoney(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{5}{B}{B}");
// Destroy all creatures. For each nontoken creature destroyed this way, create a tapped Treasure token.
this.getSpellAbility().addEffect(new BloodMoneyEffect());
}
private BloodMoney(final BloodMoney card) {
super(card);
}
@Override
public BloodMoney copy() {
return new BloodMoney(this);
}
}
class BloodMoneyEffect extends OneShotEffect {
BloodMoneyEffect() {
super(Outcome.Benefit);
staticText = "destroy all creatures. For each nontoken creature destroyed this way, create a tapped Treasure token";
}
private BloodMoneyEffect(final BloodMoneyEffect effect) {
super(effect);
}
@Override
public BloodMoneyEffect copy() {
return new BloodMoneyEffect(this);
}
@Override
public boolean apply(Game game, Ability source) {
int count = 0;
for (Permanent permanent : game.getBattlefield().getActivePermanents(
StaticFilters.FILTER_PERMANENT_CREATURE,
source.getControllerId(), source, game
)) {
if (permanent.destroy(source, game) && !(permanent instanceof PermanentToken)) {
count++;
}
}
if (count > 0) {
new TreasureToken().putOntoBattlefield(count, game, source, source.getControllerId(), true, false);
}
return true;
}
}

View file

@ -58,6 +58,7 @@ public final class CommanderLegendsBattleForBaldursGate extends ExpansionSet {
cards.add(new SetCardInfo("Black Dragon Gate", 347, Rarity.COMMON, mage.cards.b.BlackDragonGate.class));
cards.add(new SetCardInfo("Blade of Selves", 301, Rarity.RARE, mage.cards.b.BladeOfSelves.class));
cards.add(new SetCardInfo("Blessed Hippogriff", 11, Rarity.COMMON, mage.cards.b.BlessedHippogriff.class));
cards.add(new SetCardInfo("Blood Money", 116, Rarity.MYTHIC, mage.cards.b.BloodMoney.class));
cards.add(new SetCardInfo("Bloodboil Sorcerer", 164, Rarity.UNCOMMON, mage.cards.b.BloodboilSorcerer.class));
cards.add(new SetCardInfo("Blur", 58, Rarity.COMMON, mage.cards.b.Blur.class));
cards.add(new SetCardInfo("Bonecaller Cleric", 117, Rarity.UNCOMMON, mage.cards.b.BonecallerCleric.class));