diff --git a/gemp-lotr/gemp-lotr-server/src/main/java/com/gempukku/lotro/hall/HallServer.java b/gemp-lotr/gemp-lotr-server/src/main/java/com/gempukku/lotro/hall/HallServer.java index 6300365df..f0b4c1913 100644 --- a/gemp-lotr/gemp-lotr-server/src/main/java/com/gempukku/lotro/hall/HallServer.java +++ b/gemp-lotr/gemp-lotr-server/src/main/java/com/gempukku/lotro/hall/HallServer.java @@ -160,13 +160,13 @@ public class HallServer extends AbstractServer { } }); - _tournamentQueues.put("fotr_queue", new ImmediateRecurringQueue(1000, "fotr_block", + _tournamentQueues.put("fotr_queue", new ImmediateRecurringQueue(1500, "fotr_block", CollectionType.ALL_CARDS, "fotrQueue-", "Fellowship SitesBlock", 4, true, tournamentService, _tournamentPrizeSchemeRegistry.getTournamentPrizes(cardSets, "onDemand"), _pairingMechanismRegistry.getPairingMechanism("singleElimination"))); - _tournamentQueues.put("movie_queue", new ImmediateRecurringQueue(1000, "movie", + _tournamentQueues.put("movie_queue", new ImmediateRecurringQueue(1500, "movie", CollectionType.ALL_CARDS, "movieQueue-", "Movie SitesBlock", 4, true, tournamentService, _tournamentPrizeSchemeRegistry.getTournamentPrizes(cardSets, "onDemand"), _pairingMechanismRegistry.getPairingMechanism("singleElimination"))); - _tournamentQueues.put("expanded_queue", new ImmediateRecurringQueue(1000, "expanded", + _tournamentQueues.put("expanded_queue", new ImmediateRecurringQueue(1500, "expanded", CollectionType.ALL_CARDS, "expandedQueue-", "Expanded", 4, true, tournamentService, _tournamentPrizeSchemeRegistry.getTournamentPrizes(cardSets, "onDemand"), _pairingMechanismRegistry.getPairingMechanism("singleElimination"))); diff --git a/gemp-lotr/gemp-lotr-server/src/main/java/com/gempukku/lotro/tournament/DailyTournamentPrizes.java b/gemp-lotr/gemp-lotr-server/src/main/java/com/gempukku/lotro/tournament/DailyTournamentPrizes.java index dded6c6f8..b6d367049 100644 --- a/gemp-lotr/gemp-lotr-server/src/main/java/com/gempukku/lotro/tournament/DailyTournamentPrizes.java +++ b/gemp-lotr/gemp-lotr-server/src/main/java/com/gempukku/lotro/tournament/DailyTournamentPrizes.java @@ -2,19 +2,32 @@ package com.gempukku.lotro.tournament; import com.gempukku.lotro.competitive.PlayerStanding; import com.gempukku.lotro.game.CardCollection; +import com.gempukku.lotro.game.CardSets; import com.gempukku.lotro.game.DefaultCardCollection; +import com.gempukku.lotro.game.packs.SetDefinition; + +import java.util.ArrayList; +import java.util.List; +import java.util.concurrent.ThreadLocalRandom; public class DailyTournamentPrizes implements TournamentPrizes { + private List _promos = new ArrayList(); private String _registryRepresentation; - public DailyTournamentPrizes(String registryRepresentation) { + public DailyTournamentPrizes(CardSets cardSets, String registryRepresentation) { _registryRepresentation = registryRepresentation; + for (SetDefinition setDefinition : cardSets.getSetDefinitions().values()) { + if (setDefinition.hasFlag("originalSet")) + _promos.addAll(setDefinition.getCardsOfRarity("P")); + } } @Override public CardCollection getPrizeForTournament(PlayerStanding playerStanding, int playersCount) { DefaultCardCollection tournamentPrize = new DefaultCardCollection(); tournamentPrize.addItem("(S)Booster Choice", playerStanding.getPoints()); + if (playerStanding.getPlayerWins() + playerStanding.getPlayerByes() >= 2) + tournamentPrize.addItem(getRandom(_promos), 1); if (!tournamentPrize.getAll().iterator().hasNext()) { return null; @@ -27,6 +40,10 @@ public class DailyTournamentPrizes implements TournamentPrizes { return null; } + private String getRandom(List list) { + return list.get(ThreadLocalRandom.current().nextInt(list.size())); + } + @Override public String getRegistryRepresentation() { return _registryRepresentation; @@ -34,6 +51,6 @@ public class DailyTournamentPrizes implements TournamentPrizes { @Override public String getPrizeDescription() { - return "2 boosters per win (or bye), 1 per loss, max 3 rounds"; + return "2 boosters per win (or bye), 1 per loss, max 3 rounds, players with at least 2 wins get a promo"; } } diff --git a/gemp-lotr/gemp-lotr-server/src/main/java/com/gempukku/lotro/tournament/TournamentPrizeSchemeRegistry.java b/gemp-lotr/gemp-lotr-server/src/main/java/com/gempukku/lotro/tournament/TournamentPrizeSchemeRegistry.java index fd4baf68a..c12274c97 100644 --- a/gemp-lotr/gemp-lotr-server/src/main/java/com/gempukku/lotro/tournament/TournamentPrizeSchemeRegistry.java +++ b/gemp-lotr/gemp-lotr-server/src/main/java/com/gempukku/lotro/tournament/TournamentPrizeSchemeRegistry.java @@ -6,12 +6,12 @@ public class TournamentPrizeSchemeRegistry { public TournamentPrizes getTournamentPrizes(CardSets cardSets, String prizesScheme) { if (prizesScheme == null || prizesScheme.equals("none")) return new NoPrizes(); - + if (prizesScheme.equals("onDemand")) return new SingleEliminationOnDemandPrizes(cardSets, "onDemand"); if (prizesScheme.equals("daily")) - return new DailyTournamentPrizes("daily"); + return new DailyTournamentPrizes(cardSets, "daily"); return null; }