Codota Logo
mage.abilities.condition.common
Code IndexAdd Codota to your IDE (free)

How to use mage.abilities.condition.common

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

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
DateTime d =
  • Codota Iconnew DateTime()
  • Codota IconDateTimeFormatter formatter;String text;formatter.parseDateTime(text)
  • Codota IconObject instant;new DateTime(instant)
  • Smart code suggestions by Codota
}
origin: magefree/mage

public RamunapHydraBoostEffect(int power, int toughness) {
  super(Duration.WhileOnBattlefield, Layer.PTChangingEffects_7, SubLayer.ModifyPT_7c, new CardsInControllerGraveCondition(1, filter), Outcome.BoostCreature);
  this.power = power;
  this.toughness = toughness;
  staticText = "{this} gets +1/+1 as long as there is a Desert card in your graveyard";
}
origin: magefree/mage

public OathswornVampirePlayEffect() {
  super(AsThoughEffectType.PLAY_FROM_NOT_OWN_HAND_ZONE, Duration.EndOfGame, Outcome.Benefit);
  staticText = "You may cast {this} from your graveyard if you gained life this turn";
  condition = new YouGainedLifeCondition(ComparisonType.MORE_THAN, 0);
}
origin: magefree/mage

public OgreJailbreakerEffect() {
  super(AsThoughEffectType.ATTACK, Duration.WhileOnBattlefield, Outcome.Benefit);
  staticText = "{this} can attack as though it didn't have defender as long as you control a Gate";
  gateCondition = new PermanentsOnTheBattlefieldCondition(filter);
}
origin: magefree/mage

public RushwoodLegate(UUID ownerId, CardSetInfo setInfo) {
  super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{2}{G}");
  this.subtype.add(SubType.DRYAD);
  this.power = new MageInt(2);
  this.toughness = new MageInt(1);
  // If an opponent controls an Island and you control a Forest, you may cast this spell without paying its mana cost.
  Condition condition = new CompoundCondition("If an opponent controls an Island and you control a Forest",
      new OpponentControlsPermanentCondition(filterIsland),
      new PermanentsOnTheBattlefieldCondition(filterForest));
  this.addAbility(new AlternativeCostSourceAbility(null, condition));
}
origin: magefree/mage

@Override
public boolean checkInterveningIfClause(Game game) {
  return new PermanentsOnTheBattlefieldCondition(filter, ComparisonType.MORE_THAN, 0).apply(game, this);
}
origin: magefree/mage

@Override
public boolean checkTrigger(GameEvent event, Game game) {
  return MyTurnCondition.instance.apply(game, this);
}
origin: magefree/mage

public SourceHasRemainedInSameZoneCondition getInstance(UUID cardId) {
  return new SourceHasRemainedInSameZoneCondition(cardId);
}
origin: magefree/mage

  @Override
  public boolean apply(Game game, Ability source) {
    if (new CardsInControllerGraveCondition(7).apply(game, source)) {
      game.addEffect(new GainProtectionFromColorAllEffect(
          Duration.EndOfTurn,
          StaticFilters.FILTER_CONTROLLED_CREATURES
      ), source);
    }
    return true;
  }
}
origin: magefree/mage

  @Override
  public void adjustTargets(Ability ability, Game game) {
    if (KickedCondition.instance.apply(game, ability)) {
      ability.addTarget(new TargetPlayerOrPlaneswalker());
    }
  }
}
origin: magefree/mage

@Override
public boolean checkInterveningIfClause(Game game) {
  return MonstrousCondition.instance.apply(game, this);
}
origin: magefree/mage

  @Override
  public void adjustCosts(Ability ability, Game game) {
    if (ability instanceof SpellAbility) { // Prevent adjustment of activated ability
      if (MorbidCondition.instance.apply(game, ability)) {
        CardUtil.adjustCost((SpellAbility) ability, 3);
      }
    }
  }
}
origin: magefree/mage

@Override
public boolean applies(UUID sourceId, Ability source, UUID affectedControllerId, Game game) {
  if (sourceId.equals(source.getSourceId()) && gateCondition.apply(game, source))  {
    return true;
  }
  return false;
}
origin: magefree/mage

@Override
protected boolean selectedByRuntimeData(Permanent permanent, Ability source, Game game) {
  int correctModResult;
  if (oddCondition.apply(game, source)) {
    correctModResult = 1;
  } else {
    correctModResult = 0;
  }
  return permanent != null && creaturefilter.match(permanent, game) && permanent.getConvertedManaCost() % 2 == correctModResult;
}

origin: magefree/mage

@Override
public boolean apply(Game game, Ability source) {
  if ( MetalcraftCondition.instance.apply(game, source) ) {
    return new SacrificeEffect(filter, 2, effectText).apply(game, source);
  }
  else {
    return new SacrificeEffect(filter, 1, effectText).apply(game, source);
  }
}
origin: magefree/mage

  @Override
  public boolean apply(Game game, Ability source) {
    if (AddendumCondition.instance.apply(game, source)) {
      new PutCardFromHandOntoBattlefieldEffect(filter).apply(game, source);
    }
    return ExileSpellEffect.getInstance().apply(game, source);
  }
}
origin: magefree/mage

public Massacre(UUID ownerId, CardSetInfo setInfo) {
  super(ownerId,setInfo,new CardType[]{CardType.SORCERY},"{2}{B}{B}");
  // If an opponent controls a Plains and you control a Swamp, you may cast this spell without paying its mana cost.
  Condition condition = new CompoundCondition("If an opponent controls a Plains and you control a Swamp", 
      new OpponentControlsPermanentCondition(filterPlains),
      new PermanentsOnTheBattlefieldCondition(filterSwamp));
  this.addAbility(new AlternativeCostSourceAbility(null, condition));
  // All creatures get -2/-2 until end of turn.
  this.getSpellAbility().addEffect(new BoostAllEffect(-2, -2, Duration.EndOfTurn));
}
origin: magefree/mage

public BoostSourceWhileControlsEffect(FilterPermanent filter, int power, int toughness) {
  super(Duration.WhileOnBattlefield, Layer.PTChangingEffects_7, SubLayer.ModifyPT_7c, new PermanentsOnTheBattlefieldCondition(filter), Outcome.BoostCreature);
  this.power = power;
  this.toughness = toughness;
  this.filterDescription = filter.getMessage();
  staticText = "{this} gets " 
      + String.format("%1$+d/%2$+d", power, toughness)
      + " as long as you control "
      + (filterDescription.startsWith("an ") ? "":"a ")
      + filterDescription;
}
origin: magefree/mage

  @Override
  public void adjustTargets(Ability ability, Game game) {
    ability.addTarget(new TargetAnyTargetAmount(KickedCondition.instance.apply(game, ability) ? 6 : 3));
  }
}
origin: magefree/mage

  @Override
  public void adjustTargets(Ability ability, Game game) {
    ability.addTarget(new TargetAnyTarget(KickedCondition.instance.apply(game, ability) ? 2 : 1));
  }
}
origin: magefree/mage

@Override
public void adjustTargets(Ability ability, Game game) {
  if (KickedCondition.instance.apply(game, ability)) {
    ability.addTarget(new TargetCreaturePermanent());
  }
}
mage.abilities.condition.common

Most used classes

  • MyTurnCondition
  • PermanentsOnTheBattlefieldCondition
    Battlefield checking condition. This condition can decorate other conditions as well as be used stan
  • SourceHasCounterCondition
  • SourceHasRemainedInSameZoneCondition
    As long as the card has remained in the same zone since this condition was created, the condition is
  • TargetHasCounterCondition
  • AnyPlayerControlsCondition,
  • AttachedToCounterCondition,
  • AttachedToMatchesFilterCondition,
  • BuybackCondition,
  • CardsInAnyLibraryCondition,
  • CardsInControllerGraveCondition,
  • CardsInHandCondition,
  • CardsInOpponentGraveCondition,
  • CastFromEverywhereSourceCondition,
  • CastFromHandSourceCondition,
  • ControlsPermanentGreatestCMCCondition,
  • ControlsPermanentsComparedToOpponentsCondition,
  • CreatureCountCondition,
  • DashedCondition
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now