Package mage.abilities.decorator

Examples of mage.abilities.decorator.ConditionalContinousEffect


        List<Ability> constructed = new ArrayList<>();

        Condition condition = new SourceHasCounterCondition(CounterType.LEVEL, level1, level2);
        for (Ability ability : abilities) {
            ContinuousEffect effect = new GainAbilitySourceEffect(ability);
            ConditionalContinousEffect abEffect = new ConditionalContinousEffect(effect, condition, "");
            Ability staticAbility = new SimpleStaticAbility(Zone.BATTLEFIELD, abEffect);
            staticAbility.setRuleVisible(false);
            constructed.add(staticAbility);
        }

        ContinuousEffect effect = new SetPowerToughnessSourceEffect(power, toughness, Duration.WhileOnBattlefield);
        ConditionalContinousEffect ptEffect = new ConditionalContinousEffect(effect, condition, rule);
        constructed.add(new SimpleStaticAbility(Zone.BATTLEFIELD, ptEffect));

        return constructed;
    }
View Full Code Here


        // Target creature gets +3/+0 until end of turn. If Vampire's Bite was kicked, that creature gains lifelink until end of turn.
        this.getSpellAbility().addTarget(new TargetCreaturePermanent());
        this.getSpellAbility().addEffect(new BoostTargetEffect(3, 0, Duration.EndOfTurn));
        ContinuousEffect effect = new GainAbilityTargetEffect(LifelinkAbility.getInstance(), Duration.EndOfTurn);
        this.getSpellAbility().addEffect(new ConditionalContinousEffect(effect, new LockedInCondition(KickedCondition.getInstance()), "If {this} was kicked, that creature gains lifelink until end of turn"));
    }
View Full Code Here

        this.expansionSetCode = "M14";

        this.color.setWhite(true);

        // As long as your life total is greater than or equal to your starting life total, creatures you control get +1/+1.
        this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new ConditionalContinousEffect(new BoostAllEffect(1, 1, Duration.WhileOnBattlefield, filter, true), new LifeCondition(), rule)));

        // Whenever one or more creatures you control attack, you gain life equal to the number of attacking creatures.
        this.addAbility(new PathOfBraveryTriggeredAbility());

    }
View Full Code Here

        this.color.setBlue(true);
        this.power = new MageInt(1);
        this.toughness = new MageInt(1);

        // Giant Tortoise gets +0/+3 as long as it's untapped.
        this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new ConditionalContinousEffect(
                new BoostSourceEffect(0,3, Duration.WhileOnBattlefield),
                new InvertCondition(new SourceTappedCondition()),
                "{this} gets +0/+3 as long as it's untapped")));
    }
View Full Code Here

        this.color.setBlack(true);
        this.power = new MageInt(1);
        this.toughness = new MageInt(1);

        // When Festering Newt dies, target creature an opponent controls gets -1/-1 until end of turn. That creature gets -4/-4 instead if you control a creature named Bogbrew Witch.
        Effect effect = new ConditionalContinousEffect(
                new BoostTargetEffect(-4,-4, Duration.EndOfTurn),
                new BoostTargetEffect(-1,-1, Duration.EndOfTurn),
                new LockedInCondition(new PermanentsOnTheBattlefieldCondition(filterBogbrewWitch)),
                "target creature an opponent controls gets -1/-1 until end of turn. That creature gets -4/-4 instead if you control a creature named Bogbrew Witch");
        Ability ability = new DiesTriggeredAbility(effect);
View Full Code Here

        this.toughness = new MageInt(2);

        // Whenever an Equipment enters the battlefield under your control, you may draw a card.
        this.addAbility(new EntersBattlefieldControlledTriggeredAbility(Zone.BATTLEFIELD, new DrawCardSourceControllerEffect(1), filter, true));
        // Metalcraft - Equipment you control have equip {0} as long as you control three or more artifacts
        this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new ConditionalContinousEffect(
                new GainAbilityControlledEffect(new EquipAbility(Outcome.AddAbility, new GenericManaCost(0)), Duration.WhileOnBattlefield, filter),
                MetalcraftCondition.getInstance(),
                "Metalcraft - Equipment you control have equip {0} as long as you control three or more artifacts")));
    }
View Full Code Here

        this.subtype.add("Artificer");
        this.color.setGreen(true);
        this.power = new MageInt(2);
        this.toughness = new MageInt(2);
        ContinuousEffect boostSource = new BoostSourceEffect(2, 2, Duration.WhileOnBattlefield);
        ConditionalContinousEffect effect = new ConditionalContinousEffect(boostSource, MetalcraftCondition.getInstance(), text);
        this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, effect));
    }
View Full Code Here

        this.addWatcher(new CastFromHandWatcher());

        // Myojin of Night's Reach enters the battlefield with a divinity counter on it if you cast it from your hand.
        this.addAbility(new EntersBattlefieldAbility(new ConditionalOneShotEffect(new AddCountersSourceEffect(CounterType.DIVINITY.createInstance()), new CastFromHandCondition(), ""), "{this} enters the battlefield with a divinity counter on it if you cast it from your hand"));
        // Myojin of Night's Reach is indestructible as long as it has a divinity counter on it.
        this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new ConditionalContinousEffect(new GainAbilitySourceEffect(IndestructibleAbility.getInstance(), Duration.WhileOnBattlefield),
                new SourceHasCounterCondition(CounterType.DIVINITY), "{this} is indestructible as long as it has a divinity counter on it")));
        // Remove a divinity counter from Myojin of Night's Reach: Each opponent discards his or her hand.
        Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new MyojinOfNightsReachEffect(), new RemoveCountersSourceCost(CounterType.DIVINITY.createInstance()));
        this.addAbility(ability);
    }
View Full Code Here

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

        // Wildwood Geist gets +2/+2 as long as it's your turn.
        this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new ConditionalContinousEffect(
                new BoostSourceEffect(2, 2, Duration.WhileOnBattlefield),
                MyTurnCondition.getInstance(),
                "{this} gets +2/+2 as long as it's your turn")));
    }
View Full Code Here

        this.addWatcher(new CastFromHandWatcher());

        // Myojin of Seeing Winds enters the battlefield with a divinity counter on it if you cast it from your hand.
        this.addAbility(new EntersBattlefieldAbility(new ConditionalOneShotEffect(new AddCountersSourceEffect(CounterType.DIVINITY.createInstance()), new CastFromHandCondition(), ""), "{this} enters the battlefield with a divinity counter on it if you cast it from your hand"));
        // Myojin of Seeing Winds is indestructible as long as it has a divinity counter on it.
        this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new ConditionalContinousEffect(new GainAbilitySourceEffect(IndestructibleAbility.getInstance(), Duration.WhileOnBattlefield),
                new SourceHasCounterCondition(CounterType.DIVINITY), "{this} is indestructible as long as it has a divinity counter on it")));
        // Remove a divinity counter from Myojin of Seeing Winds: Draw a card for each permanent you control.
        Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new DrawCardSourceControllerEffect(new PermanentsOnBattlefieldCount(filter, 1)), new RemoveCountersSourceCost(CounterType.DIVINITY.createInstance()));
        this.addAbility(ability);
    }
View Full Code Here

TOP

Related Classes of mage.abilities.decorator.ConditionalContinousEffect

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.