use of mage.game.events.TappedForManaEvent in project mage by magefree.
the class ManaWebeffect method checkTrigger.
@Override
public boolean checkTrigger(GameEvent event, Game game) {
// it's non mana triggered ability, so ignore it on checking, see TAPPED_FOR_MANA
if (game.inCheckPlayableState()) {
return false;
}
Permanent permanent = ((TappedForManaEvent) event).getPermanent();
if (permanent == null || !permanent.isLand(game) || !game.getOpponents(permanent.getControllerId()).contains(getControllerId())) {
return false;
}
this.getEffects().setValue("tappedPermanent", permanent);
return true;
}
use of mage.game.events.TappedForManaEvent in project mage by magefree.
the class TapForManaAllTriggeredAbility method checkTrigger.
@Override
public boolean checkTrigger(GameEvent event, Game game) {
// it's non mana triggered ability, so ignore it on checking, see TAPPED_FOR_MANA
if (game.inCheckPlayableState()) {
return false;
}
TappedForManaEvent manaEvent = ((TappedForManaEvent) event);
Permanent permanent = manaEvent.getPermanent();
if (permanent == null || !filter.match(permanent, getSourceId(), getControllerId(), game)) {
return false;
}
getEffects().setValue("mana", manaEvent.getMana());
getEffects().setValue("tappedPermanent", permanent);
switch(setTargetPointer) {
case PERMANENT:
getEffects().setTargetPointer(new FixedTarget(permanent.getId(), permanent.getZoneChangeCounter(game)));
break;
case PLAYER:
getEffects().setTargetPointer(new FixedTarget(permanent.getControllerId()));
break;
}
return true;
}
use of mage.game.events.TappedForManaEvent in project mage by magefree.
the class VorinclexTriggeredAbility2 method checkTrigger.
@Override
public boolean checkTrigger(GameEvent event, Game game) {
// it's non mana triggered ability, so ignore it on checking, see TAPPED_FOR_MANA
if (game.inCheckPlayableState()) {
return false;
}
if (!game.getOpponents(getControllerId()).contains(event.getPlayerId())) {
return false;
}
Permanent permanent = ((TappedForManaEvent) event).getPermanent();
if (permanent == null || !permanent.isLand(game)) {
return false;
}
getEffects().setTargetPointer(new FixedTarget(permanent, game));
return true;
}
use of mage.game.events.TappedForManaEvent in project mage by magefree.
the class TapForManaAllTriggeredManaAbility method checkTrigger.
@Override
public boolean checkTrigger(GameEvent event, Game game) {
TappedForManaEvent manaEvent = ((TappedForManaEvent) event);
Permanent permanent = manaEvent.getPermanent();
if (permanent == null || !filter.match(permanent, getSourceId(), getControllerId(), game)) {
return false;
}
getEffects().setValue("mana", manaEvent.getMana());
getEffects().setValue("tappedPermanent", permanent);
switch(setTargetPointer) {
case PERMANENT:
getEffects().setTargetPointer(new FixedTarget(permanent.getId(), permanent.getZoneChangeCounter(game)));
break;
case PLAYER:
getEffects().setTargetPointer(new FixedTarget(permanent.getControllerId()));
break;
}
return true;
}
use of mage.game.events.TappedForManaEvent in project mage by magefree.
the class GauntletOfPowerManaEffect2 method checkTrigger.
@Override
public boolean checkTrigger(GameEvent event, Game game) {
TappedForManaEvent mEvent = (TappedForManaEvent) event;
Permanent permanent = mEvent.getPermanent();
if (permanent == null || !permanent.isLand() || !permanent.isBasic()) {
return false;
}
ObjectColor color = (ObjectColor) game.getState().getValue(getSourceId() + "_color");
if (color == null) {
return false;
}
Mana mana = mEvent.getMana();
if ((!color.isBlack() || mana.getBlack() < 1) && (!color.isBlue() || mana.getBlue() < 1) && (!color.isGreen() || mana.getGreen() < 1) && (!color.isWhite() || mana.getWhite() < 1) && (!color.isRed() || mana.getRed() < 1)) {
return false;
}
getEffects().setValue("mana", mEvent.getMana());
getEffects().setTargetPointer(new FixedTarget(permanent, game));
return true;
}
Aggregations