Skip to content

Commit

Permalink
update for ER 1.10.1
Browse files Browse the repository at this point in the history
  • Loading branch information
lewisc64 committed Mar 8, 2024
1 parent 68af915 commit 16e64f2
Show file tree
Hide file tree
Showing 10 changed files with 53 additions and 3,153 deletions.
1 change: 0 additions & 1 deletion data/sources/datasheet/README.md

This file was deleted.

2,262 changes: 0 additions & 2,262 deletions data/sources/datasheet/data.csv

This file was deleted.

42 changes: 0 additions & 42 deletions data/sources/datasheet/parse.py

This file was deleted.

654 changes: 0 additions & 654 deletions data/sources/extracted/EquipParamProtector.csv

This file was deleted.

1 change: 0 additions & 1 deletion data/sources/extracted/README.md

This file was deleted.

116 changes: 0 additions & 116 deletions data/sources/extracted/parse.py

This file was deleted.

72 changes: 0 additions & 72 deletions data/sources/wiki/scrape_wiki.py

This file was deleted.

7 changes: 3 additions & 4 deletions elden-ring-poise-optimizer/src/constants.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
export const DATA_VERSION = '1.09';
export const DATA_VERSION = '1.10.1';

export const DATA_SOURCE_LINK =
'https://docs.google.com/spreadsheets/d/1x6LvzrqA9LWXPbzPZBDG8aL4N3Xc_ZxtEFMWpUxQj5c/edit#gid=1685478111';
export const DATA_SOURCE_LINK = 'https://github.com/EldenRingDatabase/erdb';

export const DATA_SOURCE_DESCRIPTION = 'google sheet';
export const DATA_SOURCE_DESCRIPTION = 'erdb';

export const GITHUB_LINK =
'https://github.com/lewisc64/Elden-Ring-Poise-Optimizer';
Expand Down
2 changes: 1 addition & 1 deletion elden-ring-poise-optimizer/src/data/armor_data.json
Original file line number Diff line number Diff line change
Expand Up @@ -10403,4 +10403,4 @@
"defenseLightning": 2.1,
"defenseHoly": 2.8
}
]
]
49 changes: 49 additions & 0 deletions tools/fetch_data_from_erdb.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
import requests
import json

CATEGORY_TO_SLOT_MAP = {
"Head": "head",
"Body": "body",
"Arms": "arms",
"Legs": "legs",
}

ERDB_ARMOR_ENDPOINT = "https://api.erdb.wiki/v1/latest/armor/"


def fetch_erdb_data():
return requests.get(ERDB_ARMOR_ENDPOINT).json()


def transform_erdb_data(erdb_data):
data = []
for key, item in erdb_data.items():
data.append({
"name": key,
"slot": CATEGORY_TO_SLOT_MAP[item["category"]],
"weight": item["weight"],
"poise": item["resistances"]["poise"],
"immunity": item["resistances"]["immunity"],
"robustness": item["resistances"]["robustness"],
"focus": item["resistances"]["focus"],
"vitality": item["resistances"]["vitality"],
"defensePhysical": item["absorptions"]["physical"],
"defensePhysicalStrike": item["absorptions"]["strike"],
"defensePhysicalSlash": item["absorptions"]["slash"],
"defensePhysicalPierce": item["absorptions"]["pierce"],
"defenseMagic": item["absorptions"]["magic"],
"defenseFire": item["absorptions"]["fire"],
"defenseLightning": item["absorptions"]["lightning"],
"defenseHoly": item["absorptions"]["holy"]
})

data.sort(key=lambda x: x["name"])
return data


if __name__ == "__main__":
erdb_data = fetch_erdb_data()
data = transform_erdb_data(erdb_data)

with open("data.json", "w") as file:
json.dump(data, file)

0 comments on commit 16e64f2

Please sign in to comment.