- Joined
- Oct 13, 2014
- Messages
- 300
- Reaction score
- 89
- First Language
- Enlish
Hello,
I'm trying to create a stacking state which increases the overall damage output of the users attacks.
Basically, when the state is applied, damage increase by .25. When the skill is cast again, the state counter goes from 1 to 2, and then damage is increased again from 1.25 to 1.50. This would stack to a max of 2.00 damage, and when the state is removed, the counter goes back to 0.
However, I can't get it to work. I'm using Yanfly Buff and State Core to try to accomplish this.
Here's my current code:
I could be handling this all wrong, lol but i guess that's what this topic is for.
Thanks for looking at this!
I'm trying to create a stacking state which increases the overall damage output of the users attacks.
Basically, when the state is applied, damage increase by .25. When the skill is cast again, the state counter goes from 1 to 2, and then damage is increased again from 1.25 to 1.50. This would stack to a max of 2.00 damage, and when the state is removed, the counter goes back to 0.
However, I can't get it to work. I'm using Yanfly Buff and State Core to try to accomplish this.
Here's my current code:
<Custom Apply Effect>
// Defaults user's combo stacks to 0.
user._atkupStacks = user._atkupStacks || 0;
// Get the current number of stacks. Min 0, Max 4.
var stacks = user._atkupStacks.clamp(0, 4);
// Increase stack count.
stacks += 1;
// Set stack count min to 0, max to 4.
stacks = stacks.clamp(0, 4);
// Set the counter for the state.
user.setStateCounter(stateId, 'x' + stacks);
// Apply stack count to user's combo count.
user._comboStacks = stacks;
</Custom Apply Effect>
<Custom Remove Effect>
// Reset combo stacks to 0.
user._atkupStacks = 0;
// Get the current number of stacks. Min 0, Max 4.
var stacks = user._atkupStacks.clamp(0, 4);
// Set the counter for the state.
user.setStateCounter(stateId, 'x' + stacks);
</Custom Remove Effect>
<Custom Confirm Effect>
// Check if the user is delivering physical damage.
if (this.isPhysical() && this.isMagical() && value > 0 ) {
// Get the current number of stacks. Min 0, Max 4.
var stacks = user._atkupStacks.clamp(0, 4);
// Calculate the extra damage rate from Combo stacks.
var rate = 1.00 + stacks * 0.25;
// Round the damage upward.
value = Math.ceil(value * rate);
}
</Custom Confirm Effect>
// Defaults user's combo stacks to 0.
user._atkupStacks = user._atkupStacks || 0;
// Get the current number of stacks. Min 0, Max 4.
var stacks = user._atkupStacks.clamp(0, 4);
// Increase stack count.
stacks += 1;
// Set stack count min to 0, max to 4.
stacks = stacks.clamp(0, 4);
// Set the counter for the state.
user.setStateCounter(stateId, 'x' + stacks);
// Apply stack count to user's combo count.
user._comboStacks = stacks;
</Custom Apply Effect>
<Custom Remove Effect>
// Reset combo stacks to 0.
user._atkupStacks = 0;
// Get the current number of stacks. Min 0, Max 4.
var stacks = user._atkupStacks.clamp(0, 4);
// Set the counter for the state.
user.setStateCounter(stateId, 'x' + stacks);
</Custom Remove Effect>
<Custom Confirm Effect>
// Check if the user is delivering physical damage.
if (this.isPhysical() && this.isMagical() && value > 0 ) {
// Get the current number of stacks. Min 0, Max 4.
var stacks = user._atkupStacks.clamp(0, 4);
// Calculate the extra damage rate from Combo stacks.
var rate = 1.00 + stacks * 0.25;
// Round the damage upward.
value = Math.ceil(value * rate);
}
</Custom Confirm Effect>
I could be handling this all wrong, lol but i guess that's what this topic is for.
Thanks for looking at this!
Last edited:




