mirror of
https://github.com/magefree/mage.git
synced 2026-01-24 04:09:54 -08:00
Merge origin/master
This commit is contained in:
commit
b8cc0120cb
737 changed files with 1701 additions and 1729 deletions
|
|
@ -105,7 +105,7 @@ class AcademyResearchersEffect extends OneShotEffect {
|
|||
game.getState().setValue("attachTo:" + auraInHand.getId(), academyResearchers);
|
||||
auraInHand.putOntoBattlefield(game, Zone.HAND, source.getSourceId(), controller.getId());
|
||||
if (academyResearchers.addAttachment(auraInHand.getId(), game)) {
|
||||
game.informPlayers(controller.getLogName() + " put " + auraInHand.getLogName() + " on the battlefield attached to " + academyResearchers.getLogName() + ".");
|
||||
game.informPlayers(controller.getLogName() + " put " + auraInHand.getLogName() + " on the battlefield attached to " + academyResearchers.getLogName() + '.');
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -98,7 +98,7 @@ class ActOnImpulseExileEffect extends OneShotEffect {
|
|||
cards.add(card);
|
||||
}
|
||||
}
|
||||
if (cards.size() > 0) {
|
||||
if (!cards.isEmpty()) {
|
||||
List<UUID> cardsId = new ArrayList<>();
|
||||
for (Card card : cards) {
|
||||
card.moveToExile(source.getSourceId(), "Act on Impulse", source.getSourceId(), game);
|
||||
|
|
|
|||
|
|
@ -92,7 +92,7 @@ class AddleEffect extends OneShotEffect {
|
|||
controller.choose(outcome, choice, game);
|
||||
ObjectColor color = choice.getColor();
|
||||
if(color != null) {
|
||||
game.informPlayers(controller.getLogName() + " chooses " + color + ".");
|
||||
game.informPlayers(controller.getLogName() + " chooses " + color + '.');
|
||||
FilterCard filter = new FilterCard();
|
||||
filter.add(new ColorPredicate(color));
|
||||
Effect effect = new DiscardCardYouChooseTargetEffect(filter);
|
||||
|
|
|
|||
|
|
@ -105,7 +105,7 @@ class AetherbornMarauderEffect extends OneShotEffect {
|
|||
filter.add(new CounterPredicate(CounterType.P1P1));
|
||||
boolean firstRun = true;
|
||||
while (game.getBattlefield().count(filter, source.getSourceId(), source.getControllerId(), game) > 0) {
|
||||
if (controller.chooseUse(outcome, "Move " + (firstRun ? "any" : "more") + " +1/+1 counters from other permanents you control to " + sourceObject.getLogName() + "?", source, game)) {
|
||||
if (controller.chooseUse(outcome, "Move " + (firstRun ? "any" : "more") + " +1/+1 counters from other permanents you control to " + sourceObject.getLogName() + '?', source, game)) {
|
||||
firstRun = false;
|
||||
TargetControlledPermanent target = new TargetControlledPermanent(filter);
|
||||
target.setNotTarget(true);
|
||||
|
|
|
|||
|
|
@ -96,7 +96,7 @@ class AgonizingMemoriesEffect extends OneShotEffect {
|
|||
}
|
||||
|
||||
private void chooseCardInHandAndPutOnTopOfLibrary(Game game, Ability source, Player you, Player targetPlayer) {
|
||||
if (targetPlayer.getHand().size() > 0) {
|
||||
if (!targetPlayer.getHand().isEmpty()) {
|
||||
TargetCard target = new TargetCard(Zone.HAND, new FilterCard("card to put on the top of library (last chosen will be on top)"));
|
||||
if (you.choose(Outcome.Benefit, targetPlayer.getHand(), target, game)) {
|
||||
Card card = targetPlayer.getHand().get(target.getFirstTarget(), game);
|
||||
|
|
|
|||
|
|
@ -121,7 +121,7 @@ class AladdinsLampEffect extends ReplacementEffectImpl {
|
|||
|
||||
|
||||
// Put the rest on the bottom of your library in a random order
|
||||
while (cards.size() > 0) {
|
||||
while (!cards.isEmpty()) {
|
||||
Card card = cards.getRandom(game);
|
||||
if (card != null) {
|
||||
cards.remove(card);
|
||||
|
|
|
|||
|
|
@ -121,7 +121,7 @@ class AlhammarretHighArbiterEffect extends OneShotEffect {
|
|||
controller.chooseTarget(Outcome.Benefit, revealedCards, target, source, game);
|
||||
Card card = game.getCard(target.getFirstTarget());
|
||||
if (card != null) {
|
||||
game.informPlayers("The choosen card name is [" + GameLog.getColoredObjectName(card) + "]");
|
||||
game.informPlayers("The choosen card name is [" + GameLog.getColoredObjectName(card) + ']');
|
||||
Permanent sourcePermanent = game.getPermanent(source.getSourceId());
|
||||
if (sourcePermanent != null) {
|
||||
sourcePermanent.addInfo("chosen card name", CardUtil.addToolTipMarkTags("Chosen card name: " + card.getName()), game);
|
||||
|
|
|
|||
|
|
@ -95,7 +95,7 @@ class AltarOfDementiaEffect extends OneShotEffect {
|
|||
if (player != null) {
|
||||
int amount = 0;
|
||||
for (Cost cost: source.getCosts()) {
|
||||
if (cost instanceof SacrificeTargetCost && ((SacrificeTargetCost)cost).getPermanents().size() > 0) {
|
||||
if (cost instanceof SacrificeTargetCost && !((SacrificeTargetCost) cost).getPermanents().isEmpty()) {
|
||||
amount = ((SacrificeTargetCost)cost).getPermanents().get(0).getPower().getValue();
|
||||
break;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -90,7 +90,7 @@ class AmassTheComponentsEffect extends OneShotEffect {
|
|||
}
|
||||
|
||||
player.drawCards(3, game);
|
||||
if (player.getHand().size() > 0) {
|
||||
if (!player.getHand().isEmpty()) {
|
||||
FilterCard filter = new FilterCard("card from your hand to put on the bottom of your library");
|
||||
TargetCard target = new TargetCard(Zone.HAND, filter);
|
||||
|
||||
|
|
|
|||
|
|
@ -98,7 +98,7 @@ class AncestralMemoriesEffect extends OneShotEffect {
|
|||
}
|
||||
}
|
||||
|
||||
if (cards.size() > 0) {
|
||||
if (!cards.isEmpty()) {
|
||||
player.lookAtCards("Ancestral Memories", cards, game);
|
||||
|
||||
TargetCard target = new TargetCard(Math.min(2, cards.size()), Zone.LIBRARY, new FilterCard("two cards to put in your hand"));
|
||||
|
|
|
|||
|
|
@ -106,7 +106,7 @@ class AngelOfSerenityTriggeredAbility extends ZoneChangeTriggeredAbility {
|
|||
filter.add(new AnotherPredicate());
|
||||
TargetCreaturePermanent target1 = new TargetCreaturePermanent(0, 3, filter, false);
|
||||
game.getPlayer(getControllerId()).chooseTarget(Outcome.Exile, target1, this, game);
|
||||
if (target1.getTargets().size() > 0) {
|
||||
if (!target1.getTargets().isEmpty()) {
|
||||
getTargets().add(target1);
|
||||
|
||||
}
|
||||
|
|
@ -115,7 +115,7 @@ class AngelOfSerenityTriggeredAbility extends ZoneChangeTriggeredAbility {
|
|||
FilterCard filter2 = new FilterCreatureCard("up to " + leftTargets + " target creature card" + (leftTargets > 1 ? "s" : "") + " from graveyards");
|
||||
TargetCardInGraveyard target2 = new TargetCardInGraveyard(0, leftTargets, filter2);
|
||||
game.getPlayer(getControllerId()).chooseTarget(Outcome.Exile, target2, this, game);
|
||||
if (target2.getTargets().size() > 0) {
|
||||
if (!target2.getTargets().isEmpty()) {
|
||||
getTargets().add(target2);
|
||||
}
|
||||
}
|
||||
|
|
@ -152,7 +152,7 @@ class AngelOfSerenityEnterEffect extends OneShotEffect {
|
|||
boolean result = true;
|
||||
Player controller = game.getPlayer(source.getControllerId());
|
||||
MageObject sourceObject = game.getObject(source.getSourceId());
|
||||
if (controller != null && sourceObject != null && source.getTargets().size() > 0) {
|
||||
if (controller != null && sourceObject != null && !source.getTargets().isEmpty()) {
|
||||
UUID exileZoneId = CardUtil.getExileZoneId(game, source.getSourceId(), source.getSourceObjectZoneChangeCounter());
|
||||
for (Target target : source.getTargets()) {
|
||||
if (target instanceof TargetCreaturePermanent) {
|
||||
|
|
|
|||
|
|
@ -109,7 +109,7 @@ class AngelicArbiterWatcher2 extends Watcher {
|
|||
&& game.getActivePlayerId().equals(event.getPlayerId())
|
||||
&& game.getOpponents(controllerId).contains(event.getPlayerId())
|
||||
&& game.getCombat().getAttackerId().equals(event.getPlayerId())
|
||||
&& game.getCombat().getAttackers().size() > 0) {
|
||||
&& !game.getCombat().getAttackers().isEmpty()) {
|
||||
playersThatAttackedThisTurn.add(event.getPlayerId());
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -105,7 +105,7 @@ class AnimalBoneyardEffect extends OneShotEffect {
|
|||
int toughness = 0;
|
||||
|
||||
for (Cost cost : source.getCosts()) {
|
||||
if (cost instanceof SacrificeTargetCost && ((SacrificeTargetCost) cost).getPermanents().size() > 0) {
|
||||
if (cost instanceof SacrificeTargetCost && !((SacrificeTargetCost) cost).getPermanents().isEmpty()) {
|
||||
toughness = ((SacrificeTargetCost) cost).getPermanents().get(0).getToughness().getValue();
|
||||
break;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -143,7 +143,7 @@ class AnimationModuleEffect extends OneShotEffect {
|
|||
if (controller != null) {
|
||||
Permanent permanent = game.getPermanent(this.getTargetPointer().getFirst(game, source));
|
||||
if (permanent != null) {
|
||||
if (permanent.getCounters(game).size() > 0) {
|
||||
if (!permanent.getCounters(game).isEmpty()) {
|
||||
if (permanent.getCounters(game).size() == 1) {
|
||||
for (Counter counter : permanent.getCounters(game).values()) {
|
||||
Counter newCounter = new Counter(counter.getName());
|
||||
|
|
@ -172,7 +172,7 @@ class AnimationModuleEffect extends OneShotEffect {
|
|||
else {
|
||||
Player player = game.getPlayer(this.getTargetPointer().getFirst(game, source));
|
||||
if (player != null) {
|
||||
if (player.getCounters().size() > 0) {
|
||||
if (!player.getCounters().isEmpty()) {
|
||||
if (player.getCounters().size() == 1) {
|
||||
for (Counter counter : player.getCounters().values()) {
|
||||
Counter newCounter = new Counter(counter.getName());
|
||||
|
|
|
|||
|
|
@ -93,7 +93,7 @@ class AnimistsAwakeningEffect extends OneShotEffect {
|
|||
Cards cards = new CardsImpl();
|
||||
int xValue = source.getManaCostsToPay().getX();
|
||||
cards.addAll(controller.getLibrary().getTopCards(game, xValue));
|
||||
if (cards.size() > 0) {
|
||||
if (!cards.isEmpty()) {
|
||||
controller.revealCards(sourceObject.getIdName(), cards, game);
|
||||
Set<Card> toBattlefield = new LinkedHashSet<>();
|
||||
for (Card card : cards.getCards(new FilterLandCard(), source.getSourceId(), source.getControllerId(), game)) {
|
||||
|
|
|
|||
|
|
@ -127,7 +127,7 @@ class AnyaMercilessAngelCondition implements Condition {
|
|||
|
||||
public static AnyaMercilessAngelCondition getInstance() {
|
||||
return fInstance;
|
||||
};
|
||||
}
|
||||
|
||||
private AnyaMercilessAngelCondition() {}
|
||||
|
||||
|
|
|
|||
|
|
@ -159,7 +159,7 @@ class AssaultSuitGainControlEffect extends OneShotEffect {
|
|||
if (equipment.getAttachedTo() != null) {
|
||||
Permanent equippedCreature = game.getPermanent(equipment.getAttachedTo());
|
||||
if (equippedCreature != null && controller.chooseUse(outcome,
|
||||
"Let have " + activePlayer.getLogName() + " gain control of " + equippedCreature.getLogName() + "?", source, game)) {
|
||||
"Let have " + activePlayer.getLogName() + " gain control of " + equippedCreature.getLogName() + '?', source, game)) {
|
||||
equippedCreature.untap(game);
|
||||
ContinuousEffect effect = new GainControlTargetEffect(Duration.EndOfTurn, activePlayer.getId());
|
||||
effect.setTargetPointer(new FixedTarget(equipment.getAttachedTo()));
|
||||
|
|
|
|||
|
|
@ -169,7 +169,7 @@ class AureliasFuryCantCastEffect extends ContinuousRuleModifyingEffectImpl {
|
|||
public String getInfoMessage(Ability source, GameEvent event, Game game) {
|
||||
MageObject mageObject = game.getObject(source.getSourceId());
|
||||
if (mageObject != null) {
|
||||
return "You can't cast noncreature spells this turn (you were dealt damage by " + mageObject.getLogName() + ")";
|
||||
return "You can't cast noncreature spells this turn (you were dealt damage by " + mageObject.getLogName() + ')';
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -97,7 +97,7 @@ class AuriokSurvivorsEffect extends OneShotEffect {
|
|||
Permanent sourcePermanent = game.getPermanent(source.getSourceId());
|
||||
Player player = game.getPlayer(source.getControllerId());
|
||||
if (p != null && player != null && sourcePermanent != null) {
|
||||
if (player.chooseUse(Outcome.Benefit, "Attach " + p.getName() + " to " + sourcePermanent.getName() + "?", source, game)) {
|
||||
if (player.chooseUse(Outcome.Benefit, "Attach " + p.getName() + " to " + sourcePermanent.getName() + '?', source, game)) {
|
||||
sourcePermanent.addAttachment(p.getId(), game);
|
||||
}
|
||||
return true;
|
||||
|
|
|
|||
|
|
@ -118,7 +118,7 @@ class AurraSingBaneOfJediEffect extends OneShotEffect {
|
|||
public boolean apply(Game game, Ability source) {
|
||||
Player controller = game.getPlayer(source.getControllerId());
|
||||
if (controller != null) {
|
||||
if (controller.chooseUse(outcome, "Deal 2 damage to " + game.getPermanent(getTargetPointer().getFirst(game, source)).getName() + "?", source, game)) {
|
||||
if (controller.chooseUse(outcome, "Deal 2 damage to " + game.getPermanent(getTargetPointer().getFirst(game, source)).getName() + '?', source, game)) {
|
||||
new DamageTargetEffect(2).apply(game, source);
|
||||
} else {
|
||||
new DamageControllerEffect(1).apply(game, source);
|
||||
|
|
|
|||
|
|
@ -176,7 +176,7 @@ class TargetCardInBaneAlleyBrokerExile extends TargetCardInExile {
|
|||
if (sourceCard != null) {
|
||||
UUID exileId = CardUtil.getCardExileZoneId(game, sourceId);
|
||||
ExileZone exile = game.getExile().getExileZone(exileId);
|
||||
if (exile != null && exile.size() > 0) {
|
||||
if (exile != null && !exile.isEmpty()) {
|
||||
possibleTargets.addAll(exile);
|
||||
}
|
||||
}
|
||||
|
|
@ -189,7 +189,7 @@ class TargetCardInBaneAlleyBrokerExile extends TargetCardInExile {
|
|||
if (sourceCard != null) {
|
||||
UUID exileId = CardUtil.getCardExileZoneId(game, sourceId);
|
||||
ExileZone exile = game.getExile().getExileZone(exileId);
|
||||
if (exile != null && exile.size() > 0) {
|
||||
if (exile != null && !exile.isEmpty()) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -96,7 +96,7 @@ class BattletideAlchemistEffect extends PreventionEffectImpl {
|
|||
if (controller != null) {
|
||||
int numberOfClericsControlled = new PermanentsOnBattlefieldCount(new FilterControlledCreaturePermanent("Cleric", "Clerics")).calculate(game, source, this);
|
||||
int toPrevent = Math.min(numberOfClericsControlled, event.getAmount());
|
||||
if (toPrevent > 0 && controller.chooseUse(Outcome.PreventDamage, "Prevent " + toPrevent + " damage to " + targetPlayer.getName() + "?", source, game)) {
|
||||
if (toPrevent > 0 && controller.chooseUse(Outcome.PreventDamage, "Prevent " + toPrevent + " damage to " + targetPlayer.getName() + '?', source, game)) {
|
||||
GameEvent preventEvent = new GameEvent(GameEvent.EventType.PREVENT_DAMAGE, targetPlayer.getId(), source.getSourceId(), source.getControllerId(), toPrevent, false);
|
||||
if (!game.replaceEvent(preventEvent)) {
|
||||
if (event.getAmount() >= toPrevent) {
|
||||
|
|
|
|||
|
|
@ -95,7 +95,7 @@ class BirthingPodEffect extends OneShotEffect {
|
|||
for (Cost cost : source.getCosts()) {
|
||||
if (cost instanceof SacrificeTargetCost) {
|
||||
SacrificeTargetCost sacrificeCost = (SacrificeTargetCost) cost;
|
||||
if (sacrificeCost.getPermanents().size() > 0) {
|
||||
if (!sacrificeCost.getPermanents().isEmpty()) {
|
||||
sacrificedPermanent = sacrificeCost.getPermanents().get(0);
|
||||
}
|
||||
break;
|
||||
|
|
|
|||
|
|
@ -97,7 +97,7 @@ class BitterRevelationEffect extends OneShotEffect {
|
|||
cards.add(card);
|
||||
}
|
||||
}
|
||||
if (cards.size() > 0) {
|
||||
if (!cards.isEmpty()) {
|
||||
Cards cardsToHand = new CardsImpl();
|
||||
player.lookAtCards("Bitter Revelation", cards, game);
|
||||
TargetCard target = new TargetCard(Math.min(2, cards.size()), Zone.LIBRARY, new FilterCard("two cards to put in your hand"));
|
||||
|
|
|
|||
|
|
@ -127,7 +127,7 @@ class BlessedReincarnationEffect extends OneShotEffect {
|
|||
card.putOntoBattlefield(game, Zone.LIBRARY, source.getSourceId(), player.getId());
|
||||
}
|
||||
|
||||
if (cards.size() > 0) {
|
||||
if (!cards.isEmpty()) {
|
||||
player.revealCards("BlessedReincarnation", cards, game);
|
||||
Set<Card> cardsToShuffle = cards.getCards(game);
|
||||
cardsToShuffle.remove(card);
|
||||
|
|
|
|||
|
|
@ -109,7 +109,7 @@ class BlindZealotTriggeredAbility extends TriggeredAbilityImpl {
|
|||
StringBuilder sb = new StringBuilder();
|
||||
sb.append("Do you wish to sacrifice ").append(sourcePermanent.getIdName());
|
||||
sb.append(" to destroy target creature controlled by ");
|
||||
sb.append(game.getPlayer(event.getTargetId()).getLogName()).append("?");
|
||||
sb.append(game.getPlayer(event.getTargetId()).getLogName()).append('?');
|
||||
if (player.chooseUse(Outcome.DestroyPermanent, sb.toString(), this, game)) {
|
||||
FilterCreaturePermanent filter = new FilterCreaturePermanent();
|
||||
filter.add(new ControllerIdPredicate(event.getTargetId()));
|
||||
|
|
|
|||
|
|
@ -136,7 +136,7 @@ class BorderlandExplorerEffect extends OneShotEffect {
|
|||
if (cardsPlayer != null) {
|
||||
TargetCardInLibrary target = new TargetCardInLibrary(0, 1, new FilterBasicLandCard());
|
||||
if (player.searchLibrary(target, game)) {
|
||||
if (target.getTargets().size() > 0) {
|
||||
if (!target.getTargets().isEmpty()) {
|
||||
Cards cards = new CardsImpl(target.getTargets());
|
||||
cards.addAll(target.getTargets());
|
||||
cardsToReveal.put(playerId, cards);
|
||||
|
|
@ -154,7 +154,7 @@ class BorderlandExplorerEffect extends OneShotEffect {
|
|||
for (UUID cardId : cardsPlayer) {
|
||||
Cards cards = new CardsImpl(game.getCard(cardId));
|
||||
Card card = game.getCard(cardId);
|
||||
player.revealCards(card.getIdName() + " (" + player.getName() + ")", cards, game);
|
||||
player.revealCards(card.getIdName() + " (" + player.getName() + ')', cards, game);
|
||||
player.moveCardToHandWithInfo(card, source.getSourceId(), game);
|
||||
player.shuffleLibrary(source, game);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -103,7 +103,7 @@ class BottledCloisterExileEffect extends OneShotEffect {
|
|||
card.moveToExile(exileId, sourcePermanent.getName(), source.getSourceId(), game);
|
||||
card.setFaceDown(true, game);
|
||||
}
|
||||
game.informPlayers(sourcePermanent.getName() + ": " + controller.getLogName() + " exiles his or her hand face down (" + numberOfCards + "card" + (numberOfCards > 1 ?"s":"") +")");
|
||||
game.informPlayers(sourcePermanent.getName() + ": " + controller.getLogName() + " exiles his or her hand face down (" + numberOfCards + "card" + (numberOfCards > 1 ?"s":"") + ')');
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -99,9 +99,9 @@ class BrainGorgersCounterSourceEffect extends OneShotEffect {
|
|||
cost.clearPaid();
|
||||
Player player = game.getPlayer(playerId);
|
||||
if (cost.canPay(source, source.getSourceId(), player.getId(), game)
|
||||
&& player.chooseUse(outcome, "Sacrifice a creature to counter " + sourceObject.getIdName() + "?", source, game)) {
|
||||
&& player.chooseUse(outcome, "Sacrifice a creature to counter " + sourceObject.getIdName() + '?', source, game)) {
|
||||
if (cost.pay(source, game, source.getSourceId(), player.getId(), false, null)) {
|
||||
game.informPlayers(player.getLogName() + " sacrifices a creature to counter " + sourceObject.getIdName() + ".");
|
||||
game.informPlayers(player.getLogName() + " sacrifices a creature to counter " + sourceObject.getIdName() + '.');
|
||||
Spell spell = game.getStack().getSpell(source.getSourceId());
|
||||
if (spell != null) {
|
||||
game.getStack().counter(spell.getId(), source.getSourceId(), game);
|
||||
|
|
|
|||
|
|
@ -135,8 +135,8 @@ class BrilliantUltimatumEffect extends OneShotEffect {
|
|||
selectedPileCards = pileTwo;
|
||||
selectedPile = pile2;
|
||||
}
|
||||
game.informPlayers(controller.getLogName() + " chose " + selectedPileName + ".");
|
||||
while (!selectedPileCards.isEmpty() && controller.chooseUse(Outcome.PlayForFree, "Do you want to play a card for free from " + selectedPileName + "?", source, game)) {
|
||||
game.informPlayers(controller.getLogName() + " chose " + selectedPileName + '.');
|
||||
while (!selectedPileCards.isEmpty() && controller.chooseUse(Outcome.PlayForFree, "Do you want to play a card for free from " + selectedPileName + '?', source, game)) {
|
||||
TargetCard targetExiledCard = new TargetCard(Zone.EXILED, new FilterCard());
|
||||
if (controller.chooseTarget(Outcome.PlayForFree, selectedPile, targetExiledCard, source, game)) {
|
||||
Card card = selectedPile.get(targetExiledCard.getFirstTarget(), game);
|
||||
|
|
|
|||
|
|
@ -110,7 +110,7 @@ class BrionStoutarmEffect extends OneShotEffect {
|
|||
public boolean apply(Game game, Ability source) {
|
||||
int amount = 0;
|
||||
for (Cost cost : source.getCosts()) {
|
||||
if (cost instanceof SacrificeTargetCost && ((SacrificeTargetCost) cost).getPermanents().size() > 0) {
|
||||
if (cost instanceof SacrificeTargetCost && !((SacrificeTargetCost) cost).getPermanents().isEmpty()) {
|
||||
amount = ((SacrificeTargetCost) cost).getPermanents().get(0).getPower().getValue();
|
||||
break;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -99,7 +99,7 @@ class BrowseEffect extends OneShotEffect {
|
|||
}
|
||||
}
|
||||
|
||||
if (cards.size() > 0) {
|
||||
if (!cards.isEmpty()) {
|
||||
player.lookAtCards("Browse", cards, game);
|
||||
|
||||
TargetCard target = new TargetCard(Zone.LIBRARY, new FilterCard("card to put in your hand"));
|
||||
|
|
|
|||
|
|
@ -95,7 +95,7 @@ class CannibalizeEffect extends OneShotEffect {
|
|||
for(UUID targetId: getTargetPointer().getTargets(game, source)) {
|
||||
Permanent creature = game.getPermanent(targetId);
|
||||
if (creature != null) {
|
||||
if ((count == 0 && controller.chooseUse(Outcome.Exile, "Exile " + creature.getLogName() +"?", source, game))
|
||||
if ((count == 0 && controller.chooseUse(Outcome.Exile, "Exile " + creature.getLogName() + '?', source, game))
|
||||
|| (count == 1 && !exileDone)) {
|
||||
controller.moveCardToExileWithInfo(creature, null, "", source.getSourceId(), game, Zone.BATTLEFIELD, true);
|
||||
exileDone = true;
|
||||
|
|
|
|||
|
|
@ -106,7 +106,7 @@ class ChainLightningEffect extends OneShotEffect {
|
|||
Spell spell = game.getStack().getSpell(source.getSourceId());
|
||||
if (spell != null) {
|
||||
spell.createCopyOnStack(game, source, affectedPlayer.getId(), true);
|
||||
game.informPlayers(affectedPlayer.getLogName() + " copies " + spell.getName() + ".");
|
||||
game.informPlayers(affectedPlayer.getLogName() + " copies " + spell.getName() + '.');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -96,7 +96,7 @@ class ChainOfVaporEffect extends OneShotEffect {
|
|||
if (permanent != null) {
|
||||
controller.moveCards(permanent, Zone.HAND, source, game);
|
||||
Player player = game.getPlayer(permanent.getControllerId());
|
||||
TargetControlledPermanent target = new TargetControlledPermanent(0, 1, new FilterControlledLandPermanent("a land to sacrifice (to be able to copy " + sourceObject.getName() + ")"), true);
|
||||
TargetControlledPermanent target = new TargetControlledPermanent(0, 1, new FilterControlledLandPermanent("a land to sacrifice (to be able to copy " + sourceObject.getName() + ')'), true);
|
||||
if (player.chooseTarget(Outcome.Sacrifice, target, source, game)) {
|
||||
Permanent land = game.getPermanent(target.getFirstTarget());
|
||||
if (land != null && land.sacrifice(source.getSourceId(), game)) {
|
||||
|
|
@ -109,7 +109,7 @@ class ChainOfVaporEffect extends OneShotEffect {
|
|||
if (activateMessage.startsWith(" casts ")) {
|
||||
activateMessage = activateMessage.substring(6);
|
||||
}
|
||||
game.informPlayers(player.getLogName() + " " + activateMessage);
|
||||
game.informPlayers(player.getLogName() + ' ' + activateMessage);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -278,7 +278,7 @@ class ChandraPyromasterEffect3 extends OneShotEffect {
|
|||
cards.addAll(controller.getLibrary().getTopCards(game, 10));
|
||||
controller.moveCardsToExile(cards.getCards(game), source, game, true, source.getSourceId(), sourceObject.getIdName());
|
||||
|
||||
if (cards.getCards(new FilterInstantOrSorceryCard(), game).size() > 0) {
|
||||
if (!cards.getCards(new FilterInstantOrSorceryCard(), game).isEmpty()) {
|
||||
TargetCard target = new TargetCard(Zone.EXILED, new FilterInstantOrSorceryCard());
|
||||
if (controller.chooseTarget(Outcome.PlayForFree, cards, target, source, game)) {
|
||||
Card card = cards.get(target.getFirstTarget(), game);
|
||||
|
|
|
|||
|
|
@ -96,7 +96,7 @@ class ChimneyImpEffect extends OneShotEffect {
|
|||
public boolean apply(Game game, Ability source) {
|
||||
Player targetOpponent = game.getPlayer(this.getTargetPointer().getFirst(game, source));
|
||||
if (targetOpponent != null) {
|
||||
if (targetOpponent.getHand().size() > 0) {
|
||||
if (!targetOpponent.getHand().isEmpty()) {
|
||||
TargetCardInHand target = new TargetCardInHand();
|
||||
target.setNotTarget(true);
|
||||
target.setTargetName("a card from your hand to put on top of your library");
|
||||
|
|
|
|||
|
|
@ -93,7 +93,7 @@ class ChitteringRatsEffect extends OneShotEffect {
|
|||
public boolean apply(Game game, Ability source) {
|
||||
Player targetOpponent = game.getPlayer(this.getTargetPointer().getFirst(game, source));
|
||||
if (targetOpponent != null) {
|
||||
if (targetOpponent.getHand().size() > 0) {
|
||||
if (!targetOpponent.getHand().isEmpty()) {
|
||||
TargetCardInHand target = new TargetCardInHand();
|
||||
target.setNotTarget(true);
|
||||
target.setTargetName("a card from your hand to put on top of your library");
|
||||
|
|
|
|||
|
|
@ -151,7 +151,7 @@ class ChorusOfTheConclaveReplacementEffect extends ReplacementEffectImpl {
|
|||
payed = true;
|
||||
}
|
||||
}
|
||||
game.informPlayers(player.getLogName() + " pays {" + xValue + "}");
|
||||
game.informPlayers(player.getLogName() + " pays {" + xValue + '}');
|
||||
return xValue;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -107,14 +107,14 @@ class ChromeMoxEffect extends OneShotEffect {
|
|||
target.setNotTarget(true);
|
||||
Card cardToImprint = null;
|
||||
Permanent sourcePermanent = game.getPermanent(source.getSourceId());
|
||||
if (controller.getHand().size() > 0 && controller.choose(Outcome.Benefit, target, source.getSourceId(), game)) {
|
||||
if (!controller.getHand().isEmpty() && controller.choose(Outcome.Benefit, target, source.getSourceId(), game)) {
|
||||
cardToImprint = controller.getHand().get(target.getFirstTarget(), game);
|
||||
}
|
||||
if (sourcePermanent != null) {
|
||||
if (cardToImprint != null) {
|
||||
controller.moveCardsToExile(cardToImprint, source, game, true, source.getSourceId(), sourceObject.getIdName() + " (Imprint)");
|
||||
sourcePermanent.imprint(cardToImprint.getId(), game);
|
||||
sourcePermanent.addInfo("imprint", CardUtil.addToolTipMarkTags("[Imprinted card - " + GameLog.getColoredObjectIdNameForTooltip(cardToImprint) + "]"), game);
|
||||
sourcePermanent.addInfo("imprint", CardUtil.addToolTipMarkTags("[Imprinted card - " + GameLog.getColoredObjectIdNameForTooltip(cardToImprint) + ']'), game);
|
||||
} else {
|
||||
sourcePermanent.addInfo("imprint", CardUtil.addToolTipMarkTags("[Imprinted card - None]"), game);
|
||||
}
|
||||
|
|
@ -154,7 +154,7 @@ class ChromeMoxManaEffect extends ManaEffect {
|
|||
Player player = game.getPlayer(source.getControllerId());
|
||||
if (permanent != null && player != null) {
|
||||
List<UUID> imprinted = permanent.getImprinted();
|
||||
if (imprinted.size() > 0) {
|
||||
if (!imprinted.isEmpty()) {
|
||||
Card imprintedCard = game.getCard(imprinted.get(0));
|
||||
if (imprintedCard != null) {
|
||||
Choice choice = new ChoiceColor(true);
|
||||
|
|
@ -177,7 +177,7 @@ class ChromeMoxManaEffect extends ManaEffect {
|
|||
choice.getChoices().add("White");
|
||||
}
|
||||
|
||||
if (choice.getChoices().size() > 0) {
|
||||
if (!choice.getChoices().isEmpty()) {
|
||||
Mana mana = new Mana();
|
||||
if (choice.getChoices().size() == 1) {
|
||||
choice.setChoice(choice.getChoices().iterator().next());
|
||||
|
|
|
|||
|
|
@ -127,7 +127,7 @@ class ChronatogTotemAbility extends LimitedTimesPerTurnActivatedAbility {
|
|||
public String getRule() {
|
||||
StringBuilder sb = new StringBuilder(super.getRule());
|
||||
sb.deleteCharAt(sb.length() - 1); // remove last '.'
|
||||
sb.append(" and only if ").append(condition.toString()).append(".");
|
||||
sb.append(" and only if ").append(condition.toString()).append('.');
|
||||
return sb.toString();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -60,7 +60,7 @@ public class CircleOfProtectionWhite extends CardImpl {
|
|||
|
||||
// {1}: The next time a white source of your choice would deal damage to you this turn, prevent that damage.
|
||||
Effect effect = new PreventNextDamageFromChosenSourceToYouEffect(Duration.EndOfTurn, filter);
|
||||
this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, effect, new ManaCostsImpl("1")));;
|
||||
this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, effect, new ManaCostsImpl("1")));
|
||||
}
|
||||
|
||||
public CircleOfProtectionWhite(final CircleOfProtectionWhite card) {
|
||||
|
|
|
|||
|
|
@ -106,7 +106,7 @@ class CitanulFluteSearchEffect extends OneShotEffect {
|
|||
|
||||
TargetCardInLibrary target = new TargetCardInLibrary(filter);
|
||||
if (player.searchLibrary(target, game)) {
|
||||
if (target.getTargets().size() > 0) {
|
||||
if (!target.getTargets().isEmpty()) {
|
||||
Card card = player.getLibrary().getCard(target.getFirstTarget(), game);
|
||||
Cards cards = new CardsImpl();
|
||||
if (card != null){
|
||||
|
|
|
|||
|
|
@ -94,7 +94,7 @@ class ClockspinningAddOrRemoveCounterEffect extends OneShotEffect {
|
|||
|
||||
private Counter selectCounterType(Game game, Ability source, Permanent permanent) {
|
||||
Player controller = game.getPlayer(source.getControllerId());
|
||||
if (controller != null && permanent.getCounters(game).size() > 0) {
|
||||
if (controller != null && !permanent.getCounters(game).isEmpty()) {
|
||||
String counterName = null;
|
||||
if (permanent.getCounters(game).size() > 1) {
|
||||
Choice choice = new ChoiceImpl(true);
|
||||
|
|
@ -122,7 +122,7 @@ class ClockspinningAddOrRemoveCounterEffect extends OneShotEffect {
|
|||
|
||||
private Counter selectCounterType(Game game, Ability source, Card card) {
|
||||
Player controller = game.getPlayer(source.getControllerId());
|
||||
if (controller != null && card.getCounters(game).size() > 0) {
|
||||
if (controller != null && !card.getCounters(game).isEmpty()) {
|
||||
String counterName = null;
|
||||
if (card.getCounters(game).size() > 1) {
|
||||
Choice choice = new ChoiceImpl(true);
|
||||
|
|
|
|||
|
|
@ -120,7 +120,7 @@ class CloneShellEffect extends OneShotEffect {
|
|||
target1.clearChosen();
|
||||
}
|
||||
|
||||
if (cards.size() > 0) {
|
||||
if (!cards.isEmpty()) {
|
||||
TargetCard target2 = new TargetCard(Zone.LIBRARY, filter2);
|
||||
while (player.canRespond() && cards.size() > 1) {
|
||||
player.choose(Outcome.Benefit, cards, target2, game);
|
||||
|
|
@ -163,7 +163,7 @@ class CloneShellDiesEffect extends OneShotEffect {
|
|||
Permanent permanent = (Permanent) game.getLastKnownInformation(source.getSourceId(), Zone.BATTLEFIELD);
|
||||
if (permanent != null) {
|
||||
List<UUID> imprinted = permanent.getImprinted();
|
||||
if (imprinted.size() > 0) {
|
||||
if (!imprinted.isEmpty()) {
|
||||
Card imprintedCard = game.getCard(imprinted.get(0));
|
||||
imprintedCard.setFaceDown(false, game);
|
||||
if (imprintedCard.getCardType().contains(CardType.CREATURE)) {
|
||||
|
|
|
|||
|
|
@ -117,7 +117,7 @@ class CobraTrapWatcher extends Watcher {
|
|||
if (event.getType() == EventType.DESTROYED_PERMANENT) {
|
||||
Permanent perm = (Permanent) game.getPermanentOrLKIBattlefield(event.getTargetId()); // can regenerate or be indestructible
|
||||
if (perm != null && !perm.getCardType().contains(CardType.CREATURE)) {
|
||||
if (game.getStack().size() > 0) {
|
||||
if (!game.getStack().isEmpty()) {
|
||||
StackObject spell = game.getStack().getStackObject(event.getSourceId());
|
||||
if (spell != null && game.getOpponents(perm.getControllerId()).contains(spell.getControllerId())) {
|
||||
players.add(perm.getControllerId());
|
||||
|
|
|
|||
|
|
@ -80,7 +80,7 @@ class CollectiveRestraintPayManaToAttackAllEffect extends CantAttackYouUnlessPay
|
|||
public ManaCosts getManaCostToPay(GameEvent event, Ability source, Game game) {
|
||||
int domainValue = new DomainValue().calculate(game, source, this);
|
||||
if (domainValue > 0) {
|
||||
return new ManaCostsImpl<>("{" + domainValue + "}");
|
||||
return new ManaCostsImpl<>("{" + domainValue + '}');
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -108,7 +108,7 @@ class ConfiscationCoupEffect extends OneShotEffect {
|
|||
for (int i = 0; i < targetPermanent.getManaCost().convertedManaCost(); i++) {
|
||||
energy += "{E}";
|
||||
}
|
||||
if (controller.chooseUse(outcome, "Pay " + energy + " to get control of " + targetPermanent.getLogName() + "?", source, game)) {
|
||||
if (controller.chooseUse(outcome, "Pay " + energy + " to get control of " + targetPermanent.getLogName() + '?', source, game)) {
|
||||
if (cost.pay(source, game, source.getSourceId(), source.getControllerId(), true)) {
|
||||
ContinuousEffect controllEffect = new GainControlTargetEffect(Duration.Custom);
|
||||
controllEffect.setTargetPointer(new FixedTarget(targetPermanent, game));
|
||||
|
|
|
|||
|
|
@ -109,7 +109,7 @@ class ConfluxEffect extends OneShotEffect {
|
|||
|
||||
if (you != null && you.getLibrary().size() > 0) {
|
||||
if (you.searchLibrary(targetWhite, game)) {
|
||||
if (targetWhite.getTargets().size() > 0) {
|
||||
if (!targetWhite.getTargets().isEmpty()) {
|
||||
for (UUID cardId : (List<UUID>) targetWhite.getTargets()) {
|
||||
Card card = you.getLibrary().remove(cardId, game);
|
||||
if (card != null) {
|
||||
|
|
@ -121,7 +121,7 @@ class ConfluxEffect extends OneShotEffect {
|
|||
}
|
||||
if (you != null && you.getLibrary().size() > 0) {
|
||||
if (you.searchLibrary(targetBlue, game)) {
|
||||
if (targetBlue.getTargets().size() > 0) {
|
||||
if (!targetBlue.getTargets().isEmpty()) {
|
||||
for (UUID cardId : (List<UUID>) targetBlue.getTargets()) {
|
||||
Card card = you.getLibrary().remove(cardId, game);
|
||||
if (card != null) {
|
||||
|
|
@ -133,7 +133,7 @@ class ConfluxEffect extends OneShotEffect {
|
|||
}
|
||||
if (you != null && you.getLibrary().size() > 0) {
|
||||
if (you.searchLibrary(targetBlack, game)) {
|
||||
if (targetBlack.getTargets().size() > 0) {
|
||||
if (!targetBlack.getTargets().isEmpty()) {
|
||||
for (UUID cardId : (List<UUID>) targetBlack.getTargets()) {
|
||||
Card card = you.getLibrary().remove(cardId, game);
|
||||
if (card != null) {
|
||||
|
|
@ -145,7 +145,7 @@ class ConfluxEffect extends OneShotEffect {
|
|||
}
|
||||
if (you != null && you.getLibrary().size() > 0) {
|
||||
if (you.searchLibrary(targetRed, game)) {
|
||||
if (targetRed.getTargets().size() > 0) {
|
||||
if (!targetRed.getTargets().isEmpty()) {
|
||||
for (UUID cardId : (List<UUID>) targetRed.getTargets()) {
|
||||
Card card = you.getLibrary().remove(cardId, game);
|
||||
if (card != null) {
|
||||
|
|
@ -157,7 +157,7 @@ class ConfluxEffect extends OneShotEffect {
|
|||
}
|
||||
if (you != null && you.getLibrary().size() > 0) {
|
||||
if (you.searchLibrary(targetGreen, game)) {
|
||||
if (targetGreen.getTargets().size() > 0) {
|
||||
if (!targetGreen.getTargets().isEmpty()) {
|
||||
for (UUID cardId : (List<UUID>) targetGreen.getTargets()) {
|
||||
Card card = you.getLibrary().remove(cardId, game);
|
||||
if (card != null) {
|
||||
|
|
|
|||
|
|
@ -106,7 +106,7 @@ public class ConfusionInTheRanks extends CardImpl {
|
|||
if (!message.isEmpty()) {
|
||||
message += "or ";
|
||||
}
|
||||
message += cardTypeEntering.toString().toLowerCase() + " ";
|
||||
message += cardTypeEntering.toString().toLowerCase() + ' ';
|
||||
}
|
||||
filterTarget.add(Predicates.or(cardTypesPredicates));
|
||||
message += "you do not control";
|
||||
|
|
|
|||
|
|
@ -95,7 +95,7 @@ class CongregationAtDawnEffect extends OneShotEffect {
|
|||
if (controller != null && sourceObject != null) {
|
||||
TargetCardInLibrary target = new TargetCardInLibrary(0, 3, new FilterCreatureCard("creature cards"));
|
||||
if (controller.searchLibrary(target, game)) {
|
||||
if (target.getTargets().size() > 0) {
|
||||
if (!target.getTargets().isEmpty()) {
|
||||
Cards revealed = new CardsImpl();
|
||||
for (UUID cardId : (List<UUID>) target.getTargets()) {
|
||||
Card card = controller.getLibrary().remove(cardId, game);
|
||||
|
|
|
|||
|
|
@ -100,7 +100,7 @@ class ConundrumSphinxEffect extends OneShotEffect {
|
|||
}
|
||||
}
|
||||
String cardName = cardChoice.getChoice();
|
||||
game.informPlayers("Conundrum Sphinx, player: " + player.getLogName() + ", named card: [" + cardName + "]");
|
||||
game.informPlayers("Conundrum Sphinx, player: " + player.getLogName() + ", named card: [" + cardName + ']');
|
||||
Card card = player.getLibrary().removeFromTop(game);
|
||||
Cards cards = new CardsImpl();
|
||||
cards.add(card);
|
||||
|
|
|
|||
|
|
@ -97,7 +97,7 @@ class SearchLibraryPutInGraveyard extends SearchEffect {
|
|||
Player controller = game.getPlayer(source.getControllerId());
|
||||
if (controller != null) {
|
||||
if (controller.searchLibrary(target, game)) {
|
||||
if (target.getTargets().size() > 0) {
|
||||
if (!target.getTargets().isEmpty()) {
|
||||
Card card = controller.getLibrary().getCard(target.getFirstTarget(), game);
|
||||
if (card != null) {
|
||||
controller.moveCards(card, Zone.GRAVEYARD, source, game);
|
||||
|
|
|
|||
|
|
@ -136,7 +136,7 @@ class CorruptedGrafstoneManaEffect extends ManaEffect {
|
|||
if (types.getWhite() > 0) {
|
||||
choice.getChoices().add("White");
|
||||
}
|
||||
if (choice.getChoices().size() > 0) {
|
||||
if (!choice.getChoices().isEmpty()) {
|
||||
Player player = game.getPlayer(source.getControllerId());
|
||||
|
||||
if (player != null) {
|
||||
|
|
|
|||
|
|
@ -93,7 +93,7 @@ class CosmicHorrorEffect extends OneShotEffect {
|
|||
Player controller = game.getPlayer(source.getControllerId());
|
||||
Permanent cosmicHorror = game.getPermanentOrLKIBattlefield(source.getSourceId());
|
||||
if (controller != null && cosmicHorror != null) {
|
||||
StringBuilder sb = new StringBuilder(cost.getText()).append("?");
|
||||
StringBuilder sb = new StringBuilder(cost.getText()).append('?');
|
||||
if (!sb.toString().toLowerCase().startsWith("exile ") && !sb.toString().toLowerCase().startsWith("return ")) {
|
||||
sb.insert(0, "Pay ");
|
||||
}
|
||||
|
|
|
|||
|
|
@ -118,7 +118,7 @@ class CouncilsGuardianEffect extends OneShotEffect {
|
|||
}
|
||||
chosenColors.put(color, 1);
|
||||
}
|
||||
game.informPlayers(player.getLogName() + " has chosen " + color.getDescription() + ".");
|
||||
game.informPlayers(player.getLogName() + " has chosen " + color.getDescription() + '.');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -98,7 +98,7 @@ class CranialExtractionEffect extends SearchTargetGraveyardHandLibraryForCardNam
|
|||
String cardName = cardChoice.getChoice();
|
||||
MageObject sourceObject = game.getObject(source.getSourceId());
|
||||
if (sourceObject != null) {
|
||||
game.informPlayers(sourceObject.getName() + " named card: [" + cardName + "]");
|
||||
game.informPlayers(sourceObject.getName() + " named card: [" + cardName + ']');
|
||||
}
|
||||
super.applySearchAndExile(game, source, cardName, player.getId());
|
||||
}
|
||||
|
|
|
|||
|
|
@ -98,7 +98,7 @@ class CultivateEffect extends OneShotEffect {
|
|||
}
|
||||
TargetCardInLibrary target = new TargetCardInLibrary(0, 2, new FilterBasicLandCard());
|
||||
if (controller.searchLibrary(target, game)) {
|
||||
if (target.getTargets().size() > 0) {
|
||||
if (!target.getTargets().isEmpty()) {
|
||||
Cards revealed = new CardsImpl();
|
||||
for (UUID cardId : target.getTargets()) {
|
||||
Card card = controller.getLibrary().getCard(cardId, game);
|
||||
|
|
|
|||
|
|
@ -140,7 +140,7 @@ class CurseOfChaosEffect extends OneShotEffect {
|
|||
public boolean apply(Game game, Ability source) {
|
||||
Player attacker = game.getPlayer(this.getTargetPointer().getFirst(game, source));
|
||||
if (attacker != null) {
|
||||
if (attacker.getHand().size() > 0 && attacker.chooseUse(outcome, "Discard a card and draw a card?", source, game)){
|
||||
if (!attacker.getHand().isEmpty() && attacker.chooseUse(outcome, "Discard a card and draw a card?", source, game)){
|
||||
attacker.discard(1, false, source, game);
|
||||
attacker.drawCards(1, game);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -166,7 +166,7 @@ class CurseOfEchoesEffect extends OneShotEffect {
|
|||
|
||||
@Override
|
||||
public String getText(Mode mode) {
|
||||
if (mode.getTargets().size() > 0) {
|
||||
if (!mode.getTargets().isEmpty()) {
|
||||
return "Copy target " + mode.getTargets().get(0).getTargetName() + ". You may choose new targets for the copy";
|
||||
}
|
||||
return "No target";
|
||||
|
|
|
|||
|
|
@ -93,7 +93,7 @@ class CursedScrollEffect extends OneShotEffect {
|
|||
MageObject sourceObject = game.getObject(source.getSourceId());
|
||||
String cardName = (String) game.getState().getValue(source.getSourceId().toString() + NameACardEffect.INFO_KEY);
|
||||
if (sourceObject != null && controller != null && cardName != null && !cardName.isEmpty()) {
|
||||
if (controller.getHand().size() > 0) {
|
||||
if (!controller.getHand().isEmpty()) {
|
||||
Cards revealed = new CardsImpl();
|
||||
Card card = controller.getHand().getRandom(game);
|
||||
revealed.add(card);
|
||||
|
|
|
|||
|
|
@ -261,7 +261,7 @@ class DanceOfTheDeadChangeAbilityEffect extends ContinuousEffectImpl implements
|
|||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
Permanent permanent = affectedObjectList.get(0).getPermanent(game);;
|
||||
Permanent permanent = affectedObjectList.get(0).getPermanent(game);
|
||||
if (permanent != null) {
|
||||
Ability abilityToRemove = null;
|
||||
for (Ability ability : permanent.getAbilities()) {
|
||||
|
|
|
|||
|
|
@ -116,7 +116,7 @@ class DarkSupplicantEffect extends OneShotEffect {
|
|||
// Library check
|
||||
if (player.chooseUse(Outcome.Benefit, "Do you want to search your library for Scion of Darkness?", source, game)) {
|
||||
if (player.searchLibrary(target, game)) {
|
||||
if (target.getTargets().size() > 0) {
|
||||
if (!target.getTargets().isEmpty()) {
|
||||
for (UUID cardId : (List<UUID>) target.getTargets()) {
|
||||
Card card = player.getLibrary().getCard(cardId, game);
|
||||
if (card != null) {
|
||||
|
|
|
|||
|
|
@ -148,7 +148,7 @@ class TransmuteArtifactEffect extends SearchEffect {
|
|||
}
|
||||
}
|
||||
if (sacrifice && controller.searchLibrary(target, game)) {
|
||||
if (target.getTargets().size() > 0) {
|
||||
if (!target.getTargets().isEmpty()) {
|
||||
for (UUID cardId : target.getTargets()) {
|
||||
Card card = controller.getLibrary().getCard(cardId, game);
|
||||
if (card != null) {
|
||||
|
|
|
|||
|
|
@ -95,9 +95,9 @@ class DashHopesCounterSourceEffect extends OneShotEffect {
|
|||
Player player = game.getPlayer(playerId);
|
||||
cost.clearPaid();
|
||||
if (cost.canPay(source, source.getSourceId(), player.getId(), game)
|
||||
&& player.chooseUse(outcome, "Pay 5 life to counter " + sourceObject.getIdName() + "?", source, game)) {
|
||||
&& player.chooseUse(outcome, "Pay 5 life to counter " + sourceObject.getIdName() + '?', source, game)) {
|
||||
if (cost.pay(source, game, source.getSourceId(), player.getId(), false, null)) {
|
||||
game.informPlayers(player.getLogName() + " pays 5 life to counter " + sourceObject.getIdName() + ".");
|
||||
game.informPlayers(player.getLogName() + " pays 5 life to counter " + sourceObject.getIdName() + '.');
|
||||
Spell spell = game.getStack().getSpell(source.getSourceId());
|
||||
if (spell != null) {
|
||||
game.getStack().counter(spell.getId(), source.getSourceId(), game);
|
||||
|
|
|
|||
|
|
@ -172,7 +172,7 @@ class DecayingSoilEffect extends OneShotEffect {
|
|||
public boolean apply(Game game, Ability source) {
|
||||
Player player = game.getPlayer(source.getControllerId());
|
||||
if (player != null) {
|
||||
if (player.chooseUse(Outcome.Benefit, " - Pay " + cost.getText() + "?", source, game)) {
|
||||
if (player.chooseUse(Outcome.Benefit, " - Pay " + cost.getText() + '?', source, game)) {
|
||||
cost.clearPaid();
|
||||
if (cost.pay(source, game, source.getSourceId(), source.getControllerId(), false, null)) {
|
||||
UUID target = this.getTargetPointer().getFirst(game, source);
|
||||
|
|
|
|||
|
|
@ -98,6 +98,7 @@ class DeclarationInStoneEffect extends OneShotEffect {
|
|||
nonTokenCount++;
|
||||
}
|
||||
} else {
|
||||
cardsToExile.add(targetPermanent);
|
||||
for (Permanent permanent : game.getBattlefield().getAllActivePermanents(new FilterCreaturePermanent(), targetPermanent.getControllerId(), game)) {
|
||||
if (!permanent.getId().equals(targetPermanent.getId())
|
||||
&& permanent.getName().equals(targetPermanent.getName())) {
|
||||
|
|
|
|||
|
|
@ -79,7 +79,7 @@ public class DeepfireElemental extends CardImpl {
|
|||
if (ability.getOriginalId().equals(originalId)) {
|
||||
ability.getTargets().clear();
|
||||
FilterPermanent newFilter = filter.copy();
|
||||
newFilter.setMessage(new StringBuilder("artifact or creature with converted mana cost {").append(ability.getManaCostsToPay().getX()).append("}").toString());
|
||||
newFilter.setMessage(new StringBuilder("artifact or creature with converted mana cost {").append(ability.getManaCostsToPay().getX()).append('}').toString());
|
||||
newFilter.add(new ConvertedManaCostPredicate(Filter.ComparisonType.Equal, ability.getManaCostsToPay().getX()));
|
||||
Target target = new TargetPermanent(newFilter);
|
||||
ability.addTarget(target);
|
||||
|
|
|
|||
|
|
@ -107,7 +107,7 @@ class DementiaSliverEffect extends OneShotEffect {
|
|||
MageObject sourceObject = game.getObject(source.getSourceId());
|
||||
String cardName = (String) game.getState().getValue(source.getSourceId().toString() + NameACardEffect.INFO_KEY);
|
||||
if (opponent != null && sourceObject != null && !cardName.isEmpty()) {
|
||||
if (opponent.getHand().size() > 0) {
|
||||
if (!opponent.getHand().isEmpty()) {
|
||||
Cards revealed = new CardsImpl();
|
||||
Card card = opponent.getHand().getRandom(game);
|
||||
if (card != null) {
|
||||
|
|
|
|||
|
|
@ -104,7 +104,7 @@ class DemonicHordesEffect extends OneShotEffect {
|
|||
Player controller = game.getPlayer(source.getControllerId());
|
||||
Permanent demonicHordes = game.getPermanentOrLKIBattlefield(source.getSourceId());
|
||||
if (controller != null && demonicHordes != null) {
|
||||
StringBuilder sb = new StringBuilder(cost.getText()).append("?");
|
||||
StringBuilder sb = new StringBuilder(cost.getText()).append('?');
|
||||
if (!sb.toString().toLowerCase().startsWith("exile ") && !sb.toString().toLowerCase().startsWith("return ")) {
|
||||
sb.insert(0, "Pay ");
|
||||
}
|
||||
|
|
|
|||
|
|
@ -123,7 +123,7 @@ class DeployTheGatewatchEffect extends OneShotEffect {
|
|||
}
|
||||
|
||||
// Put the rest on the bottom of your library in a random order
|
||||
while (cards.size() > 0) {
|
||||
while (!cards.isEmpty()) {
|
||||
Card card = cards.getRandom(game);
|
||||
if (card != null) {
|
||||
cards.remove(card);
|
||||
|
|
|
|||
|
|
@ -95,11 +95,11 @@ class DescendantOfMasumaroEffect extends OneShotEffect {
|
|||
Player controller = game.getPlayer(source.getControllerId());
|
||||
Permanent sourcePermanent = game.getPermanent(source.getSourceId());
|
||||
if (controller != null && sourcePermanent != null) {
|
||||
if (controller.getHand().size() > 0) {
|
||||
if (!controller.getHand().isEmpty()) {
|
||||
new AddCountersSourceEffect(CounterType.P1P1.createInstance(controller.getHand().size()), true).apply(game, source);
|
||||
}
|
||||
Player targetOpponent = game.getPlayer(getTargetPointer().getFirst(game, source));
|
||||
if (targetOpponent != null && targetOpponent.getHand().size() > 0) {
|
||||
if (targetOpponent != null && !targetOpponent.getHand().isEmpty()) {
|
||||
sourcePermanent.removeCounters(CounterType.P1P1.getName(), targetOpponent.getHand().size(), game);
|
||||
game.informPlayers(controller.getLogName() + " removes " + targetOpponent.getHand().size() + " +1/+1 counters from " + sourcePermanent.getLogName());
|
||||
}
|
||||
|
|
|
|||
|
|
@ -98,7 +98,7 @@ class DevoutInvocationEffect extends OneShotEffect {
|
|||
Map<String, Serializable> options = new HashMap<>();
|
||||
options.put("UI.right.btn.text", "Tapping complete");
|
||||
controller.choose(outcome, target, source.getControllerId(), game, options);
|
||||
if (target.getTargets().size() > 0) {
|
||||
if (!target.getTargets().isEmpty()) {
|
||||
UUID creature = target.getFirstTarget();
|
||||
if (creature != null) {
|
||||
game.getPermanent(creature).tap(game);
|
||||
|
|
|
|||
|
|
@ -93,7 +93,7 @@ class DieYoungEffect extends OneShotEffect {
|
|||
if (controller != null) {
|
||||
new GetEnergyCountersControllerEffect(2).apply(game, source);
|
||||
int max = controller.getCounters().getCount(CounterType.ENERGY);
|
||||
int numberToPayed = controller.getAmount(0, max, "How many energy counters do you like to pay? (maximum = " + max + ")", game);
|
||||
int numberToPayed = controller.getAmount(0, max, "How many energy counters do you like to pay? (maximum = " + max + ')', game);
|
||||
if (numberToPayed > 0) {
|
||||
Cost cost = new PayEnergyCost(numberToPayed);
|
||||
if (cost.pay(source, game, source.getSourceId(), source.getControllerId(), true)) {
|
||||
|
|
|
|||
|
|
@ -126,7 +126,7 @@ class DiluvianPrimordialEffect extends OneShotEffect {
|
|||
if (target instanceof TargetCardInOpponentsGraveyard) {
|
||||
Card targetCard = game.getCard(target.getFirstTarget());
|
||||
if (targetCard != null) {
|
||||
if (controller.chooseUse(outcome, "Cast " + targetCard.getLogName() + "?", source, game)) {
|
||||
if (controller.chooseUse(outcome, "Cast " + targetCard.getLogName() + '?', source, game)) {
|
||||
if (controller.cast(targetCard.getSpellAbility(), game, true)) {
|
||||
ContinuousEffect effect = new DiluvianPrimordialReplacementEffect();
|
||||
effect.setTargetPointer(new FixedTarget(targetCard.getId(), game.getState().getZoneChangeCounter(targetCard.getId())));
|
||||
|
|
|
|||
|
|
@ -120,7 +120,7 @@ class DimirCharmEffect extends OneShotEffect {
|
|||
cards.add(card);
|
||||
}
|
||||
}
|
||||
if(cards.size() > 0){
|
||||
if(!cards.isEmpty()){
|
||||
TargetCard target = new TargetCard(Zone.LIBRARY, new FilterCard("Card to put back on top of library"));
|
||||
if(controller.chooseTarget(Outcome.Benefit, cards, target, source, game)){
|
||||
Card card = cards.get(target.getFirstTarget(), game);
|
||||
|
|
|
|||
|
|
@ -108,7 +108,7 @@ class DimirMachinationsEffect extends OneShotEffect {
|
|||
cards.remove(card);
|
||||
}
|
||||
}
|
||||
while (cards.size() > 0) {
|
||||
while (!cards.isEmpty()) {
|
||||
if (cards.size() == 1) {
|
||||
Card card = cards.get(cards.iterator().next(), game);
|
||||
controller.moveCardToLibraryWithInfo(card, source.getSourceId(), game, Zone.LIBRARY, true, false);
|
||||
|
|
|
|||
|
|
@ -125,7 +125,7 @@ class DivergentTransformationsEffect extends OneShotEffect {
|
|||
card.putOntoBattlefield(game, Zone.LIBRARY, source.getSourceId(), player.getId());
|
||||
}
|
||||
|
||||
if (cards.size() > 0) {
|
||||
if (!cards.isEmpty()) {
|
||||
player.revealCards(sourceObject.getIdName(), cards, game);
|
||||
Set<Card> cardsToShuffle = cards.getCards(game);
|
||||
cardsToShuffle.remove(card);
|
||||
|
|
|
|||
|
|
@ -130,7 +130,7 @@ class DracoplasmEffect extends ReplacementEffectImpl {
|
|||
return false;
|
||||
}
|
||||
controller.chooseTarget(Outcome.Detriment, target, source, game);
|
||||
if (target.getTargets().size() > 0) {
|
||||
if (!target.getTargets().isEmpty()) {
|
||||
int power = 0;
|
||||
int toughness = 0;
|
||||
for (UUID targetId : target.getTargets()) {
|
||||
|
|
|
|||
|
|
@ -121,7 +121,7 @@ class DralnusPetEffect extends OneShotEffect {
|
|||
&& permanent.getZoneChangeCounter(game) == spellAbility.getSourceObjectZoneChangeCounter()) {
|
||||
int cmc = 0;
|
||||
for (Cost cost : spellAbility.getCosts()) {
|
||||
if (cost instanceof DiscardCardCost && ((DiscardCardCost) cost).getCards().size() > 0) {
|
||||
if (cost instanceof DiscardCardCost && !((DiscardCardCost) cost).getCards().isEmpty()) {
|
||||
cmc = ((DiscardCardCost) cost).getCards().get(0).getConvertedManaCost();
|
||||
}
|
||||
if (cmc > 0) {
|
||||
|
|
|
|||
|
|
@ -108,7 +108,7 @@ class ExileTargetEffect extends OneShotEffect {
|
|||
if (permanent != null) {
|
||||
if(sourcePermananent != null){
|
||||
sourcePermananent.imprint(permanent.getId(), game);
|
||||
sourcePermananent.addInfo("imprint", new StringBuilder("[Imprinted card - ").append(permanent.getName()).append("]").toString(), game);
|
||||
sourcePermananent.addInfo("imprint", new StringBuilder("[Imprinted card - ").append(permanent.getName()).append(']').toString(), game);
|
||||
}
|
||||
return permanent.moveToExile(null, null, source.getSourceId(), game);
|
||||
}
|
||||
|
|
@ -143,7 +143,7 @@ class DuplicantContinuousEffect extends ContinuousEffectImpl {
|
|||
public boolean apply(Layer layer, SubLayer sublayer, Ability source, Game game) {
|
||||
Permanent permanent = game.getPermanent(source.getSourceId());
|
||||
if (permanent != null) {
|
||||
if(permanent.getImprinted().size() > 0){
|
||||
if(!permanent.getImprinted().isEmpty()){
|
||||
Card card = game.getCard(permanent.getImprinted().get(0));
|
||||
if(card != null && card.getCardType().contains(CardType.CREATURE))
|
||||
{
|
||||
|
|
|
|||
|
|
@ -144,8 +144,8 @@ public class DustOfMoments extends CardImpl {
|
|||
}
|
||||
if (!game.isSimulation()) {
|
||||
game.informPlayers(new StringBuilder(sourceObject.getName()).append(": ")
|
||||
.append(controller.getLogName()).append(getActionStr()).append("s")
|
||||
.append(counter.getCount()).append(" ").append(counterName.toLowerCase())
|
||||
.append(controller.getLogName()).append(getActionStr()).append('s')
|
||||
.append(counter.getCount()).append(' ').append(counterName.toLowerCase())
|
||||
.append(" counter on ").append(card.getName()).toString());
|
||||
}
|
||||
}
|
||||
|
|
@ -170,7 +170,7 @@ public class DustOfMoments extends CardImpl {
|
|||
if (!game.isSimulation()) {
|
||||
game.informPlayers(new StringBuilder(sourceObject.getName()).append(": ")
|
||||
.append(controller.getLogName()).append(getActionStr()).append("s ")
|
||||
.append(counter.getCount()).append(" ").append(counterName.toLowerCase())
|
||||
.append(counter.getCount()).append(' ').append(counterName.toLowerCase())
|
||||
.append(" counter on ").append(card.getName()).toString());
|
||||
}
|
||||
}
|
||||
|
|
@ -185,7 +185,7 @@ public class DustOfMoments extends CardImpl {
|
|||
StringBuilder sb = new StringBuilder();
|
||||
sb.append(getActionStr());
|
||||
if (counter.getCount() > 1) {
|
||||
sb.append(Integer.toString(counter.getCount())).append(" ").append(counter.getName().toLowerCase()).append(" counters on each ");
|
||||
sb.append(Integer.toString(counter.getCount())).append(' ').append(counter.getName().toLowerCase()).append(" counters on each ");
|
||||
} else {
|
||||
sb.append("a ").append(counter.getName().toLowerCase()).append(" counter on each ");
|
||||
}
|
||||
|
|
|
|||
|
|
@ -96,7 +96,7 @@ class EldritchEvolutionEffect extends OneShotEffect {
|
|||
for (Cost cost : source.getCosts()) {
|
||||
if (cost instanceof SacrificeTargetCost) {
|
||||
SacrificeTargetCost sacrificeCost = (SacrificeTargetCost) cost;
|
||||
if (sacrificeCost.getPermanents().size() > 0) {
|
||||
if (!sacrificeCost.getPermanents().isEmpty()) {
|
||||
sacrificedPermanent = sacrificeCost.getPermanents().get(0);
|
||||
}
|
||||
break;
|
||||
|
|
|
|||
|
|
@ -118,7 +118,7 @@ class EliteArcanistImprintEffect extends OneShotEffect {
|
|||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
Player player = game.getPlayer(source.getControllerId());
|
||||
if (player.getHand().size() > 0) {
|
||||
if (!player.getHand().isEmpty()) {
|
||||
TargetCard target = new TargetCard(Zone.HAND, filter);
|
||||
if (target.canChoose(source.getSourceId(), source.getControllerId(), game)
|
||||
&& player.choose(Outcome.Benefit, player.getHand(), target, game)) {
|
||||
|
|
@ -128,7 +128,7 @@ class EliteArcanistImprintEffect extends OneShotEffect {
|
|||
Permanent permanent = game.getPermanent(source.getSourceId());
|
||||
if (permanent != null) {
|
||||
permanent.imprint(card.getId(), game);
|
||||
permanent.addInfo("imprint", new StringBuilder("[Exiled card - ").append(card.getName()).append("]").toString(), game);
|
||||
permanent.addInfo("imprint", new StringBuilder("[Exiled card - ").append(card.getName()).append(']').toString(), game);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -105,7 +105,7 @@ class EndlessHorizonsEffect extends SearchEffect {
|
|||
if (you != null) {
|
||||
if (you.searchLibrary(target, game)) {
|
||||
UUID exileZone = CardUtil.getCardExileZoneId(game, source);
|
||||
if (target.getTargets().size() > 0) {
|
||||
if (!target.getTargets().isEmpty()) {
|
||||
for (UUID cardId : target.getTargets()) {
|
||||
Card card = you.getLibrary().getCard(cardId, game);
|
||||
if (card != null) {
|
||||
|
|
|
|||
|
|
@ -101,7 +101,7 @@ class EpicExperimentEffect extends OneShotEffect {
|
|||
return true;
|
||||
}
|
||||
cardsToCast.addAll(epicExperimentExileZone.getCards(filter, source.getSourceId(), source.getControllerId(), game));
|
||||
while (cardsToCast.size() > 0) {
|
||||
while (!cardsToCast.isEmpty()) {
|
||||
if (!controller.chooseUse(Outcome.PlayForFree, "Cast (another) a card exiled with " + sourceObject.getLogName() + " without paying its mana cost?", source, game)) {
|
||||
break;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -160,13 +160,13 @@ class EpiphanyAtTheDrownyardEffect extends OneShotEffect {
|
|||
}
|
||||
game.informPlayers(sb.toString());
|
||||
|
||||
sb = new StringBuilder(sourceObject.getLogName() + ": Pile 2, going to ").append(pile2Zone.equals(Zone.HAND) ? "Hand" : "Graveyard").append(":");
|
||||
sb = new StringBuilder(sourceObject.getLogName() + ": Pile 2, going to ").append(pile2Zone.equals(Zone.HAND) ? "Hand" : "Graveyard").append(':');
|
||||
i = 0;
|
||||
for (UUID cardUuid : pile2CardsIds) {
|
||||
Card card = game.getCard(cardUuid);
|
||||
if (card != null) {
|
||||
i++;
|
||||
sb.append(" ").append(GameLog.getColoredObjectName(card));
|
||||
sb.append(' ').append(GameLog.getColoredObjectName(card));
|
||||
if (i < pile2CardsIds.size()) {
|
||||
sb.append(", ");
|
||||
}
|
||||
|
|
|
|||
|
|
@ -91,8 +91,8 @@ public class Excavator extends CardImpl {
|
|||
|
||||
class ExcavatorEffect extends ContinuousEffectImpl implements SourceEffect {
|
||||
|
||||
private Abilities<Ability> abilities = new AbilitiesImpl();;
|
||||
|
||||
private Abilities<Ability> abilities = new AbilitiesImpl();
|
||||
|
||||
public ExcavatorEffect() {
|
||||
super(Duration.EndOfTurn, Layer.AbilityAddingRemovingEffects_6, SubLayer.NA, Outcome.AddAbility);
|
||||
setText("Target creature gains landwalk of each of the land types of the sacrificed land until end of turn");
|
||||
|
|
|
|||
|
|
@ -128,7 +128,7 @@ class ExclusionRitualReplacementEffect extends ContinuousRuleModifyingEffectImpl
|
|||
Permanent sourcePermanent = game.getPermanent(source.getSourceId());
|
||||
Card card = game.getCard(event.getSourceId());
|
||||
if (sourcePermanent != null && card != null) {
|
||||
if (sourcePermanent.getImprinted().size() > 0) {
|
||||
if (!sourcePermanent.getImprinted().isEmpty()) {
|
||||
Card imprintedCard = game.getCard(sourcePermanent.getImprinted().get(0));
|
||||
if (imprintedCard != null) {
|
||||
return card.getName().equals(imprintedCard.getName());
|
||||
|
|
|
|||
|
|
@ -156,7 +156,7 @@ class ExpropriateDilemmaEffect extends CouncilsDilemmaVoteEffect {
|
|||
for (UUID playerId : game.getState().getPlayersInRange(controller.getId(), game)) {
|
||||
Player player = game.getPlayer(playerId);
|
||||
if (player != null) {
|
||||
if (player.chooseUse(Outcome.Vote, "Choose " + choiceOne + "?", source, game)) {
|
||||
if (player.chooseUse(Outcome.Vote, "Choose " + choiceOne + '?', source, game)) {
|
||||
voteOneCount++;
|
||||
game.informPlayers(player.getName() + " has voted for " + choiceOne);
|
||||
} else {
|
||||
|
|
|
|||
|
|
@ -103,7 +103,7 @@ class ExtraplanarLensImprintEffect extends OneShotEffect {
|
|||
if (targetLand != null) {
|
||||
targetLand.moveToExile(null, extraplanarLens.getName() + " (Imprint)", source.getSourceId(), game);
|
||||
extraplanarLens.imprint(targetLand.getId(), game);
|
||||
extraplanarLens.addInfo("imprint", CardUtil.addToolTipMarkTags("[Imprinted card - " + targetLand.getLogName() + "]"), game);
|
||||
extraplanarLens.addInfo("imprint", CardUtil.addToolTipMarkTags("[Imprinted card - " + targetLand.getLogName() + ']'), game);
|
||||
}
|
||||
}
|
||||
return true;
|
||||
|
|
|
|||
|
|
@ -154,7 +154,7 @@ class EyeOfTheStormEffect1 extends OneShotEffect {
|
|||
if (spellController.moveCardsToExile(spell, source, game, true, exileZoneId, eyeOfTheStorm.getIdName())) {
|
||||
eyeOfTheStorm.imprint(card.getId(), game);
|
||||
|
||||
if (eyeOfTheStorm.getImprinted() != null && eyeOfTheStorm.getImprinted().size() > 0) {
|
||||
if (eyeOfTheStorm.getImprinted() != null && !eyeOfTheStorm.getImprinted().isEmpty()) {
|
||||
CardsImpl copiedCards = new CardsImpl();
|
||||
for (UUID uuid : eyeOfTheStorm.getImprinted()) {
|
||||
card = game.getCard(uuid);
|
||||
|
|
|
|||
|
|
@ -137,11 +137,11 @@ class FactOrFictionEffect extends OneShotEffect {
|
|||
}
|
||||
game.informPlayers(sb.toString());
|
||||
|
||||
sb = new StringBuilder("Pile 2, going to ").append(pile2Zone.equals(Zone.HAND)?"Hand":"Graveyard").append (":");
|
||||
sb = new StringBuilder("Pile 2, going to ").append(pile2Zone.equals(Zone.HAND)?"Hand":"Graveyard").append (':');
|
||||
i = 0;
|
||||
for (Card card: pile2) {
|
||||
i++;
|
||||
sb.append(" ").append(card.getName());
|
||||
sb.append(' ').append(card.getName());
|
||||
if (i < pile2.size()) {
|
||||
sb.append(", ");
|
||||
}
|
||||
|
|
|
|||
|
|
@ -121,7 +121,7 @@ class FaerieArtisansEffect extends OneShotEffect {
|
|||
StringBuilder sb = new StringBuilder();
|
||||
for (Permanent permanent : effect.getAddedPermanent()) {
|
||||
if (sb.length() > 0) {
|
||||
sb.append(";");
|
||||
sb.append(';');
|
||||
}
|
||||
sb.append(permanent.getId());
|
||||
}
|
||||
|
|
|
|||
|
|
@ -113,7 +113,7 @@ class FatespinnerChooseEffect extends OneShotEffect {
|
|||
}
|
||||
}
|
||||
String chosenPhase = choice.getChoice();
|
||||
game.informPlayers(player.getLogName() + " has chosen to skip " + chosenPhase.toLowerCase() + ".");
|
||||
game.informPlayers(player.getLogName() + " has chosen to skip " + chosenPhase.toLowerCase() + '.');
|
||||
game.addEffect(new FatespinnerSkipEffect(chosenPhase), source);
|
||||
return true;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -162,7 +162,7 @@ class FellShepherdEffect extends OneShotEffect {
|
|||
Card card = game.getCard(creatureId);
|
||||
if (card != null) {
|
||||
card.moveToZone(Zone.HAND, source.getSourceId(), game, false);
|
||||
sb.append(" ").append(card.getName());
|
||||
sb.append(' ').append(card.getName());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -95,7 +95,7 @@ class FirestormEffect extends OneShotEffect {
|
|||
Player you = game.getPlayer(source.getControllerId());
|
||||
int amount = (new GetXValue()).calculate(game, source, this);
|
||||
if (you != null) {
|
||||
if (source.getTargets().size() > 0) {
|
||||
if (!source.getTargets().isEmpty()) {
|
||||
for (UUID targetId : this.getTargetPointer().getTargets(game, source)) {
|
||||
Permanent creature = game.getPermanent(targetId);
|
||||
if (creature != null) {
|
||||
|
|
|
|||
|
|
@ -115,7 +115,7 @@ class FlamesOfRemembranceExileEffect extends OneShotEffect {
|
|||
cards.add(card);
|
||||
}
|
||||
}
|
||||
if (cards.size() > 0) {
|
||||
if (!cards.isEmpty()) {
|
||||
List<UUID> cardsId = new ArrayList<>();
|
||||
for (Card card : cards) {
|
||||
card.moveToExile(source.getSourceId(), "Flames of Remembrance", source.getSourceId(), game);
|
||||
|
|
|
|||
|
|
@ -101,7 +101,7 @@ class FlashEffect extends OneShotEffect {
|
|||
card.putOntoBattlefield(game, Zone.HAND, source.getSourceId(), source.getControllerId());
|
||||
|
||||
ManaCosts<ManaCost> reducedCost = CardUtil.removeVariableManaCost(CardUtil.reduceCost(card.getManaCost(), 2));
|
||||
StringBuilder sb = new StringBuilder("Pay ").append(reducedCost.getText()).append("?");
|
||||
StringBuilder sb = new StringBuilder("Pay ").append(reducedCost.getText()).append('?');
|
||||
if (player.chooseUse(Outcome.Benefit, sb.toString(), source, game)) {
|
||||
reducedCost.clearPaid();
|
||||
if (reducedCost.pay(source, game, source.getSourceId(), source.getControllerId(), false, null)) {
|
||||
|
|
|
|||
|
|
@ -100,7 +100,7 @@ class FleshwritherEffect extends OneShotEffect {
|
|||
filter.add(new ConvertedManaCostPredicate(Filter.ComparisonType.Equal, sourceObject.getConvertedManaCost()));
|
||||
TargetCardInLibrary target = new TargetCardInLibrary(1, filter);
|
||||
if (controller.searchLibrary(target, game)) {
|
||||
if (target.getTargets().size() > 0) {
|
||||
if (!target.getTargets().isEmpty()) {
|
||||
Cards chosen = new CardsImpl(target.getTargets());
|
||||
controller.moveCards(chosen, Zone.BATTLEFIELD, source, game);
|
||||
}
|
||||
|
|
|
|||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue