Package mage.abilities.effects

Examples of mage.abilities.effects.ContinuousEffect


        this.color.setBlack(true);

        // All creatures get -1/-1 until end of turn for each Swamp you control.
        PermanentsOnBattlefieldCount count = new PermanentsOnBattlefieldCount(filter, -1);
        ContinuousEffect effect = new BoostAllEffect(count, count, Duration.EndOfTurn, new FilterCreaturePermanent(), false, null, true);
        effect.overrideRuleText(ruleText);
        this.getSpellAbility().addEffect(effect);
    }
View Full Code Here


        this.subtype.add("Berserker");
        this.color.setRed(true);
        this.power = new MageInt(3);
        this.toughness = new MageInt(1);

        ContinuousEffect effect = new GainAbilitySourceEffect(DoubleStrikeAbility.getInstance(), Duration.WhileOnBattlefield);
        this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new ConditionalContinousEffect(effect, MetalcraftCondition.getInstance(), effectText)));
    }
View Full Code Here

    @Override
    public boolean apply(Game game, Ability source) {
        Player controller = game.getPlayer(source.getControllerId());
        Permanent creature = game.getPermanent(getTargetPointer().getFirst(game, source));
        if (controller != null && creature != null) {
            ContinuousEffect effect = new BoostTargetEffect(2,2,Duration.EndOfTurn);
            effect.setTargetPointer(new FixedTarget(creature.getId()));
            game.addEffect(effect, source);
            if (ClashEffect.getInstance().apply(game, source)) {
                game.addEffect(effect.copy(), source);
                effect = new GainAbilityTargetEffect(TrampleAbility.getInstance(), Duration.EndOfTurn);
                effect.setTargetPointer(new FixedTarget(creature.getId()));
                game.addEffect(effect.copy(), source);
            }
            return true;
        }
        return false;
    }
View Full Code Here

        if (sourceCreature != null && creature != null) {
            int power = sourceCreature.getPower().getValue();
            if (power > 0) {
                creature.addCounters(CounterType.P1P1.createInstance(power), game);
            }
            ContinuousEffect effect = new AddCardSubTypeTargetEffect("Mutant", Duration.WhileOnBattlefield);
            effect.setTargetPointer(new FixedTarget(creature.getId()));
            game.addEffect(effect, source);
        }
        return false;
    }
View Full Code Here

                    Card card = game.getCard(target.getFirstTarget());
                    if (card != null) {
                        if (controller.putOntoBattlefieldWithInfo(card, game, Zone.HAND, source.getSourceId())) {
                            Permanent permanent = game.getPermanent(card.getId());
                            if (permanent != null) {
                                ContinuousEffect effect = new GainAbilityTargetEffect(HasteAbility.getInstance(), Duration.Custom);
                                effect.setTargetPointer(new FixedTarget(permanent.getId()));
                                game.addEffect(effect, source);
                                SacrificeTargetEffect sacrificeEffect = new SacrificeTargetEffect("sacrifice " + card.getName());
                                sacrificeEffect.setTargetPointer(new FixedTarget(card.getId()));
                                DelayedTriggeredAbility delayedAbility = new AtEndOfTurnDelayedTriggeredAbility(sacrificeEffect);
                                delayedAbility.setSourceId(source.getSourceId());
View Full Code Here

            Cost cost = new SacrificeTargetCost(new TargetControlledCreaturePermanent());
            if (cost.canPay(source, source.getSourceId(), defendingPlayerId, game) &&
                    defender.chooseUse(Outcome.LoseAbility, "Sacrifice a creature to prevent " + sourceObject.getLogName() + " from getting unblockable?", game)) {
                if (!cost.pay(source, game, source.getSourceId(), defendingPlayerId, false)) {
                    // cost was not payed - so source gets unblockable
                    ContinuousEffect effect = new UnblockableSourceEffect(Duration.EndOfTurn);
                    game.addEffect(effect, source);
                }
            }
            return true;
        }
View Full Code Here

        this.subtype.add("Elephant");
        this.subtype.add("Soldier");
        this.color.setWhite(true);
        this.power = new MageInt(2);
        this.toughness = new MageInt(4);
        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.subtype.add("Human");
        this.subtype.add("Soldier");
        this.color.setWhite(true);
        this.power = new MageInt(1);
        this.toughness = new MageInt(1);
        ContinuousEffect boostSource = new BoostSourceEffect(2, 2, Duration.WhileOnBattlefield);
        ConditionalContinousEffect effect = new ConditionalContinousEffect(boostSource, MetalcraftCondition.getInstance(), "Ardent Recruit gets +2/+2 as long as you control three or more artifacts");
        Ability ability = new SimpleStaticAbility(Zone.BATTLEFIELD, effect);
        ability.setAbilityWord(AbilityWord.METALCRAFT);
        this.addAbility(ability);
    }
View Full Code Here

                    // Add effects only if the card has a spellAbility (e.g. not for lands).
                    if (card.getSpellAbility() != null) {
                        // allow to cast the card
                        game.addEffect(new DaxosOfMeletisCastFromExileEffect(card.getId(), exileId), source);
                        // and you may spend mana as though it were mana of any color to cast it
                        ContinuousEffect effect = new DaxosOfMeletisSpendAnyManaEffect();
                        effect.setTargetPointer(new FixedTarget(card.getId()));
                        game.addEffect(effect, source);
                    }
                }
                return true;
            }
View Full Code Here

            if (card.getZoneChangeCounter() == zoneChanges) {
                Zone currentZone = game.getState().getZone(card.getId());
                if (card.putOntoBattlefield(game, currentZone, source.getSourceId(), source.getControllerId())) {
                    Permanent creature = game.getPermanent(card.getId());
                    creature.addCounters(CounterType.P1P1.createInstance(), game);
                    ContinuousEffect effect = new GraveBetrayalContiniousEffect();
                    effect.setTargetPointer(new FixedTarget(creature.getId()));
                    game.addEffect(effect, source);
                    return true;
                }
            }
        }
View Full Code Here

TOP

Related Classes of mage.abilities.effects.ContinuousEffect

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.