Hello, I am having a difficult time trying to figure out how to play an animation if my attack does 0 damage.
For example: if the actor attacks and does 0 damage to the enemy I'd like a shield animation to play on the enemy to show that he blocked it. I have it set now so that a message says "enemy blocked the attack", but I'd like to show the animation as well.
I don't know if it'll be needed but here's the damage formula I use for my attack skill:
aDice=Math.randomInt(21);
bDice=Math.randomInt(21);
aDice==0 ? aDice=1 : aDice+0;
bDice==0 ? bDice=1 : bDice+0;
aDice==20 ? a.atk*2 : aDice+0;
bDice==20 && aDice<20 ? a.atk=0 : aDice+0;
(a.atk + aDice) - (b.def + bDice)
Also if you notice anything wrong with this formula I'd greatly appreciate you pointing it out, I know very little about Java Script.
For example: if the actor attacks and does 0 damage to the enemy I'd like a shield animation to play on the enemy to show that he blocked it. I have it set now so that a message says "enemy blocked the attack", but I'd like to show the animation as well.
I don't know if it'll be needed but here's the damage formula I use for my attack skill:
aDice=Math.randomInt(21);
bDice=Math.randomInt(21);
aDice==0 ? aDice=1 : aDice+0;
bDice==0 ? bDice=1 : bDice+0;
aDice==20 ? a.atk*2 : aDice+0;
bDice==20 && aDice<20 ? a.atk=0 : aDice+0;
(a.atk + aDice) - (b.def + bDice)
Also if you notice anything wrong with this formula I'd greatly appreciate you pointing it out, I know very little about Java Script.