full tome functionality
This commit is contained in:
parent
621a115a5c
commit
8460b2e0a7
7 changed files with 22 additions and 12 deletions
|
@ -434,7 +434,7 @@
|
|||
</div>
|
||||
</div>
|
||||
<div class = "col dark-6 rounded-bottom my-3 my-xl-1" id = "tomes-dropdown" style = "display: none;">
|
||||
<div class="row h-100 row-cols-1 row-cols-xl-2 rounded">
|
||||
<div class="row h-100 row-cols-1 row-cols-xl-2 gy-2 rounded">
|
||||
<div class="col-auto rounded">
|
||||
<div class="row h-100 dark-shadow rounded" id='weaponTome1-dropdown'>
|
||||
<div class="col-auto g-0 rounded-end my-auto text-center scaled-item-icon" id="weaponTome1-img-loc">
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
function calculate_skillpoints(equipment, weapon, tomes = []) {
|
||||
function calculate_skillpoints(equipment, weapon) {
|
||||
// Calculate equipment equipping order and required skillpoints.
|
||||
// Return value: [equip_order, best_skillpoints, final_skillpoints, best_total];
|
||||
let fixed = [];
|
||||
|
|
11
js/sq2bs.js
11
js/sq2bs.js
|
@ -3,8 +3,6 @@ let armor_keys = ['helmet', 'chestplate', 'leggings', 'boots'];
|
|||
let skp_keys = ['str', 'dex', 'int', 'def', 'agi'];
|
||||
let accessory_keys= ['ring1', 'ring2', 'bracelet', 'necklace'];
|
||||
let powderable_keys = ['helmet', 'chestplate', 'leggings', 'boots', 'weapon'];
|
||||
let tome_types = ['weaponTome', 'armorTome', 'guildTome'];
|
||||
let tome_keys = ['weaponTome1', 'weaponTome2', 'armorTome1', 'armorTome2', 'armorTome3', 'armorTome4', 'guildTome1'];
|
||||
let equipment_keys = ['helmet', 'chestplate', 'leggings', 'boots', 'ring1', 'ring2', 'bracelet', 'necklace', 'weapon'].concat(tome_keys);
|
||||
let powder_keys = ['e', 't', 'w', 'f', 'a'];
|
||||
|
||||
|
@ -155,9 +153,9 @@ function update_field(field) {
|
|||
tome = tomeMap.get(item);
|
||||
if (!tome) {return false;}
|
||||
powder_slots = 0;
|
||||
tier = item.tier;
|
||||
category = item.category;
|
||||
type = item.type;
|
||||
tier = tome.tier;
|
||||
category = tome.category;
|
||||
type = tome.type;
|
||||
}
|
||||
else {
|
||||
// item not found
|
||||
|
@ -406,7 +404,8 @@ function init_autocomplete() {
|
|||
if (tome_obj["name"].includes('No ' + eq.charAt(0).toUpperCase())) {
|
||||
continue;
|
||||
}
|
||||
tome_arr.push(tome)
|
||||
let tome_name = tome;
|
||||
tome_arr.push(tome_name);
|
||||
}
|
||||
|
||||
// create dropdown
|
||||
|
|
|
@ -488,7 +488,7 @@ class Build{
|
|||
this.tomes = [this.weaponTome1, this.weaponTome2, this.armorTome1, this.armorTome2, this.armorTome3, this.armorTome4, this.guildTome1];
|
||||
this.items = this.equipment.concat([this.weapon]).concat(this.tomes);
|
||||
// return [equip_order, best_skillpoints, final_skillpoints, best_total];
|
||||
let result = calculate_skillpoints(this.equipment, this.weapon, this.tomes);
|
||||
let result = calculate_skillpoints(this.equipment.concat(this.tomes), this.weapon);
|
||||
console.log(result);
|
||||
this.equip_order = result[0];
|
||||
// How many skillpoints the player had to assign (5 number)
|
||||
|
|
|
@ -123,7 +123,7 @@ function parsePowdering(powder_info) {
|
|||
for (let i = 0; i < 5; ++i) {
|
||||
let powders = "";
|
||||
let n_blocks = Base64.toInt(powder_info.charAt(0));
|
||||
console.log(n_blocks + " blocks");
|
||||
// console.log(n_blocks + " blocks");
|
||||
powder_info = powder_info.slice(1);
|
||||
for (let j = 0; j < n_blocks; ++j) {
|
||||
let block = powder_info.slice(0,5);
|
||||
|
@ -291,7 +291,6 @@ function encodeBuild() {
|
|||
build_string += "CR-"+encodeCraft(player_build.craftedItems[crafted_idx]);
|
||||
crafted_idx += 1;
|
||||
} else if (item.get("category") === "tome") {
|
||||
console.log(item);
|
||||
build_string += Base64.fromIntN(item.get("id"), 1);
|
||||
} else {
|
||||
build_string += Base64.fromIntN(item.get("id"), 3);
|
||||
|
|
|
@ -61,9 +61,15 @@ let item_types = [
|
|||
"Bow",
|
||||
"Potion",
|
||||
"Scroll",
|
||||
"Food"
|
||||
"Food",
|
||||
"Weapon Tome",
|
||||
"Armor Tome",
|
||||
"Guild Tome"
|
||||
]
|
||||
|
||||
let tome_types = ['weaponTome', 'armorTome', 'guildTome'];
|
||||
let tome_keys = ['weaponTome1', 'weaponTome2', 'armorTome1', 'armorTome2', 'armorTome3', 'armorTome4', 'guildTome1'];
|
||||
|
||||
/*
|
||||
* Display commands
|
||||
*/
|
||||
|
|
|
@ -14,6 +14,12 @@ const pdfs = new Map([
|
|||
|
||||
|
||||
const changelog = new Map([
|
||||
["Build Version 6 (20 May 2022)",
|
||||
[
|
||||
" + Added Tomes",
|
||||
" + Changed Build encode and decode schemes to account for tomes",
|
||||
]
|
||||
],
|
||||
["WynnBuilder^2 (12 May 2022)",
|
||||
[
|
||||
" + Switched most of Wynnbuilder over to Bootstrap",
|
||||
|
|
Loading…
Reference in a new issue