Permalink
Browse files

Added foreign name support for split and double-faced cards

  • Loading branch information...
1 parent 2b700c5 commit 7e3beb3a59048001e623fb9ec14cdfd6d760214b @Sembiance Sembiance committed Jul 15, 2014
Showing with 46 additions and 12 deletions.
  1. +27 −1 build/rip.js
  2. +1 −1 json/DGM.json
  3. +1 −1 json/DKA.json
  4. +1 −1 json/ISD.json
  5. +5 −5 util/tmp.js
  6. +8 −0 web/changelog.json
  7. +2 −2 web/generate.js
  8. +1 −1 web/index.dust
View
@@ -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
View
View
View
@@ -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
@@ -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
@@ -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
@@ -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>

0 comments on commit 7e3beb3

Please sign in to comment.