Fix negative skillpoint encoding
This commit is contained in:
parent
5269355a09
commit
0542acab49
3 changed files with 19 additions and 6 deletions
|
@ -46,8 +46,8 @@ function calculateSpellDamage(stats, spellConversions, rawModifier, pctModifier,
|
|||
else {
|
||||
damageMult *= spellMultiplier * baseDamageMultiplier[attackSpeeds.indexOf(stats.get("atkSpd"))];
|
||||
}
|
||||
console.log(damages);
|
||||
console.log(damageMult);
|
||||
//console.log(damages);
|
||||
//console.log(damageMult);
|
||||
|
||||
rawModifier *= spellMultiplier;
|
||||
|
||||
|
|
7
test.js
7
test.js
|
@ -11,7 +11,7 @@ console.log(url_tag);
|
|||
* END testing section
|
||||
*/
|
||||
|
||||
const BUILD_VERSION = "2.1";
|
||||
const BUILD_VERSION = "2.2";
|
||||
|
||||
document.getElementById("header").textContent = "Wynn build calculator "+BUILD_VERSION+" (db version "+DB_VERSION+")";
|
||||
|
||||
|
@ -254,7 +254,7 @@ function populateFromURL() {
|
|||
save_skp = true;
|
||||
let skillpoint_info = info[1].slice(27, 37);
|
||||
for (let i = 0; i < 5; ++i ) {
|
||||
skillpoints[i] = Base64.toInt(skillpoint_info.slice(i*2,i*2+2));
|
||||
skillpoints[i] = Base64.toIntSigned(skillpoint_info.slice(i*2,i*2+2));
|
||||
}
|
||||
|
||||
let powder_info = info[1].slice(37);
|
||||
|
@ -301,8 +301,9 @@ function encodeBuild() {
|
|||
Base64.fromIntN(player_build.necklace.get("id"), 3) +
|
||||
Base64.fromIntN(player_build.weapon.get("id"), 3);
|
||||
|
||||
console.log("NOW");
|
||||
for (const skp of skp_order) {
|
||||
build_string += Base64.fromIntN(getValue(skp + "-skp"), 2); // Maximum skillpoints: 4096
|
||||
build_string += Base64.fromIntN(getValue(skp + "-skp"), 2); // Maximum skillpoints: 2048
|
||||
}
|
||||
|
||||
for (const _powderset of player_build.powders) {
|
||||
|
|
14
utils.js
14
utils.js
|
@ -68,8 +68,9 @@ Base64 = (function () {
|
|||
fromIntN: function(int32, n) {
|
||||
var result = '';
|
||||
for (let i = 0; i < n; ++i) {
|
||||
console.log(int32);
|
||||
result = digits[int32 & 0x3f] + result;
|
||||
int32 >>>= 6;
|
||||
int32 >>= 6;
|
||||
}
|
||||
return result;
|
||||
},
|
||||
|
@ -81,6 +82,17 @@ Base64 = (function () {
|
|||
}
|
||||
return result;
|
||||
},
|
||||
toIntSigned: function(digitsStr) {
|
||||
var result = 0;
|
||||
var digits = digitsStr.split('');
|
||||
if (digits[0] && (digitsMap[digits[0]] & 0x20)) {
|
||||
result = -1;
|
||||
}
|
||||
for (var i = 0; i < digits.length; i++) {
|
||||
result = (result << 6) + digitsMap[digits[i]];
|
||||
}
|
||||
return result;
|
||||
}
|
||||
};
|
||||
})();
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue