mirror of
https://github.com/magefree/mage.git
synced 2026-01-26 05:09:16 -08:00
remove redundant null checks, remove some static fields
This commit is contained in:
parent
05dcfeaaa1
commit
a0e54fbb7b
21 changed files with 84 additions and 104 deletions
|
|
@ -55,7 +55,7 @@ public final class BlowflyInfestation extends CardImpl {
|
|||
|
||||
class BlowflyInfestationCondition implements Condition {
|
||||
|
||||
private static Permanent permanent;
|
||||
private Permanent permanent;
|
||||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
|
|
|
|||
|
|
@ -158,7 +158,7 @@ class IceCauldronCastFromExileEffect extends AsThoughEffectImpl {
|
|||
|
||||
class IceCauldronNoteManaEffect extends OneShotEffect {
|
||||
|
||||
private static String manaUsedString;
|
||||
private String manaUsedString;
|
||||
|
||||
public IceCauldronNoteManaEffect() {
|
||||
super(Outcome.Benefit);
|
||||
|
|
@ -167,6 +167,7 @@ class IceCauldronNoteManaEffect extends OneShotEffect {
|
|||
|
||||
public IceCauldronNoteManaEffect(final IceCauldronNoteManaEffect effect) {
|
||||
super(effect);
|
||||
manaUsedString = effect.manaUsedString;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
@ -190,8 +191,8 @@ class IceCauldronNoteManaEffect extends OneShotEffect {
|
|||
|
||||
class IceCauldronAddManaEffect extends ManaEffect {
|
||||
|
||||
private static Mana storedMana;
|
||||
private static MageObjectReference exiledCardMor;
|
||||
private Mana storedMana;
|
||||
private MageObjectReference exiledCardMor;
|
||||
|
||||
IceCauldronAddManaEffect() {
|
||||
super();
|
||||
|
|
@ -200,6 +201,8 @@ class IceCauldronAddManaEffect extends ManaEffect {
|
|||
|
||||
IceCauldronAddManaEffect(IceCauldronAddManaEffect effect) {
|
||||
super(effect);
|
||||
storedMana = effect.storedMana.copy();
|
||||
exiledCardMor = effect.exiledCardMor;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
|||
|
|
@ -60,7 +60,7 @@ public final class JeweledAmulet extends CardImpl {
|
|||
|
||||
class JeweledAmuletAddCounterEffect extends OneShotEffect {
|
||||
|
||||
private static String manaUsedString;
|
||||
private String manaUsedString;
|
||||
|
||||
public JeweledAmuletAddCounterEffect() {
|
||||
super(Outcome.Benefit);
|
||||
|
|
@ -69,6 +69,7 @@ class JeweledAmuletAddCounterEffect extends OneShotEffect {
|
|||
|
||||
public JeweledAmuletAddCounterEffect(final JeweledAmuletAddCounterEffect effect) {
|
||||
super(effect);
|
||||
manaUsedString = effect.manaUsedString;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
@ -93,7 +94,7 @@ class JeweledAmuletAddCounterEffect extends OneShotEffect {
|
|||
|
||||
class JeweledAmuletAddManaEffect extends ManaEffect {
|
||||
|
||||
private static Mana storedMana;
|
||||
private Mana storedMana;
|
||||
|
||||
JeweledAmuletAddManaEffect() {
|
||||
super();
|
||||
|
|
@ -102,6 +103,7 @@ class JeweledAmuletAddManaEffect extends ManaEffect {
|
|||
|
||||
JeweledAmuletAddManaEffect(JeweledAmuletAddManaEffect effect) {
|
||||
super(effect);
|
||||
storedMana = effect.storedMana;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
|||
|
|
@ -68,7 +68,7 @@ class MagesContestEffect extends OneShotEffect {
|
|||
Player winner = you;
|
||||
Player currentPlayer = spellController;
|
||||
do {
|
||||
if (currentPlayer != null && currentPlayer.canRespond()) {
|
||||
if (currentPlayer.canRespond()) {
|
||||
int newBid = 0;
|
||||
if (!currentPlayer.isHuman()) {
|
||||
// make AI evaluate value of the spell to decide on bidding, should be reworked
|
||||
|
|
|
|||
|
|
@ -52,8 +52,8 @@ public final class ProtectiveSphere extends CardImpl {
|
|||
class ProtectiveSphereEffect extends PreventionEffectImpl {
|
||||
|
||||
private final TargetSource target;
|
||||
private static Mana manaUsed;
|
||||
private static List<ObjectColor> colorsOfChosenSource = new ArrayList<>();
|
||||
private Mana manaUsed;
|
||||
private List<ObjectColor> colorsOfChosenSource = new ArrayList<>();
|
||||
|
||||
public ProtectiveSphereEffect() {
|
||||
super(Duration.EndOfTurn, Integer.MAX_VALUE, false, false);
|
||||
|
|
@ -64,6 +64,8 @@ class ProtectiveSphereEffect extends PreventionEffectImpl {
|
|||
public ProtectiveSphereEffect(final ProtectiveSphereEffect effect) {
|
||||
super(effect);
|
||||
this.target = effect.target.copy();
|
||||
manaUsed = effect.manaUsed.copy();
|
||||
colorsOfChosenSource = effect.colorsOfChosenSource;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
|||
|
|
@ -75,7 +75,7 @@ class ScribNibblersEffect extends OneShotEffect {
|
|||
if (targetPlayer != null && targetPlayer.getLibrary().hasCards()) {
|
||||
Card card = targetPlayer.getLibrary().getFromTop(game);
|
||||
card.moveToExile(id, "Scrib Nibblers Exile", source.getSourceId(), game);
|
||||
if (card != null && card.isLand()) {
|
||||
if (card.isLand()) {
|
||||
you.gainLife(1, game, source);
|
||||
return true;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -98,7 +98,7 @@ class WordOfCommandEffect extends OneShotEffect {
|
|||
|
||||
// You control that player until Word of Command finishes resolving
|
||||
controller.controlPlayersTurn(game, targetPlayer.getId());
|
||||
while (controller != null && controller.canRespond()) {
|
||||
while (controller.canRespond()) {
|
||||
if (controller.chooseUse(Outcome.Benefit, "Resolve " + sourceObject.getLogName() + " now" + (card != null ? " and play " + card.getLogName() : "") + '?', source, game)) {
|
||||
// this is used to give the controller a little space to utilize his player controlling effect (look at face down creatures, hand, etc.)
|
||||
break;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue