use of mage.game.events.ZoneChangeEvent in project mage by magefree.
the class UginTheIneffableLookAtFaceDownEffect method checkTrigger.
@Override
public boolean checkTrigger(GameEvent event, Game game) {
ZoneChangeEvent zEvent = ((ZoneChangeEvent) event);
if (zEvent.getToZone() == Zone.BATTLEFIELD || tokenRefs.stream().noneMatch(tokenRef -> tokenRef.refersTo(zEvent.getTarget(), game))) {
return false;
}
this.getEffects().clear();
Effect effect = new ReturnToHandTargetEffect();
effect.setTargetPointer(new FixedTarget(cardRef));
this.addEffect(effect);
return true;
}
use of mage.game.events.ZoneChangeEvent in project mage by magefree.
the class CalixDestinysHandReturnEffect method checkTrigger.
@Override
public boolean checkTrigger(GameEvent event, Game game) {
ZoneChangeEvent zEvent = (ZoneChangeEvent) event;
if (zEvent.getFromZone() != Zone.BATTLEFIELD || !this.myMor.refersTo(zEvent.getTarget(), game)) {
return false;
}
this.getEffects().clear();
this.addEffect(new ReturnToBattlefieldUnderOwnerControlTargetEffect(false, false).setTargetPointer(new FixedTarget(this.theirMor)));
return true;
}
use of mage.game.events.ZoneChangeEvent in project mage by magefree.
the class GrolnokTheOmnivorePlayEffect method checkTrigger.
@Override
public boolean checkTrigger(GameEvent event, Game game) {
ZoneChangeEvent zEvent = (ZoneChangeEvent) event;
Card card = game.getCard(zEvent.getTargetId());
if (card != null && zEvent.getToZone() == Zone.GRAVEYARD && zEvent.getFromZone() == Zone.LIBRARY && card.isOwnedBy(controllerId) && card.isPermanent(game)) {
getEffects().setTargetPointer(new FixedTarget(card, game));
return true;
}
return false;
}
use of mage.game.events.ZoneChangeEvent in project mage by magefree.
the class MagusOfTheBridgeTriggeredAbility method checkTrigger.
@Override
public boolean checkTrigger(GameEvent event, Game game) {
ZoneChangeEvent zEvent = (ZoneChangeEvent) event;
if (zEvent.isDiesEvent()) {
Permanent permanent = zEvent.getTarget();
Player controller = game.getPlayer(getControllerId());
return permanent != null && controller != null && permanent.isCreature(game) && controller.hasOpponent(permanent.getOwnerId(), game);
}
return false;
}
use of mage.game.events.ZoneChangeEvent in project mage by magefree.
the class PlanarVoidTriggeredAbility method checkTrigger.
@Override
public boolean checkTrigger(GameEvent event, Game game) {
ZoneChangeEvent zEvent = (ZoneChangeEvent) event;
if (zEvent.getToZone() != Zone.GRAVEYARD || event.getTargetId().equals(getSourceId())) {
return false;
}
this.getEffects().setTargetPointer(new FixedTarget(event.getTargetId(), game));
return true;
}
Aggregations