removed or replaced various instances of non-static variables in cards

This commit is contained in:
Evan Kranzler 2018-09-29 11:19:34 -04:00
parent 2df976b2f0
commit d28e206a99
8 changed files with 38 additions and 51 deletions

View file

@ -1,7 +1,6 @@
package mage.cards.c;
import java.util.UUID;
import mage.abilities.Ability;
import mage.abilities.common.SimpleActivatedAbility;
import mage.abilities.costs.common.ExileSourceCost;
@ -15,14 +14,13 @@ import mage.constants.CardType;
import mage.constants.Zone;
import mage.target.common.TargetCardInGraveyard;
import java.util.UUID;
/**
*
* @author jeffwadsworth
*/
public final class CrookOfCondemnation extends CardImpl {
private UUID exileId = UUID.randomUUID();
public CrookOfCondemnation(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.ARTIFACT}, "{2}");

View file

@ -29,7 +29,7 @@ import mage.watchers.common.PlayerLostLifeWatcher;
*/
public final class LuminarchAscension extends CardImpl {
private String rule = "At the beginning of each opponent's end step, if you didn't lose life this turn, you may put a quest counter on {this}. (Damage causes loss of life.)";
private static final String rule = "At the beginning of each opponent's end step, if you didn't lose life this turn, you may put a quest counter on {this}. (Damage causes loss of life.)";
public LuminarchAscension(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{1}{W}");

View file

@ -1,7 +1,6 @@
package mage.cards.m;
import java.util.UUID;
import mage.MageInt;
import mage.ObjectColor;
import mage.abilities.Ability;
@ -20,14 +19,13 @@ import mage.filter.FilterSpell;
import mage.filter.predicate.mageobject.ColorPredicate;
import mage.target.TargetPlayer;
import java.util.UUID;
/**
*
* @author jeffwadsworth
*/
public final class MerrowBonegnawer extends CardImpl {
private UUID exileId = UUID.randomUUID();
private static final FilterSpell filter = new FilterSpell("a black spell");
static {
@ -43,7 +41,7 @@ public final class MerrowBonegnawer extends CardImpl {
this.toughness = new MageInt(1);
// {tap}: Target player exiles a card from their graveyard.
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new ExileFromZoneTargetEffect(Zone.GRAVEYARD, exileId, getIdName(), new FilterCard()), new TapSourceCost());
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new ExileFromZoneTargetEffect(Zone.GRAVEYARD, null, getIdName(), new FilterCard()), new TapSourceCost());
ability.addTarget(new TargetPlayer());
this.addAbility(ability);

View file

@ -21,14 +21,13 @@ import mage.util.functions.ApplyToPermanent;
import java.util.UUID;
/**
*
* @author North
*/
public final class PhantasmalImage extends CardImpl {
private static final String effectText = "a copy of any creature on the battlefield, except it's an Illusion in addition to its other types and it has \"When this creature becomes the target of a spell or ability, sacrifice it.\"";
ApplyToPermanent phantasmalImageApplier = new ApplyToPermanent() {
private static final ApplyToPermanent phantasmalImageApplier = new ApplyToPermanent() {
@Override
public boolean apply(Game game, Permanent permanent, Ability source, UUID copyToObjectId) {
if (!permanent.hasSubtype(SubType.ILLUSION, game)) {

View file

@ -1,7 +1,6 @@
package mage.cards.r;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.common.SimpleActivatedAbility;
@ -17,14 +16,13 @@ import mage.constants.SuperType;
import mage.constants.Zone;
import mage.game.permanent.token.RakkaMarElementalToken;
import java.util.UUID;
/**
*
* @author Loki
*/
public final class RakkaMar extends CardImpl {
private RakkaMarElementalToken token = new RakkaMarElementalToken();
public RakkaMar(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{2}{R}{R}");
addSuperType(SuperType.LEGENDARY);
@ -34,7 +32,12 @@ public final class RakkaMar extends CardImpl {
this.power = new MageInt(2);
this.toughness = new MageInt(2);
this.addAbility(HasteAbility.getInstance());
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new CreateTokenEffect(token), new ManaCostsImpl("{R}"));
Ability ability = new SimpleActivatedAbility(
Zone.BATTLEFIELD,
new CreateTokenEffect(new RakkaMarElementalToken()),
new ManaCostsImpl("{R}")
);
ability.addCost(new TapSourceCost());
this.addAbility(ability);
}

View file

@ -1,7 +1,6 @@
package mage.cards.t;
import java.util.UUID;
import mage.abilities.Ability;
import mage.abilities.common.SimpleActivatedAbility;
import mage.abilities.costs.common.SacrificeSourceCost;
@ -16,23 +15,22 @@ import mage.constants.Zone;
import mage.game.Game;
import mage.watchers.common.PlayerLostLifeWatcher;
import java.util.UUID;
/**
*
* @author jeffwadsworth
*/
public final class TaintedSigil extends CardImpl {
String rule = "You gain life equal to the total life lost by all players this turn";
private static final String rule = "You gain life equal to the total life lost by all players this turn";
public TaintedSigil(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.ARTIFACT},"{1}{W}{B}");
super(ownerId, setInfo, new CardType[]{CardType.ARTIFACT}, "{1}{W}{B}");
// {tap}, Sacrifice Tainted Sigil: You gain life equal to the total life lost by all players this turn.
AllPlayersLostLifeCount totalLifeLostThisTurn = new AllPlayersLostLifeCount();
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new GainLifeEffect(totalLifeLostThisTurn, rule), new TapSourceCost());
Ability ability = new SimpleActivatedAbility(
Zone.BATTLEFIELD, new GainLifeEffect(AllPlayersLostLifeCount.instance, rule), new TapSourceCost()
);
ability.addCost(new SacrificeSourceCost());
this.addAbility(ability);
@ -48,7 +46,8 @@ public final class TaintedSigil extends CardImpl {
}
}
class AllPlayersLostLifeCount implements DynamicValue {
enum AllPlayersLostLifeCount implements DynamicValue {
instance;
@Override
public int calculate(Game game, Ability sourceAbility, Effect effect) {
@ -69,7 +68,7 @@ class AllPlayersLostLifeCount implements DynamicValue {
@Override
public DynamicValue copy() {
return new AllPlayersLostLifeCount();
return instance;
}
@Override

View file

@ -1,23 +1,17 @@
package mage.cards.t;
import java.util.UUID;
import mage.abilities.Ability;
import mage.abilities.common.SimpleStaticAbility;
import mage.abilities.effects.mana.AddManaAnyColorAttachedControllerEffect;
import mage.abilities.effects.common.AttachEffect;
import mage.abilities.effects.common.continuous.GainAbilityAttachedEffect;
import mage.abilities.effects.mana.AddManaAnyColorAttachedControllerEffect;
import mage.abilities.keyword.EnchantAbility;
import mage.abilities.keyword.ShroudAbility;
import mage.abilities.mana.TriggeredManaAbility;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.AttachmentType;
import mage.constants.CardType;
import mage.constants.SubType;
import mage.constants.Duration;
import mage.constants.Outcome;
import mage.constants.Zone;
import mage.constants.*;
import mage.game.Game;
import mage.game.events.GameEvent;
import mage.game.events.GameEvent.EventType;
@ -25,16 +19,17 @@ import mage.game.permanent.Permanent;
import mage.target.TargetPermanent;
import mage.target.common.TargetLandPermanent;
import java.util.UUID;
/**
*
* @author jeffwadsworth
*/
public final class TraceOfAbundance extends CardImpl {
private String rule = "Enchanted land has shroud";
private static final String rule = "Enchanted land has shroud";
public TraceOfAbundance(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.ENCHANTMENT},"{R/W}{G}");
super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{R/W}{G}");
this.subtype.add(SubType.AURA);
// Enchant land

View file

@ -1,7 +1,6 @@
package mage.cards.v;
import java.util.UUID;
import mage.MageInt;
import mage.MageObject;
import mage.abilities.Ability;
@ -17,12 +16,7 @@ import mage.abilities.effects.common.CopyPermanentEffect;
import mage.abilities.keyword.MorphAbility;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.SubType;
import mage.constants.Duration;
import mage.constants.Outcome;
import mage.constants.TargetController;
import mage.constants.Zone;
import mage.constants.*;
import mage.filter.StaticFilters;
import mage.filter.common.FilterCreaturePermanent;
import mage.filter.predicate.permanent.AnotherPredicate;
@ -32,12 +26,13 @@ import mage.players.Player;
import mage.target.common.TargetCreaturePermanent;
import mage.util.functions.ApplyToPermanent;
import java.util.UUID;
/**
* @author spjspj
*/
public final class VesuvanShapeshifter extends CardImpl {
protected Ability turnFaceUpAbility = null;
private static final String effectText = "as a copy of any creature on the battlefield until {this} is turned faced down";
public VesuvanShapeshifter(UUID ownerId, CardSetInfo setInfo) {