mirror of
https://github.com/magefree/mage.git
synced 2025-12-25 21:12:04 -08:00
fix broke shadowOfTheGrave + watcher
This commit is contained in:
parent
f0a83c4689
commit
576ccdb34a
2 changed files with 21 additions and 2 deletions
|
|
@ -31,6 +31,7 @@ import java.util.HashMap;
|
|||
import java.util.Map;
|
||||
import java.util.Map.Entry;
|
||||
import java.util.UUID;
|
||||
|
||||
import mage.cards.Card;
|
||||
import mage.cards.Cards;
|
||||
import mage.cards.CardsImpl;
|
||||
|
|
@ -61,12 +62,14 @@ public class CardsCycledOrDiscardedThisTurnWatcher extends Watcher {
|
|||
|
||||
@Override
|
||||
public void watch(GameEvent event, Game game) {
|
||||
if (event.getType() == GameEvent.EventType.CYCLED_CARD
|
||||
if (event.getType() == GameEvent.EventType.PAY_CYCLE_COST
|
||||
|| event.getType() == GameEvent.EventType.DISCARDED_CARD) {
|
||||
if (event.getPlayerId() != null) {
|
||||
Card card = game.getCard(event.getTargetId());
|
||||
if (card != null) {
|
||||
getCardsCycledOrDiscardedThisTurn(event.getPlayerId()).add(card);
|
||||
Cards c = getCardsCycledOrDiscardedThisTurn(event.getPlayerId());
|
||||
c.add(card);
|
||||
cycledOrDiscardedCardsThisTurn.put(event.getPlayerId(), c);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue