Package mage.abilities.condition

Examples of mage.abilities.condition.CompoundCondition


        this.expansionSetCode = "NMS";

        this.color.setBlue(true);

        // If an opponent controls a Forest and you control an Island, you may cast Submerge without paying its mana cost.
        Condition condition = new CompoundCondition("If an opponent controls a Forest and you control an Island",
                new OpponentControlsPermanentCondition(filterForest),
                new PermanentsOnTheBattlefieldCondition(filterIsland));
        this.addAbility(new AlternativeCostSourceAbility(null, condition));       
        // Put target creature on top of its owner's library.
        this.getSpellAbility().addEffect(new PutOnLibraryTargetEffect(true));
View Full Code Here


        this.expansionSetCode = "NMS";

        this.color.setBlack(true);

        // If an opponent controls a Plains and you control a Swamp, you may cast Massacre without paying its mana cost.
        Condition condition = new CompoundCondition("If an opponent controls a Plains and you control a Swamp",
                new OpponentControlsPermanentCondition(filterPlains),
                new PermanentsOnTheBattlefieldCondition(filterSwamp));
        this.addAbility(new AlternativeCostSourceAbility(null, condition));
        // All creatures get -2/-2 until end of turn.
        this.getSpellAbility().addEffect(new BoostAllEffect(-2, -2, Duration.EndOfTurn));
View Full Code Here

        // {tap}: Gain control of target creature with power less than or equal to Old Man of the Sea's power for as long as Old Man of the Sea remains tapped and that creature's power remains less than or equal to Old Man of the Sea's power.
        FilterCreaturePermanent controllableCreatures = new FilterCreaturePermanent("creature with power less than or equal to Old Man of the Sea   's power");
        controllableCreatures.add(new PowerLowerEqualSourcePredicate(this.getId()));
        ConditionalContinousEffect effect = new ConditionalContinousEffect(
                new OldManOfTheSeaGainControlTargetEffect(Duration.Custom, true), new CompoundCondition(SourceTappedCondition.getInstance(), new SourcePowerGreaterEqualTargetCondition()),
                "Gain control of target creature with power less than or equal to {this}'s power for as long as {this} remains tapped and that creature's power remains less than or equal to {this}'s power");
        Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, effect, new TapSourceCost());
        ability.addTarget(new TargetCreaturePermanent(controllableCreatures));
        this.addAbility(ability);
        // internal ability to check condition
View Full Code Here

        this.subtype.add("Equipment");

        // As long as equipped creature is tapped, tapped creatures you control get +2/+0.
        this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new ConditionalContinousEffect(
                new BoostControlledEffect(2,0, Duration.WhileOnBattlefield, filterTapped),
                new CompoundCondition(EquipmentAttachedCondition.getInstance(), new AttachedToTappedCondition()),
                "As long as equipped creature is tapped, tapped creatures you control get +2/+0"
        )));

        // As long as equipped creature is untapped, untapped creatures you control get +0/+2.
        this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new ConditionalContinousEffect(
                new BoostControlledEffect(0,2, Duration.WhileOnBattlefield, filterUntapped),
                new CompoundCondition(EquipmentAttachedCondition.getInstance(), new InvertCondition(new AttachedToTappedCondition())),
                "As long as equipped creature is untapped, untapped creatures you control get +0/+2"
        )));

        // {3}: You may tap or untap equipped creature.
        this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new MayTapOrUntapAttachedEffect(), new GenericManaCost(3)));
View Full Code Here

TOP

Related Classes of mage.abilities.condition.CompoundCondition

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.