congrats Icon
New! Tabnine Pro 14-day free trial
Start a free trial
Tabnine Logo
RemoveCounterSourceEffect
Code IndexAdd Tabnine to your IDE (free)

How to use
RemoveCounterSourceEffect
in
mage.abilities.effects.common.counter

Best Java code snippets using mage.abilities.effects.common.counter.RemoveCounterSourceEffect (Showing top 20 results out of 315)

origin: magefree/mage

@Override
public RemoveCounterSourceEffect copy() {
  return new RemoveCounterSourceEffect(this);
}
origin: magefree/mage

  @Override
  public boolean apply(Game game, Ability source) {
    Player controller = game.getPlayer(source.getControllerId());
    if (controller == null) {
      return false;
    }
    MageObject sourceObject = source.getSourceObjectIfItStillExists(game);
    if (sourceObject instanceof Card) {
      Card card = (Card) sourceObject;
      new RemoveCounterSourceEffect(CounterType.EGG.createInstance()).apply(game, source);
      if (card.getCounters(game).getCount(CounterType.EGG) == 0) {
        controller.moveCards(card, Zone.BATTLEFIELD, source, game);
      }
      return true;
    }
    return false;
  }
}
origin: magefree/mage

public RemoveCounterSourceEffect(Counter counter) {
  super(Outcome.UnboostCreature);
  this.counter = counter;
  setText();
}
origin: magefree/mage

public AzorsElocutorsTriggeredAbility() {
  super(Zone.BATTLEFIELD, new RemoveCounterSourceEffect(CounterType.FILIBUSTER.createInstance()), false);
}
origin: magefree/mage

  @Override
  public boolean apply(Game game, Ability source) {
    Player controller = game.getPlayer(source.getControllerId());
    Permanent sourcePermanent = game.getPermanent(source.getSourceId());
    if (controller != null && sourcePermanent != null) {
      if (!sourcePermanent.getCounters(game).containsKey(CounterType.PLAGUE) || controller.chooseUse(outcome, "Put a plague counter on? (No removes one)", source, game)) {
        return new AddCountersSourceEffect(CounterType.PLAGUE.createInstance(), true).apply(game, source);
      } else {
        return new RemoveCounterSourceEffect(CounterType.PLAGUE.createInstance()).apply(game, source);
      }
    }
    return false;
  }
}
origin: magefree/mage

public SuspendBeginningOfUpkeepInterveningIfTriggeredAbility() {
  super(new BeginningOfUpkeepTriggeredAbility(Zone.EXILED, new RemoveCounterSourceEffect(CounterType.TIME.createInstance()), TargetController.YOU, false),
      SuspendedCondition.instance,
      "At the beginning of your upkeep, if this card ({this}) is suspended, remove a time counter from it.");
  this.setRuleVisible(false);
}
origin: magefree/mage

  @Override
  public boolean apply(Game game, Ability source) {
    Player controller = game.getPlayer(source.getControllerId());
    Permanent sourcePermanent = game.getPermanent(source.getSourceId());
    if (controller != null && sourcePermanent != null) {
      if (!sourcePermanent.getCounters(game).containsKey(CounterType.CHARGE) || controller.chooseUse(outcome, "Put a charge counter on? (No removes one)", source, game)) {
        return new AddCountersSourceEffect(CounterType.CHARGE.createInstance(), true).apply(game, source);
      } else {
        return new RemoveCounterSourceEffect(CounterType.CHARGE.createInstance()).apply(game, source);
      }
    }
    return false;
  }
}
origin: magefree/mage

public RepairBeginningOfUpkeepInterveningIfTriggeredAbility() {
  super(new BeginningOfUpkeepTriggeredAbility(Zone.GRAVEYARD, new RemoveCounterSourceEffect(CounterType.REPAIR.createInstance()), TargetController.YOU, false),
      new SourceHasCounterCondition(CounterType.REPAIR),
      "At the beginning of your upkeep, remove a repair counter from {this}");
  this.setRuleVisible(false);
}
origin: magefree/mage

@Override
public boolean apply(Game game, Ability source) {
  Player controller = game.getPlayer(source.getControllerId());
  Permanent permanent = game.getPermanent(source.getSourceId());
  if (controller != null && permanent != null) {
    if (controller.flipCoin(source, game, true)) {
      game.informPlayers("Chaotic Goo: Won flip. Put a +1/+1 counter on Chaotic Goo.");
      new AddCountersSourceEffect(CounterType.P1P1.createInstance(1)).apply(game, source);
      return true;
    } else {
      game.informPlayers("Chaotic Goo: Lost flip. Remove a +1/+1 counter on Chaotic Goo.");
      new RemoveCounterSourceEffect(CounterType.P1P1.createInstance(1)).apply(game, source);
      return true;
      }
    }
  return false;
}
origin: magefree/mage

public MerseineActivatedAbility() {
  super(Zone.BATTLEFIELD, new RemoveCounterSourceEffect(CounterType.NET.createInstance()), new MerseineCost());
}
origin: magefree/mage

@Override
public boolean apply(Game game, Ability source) {
  Player controller = game.getPlayer(source.getControllerId());
  Permanent permanent = game.getPermanent(source.getSourceId());
  if (controller != null && permanent != null) {
    if (controller.flipCoin(source, game, true)) {
      game.informPlayers("Goblin Bomb: Won flip. Put a fuse counter on Goblin Bomb.");
      new AddCountersSourceEffect(CounterType.FUSE.createInstance(1)).apply(game, source);
      return true;
    } else {
      game.informPlayers("Goblin Bomb: Lost flip. Remove a fuse counter from Goblin Bomb.");
      new RemoveCounterSourceEffect(CounterType.FUSE.createInstance(1)).apply(game, source);
      return true;
    }
  }
  return false;
}
origin: magefree/mage

@Override
public boolean apply(Game game, Ability source) {
  Permanent p = game.getPermanent(source.getSourceId());
  if (p != null) {
    AtTheEndOfCombatDelayedTriggeredAbility ability = new AtTheEndOfCombatDelayedTriggeredAbility(new RemoveCounterSourceEffect(CounterType.P1P1.createInstance()));
    game.addDelayedTriggeredAbility(ability, source);
  }
  return false;
}
origin: magefree/mage

@Override
public boolean apply(Game game, Ability source) {
  Permanent p = game.getPermanent(source.getSourceId());
  if (p != null) {
    AtTheEndOfCombatDelayedTriggeredAbility ability = new AtTheEndOfCombatDelayedTriggeredAbility(new RemoveCounterSourceEffect(CounterType.P1P1.createInstance()));
    game.addDelayedTriggeredAbility(ability, source);
  }
  return false;
}
origin: magefree/mage

@Override
public boolean apply(Game game, Ability source) {
  Permanent p = game.getPermanent(source.getSourceId());
  if (p != null) {
    AtTheEndOfCombatDelayedTriggeredAbility ability = new AtTheEndOfCombatDelayedTriggeredAbility(new RemoveCounterSourceEffect(CounterType.P1P1.createInstance()));
    game.addDelayedTriggeredAbility(ability, source);
  }
  return false;
}
origin: magefree/mage

public BelligerentHatchling(UUID ownerId, CardSetInfo setInfo) {
  super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{3}{R/W}");
  this.subtype.add(SubType.ELEMENTAL);
  this.power = new MageInt(6);
  this.toughness = new MageInt(6);
  // First strike
  this.addAbility(FirstStrikeAbility.getInstance());
  // Belligerent Hatchling enters the battlefield with four -1/-1 counters on it.
  this.addAbility(new EntersBattlefieldAbility(new AddCountersSourceEffect(CounterType.M1M1.createInstance(4)),"with four -1/-1 counters on it"));
  // Whenever you cast a red spell, remove a -1/-1 counter from Belligerent Hatchling.
  this.addAbility(new SpellCastControllerTriggeredAbility(new RemoveCounterSourceEffect(CounterType.M1M1.createInstance(1)), filterRedSpell, false));
  // Whenever you cast a white spell, remove a -1/-1 counter from Belligerent Hatchling.
  this.addAbility(new SpellCastControllerTriggeredAbility(new RemoveCounterSourceEffect(CounterType.M1M1.createInstance(1)), filterWhiteSpell, false));
}
origin: magefree/mage

public NoxiousHatchling(UUID ownerId, CardSetInfo setInfo) {
  super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{3}{B/G}");
  this.subtype.add(SubType.ELEMENTAL);
  this.power = new MageInt(6);
  this.toughness = new MageInt(6);
  // Noxious Hatchling enters the battlefield with four -1/-1 counters on it.
  this.addAbility(new EntersBattlefieldAbility(new AddCountersSourceEffect(CounterType.M1M1.createInstance(4)),"with four -1/-1 counters on it"));
  // Wither (This deals damage to creatures in the form of -1/-1 counters.)
  this.addAbility(WitherAbility.getInstance());
  // Whenever you cast a black spell, remove a -1/-1 counter from Noxious Hatchling.
  this.addAbility(new SpellCastControllerTriggeredAbility(new RemoveCounterSourceEffect(CounterType.M1M1.createInstance()), filterBlackSpell, false));
  // Whenever you cast a green spell, remove a -1/-1 counter from Noxious Hatchling.
  this.addAbility(new SpellCastControllerTriggeredAbility(new RemoveCounterSourceEffect(CounterType.M1M1.createInstance()), filterGreenSpell, false));
}
origin: magefree/mage

public GreaterGargadonAbility() {
  super(Zone.EXILED, new RemoveCounterSourceEffect(CounterType.TIME.createInstance()), new SacrificeTargetCost(new TargetControlledPermanent(filter)));
}
origin: magefree/mage

public DivineIntervention(UUID ownerId, CardSetInfo setInfo) {
  super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{6}{W}{W}");
  // Divine Intervention enters the battlefield with 2 intervention counters on it.
  Effect effect = new AddCountersSourceEffect(CounterType.INTERVENTION.createInstance(2));
  this.addAbility(new EntersBattlefieldAbility(effect, "with 2 intervention counters"));
  // At the beginning of your upkeep, remove an intervention counter from Divine Intervention.
  this.addAbility(new BeginningOfUpkeepTriggeredAbility(new RemoveCounterSourceEffect(CounterType.INTERVENTION.createInstance()), TargetController.YOU, false));
  // Whenever a intervention counter is removed from Protean Hydra, put two intervention counters on it at the beginning of the next end step.
  this.addAbility(new DivineInterventionAbility());
}
origin: magefree/mage

public VoraciousHatchling(UUID ownerId, CardSetInfo setInfo) {
  super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{3}{W/B}");
  this.subtype.add(SubType.ELEMENTAL);
  this.power = new MageInt(6);
  this.toughness = new MageInt(6);
  // Lifelink
  this.addAbility(LifelinkAbility.getInstance());
  // Voracious Hatchling enters the battlefield with four -1/-1 counters on it.
  this.addAbility(new EntersBattlefieldAbility(new AddCountersSourceEffect(CounterType.M1M1.createInstance(4)),"with four -1/-1 counters on it"));
  // Whenever you cast a white spell, remove a -1/-1 counter from Voracious Hatchling.
  this.addAbility(new SpellCastControllerTriggeredAbility(new RemoveCounterSourceEffect(CounterType.M1M1.createInstance(1)), filterWhiteSpell, false));
  // Whenever you cast a black spell, remove a -1/-1 counter from Voracious Hatchling.
  this.addAbility(new SpellCastControllerTriggeredAbility(new RemoveCounterSourceEffect(CounterType.M1M1.createInstance(1)), filterBlackSpell, false));
}
origin: magefree/mage

public CelestialConvergence(UUID ownerId, CardSetInfo setInfo) {
  super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{2}{W}{W}");
  // Celestial Convergence enters the battlefield with seven omen counters on it.
  Effect effect = new AddCountersSourceEffect(CounterType.OMEN.createInstance(7));
  this.addAbility(new EntersBattlefieldAbility(effect, "with seven omen counters"));
  // At the beginning of your upkeep, remove an omen counter from Celestial Convergence. If there are no omen counters on Celestial Convergence, the player with the highest life total wins the game. If two or more players are tied for highest life total, the game is a draw.
  Ability ability = new BeginningOfUpkeepTriggeredAbility(
      Zone.BATTLEFIELD, new RemoveCounterSourceEffect(CounterType.OMEN.createInstance(1)), TargetController.YOU, false);
  ability.addEffect(new CelestialConvergenceEffect());
  this.addAbility(ability);
}
mage.abilities.effects.common.counterRemoveCounterSourceEffect

Most used methods

  • <init>
  • apply
  • setText

Popular in Java

  • Creating JSON documents from java classes using gson
  • setRequestProperty (URLConnection)
  • scheduleAtFixedRate (Timer)
  • notifyDataSetChanged (ArrayAdapter)
  • FileWriter (java.io)
    A specialized Writer that writes to a file in the file system. All write requests made by calling me
  • Socket (java.net)
    Provides a client-side TCP socket.
  • SimpleDateFormat (java.text)
    Formats and parses dates in a locale-sensitive manner. Formatting turns a Date into a String, and pa
  • Stack (java.util)
    Stack is a Last-In/First-Out(LIFO) data structure which represents a stack of objects. It enables u
  • HttpServletRequest (javax.servlet.http)
    Extends the javax.servlet.ServletRequest interface to provide request information for HTTP servlets.
  • IOUtils (org.apache.commons.io)
    General IO stream manipulation utilities. This class provides static utility methods for input/outpu
  • 14 Best Plugins for Eclipse
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyStudentsTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now