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

How to use
DealsDamageToACreatureAttachedTriggeredAbility
in
mage.abilities.common

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

origin: magefree/mage

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

@Override
public boolean checkTrigger(GameEvent event, Game game) {
  if (!combatOnly || ((DamagedCreatureEvent) event).isCombatDamage()) {
    Permanent attachment = game.getPermanent(this.getSourceId());
    if (attachment != null
        && attachment.isAttachedTo(event.getSourceId())) {
      if (setTargetPointer) {
        for (Effect effect : this.getEffects()) {
          effect.setTargetPointer(new FixedTarget(event.getTargetId()));
          effect.setValue("damage", event.getAmount());
        }
      }
      return true;
    }
  }
  return false;
}
origin: magefree/mage

public VenomousFangs(UUID ownerId, CardSetInfo setInfo) {
  super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{2}{G}");
  
  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 damage to a creature, destroy the other creature.
  this.addAbility(new DealsDamageToACreatureAttachedTriggeredAbility(new DestroyTargetEffect(), false, "enchanted creature", false, true));
  
}
origin: magefree/mage

public Charisma(UUID ownerId, CardSetInfo setInfo) {
  super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{U}{U}{U}");
  
  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 damage to a creature, gain control of the other creature for as long as Charisma remains on the battlefield.
  Condition condition = SourceOnBattlefieldCondition.instance;
  ConditionalContinuousEffect conditionalEffect = new ConditionalContinuousEffect(new GainControlTargetEffect(Duration.Custom), condition, rule);
  this.addAbility(new DealsDamageToACreatureAttachedTriggeredAbility(conditionalEffect, false, "enchanted creature", false, true));
  
}
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)));
}
mage.abilities.commonDealsDamageToACreatureAttachedTriggeredAbility

Most used methods

  • <init>
  • getEffects
  • getSourceId

Popular in Java

  • Updating database using SQL prepared statement
  • compareTo (BigDecimal)
  • findViewById (Activity)
  • getExternalFilesDir (Context)
  • BufferedInputStream (java.io)
    A BufferedInputStream adds functionality to another input stream-namely, the ability to buffer the i
  • BigDecimal (java.math)
    An immutable arbitrary-precision signed decimal.A value is represented by an arbitrary-precision "un
  • Executors (java.util.concurrent)
    Factory and utility methods for Executor, ExecutorService, ScheduledExecutorService, ThreadFactory,
  • Manifest (java.util.jar)
    The Manifest class is used to obtain attribute information for a JarFile and its entries.
  • ZipFile (java.util.zip)
    This class provides random read access to a zip file. You pay more to read the zip file's central di
  • IOUtils (org.apache.commons.io)
    General IO stream manipulation utilities. This class provides static utility methods for input/outpu
  • Top Sublime Text plugins
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