[MKM] Implement Goblin Maskmaker (#11884)

* [MKM] Implement Goblin Maskmaker
This commit is contained in:
Matthew Wilson 2024-03-01 18:58:32 +02:00 committed by GitHub
parent 4556af26a2
commit 82e968a97e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 75 additions and 0 deletions

View file

@ -0,0 +1,74 @@
package mage.cards.g;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.SpellAbility;
import mage.abilities.common.AttacksTriggeredAbility;
import mage.abilities.effects.common.cost.SpellsCostReductionControllerEffect;
import mage.constants.Duration;
import mage.constants.SubType;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.filter.FilterCard;
import mage.game.Game;
/**
*
* @author DominionSpy
*/
public final class GoblinMaskmaker extends CardImpl {
public GoblinMaskmaker(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{R}");
this.subtype.add(SubType.GOBLIN);
this.subtype.add(SubType.CITIZEN);
this.power = new MageInt(1);
this.toughness = new MageInt(2);
// Whenever Goblin Maskmaker attacks, face-down spells you cast this turn cost {1} less to cast.
this.addAbility(new AttacksTriggeredAbility(new GoblinMaskmakerEffect()));
}
private GoblinMaskmaker(final GoblinMaskmaker card) {
super(card);
}
@Override
public GoblinMaskmaker copy() {
return new GoblinMaskmaker(this);
}
}
class GoblinMaskmakerEffect extends SpellsCostReductionControllerEffect {
private static final FilterCard filter = new FilterCard("face-down spells");
GoblinMaskmakerEffect() {
super(filter, 1);
this.duration = Duration.EndOfTurn;
this.staticText = "face-down spells you cast this turn cost {1} less to cast";
}
private GoblinMaskmakerEffect(final GoblinMaskmakerEffect effect) {
super(effect);
}
@Override
public GoblinMaskmakerEffect copy() {
return new GoblinMaskmakerEffect(this);
}
@Override
public boolean applies(Ability abilityToModify, Ability source, Game game) {
if (abilityToModify instanceof SpellAbility) {
SpellAbility spellAbility = (SpellAbility) abilityToModify;
if (spellAbility.getSpellAbilityCastMode().isFaceDown()) {
return super.applies(abilityToModify, source, game);
}
}
return false;
}
}

View file

@ -123,6 +123,7 @@ public final class MurdersAtKarlovManor extends ExpansionSet {
cards.add(new SetCardInfo("Get a Leg Up", 161, Rarity.UNCOMMON, mage.cards.g.GetALegUp.class));
cards.add(new SetCardInfo("Gleaming Geardrake", 205, Rarity.UNCOMMON, mage.cards.g.GleamingGeardrake.class));
cards.add(new SetCardInfo("Glint Weaver", 162, Rarity.UNCOMMON, mage.cards.g.GlintWeaver.class));
cards.add(new SetCardInfo("Goblin Maskmaker", 130, Rarity.COMMON, mage.cards.g.GoblinMaskmaker.class));
cards.add(new SetCardInfo("Granite Witness", 206, Rarity.COMMON, mage.cards.g.GraniteWitness.class));
cards.add(new SetCardInfo("Gravestone Strider", 252, Rarity.COMMON, mage.cards.g.GravestoneStrider.class));
cards.add(new SetCardInfo("Greenbelt Radical", 163, Rarity.UNCOMMON, mage.cards.g.GreenbeltRadical.class));