mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-18 19:58:00 +00:00
Add RagsToRiches achievement
This commit is contained in:
@@ -5,4 +5,5 @@ import java.util.HashSet;
|
||||
//class for storing information during a game that is used at the end of the game to determine achievements
|
||||
public class AchievementTracker {
|
||||
public final HashSet<String> activatedUltimates = new HashSet<String>();
|
||||
public int mulliganTo = 7;
|
||||
}
|
||||
|
||||
@@ -88,7 +88,6 @@ public class Game implements IGameStateObject {
|
||||
private final ReplacementHandler replacementHandler = new ReplacementHandler(this);
|
||||
private final EventBus events = new EventBus("game events");
|
||||
private final GameLog gameLog = new GameLog();
|
||||
private final AchievementTracker achievementTracker = new AchievementTracker();
|
||||
|
||||
private final Zone stackZone = new Zone(ZoneType.Stack, this);
|
||||
|
||||
@@ -333,15 +332,6 @@ public class Game implements IGameStateObject {
|
||||
return gameLog;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the achievement tracker
|
||||
*
|
||||
* @return the achievement tracker
|
||||
*/
|
||||
public final AchievementTracker getAchievementTracker() {
|
||||
return achievementTracker;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the stack zone.
|
||||
*
|
||||
|
||||
@@ -1641,8 +1641,9 @@ public class GameAction {
|
||||
Player p = whoCanMulligan.get(i);
|
||||
List<Card> toMulligan = p.canMulligan() ? p.getController().getCardsToMulligan(isCommander, firstPlayer) : null;
|
||||
|
||||
if (game.isGameOver()) // conceded on mulligan prompt
|
||||
if (game.isGameOver()) { // conceded on mulligan prompt
|
||||
return;
|
||||
}
|
||||
|
||||
if (toMulligan != null && !toMulligan.isEmpty()) {
|
||||
if (!isCommander) {
|
||||
|
||||
@@ -190,6 +190,12 @@ public class Player extends GameEntity implements Comparable<Player>, IIdentifia
|
||||
|
||||
private int numManaConversion = 0;
|
||||
|
||||
private final AchievementTracker achievementTracker = new AchievementTracker();
|
||||
|
||||
public final AchievementTracker getAchievementTracker() {
|
||||
return achievementTracker;
|
||||
}
|
||||
|
||||
public final PlayerOutcome getOutcome() {
|
||||
return stats.getOutcome();
|
||||
}
|
||||
@@ -3351,6 +3357,7 @@ public class Player extends GameEntity implements Comparable<Player>, IIdentifia
|
||||
final int newHand = getCardsIn(ZoneType.Hand).size();
|
||||
stats.notifyHasMulliganed();
|
||||
stats.notifyOpeningHandSize(newHand);
|
||||
achievementTracker.mulliganTo = newHand;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user