1
0
Fork 0
mirror of https://github.com/correl/mage.git synced 2025-04-12 09:11:05 -09:00

* Some minor code and text clean up.

This commit is contained in:
LevelX2 2020-06-12 15:14:28 +02:00
parent bc2d5caa42
commit f480d0bebb
4 changed files with 13 additions and 12 deletions
Mage.Server.Plugins/Mage.Game.OathbreakerFreeForAll/src/mage/game
Mage.Sets/src/mage/cards/t
Mage/src/main/java/mage

View file

@ -25,8 +25,8 @@ import java.util.*;
public class OathbreakerFreeForAll extends GameCommanderImpl { public class OathbreakerFreeForAll extends GameCommanderImpl {
private int numPlayers; private int numPlayers;
private Map<UUID, Set<UUID>> playerSignatureSpells = new HashMap<>(); private final Map<UUID, Set<UUID>> playerSignatureSpells = new HashMap<>();
private Map<UUID, Set<UUID>> playerOathbreakers = new HashMap<>(); private final Map<UUID, Set<UUID>> playerOathbreakers = new HashMap<>();
private static final String COMMANDER_NAME_OATHBREAKER = "Oathbreaker"; private static final String COMMANDER_NAME_OATHBREAKER = "Oathbreaker";
private static final String COMMANDER_NAME_SIGNATURE_SPELL = "Signature Spell"; private static final String COMMANDER_NAME_SIGNATURE_SPELL = "Signature Spell";
@ -122,19 +122,19 @@ public class OathbreakerFreeForAll extends GameCommanderImpl {
if (player != null) { if (player != null) {
Set<UUID> commanders = this.playerOathbreakers.getOrDefault(player.getId(), new HashSet<>()); Set<UUID> commanders = this.playerOathbreakers.getOrDefault(player.getId(), new HashSet<>());
Set<UUID> spells = this.playerSignatureSpells.getOrDefault(player.getId(), new HashSet<>()); Set<UUID> spells = this.playerSignatureSpells.getOrDefault(player.getId(), new HashSet<>());
for (UUID id : player.getCommandersIds()) { for (UUID commanderId : getCommandersIds(player, commanderCardType)) {
switch (commanderCardType) { switch (commanderCardType) {
case ANY: case ANY:
res.add(id); res.add(commanderId);
break; break;
case COMMANDER_OR_OATHBREAKER: case COMMANDER_OR_OATHBREAKER:
if (commanders.contains(id)) { if (commanders.contains(commanderId)) {
res.add(id); res.add(commanderId);
} }
break; break;
case SIGNATURE_SPELL: case SIGNATURE_SPELL:
if (spells.contains(id)) { if (spells.contains(commanderId)) {
res.add(id); res.add(commanderId);
} }
break; break;
default: default:

View file

@ -54,7 +54,7 @@ class TreeOfPerditionEffect extends OneShotEffect {
public TreeOfPerditionEffect() { public TreeOfPerditionEffect() {
super(Outcome.Neutral); super(Outcome.Neutral);
staticText = "Exchange target opponent's life total with Tree of Perdition's toughness"; staticText = "Exchange target opponent's life total with {this}'s toughness";
} }
public TreeOfPerditionEffect(final TreeOfPerditionEffect effect) { public TreeOfPerditionEffect(final TreeOfPerditionEffect effect) {

View file

@ -55,8 +55,8 @@ public abstract class GameCommanderImpl extends GameImpl {
Player player = getPlayer(playerId); Player player = getPlayer(playerId);
if (player != null) { if (player != null) {
// add new commanders // add new commanders
for (UUID id : player.getSideboard()) { for (UUID cardId : player.getSideboard()) {
Card card = this.getCard(id); Card card = this.getCard(cardId);
if (card != null) { if (card != null) {
// Check for companions. If it is the only card in the sideboard, it is the commander, not a companion. // Check for companions. If it is the only card in the sideboard, it is the commander, not a companion.
if (player.getSideboard().size() > 1 && card.getAbilities(this).stream().anyMatch(ability -> ability instanceof CompanionAbility)) { if (player.getSideboard().size() > 1 && card.getAbilities(this).stream().anyMatch(ability -> ability instanceof CompanionAbility)) {

View file

@ -4272,7 +4272,8 @@ public abstract class PlayerImpl implements Player, Serializable {
cards.addAll(getLibrary().getTopCards(game, value)); cards.addAll(getLibrary().getTopCards(game, value));
if (!cards.isEmpty()) { if (!cards.isEmpty()) {
TargetCard target = new TargetCard(0, cards.size(), Zone.LIBRARY, TargetCard target = new TargetCard(0, cards.size(), Zone.LIBRARY,
new FilterCard("cards to PUT on the BOTTOM of your library (Scry)")); new FilterCard("card" + (cards.size() == 1 ? "":"s")
+ " to PUT on the BOTTOM of your library (Scry)"));
chooseTarget(Outcome.Benefit, cards, target, source, game); chooseTarget(Outcome.Benefit, cards, target, source, game);
putCardsOnBottomOfLibrary(new CardsImpl(target.getTargets()), game, source, true); putCardsOnBottomOfLibrary(new CardsImpl(target.getTargets()), game, source, true);
cards.removeAll(target.getTargets()); cards.removeAll(target.getTargets());