2021-03-14 07:55:08 +00:00
|
|
|
/*
|
|
|
|
* TESTING SECTION
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
const item_url_base = location.href.split("#")[0];
|
|
|
|
const item_url_tag = location.hash.slice(1);
|
2021-04-02 17:44:54 +00:00
|
|
|
// console.log(item_url_base);
|
|
|
|
// console.log(item_url_tag);
|
2021-03-14 07:55:08 +00:00
|
|
|
|
2021-04-07 06:01:05 +00:00
|
|
|
const ITEM_BUILD_VERSION = "7.0.1";
|
2021-03-14 07:55:08 +00:00
|
|
|
|
|
|
|
|
|
|
|
let item;
|
2021-04-07 06:01:05 +00:00
|
|
|
let amp_state = 0; //the level of corkian map used for ID purposes. Default 0.
|
2021-03-14 07:55:08 +00:00
|
|
|
|
2021-04-02 22:07:15 +00:00
|
|
|
function init_itempage() {
|
2021-03-14 07:55:08 +00:00
|
|
|
//console.log(item_url_tag);
|
|
|
|
|
|
|
|
//displayExpandedItem(expandItem(itemMap.get(item_url_tag).statMap, []), "item-view");
|
|
|
|
try{
|
2021-04-07 06:01:05 +00:00
|
|
|
item = expandItem(itemMap.get(item_url_tag.replaceAll("%20"," ")), []);
|
2022-07-17 03:49:06 +00:00
|
|
|
if (item.get('category') === 'weapon') {
|
|
|
|
item.set('powders', []);
|
|
|
|
apply_weapon_powders(item);
|
|
|
|
}
|
|
|
|
displayExpandedItem(item, "item-view");
|
|
|
|
displayAdditionalInfo("additional-info", item);
|
|
|
|
displayIDCosts("identification-costs", item);
|
2021-04-07 06:01:05 +00:00
|
|
|
if (item.get("set") && sets[item.get("set")]) {
|
2022-07-17 03:49:06 +00:00
|
|
|
displayAllSetBonuses("set-bonus-info",item.get("set"));
|
2021-03-14 07:55:08 +00:00
|
|
|
}
|
2022-07-17 03:49:06 +00:00
|
|
|
displayIDProbabilities("identification-probabilities", item, amp_state);
|
2021-03-14 07:55:08 +00:00
|
|
|
} catch (error) {
|
|
|
|
console.log(error);
|
2022-05-17 02:44:40 +00:00
|
|
|
console.log(error.stack);
|
2021-03-14 07:55:08 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-04-07 06:01:05 +00:00
|
|
|
/** Toggles the corkian amplifier level.
|
|
|
|
*
|
|
|
|
* @param {Number} button_id the ID of the button just pressed.
|
|
|
|
*/
|
|
|
|
function toggleAmps(button_id) {
|
|
|
|
amp_state = 0;
|
|
|
|
if (button_id == 0) {return;}
|
|
|
|
else {
|
|
|
|
let button = document.getElementById("cork_amp_" + button_id);
|
|
|
|
if (!button.classList.contains("toggleOn")) {
|
|
|
|
for (const child of document.getElementById("amp_row").childNodes) {
|
|
|
|
if (child.tagName === "BUTTON" && child.id !== button.id && child.classList.contains("toggleOn")) {
|
|
|
|
child.classList.remove("toggleOn");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
amp_state = button_id;
|
|
|
|
}
|
|
|
|
}
|
2022-05-17 02:44:40 +00:00
|
|
|
displaysq2IDProbabilities("identification-probabilities", item, amp_state);
|
2021-04-07 06:01:05 +00:00
|
|
|
}
|
|
|
|
|
2021-03-14 07:55:08 +00:00
|
|
|
|
2022-07-17 03:49:06 +00:00
|
|
|
(async function() {
|
|
|
|
let load_promises = [ load_init() ];
|
|
|
|
await Promise.all(load_promises);
|
|
|
|
init_itempage();
|
|
|
|
})();
|