Merge branch 'atree' into misc-bugfix

This commit is contained in:
hppeng 2022-07-10 18:54:22 -07:00
commit 237dd4cfb6
9 changed files with 76 additions and 73 deletions

View file

@ -1399,7 +1399,6 @@
<script type="text/javascript" src="../js/builder.js"></script>
<script type="text/javascript" src="../js/builder_graph.js"></script>
<script type="text/javascript" src="../js/expr_parser.js"></script>
<script type="text/javascript" src="../js/items.js"></script>
<script type="text/javascript" src="../js/sq2items.js"></script>
<script type="text/javascript" src="../js/optimize.js"></script>

View file

@ -307,7 +307,5 @@
<script type="text/javascript" src="../js/craft.js"></script>
<script type="text/javascript" src="../js/crafter.js"></script>
<script type="text/javascript" src="../js/expr_parser.js"></script>
<script type="text/javascript" src="../js/items.js"></script>
<!-- <script type="text/javascript" src="../js/sq2items.js"></script> -->
</body>
</html>

View file

@ -1906,8 +1906,6 @@
<script type="text/javascript" src="/js/craft.js"></script>
<script type="text/javascript" src="/js/display_constants.js"></script>
<script type="text/javascript" src="/js/display.js"></script>
<script type="text/javascript" src="/js/sq2display_constants.js"></script>
<script type="text/javascript" src="/js/sq2display.js"></script>
<script type="text/javascript" src="/js/custom.js"></script>
<script type="text/javascript" src="/js/customizer.js"></script>
</body>

View file

@ -140,13 +140,11 @@
<script type="text/javascript" src="../js/damage_calc.js"></script>
<script type="text/javascript" src="../js/display_constants.js"></script>
<script type="text/javascript" src="../js/display.js"></script>
<script type="text/javascript" src="../js/sq2display_constants.js"></script>
<script type="text/javascript" src="../js/sq2display.js"></script>
<script type="text/javascript" src="../js/query.js"></script>
<script type="text/javascript" src="../js/query_2.js"></script>
<script type="text/javascript" src="../js/expr_parser.js"></script>
<script type="text/javascript" src="../js/load.js"></script>
<script type="text/javascript" src="../js/items.js"></script>
<script type="text/javascript" src="../js/sq2items.js"></script>
<script type="text/javascript" src="../js/powders.js"></script>
</body>
</html>

View file

@ -1882,8 +1882,6 @@ const atrees = {
{
"display_name": "Phantom Ray",
"desc": "Condense Arrow Storm into a single ray that damages enemies 10 times per second",
"archetype": "Sharpshooter",
"archetype_req": 0,
"base_abil": "Arrow Storm",
"parents": ["Water Mastery", "Fire Creep"],
"dependencies": ["Arrow Storm"],
@ -4566,6 +4564,7 @@ const atrees = {
"parents": ["Water Mastery"],
"dependencies": ["Heal"],
"blockers": ["Arcane Transfer"],
"cost": 2,
"display": {
"row": 13,
"col": 4,
@ -4825,7 +4824,7 @@ const atrees = {
"effects": [
{
"type": "add_spell_prop",
"base_spell": 4,
"base_spell": 2,
"cost": -5
}
]
@ -4882,7 +4881,7 @@ const atrees = {
"desc": "For every 5/3s Lifesteal you have from items, gain 1% Spell Damage (Max 50%)",
"archetype": "",
"archetype_req": 0,
"parents": ["Pyrokinesis"],
"parents": ["Pyrokinesis", "Snake Nest"],
"dependencies": [],
"blockers": [],
"cost": 1,
@ -5375,6 +5374,7 @@ const atrees = {
"properties": {},
"effects": [{
"type": "add_spell_prop",
"base_spell": 3,
"target_part": "Per Melee (max)",
"hits": { "Per Orb": 1 }
}]
@ -5480,11 +5480,13 @@ const atrees = {
"effects": [
{
"type": "add_spell_prop",
"base_spell": 3,
"target_part": "Per Orb",
"multipliers": [-50, 0, -10, 0, 0, 0]
},
{
"type": "add_spell_prop",
"base_spell": 3,
"target_part": "Per Melee (max)",
"hits": { "Per Orb": 3 }
}

File diff suppressed because one or more lines are too long

View file

@ -1,6 +1,6 @@
const classDefenseMultipliers = new Map([ ["relik",0.50], ["bow",0.60], ["wand", 0.80], ["dagger", 1.0], ["spear",1.20], ["sword", 1.10]]);
const classDefenseMultipliers = new Map([ ["relik",0.50], ["bow",0.60], ["wand", 0.80], ["dagger", 1.0], ["spear",1.0], ["sword", 1.10]]);
/*
* Class that represents a wynn player's build.

View file

@ -1,57 +1,4 @@
document.addEventListener("DOMContentLoaded", function() {
let filterInputs = new Map([["item-category", ["ALL", "armor", "helmet", "chestplate", "leggings", "boots", "accessory", "ring", "bracelet", "necklace", "weapon", "wand", "spear", "bow", "dagger", "relik"]],
["item-rarity", ["ANY", "Normal", "Unique", "Set", "Rare", "Legendary", "Fabled", "Mythic", "Sane"]],
["filter1", sq2ItemFilters],
["filter2", sq2ItemFilters],
["filter3", sq2ItemFilters],
["filter4", sq2ItemFilters]]);
for (const [field, data] of filterInputs) {
let field_choice = document.getElementById(field+"-choice");
// show dropdown on click
field_choice.onclick = function() {field_choice.dispatchEvent(new Event('input', {bubbles:true}));};
filterInputs.set(field, new autoComplete({
data: {
src: data,
},
threshold: 0,
selector: "#"+ field +"-choice",
wrapper: false,
resultsList: {
maxResults: 100,
tabSelect: true,
noResults: true,
class: "search-box dark-7 rounded-bottom px-2 fw-bold dark-shadow-sm",
element: (list, data) => {
let position = document.getElementById(field+'-choice').getBoundingClientRect();
list.style.top = position.bottom + window.scrollY +"px";
list.style.left = position.x+"px";
list.style.width = position.width+"px";
list.style.maxHeight = position.height * 4 +"px";
if (!data.results.length) {
message = document.createElement('li');
message.classList.add('scaled-font');
message.textContent = "No results found!";
list.prepend(message);
};
},
},
resultItem: {
class: "scaled-font search-item",
selected: "dark-5",
},
events: {
input: {
selection: (event) => {
if (event.detail.selection.value) {
event.target.value = event.detail.selection.value;
};
},
},
}
}));
};
});
let itemCategories = [ "armor", "accessory", "weapon" ];
const sq2_translate_mappings = {
//"Name": "name",
@ -184,7 +131,11 @@ function displayItems(items_copy) {
box.appendChild(bckgrdbox);
bckgrdbox.id = "item"+i+"b";
items_parent.appendChild(box);
displaysq2ExpandedItem(item, bckgrdbox.id);
item.set("powders", []);
if (item.get("category") == "weapon") {
apply_weapon_powders(item);
}
displayExpandedItem(item, bckgrdbox.id, true);
}
}
@ -218,12 +169,12 @@ function doItemSearch() {
for (let i = 1; i <= 4; ++i) {
let raw_dat = document.getElementById("filter"+i+"-choice").value;
let filter_dat = translate_mappings[raw_dat];
let filter_dat = sq2_translate_mappings[raw_dat];
if (filter_dat !== undefined) {
queries.push(new IdQuery(filter_dat));
continue;
}
filter_dat = special_mappings[raw_dat];
filter_dat = sq2_special_mappings[raw_dat];
if (filter_dat !== undefined) {
queries.push(filter_dat);
continue;
@ -251,6 +202,63 @@ function resetItemSearch() {
function init_items() {
items_expanded = items.filter( (i) => !("remapID" in i) ).map( (i) => expandItem(i) );
//init dropdowns
let filterInputs = new Map([["item-category", ["ALL", "armor", "helmet", "chestplate", "leggings", "boots", "accessory", "ring", "bracelet", "necklace", "weapon", "wand", "spear", "bow", "dagger", "relik"]],
["item-rarity", ["ANY", "Normal", "Unique", "Set", "Rare", "Legendary", "Fabled", "Mythic", "Sane"]],
["filter1", sq2ItemFilters],
["filter2", sq2ItemFilters],
["filter3", sq2ItemFilters],
["filter4", sq2ItemFilters]]);
for (const [field, data] of filterInputs) {
let field_choice = document.getElementById(field+"-choice");
// show dropdown on click
field_choice.onclick = function() {field_choice.dispatchEvent(new Event('input', {bubbles:true}));};
filterInputs.set(field, new autoComplete({
data: {
src: data,
},
threshold: 0,
selector: "#"+ field +"-choice",
wrapper: false,
resultsList: {
maxResults: 100,
tabSelect: true,
noResults: true,
class: "search-box dark-7 rounded-bottom px-2 fw-bold dark-shadow-sm",
element: (list, data) => {
let position = document.getElementById(field+'-choice').getBoundingClientRect();
list.style.top = position.bottom + window.scrollY +"px";
list.style.left = position.x+"px";
list.style.width = position.width+"px";
list.style.maxHeight = position.height * 4 +"px";
if (!data.results.length) {
message = document.createElement('li');
message.classList.add('scaled-font');
message.textContent = "No results found!";
list.prepend(message);
};
},
},
resultItem: {
class: "scaled-font search-item",
selected: "dark-5",
},
events: {
input: {
selection: (event) => {
if (event.detail.selection.value) {
event.target.value = event.detail.selection.value;
};
},
},
}
}));
};
}
load_init(init_items);
(async function() {
await Promise.resolve(load_init());
init_items();
})();

View file

@ -773,7 +773,7 @@ function gen_slider_labeled({label_name, label_classlist = [], min = 0, max = 10
let slider = gen_slider(min, max, step, default_val, id, color, classlist, label);
//we set IDs here because the slider's id is potentially only meaningful after gen_slider() is called
label.id = slider.id + "-label";
label.id = slider.id + "_label";
slider_container.id = slider.id + "-container";
buf_col.append(slider, label);