congrats Icon
New! Announcing our next generation AI code completions
Read here
Tabnine Logo
GainControlTargetEffect.<init>
Code IndexAdd Tabnine to your IDE (free)

How to use
mage.abilities.effects.common.continuous.GainControlTargetEffect
constructor

Best Java code snippets using mage.abilities.effects.common.continuous.GainControlTargetEffect.<init> (Showing top 20 results out of 315)

origin: magefree/mage

public RiptideEntrancerTriggeredAbility() {
  super(Zone.BATTLEFIELD, new DoIfCostPaid(
      new GainControlTargetEffect(Duration.Custom),
      new SacrificeSourceCost()
  ), true);
}
origin: magefree/mage

  @Override
  public boolean apply(Game game, Ability source) {
    Permanent permanent = game.getPermanent(targetPointer.getFirst(game, source));
    if (super.apply(game, source) && permanent != null) {
      GainControlTargetEffect effect = new GainControlTargetEffect(Duration.EndOfGame);
      effect.setTargetPointer(targetPointer);
      game.addEffect(effect, source);
      return true;
    }
    return false;
  }
}
origin: magefree/mage

public MightMakesRight(UUID ownerId, CardSetInfo setInfo) {
  super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{5}{R}");
  // At the beginning of combat on your turn, if you control each creature on the battlefield with the greatest power, gain control
  // of target creature an opponent controls until end of turn. Untap that creature. It gains haste until end of turn.
  TriggeredAbility gainControlAbility = new BeginningOfCombatTriggeredAbility(new GainControlTargetEffect(Duration.EndOfTurn), TargetController.YOU, false);
  gainControlAbility.addEffect(new UntapTargetEffect());
  gainControlAbility.addEffect(new GainAbilityTargetEffect(HasteAbility.getInstance(), Duration.EndOfTurn));
  gainControlAbility.addTarget(new TargetCreaturePermanent(filter));
  Ability conditionalAbility = new ConditionalInterveningIfTriggeredAbility(gainControlAbility, ControlsEachCreatureWithGreatestPowerCondition.instance, ruleText);
  this.addAbility(conditionalAbility);
}
origin: magefree/mage

public Willbreaker(UUID ownerId, CardSetInfo setInfo) {
  super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{3}{U}{U}");
  this.subtype.add(SubType.HUMAN);
  this.subtype.add(SubType.WIZARD);
  this.power = new MageInt(2);
  this.toughness = new MageInt(3);
  // Whenever a creature an opponent controls becomes the target of a spell or ability you control, gain control of that creature for as long as you control Willbreaker.
  ConditionalContinuousEffect effect = new ConditionalContinuousEffect(new GainControlTargetEffect(Duration.Custom), new SourceOnBattlefieldControlUnchangedCondition(), null);
  effect.setText("gain control of that creature for as long as you control {this}");
  this.addAbility(new WillbreakerTriggeredAbility(effect));
}
origin: magefree/mage

public LegacysAllure(UUID ownerId, CardSetInfo setInfo) {
  super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{U}{U}");
  // At the beginning of your upkeep, you may put a treasure counter on Legacy's Allure.
  this.addAbility(new BeginningOfUpkeepTriggeredAbility(Zone.BATTLEFIELD,
      new AddCountersSourceEffect(CounterType.TREASURE.createInstance(), true), TargetController.YOU, true));
  // Sacrifice Legacy's Allure: Gain control of target creature with power less than or equal to the number of treasure counters on Legacy's Allure.
  Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new GainControlTargetEffect(Duration.EndOfGame, true), new SacrificeSourceCost());
  ability.addTarget(new TargetCreaturePermanent(0, 0, filter, false));
  ability.setTargetAdjuster(LegacysAllureAdjuster.instance);
  this.addAbility(ability);
}
origin: magefree/mage

public EntrancingMelody(UUID ownerId, CardSetInfo setInfo) {
  super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{X}{U}{U}");
  // Gain control of target creature with converted mana cost X.
  this.getSpellAbility().addEffect(new GainControlTargetEffect(Duration.Custom, true));
  this.getSpellAbility().addTarget(new TargetCreaturePermanent(filter));
  this.getSpellAbility().setTargetAdjuster(EntrancingMelodyAdjuster.instance);
}
origin: magefree/mage

public Evangelize(UUID ownerId, CardSetInfo setInfo) {
  super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{4}{W}");
  // Buyback {2}{W}{W}
  this.addAbility(new BuybackAbility("{2}{W}{W}"));
  // Gain control of target creature of an opponent's choice that he or she controls.
  GainControlTargetEffect effect = new GainControlTargetEffect(Duration.EndOfGame);
  effect.setText("Gain control of target creature of an opponent's choice he or she controls");
  this.getSpellAbility().addEffect(effect);
  this.getSpellAbility().addTarget(new TargetOpponentsChoicePermanent(1, 1, filter, false, true));
}
origin: magefree/mage

public Conscription(UUID ownerId, CardSetInfo setInfo) {
  super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{2}{U}{U}");
  
  // Gain control of target creature with power 2 or less. It becomes a Trooper in addition to its other types.
  this.getSpellAbility().addEffect(new GainControlTargetEffect(Duration.EndOfGame));
  this.getSpellAbility().addEffect(new BecomesCreatureTypeTargetEffect(Duration.EndOfGame, SubType.TROOPER, false)
      .setText("It becomes a Trooper in addition to its other types"));
  this.getSpellAbility().addTarget(new TargetCreaturePermanent(filter));
}
origin: magefree/mage

public GovernTheGuildless(UUID ownerId, CardSetInfo setInfo) {
  super(ownerId,setInfo,new CardType[]{CardType.SORCERY},"{5}{U}");
  // Gain control of target monocolored creature.
  this.getSpellAbility().addEffect(new GainControlTargetEffect(Duration.EndOfGame));
  this.getSpellAbility().addTarget(new TargetCreaturePermanent(filter));
  // Forecast - {1}{U}, Reveal Govern the Guildless from your hand: Target creature becomes the color or colors of your choice until end of turn.
  ForecastAbility ability = new ForecastAbility(new BecomesColorTargetEffect(Duration.EndOfTurn), new ManaCostsImpl("{1}{U}"));
  ability.addTarget(new TargetCreaturePermanent());
  this.addAbility(ability);
}
origin: magefree/mage

public AuraGraft(UUID ownerId, CardSetInfo setInfo) {
  super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{1}{U}");
  // Gain control of target Aura that's attached to a permanent. Attach it to another permanent it can enchant.
  FilterPermanent filter = new FilterPermanent("Aura that's attached to a permanent");
  filter.add(new SubtypePredicate(SubType.AURA));
  filter.add(new AttachedToPermanentPredicate());
  this.getSpellAbility().addTarget(new TargetPermanent(filter));
  Effect gainControlEffect = new GainControlTargetEffect(Duration.EndOfGame);
  this.getSpellAbility().addEffect(gainControlEffect);
  this.getSpellAbility().addEffect(new MoveTargetAuraEffect());
}
origin: magefree/mage

public ActOfAggression(UUID ownerId, CardSetInfo setInfo) {
  super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{3}{R/P}{R/P}");
  this.getSpellAbility().addTarget(new TargetCreaturePermanent(filter));
  this.getSpellAbility().addEffect(new GainControlTargetEffect(Duration.EndOfTurn));
  this.getSpellAbility().addEffect(new UntapTargetEffect().setText("Untap that creature"));
  this.getSpellAbility().addEffect(new GainAbilityTargetEffect(HasteAbility.getInstance(), Duration.EndOfTurn).setText("It gains haste until end of turn."));
}
origin: magefree/mage

public Hijack(UUID ownerId, CardSetInfo setInfo) {
  super(ownerId,setInfo,new CardType[]{CardType.SORCERY},"{1}{R}{R}");
  // Gain control of target artifact or creature until end of turn. Untap it. It gains haste until end of turn.
  this.getSpellAbility().addTarget(new TargetPermanent(StaticFilters.FILTER_PERMANENT_ARTIFACT_OR_CREATURE));
  this.getSpellAbility().addEffect(new GainControlTargetEffect(Duration.EndOfTurn));
  Effect effect = new UntapTargetEffect();
  effect.setText("Untap it");
  this.getSpellAbility().addEffect(effect);
  effect = new GainAbilityTargetEffect(HasteAbility.getInstance(), Duration.EndOfTurn);
  effect.setText("It gains haste until end of turn");
  this.getSpellAbility().addEffect(effect);
}
origin: magefree/mage

public MetallicMastery(UUID ownerId, CardSetInfo setInfo) {
  super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{2}{R}");
  // Gain control of target artifact until end of turn. Untap that artifact. It gains haste until end of turn.
  this.getSpellAbility().addTarget(new TargetArtifactPermanent());
  this.getSpellAbility().addEffect(new GainControlTargetEffect(Duration.EndOfTurn));
  this.getSpellAbility().addEffect(new UntapTargetEffect().setText("Untap that artifact"));
  this.getSpellAbility().addEffect(new GainAbilityTargetEffect(HasteAbility.getInstance(), Duration.EndOfTurn).setText("It gains haste until end of turn."));
}
origin: magefree/mage

public ActOfTreason(UUID ownerId, CardSetInfo setInfo) {
  super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{2}{R}");
  // Gain control of target creature until end of turn. Untap that creature.
  // It gains haste until end of turn. (It can attack and {T} this turn.)
  this.getSpellAbility().addTarget(new TargetCreaturePermanent());
  this.getSpellAbility().addEffect(new GainControlTargetEffect(Duration.EndOfTurn));
  this.getSpellAbility().addEffect(new UntapTargetEffect().setText("Untap that creature"));
  this.getSpellAbility().addEffect(new GainAbilityTargetEffect(HasteAbility.getInstance(), Duration.EndOfTurn).setText("It gains haste until end of turn."));
}
origin: magefree/mage

public Wrangle(UUID ownerId, CardSetInfo setInfo) {
  super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{1}{R}");
  // Gain control of target creature with power 4 or less until end of turn. Untap that creature. It gains haste until end of turn.
  this.getSpellAbility().addTarget(new TargetCreaturePermanent(filter));
  this.getSpellAbility().addEffect(new GainControlTargetEffect(Duration.EndOfTurn));
  Effect effect = new UntapTargetEffect();
  effect.setText("Untap that creature");
  this.getSpellAbility().addEffect(effect);
  effect = new GainAbilityTargetEffect(HasteAbility.getInstance(), Duration.EndOfTurn);
  effect.setText("It gains haste until end of turn");
  this.getSpellAbility().addEffect(effect);
}
origin: magefree/mage

public Goatnapper(UUID ownerId, CardSetInfo setInfo) {
  super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{2}{R}");
  this.subtype.add(SubType.GOBLIN);
  this.subtype.add(SubType.ROGUE);
  this.power = new MageInt(2);
  this.toughness = new MageInt(2);
  Ability ability = new EntersBattlefieldTriggeredAbility(new UntapTargetEffect(), false);
  ability.addTarget(new TargetPermanent(filter));
  ability.addEffect(new GainControlTargetEffect(Duration.EndOfTurn).setText("and gain control of it until end of turn"));
  ability.addEffect(new GainAbilityTargetEffect(HasteAbility.getInstance(), Duration.EndOfTurn).setText("It gains haste until end of turn"));
  this.addAbility(ability);
}
origin: magefree/mage

@Override
public boolean apply(Game game, Ability source) {
  PlayerList players = game.getState().getPlayersInRange(source.getControllerId(), game);
  int count = players.size();
  for (Permanent permanent : game.getBattlefield().getActivePermanents(new FilterNonlandPermanent(), source.getControllerId(), source.getSourceId(), game)) {
    ContinuousEffect effect = new GainControlTargetEffect(Duration.Custom, true, players.get(RandomUtil.nextInt(count)));
    effect.setTargetPointer(new FixedTarget(permanent.getId()));
    game.addEffect(effect, source);
    permanent.untap(game);
  }
  return true;
}
origin: magefree/mage

public KariZevsExpertise(UUID ownerId, CardSetInfo setInfo) {
  super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{1}{R}{R}");
  // Gain control of target creature or Vehicle until end of turn. Untap it. It gains haste until end of turn.
  this.getSpellAbility().addTarget(new TargetPermanent(filter));
  this.getSpellAbility().addEffect(new GainControlTargetEffect(Duration.EndOfTurn));
  this.getSpellAbility().addEffect(new UntapTargetEffect().setText("Untap it"));
  this.getSpellAbility().addEffect(new GainAbilityTargetEffect(HasteAbility.getInstance(), Duration.EndOfTurn).setText("It gans haste until end of turn."));
  // You may cast a card with converted mana cost 2 or less from your hand without paying its mana cost.
  this.getSpellAbility().addEffect(new CastWithoutPayingManaCostEffect(2));
}
origin: magefree/mage

public TraitorousBlood(UUID ownerId, CardSetInfo setInfo) {
  super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{1}{R}{R}");
  // Gain control of target creature until end of turn. Untap it. It gains trample and haste until end of turn.
  this.getSpellAbility().addTarget(new TargetCreaturePermanent());
  this.getSpellAbility().addEffect(new GainControlTargetEffect(Duration.EndOfTurn));
  this.getSpellAbility().addEffect(new UntapTargetEffect().setText("Untap it"));
  this.getSpellAbility().addEffect(new GainAbilityTargetEffect(TrampleAbility.getInstance(), Duration.EndOfTurn).setText("It gains trample"));
  this.getSpellAbility().addEffect(new GainAbilityTargetEffect(HasteAbility.getInstance(), Duration.EndOfTurn).setText("and hast until end of turn"));
}
origin: magefree/mage

public Capture(UUID ownerId, CardSetInfo setInfo) {
  super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{2}{R}");
  // Gain control of target creature until end of turn.
  this.getSpellAbility().addTarget(new TargetCreaturePermanent());
  this.getSpellAbility().addEffect(new GainControlTargetEffect(Duration.EndOfTurn));
  // Untap that creature.
  this.getSpellAbility().addEffect(new UntapTargetEffect());
  // It gains haste until end of turn.
  this.getSpellAbility().addEffect(new GainAbilityTargetEffect(HasteAbility.getInstance(), Duration.EndOfTurn));
  // If it has a bounty counter on it, add {R}{R}{R}
  this.getSpellAbility().addEffect(new ConditionalOneShotEffect(new BasicManaEffect(Mana.RedMana(3)), new TargetHasCounterCondition(CounterType.BOUNTY)));
}
mage.abilities.effects.common.continuousGainControlTargetEffect<init>

Popular methods of GainControlTargetEffect

  • discard
  • getTargetPointer
  • init
  • setTargetPointer
  • setText

Popular in Java

  • Creating JSON documents from java classes using gson
  • orElseThrow (Optional)
    Return the contained value, if present, otherwise throw an exception to be created by the provided s
  • runOnUiThread (Activity)
  • getExternalFilesDir (Context)
  • Table (com.google.common.collect)
    A collection that associates an ordered pair of keys, called a row key and a column key, with a sing
  • GridBagLayout (java.awt)
    The GridBagLayout class is a flexible layout manager that aligns components vertically and horizonta
  • Point (java.awt)
    A point representing a location in (x,y) coordinate space, specified in integer precision.
  • System (java.lang)
    Provides access to system-related information and resources including standard input and output. Ena
  • JButton (javax.swing)
  • Runner (org.openjdk.jmh.runner)
  • 21 Best IntelliJ Plugins
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