mirror of
https://github.com/magefree/mage.git
synced 2025-12-22 03:22:00 -08:00
Code cleanup
This commit is contained in:
parent
ca4a4528fb
commit
85e65c8f44
10 changed files with 42 additions and 78 deletions
|
|
@ -398,7 +398,7 @@ public abstract class ContinuousEffectImpl extends EffectImpl implements Continu
|
|||
}
|
||||
}
|
||||
|
||||
public boolean isCanLookAtNextTopLibraryCard(Game game) {
|
||||
public boolean canLookAtNextTopLibraryCard(Game game) {
|
||||
// If the top card of your library changes while you’re casting a spell, playing a land, or activating an ability,
|
||||
// you can’t look at the new top card until you finish doing so. This means that if you cast the top card of
|
||||
// your library, you can’t look at the next one until you’re done paying for that spell. (2019-05-03)
|
||||
|
|
|
|||
|
|
@ -20,7 +20,6 @@ public class ChooseACardNameEffect extends OneShotEffect {
|
|||
public static final String INFO_KEY = "NAMED_CARD";
|
||||
|
||||
public enum TypeOfName {
|
||||
|
||||
ALL,
|
||||
NOT_BASIC_LAND_NAME,
|
||||
NONBASIC_LAND_NAME,
|
||||
|
|
|
|||
|
|
@ -39,7 +39,7 @@ public class LookAtTopCardOfLibraryAnyTimeEffect extends ContinuousEffectImpl {
|
|||
if (obj == null) {
|
||||
return false;
|
||||
}
|
||||
if (!isCanLookAtNextTopLibraryCard(game)) {
|
||||
if (!canLookAtNextTopLibraryCard(game)) {
|
||||
return false;
|
||||
}
|
||||
controller.lookAtCards("Top card of " + obj.getIdName() + " controller's library", topCard, game);
|
||||
|
|
|
|||
|
|
@ -44,11 +44,11 @@ public class PlayWithTheTopCardRevealedEffect extends ContinuousEffectImpl {
|
|||
if (allPlayers) {
|
||||
for (UUID playerId : game.getState().getPlayersInRange(controller.getId(), game)) {
|
||||
Player player = game.getPlayer(playerId);
|
||||
if (player != null && isCanLookAtNextTopLibraryCard(game)) {
|
||||
if (player != null && canLookAtNextTopLibraryCard(game)) {
|
||||
player.setTopCardRevealed(true);
|
||||
}
|
||||
}
|
||||
} else if (isCanLookAtNextTopLibraryCard(game)) {
|
||||
} else if (canLookAtNextTopLibraryCard(game)) {
|
||||
controller.setTopCardRevealed(true);
|
||||
}
|
||||
return true;
|
||||
|
|
|
|||
|
|
@ -456,6 +456,8 @@ public interface Player extends MageItem, Copyable<Player> {
|
|||
/**
|
||||
* Adds the cards to the reveal window and adds the source object's id name
|
||||
* to the title bar of the revealed cards window
|
||||
* <p>
|
||||
* Warning, if you use it from continuous effect, then check with extra call isCanLookAtNextTopLibraryCard
|
||||
*
|
||||
* @param source
|
||||
* @param name
|
||||
|
|
@ -472,6 +474,8 @@ public interface Player extends MageItem, Copyable<Player> {
|
|||
/**
|
||||
* Adds the cards to the look window and adds the source object's id name to
|
||||
* the title bar of the lookedAt window
|
||||
* <p>
|
||||
* Warning, if you use it from continuous effect, then check with extra call isCanLookAtNextTopLibraryCard
|
||||
*
|
||||
* @param source
|
||||
* @param name
|
||||
|
|
|
|||
|
|
@ -14,7 +14,6 @@ import mage.watchers.Watcher;
|
|||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import java.util.Map.Entry;
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue