[DMU] Implemented Garna, Bloodfist of Keld (#9480)

This commit is contained in:
Daniel Bomar 2022-09-13 15:19:47 -05:00 committed by GitHub
parent 9b8d7b6be4
commit 39191a4bd8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 82 additions and 0 deletions

View file

@ -0,0 +1,81 @@
package mage.cards.g;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.common.DiesCreatureTriggeredAbility;
import mage.abilities.condition.Condition;
import mage.abilities.decorator.ConditionalOneShotEffect;
import mage.abilities.effects.Effects;
import mage.abilities.effects.common.DamagePlayersEffect;
import mage.abilities.effects.common.DrawCardSourceControllerEffect;
import mage.constants.SubType;
import mage.constants.SuperType;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.TargetController;
import mage.filter.common.FilterControlledCreaturePermanent;
import mage.filter.predicate.mageobject.AnotherPredicate;
import mage.game.Game;
import mage.game.permanent.Permanent;
/**
*
* @author weirddan455
*/
public final class GarnaBloodfistOfKeld extends CardImpl {
private static final FilterControlledCreaturePermanent filter = new FilterControlledCreaturePermanent("another creature you control");
static {
filter.add(AnotherPredicate.instance);
}
public GarnaBloodfistOfKeld(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{1}{B}{R}{R}");
this.addSuperType(SuperType.LEGENDARY);
this.subtype.add(SubType.HUMAN);
this.subtype.add(SubType.BERSERKER);
this.power = new MageInt(4);
this.toughness = new MageInt(3);
// Whenever another creature you control dies, draw a card if it was attacking. Otherwise, Garna, Bloodfist of Keld deals 1 damage to each opponent.
this.addAbility(new DiesCreatureTriggeredAbility(
new ConditionalOneShotEffect(
new DrawCardSourceControllerEffect(1),
new DamagePlayersEffect(1, TargetController.OPPONENT),
GarnaBloodfistOfKeldCondition.instance,
"draw a card if it was attacking. Otherwise, {this} deals 1 damage to each opponent"
),
false,
filter
));
}
private GarnaBloodfistOfKeld(final GarnaBloodfistOfKeld card) {
super(card);
}
@Override
public GarnaBloodfistOfKeld copy() {
return new GarnaBloodfistOfKeld(this);
}
}
enum GarnaBloodfistOfKeldCondition implements Condition {
instance;
@Override
public boolean apply(Game game, Ability source) {
Effects effects = source.getEffects();
if (!effects.isEmpty()) {
Object value = effects.get(0).getValue("creatureDied");
if (value instanceof Permanent) {
return ((Permanent) value).isAttacking();
}
}
return false;
}
}

View file

@ -111,6 +111,7 @@ public final class DominariaUnited extends ExpansionSet {
cards.add(new SetCardInfo("Frostfist Strider", 51, Rarity.UNCOMMON, mage.cards.f.FrostfistStrider.class));
cards.add(new SetCardInfo("Furious Bellow", 126, Rarity.COMMON, mage.cards.f.FuriousBellow.class));
cards.add(new SetCardInfo("Gaea's Might", 164, Rarity.COMMON, mage.cards.g.GaeasMight.class));
cards.add(new SetCardInfo("Garna, Bloodfist of Keld", 200, Rarity.UNCOMMON, mage.cards.g.GarnaBloodfistOfKeld.class));
cards.add(new SetCardInfo("Geothermal Bog", 247, Rarity.COMMON, mage.cards.g.GeothermalBog.class));
cards.add(new SetCardInfo("Ghitu Amplifier", 127, Rarity.COMMON, mage.cards.g.GhituAmplifier.class));
cards.add(new SetCardInfo("Gibbering Barricade", 95, Rarity.COMMON, mage.cards.g.GibberingBarricade.class));