Implemented Vantress Gargoyle

This commit is contained in:
Evan Kranzler 2019-09-14 17:52:45 -04:00
parent 3867937b38
commit 4e974b0d3c
3 changed files with 100 additions and 12 deletions

View file

@ -10,7 +10,6 @@ import mage.cards.CardSetInfo;
import mage.constants.CardType; import mage.constants.CardType;
import mage.constants.Duration; import mage.constants.Duration;
import mage.constants.SubType; import mage.constants.SubType;
import mage.constants.Zone;
import mage.counters.CounterType; import mage.counters.CounterType;
import mage.game.Game; import mage.game.Game;
import mage.game.permanent.Permanent; import mage.game.permanent.Permanent;
@ -34,10 +33,10 @@ public final class ChainedThroatseeker extends CardImpl {
this.addAbility(InfectAbility.getInstance()); this.addAbility(InfectAbility.getInstance());
// Chained Throatseeker can't attack unless defending player is poisoned. // Chained Throatseeker can't attack unless defending player is poisoned.
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new ChainedThroatseekerCantAttackEffect())); this.addAbility(new SimpleStaticAbility(new ChainedThroatseekerCantAttackEffect()));
} }
public ChainedThroatseeker(final ChainedThroatseeker card) { private ChainedThroatseeker(final ChainedThroatseeker card) {
super(card); super(card);
} }
@ -49,12 +48,12 @@ public final class ChainedThroatseeker extends CardImpl {
class ChainedThroatseekerCantAttackEffect extends RestrictionEffect { class ChainedThroatseekerCantAttackEffect extends RestrictionEffect {
public ChainedThroatseekerCantAttackEffect() { ChainedThroatseekerCantAttackEffect() {
super(Duration.WhileOnBattlefield); super(Duration.WhileOnBattlefield);
staticText = "{this} can't attack unless defending player is poisoned"; staticText = "{this} can't attack unless defending player is poisoned";
} }
public ChainedThroatseekerCantAttackEffect(final ChainedThroatseekerCantAttackEffect effect) { private ChainedThroatseekerCantAttackEffect(final ChainedThroatseekerCantAttackEffect effect) {
super(effect); super(effect);
} }
@ -65,16 +64,12 @@ class ChainedThroatseekerCantAttackEffect extends RestrictionEffect {
@Override @Override
public boolean canAttack(Permanent attacker, UUID defenderId, Ability source, Game game, boolean canUseChooseDialogs) { public boolean canAttack(Permanent attacker, UUID defenderId, Ability source, Game game, boolean canUseChooseDialogs) {
Player targetPlayer = game.getPlayer(defenderId); Player targetPlayer = game.getPlayerOrPlaneswalkerController(defenderId);
if (targetPlayer != null) { return targetPlayer != null && targetPlayer.getCounters().containsKey(CounterType.POISON);
return targetPlayer.getCounters().containsKey(CounterType.POISON);
}
return false;
} }
@Override @Override
public ChainedThroatseekerCantAttackEffect copy() { public ChainedThroatseekerCantAttackEffect copy() {
return new ChainedThroatseekerCantAttackEffect(this); return new ChainedThroatseekerCantAttackEffect(this);
} }
} }

View file

@ -0,0 +1,92 @@
package mage.cards.v;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.common.SimpleActivatedAbility;
import mage.abilities.common.SimpleStaticAbility;
import mage.abilities.condition.Condition;
import mage.abilities.condition.common.CardsInHandCondition;
import mage.abilities.costs.common.TapSourceCost;
import mage.abilities.decorator.ConditionalContinuousEffect;
import mage.abilities.effects.RestrictionEffect;
import mage.abilities.effects.common.PutTopCardOfLibraryIntoGraveEachPlayerEffect;
import mage.abilities.effects.common.combat.CantBlockSourceEffect;
import mage.abilities.keyword.FlyingAbility;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.*;
import mage.game.Game;
import mage.game.permanent.Permanent;
import mage.players.Player;
import java.util.UUID;
/**
* @author TheElk801
*/
public final class VantressGargoyle extends CardImpl {
private static final Condition condition = new CardsInHandCondition(ComparisonType.FEWER_THAN, 4);
public VantressGargoyle(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.ARTIFACT, CardType.CREATURE}, "{1}{U}");
this.subtype.add(SubType.GARGOYLE);
this.power = new MageInt(5);
this.toughness = new MageInt(4);
// Flying
this.addAbility(FlyingAbility.getInstance());
// Vantress Gargoyle can't attack unless defending player has seven or more cards in their graveyard.
this.addAbility(new SimpleStaticAbility(new VantressGargoyleEffect()));
// Vantress Gargoyle can't block unless you have four or more cards in hand.
this.addAbility(new SimpleStaticAbility(new ConditionalContinuousEffect(
new CantBlockSourceEffect(Duration.WhileOnBattlefield), condition,
"{this} can't block unless you have four or more cards in hand"
)));
// {T}: Each player puts the top card of their library into their graveyard.
this.addAbility(new SimpleActivatedAbility(
new PutTopCardOfLibraryIntoGraveEachPlayerEffect(1, TargetController.ANY), new TapSourceCost()
));
}
private VantressGargoyle(final VantressGargoyle card) {
super(card);
}
@Override
public VantressGargoyle copy() {
return new VantressGargoyle(this);
}
}
class VantressGargoyleEffect extends RestrictionEffect {
VantressGargoyleEffect() {
super(Duration.WhileOnBattlefield);
staticText = "{this} can't attack unless defending player has seven or more cards in their graveyard";
}
private VantressGargoyleEffect(final VantressGargoyleEffect effect) {
super(effect);
}
@Override
public boolean applies(Permanent permanent, Ability source, Game game) {
return permanent.getId().equals(source.getSourceId());
}
@Override
public boolean canAttack(Permanent attacker, UUID defenderId, Ability source, Game game, boolean canUseChooseDialogs) {
Player player = game.getPlayerOrPlaneswalkerController(defenderId);
return player != null && player.getGraveyard().size() > 6;
}
@Override
public VantressGargoyleEffect copy() {
return new VantressGargoyleEffect(this);
}
}

View file

@ -186,6 +186,7 @@ public final class ThroneOfEldraine extends ExpansionSet {
cards.add(new SetCardInfo("Trapped in the Tower", 33, Rarity.COMMON, mage.cards.t.TrappedInTheTower.class)); cards.add(new SetCardInfo("Trapped in the Tower", 33, Rarity.COMMON, mage.cards.t.TrappedInTheTower.class));
cards.add(new SetCardInfo("True Love's Kiss", 34, Rarity.COMMON, mage.cards.t.TrueLovesKiss.class)); cards.add(new SetCardInfo("True Love's Kiss", 34, Rarity.COMMON, mage.cards.t.TrueLovesKiss.class));
cards.add(new SetCardInfo("Turn into a Pumpkin", 69, Rarity.UNCOMMON, mage.cards.t.TurnIntoAPumpkin.class)); cards.add(new SetCardInfo("Turn into a Pumpkin", 69, Rarity.UNCOMMON, mage.cards.t.TurnIntoAPumpkin.class));
cards.add(new SetCardInfo("Vantress Gargoyle", 71, Rarity.RARE, mage.cards.v.VantressGargoyle.class));
cards.add(new SetCardInfo("Venerable Knight", 35, Rarity.UNCOMMON, mage.cards.v.VenerableKnight.class)); cards.add(new SetCardInfo("Venerable Knight", 35, Rarity.UNCOMMON, mage.cards.v.VenerableKnight.class));
cards.add(new SetCardInfo("Wandermare", 204, Rarity.UNCOMMON, mage.cards.w.Wandermare.class)); cards.add(new SetCardInfo("Wandermare", 204, Rarity.UNCOMMON, mage.cards.w.Wandermare.class));
cards.add(new SetCardInfo("Weaselback Redcap", 148, Rarity.COMMON, mage.cards.w.WeaselbackRedcap.class)); cards.add(new SetCardInfo("Weaselback Redcap", 148, Rarity.COMMON, mage.cards.w.WeaselbackRedcap.class));