mirror of
https://github.com/magefree/mage.git
synced 2026-01-25 12:49:39 -08:00
couple of sonar fixes
This commit is contained in:
parent
63fc53e0f0
commit
7c2f55eda0
28 changed files with 53 additions and 134 deletions
|
|
@ -85,55 +85,4 @@ class AvatarOfFuryAdjustingCostsAbility extends SimpleStaticAbility implements A
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//class AvatarOfFuryAdjustingCostsEffect extends CostModificationEffectImpl {
|
||||
//
|
||||
// public AvatarOfFuryAdjustingCostsEffect() {
|
||||
// super(Duration.Custom, Outcome.Benefit, CostModificationType.REDUCE_COST);
|
||||
// }
|
||||
//
|
||||
// public AvatarOfFuryAdjustingCostsEffect(final AvatarOfFuryAdjustingCostsEffect effect) {
|
||||
// super(effect);
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public boolean apply(Game game, Ability source, Ability abilityToModify) {
|
||||
// SpellAbility spellAbility = (SpellAbility)abilityToModify;
|
||||
// Mana mana = spellAbility.getManaCostsToPay().getMana();
|
||||
//
|
||||
// boolean condition = false;
|
||||
// FilterPermanent filter = new FilterLandPermanent();
|
||||
// for (UUID playerId: game.getOpponents(source.getControllerId())) {
|
||||
// if (game.getBattlefield().countAll(filter, playerId, game) > 6) {
|
||||
// condition = true;
|
||||
// break;
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// if (mana.getColorless() > 0 && condition) {
|
||||
// int newCount = mana.getColorless() - 6;
|
||||
// if (newCount < 0) {
|
||||
// newCount = 0;
|
||||
// }
|
||||
// mana.setColorless(newCount);
|
||||
// spellAbility.getManaCostsToPay().load(mana.toString());
|
||||
// return true;
|
||||
// }
|
||||
// return false;
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public boolean applies(Ability abilityToModify, Ability source, Game game) {
|
||||
// if ((abilityToModify instanceof SpellAbility || abilityToModify instanceof FlashbackAbility || abilityToModify instanceof RetraceAbility)
|
||||
// && abilityToModify.getSourceId().equals(source.getSourceId())) {
|
||||
// return true;
|
||||
// }
|
||||
// return false;
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public AvatarOfFuryAdjustingCostsEffect copy() {
|
||||
// return new AvatarOfFuryAdjustingCostsEffect(this);
|
||||
// }
|
||||
//}
|
||||
}
|
||||
|
|
@ -2,14 +2,9 @@ package mage.cards.a;
|
|||
|
||||
import java.util.UUID;
|
||||
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.AbilityImpl;
|
||||
import mage.abilities.SpellAbility;
|
||||
import mage.abilities.effects.Effect;
|
||||
import mage.abilities.effects.common.PreventCombatDamageBySourceEffect;
|
||||
import mage.abilities.effects.common.PreventDamageByTargetEffect;
|
||||
import mage.abilities.effects.common.PreventDamageToTargetEffect;
|
||||
import mage.abilities.effects.common.continuous.BoostTargetEffect;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.CardType;
|
||||
|
|
@ -46,7 +41,7 @@ public final class AzoriusPloy extends CardImpl {
|
|||
|
||||
}
|
||||
|
||||
public AzoriusPloy(final AzoriusPloy card) {
|
||||
private AzoriusPloy(final AzoriusPloy card) {
|
||||
super(card);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -11,8 +11,6 @@ import mage.cards.CardSetInfo;
|
|||
import mage.constants.*;
|
||||
import mage.filter.common.FilterLandPermanent;
|
||||
import mage.filter.predicate.mageobject.SupertypePredicate;
|
||||
import mage.game.permanent.token.TokenImpl;
|
||||
import mage.game.permanent.token.Token;
|
||||
import mage.game.permanent.token.custom.CreatureToken;
|
||||
import mage.target.TargetPermanent;
|
||||
|
||||
|
|
@ -43,7 +41,7 @@ public final class BalduvianConjurer extends CardImpl {
|
|||
this.addAbility(ability);
|
||||
}
|
||||
|
||||
public BalduvianConjurer(final BalduvianConjurer card) {
|
||||
private BalduvianConjurer(final BalduvianConjurer card) {
|
||||
super(card);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -3,8 +3,6 @@ package mage.cards.b;
|
|||
import java.util.UUID;
|
||||
import mage.MageInt;
|
||||
import mage.abilities.TriggeredAbilityImpl;
|
||||
import mage.abilities.dynamicvalue.DynamicValue;
|
||||
import mage.abilities.dynamicvalue.common.StaticValue;
|
||||
import mage.abilities.effects.common.continuous.BoostSourceEffect;
|
||||
import mage.constants.Duration;
|
||||
import mage.constants.SubType;
|
||||
|
|
@ -38,7 +36,7 @@ public final class BalduvianFallen extends CardImpl {
|
|||
this.addAbility(new BalduvianFallenAbility());
|
||||
}
|
||||
|
||||
public BalduvianFallen(final BalduvianFallen card) {
|
||||
private BalduvianFallen(final BalduvianFallen card) {
|
||||
super(card);
|
||||
}
|
||||
|
||||
|
|
@ -54,7 +52,7 @@ class BalduvianFallenAbility extends TriggeredAbilityImpl {
|
|||
super(Zone.BATTLEFIELD, null, false);
|
||||
}
|
||||
|
||||
public BalduvianFallenAbility(final BalduvianFallenAbility ability) {
|
||||
private BalduvianFallenAbility(final BalduvianFallenAbility ability) {
|
||||
super(ability);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -15,7 +15,6 @@ import mage.constants.*;
|
|||
import mage.filter.common.FilterLandPermanent;
|
||||
import mage.filter.predicate.mageobject.SupertypePredicate;
|
||||
import mage.game.permanent.token.TokenImpl;
|
||||
import mage.game.permanent.token.Token;
|
||||
import mage.target.TargetPermanent;
|
||||
|
||||
/**
|
||||
|
|
@ -44,7 +43,7 @@ public final class BalduvianFrostwaker extends CardImpl {
|
|||
this.addAbility(ability);
|
||||
}
|
||||
|
||||
public BalduvianFrostwaker(final BalduvianFrostwaker card) {
|
||||
private BalduvianFrostwaker(final BalduvianFrostwaker card) {
|
||||
super(card);
|
||||
}
|
||||
|
||||
|
|
@ -65,7 +64,7 @@ class BalduvianFrostwakerToken extends TokenImpl {
|
|||
this.toughness = new MageInt(2);
|
||||
this.addAbility(FlyingAbility.getInstance());
|
||||
}
|
||||
public BalduvianFrostwakerToken(final BalduvianFrostwakerToken token) {
|
||||
private BalduvianFrostwakerToken(final BalduvianFrostwakerToken token) {
|
||||
super(token);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -51,7 +51,7 @@ public final class BalduvianWarlord extends CardImpl {
|
|||
this.addAbility(ability, new BlockedByOnlyOneCreatureThisCombatWatcher());
|
||||
}
|
||||
|
||||
public BalduvianWarlord(final BalduvianWarlord card) {
|
||||
private BalduvianWarlord(final BalduvianWarlord card) {
|
||||
super(card);
|
||||
}
|
||||
|
||||
|
|
@ -69,7 +69,7 @@ class BalduvianWarlordUnblockEffect extends OneShotEffect {
|
|||
this.staticText = " Remove target blocking creature from combat. Creatures it was blocking that hadn't become blocked by another creature this combat become unblocked, then it blocks an attacking creature of your choice";
|
||||
}
|
||||
|
||||
public BalduvianWarlordUnblockEffect(final BalduvianWarlordUnblockEffect effect) {
|
||||
private BalduvianWarlordUnblockEffect(final BalduvianWarlordUnblockEffect effect) {
|
||||
super(effect);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -2,9 +2,7 @@
|
|||
package mage.cards.b;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.SimpleStaticAbility;
|
||||
import mage.abilities.effects.RestrictionEffect;
|
||||
import mage.abilities.effects.common.combat.CantBlockAllEffect;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
|
|
@ -12,8 +10,6 @@ import mage.constants.CardType;
|
|||
import mage.constants.Duration;
|
||||
import mage.constants.Zone;
|
||||
import mage.filter.StaticFilters;
|
||||
import mage.game.Game;
|
||||
import mage.game.permanent.Permanent;
|
||||
|
||||
/**
|
||||
*
|
||||
|
|
@ -28,7 +24,7 @@ public final class Bedlam extends CardImpl {
|
|||
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new CantBlockAllEffect(StaticFilters.FILTER_PERMANENT_CREATURES, Duration.WhileOnBattlefield)));
|
||||
}
|
||||
|
||||
public Bedlam(final Bedlam card) {
|
||||
private Bedlam(final Bedlam card) {
|
||||
super(card);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -82,7 +82,7 @@ class BendOrBreakEffect extends OneShotEffect {
|
|||
Player nextPlayer;
|
||||
UUID firstNextPlayer = null;
|
||||
|
||||
while (!getNextPlayerInDirection(true, playerList, game).equals(firstNextPlayer) && controller.canRespond()) {
|
||||
while (!getNextPlayerInDirection(true, playerList).equals(firstNextPlayer) && controller.canRespond()) {
|
||||
nextPlayer = game.getPlayer(playerList.get());
|
||||
if (nextPlayer == null) {
|
||||
return false;
|
||||
|
|
@ -187,7 +187,7 @@ class BendOrBreakEffect extends OneShotEffect {
|
|||
return false;
|
||||
}
|
||||
|
||||
private UUID getNextPlayerInDirection(boolean left, PlayerList playerList, Game game) {
|
||||
private UUID getNextPlayerInDirection(boolean left, PlayerList playerList) {
|
||||
UUID nextPlayerId;
|
||||
if (left) {
|
||||
nextPlayerId = playerList.getNext();
|
||||
|
|
|
|||
|
|
@ -1,22 +1,13 @@
|
|||
|
||||
package mage.cards.b;
|
||||
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.effects.OneShotEffect;
|
||||
import mage.abilities.effects.common.DamageTargetEffect;
|
||||
import mage.abilities.effects.common.DestroyAllAttachedEquipmentEffect;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.SubType;
|
||||
import mage.constants.Outcome;
|
||||
import mage.game.Game;
|
||||
import mage.game.permanent.Permanent;
|
||||
import mage.players.Player;
|
||||
import mage.target.common.TargetCreaturePermanent;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
|
|
@ -35,7 +26,7 @@ public final class BlastfireBolt extends CardImpl {
|
|||
this.getSpellAbility().addTarget(new TargetCreaturePermanent());
|
||||
}
|
||||
|
||||
public BlastfireBolt(final BlastfireBolt card) {
|
||||
private BlastfireBolt(final BlastfireBolt card) {
|
||||
super(card);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -4,7 +4,6 @@ package mage.cards.b;
|
|||
|
||||
import java.util.UUID;
|
||||
|
||||
import mage.MageInt;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.SimpleActivatedAbility;
|
||||
import mage.abilities.costs.common.TapSourceCost;
|
||||
|
|
@ -21,8 +20,6 @@ import mage.constants.SubType;
|
|||
import mage.constants.Zone;
|
||||
import mage.filter.FilterPermanent;
|
||||
import mage.filter.predicate.mageobject.SubtypePredicate;
|
||||
import mage.game.permanent.token.TokenImpl;
|
||||
import mage.game.permanent.token.Token;
|
||||
import mage.game.permanent.token.custom.CreatureToken;
|
||||
import mage.target.TargetPermanent;
|
||||
|
||||
|
|
@ -59,7 +56,7 @@ public final class BlinkmothNexus extends CardImpl {
|
|||
|
||||
}
|
||||
|
||||
public BlinkmothNexus(final BlinkmothNexus card) {
|
||||
private BlinkmothNexus(final BlinkmothNexus card) {
|
||||
super(card);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,7 +1,6 @@
|
|||
|
||||
package mage.cards.b;
|
||||
|
||||
import java.util.Iterator;
|
||||
import java.util.UUID;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.EntersBattlefieldTriggeredAbility;
|
||||
|
|
@ -14,7 +13,6 @@ import mage.constants.AbilityType;
|
|||
import mage.constants.CardType;
|
||||
import mage.constants.Duration;
|
||||
import mage.constants.Layer;
|
||||
import static mage.constants.Layer.AbilityAddingRemovingEffects_6;
|
||||
import mage.constants.Outcome;
|
||||
import mage.constants.SubLayer;
|
||||
import mage.constants.Zone;
|
||||
|
|
@ -39,7 +37,7 @@ public final class BloodSun extends CardImpl {
|
|||
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new BloodSunEffect(Duration.WhileOnBattlefield)));
|
||||
}
|
||||
|
||||
public BloodSun(final BloodSun card) {
|
||||
private BloodSun(final BloodSun card) {
|
||||
super(card);
|
||||
}
|
||||
|
||||
|
|
@ -56,7 +54,7 @@ class BloodSunEffect extends ContinuousEffectImpl {
|
|||
staticText = "all lands lose all abilities except mana abilities";
|
||||
}
|
||||
|
||||
public BloodSunEffect(final BloodSunEffect effect) {
|
||||
private BloodSunEffect(final BloodSunEffect effect) {
|
||||
super(effect);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -6,13 +6,9 @@ import mage.abilities.common.SimpleActivatedAbility;
|
|||
import mage.abilities.costs.common.SacrificeSourceCost;
|
||||
import mage.abilities.costs.common.TapSourceCost;
|
||||
import mage.abilities.costs.mana.GenericManaCost;
|
||||
import mage.abilities.effects.common.search.SearchLibraryPutInHandEffect;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Zone;
|
||||
import mage.filter.StaticFilters;
|
||||
import mage.target.common.TargetCardInLibrary;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.abilities.effects.common.continuous.BoostTargetEffect;
|
||||
|
|
@ -39,7 +35,7 @@ public final class BloodtallowCandle extends CardImpl {
|
|||
this.addAbility(ability);
|
||||
}
|
||||
|
||||
public BloodtallowCandle(final BloodtallowCandle card) {
|
||||
private BloodtallowCandle(final BloodtallowCandle card) {
|
||||
super(card);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@ import mage.cards.CardSetInfo;
|
|||
import mage.constants.CardType;
|
||||
import mage.constants.Zone;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.UUID;
|
||||
|
||||
|
|
@ -23,18 +23,15 @@ public final class CryptOfTheEternals extends CardImpl {
|
|||
|
||||
// When Crypt of the Eternals enters the battlefield, you gain 1 life.
|
||||
this.addAbility(new EntersBattlefieldTriggeredAbility(new GainLifeEffect(1)));
|
||||
|
||||
|
||||
// {T}: Add {C}.
|
||||
this.addAbility(new ColorlessManaAbility());
|
||||
|
||||
// {1}, {T}: Add {U}, {B}, or {R}.
|
||||
List<Mana> list = new ArrayList<Mana>() {{
|
||||
add(Mana.BlueMana(1));
|
||||
add(Mana.BlackMana(1));
|
||||
add(Mana.RedMana(1));
|
||||
}};
|
||||
|
||||
for(Mana m: list) {
|
||||
List<Mana> list = Arrays.asList(Mana.BlueMana(1), Mana.BlackMana(1), Mana.RedMana(1));
|
||||
|
||||
|
||||
for (Mana m : list) {
|
||||
SimpleManaAbility uAbility = new SimpleManaAbility(Zone.BATTLEFIELD, m, new ManaCostsImpl("{1}"));
|
||||
uAbility.addCost(new TapSourceCost());
|
||||
this.addAbility(uAbility);
|
||||
|
|
|
|||
|
|
@ -70,9 +70,9 @@ class ForesightEffect extends SearchEffect {
|
|||
card.moveToExile(null, null, targetId, game);
|
||||
}
|
||||
}
|
||||
player.shuffleLibrary(source, game);
|
||||
return true;
|
||||
}
|
||||
player.shuffleLibrary(source, game);
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -86,7 +86,7 @@ class GrinningTotemSearchAndExileEffect extends OneShotEffect {
|
|||
Card card = targetOpponent.getLibrary().remove(targetCard.getFirstTarget(), game);
|
||||
if (card != null) {
|
||||
UUID exileZoneId = CardUtil.getCardExileZoneId(game, source);
|
||||
you.moveCardToExileWithInfo(card, exileZoneId, sourceObject != null ? sourceObject.getIdName() : "", source.getSourceId(), game, Zone.LIBRARY, true);
|
||||
you.moveCardToExileWithInfo(card, exileZoneId, sourceObject.getIdName(), source.getSourceId(), game, Zone.LIBRARY, true);
|
||||
ContinuousEffect effect = new GrinningTotemMayPlayEffect();
|
||||
effect.setTargetPointer(new FixedTarget(card.getId()));
|
||||
game.addEffect(effect, source);
|
||||
|
|
|
|||
|
|
@ -59,9 +59,11 @@ class KayasWrathEffect extends OneShotEffect {
|
|||
StaticFilters.FILTER_PERMANENT_CREATURE,
|
||||
source.getControllerId(), source.getSourceId(), game
|
||||
)) {
|
||||
boolean isMine = permanent != null && permanent.isControlledBy(source.getControllerId());
|
||||
if (permanent.destroy(source.getSourceId(), game, false) && isMine) {
|
||||
counter++;
|
||||
if (permanent != null) {
|
||||
boolean isMine = permanent.isControlledBy(source.getControllerId());
|
||||
if (permanent.destroy(source.getSourceId(), game, false) && isMine) {
|
||||
counter++;
|
||||
}
|
||||
}
|
||||
}
|
||||
return new GainLifeEffect(counter).apply(game, source);
|
||||
|
|
|
|||
|
|
@ -74,12 +74,14 @@ class SaplingOfColfenorEffect extends OneShotEffect {
|
|||
if (controller != null && sourceObject != null) {
|
||||
if (controller.getLibrary().hasCards()) {
|
||||
Card card = controller.getLibrary().getFromTop(game);
|
||||
Cards cards = new CardsImpl(card);
|
||||
controller.revealCards(sourceObject.getIdName(), cards, game);
|
||||
if (card.isCreature()) {
|
||||
controller.gainLife(card.getToughness().getValue(), game, source);
|
||||
controller.loseLife(card.getPower().getValue(), game, false);
|
||||
return controller.moveCards(cards.getCards(game), Zone.HAND, source, game);
|
||||
if(card != null) {
|
||||
Cards cards = new CardsImpl(card);
|
||||
controller.revealCards(sourceObject.getIdName(), cards, game);
|
||||
if (card.isCreature()) {
|
||||
controller.gainLife(card.getToughness().getValue(), game, source);
|
||||
controller.loseLife(card.getPower().getValue(), game, false);
|
||||
return controller.moveCards(cards.getCards(game), Zone.HAND, source, game);
|
||||
}
|
||||
}
|
||||
}
|
||||
return true;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue