Skip to content

Commit

Permalink
qol(sword-slitter): Added custom game log for the second sword slitter
Browse files Browse the repository at this point in the history
  • Loading branch information
JoelFernandes09 committed Aug 17, 2023
1 parent efd57f1 commit fa6fc2e
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/abilities/Bounty-Hunter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -146,8 +146,6 @@ export default (G: Game) => {
const targetOriginalHealth = target.health;

const ability = this;
ability.end();
G.Phaser.camera.shake(0.01, 150, true, G.Phaser.camera.SHAKE_HORIZONTAL, true);

const damage = new Damage(
ability.creature, // Attacker
Expand All @@ -157,18 +155,21 @@ export default (G: Game) => {
G,
);
target.takeDamage(damage);
G.Phaser.camera.shake(0.01, 150, true, G.Phaser.camera.SHAKE_HORIZONTAL, true);
/** damage dealt is original health - current health
* if current health is lower than damage dealt,
* and the ability is upgraded,
* make a second attack
*/
if (targetOriginalHealth - target.health >= target.health && this.isUpgraded()) {
// Added a delay for the second attack
// Added a delay for the second attack with a custom game log
setTimeout(() => {
G.Phaser.camera.shake(0.01, 150, true, G.Phaser.camera.SHAKE_HORIZONTAL, true);
target.takeDamage(damage);
ability.end(true);
G.log('%CreatureName' + ability.creature.id + '% used ' + ability.title + ' twice');
}, 1000);
}
} else ability.end();
},
},

Expand Down

0 comments on commit fa6fc2e

Please sign in to comment.