I tried to increase the number of stockpiles to five but it ends in syntax error.
this is the inital code
this is what I tried to do:
this is the inital code
Code:
<Damage Formula>
// Check if the stockpile damage hasn't already been calculated
if (!this._stockpileDmg) {
// Default the user's stockpile stacks to 1
a._stockpile = a._stockpile || 1;
// If the stockpile stack is 1
if (a._stockpile === 1) {
// Use this formula
this._stockpileDmg = a.atk * 4;
// If the stockpile stack is 2
} else if (a._stockpile === 2) {
// Use this formula
this._stockpileDmg = a.atk * 8;
// Otherwise if it's more
} else {
// Use this formula
this._stockpileDmg = a.atk * 16;
}
}
// Set the damage equal to the calculated damage
value = this._stockpileDmg;
</Damage Formula>
<Custom Requirement>
// Default the user's stockpile stacks to 0
user._stockpile = user._stockpile || 0;
// If the user is at 0 stacks
if (user._stockpile <= 0) {
// The skill will be disabled
value = false;
}
</Custom Requirement>
<After Eval>
// Remove the stockpile state
user.removeState(312);
</After Eval>
this is what I tried to do:
Code:
<Damage Formula>
// Check if the stockpile damage hasn't already been calculated
if (!this._stockpileDmg) {
// Default the user's stockpile stacks to 1
a._stockpile = a._stockpile || 1;
// If the stockpile stack is 1
if (a._stockpile === 1) {
// Use this formula
this._stockpileDmg = 20;
// If the stockpile stack is 2
} else if (a._stockpile === 2) {
// Use this formula
this._stockpileDmg = 40;
// If the stockpile stack is 3
if (a._stockpile === 3) {
// Use this formula
this._stockpileDmg = 60;
// If the stockpile stack is 4
if (a._stockpile === 4) {
// Use this formula
this._stockpileDmg = 80;
// Otherwise if it's more
} else {
// Use this formula
this._stockpileDmg = 100;
}
}
// Set the damage equal to the calculated damage
value = this._stockpileDmg;
</Damage Formula>
<Custom Requirement>
// Default the user's stockpile stacks to 0
user._stockpile = user._stockpile || 0;
// If the user is at 0 stacks
if (user._stockpile <= 0) {
// The skill will be disabled
value = false;
}
</Custom Requirement>
<After Eval>
// Remove the stockpile state
user.removeState(91);
</After Eval>