Tabnine Logo
ConditionalRequirementEffect
Code IndexAdd Tabnine to your IDE (free)

How to use
ConditionalRequirementEffect
in
mage.abilities.decorator

Best Java code snippets using mage.abilities.decorator.ConditionalRequirementEffect (Showing top 6 results out of 315)

origin: magefree/mage

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

@Override
public boolean applies(Permanent permanent, Ability source, Game game) {
  if (!initDone) { // if simpleStaticAbility, init won't be called
    init(source, game);
  }
  conditionState = condition.apply(game, source);
  if (conditionState) {
    effect.setTargetPointer(this.targetPointer);
    return effect.applies(permanent, source,game);
  } else if (otherwiseEffect != null) {
    otherwiseEffect.setTargetPointer(this.targetPointer);
    return otherwiseEffect.applies(permanent, source, game);
  }
  if (!conditionState && effect.getDuration() == Duration.OneUse) {
    used = true;
  }
  if (!conditionState && effect.getDuration() == Duration.Custom) {
    this.discard();
  }
  return false;
}
origin: magefree/mage

public MaraudingMaulhorn(UUID ownerId, CardSetInfo setInfo) {
  super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{2}{R}{R}");
  this.subtype.add(SubType.BEAST);
  this.power = new MageInt(5);
  this.toughness = new MageInt(3);
  // Marauding Maulhorn attacks each combat if able unless you control a creature named Advocate of the Beast.
  Effect effect = new ConditionalRequirementEffect(
      new AttacksIfAbleSourceEffect(Duration.WhileOnBattlefield, true),
      new PermanentsOnTheBattlefieldCondition(filter, ComparisonType.FEWER_THAN, 1));
  effect.setText("{this} attacks each combat if able unless you control a creature named Advocate of the Beast");
  this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, effect));
}
origin: magefree/mage

public RecklessCohort(UUID ownerId, CardSetInfo setInfo) {
  super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{1}{R}");
  this.subtype.add(SubType.HUMAN);
  this.subtype.add(SubType.WARRIOR);
  this.subtype.add(SubType.ALLY);
  this.power = new MageInt(2);
  this.toughness = new MageInt(2);
  // Reckless Cohort attacks each combat if able unless you control another Ally.
  Effect effect = new ConditionalRequirementEffect(
      new AttacksIfAbleSourceEffect(Duration.WhileOnBattlefield, true),
      new PermanentsOnTheBattlefieldCondition(filter, ComparisonType.FEWER_THAN, 1));
  effect.setText("{this} attacks each combat if able unless you control another Ally");
  this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, effect));
}
origin: magefree/mage

public SetonsDesire(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);
  // Enchanted creature gets +2/+2.
  this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostEnchantedEffect(2, 2, Duration.WhileOnBattlefield)));
  // Threshold - As long as seven or more cards are in your graveyard, all creatures able to block enchanted creature do so.
  Effect effect = new ConditionalRequirementEffect(new MustBeBlockedByAllAttachedEffect(AttachmentType.AURA), new CardsInControllerGraveCondition(7));
  effect.setText("As long as seven or more cards are in your graveyard, all creatures able to block enchanted creature do so");
  ability = new SimpleStaticAbility(Zone.BATTLEFIELD, effect);
  ability.setAbilityWord(AbilityWord.THRESHOLD);
  this.addAbility(ability);
}
origin: magefree/mage

public GiftOfTheDeity(UUID ownerId, CardSetInfo setInfo) {
  super(ownerId,setInfo,new CardType[]{CardType.ENCHANTMENT},"{4}{B/G}");
  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);
  // As long as enchanted creature is black, it gets +1/+1 and has deathtouch.
  SimpleStaticAbility blackAbility = new SimpleStaticAbility(Zone.BATTLEFIELD, new ConditionalContinuousEffect(new BoostEnchantedEffect(1, 1), new EnchantedCreatureColorCondition(ObjectColor.BLACK), "As long as enchanted creature is black, it gets +1/+1"));
  blackAbility.addEffect(new ConditionalContinuousEffect(new GainAbilityAttachedEffect(DeathtouchAbility.getInstance(), AttachmentType.AURA), new EnchantedCreatureColorCondition(ObjectColor.BLACK), "and has deathtouch"));
  this.addAbility(blackAbility);
  // As long as enchanted creature is green, it gets +1/+1 and all creatures able to block it do so.
  SimpleStaticAbility greenAbility;
  greenAbility = new SimpleStaticAbility(Zone.BATTLEFIELD, new ConditionalContinuousEffect(new BoostEnchantedEffect(1, 1), new EnchantedCreatureColorCondition(ObjectColor.GREEN),
    "As long as enchanted creature is green, it gets +1/+1"));
  Effect effect = new ConditionalRequirementEffect(new MustBeBlockedByAllAttachedEffect(AttachmentType.AURA), new EnchantedCreatureColorCondition(ObjectColor.GREEN));
  effect.setText("and all creatures able to block it do so");
  greenAbility.addEffect(effect);
  this.addAbility(greenAbility);
}
mage.abilities.decoratorConditionalRequirementEffect

Most used methods

  • <init>
  • discard
  • init

Popular in Java

  • Reactive rest calls using spring rest template
  • putExtra (Intent)
  • compareTo (BigDecimal)
  • runOnUiThread (Activity)
  • Color (java.awt)
    The Color class is used to encapsulate colors in the default sRGB color space or colors in arbitrary
  • String (java.lang)
  • Scanner (java.util)
    A parser that parses a text string of primitive types and strings with the help of regular expressio
  • Collectors (java.util.stream)
  • ImageIO (javax.imageio)
  • BoxLayout (javax.swing)
  • From CI to AI: The AI layer in your organization
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