Tabnine Logo
SacrificeTargetEffect.<init>
Code IndexAdd Tabnine to your IDE (free)

How to use
mage.abilities.effects.common.SacrificeTargetEffect
constructor

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

origin: magefree/mage

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

public LingeringDeathAbility() {
  super(Zone.BATTLEFIELD, new SacrificeTargetEffect());
}
origin: magefree/mage

  @Override
  public boolean apply(Game game, Ability source) {
    return new CreateDelayedTriggeredAbilityEffect(new AtTheBeginOfNextEndStepDelayedTriggeredAbility(
        new SacrificeTargetEffect("sacrifice it", source.getControllerId())
    )).apply(game, source);
  }
}
origin: magefree/mage

public AshlingTheExtinguisherTriggeredAbility() {
  super(Zone.BATTLEFIELD, new SacrificeTargetEffect());
  this.addTarget(new TargetCreaturePermanent());
}
origin: magefree/mage

public CelestialSword(UUID ownerId, CardSetInfo setInfo) {
  super(ownerId,setInfo,new CardType[]{CardType.ARTIFACT},"{6}");
  // {3}, {tap}: Target creature you control gets +3/+3 until end of turn. Its controller sacrifices it at the beginning of the next end step.
  Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new BoostTargetEffect(3, 3, Duration.EndOfTurn), new GenericManaCost(3));
  ability.addCost(new TapSourceCost());
  ability.addTarget(new TargetControlledCreaturePermanent());
  ability.addEffect(new CreateDelayedTriggeredAbilityEffect(new AtTheBeginOfNextEndStepDelayedTriggeredAbility(new SacrificeTargetEffect())));
  this.addAbility(ability);
}
origin: magefree/mage

public GraftedWargear(UUID ownerId, CardSetInfo setInfo) {
  super(ownerId,setInfo,new CardType[]{CardType.ARTIFACT},"{3}");
  this.subtype.add(SubType.EQUIPMENT);
  // Equipped creature gets +3/+2.
  this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostEquippedEffect(3, 2)));
  // Whenever Grafted Wargear becomes unattached from a permanent, sacrifice that permanent.
  this.addAbility(new UnattachedTriggeredAbility(new SacrificeTargetEffect(), false));
  // Equip {0}
  this.addAbility(new EquipAbility(Outcome.AddAbility, new GenericManaCost(0)));
}
origin: magefree/mage

  @Override
  public boolean apply(Game game, Ability source) {
    Permanent targetCreature = game.getPermanent(source.getFirstTarget());
    if (targetCreature != null) {
      SacrificeTargetEffect sacrificeEffect = new SacrificeTargetEffect("sacrifice this", source.getControllerId());
      sacrificeEffect.setTargetPointer(new FixedTarget(targetCreature, game));
      DelayedTriggeredAbility delayedAbility = new AtTheBeginOfNextEndStepDelayedTriggeredAbility(sacrificeEffect);
      game.addDelayedTriggeredAbility(delayedAbility, source);
    }
    return true;
  }
}
origin: magefree/mage

  @Override
  public boolean apply(Game game, Ability source) {
    Permanent sourcePermanent = game.getPermanent(source.getSourceId());
    if (sourcePermanent != null) {
      SacrificeTargetEffect sacrificeEffect = new SacrificeTargetEffect("sacrifice {this}");
      sacrificeEffect.setTargetPointer(new FixedTarget(sourcePermanent.getId()));
      game.addDelayedTriggeredAbility(new AtTheBeginOfNextEndStepDelayedTriggeredAbility(sacrificeEffect), source);
    }
    return false;
  }
}
origin: magefree/mage

  @Override
  public boolean apply(Game game, Ability source) {
    Permanent targetCreature = game.getPermanent(source.getFirstTarget());
    if (targetCreature != null) {
      SacrificeTargetEffect sacrificeEffect = new SacrificeTargetEffect("sacrifice this", source.getControllerId());
      sacrificeEffect.setTargetPointer(new FixedTarget(targetCreature, game));
      DelayedTriggeredAbility delayedAbility = new AtTheBeginOfNextEndStepDelayedTriggeredAbility(sacrificeEffect);
      game.addDelayedTriggeredAbility(delayedAbility, source);
    }
    return true;
  }
}
origin: magefree/mage

  @Override
  public boolean apply(Game game, Ability source) {
    Permanent permanent = game.getPermanent(source.getFirstTarget());
    if (permanent != null) {
      SacrificeTargetEffect sacrificeEffect = new SacrificeTargetEffect("sacrifice this", source.getControllerId());
      sacrificeEffect.setTargetPointer(new FixedTarget(permanent, game));
      DelayedTriggeredAbility delayedAbility = new AtTheBeginOfNextEndStepDelayedTriggeredAbility(sacrificeEffect);
      game.addDelayedTriggeredAbility(delayedAbility, source);
      return true;
    }
    return false;
  }
}
origin: magefree/mage

  @Override
  public boolean apply(Game game, Ability source) {
    Permanent permanent = game.getPermanent(source.getFirstTarget());
    if (permanent != null) {
      SacrificeTargetEffect sacrificeEffect = new SacrificeTargetEffect("sacrifice this", source.getControllerId());
      sacrificeEffect.setTargetPointer(new FixedTarget(permanent, game));
      DelayedTriggeredAbility delayedAbility = new AtTheBeginOfNextEndStepDelayedTriggeredAbility(sacrificeEffect);
      game.addDelayedTriggeredAbility(delayedAbility, source);
      return true;
    }
    return false;
  }
}
origin: magefree/mage

public MercyKilling(UUID ownerId, CardSetInfo setInfo) {
  super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{2}{G/W}");
  // Target creature's controller sacrifices it, then creates X 1/1 green and white Elf Warrior creature tokens, where X is that creature's power.
  this.getSpellAbility().addEffect(new SacrificeTargetEffect("Target creature's controller sacrifices it"));
  this.getSpellAbility().addEffect(new MercyKillingTokenEffect());
  this.getSpellAbility().addTarget(new TargetCreaturePermanent());
}
origin: magefree/mage

  @Override
  public boolean apply(Game game, Ability source) {
    Permanent permanent = game.getPermanent(getTargetPointer().getFirst(game, source));
    if (permanent != null) {
      SacrificeTargetEffect sacrificeEffect = new SacrificeTargetEffect("sacrifice this", source.getControllerId());
      sacrificeEffect.setTargetPointer(new FixedTarget(permanent, game));
      DelayedTriggeredAbility delayedAbility = new AngrathTheFlameChainedDelayedTriggeredAbility(sacrificeEffect);
      game.addDelayedTriggeredAbility(delayedAbility, source);
      return true;
    }
    return false;
  }
}
origin: magefree/mage

  @Override
  public boolean apply(Game game, Ability source) {
    Permanent creature = game.getPermanent(source.getFirstTarget());
    if (creature != null) {
      SacrificeTargetEffect sacrificeEffect = new SacrificeTargetEffect("sacrifice boosted " + creature.getName(), source.getControllerId());
      sacrificeEffect.setTargetPointer(new FixedTarget(creature, game));
      DelayedTriggeredAbility delayedAbility = new AtTheBeginOfNextEndStepDelayedTriggeredAbility(sacrificeEffect);
      game.addDelayedTriggeredAbility(delayedAbility, source);
      return true;
    }
    return false;
  }
}
origin: magefree/mage

  @Override
  public boolean apply(Game game, Ability source) {
    Permanent creature = game.getPermanent(getTargetPointer().getFirst(game, source));
    if (creature != null) {
      SacrificeTargetEffect sacrificeEffect = new SacrificeTargetEffect("Sacrifice boosted " + creature.getName(), source.getControllerId());
      sacrificeEffect.setTargetPointer(new FixedTarget(creature, game));
      DelayedTriggeredAbility delayedAbility = new AtTheBeginOfNextEndStepDelayedTriggeredAbility(sacrificeEffect);
      game.addDelayedTriggeredAbility(delayedAbility, source);
    }
    return true;
  }
}
origin: magefree/mage

@Override
public boolean apply(Game game, Ability source) {
  Player controller = game.getPlayer(source.getControllerId());
  if (controller != null) {
    Effect effect = new SacrificeTargetEffect("Sacrifice those creatures at the beginning of the next end step", source.getControllerId());
    effect.setTargetPointer(new FixedTargets(game.getBattlefield().getAllActivePermanents(new FilterAttackingCreature(), controller.getId(), game), game));
    game.addDelayedTriggeredAbility(new AtTheBeginOfNextEndStepDelayedTriggeredAbility(effect), source);
    return true;
  }
  return false;
}
origin: magefree/mage

  @Override
  public boolean apply(Game game, Ability source) {
    CreateTokenEffect effect = new CreateTokenEffect(new BalduvianToken());
    effect.apply(game, source);
    for (UUID tokenId : effect.getLastAddedTokenIds()) {
      Permanent tokenPermanent = game.getPermanent(tokenId);
      if (tokenPermanent != null) {
        SacrificeTargetEffect sacrificeEffect = new SacrificeTargetEffect("Sacrifice the token at the beginning of the next end step", source.getControllerId());
        sacrificeEffect.setTargetPointer(new FixedTarget(tokenPermanent, game));
        DelayedTriggeredAbility delayedAbility = new AtTheBeginOfNextEndStepDelayedTriggeredAbility(sacrificeEffect);
        game.addDelayedTriggeredAbility(delayedAbility, source);
      }
    }
    return true;
  }
}
origin: magefree/mage

public PsychicVortex(UUID ownerId, CardSetInfo setInfo) {
  super(ownerId,setInfo,new CardType[]{CardType.ENCHANTMENT},"{2}{U}{U}");
  // Cumulative upkeep-Draw a card.
  this.addAbility(new CumulativeUpkeepAbility(new PsychicVortexCost()));
  
  // At the beginning of your end step, sacrifice a land and discard your hand.
  Effect effect = new SacrificeTargetEffect();
  effect.setText("sacrifice a land");
  Ability ability = new BeginningOfEndStepTriggeredAbility(effect, TargetController.YOU, false);
  effect = new DiscardHandControllerEffect();
  effect.setText("and discard your hand");
  ability.addEffect(effect);
  ability.addTarget(new TargetControlledPermanent(new FilterControlledLandPermanent()));
  this.addAbility(ability);
}
origin: magefree/mage

public StitchersGraft(UUID ownerId, CardSetInfo setInfo) {
  super(ownerId, setInfo, new CardType[]{CardType.ARTIFACT}, "{1}");
  this.subtype.add(SubType.EQUIPMENT);
  // Equipped creature gets +3/+3.
  this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostEquippedEffect(3, 3)));
  // Whenever equipped creature attacks, it doesn't untap during its controller's next untap step.
  this.addAbility(new StitchersGraftTriggeredAbility());
  // Whenever Stitcher's Graft becomes unattached from a permanent, sacrifice that permanent.
  Effect effect = new SacrificeTargetEffect();
  effect.setText("sacrifice that permanent");
  this.addAbility(new UnattachedTriggeredAbility(effect, false));
  // Equip {2}
  this.addAbility(new EquipAbility(Outcome.AddAbility, new GenericManaCost(2)));
}
origin: magefree/mage

@Override
public boolean apply(Game game, Ability source) {
  Permanent sourceObject = game.getPermanentOrLKIBattlefield(source.getSourceId());
  Permanent targetObject = game.getPermanent(this.getTargetPointer().getFirst(game, source));
  if (sourceObject != null && targetObject != null) {
    Effect sacrificeEffect = new SacrificeTargetEffect("sacrifice " + sourceObject.getName());
    sacrificeEffect.setTargetPointer(new FixedTarget(sourceObject, game));
    LeavesBattlefieldTriggeredAbility triggerAbility = new LeavesBattlefieldTriggeredAbility(sacrificeEffect, false);
    triggerAbility.setRuleVisible(false);
    ContinuousEffect continuousEffect = new GainAbilityTargetEffect(triggerAbility, Duration.EndOfTurn);
    continuousEffect.setTargetPointer(new FixedTarget(targetObject, game));
    game.addEffect(continuousEffect, source);
    return true;
  }
  return false;
}
mage.abilities.effects.commonSacrificeTargetEffect<init>

Popular methods of SacrificeTargetEffect

  • setTargetPointer

Popular in Java

  • Start an intent from android
  • setContentView (Activity)
  • getExternalFilesDir (Context)
  • setRequestProperty (URLConnection)
  • FileOutputStream (java.io)
    An output stream that writes bytes to a file. If the output file exists, it can be replaced or appen
  • Thread (java.lang)
    A thread is a thread of execution in a program. The Java Virtual Machine allows an application to ha
  • ArrayList (java.util)
    ArrayList is an implementation of List, backed by an array. All optional operations including adding
  • Deque (java.util)
    A linear collection that supports element insertion and removal at both ends. The name deque is shor
  • Locale (java.util)
    Locale represents a language/country/variant combination. Locales are used to alter the presentatio
  • Reflections (org.reflections)
    Reflections one-stop-shop objectReflections scans your classpath, indexes the metadata, allows you t
  • Top plugins for Android Studio
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

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