public ArrowVolleyTrap(GameState state) { super(state); SetGenerator trapCondition = Intersect.instance(Between.instance(4, null), Count.instance(Attacking.instance())); this.addAbility( new org.rnd.jmagic.abilities.Trap( state, this.getName(), trapCondition, "If four or more creatures are attacking", "(1)(W)")); Target target = this.addTarget(Attacking.instance(), "up to five target attacking creatures"); target.setNumber(1, 5); this.setDivision(Union.instance(numberGenerator(5), Identity.instance("damage"))); EventType.ParameterMap damageParameters = new EventType.ParameterMap(); damageParameters.put(EventType.Parameter.SOURCE, This.instance()); damageParameters.put( EventType.Parameter.TAKER, ChosenTargetsFor.instance(Identity.instance(target), This.instance())); this.addEffect( new EventFactory( EventType.DISTRIBUTE_DAMAGE, damageParameters, "Arrow Volley Trap deals 5 damage divided as you choose among any number of target attacking creatures.")); }
public ArrowsofJustice(GameState state) { super(state); // Arrows of Justice deals 4 damage to target attacking or blocking // creature. Target target = this.addTarget( Intersect.instance( CreaturePermanents.instance(), Union.instance(Attacking.instance(), Blocking.instance())), "target attacking or blocking creature"); this.addEffect( spellDealDamage( 4, targetedBy(target), "Arrows of Justice deals 4 damage to target attacking or blocking creature.")); }
public SliverPing(GameState state) { super(state, "(T): This permanent deals 1 damage to target attacking or blocking creature."); this.costsTap = true; Target target = this.addTarget( Intersect.instance( CreaturePermanents.instance(), Union.instance(Attacking.instance(), Blocking.instance())), "target attacking or blocking creature"); this.addEffect( permanentDealDamage( 1, targetedBy(target), "This permanent deals 1 damage to target attacking or blocking creature.")); }
public EnsnaringBridgeAbility0(GameState state) { super( state, "Creatures with power greater than the number of cards in your hand can't attack."); SetGenerator numberOfCardsInYourHand = Count.instance(InZone.instance(HandOf.instance(You.instance()))); SetGenerator hasPowerGreater = HasPower.instance( Between.instance( Sum.instance(Union.instance(numberGenerator(1), numberOfCardsInYourHand)), Empty.instance())); SetGenerator restriction = Intersect.instance(Attacking.instance(), hasPowerGreater); ContinuousEffect.Part part = new ContinuousEffect.Part(ContinuousEffectType.ATTACKING_RESTRICTION); part.parameters.put( ContinuousEffectType.Parameter.RESTRICTION, Identity.instance(restriction)); this.addEffectPart(part); }