-
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.
- Loading branch information
Showing
7 changed files
with
142 additions
and
153 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
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,23 @@ | ||
export async function background_info(data_file) { | ||
let data = {} | ||
const background_url = `https://2014.5e.tools/data/backgrounds.json` | ||
await fetch(background_url) | ||
.then((response) => response.json()) | ||
.then((json) => data = json_background_info(json, data_file)) | ||
.catch(function(error) { | ||
console.log("Can't read this background's JSON" + error); | ||
}) | ||
return data | ||
} | ||
|
||
function json_background_info(json, data_file) { | ||
const background = json["background"].filter((background) => { | ||
return background["name"].toLowerCase() === data_file["BACKGROUND"].toLowerCase() | ||
})[0] | ||
|
||
return { | ||
BACKGROUND: background["name"], | ||
BACKGROUND_URL: `https://5e.tools/backgrounds.html#${background["name"].toLowerCase()}_${background["source"].toLowerCase()}` | ||
} | ||
} | ||
|
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,25 @@ | ||
export async function class_info(data_file) { | ||
let data = {} | ||
const class_url = `https://2014.5e.tools/data/class/fluff-class-${data_file?.CLASS?.toLowerCase()}.json` | ||
await fetch(class_url) | ||
.then((response) => response.json()) | ||
.then((json) => data = json_class_info(json, data_file)) | ||
.catch(function(error) { | ||
console.log("Can't read this class' JSON" + error); | ||
}) | ||
return data | ||
} | ||
|
||
function json_class_info(json, data_file) { | ||
const giuseppe = json["classFluff"][0] | ||
const subclass = json["subclassFluff"].filter((subclass) => { | ||
return [subclass["name"].toLowerCase(), subclass["shortName"].toLowerCase()].includes(data_file["SUBCLASS"].toLowerCase()) | ||
})[0] | ||
|
||
return { | ||
CLASS_URL: `https://5e.tools/classes.html#${giuseppe["name"].toLowerCase()}_${giuseppe["source"].toLowerCase()},state:sub-${subclass["shortName"].toLowerCase()}-${subclass["source"].toLowerCase()}=b1`, | ||
CLASS: giuseppe["name"], | ||
SUBCLASS_SHORT: subclass["shortName"], | ||
SUBCLASS: subclass["name"] | ||
} | ||
} |
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,25 @@ | ||
export async function race_info(data_file) { | ||
let data = {} | ||
const race_url = `https://2014.5e.tools/data/races.json` | ||
await fetch(race_url) | ||
.then((response) => response.json()) | ||
.then((json) => data = json_race_info(json, data_file)) | ||
.catch(function(error) { | ||
console.log("Can't read this race's JSON" + error); | ||
}) | ||
return data | ||
} | ||
|
||
function json_race_info(json, data_file) { | ||
const race = json["race"].filter((race) => { | ||
let filter_name = race["name"].toLowerCase() === data_file["RACE"].toLowerCase() | ||
if(!data_file["RACE_SOURCE"]) | ||
return filter_name | ||
let filter_source = race["source"].toLowerCase() === data_file["RACE_SOURCE"].toLowerCase() | ||
return filter_name && filter_source | ||
})[0] | ||
|
||
return { | ||
RACE_URL: `https://2014.5e.tools/races.html#${race["name"].toLowerCase()}_${race["source"].toLowerCase()}` | ||
} | ||
} |
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,25 @@ | ||
{ | ||
"LVL": 9, | ||
"CA": 13, | ||
"HITDICE": 6, | ||
"CLASS": "Wizard", | ||
"SUBCLASS": "Chronurgy", | ||
"BACKGROUND": "Sage", | ||
"ALIGNMENT": "Neutral Good", | ||
"RACE": "Goblin", | ||
"RACE_SOURCE": "VGM", | ||
"SPEED": "30ft", | ||
|
||
"HP": 41, | ||
|
||
"STR": 6, | ||
"DEX": 8, | ||
"CON": 12, | ||
"INT": 18, | ||
"WIS": 16, | ||
"CHA": 7, | ||
"SkillProf": ["Arcana", "History", "Investigation", "Medicine"], | ||
"STProf": ["INT", "WIS"], | ||
"SpellcastingAbility": "INT" | ||
} | ||
|