public MotherofRunesAbility0(GameState state) { super( state, "(T): Target creature you control gains protection from the color of your choice until end of turn."); this.costsTap = true; SetGenerator target = targetedBy( this.addTarget( Intersect.instance( CreaturePermanents.instance(), ControlledBy.instance(You.instance())), "target creature you control")); EventFactory chooseColor = playerChoose( You.instance(), 1, Identity.fromCollection(Color.allColors()), PlayerInterface.ChoiceType.COLOR, PlayerInterface.ChooseReason.CHOOSE_COLOR, ""); this.addEffect(chooseColor); SetGenerator color = EffectResult.instance(chooseColor); this.addEffect( addProtectionUntilEndOfTurn( target, color, "Target creature gains protection from the color of your choice until end of turn.")); }
public TentacleRape(GameState state) { super( state, "Whenever Lorthos, the Tidemaker attacks, you may pay (8). If you do, tap up to eight target permanents. Those permanents don't untap during their controllers' next untap steps."); this.addPattern(whenThisAttacks()); Target target = this.addTarget(Permanents.instance(), "up to eight target permanents"); target.setNumber(0, 8); EventFactory mayPay8 = new EventFactory(EventType.PLAYER_MAY_PAY_MANA, "You may pay (8)"); mayPay8.parameters.put(EventType.Parameter.CAUSE, This.instance()); mayPay8.parameters.put(EventType.Parameter.PLAYER, You.instance()); mayPay8.parameters.put( EventType.Parameter.COST, Identity.fromCollection(new ManaPool("(8)"))); EventFactory tapHard = new EventFactory( EventType.TAP_HARD, "Tap up to eight target permanents. Those permanents don't untap during their controllers' next untap steps."); tapHard.parameters.put(EventType.Parameter.CAUSE, This.instance()); tapHard.parameters.put(EventType.Parameter.OBJECT, targetedBy(target)); EventFactory totalEffect = new EventFactory( EventType.IF_EVENT_THEN_ELSE, "You may pay (R). If you do, return Punishing Fire from your graveyard to your hand."); totalEffect.parameters.put(EventType.Parameter.IF, Identity.instance(mayPay8)); totalEffect.parameters.put(EventType.Parameter.THEN, Identity.instance(tapHard)); this.addEffect(totalEffect); }
public ThisCreatureKindOfSucksNow(GameState state) { super(state, "At the beginning of your upkeep, destroy this creature unless you pay (1)."); this.addPattern(atTheBeginningOfYourUpkeep()); EventFactory destroy = destroy(ABILITY_SOURCE_OF_THIS, "Destroy this creature"); EventFactory pay = new EventFactory(EventType.PAY_MANA, "Pay (1)"); pay.parameters.put(EventType.Parameter.CAUSE, This.instance()); pay.parameters.put(EventType.Parameter.COST, Identity.fromCollection(new ManaPool("(1)"))); pay.parameters.put(EventType.Parameter.PLAYER, You.instance()); this.addEffect( unless(You.instance(), destroy, pay, "Destroy this creature unless you pay (1).")); }
public ElephantGrassAbility2(GameState state) { super( state, "Nonblack creatures can't attack you unless their controller pays (2) for each creature he or she controls that's attacking you."); SetGenerator nonblackCreatures = RelativeComplement.instance( CreaturePermanents.instance(), HasColor.instance(Color.BLACK)); ContinuousEffect.Part part = new ContinuousEffect.Part(ContinuousEffectType.ATTACKING_COST); part.parameters.put( ContinuousEffectType.Parameter.COST, Identity.fromCollection(new ManaPool("2"))); part.parameters.put( ContinuousEffectType.Parameter.OBJECT, Identity.instance(nonblackCreatures)); part.parameters.put(ContinuousEffectType.Parameter.PLAYER, You.instance()); this.addEffectPart(part); }
public EntwineAdditionalCost(GameState state, CostCollection costs, String costName) { super( state, "If you choose all the modes of this spell, you pay an additional " + costName + "."); this.costCollection = costs; this.costName = costName; Set newCosts = Set.fromCollection(costs.manaCost); newCosts.addAll(costs.events); ContinuousEffect.Part part = new ContinuousEffect.Part(ContinuousEffectType.COST_ADDITION); part.parameters.put(ContinuousEffectType.Parameter.OBJECT, This.instance()); part.parameters.put(ContinuousEffectType.Parameter.COST, Identity.fromCollection(newCosts)); this.addEffectPart(part); // This only applies if you've chosen all of its modes this.canApply = Not.instance( RelativeComplement.instance( ModesOf.instance(This.instance()), SelectedModesOf.instance(This.instance()))); }