[SNC] fixed Ballroom Brawlers targeting restriction (fixes #8906)

This commit is contained in:
Evan Kranzler 2022-05-11 19:09:27 -04:00
parent 56cc0e25ef
commit 6aa793d53d
4 changed files with 12 additions and 18 deletions

View file

@ -13,6 +13,7 @@ import mage.constants.CardType;
import mage.constants.Duration; import mage.constants.Duration;
import mage.constants.Outcome; import mage.constants.Outcome;
import mage.constants.SubType; import mage.constants.SubType;
import mage.filter.StaticFilters;
import mage.game.Game; import mage.game.Game;
import mage.game.permanent.Permanent; import mage.game.permanent.Permanent;
import mage.players.Player; import mage.players.Player;
@ -24,8 +25,6 @@ import java.util.List;
import java.util.Objects; import java.util.Objects;
import java.util.UUID; import java.util.UUID;
import static mage.filter.predicate.permanent.ControllerControlsIslandPredicate.filter;
/** /**
* @author TheElk801 * @author TheElk801
*/ */
@ -41,7 +40,7 @@ public final class BallroomBrawlers extends CardImpl {
// Whenever Ballroom Brawlers attacks, Ballroom Brawlers and up to one other target creature you control each gain your choice of first strike or lifelink until end of turn. // Whenever Ballroom Brawlers attacks, Ballroom Brawlers and up to one other target creature you control each gain your choice of first strike or lifelink until end of turn.
Ability ability = new AttacksTriggeredAbility(new BallroomBrawlersEffect()); Ability ability = new AttacksTriggeredAbility(new BallroomBrawlersEffect());
ability.addTarget(new TargetPermanent(0, 1, filter)); ability.addTarget(new TargetPermanent(0, 1, StaticFilters.FILTER_CONTROLLED_ANOTHER_CREATURE));
this.addAbility(ability); this.addAbility(ability);
} }

View file

@ -30,7 +30,7 @@ public final class DwarvenSeaClan extends CardImpl {
private static final FilterAttackingOrBlockingCreature filter = new FilterAttackingOrBlockingCreature(); private static final FilterAttackingOrBlockingCreature filter = new FilterAttackingOrBlockingCreature();
static { static {
filter.add(new ControllerControlsIslandPredicate()); filter.add(ControllerControlsIslandPredicate.instance);
} }
public DwarvenSeaClan(UUID ownerId, CardSetInfo setInfo) { public DwarvenSeaClan(UUID ownerId, CardSetInfo setInfo) {

View file

@ -1,6 +1,5 @@
package mage.cards.s; package mage.cards.s;
import java.util.UUID;
import mage.abilities.Ability; import mage.abilities.Ability;
import mage.abilities.TriggeredAbilityImpl; import mage.abilities.TriggeredAbilityImpl;
import mage.abilities.costs.mana.GenericManaCost; import mage.abilities.costs.mana.GenericManaCost;
@ -10,23 +9,19 @@ import mage.abilities.effects.common.continuous.BoostTargetEffect;
import mage.abilities.keyword.EquipAbility; import mage.abilities.keyword.EquipAbility;
import mage.cards.CardImpl; import mage.cards.CardImpl;
import mage.cards.CardSetInfo; import mage.cards.CardSetInfo;
import mage.constants.CardType; import mage.constants.*;
import mage.constants.SubType;
import mage.constants.Duration;
import mage.constants.Outcome;
import mage.constants.Zone;
import mage.filter.FilterPermanent; import mage.filter.FilterPermanent;
import mage.filter.common.FilterControlledCreaturePermanent; import mage.filter.common.FilterControlledCreaturePermanent;
import mage.filter.predicate.Predicates; import mage.filter.predicate.Predicates;
import mage.filter.predicate.mageobject.CardIdPredicate; import mage.filter.predicate.mageobject.CardIdPredicate;
import static mage.filter.predicate.permanent.ControllerControlsIslandPredicate.filter;
import mage.game.Game; import mage.game.Game;
import mage.game.events.GameEvent; import mage.game.events.GameEvent;
import mage.game.permanent.Permanent; import mage.game.permanent.Permanent;
import mage.target.targetpointer.FixedTarget; import mage.target.targetpointer.FixedTarget;
import java.util.UUID;
/** /**
*
* @author LevelX2 * @author LevelX2
*/ */
public final class SigilOfValor extends CardImpl { public final class SigilOfValor extends CardImpl {
@ -127,6 +122,6 @@ class SigilOfValorCount implements DynamicValue {
@Override @Override
public String getMessage() { public String getMessage() {
return filter.getMessage(); return "";
} }
} }

View file

@ -1,4 +1,3 @@
package mage.filter.predicate.permanent; package mage.filter.predicate.permanent;
import mage.constants.SubType; import mage.constants.SubType;
@ -8,20 +7,21 @@ import mage.game.Game;
import mage.game.permanent.Permanent; import mage.game.permanent.Permanent;
/** /**
*
* @author KholdFuzion * @author KholdFuzion
*/ */
public class ControllerControlsIslandPredicate implements Predicate<Permanent> { public enum ControllerControlsIslandPredicate implements Predicate<Permanent> {
instance;
private static final FilterLandPermanent filter = new FilterLandPermanent("Island");
public static final FilterLandPermanent filter = new FilterLandPermanent("Island");
static { static {
filter.add(SubType.ISLAND.getPredicate()); filter.add(SubType.ISLAND.getPredicate());
} }
@Override @Override
public boolean apply(Permanent input, Game game) { public boolean apply(Permanent input, Game game) {
return (game.getBattlefield().countAll(filter, input.getControllerId(), game) > 0); return game.getBattlefield().countAll(filter, input.getControllerId(), game) > 0;
} }
@Override @Override