- Added Viashino Bey, Lurking Skirge, and Opal Avenger. Urza's Legacy Set 100% done.

This commit is contained in:
Jeff 2018-11-15 19:09:23 -06:00
parent f4f24502f4
commit fab9a79443
5 changed files with 459 additions and 172 deletions

View file

@ -0,0 +1,71 @@
package mage.cards.l;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.TriggeredAbility;
import mage.abilities.common.PutIntoGraveFromBattlefieldAllTriggeredAbility;
import mage.abilities.condition.common.SourceMatchesFilterCondition;
import mage.abilities.decorator.ConditionalInterveningIfTriggeredAbility;
import mage.abilities.effects.common.continuous.BecomesCreatureSourceEffect;
import mage.abilities.keyword.FlyingAbility;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.Duration;
import mage.constants.SubType;
import mage.constants.TargetController;
import mage.filter.StaticFilters;
import mage.filter.common.FilterCreaturePermanent;
import mage.filter.predicate.other.OwnerPredicate;
import mage.game.permanent.token.TokenImpl;
/**
*
* @author jeffwadsworth
*/
public final class LurkingSkirge extends CardImpl {
private static final FilterCreaturePermanent filter = new FilterCreaturePermanent();
static {
filter.add(new OwnerPredicate(TargetController.OPPONENT));
}
public LurkingSkirge(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{1}{B}");
// When a creature is put into an opponent's graveyard from the battlefield, if Lurking Skirge is an enchantment, Lurking Skirge becomes a 3/2 Imp creature with flying.
TriggeredAbility ability = new PutIntoGraveFromBattlefieldAllTriggeredAbility(new BecomesCreatureSourceEffect(new LurkingSkirgeToken(), "", Duration.WhileOnBattlefield, true, false), false, filter, false);
this.addAbility(new ConditionalInterveningIfTriggeredAbility(ability, new SourceMatchesFilterCondition(StaticFilters.FILTER_ENCHANTMENT_PERMANENT),
"When a creature is put into an opponent's graveyard from the battlefield, if {this} is an enchantment, {this} becomes a 3/2 Imp creature with flying."));
}
public LurkingSkirge(final LurkingSkirge card) {
super(card);
}
@Override
public LurkingSkirge copy() {
return new LurkingSkirge(this);
}
}
class LurkingSkirgeToken extends TokenImpl {
public LurkingSkirgeToken() {
super("Imp", "3/2 Imp with flying.");
cardType.add(CardType.CREATURE);
subtype.add(SubType.IMP);
power = new MageInt(3);
toughness = new MageInt(2);
this.addAbility(FlyingAbility.getInstance());
}
public LurkingSkirgeToken(final LurkingSkirgeToken token) {
super(token);
}
public LurkingSkirgeToken copy() {
return new LurkingSkirgeToken(this);
}
}

View file

@ -0,0 +1,120 @@
package mage.cards.o;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.StateTriggeredAbility;
import mage.abilities.effects.common.continuous.BecomesCreatureSourceEffect;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.Duration;
import mage.constants.SubType;
import mage.constants.Zone;
import mage.game.Game;
import mage.game.events.GameEvent;
import mage.game.permanent.token.TokenImpl;
/**
*
* @author jeffwadsworth
*/
public final class OpalAvenger extends CardImpl {
public OpalAvenger(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{2}{W}");
// When you have 10 or less life, if Opal Avenger is an enchantment, Opal Avenger becomes a 3/5 Soldier creature.
this.addAbility(new OpalAvengerStateTriggeredAbility());
}
public OpalAvenger(final OpalAvenger card) {
super(card);
}
@Override
public OpalAvenger copy() {
return new OpalAvenger(this);
}
}
class OpalAvengerStateTriggeredAbility extends StateTriggeredAbility {
public OpalAvengerStateTriggeredAbility() {
super(Zone.BATTLEFIELD, new BecomesCreatureSourceEffect(new OpalAvengerToken(), "", Duration.Custom, true, false));
}
public OpalAvengerStateTriggeredAbility(final OpalAvengerStateTriggeredAbility ability) {
super(ability);
}
@Override
public OpalAvengerStateTriggeredAbility copy() {
return new OpalAvengerStateTriggeredAbility(this);
}
@Override
public boolean checkTrigger(GameEvent event, Game game) {
return game.getState().getPlayer(getControllerId()).getLife() <= 10;
}
@Override
public boolean checkInterveningIfClause(Game game) {
return this.getSourcePermanentIfItStillExists(game).getCardType().contains(CardType.ENCHANTMENT);
}
@Override
public boolean canTrigger(Game game) {
//20100716 - 603.8
Boolean triggered = (Boolean) game.getState().getValue(getSourceId().toString() + "triggered");
if (triggered == null) {
triggered = Boolean.FALSE;
}
return !triggered;
}
@Override
public void trigger(Game game, UUID controllerId) {
//20100716 - 603.8
game.getState().setValue(this.getSourceId().toString() + "triggered", Boolean.TRUE);
super.trigger(game, controllerId);
}
@Override
public boolean resolve(Game game) {
//20100716 - 603.8
boolean result = super.resolve(game);
game.getState().setValue(this.getSourceId().toString() + "triggered", Boolean.FALSE);
return result;
}
@Override
public void counter(Game game) {
game.getState().setValue(this.getSourceId().toString() + "triggered", Boolean.FALSE);
}
@Override
public String getRule() {
return new StringBuilder("When you have 10 or less life, if {this} is an enchantment, ").append(super.getRule()).toString();
}
}
class OpalAvengerToken extends TokenImpl {
public OpalAvengerToken() {
super("Soldier", "3/5 Soldier creature");
cardType.add(CardType.CREATURE);
subtype.add(SubType.SOLDIER);
power = new MageInt(3);
toughness = new MageInt(5);
}
public OpalAvengerToken(final OpalAvengerToken token) {
super(token);
}
@Override
public OpalAvengerToken copy() {
return new OpalAvengerToken(this);
}
}

View file

@ -80,6 +80,7 @@ class VeiledSentryEffect extends ContinuousEffectImpl {
switch (layer) { switch (layer) {
case TypeChangingEffects_4: case TypeChangingEffects_4:
if (sublayer == SubLayer.NA) { if (sublayer == SubLayer.NA) {
veiledSentry.getCardType().clear();
if (!veiledSentry.isCreature()) { if (!veiledSentry.isCreature()) {
veiledSentry.addCardType(CardType.CREATURE); veiledSentry.addCardType(CardType.CREATURE);
} }

View file

@ -0,0 +1,92 @@
package mage.cards.v;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.common.AttacksTriggeredAbility;
import mage.abilities.effects.OneShotEffect;
import mage.constants.SubType;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.Outcome;
import mage.constants.TargetController;
import mage.filter.common.FilterCreaturePermanent;
import mage.filter.predicate.permanent.ControllerPredicate;
import mage.game.Game;
import mage.players.Player;
import mage.target.common.TargetOpponent;
/**
*
* @author jeffwadsworth
*/
public final class ViashinoBey extends CardImpl {
private static final String rule = "If {this} attacks, all creatures you control attack if able.";
private static final FilterCreaturePermanent filter = new FilterCreaturePermanent();
static {
filter.add(new ControllerPredicate(TargetController.YOU));
}
public ViashinoBey(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{2}{R}{R}");
this.subtype.add(SubType.VIASHINO);
this.power = new MageInt(4);
this.toughness = new MageInt(3);
// If Viashino Bey attacks, all creatures you control attack if able.
this.addAbility(new AttacksTriggeredAbility(new ViashinoBeyEffect(), false, rule));
}
public ViashinoBey(final ViashinoBey card) {
super(card);
}
@Override
public ViashinoBey copy() {
return new ViashinoBey(this);
}
}
class ViashinoBeyEffect extends OneShotEffect {
private static final FilterCreaturePermanent filter = new FilterCreaturePermanent();
static {
filter.add(new ControllerPredicate(TargetController.YOU));
}
public ViashinoBeyEffect() {
super(Outcome.Benefit);
}
public ViashinoBeyEffect(final ViashinoBeyEffect effect) {
super(effect);
}
@Override
public boolean apply(Game game, Ability source) {
Player controller = game.getPlayer(source.getControllerId());
TargetOpponent targetDefender = new TargetOpponent();
if (controller != null) {
game.getBattlefield().getAllActivePermanents(CardType.CREATURE).stream().filter((permanent) -> (filter.match(permanent, source.getSourceId(), source.getControllerId(), game))).forEachOrdered((permanent) -> {
if (game.getOpponents(controller.getId()).size() > 1) {
controller.choose(outcome.Benefit, targetDefender, source.getSourceId(), game);
} else {
targetDefender.add(game.getOpponents(controller.getId()).iterator().next(), game);
}
controller.declareAttacker(permanent.getId(), targetDefender.getFirstTarget(), game, false);
});
}
return false;
}
@Override
public ViashinoBeyEffect copy() {
return new ViashinoBeyEffect(this);
}
}

View file

@ -89,6 +89,7 @@ public final class UrzasLegacy extends ExpansionSet {
cards.add(new SetCardInfo("Lava Axe", 84, Rarity.COMMON, mage.cards.l.LavaAxe.class)); cards.add(new SetCardInfo("Lava Axe", 84, Rarity.COMMON, mage.cards.l.LavaAxe.class));
cards.add(new SetCardInfo("Levitation", 35, Rarity.UNCOMMON, mage.cards.l.Levitation.class)); cards.add(new SetCardInfo("Levitation", 35, Rarity.UNCOMMON, mage.cards.l.Levitation.class));
cards.add(new SetCardInfo("Lone Wolf", 105, Rarity.UNCOMMON, mage.cards.l.LoneWolf.class)); cards.add(new SetCardInfo("Lone Wolf", 105, Rarity.UNCOMMON, mage.cards.l.LoneWolf.class));
cards.add(new SetCardInfo("Lurking Skirge", 55, Rarity.RARE, mage.cards.l.LurkingSkirge.class));
cards.add(new SetCardInfo("Martyr's Cause", 13, Rarity.UNCOMMON, mage.cards.m.MartyrsCause.class)); cards.add(new SetCardInfo("Martyr's Cause", 13, Rarity.UNCOMMON, mage.cards.m.MartyrsCause.class));
cards.add(new SetCardInfo("Memory Jar", 129, Rarity.RARE, mage.cards.m.MemoryJar.class)); cards.add(new SetCardInfo("Memory Jar", 129, Rarity.RARE, mage.cards.m.MemoryJar.class));
cards.add(new SetCardInfo("Might of Oaks", 106, Rarity.RARE, mage.cards.m.MightOfOaks.class)); cards.add(new SetCardInfo("Might of Oaks", 106, Rarity.RARE, mage.cards.m.MightOfOaks.class));
@ -99,6 +100,7 @@ public final class UrzasLegacy extends ExpansionSet {
cards.add(new SetCardInfo("Multani's Presence", 109, Rarity.UNCOMMON, mage.cards.m.MultanisPresence.class)); cards.add(new SetCardInfo("Multani's Presence", 109, Rarity.UNCOMMON, mage.cards.m.MultanisPresence.class));
cards.add(new SetCardInfo("Multani, Maro-Sorcerer", 107, Rarity.RARE, mage.cards.m.MultaniMaroSorcerer.class)); cards.add(new SetCardInfo("Multani, Maro-Sorcerer", 107, Rarity.RARE, mage.cards.m.MultaniMaroSorcerer.class));
cards.add(new SetCardInfo("No Mercy", 56, Rarity.RARE, mage.cards.n.NoMercy.class)); cards.add(new SetCardInfo("No Mercy", 56, Rarity.RARE, mage.cards.n.NoMercy.class));
cards.add(new SetCardInfo("Opal Avenger", 15, Rarity.RARE, mage.cards.o.OpalAvenger.class));
cards.add(new SetCardInfo("Opal Champion", 16, Rarity.COMMON, mage.cards.o.OpalChampion.class)); cards.add(new SetCardInfo("Opal Champion", 16, Rarity.COMMON, mage.cards.o.OpalChampion.class));
cards.add(new SetCardInfo("Opportunity", 37, Rarity.UNCOMMON, mage.cards.o.Opportunity.class)); cards.add(new SetCardInfo("Opportunity", 37, Rarity.UNCOMMON, mage.cards.o.Opportunity.class));
cards.add(new SetCardInfo("Ostracize", 57, Rarity.COMMON, mage.cards.o.Ostracize.class)); cards.add(new SetCardInfo("Ostracize", 57, Rarity.COMMON, mage.cards.o.Ostracize.class));
@ -155,6 +157,7 @@ public final class UrzasLegacy extends ExpansionSet {
cards.add(new SetCardInfo("Treetop Village", 143, Rarity.UNCOMMON, mage.cards.t.TreetopVillage.class)); cards.add(new SetCardInfo("Treetop Village", 143, Rarity.UNCOMMON, mage.cards.t.TreetopVillage.class));
cards.add(new SetCardInfo("Unearth", 72, Rarity.COMMON, mage.cards.u.Unearth.class)); cards.add(new SetCardInfo("Unearth", 72, Rarity.COMMON, mage.cards.u.Unearth.class));
cards.add(new SetCardInfo("Urza's Blueprints", 137, Rarity.RARE, mage.cards.u.UrzasBlueprints.class)); cards.add(new SetCardInfo("Urza's Blueprints", 137, Rarity.RARE, mage.cards.u.UrzasBlueprints.class));
cards.add(new SetCardInfo("Viashino Bey", 93, Rarity.COMMON, mage.cards.v.ViashinoBey.class));
cards.add(new SetCardInfo("Viashino Cutthroat", 94, Rarity.UNCOMMON, mage.cards.v.ViashinoCutthroat.class)); cards.add(new SetCardInfo("Viashino Cutthroat", 94, Rarity.UNCOMMON, mage.cards.v.ViashinoCutthroat.class));
cards.add(new SetCardInfo("Viashino Heretic", 95, Rarity.UNCOMMON, mage.cards.v.ViashinoHeretic.class)); cards.add(new SetCardInfo("Viashino Heretic", 95, Rarity.UNCOMMON, mage.cards.v.ViashinoHeretic.class));
cards.add(new SetCardInfo("Viashino Sandscout", 96, Rarity.COMMON, mage.cards.v.ViashinoSandscout.class)); cards.add(new SetCardInfo("Viashino Sandscout", 96, Rarity.COMMON, mage.cards.v.ViashinoSandscout.class));