@Override public BlocksIfAbleTargetEffect copy() { return new BlocksIfAbleTargetEffect(this); }
@Override public boolean applies(Permanent permanent, Ability source, Game game) { return getTargetPointer().getTargets(game, source).contains(permanent.getId()); }
public Rathtar(UUID ownerId, CardSetInfo setInfo) { super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{2}{R}{G}"); this.subtype.add(SubType.BEAST); this.power = new MageInt(4); this.toughness = new MageInt(4); // {5}{G}{G}: Monstrosity 2. this.addAbility(new MonstrosityAbility("{5}{G}{G}", 2)); // When Rathtar becomes monstrous, any number of target creatures must block it this turn if able. Ability ability = new BecomesMonstrousSourceTriggeredAbility( new BlocksIfAbleTargetEffect(Duration.EndOfTurn).setText("any number of target creatures must block it this turn if able")); ability.addTarget(new TargetCreaturePermanent(0, Integer.MAX_VALUE)); this.addAbility(ability); }
public CullingMark(UUID ownerId, CardSetInfo setInfo) { super(ownerId,setInfo,new CardType[]{CardType.SORCERY},"{2}{G}"); // Target creature blocks this turn if able. this.getSpellAbility().addEffect(new BlocksIfAbleTargetEffect(Duration.EndOfTurn)); this.getSpellAbility().addTarget(new TargetCreaturePermanent()); }
public Resistance(UUID ownerId, CardSetInfo setInfo) { super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{R}{W}"); // Whenever a creature enters the battlefield under your control, Resistance deals 1 damage to each opponent. this.addAbility(new EntersBattlefieldControlledTriggeredAbility(Zone.BATTLEFIELD, new DamagePlayersEffect(1, TargetController.OPPONENT), StaticFilters.FILTER_PERMANENT_CREATURE, false)); // {R}{W}: Target creature gains haste until end of turn and must attack or block this turn if able. Ability ability = new SimpleActivatedAbility( new GainAbilityTargetEffect(HasteAbility.getInstance(), Duration.EndOfTurn) .setText("Target creature gains haste until end of turn"), new ManaCostsImpl("{R}{W}")); ability.addEffect(new AttacksIfAbleTargetEffect(Duration.EndOfTurn).setText("and must attack")); //ability.addEffect(new GainAbilityTargetEffect(AttacksThisTurnMarkerAbility.getInstance(), Duration.EndOfTurn, "").setText("")); ability.addEffect(new BlocksIfAbleTargetEffect(Duration.EndOfTurn).setText("or block this turn if able")); //ability.addEffect(new GainAbilityTargetEffect(BlocksThisTurnMarkerAbility.getInstance(), Duration.EndOfTurn, "").setText("")); ability.addTarget(new TargetCreaturePermanent()); this.addAbility(ability); }
public PeemaAetherSeer(UUID ownerId, CardSetInfo setInfo) { super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{3}{G}"); this.subtype.add(SubType.ELF); this.subtype.add(SubType.DRUID); this.power = new MageInt(3); this.toughness = new MageInt(2); // When Peema Aether-Seer enters the battlefield, you get an amount of {E} equal to the greatest power among creatures you control. Effect effect = new GetEnergyCountersControllerEffect(GreatestPowerAmongControlledCreaturesValue.instance); effect.setText("you get an amount of {E} equal to the greatest power among creatures you control"); this.addAbility(new EntersBattlefieldTriggeredAbility(effect)); // Pay {E}{E}{E}: Target creature blocks this turn if able. Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new BlocksIfAbleTargetEffect(Duration.EndOfTurn), new PayEnergyCost(3)); ability.addTarget(new TargetCreaturePermanent()); this.addAbility(ability); }
public AsajjVentress(UUID ownerId, CardSetInfo setInfo) { super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{1}{U}{B}{R}"); this.addSuperType(SuperType.LEGENDARY); this.subtype.add(SubType.DATHOMIRIAN); this.subtype.add(SubType.SITH); this.power = new MageInt(3); this.toughness = new MageInt(2); // Double Strike this.addAbility(DoubleStrikeAbility.getInstance()); // When Asajj Ventress becomes blocked, she gets +1/+1 for each creature blocking her until end of turn. BlockedCreatureCount value = new BlockedCreatureCount(); Effect effect = new BoostSourceEffect(value, value, Duration.EndOfTurn, true); effect.setText("she gets +1/+1 for each creature blocking her until end of turn"); this.addAbility(new BecomesBlockedTriggeredAbility(effect, false)); // <i>Hate</i> — Whenever Asajj Ventress attacks, if an opponent lost life from a source other than combat damage this turn, target creature blocks this turn if able. Ability ability = new ConditionalInterveningIfTriggeredAbility( new AttacksTriggeredAbility(new BlocksIfAbleTargetEffect(Duration.EndOfTurn), false), HateCondition.instance, "<i>Hate</i> — Whenever Asajj Ventress attacks, if an opponent lost life from a source other than combat damage this turn, target creature blocks this turn if able"); ability.addTarget(new TargetCreaturePermanent()); this.addAbility(ability, new LifeLossOtherFromCombatWatcher()); }
public Provoke(UUID ownerId, CardSetInfo setInfo) { super(ownerId,setInfo,new CardType[]{CardType.INSTANT},"{1}{G}"); // Untap target creature you don't control. That creature blocks this turn if able. this.getSpellAbility().addEffect(new UntapTargetEffect()); Effect effect = new BlocksIfAbleTargetEffect(Duration.EndOfTurn); effect.setText("That creature blocks this turn if able"); this.getSpellAbility().addEffect(effect); this.getSpellAbility().addTarget(new TargetCreaturePermanent(filter)); // Draw a card. this.getSpellAbility().addEffect(new DrawCardSourceControllerEffect(1)); }
public CourtlyProvocateur(UUID ownerId, CardSetInfo setInfo) { super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{2}{U}"); this.subtype.add(SubType.HUMAN); this.subtype.add(SubType.WIZARD); this.power = new MageInt(1); this.toughness = new MageInt(1); // {tap}: Target creature attacks this turn if able. Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new AttacksIfAbleTargetEffect(Duration.EndOfTurn), new TapSourceCost()); ability.addEffect(new GainAbilityTargetEffect(AttacksThisTurnMarkerAbility.getInstance(), Duration.EndOfTurn, null)); ability.addTarget(new TargetCreaturePermanent()); this.addAbility(ability); // {tap}: Target creature blocks this turn if able. Ability ability2 = new SimpleActivatedAbility(Zone.BATTLEFIELD, new BlocksIfAbleTargetEffect(Duration.EndOfTurn), new TapSourceCost()); ability2.addEffect(new GainAbilityTargetEffect(BlocksThisTurnMarkerAbility.getInstance(), Duration.EndOfTurn, null)); ability2.addTarget(new TargetCreaturePermanent()); this.addAbility(ability2); }
public NacatlHuntPride(UUID ownerId, CardSetInfo setInfo) { super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{5}{W}"); this.subtype.add(SubType.CAT); this.subtype.add(SubType.WARRIOR); this.power = new MageInt(5); this.toughness = new MageInt(4); // Vigilance this.addAbility(VigilanceAbility.getInstance()); // {R}, {tap}: Target creature can't block this turn. Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new CantBlockTargetEffect(Duration.EndOfTurn), new ManaCostsImpl("{R}")); ability.addCost(new TapSourceCost()); ability.addTarget(new TargetCreaturePermanent()); this.addAbility(ability); // {G}, {tap}: Target creature blocks this turn if able. Ability ability2 = new SimpleActivatedAbility(Zone.BATTLEFIELD, new BlocksIfAbleTargetEffect(Duration.EndOfTurn), new ManaCostsImpl("{G}")); ability2.addCost(new TapSourceCost()); ability2.addTarget(new TargetCreaturePermanent()); this.addAbility(ability2); }
@Override public boolean apply(Game game, Ability source) { Permanent target = game.getPermanent(source.getFirstTarget()); if (target == null) { return false; } FilterCreaturePermanent filter = new FilterCreaturePermanent(); filter.add(new ControllerIdPredicate(target.getControllerId())); filter.add(Predicates.not(new CardIdPredicate(target.getId()))); ContinuousEffect effect = new BlocksIfAbleTargetEffect(Duration.EndOfTurn); effect.setTargetPointer(new FixedTarget(target.getId())); game.addEffect(effect, source); target.untap(game); ContinuousEffect effect2 = new CantBlockAllEffect(filter, Duration.EndOfTurn); game.addEffect(effect2, source); return true; }
@Override public boolean apply(Game game, Ability source) { Player targetPlayer = game.getPlayer(getTargetPointer().getFirst(game, source)); if (targetPlayer != null) { ContinuousEffect effect = new GainControlTargetEffect(Duration.EndOfTurn, targetPlayer.getId()); effect.setTargetPointer(new SecondTargetPointer()); effect.setText("Target player gains control of up to three target nonattacking creatures until end of turn"); game.addEffect(effect, source); Effect effect2 = new UntapTargetEffect(); effect2.setTargetPointer(new SecondTargetPointer()); effect2.setText("Untap those creatures"); effect2.apply(game, source); RequirementEffect effect3 = new BlocksIfAbleTargetEffect(Duration.EndOfTurn); effect3.setTargetPointer(new SecondTargetPointer()); effect3.setText("They block this turn if able"); game.addEffect(effect3, source); return true; } return false; } }
if (game.getOpponents(creature1.getControllerId()).contains(game.getActivePlayerId())) { ContinuousEffectImpl effect = new BlocksIfAbleTargetEffect(Duration.EndOfTurn); effect.setTargetPointer(new FixedTarget(creature1.getId())); game.addEffect(effect, source);