mirror of
https://github.com/magefree/mage.git
synced 2026-01-10 21:02:08 -08:00
implement [DSK] Irreverent Gremlin (#13003)
* Add Irreverent Gremlin (DSK) * Fix formatting * Add Menace ability comment * Fix Irreverent Gremlin's card draw trigger * fix optional setting --------- Co-authored-by: xenohedron <xenohedron@users.noreply.github.com>
This commit is contained in:
parent
3265b9a060
commit
06f630b00a
3 changed files with 65 additions and 1 deletions
63
Mage.Sets/src/mage/cards/i/IrreverentGremlin.java
Normal file
63
Mage.Sets/src/mage/cards/i/IrreverentGremlin.java
Normal file
|
|
@ -0,0 +1,63 @@
|
|||
package mage.cards.i;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
import mage.MageInt;
|
||||
import mage.abilities.common.EntersBattlefieldAllTriggeredAbility;
|
||||
import mage.abilities.costs.common.DiscardCardCost;
|
||||
import mage.abilities.effects.common.DoIfCostPaid;
|
||||
import mage.abilities.effects.common.DrawCardSourceControllerEffect;
|
||||
import mage.abilities.keyword.MenaceAbility;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.ComparisonType;
|
||||
import mage.constants.SubType;
|
||||
import mage.filter.FilterPermanent;
|
||||
import mage.filter.common.FilterControlledCreaturePermanent;
|
||||
import mage.filter.predicate.mageobject.AnotherPredicate;
|
||||
import mage.filter.predicate.mageobject.PowerPredicate;
|
||||
|
||||
/**
|
||||
* @author paasar
|
||||
*/
|
||||
public final class IrreverentGremlin extends CardImpl {
|
||||
private static final FilterPermanent filter
|
||||
= new FilterControlledCreaturePermanent("another creature you control with power 2 or less");
|
||||
|
||||
static {
|
||||
filter.add(AnotherPredicate.instance);
|
||||
filter.add(new PowerPredicate(ComparisonType.FEWER_THAN, 3));
|
||||
}
|
||||
|
||||
public IrreverentGremlin(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{1}{R}");
|
||||
|
||||
this.subtype.add(SubType.GREMLIN);
|
||||
this.power = new MageInt(2);
|
||||
this.toughness = new MageInt(2);
|
||||
|
||||
// Menace (This creature can't be blocked except by two or more creatures.)
|
||||
this.addAbility(new MenaceAbility());
|
||||
|
||||
// Whenever another creature you control with power 2 or less enters, you may discard a card. If you do, draw a card. Do this only once each turn.
|
||||
this.addAbility(
|
||||
new EntersBattlefieldAllTriggeredAbility(
|
||||
new DoIfCostPaid(
|
||||
new DrawCardSourceControllerEffect(1),
|
||||
new DiscardCardCost(),
|
||||
null,
|
||||
false), // since triggered ability is optional (do only once), DoIfCostPaid must not be
|
||||
filter)
|
||||
.setDoOnlyOnceEachTurn(true));
|
||||
}
|
||||
|
||||
private IrreverentGremlin(final IrreverentGremlin card) {
|
||||
super(card);
|
||||
}
|
||||
|
||||
@Override
|
||||
public IrreverentGremlin copy() {
|
||||
return new IrreverentGremlin(this);
|
||||
}
|
||||
}
|
||||
|
|
@ -124,6 +124,7 @@ public final class DuskmournHouseOfHorror extends ExpansionSet {
|
|||
cards.add(new SetCardInfo("Innocuous Rat", 103, Rarity.COMMON, mage.cards.i.InnocuousRat.class));
|
||||
cards.add(new SetCardInfo("Insidious Fungus", 186, Rarity.UNCOMMON, mage.cards.i.InsidiousFungus.class));
|
||||
cards.add(new SetCardInfo("Intruding Soulrager", 218, Rarity.UNCOMMON, mage.cards.i.IntrudingSoulrager.class));
|
||||
cards.add(new SetCardInfo("Irreverent Gremlin", 142, Rarity.UNCOMMON, mage.cards.i.IrreverentGremlin.class));
|
||||
cards.add(new SetCardInfo("Island", 273, Rarity.LAND, mage.cards.basiclands.Island.class, FULL_ART_BFZ_VARIOUS));
|
||||
cards.add(new SetCardInfo("Jump Scare", 17, Rarity.COMMON, mage.cards.j.JumpScare.class));
|
||||
cards.add(new SetCardInfo("Killer's Mask", 104, Rarity.UNCOMMON, mage.cards.k.KillersMask.class));
|
||||
|
|
|
|||
|
|
@ -163,8 +163,8 @@ public abstract class TriggeredAbilityImpl extends AbilityImpl implements Trigge
|
|||
|
||||
@Override
|
||||
public TriggeredAbility setDoOnlyOnceEachTurn(boolean doOnlyOnce) {
|
||||
this.optional = true;
|
||||
this.doOnlyOnceEachTurn = doOnlyOnce;
|
||||
setOptional();
|
||||
return this;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue