mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-19 20:28:00 +00:00
We need to pass it as a list to update correctly
This commit is contained in:
@@ -2,14 +2,14 @@ package forge.game.event;
|
|||||||
|
|
||||||
import forge.game.card.Card;
|
import forge.game.card.Card;
|
||||||
|
|
||||||
import java.util.Arrays;
|
|
||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
public class GameEventTokenStateUpdate extends GameEvent {
|
public class GameEventTokenStateUpdate extends GameEvent {
|
||||||
|
|
||||||
public final Collection<Card> cards;
|
public final Collection<Card> cards;
|
||||||
public GameEventTokenStateUpdate(Card affected) {
|
public GameEventTokenStateUpdate(List<Card> affected) {
|
||||||
cards = Arrays.asList(affected);
|
cards = affected;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -177,14 +177,16 @@ public class PhaseHandler implements java.io.Serializable {
|
|||||||
|
|
||||||
// Tokens starting game in play should suffer from Sum. Sickness
|
// Tokens starting game in play should suffer from Sum. Sickness
|
||||||
final CardCollectionView list = playerTurn.getCardsIncludePhasingIn(ZoneType.Battlefield);
|
final CardCollectionView list = playerTurn.getCardsIncludePhasingIn(ZoneType.Battlefield);
|
||||||
|
final List<Card> toupdate = new ArrayList<>();
|
||||||
for (final Card c : list) {
|
for (final Card c : list) {
|
||||||
if (playerTurn.getTurn() > 0 || !c.isStartsGameInPlay()) {
|
if (playerTurn.getTurn() > 0 || !c.isStartsGameInPlay()) {
|
||||||
if (c.isToken()) //update token stacking on battlefield
|
if (c.isToken()) //update token stacking on battlefield
|
||||||
game.fireEvent(new GameEventTokenStateUpdate(c));
|
toupdate.add(c);
|
||||||
|
|
||||||
c.setSickness(false);
|
c.setSickness(false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
game.fireEvent(new GameEventTokenStateUpdate(toupdate));
|
||||||
playerTurn.incrementTurn();
|
playerTurn.incrementTurn();
|
||||||
|
|
||||||
game.getAction().resetActivationsPerTurn();
|
game.getAction().resetActivationsPerTurn();
|
||||||
|
|||||||
Reference in New Issue
Block a user