public RitualoftheReturned(GameState state) { super(state); // Exile target creature card from your graveyard. SetGenerator deadThings = Intersect.instance( HasType.instance(Type.CREATURE), InZone.instance(GraveyardOf.instance(You.instance()))); SetGenerator target = targetedBy( this.addTarget( deadThings, "Put a black Zombie creature token onto the battlefield. Its power is equal to that card's power and its toughness is equal to that card's toughness.")); EventFactory exile = exile(target, "Exile target creature card from your graveyard."); this.addEffect(exile); // Put a black Zombie creature token onto the battlefield. Its power is // equal to that card's power and its toughness is equal to that card's // toughness. SetGenerator thatCard = NewObjectOf.instance(EffectResult.instance(exile)); SetGenerator power = PowerOf.instance(thatCard); SetGenerator toughness = ToughnessOf.instance(thatCard); CreateTokensFactory zombie = new CreateTokensFactory( numberGenerator(1), power, toughness, "Put a black Zombie creature token onto the battlefield. Its power is equal to that card's power and its toughness is equal to that card's toughness."); zombie.setColors(Color.BLACK); zombie.setSubTypes(SubType.ZOMBIE); this.addEffect(zombie.getEventFactory()); }
public CellarDoorAbility0(GameState state) { super( state, "(3), (T): Target player puts the bottom card of his or her library into his or her graveyard. If it's a creature card, you put a 2/2 black Zombie creature token onto the battlefield."); this.setManaCost(new ManaPool("(3)")); this.costsTap = true; SetGenerator target = targetedBy(this.addTarget(Players.instance(), "target player")); SetGenerator library = LibraryOf.instance(target); EventFactory putIntoGraveyard = new EventFactory( EventType.MOVE_OBJECTS, "Target player puts the bottom card of his or her library into his or her graveyard."); putIntoGraveyard.parameters.put(EventType.Parameter.CAUSE, This.instance()); putIntoGraveyard.parameters.put(EventType.Parameter.TO, GraveyardOf.instance(target)); putIntoGraveyard.parameters.put(EventType.Parameter.OBJECT, BottomCards.instance(1, library)); this.addEffect(putIntoGraveyard); SetGenerator object = NewObjectOf.instance(EffectResult.instance(putIntoGraveyard)); SetGenerator isCreature = Intersect.instance(object, HasType.instance(Type.CREATURE)); CreateTokensFactory token = new CreateTokensFactory( 1, 2, 2, "you put a 2/2 black Zombie creature token onto the battlefield."); token.setColors(Color.BLACK); token.setSubTypes(SubType.ZOMBIE); this.addEffect( ifThen( isCreature, token.getEventFactory(), "If it's a creature card, you put a 2/2 black Zombie creature token onto the battlefield.")); }
public InfernalGenesisAbility0(GameState state) { super( state, "At the beginning of each player's upkeep, that player puts the top card of his or her library into his or her graveyard. Then he or she puts X 1/1 black Minion creature tokens onto the battlefield, where X is that card's converted mana cost."); this.addPattern(atTheBeginningOfEachPlayersUpkeep()); SetGenerator thatPlayer = OwnerOf.instance( EventParameter.instance( TriggerEvent.instance(This.instance()), EventType.Parameter.STEP)); EventFactory mill = millCards( thatPlayer, 1, "That player puts the top card of his or her library into his or her graveyard."); this.addEffect(mill); SetGenerator thatCard = NewObjectOf.instance(EffectResult.instance(mill)); SetGenerator X = ConvertedManaCostOf.instance(thatCard); CreateTokensFactory f = new CreateTokensFactory( X, numberGenerator(1), numberGenerator(1), "Then he or she puts X 1/1 black Minion creature tokens onto the battlefield, where X is that card's converted mana cost."); f.setController(thatPlayer); f.setColors(Color.BLACK); f.setSubTypes(SubType.MINION); this.addEffect(f.getEventFactory()); }
public ElspethTirelAbility1(GameState state) { super(state, -2, "Put three 1/1 white Soldier creature tokens onto the battlefield."); CreateTokensFactory factory = new CreateTokensFactory( 3, 1, 1, "Put three 1/1 white Soldier creature tokens onto the battlefield."); factory.setColors(Color.WHITE); factory.setSubTypes(SubType.SOLDIER); this.addEffect(factory.getEventFactory()); }
public BabyBoomers(GameState state) { super( state, "At the beginning of your upkeep, put a 1/1 white Human creature token onto the battlefield."); this.addPattern(atTheBeginningOfYourUpkeep()); CreateTokensFactory factory = new CreateTokensFactory( 1, 1, 1, "Put a 1/1 white Human creature token onto the battlefield."); factory.setColors(Color.WHITE); factory.setSubTypes(SubType.HUMAN); this.addEffect(factory.getEventFactory()); }
public MidnightHaunting(GameState state) { super(state); // Put two 1/1 white Spirit creature tokens with flying onto the // battlefield. CreateTokensFactory factory = new CreateTokensFactory( 2, 1, 1, "Put two 1/1 white Spirit creature tokens with flying onto the battlefield."); factory.setColors(Color.WHITE); factory.setSubTypes(SubType.SPIRIT); factory.addAbility(org.rnd.jmagic.abilities.keywords.Flying.class); this.addEffect(factory.getEventFactory()); }
public PrecinctCaptainAbility1(GameState state) { super( state, "Whenever Precinct Captain deals combat damage to a player, put a 1/1 white Soldier creature token onto the battlefield."); this.addPattern(whenThisDealsCombatDamageToAPlayer()); CreateTokensFactory token = new CreateTokensFactory( 1, 1, 1, "Put a 1/1 white Soldier creature token onto the battlefield."); token.setColors(Color.WHITE); token.setSubTypes(SubType.SOLDIER); this.addEffect(token.getEventFactory()); }
public RocEggAbility1(GameState state) { super( state, "When Roc Egg dies, put a 3/3 white Bird creature token with flying onto the battlefield."); this.addPattern(whenThisDies()); CreateTokensFactory token = new CreateTokensFactory( 1, 3, 3, "Put a 3/3 white Bird creature token with flying onto the battlefield."); token.setColors(Color.WHITE); token.setSubTypes(SubType.BIRD); token.addAbility(Flying.class); this.addEffect(token.getEventFactory()); }
public MoanoftheUnhallowed(GameState state) { super(state); // Put two 2/2 black Zombie creature tokens onto the battlefield. CreateTokensFactory factory = new CreateTokensFactory( 2, 2, 2, "Put two 2/2 black Zombie creature tokens onto the battlefield."); factory.setColors(Color.BLACK); factory.setSubTypes(SubType.ZOMBIE); this.addEffect(factory.getEventFactory()); // Flashback (5)(B)(B) (You may cast this card from your graveyard for // its flashback cost. Then exile it.) this.addAbility(new org.rnd.jmagic.abilities.keywords.Flashback(state, "(5)(B)(B)")); }
public GolemFoundryAbility1(GameState state) { super( state, "Remove three charge counters from Golem Foundry: Put a 3/3 colorless Golem artifact creature token onto the battlefield."); this.addCost( removeCounters( 3, Counter.CounterType.CHARGE, ABILITY_SOURCE_OF_THIS, "Remove three charge counters from Golem Foundry")); CreateTokensFactory factory = new CreateTokensFactory( 1, 3, 3, "Put a 3/3 colorless Golem artifact creature token onto the battlefield."); factory.setSubTypes(SubType.GOLEM); factory.setArtifact(); this.addEffect(factory.getEventFactory()); }
public KnightlyValorAbility1(GameState state) { super( state, "When Knightly Valor enters the battlefield, put a 2/2 white Knight creature token with vigilance onto the battlefield."); this.addPattern(whenThisEntersTheBattlefield()); CreateTokensFactory factory = new CreateTokensFactory( 1, 2, 2, "Put a 2/2 white Knight creature token with vigilance onto the battlefield."); factory.setColors(Color.WHITE); factory.setSubTypes(SubType.KNIGHT); factory.addAbility(Vigilance.class); this.addEffect(factory.getEventFactory()); }
public CribSwap(GameState state) { super(state); // Changeling (This card is every creature type at all times.) this.addAbility(new org.rnd.jmagic.abilities.keywords.Changeling(state)); // Exile target creature. SetGenerator target = targetedBy(this.addTarget(CreaturePermanents.instance(), "target creature")); this.addEffect(exile(target, "Exile target creature.")); // Its controller puts a 1/1 colorless Shapeshifter creature token with // changeling onto the battlefield. CreateTokensFactory token = new CreateTokensFactory( 1, 1, 1, "Its controller puts a 1/1 colorless Shapeshifter creature token with changeling onto the battlefield."); token.setController(ControllerOf.instance(target)); token.setSubTypes(SubType.SHAPESHIFTER); token.addAbility(org.rnd.jmagic.abilities.keywords.Changeling.class); this.addEffect(token.getEventFactory()); }