Package mage.watchers.common

Examples of mage.watchers.common.SourceDidDamageWatcher


        this.color.setBlue(true);
        this.color.setWhite(true);

        // Return each creature that dealt damage this turn to its owner's hand.
        this.getSpellAbility().addEffect(new RestoreThePeaceEffect());
        this.addWatcher(new SourceDidDamageWatcher());

    }
View Full Code Here


        return new RestoreThePeaceEffect(this);
    }
   
    @Override
    public boolean apply(Game game, Ability source) {
        SourceDidDamageWatcher watcher = (SourceDidDamageWatcher) game.getState().getWatchers().get("SourceDidDamageWatcher");
        if (watcher != null) {
            for (UUID permId :watcher.damageSources) {
                Permanent perm = game.getPermanent(permId);
                if (perm != null) {
                    perm.moveToZone(Zone.HAND, source.getSourceId(), game, true);
View Full Code Here

        this.color.setWhite(true);

        // Destroy target creature that dealt damage this turn.
        this.getSpellAbility().addEffect(new DestroyTargetEffect());
        this.getSpellAbility().addTarget(new AvengingArrowTarget());
        this.addWatcher(new SourceDidDamageWatcher());
    }
View Full Code Here

        super(target);
    }

    @Override
    public boolean canTarget(UUID id, Ability source, Game game) {
        SourceDidDamageWatcher watcher = (SourceDidDamageWatcher) game.getState().getWatchers().get("SourceDidDamageWatcher");
        if (watcher != null) {
            if (watcher.damageSources.contains(id)) {
                return super.canTarget(id, source, game);
            }
        }
View Full Code Here

    @Override
    public Set<UUID> possibleTargets(UUID sourceId, UUID sourceControllerId, Game game) {
        Set<UUID> availablePossibleTargets = super.possibleTargets(sourceId, sourceControllerId, game);
        Set<UUID> possibleTargets = new HashSet<UUID>();
        SourceDidDamageWatcher watcher = (SourceDidDamageWatcher) game.getState().getWatchers().get("SourceDidDamageWatcher");
        if (watcher != null) {
            for (UUID targetId : availablePossibleTargets) {
                Permanent permanent = game.getPermanent(targetId);
                if (permanent != null && watcher.damageSources.contains(targetId)) {
                    possibleTargets.add(targetId);
View Full Code Here

        // Target creature that dealt damage this turn gets -5/-5 until end of turn.
        this.getSpellAbility().addEffect(new BoostTargetEffect(-5,-5, Duration.EndOfTurn));
        this.getSpellAbility().addTarget(new TargetCreaturePermanentThatDealtDamageThisTurn());

        this.addWatcher(new SourceDidDamageWatcher());
    }
View Full Code Here

        super(target);
    }

    @Override
    public boolean canTarget(UUID id, Ability source, Game game) {
        SourceDidDamageWatcher watcher = (SourceDidDamageWatcher) game.getState().getWatchers().get("SourceDidDamageWatcher");
        if (watcher != null) {
            if (watcher.damageSources.contains(id)) {
                return super.canTarget(id, source, game);
            }
        }
View Full Code Here

        if (remainingTargets <= 0) {
            return true;
        }
        int count = 0;
        MageObject targetSource = game.getObject(sourceId);
        SourceDidDamageWatcher watcher = (SourceDidDamageWatcher) game.getState().getWatchers().get("SourceDidDamageWatcher");
        if (watcher != null) {
            for (Permanent permanent: game.getBattlefield().getActivePermanents(filter, sourceControllerId, sourceId, game)) {
                if (!targets.containsKey(permanent.getId()) && watcher.damageSources.contains(permanent.getId())) {
                    if (!notTarget || permanent.canBeTargetedBy(targetSource, sourceControllerId, game)) {
                        count++;
View Full Code Here

    @Override
    public Set<UUID> possibleTargets(UUID sourceId, UUID sourceControllerId, Game game) {
        Set<UUID> availablePossibleTargets = super.possibleTargets(sourceId, sourceControllerId, game);
        Set<UUID> possibleTargets = new HashSet<UUID>();
        SourceDidDamageWatcher watcher = (SourceDidDamageWatcher) game.getState().getWatchers().get("SourceDidDamageWatcher");
        if (watcher != null) {
            for (UUID targetId : availablePossibleTargets) {
                Permanent permanent = game.getPermanent(targetId);
                if (permanent != null && !targets.containsKey(permanent.getId()) && watcher.damageSources.contains(targetId)) {
                    possibleTargets.add(targetId);
View Full Code Here

TOP

Related Classes of mage.watchers.common.SourceDidDamageWatcher

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.