diff --git a/js/atree.js b/js/atree.js index 623aa29..2b38f27 100644 --- a/js/atree.js +++ b/js/atree.js @@ -1143,6 +1143,7 @@ function generateTooltip(UI_elem, node_elem, ability, atree_map) { let apUsed = 0; let maxAP = parseInt(document.getElementById("active_AP_cap").innerHTML); let archChosen = 0; + let satisfiedDependencies = []; let blockedBy = []; for (let [id, node_wrap] of atree_map.entries()) { if (!node_wrap.active || id == ability.id) { @@ -1152,6 +1153,9 @@ function generateTooltip(UI_elem, node_elem, ability, atree_map) { if (node_wrap.ability.archetype == ability.archetype) { archChosen++; } + if (ability.dependencies.includes(id)) { + satisfiedDependencies.push(id); + } if (ability.blockers.includes(id)) { blockedBy.push(node_wrap.ability.display_name); } @@ -1182,6 +1186,18 @@ function generateTooltip(UI_elem, node_elem, ability, atree_map) { container.appendChild(archReq); } + // dependencies + for (let i = 0; i < ability.dependencies.length; i++) { + let dependency = make_elem("p", ["scaled-font-sm", "my-0", "mx-1"], {}); + if (satisfiedDependencies.includes(ability.dependencies[i])) { + dependency.innerHTML = reqYes; + } else { + dependency.innerHTML = reqNo; + } + dependency.innerHTML += " Required Ability: " + atree_map.get(ability.dependencies[i]).ability.display_name; + container.appendChild(dependency); + } + // blockers for (let i = 0; i < blockedBy.length; i++) { let blocker = make_elem("p", ["scaled-font-sm", "my-0", "mx-1"], {});