@Override public AttacksAloneTriggeredAbility copy() { return new AttacksAloneTriggeredAbility(this); }
@Override public boolean checkTrigger(GameEvent event, Game game) { if(game.isActivePlayer(this.controllerId) ) { UUID creatureId = this.getSourceId(); if(creatureId != null) { if(game.getCombat().attacksAlone() && Objects.equals(creatureId, game.getCombat().getAttackers().get(0))) { UUID defender = game.getCombat().getDefenderId(creatureId); if(defender != null) { for(Effect effect: getEffects()) { effect.setTargetPointer(new FixedTarget(defender)); } } return true; } } } return false; }
public RogueKavu(UUID ownerId, CardSetInfo setInfo) { super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{1}{R}"); this.subtype.add(SubType.KAVU); this.power = new MageInt(1); this.toughness = new MageInt(1); // Whenever Rogue Kavu attacks alone, it gets +2/+0 until end of turn. this.addAbility(new AttacksAloneTriggeredAbility(new BoostSourceEffect(2, 0, Duration.EndOfTurn))); }
public RecklessOgre(UUID ownerId, CardSetInfo setInfo) { super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{3}{R}"); this.subtype.add(SubType.OGRE); this.power = new MageInt(3); this.toughness = new MageInt(2); // Whenever Reckless Ogre attacks alone, it gets +3/+0 until end of turn. this.addAbility(new AttacksAloneTriggeredAbility(new BoostSourceEffect(3, 0, Duration.EndOfTurn).setText("it gets +3/+0 until end of turn"))); }
public YuanShaosInfantry(UUID ownerId, CardSetInfo setInfo) { super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{3}{R}"); this.subtype.add(SubType.HUMAN); this.subtype.add(SubType.SOLDIER); this.power = new MageInt(2); this.toughness = new MageInt(2); // Whenever Yuan Shao's Infantry attacks alone, Yuan Shao's Infantry can't be blocked this combat. Effect effect = new CantBeBlockedSourceEffect(Duration.EndOfCombat); effect.setText("it can't be blocked this combat"); this.addAbility(new AttacksAloneTriggeredAbility(effect)); }
public LunkErrant(UUID ownerId, CardSetInfo setInfo) { super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{5}{R}"); this.subtype.add(SubType.GIANT); this.subtype.add(SubType.WARRIOR); this.power = new MageInt(4); this.toughness = new MageInt(4); // Whenever Lunk Errant attacks alone, it gets +1/+1 and gains trample until end of turn. Effect effect = new BoostSourceEffect(1, 1, Duration.EndOfTurn); effect.setText("it gets +1/+1"); Ability ability = new AttacksAloneTriggeredAbility(effect); effect = new GainAbilitySourceEffect(TrampleAbility.getInstance(), Duration.EndOfTurn); effect.setText("and gains trample until end of turn"); ability.addEffect(effect); this.addAbility(ability); }
public MaChaoWesternWarrior(UUID ownerId, CardSetInfo setInfo) { super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{3}{R}{R}"); addSuperType(SuperType.LEGENDARY); this.subtype.add(SubType.HUMAN); this.subtype.add(SubType.SOLDIER); this.subtype.add(SubType.WARRIOR); this.power = new MageInt(3); this.toughness = new MageInt(3); // Horsemanship this.addAbility(HorsemanshipAbility.getInstance()); // Whenever Ma Chao, Western Warrior attacks alone, it can't be blocked this combat. Effect effect = new CantBeBlockedSourceEffect(Duration.EndOfCombat); effect.setText("it can't be blocked this combat"); this.addAbility(new AttacksAloneTriggeredAbility(effect)); }
public NefaroxOverlordOfGrixis(UUID ownerId, CardSetInfo setInfo) { super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{4}{B}{B}"); addSuperType(SuperType.LEGENDARY); this.subtype.add(SubType.DEMON); this.power = new MageInt(5); this.toughness = new MageInt(5); // Flying this.addAbility(FlyingAbility.getInstance()); // Exalted this.addAbility(new ExaltedAbility()); // Whenever Nefarox, Overlord of Grixis attacks alone, defending player sacrifices a creature. this.addAbility(new AttacksAloneTriggeredAbility(new SacrificeEffect( new FilterControlledCreaturePermanent("a creature"), 1, "defending player"))); }
public GrunnTheLonelyKing(UUID ownerId, CardSetInfo setInfo) { super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{4}{G}{G}"); this.addSuperType(SuperType.LEGENDARY); this.subtype.add(SubType.APE, SubType.WARRIOR); this.power = new MageInt(5); this.toughness = new MageInt(5); //Kicker {3} (You may pay an additional {3} as you cast this spell.) this.addAbility(new KickerAbility("{3}")); //If Grunn, the Lonely King was kicked, it enters the battlefield with five +1/+1 counters on it. this.addAbility(new EntersBattlefieldAbility(new AddCountersSourceEffect(CounterType.P1P1.createInstance(5)), KickedCondition.instance, "If {this} was kicked, it enters the battlefield with five +1/+1 counters on it", "")); //Whenever Grunn attacks alone, double its power and toughness until end of turn. SourcePermanentPowerCount power = new SourcePermanentPowerCount(); SourcePermanentToughnessValue toughness = new SourcePermanentToughnessValue(); Effect effect = new BoostSourceEffect(power, toughness, Duration.EndOfTurn, true); effect.setText("double its power and toughness until end of turn"); this.addAbility(new AttacksAloneTriggeredAbility(effect)); }
public QuiGonJinn(UUID ownerId, CardSetInfo setInfo) { super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{2}{G}{U}{W}"); addSuperType(SuperType.LEGENDARY); this.subtype.add(SubType.HUMAN); this.subtype.add(SubType.JEDI); this.power = new MageInt(4); this.toughness = new MageInt(4); // Vigilance this.addAbility(VigilanceAbility.getInstance()); // When Qui-Gon Jinn attacks alone, it gets +2/+2 and lifelink until end of turn. Effect effect = new BoostSourceEffect(2, 2, Duration.EndOfTurn); effect.setText("it gets +2/+2"); Ability abitity = new AttacksAloneTriggeredAbility(effect); effect = new GainAbilitySourceEffect(LifelinkAbility.getInstance()); effect.setText("and lifelink until end of turn"); abitity.addEffect(effect); this.addAbility(abitity); // When Qui-Gon Jinn leaves the battlefield, you may exile target card from a graveyard. abitity = new LeavesBattlefieldTriggeredAbility(new ExileTargetEffect(), true); abitity.addTarget(new TargetCardInGraveyard()); this.addAbility(abitity); // Meditate {1}{W} this.addAbility(new MeditateAbility(new ManaCostsImpl("{1}{W}"))); }