use of mage.game.events.ManaEvent in project mage by magefree.
the class HarvestMageReplacementEffect method replaceEvent.
@Override
public boolean replaceEvent(GameEvent event, Ability source, Game game) {
ManaEvent manaEvent = (ManaEvent) event;
Mana mana = manaEvent.getMana();
if (game != null && game.inCheckPlayableState()) {
mana.setToMana(new Mana(0, 0, 0, 0, 0, 0, 1, 0));
return false;
}
new AddManaOfAnyColorEffect().apply(game, source);
mana.setToMana(new Mana(0, 0, 0, 0, 0, 0, 0, 0));
return true;
}
use of mage.game.events.ManaEvent in project mage by magefree.
the class PulseOfLlanowarReplacementEffect method replaceEvent.
@Override
public boolean replaceEvent(GameEvent event, Ability source, Game game) {
ManaEvent manaEvent = (ManaEvent) event;
Mana mana = manaEvent.getMana();
new AddManaOfAnyColorEffect(mana.count()).apply(game, source);
mana.setToMana(new Mana(0, 0, 0, 0, 0, 0, 0, 0));
return true;
}
use of mage.game.events.ManaEvent in project mage by magefree.
the class DampingSphereIncreasementAllEffect method replaceEvent.
@Override
public boolean replaceEvent(GameEvent event, Ability source, Game game) {
ManaEvent manaEvent = (ManaEvent) event;
Mana mana = manaEvent.getMana();
mana.setToMana(Mana.ColorlessMana(1));
return false;
}
use of mage.game.events.ManaEvent in project mage by magefree.
the class ExtraplanarLensTriggeredAbility method checkTrigger.
@Override
public boolean checkTrigger(GameEvent event, Game game) {
// need only info about permanent
Permanent landTappedForMana = ((TappedForManaEvent) event).getPermanent();
Permanent extraplanarLens = game.getPermanent(getSourceId());
if (extraplanarLens != null && landTappedForMana != null && !extraplanarLens.getImprinted().isEmpty()) {
Card imprinted = game.getCard(extraplanarLens.getImprinted().get(0));
if (imprinted != null && game.getState().getZone(imprinted.getId()) == Zone.EXILED) {
if (landTappedForMana.getName().equals(imprinted.getName()) && landTappedForMana.isLand(game)) {
ManaEvent mEvent = (ManaEvent) event;
for (Effect effect : getEffects()) {
effect.setValue("mana", mEvent.getMana());
effect.setValue("tappedPermanent", landTappedForMana);
}
getEffects().get(0).setTargetPointer(new FixedTarget(landTappedForMana.getId()));
return true;
}
}
}
return false;
}
use of mage.game.events.ManaEvent in project mage by magefree.
the class PaleMoonReplacementEffect method replaceEvent.
@Override
public boolean replaceEvent(GameEvent event, Ability source, Game game) {
ManaEvent manaEvent = (ManaEvent) event;
Mana mana = manaEvent.getMana();
mana.setToMana(Mana.ColorlessMana(mana.count()));
return false;
}
Aggregations