@Override public GetEnergyCountersControllerEffect copy() { return new GetEnergyCountersControllerEffect(this); } }
@Override public boolean apply(Game game, Ability source) { int amount = (Integer) getValue("damage"); if (amount > 0) { Player controller = game.getPlayer(source.getControllerId()); if (controller != null) { return new GetEnergyCountersControllerEffect(amount).apply(game, source); } } return false; } }
public GetEnergyCountersControllerEffect(DynamicValue value) { super(Outcome.Benefit); this.value = value; setText(); }
public GontisMachinationsTriggeredAbility() { super(Zone.BATTLEFIELD, new GetEnergyCountersControllerEffect(1), false); }
@Override public boolean apply(Game game, Ability source) { Player controller = game.getPlayer(source.getControllerId()); if (controller != null) { new GetEnergyCountersControllerEffect(3).apply(game, source); int numberToPay = controller.getAmount(0, controller.getCounters().getCount(CounterType.ENERGY), "How many {E} do you like to pay?", game); if (numberToPay > 0) { Cost cost = new PayEnergyCost(numberToPay); if (cost.pay(source, game, source.getSourceId(), source.getControllerId(), true)) { Permanent targetCreature = game.getPermanent(getTargetPointer().getFirst(game, source)); if (targetCreature != null) { targetCreature.damage(numberToPay, source.getSourceId(), game, false, true); } } } return true; } return false; } }
public SageOfShailasClaim(UUID ownerId, CardSetInfo setInfo) { super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{1}{G}"); this.subtype.add(SubType.ELF); this.subtype.add(SubType.DRUID); this.power = new MageInt(2); this.toughness = new MageInt(1); // When Sage of Shalia's Claim enters the battlefield, you get {E}{E}{E}. this.addAbility(new EntersBattlefieldTriggeredAbility(new GetEnergyCountersControllerEffect(3))); }
@Override public boolean apply(Game game, Ability source) { Player controller = game.getPlayer(source.getControllerId()); if (controller != null) { new GetEnergyCountersControllerEffect(2).apply(game, source); if (controller.getCounters().getCount(CounterType.ENERGY) > 7) { Cost cost = new PayEnergyCost(8); if (controller.chooseUse(outcome, "Pay {E}{E}{E}{E}{E}{E}{E}{E} to use this? ", "Untap all creatures you control and after this phase, there is an additional combat phase.", "Yes", "No", source, game) && cost.pay(source, game, source.getSourceId(), source.getControllerId(), true)) { new UntapAllControllerEffect(new FilterControlledCreaturePermanent()).apply(game, source); new AdditionalCombatPhaseEffect().apply(game, source); } } return true; } return false; }
public AetherHub(UUID ownerId, CardSetInfo setInfo) { super(ownerId,setInfo,new CardType[]{CardType.LAND},""); // When Aether Hub enters the battlefield, you get {E}. this.addAbility(new EntersBattlefieldTriggeredAbility(new GetEnergyCountersControllerEffect(1))); // {T}: Add {C}. this.addAbility(new ColorlessManaAbility()); // {T}, Pay {E}: Add one mana of any color. Ability ability = new AnyColorManaAbility(); ability.addCost(new PayEnergyCost(1)); this.addAbility(ability); }
@Override public boolean apply(Game game, Ability source) { Player controller = game.getPlayer(source.getControllerId()); if (controller != null) { new GetEnergyCountersControllerEffect(2).apply(game, source); int max = controller.getCounters().getCount(CounterType.ENERGY); int numberToPayed = controller.getAmount(0, max, "How many energy counters do you like to pay? (maximum = " + max + ')', game); if (numberToPayed > 0) { Cost cost = new PayEnergyCost(numberToPayed); if (cost.pay(source, game, source.getSourceId(), source.getControllerId(), true)) { Permanent targetCreature = game.getPermanent(getTargetPointer().getFirst(game, source)); if (targetCreature != null) { numberToPayed *= -1; ContinuousEffect effect = new BoostTargetEffect(numberToPayed, numberToPayed, Duration.EndOfTurn); effect.setTargetPointer(new FixedTarget(targetCreature, game)); game.addEffect(effect, source); } } } return true; } return false; } }
public FabricationModule(UUID ownerId, CardSetInfo setInfo) { super(ownerId,setInfo,new CardType[]{CardType.ARTIFACT},"{3}"); // Whenever you get one or more {E}, put a +1/+1 counter on target creature you control. Ability ability = new FabricationModuleTriggeredAbility(); ability.addTarget(new TargetControlledCreaturePermanent()); this.addAbility(ability); // {4}, {T}: You get {E}. ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new GetEnergyCountersControllerEffect(1), new GenericManaCost(4)); ability.addCost(new TapSourceCost()); this.addAbility(ability); }
@Override public boolean apply(Game game, Ability source) { Player controller = game.getPlayer(source.getControllerId()); if (controller != null) { new GetEnergyCountersControllerEffect(4).apply(game, source); Permanent targetPermanent = game.getPermanent(getTargetPointer().getFirst(game, source)); if (targetPermanent != null) { Cost cost = new PayEnergyCost(targetPermanent.getManaCost().convertedManaCost()); if (cost.canPay(source, source.getSourceId(), source.getControllerId(), game)) { int convertedManaCost = targetPermanent.getManaCost().convertedManaCost(); StringBuilder energy = new StringBuilder(convertedManaCost); for (int i = 0; i < convertedManaCost; i++) { energy.append("{E}"); } if (controller.chooseUse(outcome, "Pay " + energy + " to get control of " + targetPermanent.getLogName() + '?', source, game)) { if (cost.pay(source, game, source.getSourceId(), source.getControllerId(), true)) { ContinuousEffect controllEffect = new GainControlTargetEffect(Duration.Custom); controllEffect.setTargetPointer(new FixedTarget(targetPermanent, game)); game.addEffect(controllEffect, source); } } } } return true; } return false; } }
public GontisAetherHeart(UUID ownerId, CardSetInfo setInfo) { super(ownerId, setInfo, new CardType[]{CardType.ARTIFACT}, "{6}"); addSuperType(SuperType.LEGENDARY); // Whenever Gonti's Aether Heart or another artifact enters the battlefield under your control, you get {E}{E} <i>(two energy counters). this.addAbility(new EntersBattlefieldControlledTriggeredAbility(Zone.BATTLEFIELD, new GetEnergyCountersControllerEffect(2), filter, false)); // Pay {E}{E}{E}{E}{E}{E}{E}{E}, Exile Gonti's Aether Heart: Take an extra turn after this one. Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new AddExtraTurnControllerEffect(), new PayEnergyCost(8)); ability.addCost(new ExileSourceCost()); this.addAbility(ability); }
public ShipwreckMoray(UUID ownerId, CardSetInfo setInfo) { super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{3}{U}"); this.subtype.add(SubType.FISH); this.power = new MageInt(0); this.toughness = new MageInt(5); // When Shipwreck Moray enters the battlefield, you get {E}{E}{E}{E}. this.addAbility(new EntersBattlefieldTriggeredAbility(new GetEnergyCountersControllerEffect(4))); // Pay {E}: Shipwreck Moray gets +2/-2 until end of turn. this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new BoostSourceEffect(2, -2, Duration.EndOfTurn), new PayEnergyCost(1))); }
public ConsulateSurveillance(UUID ownerId, CardSetInfo setInfo) { super(ownerId,setInfo,new CardType[]{CardType.ENCHANTMENT},"{3}{W}"); // When Consulate Surveillance enters the battlefield, you get {E}{E}{E}{E}. this.addAbility(new EntersBattlefieldTriggeredAbility(new GetEnergyCountersControllerEffect(4))); // Pay {E}{E}: Prevent all damage that would be dealt to you this turn by a source of your choice. this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new PreventAllDamageFromChosenSourceToYouEffect(Duration.EndOfTurn, new FilterObject("source"), false), new PayEnergyCost(2))); }
public AethergeodeMiner(UUID ownerId, CardSetInfo setInfo) { super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{1}{W}"); this.subtype.add(SubType.DWARF); this.subtype.add(SubType.SCOUT); this.power = new MageInt(3); this.toughness = new MageInt(1); // Whenever Aethergeode Miner attacks, you get {E}{E}. this.addAbility(new AttacksTriggeredAbility(new GetEnergyCountersControllerEffect(2), false)); // Pay {E}{E}: Exile Aethergeode Miner, then return it to the battlefield under its owner's control. this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new AethergeodeMinerEffect(), new PayEnergyCost(2))); }
public LongtuskCub(UUID ownerId, CardSetInfo setInfo) { super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{1}{G}"); this.subtype.add(SubType.CAT); this.power = new MageInt(2); this.toughness = new MageInt(2); // Whenever Longtusk Cub deals combat damage to a player, you get {E}{E}. this.addAbility(new DealsCombatDamageToAPlayerTriggeredAbility(new GetEnergyCountersControllerEffect(2), false)); // Pay {E}{E}: Put a +1/+1 counter on Longtusk Cub. this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new AddCountersSourceEffect(CounterType.P1P1.createInstance()), new PayEnergyCost(2))); }
public ServantOfTheConduit(UUID ownerId, CardSetInfo setInfo) { super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{1}{G}"); this.subtype.add(SubType.ELF); this.subtype.add(SubType.DRUID); this.power = new MageInt(2); this.toughness = new MageInt(2); // When Servant of the Conduit enters teh battlefield, you get {E}{E}. this.addAbility(new EntersBattlefieldTriggeredAbility(new GetEnergyCountersControllerEffect(2))); // {T}, Pay {E}: Add one mana of any color. Ability ability = new AnyColorManaAbility(new TapSourceCost()); ability.addCost(new PayEnergyCost(1)); this.addAbility(ability); }
public AethertideWhale(UUID ownerId, CardSetInfo setInfo) { super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{4}{U}{U}"); this.subtype.add(SubType.WHALE); this.power = new MageInt(6); this.toughness = new MageInt(4); // Flying this.addAbility(FlyingAbility.getInstance()); // When Aethertide Whale enters the battlefield, you get {E}{E}{E}{E}{E}{E}. this.addAbility(new EntersBattlefieldTriggeredAbility(new GetEnergyCountersControllerEffect(6))); // Pay {E}{E}{E}{E}: Return Aethertide Whale to its owner's hand. this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new ReturnToHandSourceEffect(true), new PayEnergyCost(4))); }
public EraOfInnovation(UUID ownerId, CardSetInfo setInfo) { super(ownerId,setInfo,new CardType[]{CardType.ENCHANTMENT},"{1}{U}"); // Whenever an artifact or Artificer enters the battlefield under you control, you may pay {1}. If you do, you get {E}{E}. Effect effect = new DoIfCostPaid(new GetEnergyCountersControllerEffect(2), new GenericManaCost(1)); this.addAbility(new EntersBattlefieldAllTriggeredAbility(effect, filter, "Whenever an artifact or Artificer enters the battlefield under you control, you may pay {1}. If you do, you get {E}{E}.")); // {E}{E}{E}{E}{E}{E}, Sacrifice Era of Innovation: Draw three cards. Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new DrawCardSourceControllerEffect(3), new PayEnergyCost(6)); ability.addCost(new SacrificeSourceCost()); this.addAbility(ability); }
public AetherworksMarvel(UUID ownerId, CardSetInfo setInfo) { super(ownerId, setInfo, new CardType[]{CardType.ARTIFACT}, "{4}"); addSuperType(SuperType.LEGENDARY); // Whenever a permanent you control is put into a graveyard, you get {E}. this.addAbility(new PutIntoGraveFromBattlefieldAllTriggeredAbility(new GetEnergyCountersControllerEffect(1), false, new FilterControlledPermanent("a permanent you control"), false)); // {T}, Pay {E}{E}{E}{E}{E}{E}: Look at the top six cards of your library. You may cast a card from among them without paying its mana cost. Put the rest on the bottom of your library in a random order. Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new AetherworksMarvelEffect(), new TapSourceCost()); ability.addCost(new PayEnergyCost(6)); this.addAbility(ability); }