[40K] Implemented Their Number Is Legion

This commit is contained in:
Evan Kranzler 2022-10-04 21:40:42 -04:00
parent f2a476437e
commit d21f2e43dd
5 changed files with 117 additions and 87 deletions

View file

@ -1,20 +1,17 @@
package mage.cards.h;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.common.MayCastFromGraveyardSourceAbility;
import mage.abilities.common.SimpleStaticAbility;
import mage.abilities.effects.AsThoughEffectImpl;
import mage.abilities.effects.common.InfoEffect;
import mage.abilities.keyword.ConvokeAbility;
import mage.abilities.keyword.DelveAbility;
import mage.abilities.keyword.TrampleAbility;
import mage.cards.Card;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.*;
import mage.filter.FilterPermanent;
import mage.filter.predicate.mageobject.ManaValuePredicate;
import mage.game.Game;
import java.util.UUID;
@ -51,7 +48,7 @@ public final class HogaakArisenNecropolis extends CardImpl {
this.addAbility(new DelveAbility());
// You may cast Hogaak, Arisen Necropolis from your graveyard.
this.addAbility(new SimpleStaticAbility(Zone.GRAVEYARD, new HogaakArisenNecropolisEffect()));
this.addAbility(new MayCastFromGraveyardSourceAbility());
// Trample
this.addAbility(TrampleAbility.getInstance());
@ -66,37 +63,3 @@ public final class HogaakArisenNecropolis extends CardImpl {
return new HogaakArisenNecropolis(this);
}
}
class HogaakArisenNecropolisEffect extends AsThoughEffectImpl {
HogaakArisenNecropolisEffect() {
super(AsThoughEffectType.PLAY_FROM_NOT_OWN_HAND_ZONE, Duration.EndOfGame, Outcome.PutCreatureInPlay);
staticText = "You may cast {this} from your graveyard";
}
private HogaakArisenNecropolisEffect(final HogaakArisenNecropolisEffect effect) {
super(effect);
}
@Override
public boolean apply(Game game, Ability source) {
return true;
}
@Override
public HogaakArisenNecropolisEffect copy() {
return new HogaakArisenNecropolisEffect(this);
}
@Override
public boolean applies(UUID objectId, Ability source, UUID affectedControllerId, Game game) {
if (objectId.equals(source.getSourceId())
&& affectedControllerId.equals(source.getControllerId())) {
Card card = game.getCard(source.getSourceId());
if (card != null && game.getState().getZone(source.getSourceId()) == Zone.GRAVEYARD) {
return true;
}
}
return false;
}
}

View file

@ -1,28 +1,19 @@
package mage.cards.s;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.common.SimpleStaticAbility;
import mage.abilities.common.MayCastFromGraveyardSourceAbility;
import mage.abilities.costs.common.ExileFromGraveCost;
import mage.abilities.effects.AsThoughEffectImpl;
import mage.abilities.keyword.FlyingAbility;
import mage.cards.Card;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.AsThoughEffectType;
import mage.constants.CardType;
import mage.constants.Duration;
import mage.constants.Outcome;
import mage.constants.SubType;
import mage.constants.Zone;
import mage.filter.StaticFilters;
import mage.game.Game;
import mage.target.common.TargetCardInYourGraveyard;
import java.util.UUID;
/**
*
* @author Alvin
*/
public final class SkaabRuinator extends CardImpl {
@ -36,13 +27,15 @@ public final class SkaabRuinator extends CardImpl {
this.toughness = new MageInt(6);
// As an additional cost to cast Skaab Ruinator, exile three creature cards from your graveyard.
this.getSpellAbility().addCost(new ExileFromGraveCost(new TargetCardInYourGraveyard(3, 3, StaticFilters.FILTER_CARD_CREATURE_YOUR_GRAVEYARD)));
this.getSpellAbility().addCost(new ExileFromGraveCost(new TargetCardInYourGraveyard(
3, StaticFilters.FILTER_CARD_CREATURE_YOUR_GRAVEYARD
)));
// Flying
this.addAbility(FlyingAbility.getInstance());
// You may cast Skaab Ruinator from your graveyard.
this.addAbility(new SimpleStaticAbility(Zone.GRAVEYARD, new SkaabRuinatorPlayEffect()));
this.addAbility(new MayCastFromGraveyardSourceAbility());
}
private SkaabRuinator(final SkaabRuinator card) {
@ -54,37 +47,3 @@ public final class SkaabRuinator extends CardImpl {
return new SkaabRuinator(this);
}
}
class SkaabRuinatorPlayEffect extends AsThoughEffectImpl {
public SkaabRuinatorPlayEffect() {
super(AsThoughEffectType.PLAY_FROM_NOT_OWN_HAND_ZONE, Duration.EndOfGame, Outcome.PutCreatureInPlay);
staticText = "You may cast {this} from your graveyard";
}
public SkaabRuinatorPlayEffect(final SkaabRuinatorPlayEffect effect) {
super(effect);
}
@Override
public boolean apply(Game game, Ability source) {
return true;
}
@Override
public SkaabRuinatorPlayEffect copy() {
return new SkaabRuinatorPlayEffect(this);
}
@Override
public boolean applies(UUID objectId, Ability source, UUID affectedControllerId, Game game) {
if (objectId.equals(source.getSourceId())
&& affectedControllerId.equals(source.getControllerId())) {
Card card = game.getCard(source.getSourceId());
if (card != null && game.getState().getZone(source.getSourceId()) == Zone.GRAVEYARD) {
return true;
}
}
return false;
}
}

View file

@ -0,0 +1,44 @@
package mage.cards.t;
import mage.abilities.common.MayCastFromGraveyardSourceAbility;
import mage.abilities.dynamicvalue.common.ArtifactYouControlCount;
import mage.abilities.dynamicvalue.common.ManacostVariableValue;
import mage.abilities.effects.common.CreateTokenEffect;
import mage.abilities.effects.common.ExileSpellEffect;
import mage.abilities.effects.common.GainLifeEffect;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.game.permanent.token.NecronWarriorToken;
import java.util.UUID;
/**
* @author TheElk801
*/
public final class TheirNumberIsLegion extends CardImpl {
public TheirNumberIsLegion(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{X}{B}{B}{B}{B}");
// Create X tapped 2/2 black Necron Warrior artifact creature tokens, then you gain life equal to the number of artifacts you control. Exile Their Number Is Legion.
this.getSpellAbility().addEffect(new CreateTokenEffect(
new NecronWarriorToken(), ManacostVariableValue.REGULAR
));
this.getSpellAbility().addEffect(new GainLifeEffect(ArtifactYouControlCount.instance)
.setText(", then you gain life equal to the number of artifacts you control"));
this.getSpellAbility().addEffect(new ExileSpellEffect());
// You may cast Their Number Is Legion from your graveyard.
this.addAbility(new MayCastFromGraveyardSourceAbility());
}
private TheirNumberIsLegion(final TheirNumberIsLegion card) {
super(card);
}
@Override
public TheirNumberIsLegion copy() {
return new TheirNumberIsLegion(this);
}
}

View file

@ -220,6 +220,7 @@ public final class Warhammer40000 extends ExpansionSet {
cards.add(new SetCardInfo("Tervigon", 100, Rarity.RARE, mage.cards.t.Tervigon.class));
cards.add(new SetCardInfo("The Swarmlord", 4, Rarity.MYTHIC, mage.cards.t.TheSwarmlord.class));
cards.add(new SetCardInfo("Their Name Is Death", 62, Rarity.RARE, mage.cards.t.TheirNameIsDeath.class));
cards.add(new SetCardInfo("Their Number Is Legion", 63, Rarity.RARE, mage.cards.t.TheirNumberIsLegion.class));
cards.add(new SetCardInfo("Thornwood Falls", 302, Rarity.COMMON, mage.cards.t.ThornwoodFalls.class));
cards.add(new SetCardInfo("Thought Vessel", 259, Rarity.COMMON, mage.cards.t.ThoughtVessel.class));
cards.add(new SetCardInfo("Thunderhawk Gunship", 167, Rarity.RARE, mage.cards.t.ThunderhawkGunship.class));

View file

@ -0,0 +1,63 @@
package mage.abilities.common;
import mage.abilities.Ability;
import mage.abilities.StaticAbility;
import mage.abilities.effects.AsThoughEffectImpl;
import mage.cards.Card;
import mage.constants.AsThoughEffectType;
import mage.constants.Duration;
import mage.constants.Outcome;
import mage.constants.Zone;
import mage.game.Game;
import java.util.UUID;
/**
* @author TheElk801
*/
public class MayCastFromGraveyardSourceAbility extends StaticAbility {
public MayCastFromGraveyardSourceAbility() {
super(Zone.GRAVEYARD, new MayCastFromGraveyardEffect());
}
private MayCastFromGraveyardSourceAbility(final MayCastFromGraveyardSourceAbility ability) {
super(ability);
}
@Override
public MayCastFromGraveyardSourceAbility copy() {
return new MayCastFromGraveyardSourceAbility(this);
}
}
class MayCastFromGraveyardEffect extends AsThoughEffectImpl {
MayCastFromGraveyardEffect() {
super(AsThoughEffectType.PLAY_FROM_NOT_OWN_HAND_ZONE, Duration.EndOfGame, Outcome.PutCreatureInPlay);
staticText = "you may cast {this} from your graveyard";
}
private MayCastFromGraveyardEffect(final MayCastFromGraveyardEffect effect) {
super(effect);
}
@Override
public boolean apply(Game game, Ability source) {
return true;
}
@Override
public MayCastFromGraveyardEffect copy() {
return new MayCastFromGraveyardEffect(this);
}
@Override
public boolean applies(UUID objectId, Ability source, UUID affectedControllerId, Game game) {
if (!objectId.equals(source.getSourceId()) || !source.isControlledBy(affectedControllerId)) {
return false;
}
Card card = game.getCard(source.getSourceId());
return card != null && game.getState().getZone(source.getSourceId()) == Zone.GRAVEYARD;
}
}