style fixes

filters should be declared `private static final`
This commit is contained in:
xenohedron 2025-06-21 18:45:24 -04:00
parent a935045e1f
commit 78e1ef6271
21 changed files with 66 additions and 47 deletions

View file

@ -25,8 +25,10 @@ import java.util.UUID;
* @author TheElk801
*/
public final class BladegriffPrototype extends CardImpl {
static FilterNonlandPermanent filter = new FilterNonlandPermanent("nonland permanent of that player's choice that one of your opponents controls");
static{
private static final FilterNonlandPermanent filter = new FilterNonlandPermanent("nonland permanent of that player's choice that one of your opponents controls");
static {
filter.add(BladegriffSourceOpponentControlsPredicate.instance);
}
@ -56,8 +58,10 @@ public final class BladegriffPrototype extends CardImpl {
return new BladegriffPrototype(this);
}
}
enum BladegriffSourceOpponentControlsPredicate implements ObjectSourcePlayerPredicate<Controllable> {
instance;
@Override
public boolean apply(ObjectSourcePlayer<Controllable> input, Game game) {
Controllable object = input.getObject();

View file

@ -30,7 +30,8 @@ import java.util.UUID;
* @author jeffwadsworth
*/
public final class DiseasedVermin extends CardImpl {
static final FilterOpponent filter = new FilterOpponent("player previously dealt damage by {this}");
private static final FilterOpponent filter = new FilterOpponent("player previously dealt damage by {this}");
static {
filter.add(new DiseasedVerminPredicate());

View file

@ -20,11 +20,11 @@ import mage.target.targetpointer.FirstTargetPointer;
import java.util.UUID;
/**
*
* @author LevelX2
*/
public final class HarnessTheStorm extends CardImpl {
static FilterCard filter = new FilterCard("card with the same name as that spell from your graveyard");
private static final FilterCard filter = new FilterCard("card with the same name as that spell from your graveyard");
public HarnessTheStorm(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{2}{R}");
@ -50,8 +50,10 @@ public final class HarnessTheStorm extends CardImpl {
}
}
enum HarnessTheStormAdjuster implements TargetAdjuster {
instance;
@Override
public void adjustTargets(Ability ability, Game game) {
UUID spellId = ability.getEffects().get(0).getTargetPointer().getFirst(game, ability);
@ -59,10 +61,10 @@ enum HarnessTheStormAdjuster implements TargetAdjuster {
ability.getAllEffects().setTargetPointer(new FirstTargetPointer());
Spell spell = game.getSpellOrLKIStack(spellId);
if (spell == null){
if (spell == null) {
return;
}
FilterCard filter = new FilterCard("a card named " + spell.getName() + " in your graveyard");
FilterCard filter = new FilterCard("a card named " + spell.getName() + " in your graveyard");
filter.add(new NamePredicate(spell.getName()));
ability.addTarget(new TargetCardInYourGraveyard(filter));
}

View file

@ -1,4 +1,3 @@
package mage.cards.m;
import mage.MageInt;
@ -17,20 +16,20 @@ import mage.constants.SetTargetPointer;
import mage.constants.SubType;
import mage.filter.common.FilterCreaturePermanent;
import mage.target.TargetPermanent;
import mage.target.common.TargetCreaturePermanent;
import mage.target.targetadjustment.ThatPlayerControlsTargetAdjuster;
import java.util.UUID;
/**
*
* @author fireshoes
*/
public final class MageRingResponder extends CardImpl {
private static final FilterCreaturePermanent filter
= new FilterCreaturePermanent("creature defending player controls");
public MageRingResponder(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.ARTIFACT,CardType.CREATURE},"{7}");
super(ownerId, setInfo, new CardType[]{CardType.ARTIFACT, CardType.CREATURE}, "{7}");
this.subtype.add(SubType.GOLEM);
this.power = new MageInt(7);
this.toughness = new MageInt(7);

View file

@ -1,4 +1,3 @@
package mage.cards.m;
import mage.MageInt;
@ -22,14 +21,14 @@ import mage.target.targetpointer.FirstTargetPointer;
import java.util.UUID;
/**
*
* @author escplan9 (Derek Monturo - dmontur1 at gmail dot com)
*/
public final class MagusOfTheAbyss extends CardImpl {
static FilterPermanent filter = new FilterPermanent("nonartifact creature that player controls of their choice");
private static final FilterPermanent filter = new FilterPermanent("nonartifact creature that player controls of their choice");
public MagusOfTheAbyss(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{3}{B}");
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{3}{B}");
this.subtype.add(SubType.HUMAN);
this.subtype.add(SubType.WIZARD);
this.power = new MageInt(4);
@ -55,12 +54,15 @@ public final class MagusOfTheAbyss extends CardImpl {
enum MagusOfTheAbyssTargetAdjuster implements TargetAdjuster {
instance;
private static final FilterPermanent filter
= new FilterPermanent("nonartifact creature that player controls of their choice");
static {
filter.add(Predicates.not(CardType.ARTIFACT.getPredicate()));
filter.add(CardType.CREATURE.getPredicate());
}
@Override
public void adjustTargets(Ability ability, Game game) {
UUID opponentId = ability.getEffects().get(0).getTargetPointer().getFirst(game, ability);

View file

@ -1,4 +1,3 @@
package mage.cards.m;
import mage.MageInt;
@ -21,11 +20,11 @@ import mage.target.targetadjustment.TargetAdjuster;
import java.util.UUID;
/**
*
* @author LevelX2
*/
public final class MausoleumTurnkey extends CardImpl {
static FilterCreatureCard filter = new FilterCreatureCard("creature card of an opponent's choice");
private static final FilterCreatureCard filter = new FilterCreatureCard("creature card of an opponent's choice");
public MausoleumTurnkey(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{3}{B}");

View file

@ -1,4 +1,3 @@
package mage.cards.n;
import mage.MageInt;
@ -20,14 +19,14 @@ import mage.target.targetadjustment.ThatPlayerControlsTargetAdjuster;
import java.util.UUID;
/**
*
* @author MarcoMarin
*/
public final class Necrite extends CardImpl {
static FilterPermanent filter = new FilterCreaturePermanent("creature defending player controls");
private static final FilterPermanent filter = new FilterCreaturePermanent("creature defending player controls");
public Necrite(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{1}{B}{B}");
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{1}{B}{B}");
this.subtype.add(SubType.THRULL);
this.power = new MageInt(2);
this.toughness = new MageInt(2);

View file

@ -24,7 +24,8 @@ import java.util.UUID;
* @author Xanderhall
*/
public final class NeyamShaiMurad extends CardImpl {
FilterCard filter = new FilterPermanentCard("permanent card from their graveyard");
private static final FilterCard filter = new FilterPermanentCard("permanent card from their graveyard");
public NeyamShaiMurad(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{2}{W}{B}");

View file

@ -29,7 +29,8 @@ import java.util.*;
* @author TheElk801
*/
public final class OKagachiVengefulKami extends CardImpl {
static FilterPermanent filter = new FilterNonlandPermanent("nonland permanent that player controls");
private static final FilterPermanent filter = new FilterNonlandPermanent("nonland permanent that player controls");
public OKagachiVengefulKami(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{1}{W}{U}{B}{R}{G}");

View file

@ -27,8 +27,9 @@ import java.util.UUID;
* @author TheElk801
*/
public final class OrahSkyclaveHierophant extends CardImpl {
static FilterPermanent filterTrigger = new FilterControlledPermanent("Cleric you control");
static FilterCard filterTarget = new FilterCard("Cleric card with lesser mana value");
private static final FilterPermanent filterTrigger = new FilterControlledPermanent("Cleric you control");
private static final FilterCard filterTarget = new FilterCard("Cleric card with lesser mana value");
static {
filterTrigger.add(SubType.CLERIC.getPredicate());
filterTarget.add(SubType.CLERIC.getPredicate());

View file

@ -23,7 +23,8 @@ import java.util.UUID;
* @author Susucr
*/
public final class RampagingWarMammoth extends CardImpl {
static FilterPermanent filter = new FilterArtifactPermanent("up to X target artifacts");
private static final FilterPermanent filter = new FilterArtifactPermanent("up to X target artifacts");
public RampagingWarMammoth(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{5}{R}{R}");

View file

@ -25,8 +25,10 @@ import java.util.UUID;
* @author LevelX2
*/
public final class RelentlessDead extends CardImpl {
static FilterCard filter = new FilterCreatureCard("another target Zombie creature card with mana value X from your graveyard"); // This target defines X
static{
private static final FilterCard filter = new FilterCreatureCard("another target Zombie creature card with mana value X from your graveyard"); // This target defines X
static {
filter.add(SubType.ZOMBIE.getPredicate());
filter.add(AnotherPredicate.instance);
}

View file

@ -23,8 +23,9 @@ import java.util.UUID;
* @author spjspj
*/
public final class ScalelordReckoner extends CardImpl {
static FilterPermanent filterDragon = new FilterControlledPermanent(SubType.DRAGON, "a Dragon you control");
static FilterPermanent filterTarget = new FilterNonlandPermanent("nonland permanent that player controls");
private static final FilterPermanent filterDragon = new FilterControlledPermanent(SubType.DRAGON, "a Dragon you control");
private static final FilterPermanent filterTarget = new FilterNonlandPermanent("nonland permanent that player controls");
public ScalelordReckoner(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{3}{W}{W}");

View file

@ -26,7 +26,7 @@ import java.util.UUID;
*/
public final class SkymarkRoc extends CardImpl {
static FilterPermanent filter = new FilterCreaturePermanent("creature defending player controls with toughness 2 or less");
private static final FilterPermanent filter = new FilterCreaturePermanent("creature defending player controls with toughness 2 or less");
static {
filter.add(new ToughnessPredicate(ComparisonType.OR_LESS, 2));

View file

@ -18,13 +18,14 @@ import mage.target.targetadjustment.ThatPlayerControlsTargetAdjuster;
import java.util.UUID;
/**
*
* @author jeffwadsworth
*/
public final class SoltariVisionary extends CardImpl {
static FilterPermanent filter = new FilterEnchantmentPermanent("enchantment that player controls");
private static final FilterPermanent filter = new FilterEnchantmentPermanent("enchantment that player controls");
public SoltariVisionary(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{1}{W}{W}");
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{1}{W}{W}");
this.subtype.add(SubType.SOLTARI);
this.subtype.add(SubType.CLERIC);

View file

@ -1,4 +1,3 @@
package mage.cards.t;
import mage.abilities.Ability;
@ -22,14 +21,14 @@ import mage.target.targetpointer.FirstTargetPointer;
import java.util.UUID;
/**
*
* @author emerald000
*/
public final class TheAbyss extends CardImpl {
static FilterPermanent filter = new FilterPermanent("nonartifact creature that player controls of their choice");
private static final FilterPermanent filter = new FilterPermanent("nonartifact creature that player controls of their choice");
public TheAbyss(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.ENCHANTMENT},"{3}{B}");
super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{3}{B}");
this.supertype.add(SuperType.WORLD);
// At the beginning of each player's upkeep, destroy target nonartifact creature that player controls of their choice. It can't be regenerated.
@ -52,11 +51,13 @@ public final class TheAbyss extends CardImpl {
enum TheAbyssTargetAdjuster implements TargetAdjuster {
instance;
private static final FilterPermanent filter
= new FilterCreaturePermanent("nonartifact creature that player controls of their choice");
static {
filter.add(Predicates.not(CardType.ARTIFACT.getPredicate()));
}
@Override
public void adjustTargets(Ability ability, Game game) {
UUID playerId = ability.getEffects().get(0).getTargetPointer().getFirst(game, ability);

View file

@ -32,6 +32,7 @@ import java.util.UUID;
* @author Grath
*/
public final class TheLordOfPain extends CardImpl {
private static final FilterSpell filter = new FilterSpell("their first spell each turn");
static {

View file

@ -24,7 +24,8 @@ import java.util.UUID;
* @author TheElk801
*/
public final class VenerableWarsinger extends CardImpl {
FilterCard filter = new FilterCreatureCard("creature card with mana value X or less from your graveyard");
private static final FilterCard filter = new FilterCreatureCard("creature card with mana value X or less from your graveyard");
public VenerableWarsinger(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{1}{R}{W}");

View file

@ -24,7 +24,8 @@ import java.util.UUID;
* @author TheElk801
*/
public final class WebstrikeElite extends CardImpl {
FilterPermanent filter = new FilterArtifactOrEnchantmentPermanent("artifact or enchantment with mana value X");
private static final FilterPermanent filter = new FilterArtifactOrEnchantmentPermanent("artifact or enchantment with mana value X");
public WebstrikeElite(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{G}{G}");

View file

@ -10,12 +10,12 @@ import mage.game.Game;
* @author stravant
*/
public class EffectKeyValue implements DynamicValue {
private final String key;
private final String description;
public EffectKeyValue(String key) {
this.key = key;
this.description = key;
this(key, key);
}
public EffectKeyValue(String key, String description) {
@ -25,11 +25,11 @@ public class EffectKeyValue implements DynamicValue {
@Override
public int calculate(Game game, Ability sourceAbility, Effect effect) {
return (Integer)effect.getValue(key);
return (Integer) effect.getValue(key);
}
@Override
public EffectKeyValue copy(){
public EffectKeyValue copy() {
return new EffectKeyValue(this.key, this.description);
}

View file

@ -9,10 +9,11 @@ import mage.game.Game;
*
* @author notgreat
*/
public enum DefineByTriggerTargetAdjuster implements TargetAdjuster{
public enum DefineByTriggerTargetAdjuster implements TargetAdjuster {
instance;
@Override
public void adjustTargets(Ability ability, Game game){
public void adjustTargets(Ability ability, Game game) {
//Do nothing
}
}