[AFR] Implemented Old Gnawbone

This commit is contained in:
Daniel Bomar 2021-07-05 08:47:42 -05:00
parent e3a2f7619f
commit 9ee589aec9
No known key found for this signature in database
GPG key ID: C86C8658F4023918
2 changed files with 83 additions and 0 deletions

View file

@ -0,0 +1,82 @@
package mage.cards.o;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.common.DealsDamageToAPlayerAllTriggeredAbility;
import mage.abilities.dynamicvalue.DynamicValue;
import mage.abilities.effects.Effect;
import mage.abilities.effects.common.CreateTokenEffect;
import mage.constants.SetTargetPointer;
import mage.constants.SubType;
import mage.constants.SuperType;
import mage.abilities.keyword.FlyingAbility;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.filter.StaticFilters;
import mage.game.Game;
import mage.game.permanent.token.TreasureToken;
/**
*
* @author weirddan455
*/
public final class OldGnawbone extends CardImpl {
public OldGnawbone(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{5}{G}{G}");
this.addSuperType(SuperType.LEGENDARY);
this.subtype.add(SubType.DRAGON);
this.power = new MageInt(7);
this.toughness = new MageInt(7);
// Flying
this.addAbility(FlyingAbility.getInstance());
// Whenever a creature you control deals combat damage to a player, create that many Treasure tokens.
this.addAbility(new DealsDamageToAPlayerAllTriggeredAbility(
new CreateTokenEffect(new TreasureToken(), OldGnawboneValue.instance),
StaticFilters.FILTER_CONTROLLED_A_CREATURE,
false, SetTargetPointer.NONE, true
));
}
private OldGnawbone(final OldGnawbone card) {
super(card);
}
@Override
public OldGnawbone copy() {
return new OldGnawbone(this);
}
}
enum OldGnawboneValue implements DynamicValue {
instance;
@Override
public int calculate(Game game, Ability sourceAbility, Effect effect) {
Integer damage = (Integer) effect.getValue("damage");
if (damage != null) {
return damage;
}
return 0;
}
@Override
public String toString() {
return "that many";
}
@Override
public String getMessage() {
return "";
}
@Override
public OldGnawboneValue copy() {
return OldGnawboneValue.instance;
}
}

View file

@ -111,6 +111,7 @@ public final class AdventuresInTheForgottenRealms extends ExpansionSet {
cards.add(new SetCardInfo("Mordenkainen's Polymorph", 65, Rarity.COMMON, mage.cards.m.MordenkainensPolymorph.class));
cards.add(new SetCardInfo("Mountain", 274, Rarity.LAND, mage.cards.basiclands.Mountain.class, NON_FULL_USE_VARIOUS));
cards.add(new SetCardInfo("Nadaar, Selfless Paladin", 27, Rarity.RARE, mage.cards.n.NadaarSelflessPaladin.class));
cards.add(new SetCardInfo("Old Gnawbone", 197, Rarity.MYTHIC, mage.cards.o.OldGnawbone.class));
cards.add(new SetCardInfo("Plains", 262, Rarity.LAND, mage.cards.basiclands.Plains.class, NON_FULL_USE_VARIOUS));
cards.add(new SetCardInfo("Planar Ally", 31, Rarity.COMMON, mage.cards.p.PlanarAlly.class));
cards.add(new SetCardInfo("Plundering Barbarian", 158, Rarity.COMMON, mage.cards.p.PlunderingBarbarian.class));