congrats Icon
New! Announcing Tabnine Chat Beta
Learn More
Tabnine Logo
PreventDamageToControllerEffect.<init>
Code IndexAdd Tabnine to your IDE (free)

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

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

origin: magefree/mage

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

public SpiritOfResistance(UUID ownerId, CardSetInfo setInfo) {
  super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{2}{W}");
  // As long as you control a permanent of each color, prevent all damage that would be dealt to you.
  Effect effect = new ConditionalReplacementEffect(
      new PreventDamageToControllerEffect(Duration.WhileOnBattlefield),
      SpiritOfResistanceCondition.instance);
  effect.setText("As long as you control a permanent of each color, prevent all damage that would be dealt to you.");
  this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, effect));
}
origin: magefree/mage

public ShieldOfTheAges(UUID ownerId, CardSetInfo setInfo) {
  super(ownerId, setInfo, new CardType[]{CardType.ARTIFACT}, "{2}");
  // {2}: Prevent the next 1 damage that would be dealt to you this turn.
  this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new PreventDamageToControllerEffect(Duration.EndOfTurn, 1), new GenericManaCost(2)));
}
origin: magefree/mage

public Conservator(UUID ownerId, CardSetInfo setInfo) {
  super(ownerId, setInfo, new CardType[]{CardType.ARTIFACT}, "{4}");
  // {3}, {tap}: Prevent the next 2 damage that would be dealt to you this turn.
  Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new PreventDamageToControllerEffect(Duration.EndOfTurn, 2), new GenericManaCost(3));
  ability.addTarget(new TargetPlayer());
  ability.addCost(new TapSourceCost());
  this.addAbility(ability);
}
origin: magefree/mage

public DecoratedGriffin(UUID ownerId, CardSetInfo setInfo) {
  super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{4}{W}");
  this.subtype.add(SubType.GRIFFIN);
  this.power = new MageInt(2);
  this.toughness = new MageInt(3);
  // Flying
  this.addAbility(FlyingAbility.getInstance());
  // {1}{W}: Prevent the next 1 combat damage that would be dealt to you this turn.
  this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new PreventDamageToControllerEffect(Duration.EndOfTurn, true, true, 1), new ManaCostsImpl("{1}{W}")));
}
origin: magefree/mage

public ReinforcedBulwark(UUID ownerId, CardSetInfo setInfo) {
  super(ownerId, setInfo, new CardType[]{CardType.ARTIFACT, CardType.CREATURE}, "{3}");
  this.subtype.add(SubType.WALL);
  this.power = new MageInt(0);
  this.toughness = new MageInt(4);
  // Defender
  this.addAbility(DefenderAbility.getInstance());
  // {tap}: Prevent the next 1 damage that would be dealt to you this turn.
  this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new PreventDamageToControllerEffect(Duration.EndOfTurn, 1), new TapSourceCost()));
}
origin: magefree/mage

public PalliationAccord(UUID ownerId, CardSetInfo setInfo) {
  super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{3}{W}{U}");
  // Whenever a creature an opponent controls becomes tapped, put a shield counter on Palliation Accord.
  this.addAbility(new BecomesTappedTriggeredAbility(new AddCountersSourceEffect(CounterType.SHIELD.createInstance()), false, filter));
  // Remove a shield counter from Palliation Accord: Prevent the next 1 damage that would be dealt to you this turn.
  this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD,
      new PreventDamageToControllerEffect(Duration.EndOfTurn, 1),
      new RemoveCountersSourceCost(CounterType.SHIELD.createInstance())));
}
origin: magefree/mage

public FestivalOfTheGuildpact(UUID ownerId, CardSetInfo setInfo) {
  super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{X}{W}");
  // Prevent the next X damage that would be dealt to you this turn.
  this.getSpellAbility().addEffect(new PreventDamageToControllerEffect(Duration.EndOfTurn, false, true, ManacostVariableValue.instance));
  // Draw a card.
  this.getSpellAbility().addEffect(new DrawCardSourceControllerEffect(1));
}
origin: magefree/mage

public SelflessSquire(UUID ownerId, CardSetInfo setInfo) {
  super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{3}{W}");
  this.subtype.add(SubType.HUMAN);
  this.subtype.add(SubType.SOLDIER);
  this.power = new MageInt(1);
  this.toughness = new MageInt(1);
  // Flash
  this.addAbility(FlashAbility.getInstance());
  // When Selfless Squire enters the battlefield, prevent all damage that would be dealt to you this turn.
  this.addAbility(new EntersBattlefieldTriggeredAbility(new PreventDamageToControllerEffect(Duration.EndOfTurn), false));
  // Whenever damage that would be dealt to you is prevented, put that many +1/+1 counters on Selfless Squire.
  this.addAbility(new SelflessSquireTriggeredAbility());
}
origin: magefree/mage

public ThoughtLash(UUID ownerId, CardSetInfo setInfo) {
  super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{2}{U}{U}");
  // Cumulative upkeep - Exile the top card of your library.
  this.addAbility(new CumulativeUpkeepAbility(new ExileFromTopOfLibraryCost(1)));
  // When a player doesn't pay Thought Lash's cumulative upkeep, that player exiles all cards from their library.
  this.addAbility(new ThoughtLashTriggeredAbility());
  // Exile the top card of your library: Prevent the next 1 damage that would be dealt to you this turn.
  this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new PreventDamageToControllerEffect(Duration.EndOfTurn, 1), new ExileFromTopOfLibraryCost(1)));
}
origin: magefree/mage

public DruidsDeliverance(UUID ownerId, CardSetInfo setInfo) {
  super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{1}{G}");
  // Prevent all combat damage that would be dealt to you this turn. Populate.
  // (Create a token that's a copy of a creature token you control.)
  this.getSpellAbility().addEffect(new PreventDamageToControllerEffect(Duration.EndOfTurn, true, false, Integer.MAX_VALUE));
  this.getSpellAbility().addEffect(new PopulateEffect());
}
origin: magefree/mage

public RiotControl(UUID ownerId, CardSetInfo setInfo) {
  super(ownerId,setInfo,new CardType[]{CardType.INSTANT},"{2}{W}");
  // Gain 1 life for each creature your opponents control. Prevent all damage that would be dealt to you this turn.
  this.getSpellAbility().addEffect(new GainLifeEffect(new PermanentsOnBattlefieldCount(filter)));
  this.getSpellAbility().addEffect(new PreventDamageToControllerEffect(Duration.EndOfTurn));
}
origin: magefree/mage

public GlacialChasm(UUID ownerId, CardSetInfo setInfo) {
  super(ownerId,setInfo,new CardType[]{CardType.LAND},"");
  // Cumulative upkeep-Pay 2 life.
  this.addAbility(new CumulativeUpkeepAbility(new PayLifeCost(2)));
  // When Glacial Chasm enters the battlefield, sacrifice a land.
  this.addAbility(new EntersBattlefieldTriggeredAbility(new SacrificeControllerEffect(StaticFilters.FILTER_LAND, 1, "")));
  // Creatures you control can't attack.
  FilterCreaturePermanent filter = new FilterCreaturePermanent("creatures you control");
  filter.add(new ControllerPredicate(TargetController.YOU));
  this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new CantAttackAnyPlayerAllEffect(Duration.WhileOnBattlefield, filter)));
  // Prevent all damage that would be dealt to you.
  this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new PreventDamageToControllerEffect(Duration.WhileOnBattlefield)));
}
origin: magefree/mage

public SolitaryConfinement(UUID ownerId, CardSetInfo setInfo) {
  super(ownerId,setInfo,new CardType[]{CardType.ENCHANTMENT},"{2}{W}");
  // At the beginning of your upkeep, sacrifice Solitary Confinement unless you discard a card.
  this.addAbility(new BeginningOfUpkeepTriggeredAbility(Zone.BATTLEFIELD, new SacrificeSourceUnlessPaysEffect(new DiscardTargetCost(new TargetCardInHand())), TargetController.YOU, false));
  // Skip your draw step.
  this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new SkipDrawStepEffect()));
  // You have shroud.
  this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new GainAbilityControllerEffect(ShroudAbility.getInstance())));
  // Prevent all damage that would be dealt to you.
  this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new PreventDamageToControllerEffect(Duration.WhileOnBattlefield)));
}
origin: magefree/mage

public EsperBattlemage(UUID ownerId, CardSetInfo setInfo) {
  super(ownerId, setInfo, new CardType[]{CardType.ARTIFACT, CardType.CREATURE}, "{2}{U}");
  this.subtype.add(SubType.HUMAN);
  this.subtype.add(SubType.WIZARD);
  this.power = new MageInt(2);
  this.toughness = new MageInt(2);
  // {W}, {tap}: Prevent the next 2 damage that would be dealt to you this turn.
  SimpleActivatedAbility ability = new SimpleActivatedAbility(Zone.BATTLEFIELD,
      new PreventDamageToControllerEffect(Duration.EndOfTurn, 2),
      new ColoredManaCost(ColoredManaSymbol.W));
  ability.addCost(new TapSourceCost());
  this.addAbility(ability);
  // {B}, {tap}: Target creature gets -1/-1 until end of turn.
  ability = new SimpleActivatedAbility(Zone.BATTLEFIELD,
      new BoostTargetEffect(-1, -1, Duration.EndOfTurn),
      new ColoredManaCost(ColoredManaSymbol.B));
  ability.addCost(new TapSourceCost());
  ability.addTarget(new TargetCreaturePermanent());
  this.addAbility(ability);
}
origin: magefree/mage

public SecurityBlockade(UUID ownerId, CardSetInfo setInfo) {
  super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{2}{W}");
  this.subtype.add(SubType.AURA);
  this.color.setWhite(true);
  // Enchant land
  TargetPermanent auraTarget = new TargetLandPermanent();
  this.getSpellAbility().addTarget(auraTarget);
  this.getSpellAbility().addEffect(new AttachEffect(Outcome.PutCreatureInPlay));
  Ability ability = new EnchantAbility(auraTarget.getTargetName());
  this.addAbility(ability);
  // When Security Blockade enters the battlefield, create a 2/2 white Knight creature token with vigilance.
  this.addAbility(new EntersBattlefieldTriggeredAbility(new CreateTokenEffect(new KnightToken())));
  // Enchanted land has "{T}: Prevent the next 1 damage that would be dealt to you this turn."
  ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new PreventDamageToControllerEffect(Duration.EndOfTurn, 1), new TapSourceCost());
  this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new GainAbilityAttachedEffect(ability, AttachmentType.AURA, Duration.WhileOnBattlefield, rule)));
}
mage.abilities.effects.commonPreventDamageToControllerEffect<init>

Popular methods of PreventDamageToControllerEffect

  • preventDamageAction
  • setText

Popular in Java

  • Reading from database using SQL prepared statement
  • runOnUiThread (Activity)
  • scheduleAtFixedRate (ScheduledExecutorService)
  • putExtra (Intent)
  • Color (java.awt)
    The Color class is used to encapsulate colors in the default sRGB color space or colors in arbitrary
  • BitSet (java.util)
    The BitSet class implements abit array [http://en.wikipedia.org/wiki/Bit_array]. Each element is eit
  • Calendar (java.util)
    Calendar is an abstract base class for converting between a Date object and a set of integer fields
  • Queue (java.util)
    A collection designed for holding elements prior to processing. Besides basic java.util.Collection o
  • JarFile (java.util.jar)
    JarFile is used to read jar entries and their associated data from jar files.
  • HttpServlet (javax.servlet.http)
    Provides an abstract class to be subclassed to create an HTTP servlet suitable for a Web site. A sub
  • Top plugins for WebStorm
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