Heal% stat
This commit is contained in:
parent
67efec4c3d
commit
aa185ce022
5 changed files with 10 additions and 3 deletions
|
@ -76,6 +76,7 @@ stat_scaling: {
|
||||||
"slider": bool,
|
"slider": bool,
|
||||||
"slider_name": Optional[str],
|
"slider_name": Optional[str],
|
||||||
"slider_step": Optional[float],
|
"slider_step": Optional[float],
|
||||||
|
round: Optional[bool] // Control floor behavior. True for stats and false for slider by default
|
||||||
slider_behavior: Optional[str] // One of: "merge", "modify". default: merge
|
slider_behavior: Optional[str] // One of: "merge", "modify". default: merge
|
||||||
// merge: add if exist, make new part if not exist
|
// merge: add if exist, make new part if not exist
|
||||||
// modify: change existing part. do nothing if not exist
|
// modify: change existing part. do nothing if not exist
|
||||||
|
@ -751,7 +752,9 @@ const atree_stats = new (class extends ComputeNode {
|
||||||
if (effect.slider) {
|
if (effect.slider) {
|
||||||
if ('output' in effect) { // sometimes nodes will modify slider without having effect.
|
if ('output' in effect) { // sometimes nodes will modify slider without having effect.
|
||||||
const slider_val = slider_map.get(effect.slider_name).slider.value;
|
const slider_val = slider_map.get(effect.slider_name).slider.value;
|
||||||
let total = Math.floor(round_near(parseInt(slider_val) * effect.scaling[0]));
|
const {round = true} = effect;
|
||||||
|
let total = parseInt(slider_val) * effect.scaling[0];
|
||||||
|
if (round) { total = Math.floor(round_near(total)); }
|
||||||
if ('max' in effect && total > effect.max) { total = effect.max; }
|
if ('max' in effect && total > effect.max) { total = effect.max; }
|
||||||
if (Array.isArray(effect.output)) {
|
if (Array.isArray(effect.output)) {
|
||||||
for (const output of effect.output) {
|
for (const output of effect.output) {
|
||||||
|
@ -770,9 +773,11 @@ const atree_stats = new (class extends ComputeNode {
|
||||||
else {
|
else {
|
||||||
// TODO: type: prop?
|
// TODO: type: prop?
|
||||||
let total = 0;
|
let total = 0;
|
||||||
|
const {round = true} = effect;
|
||||||
for (const [scaling, input] of zip2(effect.scaling, effect.inputs)) {
|
for (const [scaling, input] of zip2(effect.scaling, effect.inputs)) {
|
||||||
total += scaling * item_stats.get(input.name);
|
total += scaling * item_stats.get(input.name);
|
||||||
}
|
}
|
||||||
|
if (round) { total = Math.floor(round_near(total)); }
|
||||||
if (total < 0) { total = 0; } // Normal stat scaling will not go negative.
|
if (total < 0) { total = 0; } // Normal stat scaling will not go negative.
|
||||||
if ('max' in effect && total > effect.max) { total = effect.max; }
|
if ('max' in effect && total > effect.max) { total = effect.max; }
|
||||||
// TODO: output (list...)
|
// TODO: output (list...)
|
||||||
|
|
|
@ -5007,6 +5007,7 @@ const atrees = {
|
||||||
"effects": [{
|
"effects": [{
|
||||||
"type": "stat_scaling",
|
"type": "stat_scaling",
|
||||||
"slider": false,
|
"slider": false,
|
||||||
|
"round": false,
|
||||||
"inputs": [
|
"inputs": [
|
||||||
{
|
{
|
||||||
"type": "stat",
|
"type": "stat",
|
||||||
|
|
File diff suppressed because one or more lines are too long
|
@ -129,6 +129,7 @@ class Build{
|
||||||
}
|
}
|
||||||
statMap.set("poisonPct", 100);
|
statMap.set("poisonPct", 100);
|
||||||
statMap.set("critDamPct", 100);
|
statMap.set("critDamPct", 100);
|
||||||
|
statMap.set("healPct", 100);
|
||||||
|
|
||||||
// The stuff relevant for damage calculation!!! @ferricles
|
// The stuff relevant for damage calculation!!! @ferricles
|
||||||
statMap.set("atkSpd", this.weapon.statMap.get("atkSpd"));
|
statMap.set("atkSpd", this.weapon.statMap.get("atkSpd"));
|
||||||
|
|
|
@ -576,7 +576,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.power * getDefenseStats(stats)[0] * Math.max(0.5,Math.min(1.75, 1 + 0.5 * stats.get("wDamPct")/100)));
|
let _heal_amount = (part.power * getDefenseStats(stats)[0] * (stats.get('healPct')/100));
|
||||||
spell_result = {
|
spell_result = {
|
||||||
type: "heal",
|
type: "heal",
|
||||||
heal_amount: _heal_amount
|
heal_amount: _heal_amount
|
||||||
|
|
Loading…
Add table
Reference in a new issue