Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Added foreign name support for split and double-faced cards

  • Loading branch information...
commit 7e3beb3a59048001e623fb9ec14cdfd6d760214b 1 parent 2b700c5
@Sembiance authored
View
28 build/rip.js
@@ -592,7 +592,33 @@ function addForeignNamesToCards(cards, cb)
{
delete card.foreignNames;
- if(card.layout!=="split" && card.layout!=="double-faced" && (card.layout!=="flip" || (card.layout==="flip" && card.names && card.names.length>=1 && card.names[0]===card.name)))
+ if(card.layout==="split" || card.layout==="double-faced" || card.layout==="flip")
+ {
+ if(card.names.length===2)
+ {
+ card.foreignNames = [];
+ (cardsForeignNames[i] || []).forEach(function(cardForeignName)
+ {
+ if(cardForeignName.name.contains("//"))
+ {
+ var cardForeignNameParts = cardForeignName.name.split("//").map(function(cardForeignNamePart) { return cardForeignNamePart.trim(); });
+ if(cardForeignNameParts.length===card.names.length)
+ {
+ cardForeignName.name = cardForeignNameParts[card.names.indexOf(card.name)];
+ if(cardForeignName.name!==card.name)
+ card.foreignNames.push(cardForeignName);
+ }
+ }
+ else if(card.names[0]===card.name && card.name!==cardForeignName.name)
+ {
+ card.foreignNames.push(cardForeignName);
+ }
+ });
+ if(!card.foreignNames.length)
+ delete card.foreignNames;
+ }
+ }
+ else
{
var cardForeignNames = cardsForeignNames[i];
if(cardForeignNames && cardForeignNames.length)
View
2  json/DGM.json
1 addition, 1 deletion not shown
View
2  json/DKA.json
1 addition, 1 deletion not shown
View
2  json/ISD.json
1 addition, 1 deletion not shown
View
10 util/tmp.js
@@ -13,7 +13,7 @@ var base = require("xbase"),
path = require("path"),
tiptoe = require("tiptoe");
-var MATCH_NAMES = ["Ancestral Vision", "Archdemon of Greed", "Bane of Hanweir", "Dryad Arbor", "Evermind", "Garruk, the Veil-Cursed", "Gatstaf Howler", "Ghastly Haunting", "Hinterland Scourge", "Homicidal Brute", "Howlpack Alpha", "Howlpack of Estwald", "Hypergenesis", "Insectile Aberration", "Ironfang", "Krallenhorde Killer", "Krallenhorde Wantons", "Living End", "Lord of Lineage", "Ludevic's Abomination", "Markov's Servant", "Merciless Predator", "Moonscarred Werewolf", "Nightfall Predator", "Rampaging Werewolf", "Ravager of the Fells", "Restore Balance", "Silverpelt Werewolf", "Stalking Vampire", "Terror of Kruin Pass", "Thraben Militia", "Tovolar's Magehunter", "Ulvenwald Primordials", "Unhallowed Cathar", "Unholy Fiend", "Werewolf Ransacker", "Wheel of Fate", "Wildblood Pack", "Withengar Unbound"];
+var matches = [];
tiptoe(
function processSets()
@@ -25,6 +25,8 @@ tiptoe(
},
function finish(err)
{
+ base.info(matches.unique().sort().join(" "));
+
if(err)
{
base.error(err);
@@ -46,10 +48,8 @@ function checkSet(setCode, cb)
{
JSON.parse(setRaw).cards.forEach(function(card)
{
- if(MATCH_NAMES.contains(card.name))
- {
- base.info(card.colors.join(", "));
- }
+ if(card.layout==="flip" || card.layout==="split" || card.layout==="double-faced")
+ matches.push(setCode);
});
this();
View
8 web/changelog.json
@@ -1,5 +1,13 @@
[
{
+ "version": "2.8.6",
+ "when": "2014-07-15",
+ "changes": [
+ "DGM, DKA, ISD: Cards with split and double-faced layouts now have foreign names."
+ ],
+ "updatedSetFiles" : ["DGM-x", "DKA-x", "ISD-x"]
+ },
+ {
"version": "2.8.5",
"when": "2014-07-14",
"changes": [
View
4 web/generate.js
@@ -18,8 +18,8 @@ var dustData =
{
title : "Magic the Gathering card data in JSON format",
sets : [],
- version : "2.8.5",
- lastUpdated : "Jul 14, 2014",
+ version : "2.8.6",
+ lastUpdated : "Jul 15, 2014",
setCodesNotOnGatherer : C.SETS_NOT_ON_GATHERER.join(", ")
};
View
2  web/index.dust
@@ -383,7 +383,7 @@
<tr>
<td>foreignNames</td>
<td>[ {~lb} language : "Italian",&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br>name : "Wurm Devastatore" {~rb} ]</td>
- <td>Foreign language names for the card. An array of objects, each object having 'language' and 'name' keys. Not available for split, flip and double-faced cards.</td>
+ <td>Foreign language names for the card. An array of objects, each object having 'language' and 'name' keys. Only present if different than the english card name.</td>
</tr>
<tr>
<td>printings</td>
Please sign in to comment.
Something went wrong with that request. Please try again.