Poison display

This commit is contained in:
b 2021-01-11 01:05:23 -06:00
parent e5e67585e2
commit 85920aee51
4 changed files with 81 additions and 34 deletions

View file

@ -216,7 +216,25 @@ function displayBuildStats(build, parent_id){
style = "negative"; style = "negative";
} }
} }
displayFixedID(active_elem, id, stats.get(id), elemental_format, style); let id_val = stats.get(id);
displayFixedID(active_elem, id, id_val, elemental_format, style);
if (id === "poison" && id_val > 0) {
let style = "positive";
let row = document.createElement('tr');
let value_elem = document.createElement('td');
value_elem.classList.add('right');
value_elem.setAttribute("colspan", "2");
let prefix_elem = document.createElement('b');
prefix_elem.textContent = "-> With Strength: ";
let number_elem = document.createElement('b');
number_elem.classList.add(style);
number_elem.textContent = (id_val * (1+skillPointsToPercentage(build.total_skillpoints[0]))).toFixed(0) + idSuffixes[id];
value_elem.append(prefix_elem);
value_elem.append(number_elem);
row.appendChild(value_elem);
active_elem.appendChild(row);
}
} }
} }
} }
@ -321,22 +339,19 @@ function displayExpandedItem(item, parent_id){
else { else {
let id = command; let id = command;
if(nonRolledIDs.includes(id) && item.get(id)){//nonRolledID & non-0/non-null/non-und ID if(nonRolledIDs.includes(id) && item.get(id)){//nonRolledID & non-0/non-null/non-und ID
let p_elem = displayFixedID(active_elem, id, item.get(id), elemental_format);
if (id === "slots") { if (id === "slots") {
continue;
// PROPER POWDER DISPLAYING EZ CLAP // PROPER POWDER DISPLAYING EZ CLAP
p_elem.textContent = ""; p_elem.textContent = "";
let powderMap = new Map([ ["e", "Earth"], ["t", "Thunder"], ["w", "Water"], ["f", "Fire"], ["a", "Air"]]);
let numerals = new Map([["1", "I"], ["2", "II"], ["3", "III"], ["4", "IV"], ["5", "V"], ["6", "VI"]]); let numerals = new Map([["1", "I"], ["2", "II"], ["3", "III"], ["4", "IV"], ["5", "V"], ["6", "VI"]]);
/*p_elem.textContent = idPrefixes[id].concat(item.get(id), idSuffixes[id]) + /*p_elem.textContent = idPrefixes[id].concat(item.get(id), idSuffixes[id]) +
" [ " + item.get("powders").map(x => powderNames.get(x)) + " ]";*/ " [ " + item.get("powders").map(x => powderNames.get(x)) + " ]";*/
let wrapper = document.createElement("p"); let wrapper = document.createElement("p");
p_elem.classList.add("itemtable");
let row = document.createElement("tr");
let powderPrefix = document.createElement("td"); let powderPrefix = document.createElement("b");
powderPrefix.classList.add("itemp"); powderPrefix.classList.add("itemp");
powderPrefix.classList.add("left"); powderPrefix.classList.add("left");
powderPrefix.textContent = "Powders: " + " ["; powderPrefix.textContent = "[";
row.appendChild(powderPrefix); row.appendChild(powderPrefix);
let spaceElem = document.createElement("td"); let spaceElem = document.createElement("td");
@ -362,7 +377,10 @@ function displayExpandedItem(item, parent_id){
wrapper.appendChild(row); wrapper.appendChild(row);
p_elem.appendChild(wrapper); p_elem.appendChild(wrapper);
}else if(id === "displayName"){ }
else {
let p_elem = displayFixedID(active_elem, id, item.get(id), elemental_format);
if (id === "displayName") {
p_elem.classList.add("title"); p_elem.classList.add("title");
if (item.get("tier") !== " ") { if (item.get("tier") !== " ") {
p_elem.classList.add(item.get("tier")); p_elem.classList.add(item.get("tier"));
@ -388,6 +406,7 @@ function displayExpandedItem(item, parent_id){
p_elem.classList.add("restrict"); p_elem.classList.add("restrict");
} }
} }
}
else if (rolledIDs.includes(id) && item.get("minRolls").get(id)){ // && item.get("maxRolls").get(id) ){//rolled ID & non-0/non-null/non-und ID else if (rolledIDs.includes(id) && item.get("minRolls").get(id)){ // && item.get("maxRolls").get(id) ){//rolled ID & non-0/non-null/non-und ID
let style = "positive"; let style = "positive";
if (item.get("minRolls").get(id) < 0) { if (item.get("minRolls").get(id) < 0) {
@ -500,6 +519,24 @@ function displayEquipOrder(parent_elem,buildOrder){
} }
} }
function displayPoisonDamage(overallparent_elem, build) {
overallparent_elem.textContent = "";
//Title
let title_elemavg = document.createElement("p");
title_elemavg.classList.add("smalltitle");
title_elemavg.classList.add("Normal");
title_elemavg.textContent = "Poison Stats";
overallparent_elem.append(title_elemavg);
let overallpoisonDamage = document.createElement("p");
overallpoisonDamage.classList.add("itemp");
let poison_tick = Math.floor(build.statMap.get("poison") * (1+skillPointsToPercentage(build.total_skillpoints[0]))/3);
overallpoisonDamage.textContent = "Poison Tick: " + poison_tick;
overallparent_elem.append(overallpoisonDamage);
overallparent_elem.append(document.createElement("br"));
}
function displayMeleeDamage(parent_elem, overallparent_elem, meleeStats){ function displayMeleeDamage(parent_elem, overallparent_elem, meleeStats){
let attackSpeeds = ["Super Slow", "Very Slow", "Slow", "Normal", "Fast", "Very Fast", "Super Fast"]; let attackSpeeds = ["Super Slow", "Very Slow", "Slow", "Normal", "Fast", "Very Fast", "Super Fast"];
//let damagePrefixes = ["Neutral Damage: ","Earth Damage: ","Thunder Damage: ","Water Damage: ","Fire Damage: ","Air Damage: "]; //let damagePrefixes = ["Neutral Damage: ","Earth Damage: ","Thunder Damage: ","Water Damage: ","Fire Damage: ","Air Damage: "];
@ -532,7 +569,7 @@ function displayMeleeDamage(parent_elem, overallparent_elem, meleeStats){
//overall title //overall title
let title_elemavg = document.createElement("p"); let title_elemavg = document.createElement("p");
title_elemavg.classList.add("title"); title_elemavg.classList.add("smalltitle");
title_elemavg.classList.add("Normal"); title_elemavg.classList.add("Normal");
title_elemavg.textContent = "Melee Stats"; title_elemavg.textContent = "Melee Stats";
overallparent_elem.append(title_elemavg); overallparent_elem.append(title_elemavg);
@ -783,12 +820,12 @@ function displaySpellDamage(parent_elem, overallparent_elem, build, spell, spell
const stats = build.statMap; const stats = build.statMap;
let title_elem = document.createElement("p"); let title_elem = document.createElement("p");
title_elem.classList.add("title"); title_elem.classList.add("smalltitle");
title_elem.classList.add("Normal"); title_elem.classList.add("Normal");
overallparent_elem.textContent = ""; overallparent_elem.textContent = "";
let title_elemavg = document.createElement("p"); let title_elemavg = document.createElement("p");
title_elemavg.classList.add('title'); title_elemavg.classList.add('smalltitle');
title_elemavg.classList.add('Normal'); title_elemavg.classList.add('Normal');
if (spellIdx != 0) { if (spellIdx != 0) {

View file

@ -185,6 +185,9 @@
<div class="spell-info"> <div class="spell-info">
<div class="center" id="spell3-infoAvg">spell4</div> <div class="center" id="spell3-infoAvg">spell4</div>
</div> </div>
<div class="spell-info">
<div class="center" id="build-poison-stats">poison</div>
</div>
</div> </div>
</div> </div>
<div class="skillpoints"> <div class="skillpoints">

View file

@ -60,6 +60,10 @@ a.link{
text-align: center; text-align: center;
font-size: 150%; font-size: 150%;
} }
.smalltitle{
text-align: center;
font-size: 125%;
}
.center { .center {
text-align: center; text-align: center;
} }

View file

@ -495,6 +495,8 @@ function calculateBuildStats() {
//setHTML("build-defense-stats", "".concat(defenseStats)); //setHTML("build-defense-stats", "".concat(defenseStats));
displayPoisonDamage(document.getElementById("build-poison-stats"),player_build);
let spells = spell_table[player_build.weapon.get("type")]; let spells = spell_table[player_build.weapon.get("type")];
for (let i = 0; i < 4; ++i) { for (let i = 0; i < 4; ++i) {
let parent_elem = document.getElementById("spell"+i+"-info"); let parent_elem = document.getElementById("spell"+i+"-info");
@ -517,6 +519,7 @@ function resetFields(){
setValue("int-skp", "0"); setValue("int-skp", "0");
setValue("def-skp", "0"); setValue("def-skp", "0");
setValue("agi-skp", "0"); setValue("agi-skp", "0");
setValue("level-choice", "");
location.hash = ""; location.hash = "";
} }