forked from the-fab-cube/flesh-and-blood-cards
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add English ability CSV/JSON files and update helper-scripts and HTML…
…s to use them
- Loading branch information
1 parent
5d77ccc
commit 1ef0596
Showing
33 changed files
with
1,066 additions
and
407 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
Unique ID Name | ||
HCCWPfFrNzCwPDntPw6gH Action | ||
kQNwpnQqhC8RGPcpDKdJD Attack Reaction | ||
GJdGNktHCbbzmHNkkNfDz Instant | ||
7jJ7hBjrMQd6fcWcqTb6D Once Per Turn Action | ||
9DbtWdGfndKG7CCDPmb9t Once Per Turn Attack Reaction | ||
KzGJdT7tz9LfLhWfbnFwb Once Per Turn Defense Reaction | ||
7mcpJ8zrDHJWkf9r68bhH Once Per Turn Effect | ||
t7KdJFMrpcTDBBnGWf6wK Once per Turn Instant | ||
cTkzhh6mR7NHCWnBRnbWW Twice per Turn Instant |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
30 changes: 30 additions & 0 deletions
30
helper-scripts/generate-json/generate_json_file/ability.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
import csv | ||
import json | ||
from pathlib import Path | ||
|
||
def generate_json_file(language): | ||
print(f"Generating {language} ability.json from ability.csv...") | ||
|
||
ability_array = [] | ||
|
||
csvPath = Path(__file__).parent / f"../../../csvs/{language}/ability.csv" | ||
jsonPath = Path(__file__).parent / f"../../../json/{language}/ability.json" | ||
|
||
with csvPath.open(newline='') as csvfile: | ||
reader = csv.reader(csvfile, delimiter='\t', quotechar='"') | ||
next(reader) | ||
|
||
for row in reader: | ||
ability_object = {} | ||
|
||
ability_object['unique_id'] = row[0] | ||
ability_object['name'] = row[1] | ||
|
||
ability_array.append(ability_object) | ||
|
||
json_object = json.dumps(ability_array, indent=4, ensure_ascii=False) | ||
|
||
with jsonPath.open('w', newline='\n', encoding='utf8') as outfile: | ||
outfile.write(json_object) | ||
|
||
print(f"Successfully {language} generated ability.json\n") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
const nanoid = require('nanoid') | ||
const nanoidDictionary = require('nanoid-dictionary') | ||
const customNanoId = nanoid.customAlphabet(nanoidDictionary.nolookalikesSafe) | ||
|
||
function capitalizeFirstLetter(string) { | ||
return string.charAt(0).toUpperCase() + string.slice(1); | ||
} | ||
|
||
module.exports = { | ||
customNanoId, | ||
capitalizeFirstLetter | ||
} |
Oops, something went wrong.