mirror of
https://github.com/magefree/mage.git
synced 2026-01-26 21:29:17 -08:00
[DFT] Implement Webstrike Elite
This commit is contained in:
parent
d9280a1122
commit
a45511d7eb
2 changed files with 101 additions and 0 deletions
100
Mage.Sets/src/mage/cards/w/WebstrikeElite.java
Normal file
100
Mage.Sets/src/mage/cards/w/WebstrikeElite.java
Normal file
|
|
@ -0,0 +1,100 @@
|
|||
package mage.cards.w;
|
||||
|
||||
import mage.MageInt;
|
||||
import mage.abilities.common.ZoneChangeTriggeredAbility;
|
||||
import mage.abilities.costs.mana.ManaCostsImpl;
|
||||
import mage.abilities.dynamicvalue.common.GetXValue;
|
||||
import mage.abilities.keyword.CyclingAbility;
|
||||
import mage.abilities.keyword.ReachAbility;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.ComparisonType;
|
||||
import mage.constants.SubType;
|
||||
import mage.constants.Zone;
|
||||
import mage.filter.FilterPermanent;
|
||||
import mage.filter.common.FilterArtifactOrEnchantmentPermanent;
|
||||
import mage.filter.predicate.mageobject.ManaValuePredicate;
|
||||
import mage.game.Game;
|
||||
import mage.game.events.GameEvent;
|
||||
import mage.game.stack.StackObject;
|
||||
import mage.target.TargetPermanent;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
* @author TheElk801
|
||||
*/
|
||||
public final class WebstrikeElite extends CardImpl {
|
||||
|
||||
public WebstrikeElite(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{G}{G}");
|
||||
|
||||
this.subtype.add(SubType.INSECT);
|
||||
this.subtype.add(SubType.ARCHER);
|
||||
this.power = new MageInt(3);
|
||||
this.toughness = new MageInt(3);
|
||||
|
||||
// Reach
|
||||
this.addAbility(ReachAbility.getInstance());
|
||||
|
||||
// Cycling {X}{G}{G}
|
||||
this.addAbility(new CyclingAbility(new ManaCostsImpl<>("{X}{G}{G}")));
|
||||
|
||||
// When you cycle this card, destroy up to one target artifact or enchantment with mana value X.
|
||||
this.addAbility(new WebstrikeEliteTriggeredAbility());
|
||||
}
|
||||
|
||||
private WebstrikeElite(final WebstrikeElite card) {
|
||||
super(card);
|
||||
}
|
||||
|
||||
@Override
|
||||
public WebstrikeElite copy() {
|
||||
return new WebstrikeElite(this);
|
||||
}
|
||||
}
|
||||
|
||||
class WebstrikeEliteTriggeredAbility extends ZoneChangeTriggeredAbility {
|
||||
|
||||
WebstrikeEliteTriggeredAbility() {
|
||||
super(Zone.ALL, null, "", false);
|
||||
}
|
||||
|
||||
private WebstrikeEliteTriggeredAbility(final WebstrikeEliteTriggeredAbility ability) {
|
||||
super(ability);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean checkEventType(GameEvent event, Game game) {
|
||||
return event.getType() == GameEvent.EventType.ACTIVATED_ABILITY;
|
||||
}
|
||||
|
||||
@Override
|
||||
public WebstrikeEliteTriggeredAbility copy() {
|
||||
return new WebstrikeEliteTriggeredAbility(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean checkTrigger(GameEvent event, Game game) {
|
||||
if (!event.getSourceId().equals(this.getSourceId())) {
|
||||
return false;
|
||||
}
|
||||
StackObject object = game.getStack().getStackObject(event.getSourceId());
|
||||
if (object == null || !(object.getStackAbility() instanceof CyclingAbility)) {
|
||||
return false;
|
||||
}
|
||||
FilterPermanent filter = new FilterArtifactOrEnchantmentPermanent("artifact or enchantment with mana value X");
|
||||
filter.add(new ManaValuePredicate(
|
||||
ComparisonType.EQUAL_TO, GetXValue.instance.calculate(game, object.getStackAbility(), null)
|
||||
));
|
||||
this.getTargets().clear();
|
||||
this.addTarget(new TargetPermanent(0, 1, filter));
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getRule() {
|
||||
return "When you cycle this card, destroy up to one target artifact or enchantment with mana value X.";
|
||||
}
|
||||
}
|
||||
|
|
@ -239,6 +239,7 @@ public final class Aetherdrift extends ExpansionSet {
|
|||
cards.add(new SetCardInfo("Walking Sarcophagus", 246, Rarity.COMMON, mage.cards.w.WalkingSarcophagus.class));
|
||||
cards.add(new SetCardInfo("Wastewood Verge", 268, Rarity.RARE, mage.cards.w.WastewoodVerge.class));
|
||||
cards.add(new SetCardInfo("Waxen Shapethief", 74, Rarity.RARE, mage.cards.w.WaxenShapethief.class));
|
||||
cards.add(new SetCardInfo("Webstrike Elite", 186, Rarity.RARE, mage.cards.w.WebstrikeElite.class));
|
||||
cards.add(new SetCardInfo("Wild Roads", 269, Rarity.UNCOMMON, mage.cards.w.WildRoads.class));
|
||||
cards.add(new SetCardInfo("Willowrush Verge", 270, Rarity.RARE, mage.cards.w.WillowrushVerge.class));
|
||||
cards.add(new SetCardInfo("Wind-Scarred Crag", 271, Rarity.COMMON, mage.cards.w.WindScarredCrag.class));
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue