@Override public FlankingAbility copy() { return new FlankingAbility(this); }
@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; }
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") )); }
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.") )); }
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); }
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()); }
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()); }
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 )); }
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()); }
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()); }
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))); }
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()); }
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()); }
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()); }
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()); }
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())); }
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)); }
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}"))); }
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}"))); }
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}"))); }