Package mage.watchers.common

Examples of mage.watchers.common.DamagedByWatcher


public class DealtDamageToCreatureBySourceDies extends ReplacementEffectImpl {

    public DealtDamageToCreatureBySourceDies(Card card, Duration duration) {
        super(Duration.WhileOnBattlefield, Outcome.Exile);
        card.addWatcher(new DamagedByWatcher());
        if (card.getCardType().contains(CardType.CREATURE)) {
            staticText = "If a creature dealt damage by {this} this turn would die, exile it instead";
        } else {
            staticText = "If a creature dealt damage this way would die this turn, exile it instead";
        }
View Full Code Here


    @Override
    public boolean applies(GameEvent event, Ability source, Game game) {
        if (event.getType().equals(EventType.ZONE_CHANGE)) {
            ZoneChangeEvent  zce = (ZoneChangeEvent) event;
            if (zce.isDiesEvent()) {
                DamagedByWatcher watcher = (DamagedByWatcher) game.getState().getWatchers().get("DamagedByWatcher", source.getSourceId());
                if (watcher != null) {
                    return watcher.wasDamaged(zce.getTarget());
                }
            }
        }
        return false;
    }
View Full Code Here

        }

        @Override
        public boolean applies(GameEvent event, Ability source, Game game) {
                if (event.getType() == EventType.ZONE_CHANGE && ((ZoneChangeEvent)event).isDiesEvent()) {
                        DamagedByWatcher watcher =
                                (DamagedByWatcher) game.getState().getWatchers().get("DamagedByWatcher", source.getSourceId());
                        if (watcher != null)
                                return watcher.damagedCreatures.contains(event.getTargetId());
                }
                return false;
View Full Code Here

        this.color.setRed(true);

        // Flamebreak deals 3 damage to each creature without flying and each player. Creatures dealt damage this way can't be regenerated this turn.
        this.getSpellAbility().addEffect(new DamageEverythingEffect(new StaticValue(3), filter1));
        this.getSpellAbility().addEffect(new FlamebreakCantRegenerateEffect());
        this.addWatcher(new DamagedByWatcher());       
    }
View Full Code Here

    }

    @Override
    public boolean applies(GameEvent event, Ability source, Game game) {
        if (event.getType() == EventType.REGENERATE) {
            DamagedByWatcher watcher = (DamagedByWatcher) game.getState().getWatchers().get("DamagedByWatcher", source.getSourceId());
            if (watcher != null) {
                return watcher.wasDamaged(event.getTargetId(), game);
            }
        }
        return false;
    }
View Full Code Here

        // Aggravate deals 1 damage to each creature target player controls.
        this.getSpellAbility().addEffect(new AggraveteEffect());
        this.getSpellAbility().addTarget(new TargetPlayer());
        // Each creature dealt damage this way attacks this turn if able.
        this.getSpellAbility().addEffect(new AggravateRequirementEffect());
        this.addWatcher(new DamagedByWatcher());
    }
View Full Code Here

        this.color.setRed(true);

        this.getSpellAbility().addEffect(new DamageTargetEffect(3));
        this.getSpellAbility().addTarget(new TargetCreatureOrPlayer());
        this.getSpellAbility().addEffect(new IncinerateEffect());
        this.addWatcher(new DamagedByWatcher());
    }
View Full Code Here

    }

    @Override
    public boolean applies(GameEvent event, Ability source, Game game) {
        if (event.getType() == EventType.REGENERATE) {
            DamagedByWatcher watcher = (DamagedByWatcher) game.getState().getWatchers().get("DamagedByWatcher", source.getSourceId());
            if (watcher != null) {
                return watcher.wasDamaged(event.getTargetId(), game);
            }
        }
        return false;
    }
View Full Code Here

        return new AggravateRequirementEffect(this);
    }

    @Override
    public boolean applies(Permanent permanent, Ability source, Game game) {
        DamagedByWatcher watcher = (DamagedByWatcher) game.getState().getWatchers().get("DamagedByWatcher", source.getSourceId());
        if (watcher != null) {
            return watcher.wasDamaged(permanent);
        }
        return false;
    }
View Full Code Here

        ability.addTarget(new TargetCreatureOrPlayer());
        ability.addCost(new TapSourceCost());
        ability.addCost(new DiscardCardCost());
        ability.addEffect(new CantRegenerateEffect());
        this.addAbility(ability);
        this.addWatcher(new DamagedByWatcher());               
       
        // {5}{R}{R}, {tap}, Discard a card: Jaya Ballard deals 6 damage to each creature and each player.
        ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new DamageEverythingEffect(6), new ManaCostsImpl("{5}{R}{R}"));
        ability.addCost(new TapSourceCost());
        ability.addCost(new DiscardCardCost());       
View Full Code Here

TOP

Related Classes of mage.watchers.common.DamagedByWatcher

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.