diff --git a/Mage.Sets/src/mage/cards/d/DustinGadgetGenius.java b/Mage.Sets/src/mage/cards/d/DustinGadgetGenius.java new file mode 100644 index 0000000000..941e12a70f --- /dev/null +++ b/Mage.Sets/src/mage/cards/d/DustinGadgetGenius.java @@ -0,0 +1,83 @@ +package mage.cards.d; + +import mage.ConditionalMana; +import mage.MageInt; +import mage.MageObject; +import mage.Mana; +import mage.abilities.Ability; +import mage.abilities.condition.Condition; +import mage.abilities.costs.common.TapSourceCost; +import mage.abilities.keyword.FriendsForeverAbility; +import mage.abilities.mana.ConditionalColorlessManaAbility; +import mage.abilities.mana.builder.ConditionalManaBuilder; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.constants.SubType; +import mage.constants.SuperType; +import mage.game.Game; + +import java.util.UUID; + +/** + * @author TheElk801 + */ +public final class DustinGadgetGenius extends CardImpl { + + public DustinGadgetGenius(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{2}{W}{U}"); + + this.addSuperType(SuperType.LEGENDARY); + this.subtype.add(SubType.HUMAN); + this.power = new MageInt(2); + this.toughness = new MageInt(3); + + // {T}: Add {C}{C}. Spend this mana only to cast artifact spells or activate abilities of artifacts. + this.addAbility(new ConditionalColorlessManaAbility( + new TapSourceCost(), 2, new DustinGadgetGeniusManaBuilder() + )); + + // Friends forever + this.addAbility(FriendsForeverAbility.getInstance()); + } + + private DustinGadgetGenius(final DustinGadgetGenius card) { + super(card); + } + + @Override + public DustinGadgetGenius copy() { + return new DustinGadgetGenius(this); + } +} + +class DustinGadgetGeniusManaBuilder extends ConditionalManaBuilder { + + @Override + public ConditionalMana build(Object... options) { + return new DustinGadgetGeniusConditionalMana(this.mana); + } + + @Override + public String getRule() { + return "Spend this mana only to cast artifact spells or activate abilities of artifacts"; + } +} + +class DustinGadgetGeniusConditionalMana extends ConditionalMana { + + DustinGadgetGeniusConditionalMana(Mana mana) { + super(mana); + addCondition(DustinGadgetGeniusCondition.instance); + } +} + +enum DustinGadgetGeniusCondition implements Condition { + instance; + + @Override + public boolean apply(Game game, Ability source) { + MageObject object = game.getObject(source.getSourceId()); + return object != null && object.isArtifact(game); + } +} diff --git a/Mage.Sets/src/mage/sets/SecretLairDrop.java b/Mage.Sets/src/mage/sets/SecretLairDrop.java index 110bfb0602..be40b557ff 100644 --- a/Mage.Sets/src/mage/sets/SecretLairDrop.java +++ b/Mage.Sets/src/mage/sets/SecretLairDrop.java @@ -274,6 +274,7 @@ public class SecretLairDrop extends ExpansionSet { cards.add(new SetCardInfo("Impact Tremors", 313, Rarity.RARE, mage.cards.i.ImpactTremors.class)); cards.add(new SetCardInfo("Primal Vigor", 314, Rarity.RARE, mage.cards.p.PrimalVigor.class)); cards.add(new SetCardInfo("Commander's Sphere", 315, Rarity.RARE, mage.cards.c.CommandersSphere.class, NON_FULL_USE_VARIOUS)); + cards.add(new SetCardInfo("Dustin, Gadget Genius", 342, Rarity.RARE, mage.cards.d.DustinGadgetGenius.class)); cards.add(new SetCardInfo("Generous Gift", 369, Rarity.RARE, mage.cards.g.GenerousGift.class)); cards.add(new SetCardInfo("Chain Lightning", 370, Rarity.RARE, mage.cards.c.ChainLightning.class)); cards.add(new SetCardInfo("Kodama's Reach", 371, Rarity.RARE, mage.cards.k.KodamasReach.class)); diff --git a/Mage/src/main/java/mage/abilities/keyword/FriendsForeverAbility.java b/Mage/src/main/java/mage/abilities/keyword/FriendsForeverAbility.java new file mode 100644 index 0000000000..f53cf3d2ec --- /dev/null +++ b/Mage/src/main/java/mage/abilities/keyword/FriendsForeverAbility.java @@ -0,0 +1,37 @@ +package mage.abilities.keyword; + +import mage.abilities.MageSingleton; +import mage.abilities.StaticAbility; +import mage.constants.Zone; + +import java.io.ObjectStreamException; + +/** + * @author TheElk801 + */ +public class FriendsForeverAbility extends StaticAbility implements MageSingleton { + + private static final FriendsForeverAbility instance = new FriendsForeverAbility(); + + private Object readResolve() throws ObjectStreamException { + return instance; + } + + public static FriendsForeverAbility getInstance() { + return instance; + } + + private FriendsForeverAbility() { + super(Zone.BATTLEFIELD, null); + } + + @Override + public String getRule() { + return "Friends forever (You can have two commanders if both have friends forever.)"; + } + + @Override + public FriendsForeverAbility copy() { + return instance; + } +} diff --git a/Utils/keywords.txt b/Utils/keywords.txt index 617997e4f4..f49a139f7b 100644 --- a/Utils/keywords.txt +++ b/Utils/keywords.txt @@ -48,6 +48,7 @@ Flying|instance| Forestcycling|cost| Forestwalk|new| Foretell|card, manaString| +Friends forever|instance| Haste|instance| Hexproof|instance| Improvise|new|