diff --git a/gemp-lotr/gemp-lotr-async/src/main/web/cards/set40/set40-dwarven.json b/gemp-lotr/gemp-lotr-async/src/main/web/cards/set40/set40-dwarven.json index a30bf88f3..b4788403b 100644 --- a/gemp-lotr/gemp-lotr-async/src/main/web/cards/set40/set40-dwarven.json +++ b/gemp-lotr/gemp-lotr-async/src/main/web/cards/set40/set40-dwarven.json @@ -10,9 +10,9 @@ ], "text": [ "[uKeyword]Tale.[/uKeyword] When you play this condition, stack the top card of your draw deck here.", - "[keyword]Response:[/keyword] If a Shadow card is about to discard any number of your {dwarven} conditions, discard this condition to prevent that.", - "[quote]\"Here lies Balin, son of Fundin, Lord of Moria.\"[/quote]" + "[keyword]Response:[/keyword] If a Shadow card is about to discard any number of your {dwarven} conditions, discard this condition to prevent that." ], + "quote": "\"Here lies Balin, son of Fundin, Lord of Moria.\"", "effects": [ { "type": "trigger", @@ -50,9 +50,9 @@ "type": "event", "keyword": "skirmish", "text": [ - "Exert a Dwarf to wound up to 2 Goblins.", - "[quote]\"There is one Dwarf yet in Moria who still draws breath!\"[/quote]" + "Exert a Dwarf to wound up to 2 Goblins." ], + "quote": "\"There is one Dwarf yet in Moria who still draws breath!\"", "effects": { "type": "event", "cost": { @@ -73,9 +73,9 @@ "type": "event", "keyword": "skirmish", "text": [ - "If Gimli is not assigned to skirmish, exert him and discard 2 cards stacked on a {dwarven} condition to have him replace another Dwarf in skirmish. Gimli is strength +2 and [keyword]damage +1[/keyword] while in that skirmish.", - "[quote]Gimli's despair over Balin's death was quickly replaced by fury.[/quote]" + "If Gimli is not assigned to skirmish, exert him and discard 2 cards stacked on a {dwarven} condition to have him replace another Dwarf in skirmish. Gimli is strength +2 and [keyword]damage +1[/keyword] while in that skirmish." ], + "quote": "Gimli's despair over Balin's death was quickly replaced by fury.", "effects": { "type": "event", "cost": [ @@ -116,9 +116,9 @@ "type": "event", "keyword": "skirmish", "text": [ - "Stack the top 3 cards of your draw deck on a {dwarven} support area condition to make a Dwarf take no more than one wound in a skirmish.", - "[quote]The Dwarves of the Mountain Races cut their teeth in battle at an early age.[/quote]" + "Stack the top 3 cards of your draw deck on a {dwarven} support area condition to make a Dwarf take no more than one wound in a skirmish." ], + "quote": "The Dwarves of the Mountain Races cut their teeth in battle at an early age.", "effects": { "type": "event", "cost": { @@ -142,9 +142,9 @@ "keyword": "skirmish", "text": [ "To play, exert 2 Dwarves and discard 2 cards stacked on a {dwarven} condition.", - "Each exerted Dwarf is strength +2 until the regroup phase.", - "[quote]Dwarves are renowned for their fierce loyalty to one another.[/quote]" + "Each exerted Dwarf is strength +2 until the regroup phase." ], + "quote": "Dwarves are renowned for their fierce loyalty to one another.", "effects": { "type": "event", "cost": [ @@ -175,9 +175,9 @@ "type": "event", "keyword": "skirmish", "text": [ - "Make a Dwarf strength +2 (or +3 if there is a card stacked on a {dwarven} condition.)", - "[quote]Gimli's axe struck true in the skulls of many Orcs and Uruk-hai.[/quote]" + "Make a Dwarf strength +2 (or +3 if there is a card stacked on a {dwarven} condition.)" ], + "quote": "Gimli's axe struck true in the skulls of many Orcs and Uruk-hai.", "effects": { "type": "event", "effect": { @@ -431,9 +431,9 @@ "text": [ "[keyword]Damage +1.[/keyword]", "While in your starting fellowship, Gimli's twilight cost is -1.", - "At the beginning of the fellowship phase, you may stack a Free Peoples card from hand on a {dwarven} support area condition to take a {dwarven} event from your discard pile into hand.", - "[quote]What are we waiting for?![/quote]" + "At the beginning of the fellowship phase, you may stack a Free Peoples card from hand on a {dwarven} support area condition to take a {dwarven} event from your discard pile into hand." ], + "quote": "What are we waiting for?!", "effects": [ { "type": "modifyOwnCost", diff --git a/gemp-lotr/gemp-lotr-images/src/main/java/com/gempukku/lotro/images/ImageGenerator.java b/gemp-lotr/gemp-lotr-images/src/main/java/com/gempukku/lotro/images/ImageGenerator.java index d9c9d74c8..33e56ae05 100644 --- a/gemp-lotr/gemp-lotr-images/src/main/java/com/gempukku/lotro/images/ImageGenerator.java +++ b/gemp-lotr/gemp-lotr-images/src/main/java/com/gempukku/lotro/images/ImageGenerator.java @@ -42,7 +42,7 @@ public class ImageGenerator { JPEGImageWriteParam jpegParams = new JPEGImageWriteParam(null); jpegParams.setCompressionMode(ImageWriteParam.MODE_EXPLICIT); - jpegParams.setCompressionQuality(0.9f); + jpegParams.setCompressionQuality(1f); final ImageWriter writer = ImageIO.getImageWritersByFormatName("jpg").next(); final File resultFile = new File(output, cardEntry.getKey() + ".jpg"); diff --git a/gemp-lotr/gemp-lotr-images/src/main/java/com/gempukku/lotro/images/recipe/JSONImageRecipe.java b/gemp-lotr/gemp-lotr-images/src/main/java/com/gempukku/lotro/images/recipe/JSONImageRecipe.java index 33262cde5..88f2e97e8 100644 --- a/gemp-lotr/gemp-lotr-images/src/main/java/com/gempukku/lotro/images/recipe/JSONImageRecipe.java +++ b/gemp-lotr/gemp-lotr-images/src/main/java/com/gempukku/lotro/images/recipe/JSONImageRecipe.java @@ -124,12 +124,31 @@ public class JSONImageRecipe implements ImageRecipe { if (value instanceof JSONObject) { JSONObject valueObj = (JSONObject) value; final String type = (String) valueObj.get("type"); - if (type.equalsIgnoreCase("cardProperty")) { + if (type.equalsIgnoreCase("append")) { + final JSONArray values = (JSONArray) valueObj.get("values"); + + List> providers = (List>) values.stream().map(appendValue -> createStringArrayProvider(appendValue)).collect(Collectors.toList()); + + return (renderContext -> { + List result = new LinkedList<>(); + for (Function provider : providers) { + final String[] texts = provider.apply(renderContext); + if (texts != null) + result.addAll(Arrays.asList(texts)); + } + return result.toArray(new String[0]); + }); + } else if (type.equalsIgnoreCase("cardProperty")) { final Function name = createStringProvider(valueObj.get("name")); + final String prefix = (String) valueObj.get("prefix"); + final String postfix = (String) valueObj.get("postfix"); return renderContext -> { final String propertyName = name.apply(renderContext); - return getStringArray(renderContext.getCardInfo().get(propertyName)); + final String[] stringArray = getStringArray(renderContext.getCardInfo().get(propertyName)); + for (int i = 0; i < stringArray.length; i++) + stringArray[i] = ((prefix != null) ? prefix : "") + stringArray[i] + ((postfix != null) ? postfix : ""); + return stringArray; }; } } diff --git a/gemp-lotr/gemp-lotr-images/src/main/resources/cardRecipe.json b/gemp-lotr/gemp-lotr-images/src/main/resources/cardRecipe.json index 29ea2f16c..318182338 100644 --- a/gemp-lotr/gemp-lotr-images/src/main/resources/cardRecipe.json +++ b/gemp-lotr/gemp-lotr-images/src/main/resources/cardRecipe.json @@ -867,8 +867,19 @@ "comment": "Card text", "type": "textBox", "text": { - "type": "cardProperty", - "name": "text" + "type": "append", + "values": [ + { + "type": "cardProperty", + "name": "text" + }, + { + "type": "cardProperty", + "name": "quote", + "prefix": "[quote]", + "postfix": "[/quote]" + } + ] }, "font": { "default": {