From 0d4a97d0d04153a46d78643c6ae3cfcd28aae2d4 Mon Sep 17 00:00:00 2001 From: Agetian Date: Wed, 12 Jul 2017 04:50:11 +0000 Subject: [PATCH] - Display the name, difficulty and objective (goal/turn limit) of puzzles on the Puzzle Goal effect card. --- .../src/main/java/forge/puzzle/Puzzle.java | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/forge-gui/src/main/java/forge/puzzle/Puzzle.java b/forge-gui/src/main/java/forge/puzzle/Puzzle.java index 87842af9af7..85255f68588 100644 --- a/forge-gui/src/main/java/forge/puzzle/Puzzle.java +++ b/forge-gui/src/main/java/forge/puzzle/Puzzle.java @@ -45,6 +45,25 @@ public class Puzzle extends GameState implements InventoryItem, Comparable { } } + private String getGoalDescription() { + StringBuilder desc = new StringBuilder(); + + String name = this.name == null ? "Unnamed Puzzle" : this.name; + String goal = this.goal == null ? "(Unspecified)" : this.goal; + String diff = this.difficulty == null ? "(Unspecified)" : this.difficulty; + + desc.append(name); + desc.append("\nDifficulty: "); + desc.append(diff); + + desc.append("\n\nGoal: "); + desc.append(goal); + desc.append("\nTurns Limit: "); + desc.append(this.turns); + + return desc.toString(); + } + private void loadGameState(List stateLines) { this.parse(stateLines); } @@ -67,6 +86,7 @@ public class Puzzle extends GameState implements InventoryItem, Comparable { goalCard.setImageKey("t:puzzle"); goalCard.setName("Puzzle Goal"); goalCard.addType("Effect"); + goalCard.setOracleText(getGoalDescription()); { final String loseTrig = "Mode$ Phase | Phase$ Cleanup | TriggerZones$ Command | Static$ True | " +