mirror of
https://github.com/correl/mage.git
synced 2024-11-15 03:00:16 +00:00
couple of Sonar fixes
This commit is contained in:
parent
39fc9fbc59
commit
f2c64629a5
8 changed files with 20 additions and 25 deletions
|
@ -16,7 +16,7 @@ import java.util.*;
|
|||
*/
|
||||
public final class ConstructedFormats {
|
||||
|
||||
public static final String ALL = "- All Sets";
|
||||
public static final String ALL_SETS = "- All Sets";
|
||||
public static final String STANDARD = "- Standard";
|
||||
public static final String EXTENDED = "- Extended";
|
||||
public static final String FRONTIER = "- Frontier";
|
||||
|
@ -65,7 +65,7 @@ public final class ConstructedFormats {
|
|||
}
|
||||
|
||||
public static List<String> getSetsByFormat(final String format) {
|
||||
if (!format.equals(ALL)) {
|
||||
if (!format.equals(ALL_SETS)) {
|
||||
return underlyingSetCodesPerFormat.get(format);
|
||||
}
|
||||
return all;
|
||||
|
@ -244,7 +244,7 @@ public final class ConstructedFormats {
|
|||
formats.add(0, EXTENDED);
|
||||
formats.add(0, STANDARD);
|
||||
}
|
||||
formats.add(0, ALL);
|
||||
formats.add(0, ALL_SETS);
|
||||
}
|
||||
|
||||
private static String getBlockDisplayName(String blockName) {
|
||||
|
|
|
@ -49,7 +49,7 @@ public final class GrothamaAllDevouring extends CardImpl {
|
|||
this.addAbility(new LeavesBattlefieldTriggeredAbility(new GrothamaAllDevouringDrawCardsEffect(), false), new GrothamaAllDevouringWatcher());
|
||||
}
|
||||
|
||||
public GrothamaAllDevouring(final GrothamaAllDevouring card) {
|
||||
private GrothamaAllDevouring(final GrothamaAllDevouring card) {
|
||||
super(card);
|
||||
}
|
||||
|
||||
|
@ -61,16 +61,16 @@ public final class GrothamaAllDevouring extends CardImpl {
|
|||
|
||||
class GrothamaAllDevouringGainAbilityEffect extends GainAbilityAllEffect {
|
||||
|
||||
private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("other creatures");
|
||||
private static final FilterCreaturePermanent otherCreatureFilter = new FilterCreaturePermanent("other creatures");
|
||||
|
||||
static {
|
||||
filter.add(AnotherPredicate.instance);
|
||||
otherCreatureFilter.add(AnotherPredicate.instance);
|
||||
}
|
||||
|
||||
GrothamaAllDevouringGainAbilityEffect() {
|
||||
super(new AttacksTriggeredAbility(
|
||||
new GrothamaAllDevouringFightEffect(null, null), true
|
||||
), Duration.WhileOnBattlefield, filter);
|
||||
), Duration.WhileOnBattlefield, otherCreatureFilter);
|
||||
this.staticText = "Other creatures have \"Whenever this creature attacks, you may have it fight {this}.\"";
|
||||
}
|
||||
|
||||
|
@ -168,7 +168,7 @@ class GrothamaAllDevouringDrawCardsEffect extends OneShotEffect {
|
|||
|
||||
class GrothamaAllDevouringWatcher extends Watcher {
|
||||
|
||||
Map<MageObjectReference, Map<UUID, Integer>> damageMap = new HashMap<>();
|
||||
private Map<MageObjectReference, Map<UUID, Integer>> damageMap = new HashMap<>();
|
||||
|
||||
GrothamaAllDevouringWatcher() {
|
||||
super(GrothamaAllDevouringWatcher.class, WatcherScope.GAME);
|
||||
|
|
|
@ -51,14 +51,14 @@ public final class GuardianProject extends CardImpl {
|
|||
|
||||
class GuardianProjectTriggeredAbility extends EntersBattlefieldAllTriggeredAbility {
|
||||
|
||||
public static final FilterPermanent filter = new FilterControlledCreaturePermanent();
|
||||
public static final FilterPermanent filterNonTokenControlledCreature = new FilterControlledCreaturePermanent();
|
||||
|
||||
static {
|
||||
filter.add(Predicates.not(TokenPredicate.instance));
|
||||
filterNonTokenControlledCreature.add(Predicates.not(TokenPredicate.instance));
|
||||
}
|
||||
|
||||
GuardianProjectTriggeredAbility() {
|
||||
super(new GuardianProjectEffect(null), filter);
|
||||
super(new GuardianProjectEffect(null), filterNonTokenControlledCreature);
|
||||
}
|
||||
|
||||
private GuardianProjectTriggeredAbility(final GuardianProjectTriggeredAbility ability) {
|
||||
|
|
|
@ -68,19 +68,19 @@ public final class MyriadLandscape extends CardImpl {
|
|||
|
||||
class TargetCardInLibrarySharingLandType extends TargetCardInLibrary {
|
||||
|
||||
private static final FilterCard filter = new FilterCard("basic land card");
|
||||
private static final FilterCard filterBasicLandCard = new FilterCard("basic land card");
|
||||
|
||||
static {
|
||||
List<Predicate<MageObject>> subTypePreds = new ArrayList<>();
|
||||
for (SubType landType : SubType.getLandTypes()) {
|
||||
subTypePreds.add(new SubtypePredicate(landType));
|
||||
}
|
||||
filter.add(Predicates.or(subTypePreds));
|
||||
filter.add(new SupertypePredicate(SuperType.BASIC));
|
||||
filterBasicLandCard.add(Predicates.or(subTypePreds));
|
||||
filterBasicLandCard.add(new SupertypePredicate(SuperType.BASIC));
|
||||
}
|
||||
|
||||
public TargetCardInLibrarySharingLandType(int minNumTargets, int maxNumTargets) {
|
||||
super(minNumTargets, maxNumTargets, filter);
|
||||
super(minNumTargets, maxNumTargets, filterBasicLandCard);
|
||||
}
|
||||
|
||||
public TargetCardInLibrarySharingLandType(final TargetCardInLibrarySharingLandType target) {
|
||||
|
|
|
@ -71,7 +71,7 @@ class PainSeerEffect extends OneShotEffect {
|
|||
if (card != null) {
|
||||
Cards cards = new CardsImpl(card);
|
||||
player.revealCards("Pain Seer", cards, game);
|
||||
if (card.moveToZone(Zone.HAND, source.getSourceId(), game, false)) {
|
||||
if(player.moveCards(card, Zone.HAND, source, game)) {
|
||||
player.loseLife(card.getConvertedManaCost(), game, false);
|
||||
return true;
|
||||
}
|
||||
|
|
|
@ -41,13 +41,13 @@ public final class Putrefaction extends CardImpl {
|
|||
|
||||
class PutrefactionTriggeredAbility extends SpellCastAllTriggeredAbility {
|
||||
|
||||
private static final FilterSpell filter = new FilterSpell("green or white spell");
|
||||
private static final FilterSpell filterGreenOrWhiteSpell = new FilterSpell("green or white spell");
|
||||
static {
|
||||
filter.add(Predicates.or(new ColorPredicate(ObjectColor.GREEN), new ColorPredicate(ObjectColor.WHITE)));
|
||||
filterGreenOrWhiteSpell.add(Predicates.or(new ColorPredicate(ObjectColor.GREEN), new ColorPredicate(ObjectColor.WHITE)));
|
||||
}
|
||||
|
||||
public PutrefactionTriggeredAbility() {
|
||||
super(new DiscardTargetEffect(1), filter, false);
|
||||
super(new DiscardTargetEffect(1), filterGreenOrWhiteSpell, false);
|
||||
}
|
||||
|
||||
public PutrefactionTriggeredAbility(PutrefactionTriggeredAbility ability) {
|
||||
|
@ -58,7 +58,7 @@ class PutrefactionTriggeredAbility extends SpellCastAllTriggeredAbility {
|
|||
public boolean checkTrigger(GameEvent event, Game game) {
|
||||
if (event.getType() == GameEvent.EventType.SPELL_CAST) {
|
||||
Spell spell = game.getStack().getSpell(event.getTargetId());
|
||||
if (spell != null && filter.match(spell, getSourceId(), getControllerId(), game)) {
|
||||
if (spell != null && filterGreenOrWhiteSpell.match(spell, getSourceId(), getControllerId(), game)) {
|
||||
this.getEffects().get(0).setTargetPointer(new FixedTarget(event.getPlayerId()));
|
||||
return true;
|
||||
}
|
||||
|
|
|
@ -74,7 +74,6 @@ public final class VraskaTheUnseen extends CardImpl {
|
|||
class VraskaTheUnseenGainAbilityEffect extends ContinuousEffectImpl {
|
||||
|
||||
protected Ability ability;
|
||||
protected int startingTurn;
|
||||
|
||||
public VraskaTheUnseenGainAbilityEffect(Ability ability) {
|
||||
super(Duration.Custom, Layer.AbilityAddingRemovingEffects_6, SubLayer.NA, Outcome.AddAbility);
|
||||
|
|
|
@ -105,10 +105,6 @@
|
|||
</plugin>
|
||||
</plugins>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<finalName>mage</finalName>
|
||||
|
||||
|
||||
|
|
Loading…
Reference in a new issue