Merge branch 'master' of git://github.com/wynnbuilder/wynnbuilder.github.io
This commit is contained in:
commit
68d8ce2a8b
11 changed files with 281 additions and 17 deletions
|
@ -766,7 +766,8 @@ function calculateBuildStats() {
|
||||||
let remainingSkpTitle = document.createElement("b");
|
let remainingSkpTitle = document.createElement("b");
|
||||||
remainingSkpTitle.textContent = "Remaining skillpoints: ";
|
remainingSkpTitle.textContent = "Remaining skillpoints: ";
|
||||||
let remainingSkpContent = document.createElement("b");
|
let remainingSkpContent = document.createElement("b");
|
||||||
remainingSkpContent.textContent = "" + (levelToSkillPoints(player_build.level) - player_build.assigned_skillpoints < 0 ? "< 0" : levelToSkillPoints(player_build.level) - player_build.assigned_skillpoints);
|
//remainingSkpContent.textContent = "" + (levelToSkillPoints(player_build.level) - player_build.assigned_skillpoints < 0 ? "< 0" : levelToSkillPoints(player_build.level) - player_build.assigned_skillpoints);
|
||||||
|
remainingSkpContent.textContent = "" + (levelToSkillPoints(player_build.level) - player_build.assigned_skillpoints);
|
||||||
remainingSkpContent.classList.add(levelToSkillPoints(player_build.level) - player_build.assigned_skillpoints < 0 ? "negative" : "positive");
|
remainingSkpContent.classList.add(levelToSkillPoints(player_build.level) - player_build.assigned_skillpoints < 0 ? "negative" : "positive");
|
||||||
|
|
||||||
remainingSkp.appendChild(remainingSkpTitle);
|
remainingSkp.appendChild(remainingSkpTitle);
|
||||||
|
|
241
ci_parse.py
Normal file
241
ci_parse.py
Normal file
|
@ -0,0 +1,241 @@
|
||||||
|
import os
|
||||||
|
import re
|
||||||
|
|
||||||
|
def parse_ci(infile):
|
||||||
|
itemName = infile.split("/")[1].split(".")[0]
|
||||||
|
|
||||||
|
print("-------------------------------")
|
||||||
|
print(infile)
|
||||||
|
print("-------------------------------")
|
||||||
|
|
||||||
|
id_reverse_map = {
|
||||||
|
"Neutral Damage": "nDam",
|
||||||
|
"Fire Damage": "fDam",
|
||||||
|
"Water Damage": "wDam",
|
||||||
|
"Air Damage": "aDam",
|
||||||
|
"Thunder Damage": "tDam",
|
||||||
|
"Earth Damage": "eDam",
|
||||||
|
|
||||||
|
"ealth": "hp", # HACKY
|
||||||
|
"Fire Defense": "fDef",
|
||||||
|
"Water Defense": "wDef",
|
||||||
|
"Air Defense": "aDef",
|
||||||
|
"Thunder Defense": "tDef",
|
||||||
|
"Earth Defense": "eDef",
|
||||||
|
|
||||||
|
"Combat Lv. Min": "lvl",
|
||||||
|
"Strength Min": "strReq",
|
||||||
|
"Dexterity Min": "dexReq",
|
||||||
|
"Intelligence Min": "intReq",
|
||||||
|
"Defense Min": "defReq",
|
||||||
|
"Agility Min": "agiReq",
|
||||||
|
|
||||||
|
"% Health Regen": "hprPct",
|
||||||
|
"/4s Mana Regen": "mr",
|
||||||
|
"% Spell Damage": "sdPct",
|
||||||
|
"% Main Attack Damage": "mdPct",
|
||||||
|
"/4s Life Steal": "ls",
|
||||||
|
"/4s Mana Steal": "ms",
|
||||||
|
"% XP Bonus": "xpb",
|
||||||
|
"% Loot Bonus": "lb",
|
||||||
|
"% Reflection": "ref",
|
||||||
|
"Strength": "str",
|
||||||
|
"Dexterity": "dex",
|
||||||
|
"Intelligence": "int",
|
||||||
|
"Agility": "agi",
|
||||||
|
"Defense": "def",
|
||||||
|
"% Thorns": "thorns",
|
||||||
|
"% Exploding": "expd",
|
||||||
|
"% Walk Speed": "spd",
|
||||||
|
"tier Attack Speed": "atkTier",
|
||||||
|
"/3s Poison": "poison",
|
||||||
|
"Health": "hpBonus",
|
||||||
|
"% Soul Point Regen": "spRegen",
|
||||||
|
"% Stealing": "eSteal",
|
||||||
|
"Health Regen": "hprRaw",
|
||||||
|
"Spell Damage": "sdRaw",
|
||||||
|
"Main Attack Damage": "mdRaw",
|
||||||
|
"% Fire Damage": "fDamPct",
|
||||||
|
"% Water Damage": "wDamPct",
|
||||||
|
"% Air Damage": "aDamPct",
|
||||||
|
"% Thunder Damage": "tDamPct",
|
||||||
|
"% Earth Damage": "eDamPct",
|
||||||
|
"% Fire Defense": "fDefPct",
|
||||||
|
"% Water Defense": "wDefPct",
|
||||||
|
"% Air Defense": "aDefPct",
|
||||||
|
"% Thunder Defense": "tDefPct",
|
||||||
|
"% Earth Defense": "eDefPct",
|
||||||
|
|
||||||
|
"% 1st Spell Cost": "spPct1",
|
||||||
|
"1st Spell Cost": "spRaw1",
|
||||||
|
"% 2nd Spell Cost": "spPct2",
|
||||||
|
"2nd Spell Cost": "spRaw2",
|
||||||
|
"% 3rd Spell Cost": "spPct3",
|
||||||
|
"3rd Spell Cost": "spRaw3",
|
||||||
|
"% 4th Spell Cost": "spPct4",
|
||||||
|
"4th Spell Cost": "spRaw4",
|
||||||
|
|
||||||
|
"rainbowSpellDamageRaw": "rainbowRaw",
|
||||||
|
"% Sprint": "sprint",
|
||||||
|
"% Sprint Regen": "sprintReg",
|
||||||
|
"Jump Height": "jh",
|
||||||
|
"lootQuality": "lq",
|
||||||
|
|
||||||
|
"gatherXpBonus": "gXp",
|
||||||
|
"gatherSpeed": "gSpd",
|
||||||
|
}
|
||||||
|
|
||||||
|
weapons = [ "bow", "wand", "spear", "dagger", "relik" ]
|
||||||
|
armors = [ "helmet", "chestplate", "leggings", "boots" ]
|
||||||
|
accessories = [ "ring", "bracelet", "necklace" ]
|
||||||
|
|
||||||
|
item_dict = dict()
|
||||||
|
with open(infile, "r") as _infile:
|
||||||
|
item_data = _infile.read()
|
||||||
|
item_data = item_data.split("<p class='restrictions")[0]
|
||||||
|
item_data = item_data.split("<p class='tier'>")[0].split("/items/v4//",1)[1]
|
||||||
|
|
||||||
|
type_info = item_data.split("/", 1)[0]
|
||||||
|
item_data = item_data.split("p class='name ",1)[1]
|
||||||
|
tier_info = item_data.split("'",1)[0]
|
||||||
|
|
||||||
|
item_dict["tier"] = tier_info
|
||||||
|
item_dict["type"] = type_info
|
||||||
|
|
||||||
|
item_dict["name"] = itemName + " (1.20)"
|
||||||
|
item_dict["displayName"] = item_dict["name"]
|
||||||
|
|
||||||
|
item_dict["set"] = None
|
||||||
|
item_dict["quest"] = None
|
||||||
|
item_dict["classReq"] = None # Ignoring cause I'm not checking anyway
|
||||||
|
item_dict["restrict"] = "1.20 item"
|
||||||
|
|
||||||
|
static_info, id_info = item_data.split("table class='")
|
||||||
|
fix_id = id_info[:3] == 'td2'
|
||||||
|
item_dict["fixID"] = fix_id
|
||||||
|
id_info = id_info.split("/thead",1)[-1]
|
||||||
|
|
||||||
|
def process_reqs(req_info):
|
||||||
|
req_info = [x.split("<",1)[0] for x in req_info.split('mark">')[1:]]
|
||||||
|
for req in req_info:
|
||||||
|
key, val = req.split(":")
|
||||||
|
item_dict[id_reverse_map[key]] = int(val)
|
||||||
|
|
||||||
|
item_dict["strReq"] = 0;
|
||||||
|
item_dict["dexReq"] = 0;
|
||||||
|
item_dict["intReq"] = 0;
|
||||||
|
item_dict["defReq"] = 0;
|
||||||
|
item_dict["agiReq"] = 0;
|
||||||
|
if type_info in weapons:
|
||||||
|
attack_speed, static_info = static_info.split(" Speed",1)
|
||||||
|
attack_speed = attack_speed.split("attackSpeed'>",1)[1].split("Attack")[0].strip().replace(" ","_").upper()
|
||||||
|
item_dict["atkSpd"] = attack_speed
|
||||||
|
item_dict["category"] = "weapon"
|
||||||
|
|
||||||
|
stat_info, req_info = static_info.split("Class Req: ")
|
||||||
|
process_reqs(req_info)
|
||||||
|
item_dict["nDam"] = "0-0";
|
||||||
|
item_dict["eDam"] = "0-0";
|
||||||
|
item_dict["tDam"] = "0-0";
|
||||||
|
item_dict["wDam"] = "0-0";
|
||||||
|
item_dict["fDam"] = "0-0";
|
||||||
|
item_dict["aDam"] = "0-0";
|
||||||
|
|
||||||
|
else: # Armor and accessory both do health and eledef
|
||||||
|
if type_info in accessories:
|
||||||
|
item_dict["category"] = "accessory"
|
||||||
|
else:
|
||||||
|
item_dict["category"] = "armor"
|
||||||
|
|
||||||
|
stat_info, req_info = static_info.split('requirements')
|
||||||
|
process_reqs(req_info)
|
||||||
|
|
||||||
|
stat_info = stat_info.split("i class='")[1:]
|
||||||
|
for stat in stat_info:
|
||||||
|
key, stat = stat.split(">",1)[1][2:].replace("</i>","",1).split("<",1)[0].split(": ")
|
||||||
|
try:
|
||||||
|
item_dict[id_reverse_map[key]] = int(stat)
|
||||||
|
except:
|
||||||
|
item_dict[id_reverse_map[key]] = stat
|
||||||
|
|
||||||
|
if type_info not in accessories:
|
||||||
|
id_info, slot_info = id_info.split("'bottom'>")
|
||||||
|
if 'sockets' in slot_info:
|
||||||
|
item_dict["slots"] = int(slot_info.split("/",1)[1].split("]",1)[0])
|
||||||
|
else:
|
||||||
|
item_dict["slots"] = 0
|
||||||
|
|
||||||
|
number_regex = re.compile(r"(-?\d+)(.*)")
|
||||||
|
id_info = id_info.split("<tr>")[1:]
|
||||||
|
|
||||||
|
item_dict["str"] = 0;
|
||||||
|
item_dict["dex"] = 0;
|
||||||
|
item_dict["int"] = 0;
|
||||||
|
item_dict["def"] = 0;
|
||||||
|
item_dict["agi"] = 0;
|
||||||
|
if fix_id:
|
||||||
|
for id_row in id_info:
|
||||||
|
label, high = re.split(r'<td', id_row)[1:]
|
||||||
|
high = high.split(">")[1].split("<")[0]
|
||||||
|
label = label.rsplit("<",1)[0][1:]
|
||||||
|
if "i class" in label:
|
||||||
|
_, two, three = label.split(">", 2)
|
||||||
|
label = two.split("<")[0][2:] + three
|
||||||
|
value_combine = high + " " + label
|
||||||
|
result = re.match(number_regex, value_combine)
|
||||||
|
high = int(result.group(1))
|
||||||
|
key = result.group(2).strip()
|
||||||
|
print(high, key)
|
||||||
|
item_dict[id_reverse_map[key]] = high
|
||||||
|
else:
|
||||||
|
for id_row in id_info:
|
||||||
|
low, label, high = re.split(r'<td', id_row)[1:]
|
||||||
|
low = low.split(">")[1].split("<")[0]
|
||||||
|
high = high.split(">")[1].split("<")[0]
|
||||||
|
label = label.rsplit("<",1)[0][1:]
|
||||||
|
if "i class" in label:
|
||||||
|
_, two, three = label.split(">", 2)
|
||||||
|
label = two.split("<")[0][2:] + three
|
||||||
|
value_combine = high + " " + label
|
||||||
|
result = re.match(number_regex, value_combine)
|
||||||
|
_high = int(result.group(1))
|
||||||
|
if low == "~":
|
||||||
|
_low = _high
|
||||||
|
else:
|
||||||
|
_low = int(re.match(number_regex, low).group(1))
|
||||||
|
key = result.group(2).strip()
|
||||||
|
low = min(_low, _high)
|
||||||
|
high = max(_low, _high)
|
||||||
|
print(low, high, key)
|
||||||
|
if low < 0:
|
||||||
|
# negative range: 1.3 to 0.7
|
||||||
|
base_guess = high
|
||||||
|
while base_guess > low:
|
||||||
|
if abs(base_guess * 1.3 - low) <= 0.5:
|
||||||
|
break
|
||||||
|
base_guess -= 1
|
||||||
|
else:
|
||||||
|
# positive range: 0.3 to 1.3
|
||||||
|
base_guess = low
|
||||||
|
while base_guess < high:
|
||||||
|
if abs(base_guess * 1.3 - high) <= 0.5:
|
||||||
|
break
|
||||||
|
base_guess += 1
|
||||||
|
item_dict[id_reverse_map[key]] = base_guess
|
||||||
|
return item_dict
|
||||||
|
|
||||||
|
#import sys
|
||||||
|
#print(parse_ci(sys.argv[1]))
|
||||||
|
#exit(1)
|
||||||
|
|
||||||
|
items_all = []
|
||||||
|
id_start_number = 10398
|
||||||
|
for filename in os.listdir('ci.2'):
|
||||||
|
item = parse_ci('ci.2/'+filename)
|
||||||
|
item['id'] = id_start_number + len(items_all)
|
||||||
|
items_all.append(item)
|
||||||
|
|
||||||
|
import json
|
||||||
|
with open("1_20_ci.json.2", "w") as outfile:
|
||||||
|
json.dump(items_all, outfile, indent=2)
|
||||||
|
|
20
ci_scrape.py
Normal file
20
ci_scrape.py
Normal file
|
@ -0,0 +1,20 @@
|
||||||
|
import os
|
||||||
|
|
||||||
|
with open("ci.txt.2") as infile:
|
||||||
|
current_mode = ""
|
||||||
|
for line in infile:
|
||||||
|
if line.startswith("#"):
|
||||||
|
continue
|
||||||
|
if "-" in line:
|
||||||
|
name, url = line.split(" - ")
|
||||||
|
url = "www.wynn".join(url.split("wynn", 1))
|
||||||
|
response = os.popen("curl "+url).read()
|
||||||
|
for line in response.split("\n"):
|
||||||
|
if "itembox macrocategory" in line:
|
||||||
|
response = line
|
||||||
|
break
|
||||||
|
with open(f"ci.2/{name}.html", "w") as outfile:
|
||||||
|
outfile.write(response)
|
||||||
|
if "_" in line:
|
||||||
|
break
|
||||||
|
|
|
@ -271259,11 +271259,6 @@
|
||||||
"int": 12,
|
"int": 12,
|
||||||
"def": 12,
|
"def": 12,
|
||||||
"agi": 12,
|
"agi": 12,
|
||||||
"eDamPct": 8,
|
|
||||||
"tDamPct": 8,
|
|
||||||
"wDamPct": 8,
|
|
||||||
"fDamPct": 8,
|
|
||||||
"aDamPct": 8,
|
|
||||||
"spPct2": -1,
|
"spPct2": -1,
|
||||||
"id": 10262
|
"id": 10262
|
||||||
},
|
},
|
||||||
|
|
File diff suppressed because one or more lines are too long
11
display.js
11
display.js
|
@ -1205,19 +1205,20 @@ function displaySpellDamage(parent_elem, overallparent_elem, build, spell, spell
|
||||||
title_elemavg.classList.add('Normal');
|
title_elemavg.classList.add('Normal');
|
||||||
|
|
||||||
if (spellIdx != 0) {
|
if (spellIdx != 0) {
|
||||||
title_elem.textContent = spell.title + " (" + build.getSpellCost(spellIdx, spell.cost) + ")";
|
|
||||||
let first = document.createElement("b");
|
let first = document.createElement("b");
|
||||||
first.textContent = spell.title + " (";
|
first.textContent = spell.title + " (";
|
||||||
|
title_elem.appendChild(first.cloneNode(true)); //cloneNode is needed here.
|
||||||
title_elemavg.appendChild(first);
|
title_elemavg.appendChild(first);
|
||||||
let second = document.createElement("b");
|
let second = document.createElement("b");
|
||||||
second.textContent = build.getSpellCost(spellIdx, spell.cost);
|
second.textContent = build.getSpellCost(spellIdx, spell.cost);
|
||||||
second.classList.add("Mana");
|
second.classList.add("Mana");
|
||||||
|
title_elem.appendChild(second.cloneNode(true));
|
||||||
title_elemavg.appendChild(second);
|
title_elemavg.appendChild(second);
|
||||||
let fourth = document.createElement("b");
|
let third = document.createElement("b");
|
||||||
fourth.textContent = ")";
|
third.textContent = ")";
|
||||||
title_elemavg.appendChild(fourth);
|
title_elem.appendChild(third.cloneNode(true));
|
||||||
|
title_elemavg.appendChild(third);
|
||||||
|
|
||||||
//title_elemavg.textContent = spell.title + " (" + build.getSpellCost(spellIdx, spell.cost) + ")";
|
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
title_elem.textContent = spell.title;
|
title_elem.textContent = spell.title;
|
||||||
|
|
BIN
favicon.png
BIN
favicon.png
Binary file not shown.
Before Width: | Height: | Size: 2.3 KiB After Width: | Height: | Size: 304 B |
|
@ -10,7 +10,7 @@
|
||||||
<link rel="stylesheet" media="screen and (max-width: 1099px)" href="narrow.css"/>
|
<link rel="stylesheet" media="screen and (max-width: 1099px)" href="narrow.css"/>
|
||||||
<link rel="icon" href="favicon.png">
|
<link rel="icon" href="favicon.png">
|
||||||
<link rel="manifest" href="manifest.json">
|
<link rel="manifest" href="manifest.json">
|
||||||
<title>Wynn Clientside</title>
|
<title>WynnBuilder</title>
|
||||||
</head>
|
</head>
|
||||||
<body class="all">
|
<body class="all">
|
||||||
<div class="header" id="header">
|
<div class="header" id="header">
|
||||||
|
@ -192,7 +192,7 @@
|
||||||
</div>
|
</div>
|
||||||
<br><br>
|
<br><br>
|
||||||
<div class="externalBuffs" id="buff-box">
|
<div class="externalBuffs" id="buff-box">
|
||||||
<table>
|
<table class="externalBuffs">
|
||||||
<tr>
|
<tr>
|
||||||
<p class = "buffs-title itemp title">
|
<p class = "buffs-title itemp title">
|
||||||
Spell Boosts & Powder Specials:
|
Spell Boosts & Powder Specials:
|
||||||
|
|
2
load.js
2
load.js
|
@ -1,4 +1,4 @@
|
||||||
const DB_VERSION = 19;
|
const DB_VERSION = 20;
|
||||||
// @See https://github.com/mdn/learning-area/blob/master/javascript/apis/client-side-storage/indexeddb/video-store/index.js
|
// @See https://github.com/mdn/learning-area/blob/master/javascript/apis/client-side-storage/indexeddb/video-store/index.js
|
||||||
|
|
||||||
let db;
|
let db;
|
||||||
|
|
|
@ -31,7 +31,9 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
.skp-input {
|
.skp-input {
|
||||||
|
width: 15vw;
|
||||||
|
height: 7vw;
|
||||||
|
max-height: 30px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.hide-container-block {
|
.hide-container-block {
|
||||||
|
|
|
@ -162,7 +162,7 @@ a.link{
|
||||||
.Damage { color: rgb(255, 198, 85)}
|
.Damage { color: rgb(255, 198, 85)}
|
||||||
|
|
||||||
.Mana { color: #5ff;}
|
.Mana { color: #5ff;}
|
||||||
.Mana:after { content: "\2749"}
|
.Mana:after { content: "\273A"}
|
||||||
|
|
||||||
.Health {
|
.Health {
|
||||||
color: #a00;
|
color: #a00;
|
||||||
|
@ -286,3 +286,7 @@ button.toggleOn{
|
||||||
text-align: center;
|
text-align: center;
|
||||||
transform: translateX(calc(50vw - 50%));
|
transform: translateX(calc(50vw - 50%));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.externalBuffs {
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in a new issue