Package mage.abilities.dynamicvalue

Examples of mage.abilities.dynamicvalue.DynamicValue


        // You may exile two green cards from your hand rather than pay Allosaurus Rider's mana cost.
        this.addAbility(new AlternativeCostSourceAbility(new ExileFromHandCost(new TargetCardInHand(2, filter))));

        // Allosaurus Rider's power and toughness are each equal to 1 plus the number of lands you control.
        DynamicValue onePlusControlledLands = new IntPlusDynamicValue(1, new PermanentsOnBattlefieldCount(new FilterControlledLandPermanent("lands you control")));
        this.addAbility(new SimpleStaticAbility(Zone.ALL, new SetPowerToughnessSourceEffect(onePlusControlledLands, Duration.EndOfGame)));

    }
View Full Code Here


        this.toughness = new MageInt(1);

        // Changeling
        this.addAbility(ChangelingAbility.getInstance());
        // {X}: Creatures you control become X/X and gain all creature types until end of turn.
        DynamicValue variableMana = new ManacostVariableValue();
        Effect effect = new SetPowerToughnessAllEffect(variableMana, variableMana, Duration.EndOfTurn, filter, true);
        effect.setText("Creatures you control become X/X");
        Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, effect, new VariableManaCost());
        effect = new GainAbilityAllEffect(ChangelingAbility.getInstance(), Duration.EndOfTurn, filter);
        effect.setText("and gain all creature types until end of turn");
View Full Code Here

        this.color.setGreen(true);
        this.power = new MageInt(0);
        this.toughness = new MageInt(0);

        // Overbeing of Myth's power and toughness are each equal to the number of cards in your hand.
        DynamicValue number = new CardsInControllerHandCount();
        this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new SetPowerToughnessSourceEffect(number, Duration.WhileOnBattlefield)));
       
        // At the beginning of your draw step, draw an additional card.
        this.addAbility(new BeginningOfDrawTriggeredAbility(new DrawCardSourceControllerEffect(1), TargetController.YOU, false));
       
View Full Code Here

        this.color.setWhite(true);

        // Sweep - Return any number of Plains you control to their owner's hand. Target creature gets +1/+1 until end of turn for each Plains returned this way.
        this.getSpellAbility().addEffect(new SweepEffect("Plains"));
        DynamicValue sweepValue = new SweepNumber("Plains", true);
        this.getSpellAbility().addEffect(new BoostTargetEffect(sweepValue, sweepValue, Duration.EndOfTurn));
        this.getSpellAbility().addTarget(new TargetCreaturePermanent());
    }
View Full Code Here

        this.color.setWhite(true);

        // Sweep - Return any number of Plains you control to their owner's hand. Creatures you control get +1/+1 until end of turn for each Plains returned this way.
        this.getSpellAbility().addEffect(new SweepEffect("Plains"));
        DynamicValue sweepValue = new SweepNumber("Plains", true);
        this.getSpellAbility().addEffect(new BoostControlledEffect(sweepValue, sweepValue, Duration.EndOfTurn));

    }
View Full Code Here

        this.expansionSetCode = "8ED";

        this.color.setWhite(true);

        // You gain 2 life for each creature you control.
        DynamicValue amount = new PermanentsOnBattlefieldCount(new FilterControlledCreaturePermanent(), 2);
        this.getSpellAbility().addEffect(new GainLifeEffect(amount));
    }
View Full Code Here

        return new TezzeretAgentOfBolasEffect2(this);
    }

    @Override
    public boolean apply(Game game, Ability source) {
        DynamicValue value = new PermanentsOnBattlefieldCount(filter);
        int count = value.calculate(game, source, this) * 2;

        Player player = game.getPlayer(source.getFirstTarget());
        if (player != null) {
            player.loseLife(count, game);
        }
View Full Code Here

        filter.add(new ColorPredicate(ObjectColor.BLACK));
        filter.add(Predicates.not(new CardIdPredicate(this.getId()))); // the exile cost can never be paid with the card itself
        this.addAbility(new AlternativeCostSourceAbility(new ExileFromHandCost(new TargetCardInHand(filter))));

        // Target creature gets -X/-X until end of turn.
        DynamicValue x = new SignInversionDynamicValue(new ExileFromHandCostCardConvertedMana());
        this.getSpellAbility().addEffect(new BoostTargetEffect(x, x, Duration.EndOfTurn, true));
        this.getSpellAbility().addTarget(new TargetCreaturePermanent());
    }
View Full Code Here

        this.color.setRed(true);
        this.color.setGreen(true);
        this.power = new MageInt(0);
        this.toughness = new MageInt(0);

        DynamicValue controlledLands = new PermanentsOnBattlefieldCount(filter);
       
        // Rubblehulk's power and toughness are each equal to the number of lands you control.
        this.addAbility(new SimpleStaticAbility(Zone.ALL, new SetPowerToughnessSourceEffect(controlledLands, Duration.EndOfGame)));

        // Bloodrush - 1{R}{G}, Discard Rubblehulk: Target attacking creature gets +X/+X until end of turn, where X is the number of lands you control.
View Full Code Here

        Ability ability = new EnchantAbility(auraTarget.getTargetName());
        this.addAbility(ability);


        // When enchanted creature dies, target player loses X life and you gain X life, where X is its power.
        DynamicValue attachedPower = new AttachedPermanentPowerCount();
        ability = new DiesAttachedTriggeredAbility(new LoseLifeTargetEffect(attachedPower), "enchanted creature");
        ability.addEffect(new GainLifeEffect(attachedPower));
        ability.addTarget(new TargetPlayer());
        this.addAbility(ability);
    }
View Full Code Here

TOP

Related Classes of mage.abilities.dynamicvalue.DynamicValue

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.