- Joined
- Dec 20, 2014
- Messages
- 6
- Reaction score
- 1
- First Language
- English
I would like to make an ability that stacks a DoT that is based on a characters level.
I have started with it from Yanfly's Plugins.
The Math.floor section I would like to reference so that stacks go up until 5 at level 10 and then + 1 per 2 levels after that to level 20 then explodes dealing damage to all enemies.
Trying remember my coding from college classes 10 years ago.
This is what I have so far.
<Custom Apply Effect>
// If stack count exists, skip.
if (target._stackingPoison > 0) {
}
else {
// Make sure the stack count exists.
target._stackingPoison = target._stackingPoison || 0;
// Increase the stack count.
target._stackingPoison += 1;
}
</Custom Apply Effect>
<Custom Remove Effect>
// Reset the stack count.
target._stackingPoison = 0;
</Custom Remove Effect>
<Custom Regenerate Effect>
// Make sure the stack count exists.
target._stackingPoison = target._stackingPoison || 1;
// Sets the maximum amount of stacks to 5.
var stacks = Math.min(Math.floor(5+((11-10)/2)), target._stackingPoison);
// The damage formula used per tick.
var damage = stacks * 100;
// Play poison animation on the target.
target.startAnimation(59);
// Target takes HP damage.
target.gainHp(-damage);
// Play the popup.
target.startDamagePopup();
// Clear the results.
target.clearResult();
// Check if the target is dead.
if (target.isDead()) {
// If the target is dead, make it collapse.
target.performCollapse();
}
target._stackingPoison += 1;
</Custom Regenerate Effect>
I have started with it from Yanfly's Plugins.
The Math.floor section I would like to reference so that stacks go up until 5 at level 10 and then + 1 per 2 levels after that to level 20 then explodes dealing damage to all enemies.
Trying remember my coding from college classes 10 years ago.
This is what I have so far.
<Custom Apply Effect>
// If stack count exists, skip.
if (target._stackingPoison > 0) {
}
else {
// Make sure the stack count exists.
target._stackingPoison = target._stackingPoison || 0;
// Increase the stack count.
target._stackingPoison += 1;
}
</Custom Apply Effect>
<Custom Remove Effect>
// Reset the stack count.
target._stackingPoison = 0;
</Custom Remove Effect>
<Custom Regenerate Effect>
// Make sure the stack count exists.
target._stackingPoison = target._stackingPoison || 1;
// Sets the maximum amount of stacks to 5.
var stacks = Math.min(Math.floor(5+((11-10)/2)), target._stackingPoison);
// The damage formula used per tick.
var damage = stacks * 100;
// Play poison animation on the target.
target.startAnimation(59);
// Target takes HP damage.
target.gainHp(-damage);
// Play the popup.
target.startDamagePopup();
// Clear the results.
target.clearResult();
// Check if the target is dead.
if (target.isDead()) {
// If the target is dead, make it collapse.
target.performCollapse();
}
target._stackingPoison += 1;
</Custom Regenerate Effect>