@Override public AddManaToManaPoolTargetControllerEffect copy() { return new AddManaToManaPoolTargetControllerEffect(this); }
@Override public boolean apply(Game game, Ability source) { Player player = game.getPlayer(getTargetPointer().getFirst(game, source)); if (player != null) { player.getManaPool().addMana(getMana(game, source), game, source, emptyOnlyOnTurnsEnd); return true; } return false; }
public OvergrowthTriggeredAbility() { super(Zone.BATTLEFIELD, new AddManaToManaPoolTargetControllerEffect(Mana.GreenMana(2), "their")); }
public EladamrisVineyard(UUID ownerId, CardSetInfo setInfo) { super(ownerId,setInfo,new CardType[]{CardType.ENCHANTMENT},"{G}"); // At the beginning of each player's precombat main phase, add {G}{G} to that player's mana pool. this.addAbility(new BeginningOfPreCombatMainTriggeredAbility( Zone.BATTLEFIELD, new AddManaToManaPoolTargetControllerEffect(Mana.GreenMana(2), "that player's"), TargetController.ANY, false, true)); }
public Tangleroot(UUID ownerId, CardSetInfo setInfo) { super(ownerId, setInfo, new CardType[]{CardType.ARTIFACT}, "{3}"); // Whenever a player casts a creature spell, that player adds {G}. this.addAbility(new SpellCastAllTriggeredAbility( new AddManaToManaPoolTargetControllerEffect(Mana.GreenMana(1), "their"), StaticFilters.FILTER_SPELL_A_CREATURE, false, SetTargetPointer.PLAYER)); }
public HighTideTriggeredAbility() { super(new AddManaToManaPoolTargetControllerEffect(new Mana(ColoredManaSymbol.U), "their"), Duration.EndOfTurn, false); this.usesStack = false; }
public BubblingMuckTriggeredAbility() { super(new AddManaToManaPoolTargetControllerEffect(new Mana(ColoredManaSymbol.B), "their"), Duration.EndOfTurn, false); this.usesStack = false; }
public ChaosMoonOddTriggeredAbility() { super(new AddManaToManaPoolTargetControllerEffect(new Mana(ColoredManaSymbol.R), "their"), Duration.EndOfTurn, false); this.usesStack = false; }
public WildGrowthTriggeredAbility() { super(Zone.BATTLEFIELD, new AddManaToManaPoolTargetControllerEffect(new Mana(ColoredManaSymbol.G), "their")); }
public VernalBloom(UUID ownerId, CardSetInfo setInfo) { super(ownerId,setInfo,new CardType[]{CardType.ENCHANTMENT},"{3}{G}"); // Whenever a Forest is tapped for mana, its controller adds {G}. this.addAbility(new TapForManaAllTriggeredManaAbility( new AddManaToManaPoolTargetControllerEffect(new Mana(ColoredManaSymbol.G), "their"), filter, SetTargetPointer.PLAYER)); }
public MagusOfTheVineyard(UUID ownerId, CardSetInfo setInfo) { super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{G}"); this.subtype.add(SubType.HUMAN); this.subtype.add(SubType.WIZARD); this.power = new MageInt(1); this.toughness = new MageInt(1); // At the beginning of each player's precombat main phase, add {G}{G} to that player's mana pool. this.addAbility(new BeginningOfPreCombatMainTriggeredAbility( Zone.BATTLEFIELD, new AddManaToManaPoolTargetControllerEffect(Mana.GreenMana(2), "that player's"), TargetController.ANY, false, true)); }
@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; }
public GauntletOfMight(UUID ownerId, CardSetInfo setInfo) { super(ownerId,setInfo,new CardType[]{CardType.ARTIFACT},"{4}"); // Red creatures get +1/+1. this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostAllEffect(1, 1, Duration.WhileOnBattlefield, filter, false))); // Whenever a Mountain is tapped for mana, its controller adds {R}. ManaEffect effect = new AddManaToManaPoolTargetControllerEffect(new Mana(ColoredManaSymbol.R), "their"); effect.setText("its controller adds {R}"); this.addAbility(new TapForManaAllTriggeredManaAbility( effect, filterMountain, SetTargetPointer.PLAYER)); }
public ShizukoCallerOfAutumn(UUID ownerId, CardSetInfo setInfo) { super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{1}{G}{G}"); addSuperType(SuperType.LEGENDARY); this.subtype.add(SubType.SNAKE); this.subtype.add(SubType.SHAMAN); this.power = new MageInt(2); this.toughness = new MageInt(3); // At the beginning of each player's upkeep, that player adds {G}{G}{G}. Until end of turn, this mana doesn't empty from that player's mana pool as steps and phases end. Effect effect = new AddManaToManaPoolTargetControllerEffect(Mana.GreenMana(3), "that player", true); effect.setText("that player adds {G}{G}{G}. Until end of turn, this mana doesn't empty from that player's mana pool as steps and phases end"); this.addAbility(new BeginningOfUpkeepTriggeredAbility(Zone.BATTLEFIELD, effect, TargetController.ANY, false)); }
public SakuraTribeSpringcaller(UUID ownerId, CardSetInfo setInfo) { super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{3}{G}"); this.subtype.add(SubType.SNAKE); this.subtype.add(SubType.SHAMAN); this.power = new MageInt(2); this.toughness = new MageInt(4); // At the beginning of your upkeep, add {G}. Until end of turn, you don't lose this mana as steps and phases end. Effect effect = new AddManaToManaPoolTargetControllerEffect(new Mana(Mana.GreenMana(1)), "your", true); effect.setText("add {G}. Until end of turn, you don't lose this mana as steps and phases end"); this.addAbility(new BeginningOfUpkeepTriggeredAbility(Zone.BATTLEFIELD, effect, TargetController.YOU, false)); }
@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; }
public Valleymaker(UUID ownerId, CardSetInfo setInfo) { super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{5}{R/G}"); this.subtype.add(SubType.GIANT); this.subtype.add(SubType.SHAMAN); this.power = new MageInt(5); this.toughness = new MageInt(5); // {tap}, Sacrifice a Mountain: Valleymaker deals 3 damage to target creature. Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new DamageTargetEffect(3), new TapSourceCost()); ability.addCost(new SacrificeTargetCost(new TargetControlledPermanent(filter))); ability.addTarget(new TargetCreaturePermanent()); this.addAbility(ability); // {tap}, Sacrifice a Forest: Choose a player. That player adds {G}{G}{G}. Ability ability2 = new SimpleManaAbility(Zone.BATTLEFIELD, new AddManaToManaPoolTargetControllerEffect(Mana.GreenMana(3), "chosen player"), new TapSourceCost()); ability2.addCost(new SacrificeTargetCost(new TargetControlledPermanent(filter2))); ability2.addTarget(new TargetPlayer(1, 1, true)); this.addAbility(ability2); }
@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; } }
@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.getSourceId(), game); // mana gets added also if counter is not successful int cmc = spell.getConvertedManaCost(); 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; } }