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

How to use
FlankingAbility
in
mage.abilities.keyword

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

origin: magefree/mage

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

@Override
public boolean checkTrigger(GameEvent event, Game game) {
  if (event.getTargetId().equals(this.getSourceId())) {
    Permanent permanent = game.getPermanent(event.getSourceId());
    if (permanent != null) {
      boolean hasFlankingAbility
          = permanent.getAbilities().stream().anyMatch(ability -> ability instanceof FlankingAbility);
      if (!hasFlankingAbility) {
        for (Effect effect : this.getEffects()) {
          effect.setTargetPointer(new FixedTarget(event.getSourceId()));
        }
        return true;
      }
    }
  }
  return false;
}
origin: magefree/mage

public SidewinderSliver(UUID ownerId, CardSetInfo setInfo) {
  super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{W}");
  this.subtype.add(SubType.SLIVER);
  this.power = new MageInt(1);
  this.toughness = new MageInt(1);
  // All Sliver creatures have flanking.
  this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD,
      new GainAbilityAllEffect(new FlankingAbility(), Duration.WhileOnBattlefield, filter, false)
          .setText("all Slivers have flanking")
  ));
}
origin: magefree/mage

public CavalryMaster(UUID ownerId, CardSetInfo setInfo) {
  super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{2}{W}{W}");
  this.subtype.add(SubType.HUMAN);
  this.subtype.add(SubType.KNIGHT);
  this.power = new MageInt(3);
  this.toughness = new MageInt(3);
  // Flanking
  this.addAbility(new FlankingAbility());
  // Other creatures you control with flanking have flanking.
  this.addAbility(new SimpleStaticAbility(
      Zone.BATTLEFIELD, new GainAbilityAllEffect(new FlankingAbility(), Duration.WhileOnBattlefield, filter, true)
          .setText("Other creatures you control with flanking have flanking.")
  ));
}
origin: magefree/mage

public JabarisBanner(UUID ownerId, CardSetInfo setInfo) {
  super(ownerId,setInfo,new CardType[]{CardType.ARTIFACT},"{2}");
  // {1}, {tap}: Target creature gains flanking until end of turn.
  Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new GainAbilityTargetEffect(new FlankingAbility(), Duration.EndOfTurn), new ManaCostsImpl("{1}"));
  ability.addCost(new TapSourceCost());
  ability.addTarget(new TargetCreaturePermanent());
  this.addAbility(ability);
}
origin: magefree/mage

public BenalishCavalry(UUID ownerId, CardSetInfo setInfo) {
  super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{1}{W}");
  this.subtype.add(SubType.HUMAN, SubType.KNIGHT);
  this.power = new MageInt(2);
  this.toughness = new MageInt(2);
  // Flanking
  this.addAbility(new FlankingAbility());
}
origin: magefree/mage

public ShadowRider(UUID ownerId, CardSetInfo setInfo) {
  super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{2}{B}{B}");
  this.subtype.add(SubType.KNIGHT);
  this.power = new MageInt(3);
  this.toughness = new MageInt(3);
  // Flanking
  this.addAbility(new FlankingAbility());
}
origin: magefree/mage

public BarbedFoliage(UUID ownerId, CardSetInfo setInfo) {
  super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{2}{G}{G}");
  // Whenever a creature attacks you, it loses flanking until end of turn.
  this.addAbility(new AttackedByCreatureTriggeredAbility(
      new LoseAbilityTargetEffect(new FlankingAbility())
          .setText("it loses flanking until end of turn"),
      false, SetTargetPointer.PERMANENT
  ));
  // Whenever a creature without flying attacks you, Barbed Foliage deals 1 damage to it.
  this.addAbility(new AttackedByCreatureTriggeredAbility(
      Zone.BATTLEFIELD,
      new DamageTargetEffect(1)
          .setText("{this} deals 1 damage to it"),
      false, SetTargetPointer.PERMANENT, filter
  ));
}
origin: magefree/mage

public MtendaHerder(UUID ownerId, CardSetInfo setInfo) {
  super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{W}");
  this.subtype.add(SubType.HUMAN);
  this.subtype.add(SubType.SCOUT);
  this.power = new MageInt(1);
  this.toughness = new MageInt(1);
  // Flanking
  this.addAbility(new FlankingAbility());
}
origin: magefree/mage

public BogardanLancer(UUID ownerId, CardSetInfo setInfo) {
  super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{1}{R}");
  this.subtype.add(SubType.HUMAN, SubType.KNIGHT);
  this.power = new MageInt(1);
  this.toughness = new MageInt(1);
  // Bloodthirst 1
  this.addAbility(new BloodthirstAbility(1));
  // Flanking
  this.addAbility(new FlankingAbility());
}
origin: magefree/mage

public Agility(UUID ownerId, CardSetInfo setInfo) {
  super(ownerId,setInfo,new CardType[]{CardType.ENCHANTMENT},"{1}{R}");
  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 gets +1/+1 and has flanking.
  this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostEnchantedEffect(1, 1)));
  this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new GainAbilityAttachedEffect(new FlankingAbility(), AttachmentType.AURA)));
}
origin: magefree/mage

public RiftmarkedKnightToken() {
  super("Knight", "2/2 black Knight creature token with flanking, protection from white, and haste");
  cardType.add(CardType.CREATURE);
  color.setBlack(true);
  subtype.add(SubType.KNIGHT);
  power = new MageInt(2);
  toughness = new MageInt(2);
  this.addAbility(ProtectionAbility.from(ObjectColor.WHITE));
  this.addAbility(new FlankingAbility());
  this.addAbility(HasteAbility.getInstance());
}
origin: magefree/mage

public JolraelsCentaur(UUID ownerId, CardSetInfo setInfo) {
  super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{1}{G}{G}");
  this.subtype.add(SubType.CENTAUR);
  this.subtype.add(SubType.ARCHER);
  this.power = new MageInt(2);
  this.toughness = new MageInt(2);
  // Shroud
  this.addAbility(ShroudAbility.getInstance());
  // Flanking
  this.addAbility(new FlankingAbility());
}
origin: magefree/mage

public FallenAskari(UUID ownerId, CardSetInfo setInfo) {
  super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{1}{B}");
  this.subtype.add(SubType.HUMAN);
  this.subtype.add(SubType.KNIGHT);
  this.power = new MageInt(2);
  this.toughness = new MageInt(2);
  // Flanking
  this.addAbility(new FlankingAbility());
  
  // Fallen Askari can't block.
  this.addAbility(new CantBlockAbility());
}
origin: magefree/mage

public SuqAtaLancer(UUID ownerId, CardSetInfo setInfo) {
  super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{2}{R}");
  this.subtype.add(SubType.HUMAN);
  this.subtype.add(SubType.KNIGHT);
  this.power = new MageInt(2);
  this.toughness = new MageInt(2);
  // Haste
  this.addAbility(HasteAbility.getInstance());
  // Flanking
  this.addAbility(new FlankingAbility());
}
origin: magefree/mage

public SkulkingKnight(UUID ownerId, CardSetInfo setInfo) {
  super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{2}{B}");
  this.subtype.add(SubType.ZOMBIE);
  this.subtype.add(SubType.KNIGHT);
  this.power = new MageInt(3);
  this.toughness = new MageInt(3);
  // Flanking
  this.addAbility(new FlankingAbility());
  // When Skulking Knight becomes the target of a spell or ability, sacrifice it.
  this.addAbility(new BecomesTargetTriggeredAbility(new SacrificeSourceEffect()));
}
origin: magefree/mage

public TelimTor(UUID ownerId, CardSetInfo setInfo) {
  super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{4}{R}");
  this.addSuperType(SuperType.LEGENDARY);
  this.subtype.add(SubType.HUMAN);
  this.subtype.add(SubType.KNIGHT);
  this.power = new MageInt(2);
  this.toughness = new MageInt(2);
  // Flanking
  this.addAbility(new FlankingAbility());
  // Whenever Telim'Tor attacks, all attacking creatures with flanking get +1/+1 until end of turn.
  this.addAbility(new AttacksTriggeredAbility(new BoostAllEffect(1, 1, Duration.EndOfTurn, filter, false), false));
}
origin: magefree/mage

public TeferisHonorGuard(UUID ownerId, CardSetInfo setInfo) {
  super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{2}{W}");
  this.subtype.add(SubType.HUMAN);
  this.subtype.add(SubType.KNIGHT);
  this.power = new MageInt(2);
  this.toughness = new MageInt(2);
  // Flanking
  this.addAbility(new FlankingAbility());
  
  // {U}{U}: Teferi's Honor Guard phases out.
  this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new PhaseOutSourceEffect(), new ManaCostsImpl("{U}{U}")));
}
origin: magefree/mage

public ZhalfirinKnight(UUID ownerId, CardSetInfo setInfo) {
  super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{2}{W}");
  this.subtype.add(SubType.HUMAN, SubType.KNIGHT);
  this.power = new MageInt(2);
  this.toughness = new MageInt(2);
  // Flanking
  this.addAbility(new FlankingAbility());
  // {W}{W}: Zhalfirin Knight gains first strike until end of turn.
  this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new GainAbilitySourceEffect(FirstStrikeAbility.getInstance(), Duration.EndOfTurn), new ManaCostsImpl("{W}{W}")));
}
origin: magefree/mage

public CadaverousKnight(UUID ownerId, CardSetInfo setInfo) {
  super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{2}{B}");
  this.subtype.add(SubType.ZOMBIE);
  this.subtype.add(SubType.KNIGHT);
  this.power = new MageInt(2);
  this.toughness = new MageInt(2);
  // Flanking
  this.addAbility(new FlankingAbility());
  // {1}{B}{B}: Regenerate Cadaverous Knight.
  this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new RegenerateSourceEffect(), new ManaCostsImpl("{1}{B}{B}")));
}
mage.abilities.keywordFlankingAbility

Most used methods

  • <init>
  • getEffects
  • getSourceId

Popular in Java

  • Running tasks concurrently on multiple threads
  • addToBackStack (FragmentTransaction)
  • setContentView (Activity)
  • getExternalFilesDir (Context)
  • TimeUnit (java.util.concurrent)
    A TimeUnit represents time durations at a given unit of granularity and provides utility methods to
  • AtomicInteger (java.util.concurrent.atomic)
    An int value that may be updated atomically. See the java.util.concurrent.atomic package specificati
  • JarFile (java.util.jar)
    JarFile is used to read jar entries and their associated data from jar files.
  • 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
  • Modifier (javassist)
    The Modifier class provides static methods and constants to decode class and member access modifiers
  • JOptionPane (javax.swing)
  • Best IntelliJ 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