Skip to content

Commit

Permalink
issue-122 added skyrim AE content
Browse files Browse the repository at this point in the history
  • Loading branch information
gennadyterekhov committed Jun 15, 2024
1 parent 0cac4c4 commit 53effc2
Show file tree
Hide file tree
Showing 61 changed files with 5,624 additions and 7 deletions.
Binary file added assets/img/skyrim/ingredients/Alocasia Fruit.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/img/skyrim/ingredients/Ambrosia.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/img/skyrim/ingredients/Blister Pod Cap.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/img/skyrim/ingredients/Bog Beacon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/img/skyrim/ingredients/Bungler's Bane.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/img/skyrim/ingredients/Chokeberry.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/img/skyrim/ingredients/Chokeweed.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/img/skyrim/ingredients/Coda Flower.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/img/skyrim/ingredients/Comberry.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/img/skyrim/ingredients/Corkbulb Root.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/img/skyrim/ingredients/Daedra Silk.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/img/skyrim/ingredients/Daedra Venin.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/img/skyrim/ingredients/Daedroth Teeth.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/img/skyrim/ingredients/Dreugh Wax.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/img/skyrim/ingredients/Elytra Ichor.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/img/skyrim/ingredients/Fire Petal.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/img/skyrim/ingredients/Flame Stalk.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/img/skyrim/ingredients/Fungus Stalk.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/img/skyrim/ingredients/Gnarl Bark.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/img/skyrim/ingredients/Gold Kanet.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/img/skyrim/ingredients/Heart of Order.png
Binary file added assets/img/skyrim/ingredients/Hunger Tongue.png
Binary file added assets/img/skyrim/ingredients/Hypha Facia.png
Binary file added assets/img/skyrim/ingredients/Imp Gall.png
Binary file added assets/img/skyrim/ingredients/Kagouti Hide.png
Binary file added assets/img/skyrim/ingredients/Kresh Fiber.png
Binary file added assets/img/skyrim/ingredients/Lichor.png
Binary file added assets/img/skyrim/ingredients/Marshmerrow.png
Binary file added assets/img/skyrim/ingredients/Minotaur Horn.png
Binary file added assets/img/skyrim/ingredients/Ogre's Teeth.png
Binary file added assets/img/skyrim/ingredients/Redwort Flower.png
Binary file added assets/img/skyrim/ingredients/Roobrush.png
Binary file added assets/img/skyrim/ingredients/Saltrice.png
Binary file added assets/img/skyrim/ingredients/Scalon Fin.png
Binary file added assets/img/skyrim/ingredients/Scrib Jelly.png
Binary file added assets/img/skyrim/ingredients/Scrib Jerky.png
Binary file added assets/img/skyrim/ingredients/Sload Soap.png
Binary file added assets/img/skyrim/ingredients/Void Essence.png
Binary file added assets/img/skyrim/ingredients/Watcher's Eye.png
Binary file added assets/img/skyrim/ingredients/Wisp Stalk Caps.png
Binary file added assets/img/skyrim/ingredients/Withering Moon.png
Binary file added assets/img/skyrim/ingredients/Worm's Head Cap.png
884 changes: 884 additions & 0 deletions lib/layers/data/storage/skyrim.dart

Large diffs are not rendered by default.

511 changes: 511 additions & 0 deletions lib/layers/data_mining/ae_no_url.json

Large diffs are not rendered by default.

1,620 changes: 1,620 additions & 0 deletions lib/layers/data_mining/ae_with_mags.json

Large diffs are not rendered by default.

512 changes: 512 additions & 0 deletions lib/layers/data_mining/mags.json

Large diffs are not rendered by default.

137 changes: 137 additions & 0 deletions lib/layers/data_mining/parse_anniversary_edition.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,137 @@
import json
import requests
import time

def get_file_contents(filename) -> str:
f = open(filename, 'r')
c = f.read()
f.close()
return c


def getId(ing):
rawName = ing['Ingredient Name']
parts = rawName.split('\n ')
return parts[1]


def getName(ing):
rawName = ing['Ingredient Name']
parts = rawName.split('\n ')
return parts[0]


def getCleanEffect(effText):
return effText.split(' (')[0]


def getCleanEffects(ing):
return [
getCleanEffect(ing['Primary Effect']),
getCleanEffect(ing['Secondary Effect']),
getCleanEffect(ing['Tertiary Effect']),
getCleanEffect(ing['Quaternary Effect']),
]


def getTable():
table = json.loads(get_file_contents('table_no_img.json'))
keyed_by_id = {}

for ing in table:
id = getId(ing)
name = getName(ing)
ing['id'] = id
ing['name'] = name
del ing['Ingredient Name']
del ing['image']

ing['icon'] = 'TODO add icons'
ing['uesp_url'] = 'TODO add url'
ing['text'] = 'Can be purchased from Khajiit caravans.'
ing['effects'] = getCleanEffects(ing)
ing['value'] = int(ing['price'])
ing['weight'] = float(ing['weight'])
del ing['price']
del ing['Primary Effect']
del ing['Secondary Effect']
del ing['Tertiary Effect']
del ing['Quaternary Effect']
keyed_by_id[name] = ing

print(json.dumps(keyed_by_id))


def guessUespUrl(name):
name = name.replace(' ', '_')
return f'https://en.uesp.net/wiki/Skyrim:{name}'


def checkUrlValid(url):
response = requests.get(url)
assert (response.status_code == 200)
time.sleep(0.5)


def uespUrls():
table = json.loads(get_file_contents('ae_no_url.json'))

for k, ing in table.items():
url = guessUespUrl(k)
# checkUrlValid(url)
ing['uesp_url'] = url
print(json.dumps(table))

def getMultipliersFor1Effect(effectString):
''' Restore Health (1.2×Magnitude,1.22×Gold) '''
parts = effectString.split(' (')
if len(parts) == 1:
return None
return {"Magnitude":1, "Duration":1, "Gold":1}

multis = parts[1].replace(')','') #1.2×Magnitude,1.22×Gold
multis = multis.split(',') # ['1.2×Magnitude', '1.22×Gold']


res = {}
for m in multis:
parts = m.split('×')
coef = float(parts[0])
kind = parts[1].strip()
res[kind] = coef

return res

def getMultipliers(ing):
'''
"Primary Effect": "Restore Health (1.2×Magnitude,1.22×Gold)",
"Secondary Effect": "Regenerate Health (1.2×Magnitude,1.22×Gold)",
"Tertiary Effect": "Fortify Health (1.25×Magnitude,1.27×Gold)",
"Quaternary Effect": "Cure Poison (1.56×Gold)",
'''
ing["Primary Effect"]
return [
getMultipliersFor1Effect(ing["Primary Effect"]),
getMultipliersFor1Effect(ing["Secondary Effect"]),
getMultipliersFor1Effect(ing["Tertiary Effect"]),
getMultipliersFor1Effect(ing["Quaternary Effect"]),
]

def multipliers():
''' every effect has 3 kinds: magnitude, duration, price'''
currentTable = json.loads(get_file_contents('urls.json'))
mags = json.loads(get_file_contents('mags.json'))
for ing in mags:
name = getName(ing)
mults = getMultipliers(ing)
currentTable[name]['multipliers'] = mults

print(json.dumps(currentTable))
def main():
# getTable()
# uespUrls()
multipliers()


if __name__ == '__main__':
main()
675 changes: 675 additions & 0 deletions lib/layers/data_mining/table_no_desc.html

Large diffs are not rendered by default.

Loading

0 comments on commit 53effc2

Please sign in to comment.