mirror of
https://github.com/magefree/mage.git
synced 2025-12-26 05:22:02 -08:00
* Fixed problems with win / lose restrictions in relation to empty draw condition (fixes #1681 #6553).
This commit is contained in:
parent
37f7389c17
commit
3aefbfb360
13 changed files with 107 additions and 34 deletions
|
|
@ -39,7 +39,7 @@ public class LookLibraryMayPutToBottomEffect extends OneShotEffect {
|
|||
if (sourceObject == null || controller == null) {
|
||||
return false;
|
||||
}
|
||||
if (!controller.getLibrary().isEmptyDraw()) {
|
||||
if (controller.getLibrary().hasCards()) {
|
||||
Card card = controller.getLibrary().getFromTop(game);
|
||||
if (card == null) {
|
||||
return false;
|
||||
|
|
|
|||
|
|
@ -61,12 +61,6 @@ public class MageDrawAction extends MageAction {
|
|||
if (!player.isTopCardRevealed() && numDrawn > 0) {
|
||||
game.fireInformEvent(player.getLogName() + " draws " + CardUtil.numberToText(numDrawn, "a") + " card" + (numDrawn > 1 ? "s" : ""));
|
||||
}
|
||||
if (player.isEmptyDraw()) {
|
||||
event = GameEvent.getEvent(GameEvent.EventType.EMPTY_DRAW, player.getId(), player.getId());
|
||||
if (!game.replaceEvent(event)) {
|
||||
game.doAction(new MageLoseGameAction(player, MageLoseGameAction.DRAW_REASON), sourceId);
|
||||
}
|
||||
}
|
||||
|
||||
setScore(player, score);
|
||||
game.setStateCheckRequired();
|
||||
|
|
|
|||
|
|
@ -1848,7 +1848,7 @@ public abstract class GameImpl implements Game, Serializable {
|
|||
for (Player player : state.getPlayers().values()) {
|
||||
if (!player.hasLost()
|
||||
&& ((player.getLife() <= 0 && player.canLoseByZeroOrLessLife())
|
||||
|| player.isEmptyDraw()
|
||||
|| player.getLibrary().isEmptyDraw()
|
||||
|| player.getCounters().getCount(CounterType.POISON) >= 10)) {
|
||||
player.lost(this);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -68,7 +68,6 @@ public class GameEvent implements Serializable {
|
|||
*/
|
||||
ZONE_CHANGE,
|
||||
ZONE_CHANGE_GROUP,
|
||||
EMPTY_DRAW,
|
||||
DRAW_CARDS, // applies to an instruction to draw more than one card before any replacement effects apply to individual cards drawn
|
||||
DRAW_CARD, DREW_CARD,
|
||||
EXPLORED,
|
||||
|
|
|
|||
|
|
@ -239,6 +239,8 @@ public class Library implements Serializable {
|
|||
|
||||
/**
|
||||
* Tests only -- find card position in library
|
||||
* @param cardId
|
||||
* @return
|
||||
*/
|
||||
public int getCardPosition(UUID cardId) {
|
||||
UUID[] list = library.toArray(new UUID[0]);
|
||||
|
|
|
|||
|
|
@ -152,8 +152,6 @@ public interface Player extends MageItem, Copyable<Player> {
|
|||
|
||||
boolean isPassed();
|
||||
|
||||
boolean isEmptyDraw();
|
||||
|
||||
void pass(Game game);
|
||||
|
||||
void resetPassed();
|
||||
|
|
|
|||
|
|
@ -2338,11 +2338,6 @@ public abstract class PlayerImpl implements Player, Serializable {
|
|||
resetStoredBookmark(game);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isEmptyDraw() {
|
||||
return library.isEmptyDraw();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void resetPassed() {
|
||||
this.passed = this.loses || this.hasLeft();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue