Merge pull request #3758 from ingmargoudt/master

clean ups, talk to interface rather than implementation
This commit is contained in:
ingmargoudt 2017-07-29 23:56:03 +02:00 committed by GitHub
commit de33d1ce75
90 changed files with 509 additions and 457 deletions

View file

@ -27,8 +27,6 @@
*/
package mage.cards.a;
import java.util.ArrayList;
import java.util.UUID;
import mage.abilities.Ability;
import mage.abilities.effects.OneShotEffect;
import mage.cards.*;
@ -44,6 +42,10 @@ import mage.players.Player;
import mage.players.PlayerList;
import mage.target.TargetCard;
import java.util.ArrayList;
import java.util.List;
import java.util.UUID;
/**
*
* @author LevelX2
@ -102,8 +104,8 @@ class AetherspoutsEffect extends OneShotEffect {
Player player = game.getPlayer(game.getActivePlayerId());
Player activePlayer = player;
do {
ArrayList<Permanent> permanentsToTop = new ArrayList<>();
ArrayList<Permanent> permanentsToBottom = new ArrayList<>();
List<Permanent> permanentsToTop = new ArrayList<>();
List<Permanent> permanentsToBottom = new ArrayList<>();
for (Permanent permanent:game.getState().getBattlefield().getActivePermanents(new FilterAttackingCreature(), player.getId(), source.getSourceId(), game)) {
if (permanent.getOwnerId().equals(player.getId())) {
if (player.chooseUse(outcome, "Put " + permanent.getLogName() + " to the top? (else it goes to bottom)", source, game)) {
@ -117,7 +119,7 @@ class AetherspoutsEffect extends OneShotEffect {
}
// cards to top
Cards cards = new CardsImpl();
ArrayList<Permanent> toLibrary = new ArrayList<>();
List<Permanent> toLibrary = new ArrayList<>();
for (Permanent permanent: permanentsToTop) {
if (permanent instanceof PermanentToken) {
toLibrary.add(permanent);

View file

@ -27,8 +27,6 @@
*/
package mage.cards.a;
import java.util.ArrayList;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.common.AsEntersBattlefieldAbility;
@ -48,6 +46,10 @@ import mage.game.permanent.Permanent;
import mage.players.Player;
import mage.target.common.TargetCardInHand;
import java.util.ArrayList;
import java.util.List;
import java.util.UUID;
/**
*
* @author jeffwadsworth
@ -110,7 +112,7 @@ class ArsenalThresherEffect extends OneShotEffect {
}
if (arsenalThresher != null) {
controller.revealCards(arsenalThresher.getIdName(), cards, game);
ArrayList<UUID> appliedEffects = (ArrayList<UUID>) this.getValue("appliedEffects"); // the basic event is the EntersBattlefieldEvent, so use already applied replacement effects from that event
List<UUID> appliedEffects = (ArrayList<UUID>) this.getValue("appliedEffects"); // the basic event is the EntersBattlefieldEvent, so use already applied replacement effects from that event
arsenalThresher.addCounters(CounterType.P1P1.createInstance(cards.size()), source, game, appliedEffects);
}
}

View file

@ -27,8 +27,6 @@
*/
package mage.cards.b;
import java.util.HashMap;
import java.util.UUID;
import mage.abilities.Ability;
import mage.abilities.effects.OneShotEffect;
import mage.cards.*;
@ -43,6 +41,10 @@ import mage.players.Player;
import mage.target.common.TargetCardInHand;
import mage.target.common.TargetControlledPermanent;
import java.util.HashMap;
import java.util.Map;
import java.util.UUID;
/**
*
* @author emerald000
@ -156,7 +158,7 @@ class BalanceEffect extends OneShotEffect {
//Cards in hand
int minCard = Integer.MAX_VALUE;
HashMap<UUID, Cards> cardsToDiscard = new HashMap<>(2);
Map<UUID, Cards> cardsToDiscard = new HashMap<>(2);
for (UUID playerId : game.getState().getPlayersInRange(controller.getId(), game)) {
Player player = game.getPlayer(playerId);
if (player != null) {

View file

@ -27,8 +27,6 @@
*/
package mage.cards.b;
import java.util.ArrayList;
import java.util.UUID;
import mage.abilities.Ability;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.DamageTargetEffect;
@ -41,6 +39,10 @@ import mage.game.permanent.Permanent;
import mage.players.Player;
import mage.target.common.TargetCreaturePermanent;
import java.util.ArrayList;
import java.util.List;
import java.util.UUID;
/**
*
* @author Quercitron
@ -89,7 +91,7 @@ class DestroyAllAttachedEquipmentEffect extends OneShotEffect {
if (controller != null) {
Permanent target = game.getPermanent(source.getFirstTarget());
if (target != null) {
ArrayList<UUID> attachments = new ArrayList<>(target.getAttachments());
List<UUID> attachments = new ArrayList<>(target.getAttachments());
for (UUID attachmentId : attachments) {
Permanent attachment = game.getPermanent(attachmentId);
if (attachment != null && attachment.getSubtype(game).contains("Equipment")) {

View file

@ -44,6 +44,7 @@ import mage.target.common.TargetCardInLibrary;
import mage.target.common.TargetDiscard;
import java.util.HashMap;
import java.util.Map;
import java.util.UUID;
/**
@ -95,9 +96,9 @@ class BorderlandExplorerEffect extends OneShotEffect {
public boolean apply(Game game, Ability source) {
Player controller = game.getPlayer(source.getControllerId());
// Store for each player the cards to discard, that's important because all discard shall happen at the same time
HashMap<UUID, Cards> cardsToDiscard = new HashMap<>();
Map<UUID, Cards> cardsToDiscard = new HashMap<>();
// Store for each player the lands to reveal, that's important because all reveals shall happen at the same time
HashMap<UUID, Cards> cardsToReveal = new HashMap<>();
Map<UUID, Cards> cardsToReveal = new HashMap<>();
if (controller != null) {
// choose cards to discard
for (UUID playerId : game.getState().getPlayersInRange(controller.getId(), game)) {

View file

@ -27,8 +27,6 @@
*/
package mage.cards.c;
import java.util.ArrayList;
import java.util.UUID;
import mage.MageObject;
import mage.abilities.Ability;
import mage.abilities.common.OnEventTriggeredAbility;
@ -53,6 +51,10 @@ import mage.target.TargetCard;
import mage.target.TargetPermanent;
import mage.target.common.TargetCreaturePermanent;
import java.util.ArrayList;
import java.util.List;
import java.util.UUID;
/**
*
* @author North
@ -122,7 +124,7 @@ class CallToTheKindredEffect extends OneShotEffect {
if (!creature.getAbilities().contains(ChangelingAbility.getInstance())) {
StringBuilder sb = new StringBuilder("creature card with at least one subtype from: ");
ArrayList<Predicate<MageObject>> subtypes = new ArrayList<>();
List<Predicate<MageObject>> subtypes = new ArrayList<>();
for (SubType subtype : creature.getSubtype(game)) {
subtypes.add(new SubtypePredicate(subtype));
sb.append(subtype).append(", ");

View file

@ -27,8 +27,6 @@
*/
package mage.cards.c;
import java.util.ArrayList;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.common.BeginningOfUpkeepTriggeredAbility;
@ -45,6 +43,10 @@ import mage.game.permanent.Permanent;
import mage.target.TargetPermanent;
import mage.util.RandomUtil;
import java.util.ArrayList;
import java.util.List;
import java.util.UUID;
/**
*
* @author North
@ -101,7 +103,7 @@ class CapriciousEfreetEffect extends OneShotEffect {
@Override
public boolean apply(Game game, Ability source) {
ArrayList<Permanent> targetPermanents = new ArrayList<>();
List<Permanent> targetPermanents = new ArrayList<>();
Permanent permanent = game.getPermanent(source.getTargets().get(0).getFirstTarget());
if (permanent != null) {
targetPermanents.add(permanent);

View file

@ -27,8 +27,6 @@
*/
package mage.cards.c;
import java.util.LinkedHashSet;
import java.util.UUID;
import mage.Mana;
import mage.abilities.Ability;
import mage.abilities.TriggeredAbilityImpl;
@ -50,6 +48,10 @@ import mage.game.events.GameEvent.EventType;
import mage.players.Player;
import mage.target.common.TargetOpponent;
import java.util.LinkedHashSet;
import java.util.Set;
import java.util.UUID;
/**
*
* @author Plopman
@ -163,7 +165,7 @@ class CarpetOfFlowersEffect extends ManaEffect {
}
int countMax = game.getBattlefield().count(filter, source.getSourceId(), source.getTargets().getFirstTarget(), game);
ChoiceImpl choiceCount = new ChoiceImpl(true);
LinkedHashSet<String> set = new LinkedHashSet<>(countMax + 1);
Set<String> set = new LinkedHashSet<>(countMax + 1);
for (int i = 0; i <= countMax; i++) {
set.add(Integer.toString(i));
}

View file

@ -27,8 +27,6 @@
*/
package mage.cards.c;
import java.util.ArrayList;
import java.util.UUID;
import mage.MageObject;
import mage.abilities.Ability;
import mage.abilities.effects.OneShotEffect;
@ -47,6 +45,10 @@ import mage.players.Player;
import mage.target.TargetSpell;
import mage.target.common.TargetCardInHand;
import java.util.ArrayList;
import java.util.List;
import java.util.UUID;
/**
*
* @author BetaSteward
@ -96,7 +98,7 @@ class CounterlashEffect extends OneShotEffect {
game.getStack().counter(source.getFirstTarget(), source.getSourceId(), game);
if (player.chooseUse(Outcome.PutCardInPlay, "Cast a nonland card in your hand that shares a card type with that spell without paying its mana cost?", source, game)) {
FilterCard filter = new FilterCard();
ArrayList<Predicate<MageObject>> types = new ArrayList<>();
List<Predicate<MageObject>> types = new ArrayList<>();
for (CardType type: stackObject.getCardType()) {
if (type != CardType.LAND) {
types.add(new CardTypePredicate(type));

View file

@ -27,8 +27,6 @@
*/
package mage.cards.c;
import java.util.ArrayList;
import java.util.UUID;
import mage.abilities.Ability;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.DamagePlayersEffect;
@ -47,6 +45,10 @@ import mage.players.Player;
import mage.target.Target;
import mage.target.common.TargetControlledCreaturePermanent;
import java.util.ArrayList;
import java.util.List;
import java.util.UUID;
/**
*
* @author LevelX2
@ -92,7 +94,7 @@ class CracklingDoomEffect extends OneShotEffect {
public boolean apply(Game game, Ability source) {
Player controller = game.getPlayer(source.getControllerId());
if (controller != null) {
ArrayList<Permanent> toSacrifice = new ArrayList<>();
List<Permanent> toSacrifice = new ArrayList<>();
for (UUID playerId : game.getState().getPlayersInRange(controller.getId(), game)) {
if (controller.hasOpponent(playerId, game)) {
Player opponent = game.getPlayer(playerId);

View file

@ -1,7 +1,5 @@
package mage.cards.c;
import java.util.ArrayList;
import java.util.UUID;
import mage.Mana;
import mage.abilities.common.EntersBattlefieldTriggeredAbility;
import mage.abilities.costs.common.TapSourceCost;
@ -14,6 +12,10 @@ import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.Zone;
import java.util.ArrayList;
import java.util.List;
import java.util.UUID;
public class CryptOfTheEternals extends CardImpl {
public CryptOfTheEternals(UUID ownerId, CardSetInfo setInfo) {
@ -26,7 +28,7 @@ public class CryptOfTheEternals extends CardImpl {
this.addAbility(new ColorlessManaAbility());
// {1}, {T}: Add {U}, {B}, or {R} to your mana pool.
ArrayList<Mana> list = new ArrayList<Mana>() {{
List<Mana> list = new ArrayList<Mana>() {{
add(Mana.BlueMana(1));
add(Mana.BlackMana(1));
add(Mana.RedMana(1));

View file

@ -27,9 +27,6 @@
*/
package mage.cards.c;
import java.util.ArrayList;
import java.util.List;
import java.util.UUID;
import mage.abilities.Ability;
import mage.abilities.common.SimpleActivatedAbility;
import mage.abilities.costs.Cost;
@ -55,6 +52,10 @@ import mage.game.permanent.Permanent;
import mage.players.Player;
import mage.target.common.TargetControlledPermanent;
import java.util.ArrayList;
import java.util.List;
import java.util.UUID;
/**
*
* @author spjspj
@ -199,7 +200,7 @@ class CrypticGatewayEffect extends OneShotEffect {
changeling2 = true;
}
ArrayList<SubtypePredicate> subtypes = new ArrayList<>();
List<SubtypePredicate> subtypes = new ArrayList<>();
for (SubType subtype : creature.getSubtype(game)) {
if (creature2.getSubtype(game).contains(subtype) || changeling2) {

View file

@ -27,8 +27,6 @@
*/
package mage.cards.c;
import java.util.HashMap;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.common.EntersBattlefieldTriggeredAbility;
@ -45,6 +43,10 @@ import mage.game.Game;
import mage.players.Player;
import mage.target.TargetCard;
import java.util.HashMap;
import java.util.Map;
import java.util.UUID;
/**
*
* @author LevelX2
@ -105,7 +107,7 @@ class CustodiSquireVoteEffect extends OneShotEffect {
Cards possibleCards = new CardsImpl();
possibleCards.addAll(controller.getGraveyard().getCards(filter, game));
if (!possibleCards.isEmpty()) {
HashMap<UUID, Integer> cardCounter = new HashMap<>();
Map<UUID, Integer> cardCounter = new HashMap<>();
TargetCard target = new TargetCard(1, 1, Zone.GRAVEYARD, filter);
int maxCount = 1;
for (UUID playerId : game.getState().getPlayersInRange(controller.getId(), game)) {

View file

@ -27,8 +27,6 @@
*/
package mage.cards.d;
import java.util.HashMap;
import java.util.UUID;
import mage.abilities.Ability;
import mage.abilities.effects.OneShotEffect;
import mage.cards.CardImpl;
@ -40,6 +38,10 @@ import mage.game.Game;
import mage.game.permanent.Permanent;
import mage.players.Player;
import java.util.HashMap;
import java.util.Map;
import java.util.UUID;
/**
*
* @author LevelX2
@ -83,15 +85,15 @@ class DeadlyTempestEffect extends OneShotEffect {
public boolean apply(Game game, Ability source) {
Player controller = game.getPlayer(source.getControllerId());
if (controller != null) {
HashMap<UUID, Integer> destroyedCreatures = new HashMap<>();
Map<UUID, Integer> destroyedCreatures = new HashMap<>();
for (Permanent permanent : game.getBattlefield().getActivePermanents(StaticFilters.FILTER_PERMANENT_CREATURE, source.getControllerId(), source.getSourceId(), game)) {
if (permanent.destroy(source.getSourceId(), game, false)) {
int count = destroyedCreatures.containsKey(permanent.getControllerId()) ? destroyedCreatures.get(permanent.getControllerId()) : 0;
int count = destroyedCreatures.getOrDefault(permanent.getControllerId(), 0);
destroyedCreatures.put(permanent.getControllerId(), count + 1);
}
}
for (UUID playerId : game.getState().getPlayerList(source.getControllerId())) {
int count = destroyedCreatures.containsKey(playerId) ? destroyedCreatures.get(playerId) : 0;
int count = destroyedCreatures.getOrDefault(playerId, 0);
if (count > 0) {
Player player = game.getPlayer(playerId);
if (player != null) {

View file

@ -27,8 +27,6 @@
*/
package mage.cards.d;
import java.util.HashMap;
import java.util.UUID;
import mage.abilities.Ability;
import mage.abilities.effects.OneShotEffect;
import mage.cards.CardImpl;
@ -42,6 +40,10 @@ import mage.players.Player;
import mage.target.Target;
import mage.target.common.TargetCreaturePermanent;
import java.util.HashMap;
import java.util.Map;
import java.util.UUID;
/**
* @author jeffwadsworth
*/
@ -86,7 +88,7 @@ class DescentOfTheDragonsEffect extends OneShotEffect {
public boolean apply(Game game, Ability source) {
Player controller = game.getPlayer(source.getControllerId());
if (controller != null) {
HashMap<UUID, Integer> playersWithTargets = new HashMap<>();
Map<UUID, Integer> playersWithTargets = new HashMap<>();
for (Target target : source.getTargets()) {
for (UUID permanentId : target.getTargets()) {
Permanent permanent = game.getPermanent(permanentId);

View file

@ -27,8 +27,6 @@
*/
package mage.cards.d;
import java.util.ArrayList;
import java.util.UUID;
import mage.MageObject;
import mage.abilities.ActivatedAbilityImpl;
import mage.abilities.costs.common.SacrificeSourceCost;
@ -46,6 +44,10 @@ import mage.filter.predicate.mageobject.SubtypePredicate;
import mage.filter.predicate.mageobject.SupertypePredicate;
import mage.target.common.TargetCardInLibrary;
import java.util.ArrayList;
import java.util.List;
import java.util.UUID;
/**
*
* @author Styxo
@ -84,7 +86,7 @@ public class DroidFactory extends CardImpl {
addCost(new SacrificeSourceCost());
FilterCard filter = new FilterCard("basic Plains, Island or Swamp");
filter.add(new CardTypePredicate(CardType.LAND));
ArrayList<Predicate<MageObject>> subtypePredicates = new ArrayList<>();
List<Predicate<MageObject>> subtypePredicates = new ArrayList<>();
subtypePredicates.add(new SubtypePredicate(SubType.SWAMP));
subtypePredicates.add(new SubtypePredicate(SubType.PLAINS));
subtypePredicates.add(new SubtypePredicate(SubType.ISLAND));

View file

@ -27,8 +27,6 @@
*/
package mage.cards.d;
import java.util.HashSet;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.common.SimpleActivatedAbility;
@ -52,6 +50,10 @@ import mage.players.Player;
import mage.target.common.TargetCreaturePermanent;
import mage.target.targetpointer.FixedTarget;
import java.util.HashSet;
import java.util.Set;
import java.util.UUID;
/**
*
* @author LoneFox
@ -84,7 +86,7 @@ public class DwarvenArmorer extends CardImpl {
class DwarvenArmorerEffect extends OneShotEffect {
private static final HashSet<String> choices = new HashSet<>();
private static final Set<String> choices = new HashSet<>();
static {
choices.add("+0/+1");

View file

@ -27,8 +27,6 @@
*/
package mage.cards.e;
import java.util.ArrayList;
import java.util.UUID;
import mage.MageInt;
import mage.MageObject;
import mage.ObjectColor;
@ -45,6 +43,10 @@ import mage.filter.predicate.mageobject.ColorPredicate;
import mage.game.Game;
import mage.game.permanent.Permanent;
import java.util.ArrayList;
import java.util.List;
import java.util.UUID;
/**
*
* @author LevelX2
@ -113,7 +115,7 @@ class EmptyShrineKannushiProtectionAbility extends ProtectionAbility {
}
}
ArrayList<Predicate<MageObject>> colorPredicates = new ArrayList<>();
List<Predicate<MageObject>> colorPredicates = new ArrayList<>();
if (color.isBlack()) {
colorPredicates.add(new ColorPredicate(ObjectColor.BLACK));
}

View file

@ -27,8 +27,6 @@
*/
package mage.cards.e;
import java.util.ArrayList;
import java.util.UUID;
import mage.abilities.Ability;
import mage.abilities.effects.OneShotEffect;
import mage.cards.CardImpl;
@ -39,6 +37,10 @@ import mage.game.Game;
import mage.game.permanent.Permanent;
import mage.players.Player;
import java.util.ArrayList;
import java.util.List;
import java.util.UUID;
/**
*
* @author LevelX2
@ -83,7 +85,7 @@ class EndHostilitiesEffect extends OneShotEffect {
public boolean apply(Game game, Ability source) {
Player controller = game.getPlayer(source.getControllerId());
if (controller != null) {
ArrayList<Permanent> toDestroy = new ArrayList<>();
List<Permanent> toDestroy = new ArrayList<>();
for (Permanent permanent : game.getBattlefield().getActivePermanents(controller.getId(), game)) {
if (permanent.isCreature()) {
toDestroy.add(permanent);

View file

@ -27,8 +27,6 @@
*/
package mage.cards.e;
import java.util.HashMap;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.TriggeredAbilityImpl;
import mage.abilities.effects.keyword.InvestigateEffect;
@ -43,6 +41,10 @@ import mage.game.events.GameEvent;
import mage.game.events.GameEvent.EventType;
import mage.watchers.Watcher;
import java.util.HashMap;
import java.util.Map;
import java.util.UUID;
/**
* @author LevelX2
*/
@ -106,7 +108,7 @@ class ErdwalIlluminatorTriggeredAbility extends TriggeredAbilityImpl {
class InvestigatedWatcher extends Watcher {
private final HashMap<UUID, Integer> timesInvestigated = new HashMap<>();
private final Map<UUID, Integer> timesInvestigated = new HashMap<>();
public InvestigatedWatcher() {
super(InvestigatedWatcher.class.getSimpleName(), WatcherScope.GAME);

View file

@ -27,9 +27,6 @@
*/
package mage.cards.e;
import java.util.HashMap;
import java.util.Objects;
import java.util.UUID;
import mage.abilities.Ability;
import mage.abilities.TriggeredAbilityImpl;
import mage.abilities.common.EntersBattlefieldTriggeredAbility;
@ -49,6 +46,11 @@ import mage.game.events.GameEvent.EventType;
import mage.game.permanent.Permanent;
import mage.target.targetpointer.FixedTarget;
import java.util.HashMap;
import java.util.Map;
import java.util.Objects;
import java.util.UUID;
/**
*
* @author spjspj
@ -101,8 +103,8 @@ class EyeOfSingularityETBEffect extends OneShotEffect {
@Override
public boolean apply(Game game, Ability source) {
HashMap<String, UUID> cardNames = new HashMap<>();
HashMap<UUID, Integer> toDestroy = new HashMap<>();
Map<String, UUID> cardNames = new HashMap<>();
Map<UUID, Integer> toDestroy = new HashMap<>();
for (Permanent permanent : game.getBattlefield().getActivePermanents(filter, source.getControllerId(), source.getSourceId(), game)) {
String cardName = permanent.getName();
@ -183,7 +185,7 @@ class EyeOfSingularityTriggeredEffect extends OneShotEffect {
@Override
public boolean apply(Game game, Ability source) {
HashMap<UUID, Integer> toDestroy = new HashMap<>();
Map<UUID, Integer> toDestroy = new HashMap<>();
Permanent etbPermanent = game.getPermanentOrLKIBattlefield(getTargetPointer().getFirst(game, source));
if (etbPermanent == null) {

View file

@ -27,8 +27,6 @@
*/
package mage.cards.f;
import java.util.ArrayList;
import java.util.UUID;
import mage.abilities.Ability;
import mage.abilities.effects.OneShotEffect;
import mage.cards.Card;
@ -43,6 +41,10 @@ import mage.game.events.GameEvent;
import mage.game.events.ZoneChangeEvent;
import mage.watchers.Watcher;
import java.util.ArrayList;
import java.util.List;
import java.util.UUID;
/**
*
* @author Loki
@ -101,7 +103,7 @@ class FaithsRewardEffect extends OneShotEffect {
}
class FaithsRewardWatcher extends Watcher {
ArrayList<UUID> cards = new ArrayList<>();
List<UUID> cards = new ArrayList<>();
public FaithsRewardWatcher() {
super(FaithsRewardWatcher.class.getSimpleName(), WatcherScope.GAME);

View file

@ -27,8 +27,6 @@
*/
package mage.cards.f;
import java.util.HashMap;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.common.SimpleStaticAbility;
@ -43,6 +41,10 @@ import mage.filter.predicate.mageobject.SubtypePredicate;
import mage.game.Game;
import mage.players.Player;
import java.util.HashMap;
import java.util.Map;
import java.util.UUID;
/**
*
* @author LevelX2
@ -90,7 +92,7 @@ class FalkenrathGorgerEffect extends ContinuousEffectImpl {
}
HashMap<UUID, MadnessAbility> madnessAbilities = new HashMap<>(); // reuse the same ability for the same object
Map<UUID, MadnessAbility> madnessAbilities = new HashMap<>(); // reuse the same ability for the same object
public FalkenrathGorgerEffect() {
super(Duration.WhileOnBattlefield, Layer.AbilityAddingRemovingEffects_6, SubLayer.NA, Outcome.AddAbility);
@ -111,7 +113,7 @@ class FalkenrathGorgerEffect extends ContinuousEffectImpl {
public boolean apply(Game game, Ability source) {
Player controller = game.getPlayer(source.getControllerId());
if (controller != null) {
HashMap<UUID, MadnessAbility> usedMadnessAbilities = new HashMap<>();
Map<UUID, MadnessAbility> usedMadnessAbilities = new HashMap<>();
// hand
for (Card card : controller.getHand().getCards(filter, game)) {
addMadnessToCard(game, card, usedMadnessAbilities);
@ -136,7 +138,7 @@ class FalkenrathGorgerEffect extends ContinuousEffectImpl {
return false;
}
private void addMadnessToCard(Game game, Card card, HashMap<UUID, MadnessAbility> usedMadnessAbilities) {
private void addMadnessToCard(Game game, Card card, Map<UUID, MadnessAbility> usedMadnessAbilities) {
MadnessAbility ability = madnessAbilities.get(card.getId());
if (ability == null) {
ability = new MadnessAbility(card, card.getSpellAbility().getManaCosts());

View file

@ -27,8 +27,6 @@
*/
package mage.cards.f;
import java.util.HashSet;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.common.BeginningOfUpkeepTriggeredAbility;
@ -44,6 +42,10 @@ import mage.game.events.GameEvent;
import mage.game.events.GameEvent.EventType;
import mage.players.Player;
import java.util.HashSet;
import java.util.Set;
import java.util.UUID;
/**
*
* @author LoneFox
@ -74,7 +76,7 @@ public class Fatespinner extends CardImpl {
class FatespinnerChooseEffect extends OneShotEffect {
private static final HashSet<String> choices = new HashSet<>();
private static final Set<String> choices = new HashSet<>();
static {
choices.add("Draw step");

View file

@ -27,8 +27,6 @@
*/
package mage.cards.f;
import java.util.HashSet;
import java.util.UUID;
import mage.abilities.Ability;
import mage.abilities.TriggeredAbilityImpl;
import mage.abilities.common.SimpleActivatedAbility;
@ -48,6 +46,10 @@ import mage.game.events.GameEvent.EventType;
import mage.game.permanent.Permanent;
import mage.target.common.TargetCreatureOrPlayer;
import java.util.HashSet;
import java.util.Set;
import java.util.UUID;
/**
*
* @author Plopman
@ -82,7 +84,7 @@ class FiveAlarmFireTriggeredAbility extends TriggeredAbilityImpl {
// Because a creature that is blocked by multiple creatures it deals damage to, only causes to add one counter to ,
// it's neccessary to remember which creature already triggered
HashSet<UUID> triggeringCreatures = new HashSet<>();
Set<UUID> triggeringCreatures = new HashSet<>();
private static final FilterControlledCreaturePermanent filter = new FilterControlledCreaturePermanent();

View file

@ -27,8 +27,6 @@
*/
package mage.cards.f;
import java.util.HashSet;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.common.SimpleActivatedAbility;
@ -52,6 +50,10 @@ import mage.counters.CounterType;
import mage.game.Game;
import mage.players.Player;
import java.util.HashSet;
import java.util.Set;
import java.util.UUID;
/**
*
* @author LoneFox
@ -82,7 +84,7 @@ public class FlowstoneSculpture extends CardImpl {
class FlowstoneSculptureEffect extends OneShotEffect {
private static final HashSet<String> choices = new HashSet<>();
private static final Set<String> choices = new HashSet<>();
static {
choices.add("+1/+1 counter");

View file

@ -27,8 +27,6 @@
*/
package mage.cards.f;
import java.util.ArrayList;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.common.BeginningOfUpkeepTriggeredAbility;
@ -51,6 +49,10 @@ import mage.players.Player;
import mage.target.Target;
import mage.target.common.TargetCreaturePermanent;
import java.util.ArrayList;
import java.util.List;
import java.util.UUID;
/**
*
* @author Blinke
@ -116,7 +118,7 @@ public class ForgottenAncient extends CardImpl {
}
int numCounters = sourcePermanent.getCounters(game).getCount(CounterType.P1P1);
ArrayList<CounterMovement> counterMovements = new ArrayList<>();
List<CounterMovement> counterMovements = new ArrayList<>();
do {
Target target = new TargetCreaturePermanent(1, 1, filter, true);

View file

@ -27,8 +27,6 @@
*/
package mage.cards.g;
import java.util.ArrayList;
import java.util.UUID;
import mage.abilities.Ability;
import mage.abilities.common.delayed.AtTheEndOfCombatDelayedTriggeredAbility;
import mage.abilities.effects.OneShotEffect;
@ -45,6 +43,10 @@ import mage.players.Player;
import mage.target.common.TargetCreaturePermanent;
import mage.watchers.common.BlockedAttackerWatcher;
import java.util.ArrayList;
import java.util.List;
import java.util.UUID;
/**
*
* @author LevelX2
@ -96,7 +98,7 @@ class GazeOfTheGorgonEffect extends OneShotEffect {
if (controller != null && targetCreature != null) {
BlockedAttackerWatcher watcher = (BlockedAttackerWatcher) game.getState().getWatchers().get(BlockedAttackerWatcher.class.getSimpleName());
if (watcher != null) {
ArrayList<Permanent> toDestroy = new ArrayList<>();
List<Permanent> toDestroy = new ArrayList<>();
for (Permanent creature : game.getBattlefield().getActivePermanents(StaticFilters.FILTER_PERMANENT_CREATURE, source.getControllerId(), source.getSourceId(), game)) {
if (!creature.getId().equals(targetCreature.getId())) {
if (watcher.creatureHasBlockedAttacker(creature, targetCreature, game) || watcher.creatureHasBlockedAttacker(targetCreature, creature, game)) {

View file

@ -27,7 +27,6 @@
*/
package mage.cards.g;
import java.util.*;
import mage.MageObjectReference;
import mage.abilities.Ability;
import mage.abilities.costs.mana.ManaCosts;
@ -47,6 +46,8 @@ import mage.game.Game;
import mage.players.Player;
import mage.target.TargetPlayer;
import java.util.*;
/**
*
* @author LevelX2
@ -92,7 +93,7 @@ class GhastlyConscriptionEffect extends OneShotEffect {
Player controller = game.getPlayer(source.getControllerId());
Player targetPlayer = game.getPlayer(getTargetPointer().getFirst(game, source));
if (controller != null && targetPlayer != null) {
ArrayList<Card> cardsToManifest = new ArrayList<>();
List<Card> cardsToManifest = new ArrayList<>();
for (Card card : targetPlayer.getGraveyard().getCards(new FilterCreatureCard(), game)) {
cardsToManifest.add(card);
controller.moveCardToExileWithInfo(card, null, "", source.getSourceId(), game, Zone.GRAVEYARD, true);

View file

@ -42,10 +42,7 @@ import mage.game.permanent.Permanent;
import mage.players.Player;
import mage.target.TargetCard;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.UUID;
import java.util.*;
/**
*
@ -94,7 +91,7 @@ class HarmonicConvergenceEffect extends OneShotEffect {
source.getSourceId(),
game);
HashMap<UUID, List<Permanent>> moveList = new HashMap<>();
Map<UUID, List<Permanent>> moveList = new HashMap<>();
for (Permanent permanent : enchantments) {
List<Permanent> list = moveList.computeIfAbsent(permanent.getControllerId(), k -> new ArrayList<>());
list.add(permanent);

View file

@ -27,8 +27,6 @@
*/
package mage.cards.h;
import java.util.ArrayList;
import java.util.UUID;
import mage.MageObject;
import mage.abilities.Ability;
import mage.abilities.common.EntersBattlefieldTriggeredAbility;
@ -38,17 +36,17 @@ import mage.abilities.effects.OneShotEffect;
import mage.cards.Card;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.AsThoughEffectType;
import mage.constants.CardType;
import mage.constants.Duration;
import mage.constants.Outcome;
import mage.constants.Zone;
import mage.constants.*;
import mage.game.ExileZone;
import mage.game.Game;
import mage.players.Player;
import mage.target.common.TargetOpponent;
import mage.util.CardUtil;
import java.util.ArrayList;
import java.util.List;
import java.util.UUID;
/**
*
* @author LevelX2
@ -100,7 +98,7 @@ class HedonistsTroveExileEffect extends OneShotEffect {
MageObject sourceObject = source.getSourceObject(game);
if (controller != null && targetPlayer != null && sourceObject != null) {
UUID exileId = CardUtil.getExileZoneId(game, source.getSourceId(), source.getSourceObjectZoneChangeCounter());
ArrayList<UUID> graveyard = new ArrayList<>(targetPlayer.getGraveyard());
List<UUID> graveyard = new ArrayList<>(targetPlayer.getGraveyard());
for (UUID cardId : graveyard) {
Card card = game.getCard(cardId);
if (card != null) {

View file

@ -27,19 +27,11 @@
*/
package mage.cards.i;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Set;
import java.util.UUID;
import mage.MageObject;
import mage.abilities.Ability;
import mage.abilities.SpellAbility;
import mage.abilities.effects.OneShotEffect;
import mage.cards.Card;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.cards.Cards;
import mage.cards.CardsImpl;
import mage.cards.*;
import mage.constants.CardType;
import mage.constants.Outcome;
import mage.constants.Zone;
@ -52,6 +44,8 @@ import mage.players.Library;
import mage.players.Player;
import mage.target.TargetPermanent;
import java.util.*;
/**
*
* @author LevelX2
@ -112,7 +106,7 @@ class IndomitableCreativityEffect extends OneShotEffect {
Player controller = game.getPlayer(source.getControllerId());
MageObject sourceObject = source.getSourceObject(game);
if (controller != null && sourceObject != null) {
ArrayList<Permanent> destroyedPermanents = new ArrayList<>();
List<Permanent> destroyedPermanents = new ArrayList<>();
for (UUID targetId : getTargetPointer().getTargets(game, source)) {
Permanent target = game.getPermanent(targetId);
if (target != null) {
@ -121,7 +115,7 @@ class IndomitableCreativityEffect extends OneShotEffect {
}
}
}
HashMap<Player, Cards> cardsToReveal = new HashMap<>();
Map<Player, Cards> cardsToReveal = new HashMap<>();
for (Permanent permanent : destroyedPermanents) {
Player controllerOfDestroyedCreature = game.getPlayer(permanent.getControllerId());

View file

@ -27,8 +27,6 @@
*/
package mage.cards.j;
import java.util.ArrayList;
import java.util.UUID;
import mage.MageObject;
import mage.abilities.ActivatedAbilityImpl;
import mage.abilities.costs.common.SacrificeSourceCost;
@ -46,6 +44,10 @@ import mage.filter.predicate.mageobject.SubtypePredicate;
import mage.filter.predicate.mageobject.SupertypePredicate;
import mage.target.common.TargetCardInLibrary;
import java.util.ArrayList;
import java.util.List;
import java.util.UUID;
/**
*
* @author Styxo
@ -84,7 +86,7 @@ public class JediEnclave extends CardImpl {
addCost(new SacrificeSourceCost());
FilterCard filter = new FilterCard("basic Forest, Plains or Island");
filter.add(new CardTypePredicate(CardType.LAND));
ArrayList<Predicate<MageObject>> subtypePredicates = new ArrayList<>();
List<Predicate<MageObject>> subtypePredicates = new ArrayList<>();
subtypePredicates.add(new SubtypePredicate(SubType.FOREST));
subtypePredicates.add(new SubtypePredicate(SubType.PLAINS));
subtypePredicates.add(new SubtypePredicate(SubType.ISLAND));

View file

@ -27,8 +27,6 @@
*/
package mage.cards.j;
import java.util.HashSet;
import java.util.UUID;
import mage.MageInt;
import mage.ObjectColor;
import mage.abilities.Ability;
@ -44,16 +42,15 @@ import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.choices.Choice;
import mage.choices.ChoiceImpl;
import mage.constants.CardType;
import mage.constants.Duration;
import mage.constants.Layer;
import mage.constants.Outcome;
import mage.constants.SubLayer;
import mage.constants.Zone;
import mage.constants.*;
import mage.game.Game;
import mage.game.permanent.Permanent;
import mage.players.Player;
import java.util.HashSet;
import java.util.Set;
import java.util.UUID;
/**
*
* @author Styxo
@ -83,7 +80,7 @@ public class JodahsAvenger extends CardImpl {
class JodahsAvengerEffect extends ContinuousEffectImpl {
private static final HashSet<String> choices = new HashSet<>();
private static final Set<String> choices = new HashSet<>();
private Ability gainedAbility;
static {

View file

@ -27,8 +27,6 @@
*/
package mage.cards.j;
import java.util.ArrayList;
import java.util.UUID;
import mage.MageObject;
import mage.abilities.ActivatedAbilityImpl;
import mage.abilities.costs.common.SacrificeSourceCost;
@ -46,6 +44,10 @@ import mage.filter.predicate.mageobject.SubtypePredicate;
import mage.filter.predicate.mageobject.SupertypePredicate;
import mage.target.common.TargetCardInLibrary;
import java.util.ArrayList;
import java.util.List;
import java.util.UUID;
/**
*
* @author Styxo
@ -84,7 +86,7 @@ public class JungleVillage extends CardImpl {
addCost(new SacrificeSourceCost());
FilterCard filter = new FilterCard("basic Mountain, Forest or Plains");
filter.add(new CardTypePredicate(CardType.LAND));
ArrayList<Predicate<MageObject>> subtypePredicates = new ArrayList<>();
List<Predicate<MageObject>> subtypePredicates = new ArrayList<>();
subtypePredicates.add(new SubtypePredicate(SubType.PLAINS));
subtypePredicates.add(new SubtypePredicate(SubType.MOUNTAIN));
subtypePredicates.add(new SubtypePredicate(SubType.FAERIE));

View file

@ -27,10 +27,6 @@
*/
package mage.cards.k;
import java.util.HashMap;
import java.util.LinkedList;
import java.util.List;
import java.util.UUID;
import mage.abilities.Ability;
import mage.abilities.dynamicvalue.common.ManacostVariableValue;
import mage.abilities.effects.OneShotEffect;
@ -43,6 +39,8 @@ import mage.game.Game;
import mage.game.permanent.Permanent;
import mage.players.Player;
import java.util.*;
/**
*
* @author North
@ -92,8 +90,8 @@ class KillingWaveEffect extends OneShotEffect {
int amount = (new ManacostVariableValue()).calculate(game, source, this);
if (amount > 0) {
LinkedList<Permanent> sacrifices = new LinkedList<>();
HashMap<UUID, Integer> lifePaidAmounts = new HashMap<>();
List<Permanent> sacrifices = new LinkedList<>();
Map<UUID, Integer> lifePaidAmounts = new HashMap<>();
FilterCreaturePermanent filter = new FilterCreaturePermanent();
for (UUID playerId : game.getState().getPlayersInRange(controller.getId(), game)) {

View file

@ -27,9 +27,6 @@
*/
package mage.cards.k;
import java.util.ArrayList;
import java.util.Objects;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.common.BeginningOfEndStepTriggeredAbility;
@ -46,6 +43,11 @@ import mage.players.PlayerList;
import mage.target.Target;
import mage.target.common.TargetCardInHand;
import java.util.ArrayList;
import java.util.List;
import java.util.Objects;
import java.util.UUID;
/**
* @author spjspj
*/
@ -104,7 +106,7 @@ class KynaiosAndTirosEffect extends OneShotEffect {
Player currentPlayer = game.getPlayer(playerList.get());
UUID firstInactivePlayer = null;
Target target = new TargetCardInHand(filter);
ArrayList<UUID> noLandPlayers = new ArrayList<>();
List<UUID> noLandPlayers = new ArrayList<>();
while (controller.canRespond()) {
if (currentPlayer != null && currentPlayer.canRespond() && game.getState().getPlayersInRange(controller.getId(), game).contains(currentPlayer.getId())) {

View file

@ -27,8 +27,6 @@
*/
package mage.cards.l;
import java.util.HashSet;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.common.SimpleActivatedAbility;
@ -51,6 +49,10 @@ import mage.counters.CounterType;
import mage.game.Game;
import mage.players.Player;
import java.util.HashSet;
import java.util.Set;
import java.util.UUID;
/**
*
* @author LoneFox
@ -82,7 +84,7 @@ public class LunarAvenger extends CardImpl {
class LunarAvengerEffect extends OneShotEffect {
private static final HashSet<String> choices = new HashSet<>();
private static final Set<String> choices = new HashSet<>();
static {
choices.add("Flying");

View file

@ -27,8 +27,6 @@
*/
package mage.cards.m;
import java.util.HashSet;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.common.SimpleActivatedAbility;
@ -51,6 +49,10 @@ import mage.game.Game;
import mage.players.Player;
import mage.target.common.TargetCardInYourGraveyard;
import java.util.HashSet;
import java.util.Set;
import java.util.UUID;
/**
*
* @author Styxo
@ -90,7 +92,7 @@ public class MaintenanceDroid extends CardImpl {
class MaintenanceDroidEffect extends OneShotEffect {
private static final HashSet<String> choices = new HashSet<>();
private static final Set<String> choices = new HashSet<>();
static {
choices.add("Remove a repair counter");

View file

@ -27,9 +27,6 @@
*/
package mage.cards.m;
import java.util.HashMap;
import java.util.List;
import java.util.UUID;
import mage.abilities.Ability;
import mage.abilities.effects.OneShotEffect;
import mage.cards.CardImpl;
@ -41,6 +38,11 @@ import mage.game.Game;
import mage.game.permanent.Permanent;
import mage.game.permanent.token.SpiritWhiteToken;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.UUID;
/**
*
* @author LoneFox
@ -85,7 +87,7 @@ class MarchOfSoulsEffect extends OneShotEffect {
public boolean apply(Game game, Ability source) {
List<Permanent> creatures = game.getBattlefield().getActivePermanents(StaticFilters.FILTER_PERMANENT_CREATURES,
source.getControllerId(), source.getSourceId(), game);
HashMap<UUID, Integer> playersWithCreatures = new HashMap<>();
Map<UUID, Integer> playersWithCreatures = new HashMap<>();
for(Permanent p : creatures) {
UUID controllerId = p.getControllerId();
if(p.destroy(source.getSourceId(), game, true)) {

View file

@ -27,9 +27,6 @@
*/
package mage.cards.m;
import java.util.ArrayList;
import java.util.List;
import java.util.UUID;
import mage.abilities.Ability;
import mage.abilities.TriggeredAbilityImpl;
import mage.abilities.effects.Effect;
@ -51,6 +48,10 @@ import mage.players.Player;
import mage.target.common.TargetControlledPermanent;
import mage.target.targetpointer.FixedTarget;
import java.util.ArrayList;
import java.util.List;
import java.util.UUID;
/**
*
* @author spjspj
@ -143,7 +144,7 @@ class MartyrsBondEffect extends OneShotEffect {
String message = "permanent with type (";
boolean firstType = true;
ArrayList<CardTypePredicate> cardTypes = new ArrayList<>();
List<CardTypePredicate> cardTypes = new ArrayList<>();
for (CardType type : saccedPermanent.getCardType()) {
cardTypes.add(new CardTypePredicate(type));

View file

@ -27,8 +27,6 @@
*/
package mage.cards.m;
import java.util.HashMap;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.common.EntersBattlefieldTriggeredAbility;
@ -44,6 +42,10 @@ import mage.game.Game;
import mage.game.permanent.Permanent;
import mage.players.Player;
import java.util.HashMap;
import java.util.Map;
import java.util.UUID;
/**
*
* @author jeffwadsworth
@ -100,7 +102,7 @@ class MenacingOgreEffect extends OneShotEffect {
int number = 0;
Permanent menacingOgre = game.getPermanent(source.getSourceId());
String message = "Choose a number.";
HashMap<Player, Integer> numberChosen = new HashMap<>();
Map<Player, Integer> numberChosen = new HashMap<>();
//players choose numbers
for (Player player : game.getPlayers().values()) {

View file

@ -27,8 +27,6 @@
*/
package mage.cards.m;
import java.util.HashSet;
import java.util.UUID;
import mage.abilities.Ability;
import mage.abilities.effects.OneShotEffect;
import mage.cards.CardImpl;
@ -46,6 +44,10 @@ import mage.game.Game;
import mage.players.Player;
import mage.target.TargetPlayer;
import java.util.HashSet;
import java.util.Set;
import java.util.UUID;
/**
*
* @author Loki
@ -95,7 +97,7 @@ class MindblazeEffect extends OneShotEffect {
cardChoice.clearChoice();
Choice numberChoice = new ChoiceImpl();
numberChoice.setMessage("Choose a number greater than 0");
HashSet<String> numbers = new HashSet<>();
Set<String> numbers = new HashSet<>();
for (int i = 1; i <= 4; i++) {
numbers.add(Integer.toString(i));
}

View file

@ -27,9 +27,6 @@
*/
package mage.cards.m;
import java.util.HashSet;
import java.util.List;
import java.util.UUID;
import mage.abilities.Ability;
import mage.abilities.effects.OneShotEffect;
import mage.cards.*;
@ -43,6 +40,11 @@ import mage.game.permanent.Permanent;
import mage.players.Player;
import mage.target.TargetCard;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
import java.util.UUID;
/**
*
* @author North
@ -85,7 +87,7 @@ class MitoticManipulationEffect extends OneShotEffect {
@Override
public boolean apply(Game game, Ability source) {
List<Permanent> permanents = game.getBattlefield().getActivePermanents(source.getControllerId(), game);
HashSet<String> permanentNames = new HashSet<>();
Set<String> permanentNames = new HashSet<>();
FilterCard filter = new FilterCard("card to put onto the battlefield");
for (Permanent permanent : permanents) {
permanentNames.add(permanent.getName());

View file

@ -27,8 +27,6 @@
*/
package mage.cards.m;
import java.util.HashSet;
import java.util.UUID;
import mage.MageInt;
import mage.MageObject;
import mage.abilities.Ability;
@ -46,16 +44,15 @@ import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.choices.Choice;
import mage.choices.ChoiceImpl;
import mage.constants.CardType;
import mage.constants.Duration;
import mage.constants.Layer;
import mage.constants.Outcome;
import mage.constants.SubLayer;
import mage.constants.Zone;
import mage.constants.*;
import mage.game.Game;
import mage.game.permanent.Permanent;
import mage.players.Player;
import java.util.HashSet;
import java.util.Set;
import java.util.UUID;
/**
*
* @author LevelX2
@ -90,7 +87,7 @@ public class MultiformWonder extends CardImpl {
class MultiformWonderEffect extends OneShotEffect {
private static final HashSet<String> choices = new HashSet<>();
private static final Set<String> choices = new HashSet<>();
static {
choices.add("Flying");

View file

@ -27,19 +27,13 @@
*/
package mage.cards.n;
import java.util.ArrayList;
import java.util.UUID;
import mage.MageObject;
import mage.abilities.Ability;
import mage.abilities.effects.ContinuousEffect;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.ExileSpellEffect;
import mage.abilities.effects.common.continuous.BecomesBlackZombieAdditionEffect;
import mage.cards.Card;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.cards.Cards;
import mage.cards.CardsImpl;
import mage.cards.*;
import mage.constants.CardType;
import mage.constants.Outcome;
import mage.constants.Zone;
@ -56,6 +50,10 @@ import mage.target.Target;
import mage.target.common.TargetCardInGraveyard;
import mage.target.targetpointer.FixedTarget;
import java.util.ArrayList;
import java.util.List;
import java.util.UUID;
/**
*
* @author LevelX2
@ -110,7 +108,7 @@ class NecromanticSelectionEffect extends OneShotEffect {
}
}
FilterCard filter = new FilterCreatureCard("creature card put into a graveyard with " + sourceObject.getLogName());
ArrayList<Predicate<MageObject>> cardIdPredicates = new ArrayList<>();
List<Predicate<MageObject>> cardIdPredicates = new ArrayList<>();
for (UUID cardId : cards) {
cardIdPredicates.add(new CardIdPredicate(cardId));
}

View file

@ -27,8 +27,6 @@
*/
package mage.cards.n;
import java.util.HashMap;
import java.util.UUID;
import mage.MageObject;
import mage.abilities.Ability;
import mage.abilities.LoyaltyAbility;
@ -38,17 +36,8 @@ import mage.abilities.effects.ContinuousEffect;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.DamageTargetEffect;
import mage.abilities.effects.common.ExileAllEffect;
import mage.cards.Card;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.cards.Cards;
import mage.cards.CardsImpl;
import mage.constants.AsThoughEffectType;
import mage.constants.CardType;
import mage.constants.Duration;
import mage.constants.Outcome;
import mage.constants.TargetController;
import mage.constants.Zone;
import mage.cards.*;
import mage.constants.*;
import mage.filter.FilterCard;
import mage.filter.FilterPermanent;
import mage.filter.common.FilterNonlandPermanent;
@ -62,6 +51,10 @@ import mage.target.common.TargetCreatureOrPlayer;
import mage.target.common.TargetOpponent;
import mage.target.targetpointer.FixedTarget;
import java.util.HashMap;
import java.util.Map;
import java.util.UUID;
/**
*
* @author Will
@ -126,7 +119,7 @@ class NicolBolasGodPharaohPlusOneEffect extends OneShotEffect {
@Override
public boolean apply(Game game, Ability source) {
// Store for each player the cards to exile, that's important because all exile shall happen at the same time
HashMap<UUID, Cards> cardsToExile = new HashMap<>();
Map<UUID, Cards> cardsToExile = new HashMap<>();
// Each player chooses 2 cards to discard
for (UUID playerId : game.getOpponents(source.getControllerId())) {
Player player = game.getPlayer(playerId);

View file

@ -27,17 +27,11 @@
*/
package mage.cards.n;
import java.util.ArrayList;
import java.util.UUID;
import mage.abilities.Ability;
import mage.abilities.common.SimpleActivatedAbility;
import mage.abilities.costs.common.SacrificeSourceCost;
import mage.abilities.effects.OneShotEffect;
import mage.cards.Card;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.cards.Cards;
import mage.cards.CardsImpl;
import mage.cards.*;
import mage.constants.CardType;
import mage.constants.Outcome;
import mage.constants.WatcherScope;
@ -48,6 +42,10 @@ import mage.game.events.ZoneChangeEvent;
import mage.players.Player;
import mage.watchers.Watcher;
import java.util.ArrayList;
import java.util.List;
import java.util.UUID;
/**
*
* @author anonymous
@ -115,7 +113,7 @@ class NoRestForTheWickedEffect extends OneShotEffect {
class NoRestForTheWickedWatcher extends Watcher {
ArrayList<UUID> cards;
List<UUID> cards;
public NoRestForTheWickedWatcher() {
super(NoRestForTheWickedWatcher.class.getSimpleName(), WatcherScope.GAME);

View file

@ -27,9 +27,6 @@
*/
package mage.cards.n;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.UUID;
import mage.Mana;
import mage.abilities.Ability;
import mage.abilities.common.EntersBattlefieldTriggeredAbility;
@ -38,25 +35,19 @@ import mage.abilities.effects.ContinuousEffectImpl;
import mage.abilities.effects.common.AttachEffect;
import mage.abilities.effects.common.DrawCardSourceControllerEffect;
import mage.abilities.keyword.EnchantAbility;
import mage.abilities.mana.BasicManaAbility;
import mage.abilities.mana.BlackManaAbility;
import mage.abilities.mana.BlueManaAbility;
import mage.abilities.mana.GreenManaAbility;
import mage.abilities.mana.RedManaAbility;
import mage.abilities.mana.WhiteManaAbility;
import mage.abilities.mana.*;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.Duration;
import mage.constants.Layer;
import mage.constants.Outcome;
import mage.constants.SubLayer;
import mage.constants.Zone;
import mage.constants.*;
import mage.game.Game;
import mage.game.permanent.Permanent;
import mage.target.TargetPermanent;
import mage.target.common.TargetLandPermanent;
import java.util.ArrayList;
import java.util.List;
import java.util.UUID;
/**
*
* @author LevelX2
@ -77,7 +68,7 @@ public class NyleasPresence extends CardImpl {
// When Nylea's Presence enters the battlefield, draw a card.
this.addAbility(new EntersBattlefieldTriggeredAbility(new DrawCardSourceControllerEffect(1)));
// Enchanted land is every basic land type in addition to its other types.
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new NyleasPresenceLandTypeEffect("Swamp", "Mountain", "Forest", "Island", "Plains")));
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new NyleasPresenceLandTypeEffect()));
}
@ -93,11 +84,11 @@ public class NyleasPresence extends CardImpl {
class NyleasPresenceLandTypeEffect extends ContinuousEffectImpl {
protected ArrayList<String> landTypes = new ArrayList<>();
protected List<SubType> landTypes = new ArrayList<>();
public NyleasPresenceLandTypeEffect(String... landNames) {
public NyleasPresenceLandTypeEffect() {
super(Duration.WhileOnBattlefield, Outcome.Detriment);
landTypes.addAll(Arrays.asList(landNames));
landTypes.addAll(SubType.getBasicLands(false));
this.staticText = "Enchanted land is every basic land type in addition to its other types";
}
@ -132,24 +123,24 @@ class NyleasPresenceLandTypeEffect extends ContinuousEffectImpl {
}
}
}
if (mana.getGreen() == 0 && landTypes.contains("Forest")) {
if (mana.getGreen() == 0 && landTypes.contains(SubType.FOREST)) {
land.addAbility(new GreenManaAbility(), source.getSourceId(), game);
}
if (mana.getRed() == 0 && landTypes.contains("Mountain")) {
if (mana.getRed() == 0 && landTypes.contains(SubType.MOUNTAIN)) {
land.addAbility(new RedManaAbility(), source.getSourceId(), game);
}
if (mana.getBlue() == 0 && landTypes.contains("Island")) {
if (mana.getBlue() == 0 && landTypes.contains(SubType.ISLAND)) {
land.addAbility(new BlueManaAbility(), source.getSourceId(), game);
}
if (mana.getWhite() == 0 && landTypes.contains("Plains")) {
if (mana.getWhite() == 0 && landTypes.contains(SubType.PLAINS)) {
land.addAbility(new WhiteManaAbility(), source.getSourceId(), game);
}
if (mana.getBlack() == 0 && landTypes.contains("Swamp")) {
if (mana.getBlack() == 0 && landTypes.contains(SubType.SWAMP)) {
land.addAbility(new BlackManaAbility(), source.getSourceId(), game);
}
break;
case TypeChangingEffects_4:
for (String subtype : landTypes) {
for (SubType subtype : landTypes) {
if (!land.getSubtype(game).contains(subtype)) {
land.getSubtype(game).add(subtype);
}

View file

@ -27,9 +27,6 @@
*/
package mage.cards.o;
import java.util.ArrayList;
import java.util.Objects;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.common.BeginningOfUpkeepTriggeredAbility;
@ -51,6 +48,11 @@ import mage.players.Player;
import mage.target.Target;
import mage.target.common.TargetControlledCreaturePermanent;
import java.util.ArrayList;
import java.util.List;
import java.util.Objects;
import java.util.UUID;
/**
*
* @author LevelX2
@ -100,8 +102,8 @@ class OrzhovAdvokistEffect extends OneShotEffect {
public boolean apply(Game game, Ability source) {
Player controller = game.getPlayer(source.getControllerId());
if (controller != null) {
ArrayList<UUID> players = new ArrayList<>();
ArrayList<UUID> creatures = new ArrayList<>();
List<UUID> players = new ArrayList<>();
List<UUID> creatures = new ArrayList<>();
for (UUID playerId : game.getState().getPlayersInRange(controller.getId(), game)) {
Player player = game.getPlayer(playerId);
if (player != null) {

View file

@ -27,9 +27,6 @@
*/
package mage.cards.p;
import java.util.HashSet;
import java.util.Set;
import java.util.UUID;
import mage.abilities.Ability;
import mage.abilities.effects.OneShotEffect;
import mage.cards.Card;
@ -44,6 +41,10 @@ import mage.players.Player;
import mage.target.Target;
import mage.target.common.TargetLandPermanent;
import java.util.HashSet;
import java.util.Set;
import java.util.UUID;
/**
*
* @author Styxo
@ -91,9 +92,9 @@ class PlanarOverlayEffect extends OneShotEffect {
for (UUID playerId : game.getState().getPlayersInRange(controller.getId(), game)) {
Player player = game.getPlayer(playerId);
if (player != null) {
for (String landName : SubType.getBasicLands(false)) {
for (SubType landName : SubType.getBasicLands(false)) {
FilterLandPermanent filter = new FilterLandPermanent(landName + " to return to hand");
filter.add(new SubtypePredicate(SubType.byDescription(landName)));
filter.add(new SubtypePredicate(landName));
filter.add(new ControllerPredicate(TargetController.YOU));
Target target = new TargetLandPermanent(1, 1, filter, true);
if (target.canChoose(source.getSourceId(), player.getId(), game)) {

View file

@ -27,31 +27,22 @@
*/
package mage.cards.p;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.UUID;
import mage.Mana;
import mage.abilities.Ability;
import mage.abilities.common.SimpleStaticAbility;
import mage.abilities.effects.ContinuousEffectImpl;
import mage.abilities.mana.BasicManaAbility;
import mage.abilities.mana.BlackManaAbility;
import mage.abilities.mana.BlueManaAbility;
import mage.abilities.mana.GreenManaAbility;
import mage.abilities.mana.RedManaAbility;
import mage.abilities.mana.WhiteManaAbility;
import mage.abilities.mana.*;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.Duration;
import mage.constants.Layer;
import mage.constants.Outcome;
import mage.constants.SubLayer;
import mage.constants.Zone;
import mage.constants.*;
import mage.filter.common.FilterLandPermanent;
import mage.game.Game;
import mage.game.permanent.Permanent;
import java.util.ArrayList;
import java.util.List;
import java.util.UUID;
/**
*
* @author LevelX2
@ -77,11 +68,11 @@ public class PrismaticOmen extends CardImpl {
class BecomesBasicLandTypeAllEffect extends ContinuousEffectImpl {
protected ArrayList<String> landTypes = new ArrayList<>();
protected List<SubType> landTypes = new ArrayList<>();
public BecomesBasicLandTypeAllEffect(String... landNames) {
super(Duration.WhileOnBattlefield, Outcome.Detriment);
landTypes.addAll(Arrays.asList(landNames));
landTypes.addAll(SubType.getBasicLands(false));
this.staticText = "Lands you control are every basic land type in addition to their other types";
}
@ -114,24 +105,24 @@ class BecomesBasicLandTypeAllEffect extends ContinuousEffectImpl {
}
}
}
if (mana.getGreen() == 0 && landTypes.contains("Forest")) {
if (mana.getGreen() == 0 && landTypes.contains(SubType.FOREST)) {
land.addAbility(new GreenManaAbility(), source.getSourceId(), game);
}
if (mana.getRed() == 0 && landTypes.contains("Mountain")) {
if (mana.getRed() == 0 && landTypes.contains(SubType.MOUNTAIN)) {
land.addAbility(new RedManaAbility(), source.getSourceId(), game);
}
if (mana.getBlue() == 0 && landTypes.contains("Island")) {
if (mana.getBlue() == 0 && landTypes.contains(SubType.ISLAND)) {
land.addAbility(new BlueManaAbility(), source.getSourceId(), game);
}
if (mana.getWhite() == 0 && landTypes.contains("Plains")) {
if (mana.getWhite() == 0 && landTypes.contains(SubType.PLAINS)) {
land.addAbility(new WhiteManaAbility(), source.getSourceId(), game);
}
if (mana.getBlack() == 0 && landTypes.contains("Swamp")) {
if (mana.getBlack() == 0 && landTypes.contains(SubType.SWAMP)) {
land.addAbility(new BlackManaAbility(), source.getSourceId(), game);
}
break;
case TypeChangingEffects_4:
for (String subtype : landTypes) {
for (SubType subtype : landTypes) {
if (!land.getSubtype(game).contains(subtype)) {
land.getSubtype(game).add(subtype);
}

View file

@ -27,9 +27,6 @@
*/
package mage.cards.r;
import java.util.ArrayList;
import java.util.Set;
import java.util.UUID;
import mage.abilities.Ability;
import mage.abilities.DelayedTriggeredAbility;
import mage.abilities.common.delayed.AtTheBeginOfYourNextUpkeepDelayedTriggeredAbility;
@ -51,6 +48,11 @@ import mage.game.permanent.Permanent;
import mage.players.Player;
import mage.target.targetpointer.FixedTargets;
import java.util.ArrayList;
import java.util.List;
import java.util.Set;
import java.util.UUID;
/**
*
* @author emerald000
@ -101,7 +103,7 @@ class RallyTheAncestorsEffect extends OneShotEffect {
filter.add(new ConvertedManaCostPredicate(ComparisonType.FEWER_THAN, xValue + 1));
Set<Card> cards = player.getGraveyard().getCards(filter, game);
player.moveCards(cards, Zone.BATTLEFIELD, source, game);
ArrayList<Permanent> toExile = new ArrayList<>(cards.size());
List<Permanent> toExile = new ArrayList<>(cards.size());
for (Card card : cards) {
if (card != null) {
Permanent permanent = game.getPermanent(card.getId());

View file

@ -27,17 +27,10 @@
*/
package mage.cards.r;
import java.util.ArrayList;
import java.util.UUID;
import mage.MageObject;
import mage.abilities.Ability;
import mage.abilities.effects.OneShotEffect;
import mage.cards.Card;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.cards.Cards;
import mage.cards.CardsImpl;
import mage.cards.SplitCard;
import mage.cards.*;
import mage.constants.CardType;
import mage.constants.Outcome;
import mage.constants.Zone;
@ -52,6 +45,10 @@ import mage.target.common.TargetCardInHand;
import mage.target.common.TargetCardInLibrary;
import mage.target.common.TargetOpponent;
import java.util.ArrayList;
import java.util.List;
import java.util.UUID;
/**
*
* @author jeffwadsworth
@ -122,7 +119,7 @@ class ReapIntellectEffect extends OneShotEffect {
if (!exiledCards.isEmpty()) {
// Building a card filter with all names
ArrayList<NamePredicate> names = new ArrayList<>();
List<NamePredicate> names = new ArrayList<>();
FilterCard filterNamedCards = new FilterCard();
for (Card card : exiledCards.getCards(game)) {
if (exiledCards.size() == 1) {

View file

@ -27,8 +27,6 @@
*/
package mage.cards.r;
import java.util.ArrayList;
import java.util.UUID;
import mage.MageObject;
import mage.abilities.Ability;
import mage.abilities.common.DiesAttachedTriggeredAbility;
@ -51,6 +49,10 @@ import mage.players.Player;
import mage.target.TargetPermanent;
import mage.target.common.TargetCreaturePermanent;
import java.util.ArrayList;
import java.util.List;
import java.util.UUID;
/**
*
* @author jeffwadsworth
@ -110,7 +112,7 @@ class ReinsOfTheVinesteedEffect extends OneShotEffect {
}
FilterCreaturePermanent FILTER = new FilterCreaturePermanent();
StringBuilder sb = new StringBuilder("creature that shares a creature type with the formerly attached creature: ");
ArrayList<Predicate<MageObject>> subtypes = new ArrayList<>();
List<Predicate<MageObject>> subtypes = new ArrayList<>();
for (SubType subtype : lastStateCreature.getSubtype(game)) {
subtypes.add(new SubtypePredicate(subtype));
sb.append(subtype).append(", ");

View file

@ -27,17 +27,11 @@
*/
package mage.cards.r;
import java.util.HashMap;
import java.util.UUID;
import mage.abilities.Ability;
import mage.abilities.costs.mana.ColoredManaCost;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.keyword.SuspendAbility;
import mage.cards.Card;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.cards.Cards;
import mage.cards.CardsImpl;
import mage.cards.*;
import mage.constants.CardType;
import mage.constants.ColoredManaSymbol;
import mage.constants.Outcome;
@ -50,6 +44,10 @@ import mage.players.Player;
import mage.target.common.TargetCardInHand;
import mage.target.common.TargetControlledPermanent;
import java.util.HashMap;
import java.util.Map;
import java.util.UUID;
/**
*
* @author Plopman
@ -168,7 +166,7 @@ class RestoreBalanceEffect extends OneShotEffect {
//Cards in hand
int minCard = Integer.MAX_VALUE;
HashMap<UUID, Cards> cardsToDiscard = new HashMap<>(2);
Map<UUID, Cards> cardsToDiscard = new HashMap<>(2);
for (UUID playerId : game.getState().getPlayersInRange(controller.getId(), game)) {
Player player = game.getPlayer(playerId);
if (player != null) {

View file

@ -27,9 +27,6 @@
*/
package mage.cards.r;
import java.util.HashSet;
import java.util.LinkedList;
import java.util.UUID;
import mage.abilities.Ability;
import mage.abilities.effects.OneShotEffect;
import mage.cards.CardImpl;
@ -44,6 +41,8 @@ import mage.game.permanent.Permanent;
import mage.players.Player;
import mage.target.common.TargetControlledPermanent;
import java.util.*;
/**
*
* @author North
@ -91,7 +90,7 @@ class RiteOfRuinEffect extends OneShotEffect {
return false;
}
HashSet<String> choices = new HashSet<>();
Set<String> choices = new HashSet<>();
choices.add("Artifacts");
choices.add("Creatures");
choices.add("Lands");
@ -106,7 +105,7 @@ class RiteOfRuinEffect extends OneShotEffect {
}
order.add(getCardType(choices.iterator().next()));
LinkedList<UUID> sacrifices = new LinkedList<>();
List<UUID> sacrifices = new LinkedList<>();
int count = 1;
for (CardType cardType : order) {
FilterControlledPermanent filter = new FilterControlledPermanent(cardType + " permanent you control");

View file

@ -27,12 +27,6 @@
*/
package mage.cards.s;
import java.util.HashSet;
import java.util.LinkedHashMap;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
import java.util.UUID;
import mage.MageObject;
import mage.abilities.Ability;
import mage.abilities.common.CantBeCounteredAbility;
@ -42,11 +36,7 @@ import mage.abilities.effects.ReplacementEffectImpl;
import mage.cards.Card;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.AsThoughEffectType;
import mage.constants.CardType;
import mage.constants.Duration;
import mage.constants.Outcome;
import mage.constants.WatcherScope;
import mage.constants.*;
import mage.counters.CounterType;
import mage.game.Game;
import mage.game.command.Commander;
@ -57,6 +47,9 @@ import mage.game.permanent.Permanent;
import mage.game.stack.Spell;
import mage.watchers.Watcher;
import java.util.*;
import java.util.Map.Entry;
/**
*
* @author LevelX2
@ -200,7 +193,7 @@ class SavageSummoningWatcher extends Watcher {
public boolean isSpellCastWithThisSavageSummoning(UUID spellId, UUID cardId, int zoneChangeCounter) {
String cardKey = new StringBuilder(cardId.toString()).append('_').append(zoneChangeCounter).toString();
HashSet<String> savageSpells = (HashSet<String>) spellsCastWithSavageSummoning.get(spellId);
Set<String> savageSpells = spellsCastWithSavageSummoning.get(spellId);
return savageSpells != null && savageSpells.contains(cardKey);
}
@ -208,7 +201,7 @@ class SavageSummoningWatcher extends Watcher {
String creatureCardKey = card.getId().toString() + '_' + (card.getZoneChangeCounter(game));
// add one because card is now gone to battlefield as creature
String cardKey = cardId.toString() + '_' + zoneChangeCounter;
HashSet<String> savageSpells = (HashSet<String>) cardsCastWithSavageSummoning.get(creatureCardKey);
Set<String> savageSpells = cardsCastWithSavageSummoning.get(creatureCardKey);
return savageSpells != null && savageSpells.contains(cardKey);
}

View file

@ -27,8 +27,6 @@
*/
package mage.cards.s;
import java.util.HashMap;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.common.DealsCombatDamageToAPlayerTriggeredAbility;
@ -46,6 +44,10 @@ import mage.players.Player;
import mage.target.Target;
import mage.target.common.TargetDiscard;
import java.util.HashMap;
import java.util.Map;
import java.util.UUID;
/**
*
* @author jeffwadsworth
@ -90,8 +92,8 @@ class ScytheSpecterEffect extends OneShotEffect {
@Override
public boolean apply(Game game, Ability source) {
HashMap<UUID, Card> cardDiscarded = new HashMap<>();
HashMap<UUID, Integer> discardedCheck = new HashMap<>();
Map<UUID, Card> cardDiscarded = new HashMap<>();
Map<UUID, Integer> discardedCheck = new HashMap<>();
Integer highestCMC = 0;
Integer currentCMC = 0;
Player controller = game.getPlayer(source.getControllerId());

View file

@ -27,8 +27,6 @@
*/
package mage.cards.s;
import java.util.ArrayList;
import java.util.UUID;
import mage.abilities.Ability;
import mage.abilities.effects.OneShotEffect;
import mage.cards.Card;
@ -43,6 +41,10 @@ import mage.game.events.GameEvent;
import mage.game.events.ZoneChangeEvent;
import mage.watchers.Watcher;
import java.util.ArrayList;
import java.util.List;
import java.util.UUID;
/**
*
* @author LevelX2
@ -103,7 +105,7 @@ class SecondSunriseEffect extends OneShotEffect {
}
class SecondSunriseWatcher extends Watcher {
ArrayList<UUID> cards = new ArrayList<>();
List<UUID> cards = new ArrayList<>();
public SecondSunriseWatcher() {
super(SecondSunriseWatcher.class.getSimpleName(), WatcherScope.GAME);

View file

@ -27,8 +27,6 @@
*/
package mage.cards.s;
import java.util.HashSet;
import java.util.UUID;
import mage.MageInt;
import mage.MageObject;
import mage.abilities.Ability;
@ -41,18 +39,16 @@ import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.choices.Choice;
import mage.choices.ChoiceImpl;
import mage.constants.CardType;
import mage.constants.Duration;
import mage.constants.Layer;
import mage.constants.Outcome;
import mage.constants.SubLayer;
import mage.constants.TargetController;
import mage.constants.Zone;
import mage.constants.*;
import mage.game.Game;
import mage.game.permanent.Permanent;
import mage.players.Player;
import mage.util.CardUtil;
import java.util.HashSet;
import java.util.Set;
import java.util.UUID;
/**
*
* @author MarcoMarin / HCrescent
@ -101,21 +97,21 @@ class ShapeshifterEffect extends OneShotEffect {
@Override
public boolean apply(Game game, Ability source) {
Player Controller = game.getPlayer(source.getControllerId());
Player controller = game.getPlayer(source.getControllerId());
MageObject mageObject = game.getPermanentEntering(source.getSourceId());
if (mageObject == null) {
mageObject = game.getPermanent(source.getSourceId());
}
if (Controller != null) {
if (controller != null) {
Choice numberChoice = new ChoiceImpl();
numberChoice.setMessage("Choose a number beween 0 and 7");
HashSet<String> numbers = new HashSet<>();
Set<String> numbers = new HashSet<>();
for (int i = 0; i <= 7; i++) {
numbers.add(Integer.toString(i));
}
numberChoice.setChoices(numbers);
while (!Controller.choose(Outcome.Neutral, numberChoice, game)) {
if (!Controller.canRespond()) {
while (!controller.choose(Outcome.Neutral, numberChoice, game)) {
if (!controller.canRespond()) {
return false;
}
}

View file

@ -27,8 +27,6 @@
*/
package mage.cards.s;
import java.util.ArrayList;
import java.util.UUID;
import mage.MageObject;
import mage.abilities.Ability;
import mage.abilities.Mode;
@ -47,6 +45,10 @@ import mage.filter.predicate.permanent.PermanentIdPredicate;
import mage.game.Game;
import mage.game.permanent.Permanent;
import java.util.ArrayList;
import java.util.List;
import java.util.UUID;
/**
*
* @author Plopman
@ -109,7 +111,7 @@ class SharedAnimosityEffect extends ContinuousEffectImpl {
}
}
if(!allCreatureTypes){
ArrayList<Predicate<MageObject>> predicateList = new ArrayList<>();
List<Predicate<MageObject>> predicateList = new ArrayList<>();
for(SubType subtype : permanent.getSubtype(game)){
predicateList.add(new SubtypePredicate(subtype));
}

View file

@ -27,8 +27,6 @@
*/
package mage.cards.s;
import java.util.ArrayList;
import java.util.UUID;
import mage.abilities.Ability;
import mage.abilities.abilityword.StriveAbility;
import mage.abilities.effects.OneShotEffect;
@ -42,6 +40,10 @@ import mage.game.permanent.Permanent;
import mage.players.Player;
import mage.target.common.TargetCreaturePermanent;
import java.util.ArrayList;
import java.util.List;
import java.util.UUID;
/**
@ -95,7 +97,7 @@ class SilenceTheBelieversExileEffect extends OneShotEffect {
for (UUID targetId: this.getTargetPointer().getTargets(game, source)) {
Permanent creature = game.getPermanent(targetId);
if (creature != null) {
ArrayList<UUID> attachments = new ArrayList<>(creature.getAttachments());
List<UUID> attachments = new ArrayList<>(creature.getAttachments());
for (UUID attachmentId: attachments) {
Permanent attachment = game.getPermanent(attachmentId);
if (attachment != null && attachment.getSubtype(game).contains("Aura")) {

View file

@ -27,8 +27,6 @@
*/
package mage.cards.s;
import java.util.HashSet;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.common.SimpleActivatedAbility;
@ -51,6 +49,10 @@ import mage.game.permanent.Permanent;
import mage.players.Player;
import mage.target.common.TargetControlledCreaturePermanent;
import java.util.HashSet;
import java.util.Set;
import java.util.UUID;
/**
*
* @author Styxo
@ -84,7 +86,7 @@ public class SithEvoker extends CardImpl {
class SithEvokerEffect extends OneShotEffect {
private static final HashSet<String> choices = new HashSet<>();
private static final Set<String> choices = new HashSet<>();
static {
choices.add("Gain life equal to creature's power");

View file

@ -27,8 +27,6 @@
*/
package mage.cards.s;
import java.util.ArrayList;
import java.util.UUID;
import mage.MageObject;
import mage.abilities.ActivatedAbilityImpl;
import mage.abilities.costs.common.SacrificeSourceCost;
@ -46,6 +44,10 @@ import mage.filter.predicate.mageobject.SubtypePredicate;
import mage.filter.predicate.mageobject.SupertypePredicate;
import mage.target.common.TargetCardInLibrary;
import java.util.ArrayList;
import java.util.List;
import java.util.UUID;
/**
*
* @author Styxo
@ -84,7 +86,7 @@ public class SithRuins extends CardImpl {
addCost(new SacrificeSourceCost());
FilterCard filter = new FilterCard("basic Island, Swamp or Mountain");
filter.add(new CardTypePredicate(CardType.LAND));
ArrayList<Predicate<MageObject>> subtypePredicates = new ArrayList<>();
List<Predicate<MageObject>> subtypePredicates = new ArrayList<>();
subtypePredicates.add(new SubtypePredicate(SubType.SWAMP));
subtypePredicates.add(new SubtypePredicate(SubType.MOUNTAIN));
subtypePredicates.add(new SubtypePredicate(SubType.ISLAND));

View file

@ -27,8 +27,6 @@
*/
package mage.cards.s;
import java.util.HashSet;
import java.util.UUID;
import mage.MageInt;
import mage.ObjectColor;
import mage.abilities.Ability;
@ -46,6 +44,10 @@ import mage.game.Game;
import mage.game.permanent.Permanent;
import mage.players.Player;
import java.util.HashSet;
import java.util.Set;
import java.util.UUID;
/**
*
* @author LevelX2
@ -100,7 +102,7 @@ class SoulOfRavnicaEffect extends OneShotEffect {
public boolean apply(Game game, Ability source) {
Player controller = game.getPlayer(source.getControllerId());
if (controller != null) {
HashSet<ObjectColor> colors = new HashSet<>();
Set<ObjectColor> colors = new HashSet<>();
for (Permanent permanent : game.getBattlefield().getAllActivePermanents(controller.getId())) {
if (permanent.getColor(game).isBlack()) {
colors.add(ObjectColor.BLACK);

View file

@ -27,8 +27,6 @@
*/
package mage.cards.s;
import java.util.HashSet;
import java.util.UUID;
import mage.ObjectColor;
import mage.abilities.Ability;
import mage.abilities.common.SimpleStaticAbility;
@ -45,6 +43,10 @@ import mage.game.Game;
import mage.game.permanent.Permanent;
import mage.players.Player;
import java.util.HashSet;
import java.util.Set;
import java.util.UUID;
/**
* @author Quercitron
*/
@ -79,7 +81,7 @@ enum SpiritOfResistanceCondition implements Condition {
public boolean apply(Game game, Ability source) {
Player controller = game.getPlayer(source.getControllerId());
if (controller != null) {
HashSet<ObjectColor> colors = new HashSet<>();
Set<ObjectColor> colors = new HashSet<>();
for (Permanent permanent : game.getBattlefield().getAllActivePermanents(controller.getId())) {
if (permanent.getColor(game).isBlack()) {
colors.add(ObjectColor.BLACK);

View file

@ -27,8 +27,6 @@
*/
package mage.cards.s;
import java.util.HashSet;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.common.SimpleStaticAbility;
@ -40,6 +38,10 @@ import mage.game.Game;
import mage.game.events.GameEvent;
import mage.watchers.Watcher;
import java.util.HashSet;
import java.util.Set;
import java.util.UUID;
/**
*
@ -71,7 +73,7 @@ public class SpiritOfTheLabyrinth extends CardImpl {
class SpiritOfTheLabyrinthWatcher extends Watcher {
private final HashSet<UUID> playersThatDrewCard;
private final Set<UUID> playersThatDrewCard;
public SpiritOfTheLabyrinthWatcher() {
super(SpiritOfTheLabyrinthWatcher.class.getSimpleName(), WatcherScope.GAME);

View file

@ -27,8 +27,6 @@
*/
package mage.cards.s;
import java.util.HashSet;
import java.util.UUID;
import mage.abilities.Ability;
import mage.abilities.common.SimpleStaticAbility;
import mage.abilities.effects.RestrictionEffect;
@ -44,6 +42,10 @@ import mage.game.Game;
import mage.game.permanent.Permanent;
import mage.players.Player;
import java.util.HashSet;
import java.util.Set;
import java.util.UUID;
/**
*
* @author LevelX2
@ -71,7 +73,7 @@ class StorageMatrixRestrictionEffect extends RestrictionEffect {
private int turn;
private boolean applies;
private static final HashSet<String> choice = new HashSet<>();
private static final Set<String> choice = new HashSet<>();
static {
choice.add(CardType.ARTIFACT.toString());

View file

@ -27,9 +27,6 @@
*/
package mage.cards.s;
import java.util.HashSet;
import java.util.Set;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.common.EntersBattlefieldOrLeavesSourceTriggeredAbility;
@ -47,6 +44,10 @@ import mage.players.Player;
import mage.target.Target;
import mage.target.common.TargetLandPermanent;
import java.util.HashSet;
import java.util.Set;
import java.util.UUID;
/**
*
* @author LevelX2
@ -96,9 +97,9 @@ class SunderingTitanDestroyLandEffect extends OneShotEffect {
Permanent sourcePermanent = game.getPermanentOrLKIBattlefield(source.getSourceId());
Set<UUID> lands = new HashSet<>();
if (controller != null && sourcePermanent != null) {
for (String landName : SubType.getBasicLands(false)) {
for (SubType landName : SubType.getBasicLands(false)) {
FilterLandPermanent filter = new FilterLandPermanent(landName + " to destroy");
filter.add(new SubtypePredicate(SubType.byDescription(landName)));
filter.add(new SubtypePredicate(landName));
Target target = new TargetLandPermanent(1, 1, filter, true);
if (target.canChoose(source.getSourceId(), source.getControllerId(), game)) {
controller.chooseTarget(outcome, target, source, game);

View file

@ -27,9 +27,6 @@
*/
package mage.cards.t;
import java.util.ArrayList;
import java.util.List;
import java.util.UUID;
import mage.MageObjectReference;
import mage.abilities.Ability;
import mage.abilities.DelayedTriggeredAbility;
@ -58,6 +55,10 @@ import mage.players.Player;
import mage.target.TargetPermanent;
import mage.target.common.TargetCreaturePermanent;
import java.util.ArrayList;
import java.util.List;
import java.util.UUID;
/**
*
* @author LevelX2
@ -123,7 +124,7 @@ class TamiyoFieldResearcherEffect1 extends OneShotEffect {
public boolean apply(Game game, Ability source) {
Player controller = game.getPlayer(source.getControllerId());
if (controller != null) {
ArrayList<MageObjectReference> creatures = new ArrayList<>();
List<MageObjectReference> creatures = new ArrayList<>();
for (UUID uuid : getTargetPointer().getTargets(game, source)) {
creatures.add(new MageObjectReference(uuid, game));
}

View file

@ -27,8 +27,6 @@
*/
package mage.cards.t;
import java.util.HashSet;
import java.util.UUID;
import mage.MageInt;
import mage.MageObject;
import mage.abilities.Ability;
@ -37,15 +35,14 @@ import mage.abilities.effects.ContinuousEffectImpl;
import mage.cards.Card;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.Duration;
import mage.constants.Layer;
import mage.constants.Outcome;
import mage.constants.SubLayer;
import mage.constants.Zone;
import mage.constants.*;
import mage.game.Game;
import mage.players.Player;
import java.util.EnumSet;
import java.util.Set;
import java.util.UUID;
/**
*
* @author Plopman
@ -95,7 +92,7 @@ class TarmogoyfEffect extends ContinuousEffectImpl {
if (controller != null) {
MageObject target = game.getObject(source.getSourceId());
if (target != null) {
HashSet<CardType> foundCardTypes = new HashSet<>();
Set<CardType> foundCardTypes = EnumSet.noneOf(CardType.class);
for (UUID playerId : game.getState().getPlayersInRange(controller.getId(), game)) {
Player player = game.getPlayer(playerId);
if (player != null) {

View file

@ -27,8 +27,6 @@
*/
package mage.cards.t;
import java.util.HashSet;
import java.util.UUID;
import mage.abilities.Ability;
import mage.abilities.common.BeginningOfUpkeepTriggeredAbility;
import mage.abilities.effects.OneShotEffect;
@ -46,6 +44,10 @@ import mage.game.Game;
import mage.game.permanent.Permanent;
import mage.players.Player;
import java.util.HashSet;
import java.util.Set;
import java.util.UUID;
/**
*
* @author LevelX2
@ -76,7 +78,7 @@ class TeferisRealmEffect extends OneShotEffect {
private static final String CREATURE = "Creature";
private static final String LAND = "Land";
private static final String NON_AURA_ENCHANTMENT = "Non-Aura enchantment";
private static final HashSet<String> choices = new HashSet<>();
private static final Set<String> choices = new HashSet<>();
static {
choices.add(ARTIFACT);

View file

@ -27,9 +27,6 @@
*/
package mage.cards.t;
import java.util.HashMap;
import java.util.Map.Entry;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.common.EntersBattlefieldTriggeredAbility;
@ -47,6 +44,11 @@ import mage.game.permanent.Permanent;
import mage.game.permanent.token.ElephantToken;
import mage.target.TargetPermanent;
import java.util.HashMap;
import java.util.Map;
import java.util.Map.Entry;
import java.util.UUID;
/**
*
* @author jeffwadsworth
@ -100,7 +102,7 @@ class TerastodonEffect extends OneShotEffect {
@Override
public boolean apply(Game game, Ability source) {
HashMap<UUID, Integer> destroyedPermanents = new HashMap<>();
Map<UUID, Integer> destroyedPermanents = new HashMap<>();
for (UUID targetID : this.targetPointer.getTargets(game, source)) {
Permanent permanent = game.getPermanent(targetID);
if (permanent != null) {

View file

@ -27,8 +27,6 @@
*/
package mage.cards.t;
import java.util.ArrayList;
import java.util.UUID;
import mage.abilities.Ability;
import mage.abilities.common.delayed.AtTheBeginOfNextEndStepDelayedTriggeredAbility;
import mage.abilities.effects.OneShotEffect;
@ -42,6 +40,10 @@ import mage.game.permanent.Permanent;
import mage.game.permanent.token.ThatcherHumanToken;
import mage.target.targetpointer.FixedTargets;
import java.util.ArrayList;
import java.util.List;
import java.util.UUID;
/**
*
* @author North
@ -85,7 +87,7 @@ class ThatcherRevoltEffect extends OneShotEffect {
public boolean apply(Game game, Ability source) {
ThatcherHumanToken token = new ThatcherHumanToken();
token.putOntoBattlefield(3, game, source.getSourceId(), source.getControllerId());
ArrayList<Permanent> toSacrifice = new ArrayList<>();
List<Permanent> toSacrifice = new ArrayList<>();
for (UUID tokenId : token.getLastAddedTokenIds()) {
Permanent tokenPermanent = game.getPermanent(tokenId);
if (tokenPermanent != null) {

View file

@ -27,8 +27,6 @@
*/
package mage.cards.t;
import java.util.HashSet;
import java.util.UUID;
import mage.ConditionalMana;
import mage.Mana;
import mage.abilities.Ability;
@ -52,6 +50,10 @@ import mage.game.permanent.Permanent;
import mage.game.stack.Spell;
import mage.players.Player;
import java.util.HashSet;
import java.util.Set;
import java.util.UUID;
/**
*
* @author spjspjs
@ -97,7 +99,7 @@ class ThranTurbineEffect extends OneShotEffect {
if (player != null) {
Choice numberChoice = new ChoiceImpl();
HashSet<String> numbers = new HashSet<>();
Set<String> numbers = new HashSet<>();
numbers.add(Integer.toString(1));
numbers.add(Integer.toString(2));
numberChoice.setChoices(numbers);

View file

@ -27,8 +27,6 @@
*/
package mage.cards.t;
import java.util.HashSet;
import java.util.UUID;
import mage.abilities.Ability;
import mage.abilities.effects.OneShotEffect;
import mage.cards.CardImpl;
@ -46,6 +44,10 @@ import mage.game.permanent.Permanent;
import mage.players.Player;
import mage.target.TargetPlayer;
import java.util.HashSet;
import java.util.Set;
import java.util.UUID;
/**
*
* @author Plopman
@ -73,7 +75,7 @@ public class Turnabout extends CardImpl {
class TurnaboutEffect extends OneShotEffect {
private static final HashSet<String> choice = new HashSet<>();
private static final Set<String> choice = new HashSet<>();
static {
choice.add(CardType.ARTIFACT.toString());
@ -81,7 +83,7 @@ class TurnaboutEffect extends OneShotEffect {
choice.add(CardType.LAND.toString());
}
private static final HashSet<String> choice2 = new HashSet<>();
private static final Set<String> choice2 = new HashSet<>();
static {
choice2.add("Untap");

View file

@ -27,8 +27,6 @@
*/
package mage.cards.t;
import java.util.ArrayList;
import java.util.UUID;
import mage.abilities.Ability;
import mage.abilities.DelayedTriggeredAbility;
import mage.abilities.abilityword.StriveAbility;
@ -48,6 +46,10 @@ import mage.target.common.TargetControlledCreaturePermanent;
import mage.target.targetpointer.FixedTarget;
import mage.target.targetpointer.FixedTargets;
import java.util.ArrayList;
import java.util.List;
import java.util.UUID;
/**
*
* @author LevelX2
@ -95,7 +97,7 @@ class TwinflameCopyEffect extends OneShotEffect {
public boolean apply(Game game, Ability source) {
Player controller = game.getPlayer(source.getControllerId());
if (controller != null) {
ArrayList<Permanent> toExile = new ArrayList<>();
List<Permanent> toExile = new ArrayList<>();
for (UUID creatureId : this.getTargetPointer().getTargets(game, source)) {
Permanent creature = game.getPermanentOrLKIBattlefield(creatureId);
if (creature != null) {

View file

@ -27,10 +27,6 @@
*/
package mage.cards.t;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Set;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.common.BeginningOfPostCombatMainTriggeredAbility;
@ -49,6 +45,8 @@ import mage.game.events.GameEvent.EventType;
import mage.players.Player;
import mage.watchers.Watcher;
import java.util.*;
/**
*
* @author LevelX2
@ -122,7 +120,7 @@ class TymnaTheWeaverEffect extends OneShotEffect {
class TymnaTheWeaverWatcher extends Watcher {
// private final Set<UUID> players = new HashSet<>();
private final HashMap<UUID, Set<UUID>> players = new HashMap<>();
private final Map<UUID, Set<UUID>> players = new HashMap<>();
public TymnaTheWeaverWatcher() {
super(TymnaTheWeaverWatcher.class.getSimpleName(), WatcherScope.GAME);
@ -131,7 +129,7 @@ class TymnaTheWeaverWatcher extends Watcher {
public TymnaTheWeaverWatcher(final TymnaTheWeaverWatcher watcher) {
super(watcher);
for (UUID playerId : watcher.players.keySet()) {
HashSet<UUID> opponents = new HashSet<>();
Set<UUID> opponents = new HashSet<>();
opponents.addAll(watcher.players.get(playerId));
players.put(playerId, opponents);
}

View file

@ -27,10 +27,6 @@
*/
package mage.cards.u;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.UUID;
import mage.MageObject;
import mage.MageObjectReference;
import mage.abilities.Ability;
@ -40,17 +36,14 @@ import mage.abilities.effects.ReplacementEffectImpl;
import mage.cards.Card;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.AsThoughEffectType;
import mage.constants.CardType;
import mage.constants.Duration;
import mage.constants.Outcome;
import mage.constants.WatcherScope;
import mage.constants.Zone;
import mage.constants.*;
import mage.game.Game;
import mage.game.events.GameEvent;
import mage.players.Player;
import mage.watchers.Watcher;
import java.util.*;
/**
*
* @author LevelX2
@ -162,7 +155,7 @@ class UbaMaskPlayEffect extends AsThoughEffectImpl {
class UbaMaskExiledCardsWatcher extends Watcher {
private final HashMap<UUID, List<MageObjectReference>> exiledCards = new HashMap<>();
private final Map<UUID, List<MageObjectReference>> exiledCards = new HashMap<>();
public UbaMaskExiledCardsWatcher() {
super(UbaMaskExiledCardsWatcher.class.getSimpleName(), WatcherScope.GAME);

View file

@ -27,8 +27,6 @@
*/
package mage.cards.u;
import java.util.ArrayList;
import java.util.UUID;
import mage.MageObject;
import mage.abilities.ActivatedAbilityImpl;
import mage.abilities.costs.common.SacrificeSourceCost;
@ -46,6 +44,10 @@ import mage.filter.predicate.mageobject.SubtypePredicate;
import mage.filter.predicate.mageobject.SupertypePredicate;
import mage.target.common.TargetCardInLibrary;
import java.util.ArrayList;
import java.util.List;
import java.util.UUID;
/**
*
* @author Styxo
@ -84,7 +86,7 @@ public class UnderworldSlums extends CardImpl {
addCost(new SacrificeSourceCost());
FilterCard filter = new FilterCard("basic Swamp, Mountain or Forest");
filter.add(new CardTypePredicate(CardType.LAND));
ArrayList<Predicate<MageObject>> subtypePredicates = new ArrayList<>();
List<Predicate<MageObject>> subtypePredicates = new ArrayList<>();
subtypePredicates.add(new SubtypePredicate(SubType.SWAMP));
subtypePredicates.add(new SubtypePredicate(SubType.MOUNTAIN));
subtypePredicates.add(new SubtypePredicate(SubType.FOREST));

View file

@ -27,8 +27,6 @@
*/
package mage.cards.u;
import java.util.ArrayList;
import java.util.UUID;
import mage.abilities.Ability;
import mage.abilities.common.ZoneChangeAllTriggeredAbility;
import mage.abilities.costs.Cost;
@ -46,6 +44,10 @@ import mage.game.Game;
import mage.game.events.GameEvent;
import mage.watchers.Watcher;
import java.util.ArrayList;
import java.util.List;
import java.util.UUID;
/**
*
* @author MarcoMarin
@ -95,7 +97,7 @@ class UrzasMiterDoIfCostPaid extends DoIfCostPaid {
class UrzasMiterWatcher extends Watcher {
ArrayList<UUID> cards;
List<UUID> cards;
public UrzasMiterWatcher() {
super(UrzasMiterWatcher.class.getSimpleName(), WatcherScope.PLAYER);

View file

@ -27,8 +27,6 @@
*/
package mage.cards.v;
import java.util.HashMap;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.costs.mana.ManaCostsImpl;
@ -51,6 +49,10 @@ import mage.game.permanent.token.EldraziScionToken;
import mage.players.Player;
import mage.watchers.Watcher;
import java.util.HashMap;
import java.util.Map;
import java.util.UUID;
/**
* @author LevelX2
*/
@ -117,7 +119,7 @@ class VileRedeemerEffect extends OneShotEffect {
class VileRedeemerNonTokenCreaturesDiedWatcher extends Watcher {
private final HashMap<UUID, Integer> amountOfCreaturesThatDied = new HashMap<>();
private final Map<UUID, Integer> amountOfCreaturesThatDied = new HashMap<>();
public VileRedeemerNonTokenCreaturesDiedWatcher() {
super(VileRedeemerNonTokenCreaturesDiedWatcher.class.getSimpleName(), WatcherScope.GAME);

View file

@ -27,8 +27,6 @@
*/
package mage.cards.v;
import java.util.ArrayList;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.common.EntersBattlefieldTriggeredAbility;
@ -46,6 +44,9 @@ import mage.game.Game;
import mage.game.permanent.Permanent;
import mage.target.common.TargetCreatureOrPlayer;
import java.util.List;
import java.util.UUID;
/**
*
* @author LevelX2
@ -93,7 +94,7 @@ class TwiceDevouredGoblins implements DynamicValue {
if (abilityEffect instanceof DevourEffect) {
DevourEffect devourEffect = (DevourEffect) abilityEffect;
int amountGoblins = 0;
for (ArrayList<String> subtypesItem :devourEffect.getSubtypes(game, sourcePermanent.getId())) {
for (List<String> subtypesItem :devourEffect.getSubtypes(game, sourcePermanent.getId())) {
if (subtypesItem.contains("Goblin")) {
++amountGoblins;
}

View file

@ -27,8 +27,6 @@
*/
package mage.cards.w;
import java.util.ArrayList;
import java.util.UUID;
import mage.abilities.Ability;
import mage.abilities.DelayedTriggeredAbility;
import mage.abilities.SpellAbility;
@ -53,6 +51,10 @@ import mage.players.Player;
import mage.target.common.TargetCardInYourGraveyard;
import mage.target.targetpointer.FixedTargets;
import java.util.ArrayList;
import java.util.List;
import java.util.UUID;
/**
*
* @author LevelX2
@ -111,7 +113,7 @@ class WakeTheDeadReturnFromGraveyardToBattlefieldTargetEffect extends OneShotEff
if (controller != null) {
Cards cards = new CardsImpl(getTargetPointer().getTargets(game, source));
controller.moveCards(cards, Zone.BATTLEFIELD, source, game);
ArrayList<Permanent> toSacrifice = new ArrayList<>(cards.size());
List<Permanent> toSacrifice = new ArrayList<>(cards.size());
for (UUID targetId : cards) {
Permanent creature = game.getPermanent(targetId);
if (creature != null) {

View file

@ -27,8 +27,6 @@
*/
package mage.cards.w;
import java.util.ArrayList;
import java.util.UUID;
import mage.abilities.Ability;
import mage.abilities.common.EntersBattlefieldTriggeredAbility;
import mage.abilities.common.SimpleStaticAbility;
@ -44,6 +42,10 @@ import mage.game.Game;
import mage.game.permanent.Permanent;
import mage.players.Player;
import java.util.ArrayList;
import java.util.List;
import java.util.UUID;
/**
*
* @author BetaSteward
@ -86,7 +88,7 @@ class WitchbaneOrbEffect extends OneShotEffect {
public boolean apply(Game game, Ability source) {
Player controller = game.getPlayer(source.getControllerId());
if (controller != null) {
ArrayList<Permanent> toDestroy = new ArrayList<>();
List<Permanent> toDestroy = new ArrayList<>();
for (UUID attachmentId : controller.getAttachments()) {
Permanent attachment = game.getPermanent(attachmentId);
if (attachment != null && attachment.getSubtype(game).contains("Curse")) {

View file

@ -27,11 +27,6 @@
*/
package mage.cards.w;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.LinkedHashSet;
import java.util.List;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.common.BeginningOfUpkeepTriggeredAbility;
@ -52,6 +47,8 @@ import mage.players.Player;
import mage.target.TargetPermanent;
import mage.target.common.TargetControlledPermanent;
import java.util.*;
/**
*
* @author jeffwadsworth
@ -82,7 +79,7 @@ public class WorldQueller extends CardImpl {
class WorldQuellerEffect extends OneShotEffect {
private static final HashSet<String> choice = new LinkedHashSet<>();
private static final Set<String> choice = new LinkedHashSet<>();
static {
choice.add(CardType.ARTIFACT.toString());

View file

@ -1,9 +1,10 @@
package mage.constants;
import mage.util.SubTypeList;
import java.util.Arrays;
import java.util.Set;
import java.util.stream.Collectors;
import mage.util.SubTypeList;
public enum SubType {
@ -427,8 +428,8 @@ public enum SubType {
return subTypes;
}
public static Set<String> getBasicLands(boolean customSet) {
return Arrays.stream(values()).filter(s -> s.customSet == customSet).filter(p -> p.getSubTypeSet() == SubTypeSet.BasicLandType).map(SubType::getDescription).collect(Collectors.toSet());
public static Set<SubType> getBasicLands(boolean customSet) {
return Arrays.stream(values()).filter(s -> s.customSet == customSet).filter(p -> p.getSubTypeSet() == SubTypeSet.BasicLandType).collect(Collectors.toSet());
}
public static SubTypeList getLandTypes(boolean customSet) {

View file

@ -7,9 +7,12 @@ package mage.filter;
import mage.constants.CardType;
import mage.constants.SubType;
import mage.constants.SuperType;
import mage.filter.common.*;
import mage.filter.predicate.Predicates;
import mage.filter.predicate.mageobject.CardTypePredicate;
import mage.filter.predicate.mageobject.SubtypePredicate;
import mage.filter.predicate.mageobject.SupertypePredicate;
import mage.filter.predicate.permanent.AnotherPredicate;
import mage.filter.predicate.permanent.AttackingPredicate;
import mage.filter.predicate.permanent.TokenPredicate;
@ -64,6 +67,26 @@ public final class StaticFilters {
public static final FilterPermanent FILTER_ATTACKING_CREATURES = new FilterCreaturePermanent("attacking creatures");
public static final FilterPermanent FILTER_AURA = new FilterPermanent();
public static final FilterPermanent FILTER_EQUIPMENT = new FilterPermanent();
public static final FilterPermanent FILTER_FORTIFICATION = new FilterPermanent();
public static final FilterPermanent FILTER_LEGENDARY = new FilterPermanent();
static {
FILTER_AURA.add(new CardTypePredicate(CardType.ENCHANTMENT));
FILTER_AURA.add(new SubtypePredicate(SubType.AURA));
FILTER_EQUIPMENT.add(new CardTypePredicate(CardType.ARTIFACT));
FILTER_EQUIPMENT.add(new SubtypePredicate(SubType.EQUIPMENT));
FILTER_FORTIFICATION.add(new CardTypePredicate(CardType.ARTIFACT));
FILTER_FORTIFICATION.add(new SubtypePredicate(SubType.FORTIFICATION));
FILTER_LEGENDARY.add(new SupertypePredicate(SuperType.LEGENDARY));
}
static {
FILTER_CONTROLLED_PERMANENT_NON_LAND.add(
Predicates.not(new CardTypePredicate(CardType.LAND)));

View file

@ -54,9 +54,9 @@ import mage.designations.Monarch;
import mage.filter.Filter;
import mage.filter.FilterCard;
import mage.filter.FilterPermanent;
import mage.filter.StaticFilters;
import mage.filter.common.FilterControlledCreaturePermanent;
import mage.filter.common.FilterPlaneswalkerPermanent;
import mage.filter.predicate.mageobject.CardTypePredicate;
import mage.filter.predicate.mageobject.NamePredicate;
import mage.filter.predicate.mageobject.SubtypePredicate;
import mage.filter.predicate.mageobject.SupertypePredicate;
@ -103,24 +103,6 @@ public abstract class GameImpl implements Game, Serializable {
private static final Logger logger = Logger.getLogger(GameImpl.class);
private static final FilterPermanent FILTER_AURA = new FilterPermanent();
private static final FilterPermanent FILTER_EQUIPMENT = new FilterPermanent();
private static final FilterPermanent FILTER_FORTIFICATION = new FilterPermanent();
private static final FilterPermanent FILTER_LEGENDARY = new FilterPermanent();
static {
FILTER_AURA.add(new CardTypePredicate(CardType.ENCHANTMENT));
FILTER_AURA.add(new SubtypePredicate(SubType.AURA));
FILTER_EQUIPMENT.add(new CardTypePredicate(CardType.ARTIFACT));
FILTER_EQUIPMENT.add(new SubtypePredicate(SubType.EQUIPMENT));
FILTER_FORTIFICATION.add(new CardTypePredicate(CardType.ARTIFACT));
FILTER_FORTIFICATION.add(new SubtypePredicate(SubType.FORTIFICATION));
FILTER_LEGENDARY.add(new SupertypePredicate(SuperType.LEGENDARY));
}
private transient Object customData;
protected boolean simulation = false;
@ -1784,7 +1766,7 @@ public abstract class GameImpl implements Game, Serializable {
if (perm.isWorld()) {
worldEnchantment.add(perm);
}
if (FILTER_AURA.match(perm, this)) {
if (StaticFilters.FILTER_AURA.match(perm, this)) {
//20091005 - 704.5n, 702.14c
if (perm.getAttachedTo() == null) {
Card card = this.getCard(perm.getId());
@ -1862,10 +1844,10 @@ public abstract class GameImpl implements Game, Serializable {
}
}
}
if (this.getState().isLegendaryRuleActive() && FILTER_LEGENDARY.match(perm, this)) {
if (this.getState().isLegendaryRuleActive() && StaticFilters.FILTER_LEGENDARY.match(perm, this)) {
legendary.add(perm);
}
if (FILTER_EQUIPMENT.match(perm, this)) {
if (StaticFilters.FILTER_EQUIPMENT.match(perm, this)) {
//20091005 - 704.5p, 702.14d
if (perm.getAttachedTo() != null) {
Permanent attachedTo = getPermanent(perm.getAttachedTo());
@ -1890,7 +1872,7 @@ public abstract class GameImpl implements Game, Serializable {
}
}
}
if (FILTER_FORTIFICATION.match(perm, this)) {
if (StaticFilters.FILTER_FORTIFICATION.match(perm, this)) {
if (perm.getAttachedTo() != null) {
Permanent land = getPermanent(perm.getAttachedTo());
if (land == null || !land.getAttachments().contains(perm.getId())) {