@Override public CanBlockAdditionalCreatureTargetEffect copy() { return new CanBlockAdditionalCreatureTargetEffect(this); }
public CanBlockAdditionalCreatureTargetEffect(Duration duration, int amount) { super(duration, Outcome.Benefit); this.amount = amount; staticText = setText(); }
@Override public boolean apply(Layer layer, SubLayer sublayer, Ability source, Game game) { Permanent target = game.getPermanent(this.getTargetPointer().getFirst(game, source)); if (target == null) { return false; } // maxBlocks = 0 equals to "can block any number of creatures" if (amount > 0) { target.setMaxBlocks(target.getMaxBlocks() + amount); } else { target.setMaxBlocks(0); } return true; }
public BlazeOfGlory(UUID ownerId, CardSetInfo setInfo) { super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{W}"); // Cast Blaze of Glory only during combat before blockers are declared. this.addAbility(new CastOnlyDuringPhaseStepSourceAbility(TurnPhase.COMBAT, BeforeBlockersAreDeclaredCondition.instance)); // Target creature defending player controls can block any number of creatures this turn. It blocks each attacking creature this turn if able. this.getSpellAbility().addTarget(new TargetCreaturePermanent(filter)); this.getSpellAbility().addEffect(new CanBlockAdditionalCreatureTargetEffect(Duration.EndOfTurn, 0)); this.getSpellAbility().addEffect(new BlazeOfGloryRequirementEffect()); }
public ActOfHeroism(UUID ownerId, CardSetInfo setInfo) { super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{1}{W}"); // Untap target creature. Effect effect = new UntapTargetEffect(); effect.setText("Untap target creature"); this.getSpellAbility().addEffect(effect); // It gets +2/+2 until end of turn effect = new BoostTargetEffect(2, 2, Duration.EndOfTurn); effect.setText("It gets +2/+2 until end of turn"); this.getSpellAbility().addEffect(effect); // and can block an additional creature this turn effect = new CanBlockAdditionalCreatureTargetEffect(); effect.setText("and can block an additional creature this turn."); this.getSpellAbility().addEffect(effect); this.getSpellAbility().addTarget(new TargetCreaturePermanent()); }