mirror of
https://github.com/magefree/mage.git
synced 2025-12-25 13:02:06 -08:00
code style: eliminate unnecessary static imports (#10585)
* SacrificeTargetCost(StaticFilters) * remove import static mage.constants.Outcome * remove import static mage.constants.Duration * remove other import static * a few more sacrifice filters * simpler constructors * remove import static mage.filter * remove a few more import static
This commit is contained in:
parent
f6fdcb9d59
commit
0fa971514a
259 changed files with 499 additions and 622 deletions
|
|
@ -6,7 +6,6 @@ import mage.abilities.effects.OneShotEffect;
|
|||
import mage.abilities.effects.common.continuous.GainControlTargetEffect;
|
||||
import mage.constants.Duration;
|
||||
import mage.constants.Outcome;
|
||||
import static mage.constants.Outcome.Benefit;
|
||||
import mage.game.Game;
|
||||
import mage.game.permanent.Permanent;
|
||||
import mage.players.Player;
|
||||
|
|
@ -22,7 +21,7 @@ import mage.target.targetpointer.FixedTarget;
|
|||
public class EntersBattlefieldUnderControlOfOpponentOfChoiceEffect extends OneShotEffect {
|
||||
|
||||
public EntersBattlefieldUnderControlOfOpponentOfChoiceEffect() {
|
||||
super(Benefit);
|
||||
super(Outcome.Benefit);
|
||||
staticText = "under the control of an opponent of your choice";
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -5,7 +5,6 @@ import mage.abilities.Ability;
|
|||
import mage.abilities.Mode;
|
||||
import mage.abilities.effects.PreventionEffectImpl;
|
||||
import mage.constants.Duration;
|
||||
import static mage.constants.Duration.EndOfTurn;
|
||||
import mage.game.Game;
|
||||
import mage.game.events.GameEvent;
|
||||
|
||||
|
|
@ -61,7 +60,7 @@ public class PreventDamageToSourceEffect extends PreventionEffectImpl {
|
|||
sb.append("Prevent the next ").append(amountToPrevent).append(" damage that would be dealt to ");
|
||||
}
|
||||
sb.append("{this} ");
|
||||
if (duration == EndOfTurn) {
|
||||
if (duration == Duration.EndOfTurn) {
|
||||
sb.append("this turn");
|
||||
} else {
|
||||
sb.append(duration.toString());
|
||||
|
|
|
|||
|
|
@ -8,8 +8,6 @@ import mage.filter.common.FilterCreaturePermanent;
|
|||
import mage.game.Game;
|
||||
import mage.game.permanent.Permanent;
|
||||
|
||||
import static mage.constants.Duration.EndOfTurn;
|
||||
|
||||
/**
|
||||
* @author LevelX2
|
||||
*/
|
||||
|
|
@ -50,7 +48,7 @@ public class CantBeBlockedByAllTargetEffect extends RestrictionEffect {
|
|||
return "target "
|
||||
+ mode.getTargets().get(0).getTargetName()
|
||||
+ " can't be blocked "
|
||||
+ (duration == EndOfTurn ? "this turn " : "")
|
||||
+ (duration == Duration.EndOfTurn ? "this turn " : "")
|
||||
+ (filterBlockedBy.getMessage().startsWith("except by") ? "" : "by ")
|
||||
+ filterBlockedBy.getMessage();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -9,8 +9,6 @@ import mage.game.Game;
|
|||
import mage.game.permanent.Permanent;
|
||||
import mage.target.targetpointer.FixedTarget;
|
||||
|
||||
import static mage.constants.Duration.EndOfTurn;
|
||||
|
||||
/**
|
||||
* @author North
|
||||
*/
|
||||
|
|
@ -35,7 +33,7 @@ public class CantBlockAttachedEffect extends RestrictionEffect {
|
|||
if (!filter.getMessage().equals("creature")) {
|
||||
sb.append(' ').append(filter.getMessage());
|
||||
}
|
||||
if (duration == EndOfTurn) {
|
||||
if (duration == Duration.EndOfTurn) {
|
||||
sb.append(" this turn");
|
||||
} else if (!duration.toString().isEmpty()) {
|
||||
sb.append(' ').append(duration.toString());
|
||||
|
|
|
|||
|
|
@ -4,7 +4,6 @@ package mage.abilities.keyword;
|
|||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.SimpleStaticAbility;
|
||||
import mage.abilities.effects.ContinuousEffectImpl;
|
||||
import static mage.abilities.keyword.AscendAbility.ASCEND_RULE;
|
||||
import mage.constants.Duration;
|
||||
import mage.constants.Layer;
|
||||
import mage.constants.Outcome;
|
||||
|
|
@ -70,7 +69,7 @@ class AscendContinuousEffect extends ContinuousEffectImpl {
|
|||
|
||||
public AscendContinuousEffect() {
|
||||
super(Duration.WhileOnBattlefield, Layer.PlayerEffects, SubLayer.NA, Outcome.Benefit);
|
||||
staticText = ASCEND_RULE;
|
||||
staticText = AscendAbility.ASCEND_RULE;
|
||||
}
|
||||
|
||||
public AscendContinuousEffect(final AscendContinuousEffect effect) {
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@ import mage.constants.Zone;
|
|||
import mage.game.command.Emblem;
|
||||
import mage.target.common.TargetControlledCreaturePermanent;
|
||||
|
||||
import static mage.filter.StaticFilters.FILTER_CONTROLLED_CREATURE_SHORT_TEXT;
|
||||
import mage.filter.StaticFilters;
|
||||
|
||||
/**
|
||||
* @author spjspj
|
||||
|
|
@ -27,7 +27,7 @@ public final class ObNixilisOfTheBlackOathEmblem extends Emblem {
|
|||
Effect effect = new GainLifeEffect(xValue);
|
||||
effect.setText("You gain X life");
|
||||
Ability ability = new SimpleActivatedAbility(Zone.COMMAND, effect, new ManaCostsImpl<>("{1}{B}"));
|
||||
ability.addCost(new SacrificeTargetCost(new TargetControlledCreaturePermanent(FILTER_CONTROLLED_CREATURE_SHORT_TEXT)));
|
||||
ability.addCost(new SacrificeTargetCost(StaticFilters.FILTER_CONTROLLED_CREATURE_SHORT_TEXT));
|
||||
effect = new DrawCardSourceControllerEffect(xValue);
|
||||
effect.setText("and draw X cards, where X is the sacrificed creature's power");
|
||||
ability.addEffect(effect);
|
||||
|
|
|
|||
|
|
@ -9,11 +9,10 @@ import mage.constants.CardType;
|
|||
import mage.constants.Duration;
|
||||
import mage.constants.TargetController;
|
||||
import mage.constants.Zone;
|
||||
import mage.filter.StaticFilters;
|
||||
import mage.game.command.Emblem;
|
||||
import mage.target.TargetPermanent;
|
||||
|
||||
import static mage.filter.StaticFilters.FILTER_CONTROLLED_PERMANENT_ARTIFACT;
|
||||
|
||||
/**
|
||||
* @author spjspj
|
||||
*/
|
||||
|
|
@ -28,7 +27,7 @@ public final class TezzeretTheSchemerEmblem extends Emblem {
|
|||
effect = new SetBasePowerToughnessTargetEffect(5, 5, Duration.EndOfGame);
|
||||
effect.setText("with base power and toughness 5/5");
|
||||
ability.addEffect(effect);
|
||||
ability.addTarget(new TargetPermanent(FILTER_CONTROLLED_PERMANENT_ARTIFACT));
|
||||
ability.addTarget(new TargetPermanent(StaticFilters.FILTER_CONTROLLED_PERMANENT_ARTIFACT));
|
||||
this.getAbilities().add(ability);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -2,7 +2,6 @@
|
|||
package mage.target.common;
|
||||
|
||||
import mage.filter.StaticFilters;
|
||||
import static mage.filter.StaticFilters.FILTER_PERMANENT_CREATURE;
|
||||
import mage.filter.common.FilterCreaturePermanent;
|
||||
import mage.target.TargetPermanent;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue