public MysticRemoraAbility1(GameState state) { super( state, "Whenever an opponent casts a noncreature spell, you may draw a card unless that player pays (4)."); SimpleEventPattern pattern = new SimpleEventPattern(EventType.BECOMES_PLAYED); pattern.put(EventType.Parameter.PLAYER, OpponentsOf.instance(You.instance())); pattern.put( EventType.Parameter.OBJECT, RelativeComplement.instance(Spells.instance(), HasType.instance(Type.CREATURE))); this.addPattern(pattern); SetGenerator thatPlayer = EventParameter.instance( TriggerEvent.instance(This.instance()), EventType.Parameter.PLAYER); EventFactory mayDraw = youMay(drawCards(You.instance(), 1, "Draw a card"), "You may draw a card"); EventFactory pay = new EventFactory(EventType.PAY_MANA, "Pay (4)"); pay.parameters.put(EventType.Parameter.CAUSE, This.instance()); pay.parameters.put(EventType.Parameter.PLAYER, thatPlayer); pay.parameters.put(EventType.Parameter.MANA, Identity.instance(new ManaPool("4"))); this.addEffect( unless(thatPlayer, mayDraw, pay, "You may draw a card unless that player pays (4).")); }
public PsychosisCrawlerAbility1(GameState state) { super(state, "Whenever you draw a card, each opponent loses 1 life."); SimpleEventPattern pattern = new SimpleEventPattern(EventType.DRAW_ONE_CARD); pattern.put(EventType.Parameter.PLAYER, You.instance()); this.addPattern(pattern); this.addEffect( loseLife(OpponentsOf.instance(You.instance()), 1, "Each opponent loses 1 life.")); }
public Vampiricism(GameState state) { super(state, "Whenever you gain life, target opponent loses that much life."); SimpleEventPattern pattern = new SimpleEventPattern(EventType.GAIN_LIFE); pattern.put(EventType.Parameter.PLAYER, You.instance()); this.addPattern(pattern); Target target = this.addTarget(OpponentsOf.instance(You.instance()), "target opponent"); this.addEffect( loseLife( targetedBy(target), EventParameter.instance( TriggerEvent.instance(This.instance()), EventType.Parameter.NUMBER), "Target opponent loses that much life.")); }
public SigardaHostofHeronsAbility1(GameState state) { super( state, "Spells and abilities your opponents control can't cause you to sacrifice permanents."); SimpleEventPattern youSacrificePermanents = new SimpleEventPattern(EventType.SACRIFICE_ONE_PERMANENT); youSacrificePermanents.put( EventType.Parameter.CAUSE, ControlledBy.instance(OpponentsOf.instance(You.instance()), Stack.instance())); youSacrificePermanents.put(EventType.Parameter.PERMANENT, Permanents.instance()); youSacrificePermanents.put(EventType.Parameter.PLAYER, You.instance()); ContinuousEffect.Part part = new ContinuousEffect.Part(ContinuousEffectType.PROHIBIT); part.parameters.put( ContinuousEffectType.Parameter.PROHIBITION, Identity.instance(youSacrificePermanents)); this.addEffectPart(part); }
public BlindObedienceAbility1(GameState state) { super(state, "Artifacts and creatures your opponents control enter the battlefield tapped."); SetGenerator controller = ControllerOf.instance(This.instance()); SetGenerator stuff = HasType.instance(Type.ARTIFACT, Type.CREATURE); SetGenerator opponents = OpponentsOf.instance(controller); ZoneChangeReplacementEffect gatekeeping = new ZoneChangeReplacementEffect( this.game, "Artifacts and creatures your opponents control enter the battlefield tapped"); gatekeeping.addPattern( new SimpleZoneChangePattern(null, Battlefield.instance(), stuff, opponents, false)); gatekeeping.addEffect( tap( NewObjectOf.instance(gatekeeping.replacedByThis()), "An artifact or creature an opponent controls enters the battlefield tapped.")); this.addEffectPart(replacementEffectPart(gatekeeping)); }
public AntiWarden(GameState state) { super( state, "Whenever a creature enters the battlefield under an opponent's control, you may have that player lose 1 life."); this.addPattern( new SimpleZoneChangePattern( null, Battlefield.instance(), HasType.instance(Type.CREATURE), OpponentsOf.instance(You.instance()), false)); this.addEffect( youMay( loseLife( ControllerOf.instance(TriggerZoneChange.instance(This.instance())), 1, "That player loses 1 life."), "You may have that player lose 1 life.")); }
public LazavDimirMastermindAbility1(GameState state) { super( state, "Whenever a creature card is put into an opponent's graveyard from anywhere, you may have Lazav, Dimir Mastermind become a copy of that card except its name is still Lazav, Dimir Mastermind, it's legendary in addition to its other types, and it gains hexproof and this ability."); this.addPattern( new SimpleZoneChangePattern( null, GraveyardOf.instance(OpponentsOf.instance(You.instance())), HasType.instance(Type.CREATURE), false)); SetGenerator thatCard = NewObjectOf.instance(TriggerZoneChange.instance(This.instance())); ContinuousEffect.Part part = new ContinuousEffect.Part(ContinuousEffectType.COPY_OBJECT); part.parameters.put( ContinuousEffectType.Parameter.ABILITY, Identity.instance( new SimpleAbilityFactory(LazavDimirMastermindAbility1.class), new SimpleAbilityFactory(Hexproof.class))); part.parameters.put(ContinuousEffectType.Parameter.OBJECT, ABILITY_SOURCE_OF_THIS); part.parameters.put(ContinuousEffectType.Parameter.ORIGINAL, thatCard); part.parameters.put( ContinuousEffectType.Parameter.RETAIN, Identity.instance(Characteristics.Characteristic.NAME)); part.parameters.put( ContinuousEffectType.Parameter.TYPE, Identity.instance(SuperType.LEGENDARY)); EventFactory copy = createFloatingEffect( Empty.instance(), "Have Lazav, Dimir Mastermind become a copy of that card except its name is still Lazav, Dimir Mastermind, it's legendary in addition to its other types, and it gains hexproof and this ability.", part); this.addEffect( youMay( copy, "Have Lazav, Dimir Mastermind become a copy of that card except its name is still Lazav, Dimir Mastermind, it's legendary in addition to its other types, and it gains hexproof and this ability.")); }