Positive Physical Rate: value *= 100 / (100 + armor)
Negative Physical Rate: value *= 2 - (100 / (100 - armor))
Physical Base Armor: target.def
So I was toying around w/ the settings in the YEP_X_ArmorScaling plugin and was wondering if it was possible to change the value of "Physical Base Armor" depending on whether the attack/skill was using multiple elements. For example, I want physical attacks/skills that are to set to the "Normal Attack" element to use the above formula, but if a physical attack/skill uses the <Multiple Elements: x> notetag from the YEP_ElementCore then it should use the formula below...
Positive Physical Rate: value *= 100 / (100 + armor)
Negative Physical Rate: value *= 2 - (100 / (100 - armor))
Physical Base Armor: (target.def + target.mdf) / 2
I was thinking something along the line of the follow for the value of "Physical Base Armor":
Physical Base Armor: if (this.item().damage.elementId >= 4) {(target.def + target.mdf) / 2} else {target.def}
Could someone w/ expertise in JavaScript share their opinion on whether I can implement something like this? Thanks!
Btw, I used ">= 4" for elementId cuz in my game elements 4, 5, 6, etc. are magical elements (fire, frost, shock, etc.)
Also, would using <Multiple Elements: x> in this manner be compatible? The reason for all this complexity is because I have skills planned that are physical (not spells) but also incorporate elemental damage in addition to physical damage, hence the "(target.def + target.mdf) / 2".
An example skill I would be implementing:
Name: Frost Strike
Type: HP Damage
Element: Normal Attack
Hit Type: Physical Attack
Formula : (a.atk * 3 + a.mat * 2) * 100 / (100 + (b.def + b.mdf) / 2)
Edit:
I'm also trying to do something similar w/ the magical portion of the ArmorScaling settings but w/ some tweaks. It is currently...
Positive Magical Rate: value *= 100 / (100 + armor)
Negative Magical Rate: value *= 2 - (100 / (100 - armor))
Magical Base Armor: target.mdf
But I need it to be:
target.mdf if elementId only contains 4, 5, 6, 7, or 8
target.def if elementId only contains 1, 2, or 3
(target.def + target.mdf) / 2 if elementId contains at least (1, 2, or 3) AND (4, 5, 6, 7, or 8)
I just can't seem to figure out the correct combination of if/else/and/or operations. Help is much appreciated, thanks in advance!
Edit2:
I think I may have figured out a solution to the issue I brought up in my 1st edit...
However, either my syntax or the function I'm using is incorrect: "this.item().damage.elementId"
if (this.item().damage.elementId < 4 && this.item().damage.elementId >= 4) {(target.def + target.mdf) / 2}
else if (!this.item().damage.elementId >= 4) {target.def}
else {target.mdf}
Negative Physical Rate: value *= 2 - (100 / (100 - armor))
Physical Base Armor: target.def
So I was toying around w/ the settings in the YEP_X_ArmorScaling plugin and was wondering if it was possible to change the value of "Physical Base Armor" depending on whether the attack/skill was using multiple elements. For example, I want physical attacks/skills that are to set to the "Normal Attack" element to use the above formula, but if a physical attack/skill uses the <Multiple Elements: x> notetag from the YEP_ElementCore then it should use the formula below...
Positive Physical Rate: value *= 100 / (100 + armor)
Negative Physical Rate: value *= 2 - (100 / (100 - armor))
Physical Base Armor: (target.def + target.mdf) / 2
I was thinking something along the line of the follow for the value of "Physical Base Armor":
Physical Base Armor: if (this.item().damage.elementId >= 4) {(target.def + target.mdf) / 2} else {target.def}
Could someone w/ expertise in JavaScript share their opinion on whether I can implement something like this? Thanks!
Btw, I used ">= 4" for elementId cuz in my game elements 4, 5, 6, etc. are magical elements (fire, frost, shock, etc.)
Also, would using <Multiple Elements: x> in this manner be compatible? The reason for all this complexity is because I have skills planned that are physical (not spells) but also incorporate elemental damage in addition to physical damage, hence the "(target.def + target.mdf) / 2".
An example skill I would be implementing:
Name: Frost Strike
Type: HP Damage
Element: Normal Attack
Hit Type: Physical Attack
Formula : (a.atk * 3 + a.mat * 2) * 100 / (100 + (b.def + b.mdf) / 2)
^the latter half of this formula would be deleted here and incorporated into the ArmorScaling plugin
Note: <Multiple Elements: 5>Edit:
I'm also trying to do something similar w/ the magical portion of the ArmorScaling settings but w/ some tweaks. It is currently...
Positive Magical Rate: value *= 100 / (100 + armor)
Negative Magical Rate: value *= 2 - (100 / (100 - armor))
Magical Base Armor: target.mdf
But I need it to be:
target.mdf if elementId only contains 4, 5, 6, 7, or 8
target.def if elementId only contains 1, 2, or 3
(target.def + target.mdf) / 2 if elementId contains at least (1, 2, or 3) AND (4, 5, 6, 7, or 8)
I just can't seem to figure out the correct combination of if/else/and/or operations. Help is much appreciated, thanks in advance!
Edit2:
I think I may have figured out a solution to the issue I brought up in my 1st edit...
However, either my syntax or the function I'm using is incorrect: "this.item().damage.elementId"
if (this.item().damage.elementId < 4 && this.item().damage.elementId >= 4) {(target.def + target.mdf) / 2}
else if (!this.item().damage.elementId >= 4) {target.def}
else {target.mdf}