Search in sources :

Example 1 with TargetStackObject

use of mage.target.TargetStackObject in project mage by magefree.

the class FrostTitanAbility method checkTrigger.

@Override
public boolean checkTrigger(GameEvent event, Game game) {
    if (event.getTargetId().equals(this.getSourceId()) && game.getOpponents(this.controllerId).contains(event.getPlayerId())) {
        this.getTargets().clear();
        TargetStackObject target = new TargetStackObject();
        target.add(event.getSourceId(), game);
        this.addTarget(target);
        return true;
    }
    return false;
}
Also used : TargetStackObject(mage.target.TargetStackObject)

Example 2 with TargetStackObject

use of mage.target.TargetStackObject in project mage by magefree.

the class JumpTrooperTriggeredAbility method checkTrigger.

@Override
public boolean checkTrigger(GameEvent event, Game game) {
    if (game.getOpponents(this.controllerId).contains(event.getPlayerId())) {
        Permanent creature = game.getPermanent(event.getTargetId());
        if (creature != null && filter.match(creature, getSourceId(), getControllerId(), game)) {
            this.getTargets().clear();
            TargetStackObject target = new TargetStackObject();
            target.add(event.getSourceId(), game);
            this.addTarget(target);
            return true;
        }
    }
    return false;
}
Also used : Permanent(mage.game.permanent.Permanent) FilterControlledCreaturePermanent(mage.filter.common.FilterControlledCreaturePermanent) TargetStackObject(mage.target.TargetStackObject)

Example 3 with TargetStackObject

use of mage.target.TargetStackObject in project mage by magefree.

the class JettingGlasskiteAbility method checkTrigger.

@Override
public boolean checkTrigger(GameEvent event, Game game) {
    if (event.getTargetId().equals(this.getSourceId()) && game.getTurnNum() > turnUsed) {
        this.getTargets().clear();
        TargetStackObject target = new TargetStackObject();
        target.add(event.getSourceId(), game);
        this.addTarget(target);
        turnUsed = game.getTurnNum();
        return true;
    }
    return false;
}
Also used : TargetStackObject(mage.target.TargetStackObject)

Example 4 with TargetStackObject

use of mage.target.TargetStackObject in project mage by magefree.

the class ShimmeringGlasskiteAbility method checkTrigger.

@Override
public boolean checkTrigger(GameEvent event, Game game) {
    if (event.getTargetId().equals(this.getSourceId()) && game.getTurnNum() > turnUsed) {
        this.getTargets().clear();
        TargetStackObject target = new TargetStackObject();
        target.add(event.getSourceId(), game);
        this.addTarget(target);
        turnUsed = game.getTurnNum();
        return true;
    }
    return false;
}
Also used : TargetStackObject(mage.target.TargetStackObject)

Aggregations

TargetStackObject (mage.target.TargetStackObject)4 FilterControlledCreaturePermanent (mage.filter.common.FilterControlledCreaturePermanent)1 Permanent (mage.game.permanent.Permanent)1