congrats Icon
New! Announcing Tabnine Chat Beta
Learn More
Tabnine Logo
DealsDamageToAPlayerAttachedTriggeredAbility
Code IndexAdd Tabnine to your IDE (free)

How to use
DealsDamageToAPlayerAttachedTriggeredAbility
in
mage.abilities.common

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

origin: magefree/mage

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

@Override
public boolean checkTrigger(GameEvent event, Game game) {
  if (targetController == TargetController.OPPONENT) {
    Player controller = game.getPlayer(this.getControllerId());
    if (controller == null || !game.isOpponent(controller, event.getPlayerId())) {
      return false;
    }
  }
  if (targetController == TargetController.YOU) {
    if (!this.isControlledBy(event.getPlayerId())) {
      return false;
    }
  }
  DamagedPlayerEvent damageEvent = (DamagedPlayerEvent) event;
  Permanent p = game.getPermanent(event.getSourceId());
  if ((!onlyCombat || damageEvent.isCombatDamage())
      && p != null && p.getAttachments().contains(this.getSourceId())) {
    if (setFixedTargetPointer) {
      for (Effect effect : this.getEffects()) {
        effect.setValue("damage", event.getAmount());
        effect.setTargetPointer(new FixedTarget(event.getPlayerId()));
      }
    }
    return true;
  }
  return false;
}
origin: magefree/mage

public RoguesGloves(UUID ownerId, CardSetInfo setInfo) {
  super(ownerId,setInfo,new CardType[]{CardType.ARTIFACT},"{2}");
  this.subtype.add(SubType.EQUIPMENT);
  // Whenever equipped creature deals combat damage to a player, you may draw a card.
  this.addAbility(new DealsDamageToAPlayerAttachedTriggeredAbility(new DrawCardSourceControllerEffect(1), "equipped creature", true));
  
  // Equip {2}
  this.addAbility(new EquipAbility(Outcome.AddAbility, new GenericManaCost(2)));
}
origin: magefree/mage

public MaskOfMemory(UUID ownerId, CardSetInfo setInfo) {
  super(ownerId,setInfo,new CardType[]{CardType.ARTIFACT},"{2}");
  this.subtype.add(SubType.EQUIPMENT);
  // Whenever equipped creature deals combat damage to a player, you may draw two cards. If you do, discard a card.
  Ability ability = new DealsDamageToAPlayerAttachedTriggeredAbility(new DrawCardSourceControllerEffect(2), "equipped creature", true);
  Effect effect = new DiscardControllerEffect(1);
  effect.setText("If you do, discard a card");
  ability.addEffect(effect);
  this.addAbility(ability);
  // Equip {1}
  this.addAbility(new EquipAbility(Outcome.AddAbility, new GenericManaCost(1)));
}
origin: magefree/mage

public SpectersShroud(UUID ownerId, CardSetInfo setInfo) {
  super(ownerId, setInfo, new CardType[]{CardType.ARTIFACT}, "{2}");
  
  this.subtype.add(SubType.EQUIPMENT);
  // Equipped creature gets +1/+0.
  this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostEquippedEffect(1, 0)));
  // Whenever equipped creature deals combat damage to a player, that player discards a card.
  this.addAbility(new DealsDamageToAPlayerAttachedTriggeredAbility(new DiscardTargetEffect(1), "equipped creature", false, true, true));
  // Equip {1}
  this.addAbility(new EquipAbility(Outcome.AddAbility, new GenericManaCost(1)));
}
origin: magefree/mage

public KeenSense(UUID ownerId, CardSetInfo setInfo) {
  super(ownerId,setInfo,new CardType[]{CardType.ENCHANTMENT},"{G}");
  this.subtype.add(SubType.AURA);
  // Enchant creature
  TargetPermanent auraTarget = new TargetCreaturePermanent();
  this.getSpellAbility().addTarget(auraTarget);
  this.getSpellAbility().addEffect(new AttachEffect(Outcome.DrawCard));
  Ability ability = new EnchantAbility(auraTarget.getTargetName());
  this.addAbility(ability);
  // Whenever enchanted creature deals damage to an opponent, you may draw a card.
  this.addAbility(new DealsDamageToAPlayerAttachedTriggeredAbility(new DrawCardSourceControllerEffect(1), "enchanted creature", true, false, false, TargetController.OPPONENT));
}
origin: magefree/mage

public MaskOfRiddles(UUID ownerId, CardSetInfo setInfo) {
  super(ownerId,setInfo,new CardType[]{CardType.ARTIFACT},"{U}{B}");
  this.subtype.add(SubType.EQUIPMENT);
  // Equipped creature has fear.
  this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new GainAbilityAttachedEffect(FearAbility.getInstance(), AttachmentType.EQUIPMENT)));
  // Whenever equipped creature deals combat damage to a player, you may draw a card.
  this.addAbility(new DealsDamageToAPlayerAttachedTriggeredAbility(new DrawCardSourceControllerEffect(1), "equipped", true));
  // Equip {2}
  this.addAbility(new EquipAbility(Outcome.AddAbility, new GenericManaCost(2)));
}
origin: magefree/mage

public QuietusSpike(UUID ownerId, CardSetInfo setInfo) {
  super(ownerId, setInfo, new CardType[]{CardType.ARTIFACT}, "{3}");
  this.subtype.add(SubType.EQUIPMENT);
  // Equipped creature has deathtouch.
  this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new GainAbilityAttachedEffect(DeathtouchAbility.getInstance(), AttachmentType.EQUIPMENT)));
  // Whenever equipped creature deals combat damage to a player, that player loses half their life, rounded up.
  this.addAbility(new DealsDamageToAPlayerAttachedTriggeredAbility(new LoseHalfLifeTargetEffect(), "equipped", false, true));
  // Equip {3}
  this.addAbility(new EquipAbility(Outcome.AddAbility, new GenericManaCost(3)));
}
origin: magefree/mage

public DestructiveUrge(UUID ownerId, CardSetInfo setInfo) {
  super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{1}{R}{R}");
  this.subtype.add(SubType.AURA);
  // Enchant creature
  TargetPermanent auraTarget = new TargetCreaturePermanent();
  this.getSpellAbility().addTarget(auraTarget);
  this.getSpellAbility().addEffect(new AttachEffect(Outcome.BoostCreature));
  Ability ability = new EnchantAbility(auraTarget.getTargetName());
  this.addAbility(ability);
  // Whenever enchanted creature deals combat damage to a player, that player sacrifices a land.
  this.addAbility(new DealsDamageToAPlayerAttachedTriggeredAbility(
      new SacrificeEffect(StaticFilters.FILTER_LAND, 1, "that player"),
      "enchanted", false, true
  ));
}
origin: magefree/mage

public Scytheclaw(UUID ownerId, CardSetInfo setInfo) {
  super(ownerId, setInfo, new CardType[]{CardType.ARTIFACT}, "{5}");
  this.subtype.add(SubType.EQUIPMENT);
  // Living weapon
  this.addAbility(new LivingWeaponAbility());
  // Equipped creature gets +1/+1.
  this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostEquippedEffect(1, 1)));
  // Whenever equipped creature deals combat damage to a player, that player loses half of their life, round up.
  this.addAbility(new DealsDamageToAPlayerAttachedTriggeredAbility(new LoseHalfLifeTargetEffect(), "equipped", false, true));
  // Equip {3}
  this.addAbility(new EquipAbility(Outcome.AddAbility, new GenericManaCost(3)));
}
origin: magefree/mage

public PryingBlade(UUID ownerId, CardSetInfo setInfo) {
  super(ownerId, setInfo, new CardType[]{CardType.ARTIFACT}, "{1}");
  this.subtype.add(SubType.EQUIPMENT);
  // Equipped creature gets +1/+0.
  this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostEquippedEffect(1, 0)));
  // Whenever equipped creature deals combat damage to a player, create a colorless Treasure artifact token with "{t}, Sacrifice this artifact: Add one mana of any color."
  this.addAbility(new DealsDamageToAPlayerAttachedTriggeredAbility(new CreateTokenEffect(new TreasureToken()), "equipped creature", false));
  // Equip {2}
  this.addAbility(new EquipAbility(Outcome.AddAbility, new GenericManaCost(2)));
}
origin: magefree/mage

public OphidianEye(UUID ownerId, CardSetInfo setInfo) {
  super(ownerId,setInfo,new CardType[]{CardType.ENCHANTMENT},"{2}{U}");
  this.subtype.add(SubType.AURA);
  // Flash
  this.addAbility(FlashAbility.getInstance());
  // Enchant creature
  TargetPermanent auraTarget = new TargetCreaturePermanent();
  this.getSpellAbility().addTarget(auraTarget);
  this.getSpellAbility().addEffect(new AttachEffect(Outcome.DrawCard));
  Ability ability = new EnchantAbility(auraTarget.getTargetName());
  this.addAbility(ability);
  // Whenever enchanted creature deals damage to an opponent, you may draw a card.
  this.addAbility(new DealsDamageToAPlayerAttachedTriggeredAbility(new DrawCardSourceControllerEffect(1), "enchanted creature", true, false, false, TargetController.OPPONENT));
}
origin: magefree/mage

public Backfire(UUID ownerId, CardSetInfo setInfo) {
  super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{U}");
  
  this.subtype.add(SubType.AURA);
  // Enchant creature
  TargetPermanent auraTarget = new TargetCreaturePermanent();
  this.getSpellAbility().addTarget(auraTarget);
  this.getSpellAbility().addEffect(new AttachEffect(Outcome.UnboostCreature));
  Ability ability = new EnchantAbility(auraTarget.getTargetName());
  this.addAbility(ability);
  // Whenever enchanted creature deals damage to you, Backfire deals that much damage to that creature's controller.
  this.addAbility(new DealsDamageToAPlayerAttachedTriggeredAbility(new DamageAttachedControllerEffect(new NumericSetToEffectValues("that much", "damage")), "enchanted creature", false, true, false, TargetController.YOU));
}
origin: magefree/mage

public SigilOfSleep(UUID ownerId, CardSetInfo setInfo) {
  super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{U}");
  this.subtype.add(SubType.AURA);
  // Enchant creature
  TargetPermanent auraTarget = new TargetCreaturePermanent();
  this.getSpellAbility().addTarget(auraTarget);
  this.getSpellAbility().addEffect(new AttachEffect(Outcome.AddAbility));
  Ability ability = new EnchantAbility(auraTarget.getTargetName());
  this.addAbility(ability);
  // Whenever enchanted creature deals damage to a player, return target creature that player controls to its owner's hand.
  Effect effect = new ReturnToHandTargetEffect();
  effect.setText("return target creature that player controls to its owner's hand");
  ability = new DealsDamageToAPlayerAttachedTriggeredAbility(effect, "enchanted", false, true, false);
  ability.setTargetAdjuster(SigilOfSleepAdjuster.instance);
  this.addAbility(ability);
}
origin: magefree/mage

public ElbrusTheBindingBlade(UUID ownerId, CardSetInfo setInfo) {
  super(ownerId, setInfo, new CardType[]{CardType.ARTIFACT}, "{7}");
  addSuperType(SuperType.LEGENDARY);
  this.subtype.add(SubType.EQUIPMENT);
  this.transformable = true;
  this.secondSideCardClazz = mage.cards.w.WithengarUnbound.class;
  this.addAbility(new TransformAbility());
  // Equipped creature gets +1/+0.
  this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostEquippedEffect(1, 0)));
  // When equipped creature deals combat damage to a player, unattach Elbrus, the Binding Blade, then transform it.
  this.addAbility(new DealsDamageToAPlayerAttachedTriggeredAbility(new ElbrusTheBindingBladeEffect(), "equipped", true));
  // Equip {1}
  this.addAbility(new EquipAbility(Outcome.AddAbility, new GenericManaCost(1)));
}
origin: magefree/mage

public NecromanticThirst(UUID ownerId, CardSetInfo setInfo) {
  super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{2}{B}{B}");
  this.subtype.add(SubType.AURA);
  // Enchant creature
  TargetPermanent auraTarget = new TargetCreaturePermanent();
  this.getSpellAbility().addTarget(auraTarget);
  this.getSpellAbility().addEffect(new AttachEffect(Outcome.Benefit));
  this.addAbility(new EnchantAbility(auraTarget.getTargetName()));
  // Whenever enchanted creature deals combat damage to a player, you may return target creature card from your graveyard to your hand.
  Ability ability = new DealsDamageToAPlayerAttachedTriggeredAbility(
      new ReturnFromGraveyardToHandTargetEffect(),
      "enchanted creature", true, false, true, TargetController.ANY);
  ability.addTarget(new TargetCardInYourGraveyard(StaticFilters.FILTER_CARD_CREATURE_YOUR_GRAVEYARD));
  this.addAbility(ability);
}
origin: magefree/mage

public NekoTe(UUID ownerId, CardSetInfo setInfo) {
  super(ownerId,setInfo,new CardType[]{CardType.ARTIFACT},"{3}");
  this.subtype.add(SubType.EQUIPMENT);
  // Whenever equipped creature deals damage to a creature, tap that creature. That creature doesn't untap during its controller's untap step for as long as Neko-Te remains on the battlefield.
  ContinuousRuleModifyingEffect skipUntapEffect = new DontUntapInControllersUntapStepTargetEffect(Duration.WhileOnBattlefield);
  skipUntapEffect.setText("That creature doesn't untap during its controller's untap step for as long as {this} remains on the battlefield");
  ConditionalContinuousRuleModifyingEffect effect = new ConditionalContinuousRuleModifyingEffect(skipUntapEffect, SourceOnBattlefieldCondition.instance);
  Ability ability = new DealsDamageToACreatureAttachedTriggeredAbility(new TapTargetEffect("that creature"), false, "equipped creature", false, true);
  ability.addEffect(effect);
  this.addAbility(ability);
  // Whenever equipped creature deals damage to a player, that player loses 1 life.
  this.addAbility(new DealsDamageToAPlayerAttachedTriggeredAbility(new LoseLifeTargetEffect(1), "equipped creature", false, true, false));
  // Equip {2}
  this.addAbility(new EquipAbility(Outcome.Benefit, new GenericManaCost(2)));
}
origin: magefree/mage

public SkeletonKey(UUID ownerId, CardSetInfo setInfo) {
  super(ownerId,setInfo,new CardType[]{CardType.ARTIFACT},"{1}");
  this.subtype.add(SubType.EQUIPMENT);
  // Equipped creature has skulk.
  this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new GainAbilityAttachedEffect(new SkulkAbility(), AttachmentType.EQUIPMENT)));
  // Whenever equipped creature deals combat damage to a player, you may draw a card. if you do, discard a card.
  Ability ability = new DealsDamageToAPlayerAttachedTriggeredAbility(new DrawCardSourceControllerEffect(1), "equipped creature", true);
  Effect effect = new DiscardControllerEffect(1);
  effect.setText("If you do, discard a card");
  ability.addEffect(effect);
  this.addAbility(ability);
  // Equip {2}
  this.addAbility(new EquipAbility(Outcome.AddAbility, new GenericManaCost(2)));
}
origin: magefree/mage

public OneWithNature(UUID ownerId, CardSetInfo setInfo) {
  super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{G}");
  this.subtype.add(SubType.AURA);
  // Enchant creature
  TargetPermanent auraTarget = new TargetCreaturePermanent();
  this.getSpellAbility().addTarget(auraTarget);
  this.getSpellAbility().addEffect(new AttachEffect(Outcome.PutLandInPlay));
  Ability ability = new EnchantAbility(auraTarget.getTargetName());
  this.addAbility(ability);
  // Whenever enchanted creature deals combat damage to a player, you may search your library for a basic land card, put that card onto the battlefield tapped, then shuffle your library.
  ability = new DealsDamageToAPlayerAttachedTriggeredAbility(
      new SearchLibraryPutInPlayEffect(new TargetCardInLibrary(StaticFilters.FILTER_CARD_BASIC_LAND), true, Outcome.PutLandInPlay)
          .setText("you may search your library for a basic land card, put that card onto the battlefield tapped, then shuffle your library."),
      "enchanted creature", true, false, true, TargetController.ANY);
  this.addAbility(ability);
}
origin: magefree/mage

public SleepersRobe(UUID ownerId, CardSetInfo setInfo) {
  super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{U}{B}");
  this.subtype.add(SubType.AURA);
  // Enchant creature
  TargetPermanent auraTarget = new TargetCreaturePermanent();
  this.getSpellAbility().addTarget(auraTarget);
  this.getSpellAbility().addEffect(new AttachEffect(Outcome.AddAbility));
  Ability ability = new EnchantAbility(auraTarget.getTargetName());
  this.addAbility(ability);
  // Enchanted creature has fear.
  this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new GainAbilityAttachedEffect(FearAbility.getInstance(), AttachmentType.AURA)));
  // Whenever enchanted creature deals combat damage to an opponent, you may draw a card.
  this.addAbility(new DealsDamageToAPlayerAttachedTriggeredAbility(new DrawCardSourceControllerEffect(1), "enchanted creature", true, false, true, TargetController.OPPONENT));
}
mage.abilities.commonDealsDamageToAPlayerAttachedTriggeredAbility

Most used methods

  • <init>
  • getControllerId
  • getEffects
  • getSourceId
  • isControlledBy

Popular in Java

  • Making http requests using okhttp
  • onRequestPermissionsResult (Fragment)
  • getContentResolver (Context)
  • setScale (BigDecimal)
  • BufferedImage (java.awt.image)
    The BufferedImage subclass describes an java.awt.Image with an accessible buffer of image data. All
  • BufferedReader (java.io)
    Wraps an existing Reader and buffers the input. Expensive interaction with the underlying reader is
  • Proxy (java.net)
    This class represents proxy server settings. A created instance of Proxy stores a type and an addres
  • MessageDigest (java.security)
    Uses a one-way hash function to turn an arbitrary number of bytes into a fixed-length byte sequence.
  • Timestamp (java.sql)
    A Java representation of the SQL TIMESTAMP type. It provides the capability of representing the SQL
  • Format (java.text)
    The base class for all formats. This is an abstract base class which specifies the protocol for clas
  • 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