Update to 1.20.3 with item api

This commit is contained in:
b 2021-07-13 15:34:40 -07:00
parent bd09cd23e1
commit ad5c3529ec
61 changed files with 61936 additions and 118077 deletions

95795
clean.json

File diff suppressed because it is too large Load diff

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View file

@ -57,11 +57,6 @@
prepowder (true)
</button>
</td>
<td>
<button class = "button-narrow" id = "strDexToggle" onclick = "toggleStrDex()">
1.20.3 (false)
</button>
</td>
</tr>
</table>
<p id="info">

View file

@ -148,14 +148,11 @@ function showDetails(data, i, xfunc, yfunc) {
let texts = [[1, i[0]],
[3, "Prepowder: "+i[4].toFixed(2)],
[4, "Postpowder: "+i[5].toFixed(2)],
[5, "Prepowder (1.20.3): "+i[6].toFixed(2)],
[6, "Postpowder (1.20.3): "+i[7].toFixed(2)],
[7, "Prepowder drop: "+((i[4]-i[6])/i[4]*100).toFixed(2) + "%"],
[8, "Postpowder drop: "+((i[5]-i[7])/i[5]*100).toFixed(2) + "%"],
[10, "Design Modifier: "+i[9].toFixed(2)],
[11, "Explained D. Mod: "+i[8].toFixed(2)]];
let idx = 12;
for (const explanation of i[10]) {
[6, "Design Modifier: "+i[7].toFixed(2)],
[7, "Explained D. Mod: "+i[6].toFixed(2)]];
let idx = 8;
console.log(i);
for (const explanation of i[8]) {
texts.push([idx, explanation[0] + ": " + explanation[1]]);
idx += 1;
}
@ -279,12 +276,3 @@ function togglePowder() {
setGetterFunc();
redraw(current_data);
}
function toggleStrDex() {
strDex = !strDex;
if (strDex) baseline_y = dps_data.baseline_ys_new
else baseline_y = dps_data.baseline_ys
d3.select("#strDexToggle").text("1.20.3 ("+strDex+")");
setGetterFunc();
redraw(current_data);
}

29570
ingreds.json

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load diff

File diff suppressed because one or more lines are too long

View file

@ -15,6 +15,7 @@ baselines_known_y = np.array([ 341.53, 383.35, 432.14, 480.93, 536.69, 592.45, 6
baselines_known_y_new = np.zeros(len(baselines_known_x))
for i, (x, y) in enumerate(zip(baselines_known_x, baselines_known_y)):
baselines_known_y_new[i] = y * (1 - 0.01 * (x - 70))
baselines_known_y = baselines_known_y_new
def interpolate_baseline(level):
i = 0
@ -54,8 +55,8 @@ def get_display_name(item):
return item["name"]
item_data = json.load(open(items_file))["items"]
item_map = {get_display_name(item): item for item in item_data}
item_new_data = json.load(open(items_new_file))["items"]
item_new_map = {get_display_name(item): item for item in item_new_data}
#item_new_data = json.load(open(items_new_file))["items"]
#item_new_map = {get_display_name(item): item for item in item_new_data}
attack_speed_mods = {"SUPER_SLOW": 0.51, "VERY_SLOW": 0.83, "SLOW": 1.5, "NORMAL": 2.05, "FAST": 2.5, "VERY_FAST": 3.1, "SUPER_FAST": 4.3}
attack_speed_target_mult = {"SUPER_SLOW": 4, "VERY_SLOW": 2.5, "SLOW": 1.4, "NORMAL": 1, "FAST": 0.8, "VERY_FAST": 0.66, "SUPER_FAST": 0.48}
@ -162,16 +163,15 @@ for name, item in item_map.items():
continue
if item["lvl"] >= min_level and item["category"] == "weapon":
dps, postpowder_dps = get_data(item, powders_old)
new_item = item_new_map[name]
new_dps, new_postpowder_dps = get_data(new_item, powders_new)
# new_item = item_new_map[name]
# new_dps, new_postpowder_dps = get_data(new_item, powders_new)
total, actual, explain = guess_design_modifier(item, dps)
item_dat[item["type"]].append((get_display_name(item), item["lvl"], item["id"], item["tier"],
dps, postpowder_dps,
new_dps, new_postpowder_dps,
total, actual, explain))
item_dat["baseline_xs"] = baselines_known_x.tolist()
item_dat["baseline_ys"] = baselines_known_y.tolist()
item_dat["baseline_ys_new"] = baselines_known_y_new.tolist()
#item_dat["baseline_ys_new"] = baselines_known_y_new.tolist()
json.dump(item_dat, open("dps_data.json", "w"), indent=2)
json.dump(item_dat, open("dps_data_compress.json", "w"))
# item_lvl, item_dps, item_tiercolor = zip(*item_dat)

View file

@ -149,6 +149,10 @@ for item in items:
if key in item:
del item[key]
for k in list(item.keys()):
if (item[k] == 0 or item[k] is None):
del item[k]
for k, v in translate_mappings.items():
if k in item:
item[v] = item[k]
@ -163,9 +167,9 @@ for item in items:
if item["name"] in item_set_map:
item["set"] = item_set_map[item["name"]]
with open("1_20_ci.json", "r") as ci_file:
ci_items = json.load(ci_file)
items.extend(ci_items)
#with open("1_20_ci.json", "r") as ci_file:
# ci_items = json.load(ci_file)
# items.extend(ci_items)
with open("id_map.json","w") as id_mapfile:
json.dump(id_map, id_mapfile, indent=2)

View file

@ -40,19 +40,6 @@ for set_name, set_data in data["sets"].items():
for item_name in set_data["items"]:
item_set_map[item_name] = set_name
must_mappings = [
"strength",
"dexterity",
"intelligence",
"agility",
"defense",
"strengthPoints",
"dexterityPoints",
"intelligencePoints",
"agilityPoints",
"defensePoints",
]
translate_mappings = {
#"name": "name",
#"displayName": "displayName",
@ -178,7 +165,7 @@ for item in items:
del item[key]
for k in list(item.keys()):
if (item[k] == 0 or item[k] is None) and not k in must_mappings:
if (item[k] == 0 or item[k] is None):
del item[k]
for k, v in translate_mappings.items():