use of mage.abilities.effects.mana.AddManaToManaPoolTargetControllerEffect in project mage by magefree.
the class MarkOfSakikoTriggeredAbility method checkTrigger.
@Override
public boolean checkTrigger(GameEvent event, Game game) {
if (((DamagedEvent) event).isCombatDamage()) {
if (event.getSourceId().equals(getSourceId())) {
this.getEffects().clear();
Effect effect = new AddManaToManaPoolTargetControllerEffect(Mana.GreenMana(event.getAmount()), "that player", true);
effect.setTargetPointer(new FixedTarget(getControllerId()));
effect.setText("add that much {G}. Until end of turn, you don't lose this mana as steps and phases end");
this.addEffect(effect);
return true;
}
}
return false;
}
use of mage.abilities.effects.mana.AddManaToManaPoolTargetControllerEffect in project mage by magefree.
the class ManaDrainCounterEffect method apply.
@Override
public boolean apply(Game game, Ability source) {
Spell spell = game.getStack().getSpell(getTargetPointer().getFirst(game, source));
if (spell != null) {
game.getStack().counter(getTargetPointer().getFirst(game, source), source, game);
// mana gets added also if counter is not successful
int cmc = spell.getManaValue();
Effect effect = new AddManaToManaPoolTargetControllerEffect(Mana.ColorlessMana(cmc), "your");
effect.setTargetPointer(new FixedTarget(source.getControllerId()));
AtTheBeginOfMainPhaseDelayedTriggeredAbility delayedAbility = new AtTheBeginOfMainPhaseDelayedTriggeredAbility(effect, false, TargetController.YOU, PhaseSelection.NEXT_MAIN);
game.addDelayedTriggeredAbility(delayedAbility, source);
return true;
}
return false;
}
use of mage.abilities.effects.mana.AddManaToManaPoolTargetControllerEffect in project mage by magefree.
the class SakikoMotherOfSummerTriggeredAbility method checkTrigger.
@Override
public boolean checkTrigger(GameEvent event, Game game) {
if (((DamagedPlayerEvent) event).isCombatDamage()) {
Permanent creature = game.getPermanent(event.getSourceId());
if (creature != null && creature.isControlledBy(controllerId)) {
this.getEffects().clear();
Effect effect = new AddManaToManaPoolTargetControllerEffect(Mana.GreenMana(event.getAmount()), "that player", true);
effect.setTargetPointer(new FixedTarget(creature.getControllerId()));
effect.setText("add that much {G}. Until end of turn, you don't lose this mana as steps and phases end");
this.addEffect(effect);
return true;
}
}
return false;
}
use of mage.abilities.effects.mana.AddManaToManaPoolTargetControllerEffect in project mage by magefree.
the class StadiumVendorsEffect method apply.
@Override
public boolean apply(Game game, Ability source) {
Player controller = game.getPlayer(source.getControllerId());
if (controller == null) {
return false;
}
TargetPlayer target = new TargetPlayer(1, 1, true);
if (controller.choose(Outcome.Benefit, target, source.getSourceId(), game)) {
Player player = game.getPlayer(target.getFirstTarget());
ChoiceColor colorChoice = new ChoiceColor(true);
if (player == null || !player.choose(Outcome.Benefit, colorChoice, game)) {
return false;
}
Effect effect = new AddManaToManaPoolTargetControllerEffect(colorChoice.getMana(2), "that player's");
effect.setTargetPointer(new FixedTarget(player.getId(), game));
return effect.apply(game, source);
}
return false;
}
Aggregations