Testing healing
This commit is contained in:
parent
c7fd1c53f8
commit
3fb59494d9
3 changed files with 28 additions and 47 deletions
|
@ -592,7 +592,7 @@ class SpellDamageCalcNode extends ComputeNode {
|
||||||
}
|
}
|
||||||
} else if ('power' in part) {
|
} else if ('power' in part) {
|
||||||
// TODO: wynn2 formula
|
// TODO: wynn2 formula
|
||||||
let _heal_amount = (part.strength * getDefenseStats(stats)[0] * Math.max(0.5,Math.min(1.75, 1 + 0.5 * stats.get("wDamPct")/100))).toFixed(2);
|
let _heal_amount = (part.power * getDefenseStats(stats)[0] * Math.max(0.5,Math.min(1.75, 1 + 0.5 * stats.get("wDamPct")/100)));
|
||||||
spell_result = {
|
spell_result = {
|
||||||
type: "heal",
|
type: "heal",
|
||||||
heal_amount: _heal_amount
|
heal_amount: _heal_amount
|
||||||
|
@ -604,7 +604,8 @@ class SpellDamageCalcNode extends ComputeNode {
|
||||||
normal_total: [0, 0],
|
normal_total: [0, 0],
|
||||||
crit_min: [0, 0, 0, 0, 0, 0],
|
crit_min: [0, 0, 0, 0, 0, 0],
|
||||||
crit_max: [0, 0, 0, 0, 0, 0],
|
crit_max: [0, 0, 0, 0, 0, 0],
|
||||||
crit_total: [0, 0]
|
crit_total: [0, 0],
|
||||||
|
heal_amount: 0
|
||||||
}
|
}
|
||||||
const dam_res_keys = ['normal_min', 'normal_max', 'normal_total', 'crit_min', 'crit_max', 'crit_total'];
|
const dam_res_keys = ['normal_min', 'normal_max', 'normal_total', 'crit_min', 'crit_max', 'crit_total'];
|
||||||
for (const [subpart_name, hits] of Object.entries(part.hits)) {
|
for (const [subpart_name, hits] of Object.entries(part.hits)) {
|
||||||
|
@ -1111,7 +1112,7 @@ function builder_graph_init() {
|
||||||
|
|
||||||
// Also do something similar for skill points
|
// Also do something similar for skill points
|
||||||
|
|
||||||
//for (let i = 0; i < 4; ++i) {
|
//for (let i = 0; i < 4; ++i) { TODO: testing code
|
||||||
for (let i = 0; i < 1; ++i) {
|
for (let i = 0; i < 1; ++i) {
|
||||||
let spell_node = new SpellSelectNode(i);
|
let spell_node = new SpellSelectNode(i);
|
||||||
spell_node.link_to(build_node, 'build');
|
spell_node.link_to(build_node, 'build');
|
||||||
|
|
|
@ -246,6 +246,16 @@ const default_spells = {
|
||||||
scaling: "melee", use_atkspd: false,
|
scaling: "melee", use_atkspd: false,
|
||||||
display: "Melee",
|
display: "Melee",
|
||||||
parts: [{ name: "Melee", multipliers: [100, 0, 0, 0, 0, 0] }]
|
parts: [{ name: "Melee", multipliers: [100, 0, 0, 0, 0, 0] }]
|
||||||
|
}, {
|
||||||
|
name: "Heal", // TODO: name for melee attacks?
|
||||||
|
display_text: "Heal spell!",
|
||||||
|
base_spell: 1,
|
||||||
|
display: "Total Heal",
|
||||||
|
parts: [
|
||||||
|
{ name: "First Pulse", power: 0.12 },
|
||||||
|
{ name: "Second and Third Pulses", power: 0.06 },
|
||||||
|
{ name: "Total Heal", hits: { "First Pulse": 1, "Second and Third Pulses": 2 } }
|
||||||
|
]
|
||||||
}],
|
}],
|
||||||
spear: [{
|
spear: [{
|
||||||
name: "Melee", // TODO: name for melee attacks?
|
name: "Melee", // TODO: name for melee attacks?
|
||||||
|
|
|
@ -1627,6 +1627,18 @@ function displaySpellDamage(parent_elem, overallparent_elem, stats, spell, spell
|
||||||
let part_divavg = document.createElement("p");
|
let part_divavg = document.createElement("p");
|
||||||
overallparent_elem.append(part_divavg);
|
overallparent_elem.append(part_divavg);
|
||||||
|
|
||||||
|
function _summary(text, val, fmt) {
|
||||||
|
let overallaverageLabel = document.createElement("p");
|
||||||
|
let first = document.createElement("span");
|
||||||
|
let second = document.createElement("span");
|
||||||
|
first.textContent = text;
|
||||||
|
second.textContent = val.toFixed(2);
|
||||||
|
overallaverageLabel.appendChild(first);
|
||||||
|
overallaverageLabel.appendChild(second);
|
||||||
|
second.classList.add(fmt);
|
||||||
|
part_divavg.append(overallaverageLabel);
|
||||||
|
}
|
||||||
|
|
||||||
for (let i = 0; i < spell_results.length; ++i) {
|
for (let i = 0; i < spell_results.length; ++i) {
|
||||||
const damage_info = spell_results[i];
|
const damage_info = spell_results[i];
|
||||||
|
|
||||||
|
@ -1652,15 +1664,7 @@ function displaySpellDamage(parent_elem, overallparent_elem, stats, spell, spell
|
||||||
|
|
||||||
|
|
||||||
if (damage_info.name === spell.display) {
|
if (damage_info.name === spell.display) {
|
||||||
let overallaverageLabel = document.createElement("p");
|
_summary(damage_info.name+ " Average: ", averageDamage, "Damage");
|
||||||
let first = document.createElement("span");
|
|
||||||
let second = document.createElement("span");
|
|
||||||
first.textContent = damage_info.name+ " Average: ";
|
|
||||||
second.textContent = averageDamage.toFixed(2);
|
|
||||||
overallaverageLabel.appendChild(first);
|
|
||||||
overallaverageLabel.appendChild(second);
|
|
||||||
second.classList.add("Damage");
|
|
||||||
part_divavg.append(overallaverageLabel);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function _damage_display(label_text, average, dmg_min, dmg_max) {
|
function _damage_display(label_text, average, dmg_min, dmg_max) {
|
||||||
|
@ -1686,42 +1690,8 @@ function displaySpellDamage(parent_elem, overallparent_elem, stats, spell, spell
|
||||||
// healLabel.classList.add("damagep");
|
// healLabel.classList.add("damagep");
|
||||||
part_div.append(healLabel);
|
part_div.append(healLabel);
|
||||||
if (damage_info.name === spell.display) {
|
if (damage_info.name === spell.display) {
|
||||||
let overallhealLabel = document.createElement("p");
|
_summary(damage_info.name+ ": ", heal_amount, "Set");
|
||||||
let first = document.createElement("span");
|
|
||||||
let second = document.createElement("span");
|
|
||||||
first.textContent = damage_info.name+ ": ";
|
|
||||||
second.textContent = heal_amount;
|
|
||||||
overallhealLabel.appendChild(first);
|
|
||||||
second.classList.add("Set");
|
|
||||||
overallhealLabel.appendChild(second);
|
|
||||||
part_divavg.append(overallhealLabel);
|
|
||||||
}
|
}
|
||||||
// } else if (part.type === "total") {
|
|
||||||
// let total_damage = 0;
|
|
||||||
// for (let i in part.factors) {
|
|
||||||
// total_damage += save_damages[i] * part.factors[i];
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// let dmgarr = part.factors.slice();
|
|
||||||
// dmgarr = dmgarr.map(x => "(" + x + " * " + save_damages[dmgarr.indexOf(x)].toFixed(2) + ")");
|
|
||||||
//
|
|
||||||
//
|
|
||||||
// let averageLabel = document.createElement("p");
|
|
||||||
// averageLabel.textContent = "Average: "+total_damage.toFixed(2);
|
|
||||||
// averageLabel.classList.add("damageSubtitle");
|
|
||||||
// part_div.append(averageLabel);
|
|
||||||
//
|
|
||||||
// let overallaverageLabel = document.createElement("p");
|
|
||||||
// let overallaverageLabelFirst = document.createElement("span");
|
|
||||||
// let overallaverageLabelSecond = document.createElement("span");
|
|
||||||
// overallaverageLabelFirst.textContent = "Average: ";
|
|
||||||
// overallaverageLabelSecond.textContent = total_damage.toFixed(2);
|
|
||||||
// overallaverageLabelSecond.classList.add("Damage");
|
|
||||||
//
|
|
||||||
//
|
|
||||||
// overallaverageLabel.appendChild(overallaverageLabelFirst);
|
|
||||||
// overallaverageLabel.appendChild(overallaverageLabelSecond);
|
|
||||||
// part_divavg.append(overallaverageLabel);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue