full tome functionality

This commit is contained in:
ferricles 2022-05-20 21:34:24 -07:00
parent 621a115a5c
commit 8460b2e0a7
7 changed files with 22 additions and 12 deletions

View file

@ -434,7 +434,7 @@
</div> </div>
</div> </div>
<div class = "col dark-6 rounded-bottom my-3 my-xl-1" id = "tomes-dropdown" style = "display: none;"> <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="col-auto rounded">
<div class="row h-100 dark-shadow rounded" id='weaponTome1-dropdown'> <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"> <div class="col-auto g-0 rounded-end my-auto text-center scaled-item-icon" id="weaponTome1-img-loc">

View file

@ -1,4 +1,4 @@
function calculate_skillpoints(equipment, weapon, tomes = []) { function calculate_skillpoints(equipment, weapon) {
// Calculate equipment equipping order and required skillpoints. // Calculate equipment equipping order and required skillpoints.
// Return value: [equip_order, best_skillpoints, final_skillpoints, best_total]; // Return value: [equip_order, best_skillpoints, final_skillpoints, best_total];
let fixed = []; let fixed = [];

View file

@ -3,8 +3,6 @@ let armor_keys = ['helmet', 'chestplate', 'leggings', 'boots'];
let skp_keys = ['str', 'dex', 'int', 'def', 'agi']; let skp_keys = ['str', 'dex', 'int', 'def', 'agi'];
let accessory_keys= ['ring1', 'ring2', 'bracelet', 'necklace']; let accessory_keys= ['ring1', 'ring2', 'bracelet', 'necklace'];
let powderable_keys = ['helmet', 'chestplate', 'leggings', 'boots', 'weapon']; 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 equipment_keys = ['helmet', 'chestplate', 'leggings', 'boots', 'ring1', 'ring2', 'bracelet', 'necklace', 'weapon'].concat(tome_keys);
let powder_keys = ['e', 't', 'w', 'f', 'a']; let powder_keys = ['e', 't', 'w', 'f', 'a'];
@ -155,9 +153,9 @@ function update_field(field) {
tome = tomeMap.get(item); tome = tomeMap.get(item);
if (!tome) {return false;} if (!tome) {return false;}
powder_slots = 0; powder_slots = 0;
tier = item.tier; tier = tome.tier;
category = item.category; category = tome.category;
type = item.type; type = tome.type;
} }
else { else {
// item not found // item not found
@ -406,7 +404,8 @@ function init_autocomplete() {
if (tome_obj["name"].includes('No ' + eq.charAt(0).toUpperCase())) { if (tome_obj["name"].includes('No ' + eq.charAt(0).toUpperCase())) {
continue; continue;
} }
tome_arr.push(tome) let tome_name = tome;
tome_arr.push(tome_name);
} }
// create dropdown // create dropdown

View file

@ -488,7 +488,7 @@ class Build{
this.tomes = [this.weaponTome1, this.weaponTome2, this.armorTome1, this.armorTome2, this.armorTome3, this.armorTome4, this.guildTome1]; 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); this.items = this.equipment.concat([this.weapon]).concat(this.tomes);
// return [equip_order, best_skillpoints, final_skillpoints, best_total]; // 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); console.log(result);
this.equip_order = result[0]; this.equip_order = result[0];
// How many skillpoints the player had to assign (5 number) // How many skillpoints the player had to assign (5 number)

View file

@ -123,7 +123,7 @@ function parsePowdering(powder_info) {
for (let i = 0; i < 5; ++i) { for (let i = 0; i < 5; ++i) {
let powders = ""; let powders = "";
let n_blocks = Base64.toInt(powder_info.charAt(0)); 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); powder_info = powder_info.slice(1);
for (let j = 0; j < n_blocks; ++j) { for (let j = 0; j < n_blocks; ++j) {
let block = powder_info.slice(0,5); let block = powder_info.slice(0,5);
@ -291,7 +291,6 @@ function encodeBuild() {
build_string += "CR-"+encodeCraft(player_build.craftedItems[crafted_idx]); build_string += "CR-"+encodeCraft(player_build.craftedItems[crafted_idx]);
crafted_idx += 1; crafted_idx += 1;
} else if (item.get("category") === "tome") { } else if (item.get("category") === "tome") {
console.log(item);
build_string += Base64.fromIntN(item.get("id"), 1); build_string += Base64.fromIntN(item.get("id"), 1);
} else { } else {
build_string += Base64.fromIntN(item.get("id"), 3); build_string += Base64.fromIntN(item.get("id"), 3);

View file

@ -61,9 +61,15 @@ let item_types = [
"Bow", "Bow",
"Potion", "Potion",
"Scroll", "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 * Display commands
*/ */

View file

@ -14,6 +14,12 @@ const pdfs = new Map([
const changelog = 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)", ["WynnBuilder^2 (12 May 2022)",
[ [
" + Switched most of Wynnbuilder over to Bootstrap", " + Switched most of Wynnbuilder over to Bootstrap",