Updated the ante rarity code. Previously, it would add both Rare and MythicRare rarities to the pool of choices, but it considers both interchangeable. This led to a large increase of Rare and MythicRare cards being chosen. The game now adds only one.

This commit is contained in:
Krazy
2014-04-22 03:34:37 +00:00
parent 8c884753e1
commit 3b4964ba4a

View File

@@ -632,6 +632,8 @@ public class Game {
if (validRarities.contains(CardRarity.Special)) { if (validRarities.contains(CardRarity.Special)) {
onePlayerHasTimeShifted = false; onePlayerHasTimeShifted = false;
} }
System.out.println(validRarities.size());
CardRarity anteRarity = validRarities.get(new Random().nextInt(validRarities.size())); CardRarity anteRarity = validRarities.get(new Random().nextInt(validRarities.size()));
@@ -697,8 +699,10 @@ public class Game {
Set<CardRarity> rarities = new HashSet<>(); Set<CardRarity> rarities = new HashSet<>();
for (Card card : cards) { for (Card card : cards) {
if (card.getRarity() == CardRarity.Rare || card.getRarity() == CardRarity.MythicRare) { if (card.getRarity() == CardRarity.Rare || card.getRarity() == CardRarity.MythicRare) {
//Since both rare and mythic rare are considered the same, adding both rarities
//massively increases the odds chances of the game picking rare cards to ante.
//This is a little unfair, so we add just one of the two.
rarities.add(CardRarity.Rare); rarities.add(CardRarity.Rare);
rarities.add(CardRarity.MythicRare);
} else { } else {
rarities.add(card.getRarity()); rarities.add(card.getRarity());
} }