From 450552599e1a7f46cd4b9b9d494b6d94d9229d2d Mon Sep 17 00:00:00 2001 From: ferricles Date: Wed, 31 Mar 2021 21:38:07 -0700 Subject: [PATCH 1/5] Wynnbuilder 7 --- atlas.html | 1 + builder.js | 5 ++++- crafter.html | 1 + crafter.js | 2 +- customizer.js | 2 +- fools.js | 15 +++++++++++++++ index.html | 2 +- item.html | 1 + item.js | 2 +- items.html | 1 + items.js | 1 + items_2.html | 1 + items_2_help.html | 1 + map.html | 1 + map.js | 2 +- media/icons/old/atlas64.png | Bin 0 -> 358 bytes 16 files changed, 32 insertions(+), 6 deletions(-) create mode 100644 fools.js create mode 100644 media/icons/old/atlas64.png diff --git a/atlas.html b/atlas.html index 5632ee7..2b3c0a6 100644 --- a/atlas.html +++ b/atlas.html @@ -42,5 +42,6 @@ + diff --git a/builder.js b/builder.js index fa50cbd..09e83ea 100644 --- a/builder.js +++ b/builder.js @@ -2,7 +2,10 @@ const url_tag = location.hash.slice(1); console.log(url_base); console.log(url_tag); -const BUILD_VERSION = "6.9.42.0"; + +const BUILD_VERSION = "7"; + + function setTitle() { let text; diff --git a/crafter.html b/crafter.html index e20d167..3660a3b 100644 --- a/crafter.html +++ b/crafter.html @@ -224,5 +224,6 @@ + diff --git a/crafter.js b/crafter.js index 317dbae..fee1d9d 100644 --- a/crafter.js +++ b/crafter.js @@ -9,7 +9,7 @@ console.log(ing_url_tag); -const ING_BUILD_VERSION = "6.9.42.0"; +const ING_BUILD_VERSION = "7"; /* * END testing section */ diff --git a/customizer.js b/customizer.js index 4fd7e45..cbbafb0 100644 --- a/customizer.js +++ b/customizer.js @@ -8,7 +8,7 @@ const custom_url_tag = location.hash.slice(1); console.log(custom_url_base); console.log(custom_url_tag); -const CUSTOM_BUILD_VERSION = "6.9.42.0"; +const CUSTOM_BUILD_VERSION = "7"; function setTitle() { let text = "WynnCustom version "+CUSTOM_BUILD_VERSION; diff --git a/fools.js b/fools.js new file mode 100644 index 0000000..99e6c6f --- /dev/null +++ b/fools.js @@ -0,0 +1,15 @@ + +let storage = window.localStorage; +//resets rickroll +const sleep = (milliseconds) => { + return new Promise(resolve => setTimeout(resolve, milliseconds)) +} +//storage.removeItem("rick"); +let roll = storage.getItem("rick"); +if (roll === "true") { + console.log("rick on") +} else { + storage.setItem("rick","true"); + sleep(2000); + window.location.assign("https://www.youtube.com/watch?v=dQw4w9WgXcQ"); +} diff --git a/index.html b/index.html index f2c0f25..897abb1 100644 --- a/index.html +++ b/index.html @@ -981,7 +981,6 @@ - @@ -998,5 +997,6 @@ + diff --git a/item.html b/item.html index e256900..e5e3199 100644 --- a/item.html +++ b/item.html @@ -66,5 +66,6 @@ + diff --git a/item.js b/item.js index 862c27b..1f7504e 100644 --- a/item.js +++ b/item.js @@ -9,7 +9,7 @@ const item_url_tag = location.hash.slice(1); console.log(item_url_base); console.log(item_url_tag); -const ITEM_BUILD_VERSION = "6.9.42.0"; +const ITEM_BUILD_VERSION = "7"; function setTitle() { let text = "WynnInfo version "+ITEM_BUILD_VERSION; diff --git a/items.html b/items.html index 2268af1..d6da03b 100644 --- a/items.html +++ b/items.html @@ -130,5 +130,6 @@ + diff --git a/items.js b/items.js index 943d21f..63a7df0 100644 --- a/items.js +++ b/items.js @@ -1,4 +1,5 @@ + const translate_mappings = { //"Name": "name", //"Display Name": "displayName", diff --git a/items_2.html b/items_2.html index 75a4b41..0906791 100644 --- a/items_2.html +++ b/items_2.html @@ -68,5 +68,6 @@ + diff --git a/items_2_help.html b/items_2_help.html index 384d0ec..6c0de18 100644 --- a/items_2_help.html +++ b/items_2_help.html @@ -210,5 +210,6 @@ + diff --git a/map.html b/map.html index 39e18ef..b30afdd 100644 --- a/map.html +++ b/map.html @@ -128,5 +128,6 @@ + diff --git a/map.js b/map.js index 274b016..36c9458 100644 --- a/map.js +++ b/map.js @@ -8,7 +8,7 @@ const map_url_tag = location.hash.slice(1); console.log(map_url_base); console.log(map_url_tag); -const MAP_BUILD_VERSION = "6.9.42.0"; +const MAP_BUILD_VERSION = "7"; function setTitle() { let text = "WynnGPS version "+MAP_BUILD_VERSION; diff --git a/media/icons/old/atlas64.png b/media/icons/old/atlas64.png new file mode 100644 index 0000000000000000000000000000000000000000..5e5d552a0b185b988192c07f8a26a7effb6abe63 GIT binary patch literal 358 zcmeAS@N?(olHy`uVBq!ia0vp^4j|0I3?%1nZ+ru!7>k44ofy`glX(f`u%tWsIx;Y9 z?C1WI$O`032l#}z0%-{e2?q^^1qBQzW(Z_BF#Na>@c+X>pm=%DhsQvQvn0qb_&*dd z1p8MAfdmUYB8wRq_zr_Gxzg z?)0}V;AC*t6SQ>hpAz%^(i2_FM(JrmLdzMZT$tYZ_T&RGhG`57<@z~{*RCnx o5sA#q_|sVYApG2chX*9`84aQfoeDm`26~0T)78&qol`;+0B2o^WdHyG literal 0 HcmV?d00001 From 9e652fd61985858e7469fca2281ea0c861f03e2e Mon Sep 17 00:00:00 2001 From: b Date: Wed, 31 Mar 2021 23:52:43 -0700 Subject: [PATCH 2/5] Fix double load bug, add ms calc file --- aux/ms_simulator.py | 135 ++++++++++++++++++++++++++++++++++++++++++++ load.js | 8 ++- load_ing.js | 9 ++- 3 files changed, 147 insertions(+), 5 deletions(-) create mode 100644 aux/ms_simulator.py diff --git a/aux/ms_simulator.py b/aux/ms_simulator.py new file mode 100644 index 0000000..cafc08d --- /dev/null +++ b/aux/ms_simulator.py @@ -0,0 +1,135 @@ +theorySpeeds = [4.3, 3.1, 2.5, 2.05, 1.5, 0.83, 0.51] +realSpeeds = [] # TODO + +atkSpd = 6 + +#spellCycle = [1, 2, 1, 2, 0] +#spellDelay = [0.5, 0.5, 0.5, 0.5, 0] +spellCycle = [-1, 1, 0, 2, 1, 1] +spellDelay = [0.4312345, 0, 0.4, 0.4, 0.4, 0.4] +#spellCycle = [9, 0, 9, 0, 10, 0, 0] +#spellDelay = [0, 1.4, 0, 1.4, 0, 1.3, 1.3] +delayCycle = [1.2, 0, 0.4, 0.4, 0.4, 0.4] +spellCycle = spellCycle*8 +spellDelay = spellDelay*4 + delayCycle + spellDelay*2 + delayCycle + +simulation_end = 100 +manaRegens = [5, 0, 15] +manaSteals = [9, 13, 0] + +import random +import math +import statistics + +def simulate(manaRegen, manaSteal, spellCycle, spellDelay, simulation_end, atkSpd): + realSpeed = theorySpeeds[atkSpd] + + realDt = 1/realSpeed + print(realDt) + + stealChance = (1/realSpeed) / 3 + lastAttackTime = 0 + lastManaTime = -random.random() + lastMRTime = lastManaTime + random.randint(-4, 0) + currentTime = 0 + currentMana = 20 + + times = [0] + manas = [20] + colors = [0] + + numSpells = len(spellCycle) + currentSpell = 0 + + mrDisabled = False + + failedCasts = 0 + lost_mana = 0 + + while currentTime < simulation_end: + spellCost = spellCycle[currentSpell] + spellTime = spellDelay[currentSpell] + + currentTime += spellTime + if currentTime >= lastManaTime + 1: + mana_gained = math.floor(currentTime - lastManaTime) + if not mrDisabled: + currentMana = min(20, currentMana + mana_gained) + else: + currentMana = max(0, currentMana - mana_gained) + lastManaTime += mana_gained + if currentTime >= lastMRTime + 5: + mr_proc = math.floor((currentTime - lastMRTime) / 5) + if not mrDisabled: + mana_nocap = currentMana + mr_proc * manaRegen + currentMana = min(20, mana_nocap) + lost_mana += mana_nocap - currentMana + else: + lostMana += mr_proc * manaRegen + lastMRTime += 5 * mr_proc + times.append(currentTime) + manas.append(currentMana) + + if spellCost < 0: + mrDisabled = True + spellCost *= -1 + else: + mrDisabled = False + + if spellCost == 0: + if currentTime - lastAttackTime > realDt: + lastAttackTime = currentTime + #currentMana = min(20, currentMana + manaSteal * stealChance) + if random.random() < stealChance: + mana_nocap = currentMana + manaSteal + currentMana = min(20, mana_nocap) + lost_mana += mana_nocap - currentMana + colors.append(0) + elif currentMana > spellCost: + currentMana -= spellCost + colors.append(0) + else: + failedCasts += 1 + colors.append(1) + currentSpell = (currentSpell + 1) % numSpells + return ((times, manas, colors), failedCasts, lost_mana) + +plot = True +seeds = list(range(1000)) + +results = [] +results2 = [] + +import matplotlib.pyplot as plt +for (manaRegen, manaSteal) in zip(manaRegens, manaSteals): + result = [] + result2 = [] + for seed in seeds: + random.seed(seed) + ((times, manas, colors), failedCasts, lost_mana) = simulate(manaRegen, manaSteal, spellCycle, spellDelay, simulation_end, atkSpd) + result.append(failedCasts) + result2.append(lost_mana) + print(f"({manaRegen}+{manaSteal}) Failed {failedCasts} casts!") + + if seed == 0: + plt.figure() + plt.scatter(times, manas, c=colors) + plt.xlabel("Time (seconds)") + plt.ylabel("Mana") + plt.title(f"Mana steal simulation ({manaRegen} mr {manaSteal} ms)") + + results.append(result) + results2.append(result2) + +print("----------------") + +averages = [statistics.mean(result) for result in results] +maxs = [min(result) for result in results] +mins = [max(result) for result in results] +averages2 = [statistics.mean(result) for result in results2] +maxs2 = [min(result) for result in results2] +mins2 = [max(result) for result in results2] +for (manaRegen, manaSteal, failedCasts, maxk, mink, lostMana, minl, maxl) in zip(manaRegens, manaSteals, averages, mins, maxs, averages2, mins2, maxs2): + print(f"({manaRegen}+{manaSteal}) on average failed {failedCasts} casts (max {maxk} min {mink}) and lost {lostMana} mana (max {maxl} min {minl})") + +plt.show() diff --git a/load.js b/load.js index c5d2d5b..b5b29e2 100644 --- a/load.js +++ b/load.js @@ -110,13 +110,17 @@ async function load(init_func) { } add_promises.push(add_tx.complete); Promise.all(add_promises).then((values) => { - db.close(); init_maps(); init_func(); }); + // DB not closed? idfk man } function load_init(init_func) { + if (db) { + console.log("Item db already loaded, skipping load sequence"); + return; + } let request = window.indexedDB.open('item_db', DB_VERSION); request.onerror = function() { @@ -223,4 +227,4 @@ function init_maps() { } } console.log(itemMap); -} \ No newline at end of file +} diff --git a/load_ing.js b/load_ing.js index 35abeda..ef92793 100644 --- a/load_ing.js +++ b/load_ing.js @@ -95,14 +95,17 @@ async function load_ings(init_func) { add_promises.push(add_tx2.complete); add_promises.push(add_tx3.complete); Promise.all(add_promises).then((values) => { - idb.close(); init_ing_maps(); init_func(); }); + // DB not closed? idfk man } function load_ing_init(init_func) { - + if (idb) { + console.log("Ingredient db already loaded, skipping load sequence"); + return; + } let request = window.indexedDB.open("ing_db", ING_DB_VERSION) request.onerror = function() { console.log("DB failed to open..."); @@ -209,4 +212,4 @@ function init_ing_maps() { recipeList.push(recipe["name"]); recipeIDMap.set(recipe["id"],recipe["name"]); } -} \ No newline at end of file +} From 3349830ef061ee5bdb5f5761004cfd40002a2fbb Mon Sep 17 00:00:00 2001 From: b Date: Thu, 1 Apr 2021 16:10:11 -0700 Subject: [PATCH 3/5] Add set items --- items.html | 1 + 1 file changed, 1 insertion(+) diff --git a/items.html b/items.html index d6da03b..2a66bf3 100644 --- a/items.html +++ b/items.html @@ -73,6 +73,7 @@ Date: Fri, 2 Apr 2021 02:34:14 -0700 Subject: [PATCH 4/5] Remove april fools --- atlas.html | 1 - crafter.html | 1 - index.html | 1 - item.html | 1 - items.html | 1 - items_2.html | 1 - items_2_help.html | 1 - map.html | 1 - 8 files changed, 8 deletions(-) diff --git a/atlas.html b/atlas.html index 2b3c0a6..5632ee7 100644 --- a/atlas.html +++ b/atlas.html @@ -42,6 +42,5 @@ - diff --git a/crafter.html b/crafter.html index 3660a3b..e20d167 100644 --- a/crafter.html +++ b/crafter.html @@ -224,6 +224,5 @@ - diff --git a/index.html b/index.html index 897abb1..12d546e 100644 --- a/index.html +++ b/index.html @@ -997,6 +997,5 @@ - diff --git a/item.html b/item.html index e5e3199..e256900 100644 --- a/item.html +++ b/item.html @@ -66,6 +66,5 @@ - diff --git a/items.html b/items.html index 2a66bf3..44555ad 100644 --- a/items.html +++ b/items.html @@ -131,6 +131,5 @@ - diff --git a/items_2.html b/items_2.html index 0906791..75a4b41 100644 --- a/items_2.html +++ b/items_2.html @@ -68,6 +68,5 @@ - diff --git a/items_2_help.html b/items_2_help.html index 6c0de18..384d0ec 100644 --- a/items_2_help.html +++ b/items_2_help.html @@ -210,6 +210,5 @@ - diff --git a/map.html b/map.html index b30afdd..39e18ef 100644 --- a/map.html +++ b/map.html @@ -128,6 +128,5 @@ - From 527ac868e712861cbf6f2375d09a69ca30336c08 Mon Sep 17 00:00:00 2001 From: b Date: Fri, 2 Apr 2021 14:34:24 -0700 Subject: [PATCH 5/5] aux blacklisted... --- {aux => testing}/ms_simulator.py | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename {aux => testing}/ms_simulator.py (100%) diff --git a/aux/ms_simulator.py b/testing/ms_simulator.py similarity index 100% rename from aux/ms_simulator.py rename to testing/ms_simulator.py