@Override public boolean checkTrigger(GameEvent event, Game game) { if (event.getPlayerId().equals(this.controllerId)) { if (game.getBattlefield().count(filter, this.getSourceId(), this.getControllerId(), game) == 0) { return true; } } return false; }
@Override public int calculate(Game game, Ability sourceAbility, Effect effect) { int value = game.getBattlefield().count(filter, sourceAbility.getSourceId(), sourceAbility.getControllerId(), game); if (multiplier != null) { value *= multiplier; } return value; }
@Override public int calculate(Game game, Ability sourceAbility, Effect effect) { int value = game.getBattlefield().count(filter, sourceAbility.getSourceId(), sourceAbility.getControllerId(), game); if (value > 0) { value--; } return value; }
@Override public boolean applies(Permanent permanent, Ability source, Game game) { return permanent.getId().equals(source.getSourceId()) && game.getBattlefield().count(filter, source.getSourceId(), source.getControllerId(), game) < 5; } }
@Override public boolean applies(Permanent permanent, Ability source, Game game) { return permanent.getId().equals(source.getSourceId()) && game.getBattlefield().count(filter, source.getSourceId(), source.getControllerId(), game) == 0; } }
@Override public boolean applies(Permanent permanent, Ability source, Game game) { if (permanent.getId().equals(source.getSourceId())) { if (game.getBattlefield().count(filter, source.getSourceId(), source.getControllerId(), game) < 1) { return true; } } return false; } }
@Override public boolean apply(Game game, Ability source) { return game.getBattlefield().count(new FilterLandPermanent(), source.getSourceId(), source.getControllerId(), game) >= 7; } }
@Override public boolean apply(Game game, Ability source, Ability abilityToModify) { int reductionAmount = game.getBattlefield().count(filter, source.getSourceId(), source.getControllerId(), game); CardUtil.reduceCost(abilityToModify, reductionAmount); return true; }
@Override public boolean checkTrigger(GameEvent event, Game game) { return game.getBattlefield().count(new FilterCreaturePermanent(), this.getSourceId(), this.getControllerId(), game) == 0; }
@Override public boolean applies(GameEvent event, Ability source, Game game) { Permanent permanent = game.getPermanent(event.getTargetId()); if (permanent != null && permanent.getName().equals("Brothers Yamazaki")) { return game.getBattlefield().count(filter, source.getSourceId(), source.getControllerId(), game) == 2; } return false; }
@Override public boolean apply(Game game, Ability source) { Player player = game.getPlayer(source.getControllerId()); if (player != null) { int lifeToGain = game.getBattlefield().count(StaticFilters.FILTER_PERMANENT_CREATURE, source.getSourceId(), source.getControllerId(), game); lifeToGain += game.getBattlefield().count(new FilterArtifactPermanent(), source.getSourceId(), source.getControllerId(), game); player.gainLife(lifeToGain, game, source); } return true; }
@Override public boolean apply(Game game, Ability source) { Player player = game.getPlayer(source.getControllerId()); if (player != null) { int life = game.getBattlefield().count(filter, source.getSourceId(), source.getControllerId(), game) * 3; player.gainLife(life, game, source); } return true; }
@Override public boolean apply(Game game, Ability source) { int amount = game.getBattlefield().count(filter, source.getSourceId(), source.getControllerId(), game); Player player = game.getPlayer(source.getControllerId()); if (player != null) { player.gainLife(amount, game, source); return true; } return false; }
@Override public boolean apply(Game game, Ability source) { Player player = game.getPlayer(source.getControllerId()); if (player != null) { int life = 2 * game.getBattlefield().count(filter, source.getSourceId(), source.getControllerId(), game); player.gainLife(life, game, source); } return true; }
@Override public int calculate(Game game, Ability sourceAbility, Effect effect) { int value = 0; Permanent permanent = game.getPermanent(sourceAbility.getSourceId()); if (permanent != null && !permanent.getImprinted().isEmpty()) { FilterPermanent filterPermanent = new FilterPermanent(); filterPermanent.add(new NamePredicate(game.getCard(permanent.getImprinted().get(0)).getName())); value = game.getBattlefield().count(filterPermanent, sourceAbility.getSourceId(), sourceAbility.getControllerId(), game); } return value; }
@Override public boolean apply(Game game, Ability source) { Player controller = game.getPlayer(source.getControllerId()); if (controller != null) { if (game.getBattlefield().count(filter, source.getSourceId(), source.getControllerId(), game) >= 3) { return new TransformSourceEffect(true).apply(game, source); } } return false; } }
@Override public int calculate(Game game, Ability sourceAbility, Effect effect) { if (sourceAbility.getFirstTarget() == null) { return 0; } FilterArtifactPermanent filter = new FilterArtifactPermanent(); filter.add(TappedPredicate.instance); filter.add(new ControllerIdPredicate(sourceAbility.getFirstTarget())); return game.getBattlefield().count(filter, sourceAbility.getSourceId(), sourceAbility.getControllerId(), game); }
@Override public boolean apply(Game game, Ability source) { Player controller = game.getPlayer(source.getControllerId()); if (controller != null) { if (game.getBattlefield().count(filterLands, source.getSourceId(), source.getControllerId(), game) >= 10) { new FlipSourceEffect(new DokaiWeaverofLife()).apply(game, source); } return true; } return false; }
@Override public boolean apply(Game game, Ability source) { Player player = game.getPlayer(source.getControllerId()); if (player != null) { FilterCreaturePermanent filter = new FilterCreaturePermanent("green creatures"); filter.add(new ColorPredicate(ObjectColor.GREEN)); int greenCreatures = game.getBattlefield().count(filter, source.getSourceId(), source.getControllerId(), game); player.gainLife(greenCreatures+1, game, source); } return true; }
@Override public boolean applies(GameEvent event, Ability source, Game game) { if (source.isControlledBy(event.getPlayerId())) { Player controller = game.getPlayer(source.getControllerId()); if (controller != null && (controller.getLife() - event.getAmount()) < 1 && game.getBattlefield().count(new FilterControlledCreaturePermanent(), source.getSourceId(), event.getPlayerId(), game) > 0 ) { event.setAmount(controller.getLife() - 1); } } return false; }