diff --git a/Mage.Sets/src/mage/cards/d/DalakosCrafterOfWonders.java b/Mage.Sets/src/mage/cards/d/DalakosCrafterOfWonders.java new file mode 100644 index 00000000000..4ced5b790c0 --- /dev/null +++ b/Mage.Sets/src/mage/cards/d/DalakosCrafterOfWonders.java @@ -0,0 +1,103 @@ +package mage.cards.d; + +import mage.ConditionalMana; +import mage.MageInt; +import mage.MageObject; +import mage.Mana; +import mage.abilities.Ability; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.condition.Condition; +import mage.abilities.costs.common.TapSourceCost; +import mage.abilities.effects.common.continuous.GainAbilityControlledEffect; +import mage.abilities.keyword.FlyingAbility; +import mage.abilities.keyword.HasteAbility; +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.Duration; +import mage.constants.SubType; +import mage.constants.SuperType; +import mage.filter.FilterPermanent; +import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.permanent.EquippedPredicate; +import mage.game.Game; + +import java.util.UUID; + +/** + * @author TheElk801 + */ +public final class DalakosCrafterOfWonders extends CardImpl { + + private static final FilterPermanent filter = new FilterCreaturePermanent("equipped creatures you control"); + + static { + filter.add(EquippedPredicate.instance); + } + + public DalakosCrafterOfWonders(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{1}{U}{R}"); + + this.addSuperType(SuperType.LEGENDARY); + this.subtype.add(SubType.MERFOLK); + this.subtype.add(SubType.ARTIFICER); + this.power = new MageInt(2); + this.toughness = new MageInt(4); + + // {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 DalakosCrafterOfWondersManaBuilder() + )); + + // Equipped creatures you control have flying and haste. + Ability ability = new SimpleStaticAbility(new GainAbilityControlledEffect( + FlyingAbility.getInstance(), Duration.WhileOnBattlefield, filter + )); + ability.addEffect(new GainAbilityControlledEffect( + HasteAbility.getInstance(), Duration.WhileOnBattlefield, filter + ).setText("and haste")); + this.addAbility(ability); + } + + private DalakosCrafterOfWonders(final DalakosCrafterOfWonders card) { + super(card); + } + + @Override + public DalakosCrafterOfWonders copy() { + return new DalakosCrafterOfWonders(this); + } +} + +class DalakosCrafterOfWondersManaBuilder extends ConditionalManaBuilder { + + @Override + public ConditionalMana build(Object... options) { + return new DalakosCrafterOfWondersConditionalMana(this.mana); + } + + @Override + public String getRule() { + return "Spend this mana only to cast artifact spells or activate abilities of artifacts"; + } +} + +class DalakosCrafterOfWondersConditionalMana extends ConditionalMana { + + DalakosCrafterOfWondersConditionalMana(Mana mana) { + super(mana); + addCondition(DalakosCrafterOfWondersCondition.instance); + } +} + +enum DalakosCrafterOfWondersCondition implements Condition { + instance; + + @Override + public boolean apply(Game game, Ability source) { + MageObject object = game.getObject(source.getSourceId()); + return object != null && object.isArtifact(); + } +} \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/TherosBeyondDeath.java b/Mage.Sets/src/mage/sets/TherosBeyondDeath.java index 6019a864af5..d6e67fe4b1d 100644 --- a/Mage.Sets/src/mage/sets/TherosBeyondDeath.java +++ b/Mage.Sets/src/mage/sets/TherosBeyondDeath.java @@ -38,6 +38,7 @@ public final class TherosBeyondDeath extends ExpansionSet { cards.add(new SetCardInfo("Chainweb Aracnir", 167, Rarity.UNCOMMON, mage.cards.c.ChainwebAracnir.class)); cards.add(new SetCardInfo("Cling to Dust", 87, Rarity.UNCOMMON, mage.cards.c.ClingToDust.class)); cards.add(new SetCardInfo("Commanding Presence", 7, Rarity.UNCOMMON, mage.cards.c.CommandingPresence.class)); + cards.add(new SetCardInfo("Dalakos, Crafter of Wonders", 212, Rarity.RARE, mage.cards.d.DalakosCrafterOfWonders.class)); cards.add(new SetCardInfo("Daxos, Blessed by the Sun", 9, Rarity.UNCOMMON, mage.cards.d.DaxosBlessedByTheSun.class)); cards.add(new SetCardInfo("Deathbellow War Cry", 294, Rarity.RARE, mage.cards.d.DeathbellowWarCry.class)); cards.add(new SetCardInfo("Demon of Loathing", 292, Rarity.RARE, mage.cards.d.DemonOfLoathing.class));