- Joined
- Nov 2, 2015
- Messages
- 287
- Reaction score
- 89
- First Language
- French
Hey !
I have a trouble with making a pretty simple poison effect. In my game, I have an assassin who is able to equip poison. The equipped poison grant a passive state to the assassin, and this passive state do something in battle.
My problem is with one of these poison. The goal is to inflict 20% additionnal damages for each physical attack.
This is the code in the state notetag :
Actually it seems to work, but I have one main problem : the damage display.
When this poison is equipped, and I attack, only the additionnal damages are displayed (but the base damages + the additionnal damages are dealed to the enemy).
How can I make it look like the display of a repeatable attack ?
Thanks by advance !
I have a trouble with making a pretty simple poison effect. In my game, I have an assassin who is able to equip poison. The equipped poison grant a passive state to the assassin, and this passive state do something in battle.
My problem is with one of these poison. The goal is to inflict 20% additionnal damages for each physical attack.
This is the code in the state notetag :
<Custom Establish Effect>
// Check if the action deals HP healing and the target is alive.
if (this.isHpEffect() && target.result().hpDamage > 0 && target.isAlive() && this.isPhysical()) {
// Calculate 20% of the amount healed.
var dmg = -Math.abs(Math.ceil(target.result().hpDamage * 0.20));
// Inflics the damages
target.gainHp(dmg);
// Start the damage popup.
target.startDamagePopup();
// Clear the result.
target.clearResult();
// Check if the user is dead.
if (target.isDead()) {
// Perform a collapse.
target.performCollapse();
}
}
</Custom Establish Effect>
// Check if the action deals HP healing and the target is alive.
if (this.isHpEffect() && target.result().hpDamage > 0 && target.isAlive() && this.isPhysical()) {
// Calculate 20% of the amount healed.
var dmg = -Math.abs(Math.ceil(target.result().hpDamage * 0.20));
// Inflics the damages
target.gainHp(dmg);
// Start the damage popup.
target.startDamagePopup();
// Clear the result.
target.clearResult();
// Check if the user is dead.
if (target.isDead()) {
// Perform a collapse.
target.performCollapse();
}
}
</Custom Establish Effect>
Actually it seems to work, but I have one main problem : the damage display.
When this poison is equipped, and I attack, only the additionnal damages are displayed (but the base damages + the additionnal damages are dealed to the enemy).
How can I make it look like the display of a repeatable attack ?
Thanks by advance !

