Merge branch 'dev' of https://github.com/hppeng-wynn/hppeng-wynn.github.io into dev
This commit is contained in:
commit
c288357e6d
13 changed files with 172 additions and 11 deletions
|
@ -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;
|
||||
|
|
|
@ -9,7 +9,7 @@ const ing_url_tag = location.hash.slice(1);
|
|||
|
||||
|
||||
|
||||
const ING_BUILD_VERSION = "6.9.42.0";
|
||||
const ING_BUILD_VERSION = "7";
|
||||
/*
|
||||
* END testing section
|
||||
*/
|
||||
|
|
|
@ -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;
|
||||
|
|
15
fools.js
Normal file
15
fools.js
Normal file
|
@ -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");
|
||||
}
|
|
@ -981,7 +981,6 @@
|
|||
</div>
|
||||
</footer>
|
||||
</div>
|
||||
|
||||
<script type="text/javascript" src="utils.js"></script>
|
||||
<script type="text/javascript" src="loadheader.js"></script>
|
||||
<script type="text/javascript" src="icons.js"></script>
|
||||
|
|
2
item.js
2
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;
|
||||
|
|
|
@ -73,6 +73,7 @@
|
|||
<option value="ANY">
|
||||
<option value="Normal">
|
||||
<option value="Unique">
|
||||
<option value="Set">
|
||||
<option value="Rare">
|
||||
<option value="Legendary">
|
||||
<option value="Fabled">
|
||||
|
|
1
items.js
1
items.js
|
@ -1,4 +1,5 @@
|
|||
|
||||
|
||||
const translate_mappings = {
|
||||
//"Name": "name",
|
||||
//"Display Name": "displayName",
|
||||
|
|
8
load.js
8
load.js
|
@ -117,13 +117,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() {
|
||||
|
@ -230,4 +234,4 @@ function init_maps() {
|
|||
}
|
||||
}
|
||||
console.log(itemMap);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -102,14 +102,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...");
|
||||
|
@ -221,4 +224,4 @@ function init_ing_maps() {
|
|||
recipeList.push(recipe["name"]);
|
||||
recipeIDMap.set(recipe["id"],recipe["name"]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
2
map.js
2
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;
|
||||
|
|
BIN
media/icons/old/atlas64.png
Normal file
BIN
media/icons/old/atlas64.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 358 B |
135
testing/ms_simulator.py
Normal file
135
testing/ms_simulator.py
Normal file
|
@ -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()
|
Loading…
Reference in a new issue