From 62a74e3f812b81da5195313d0498b9adbbc59621 Mon Sep 17 00:00:00 2001 From: Florrie Date: Fri, 17 Aug 2018 09:12:51 -0300 Subject: Visual significant stun feedback --- index.js | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/index.js b/index.js index c927385..955fcb7 100644 --- a/index.js +++ b/index.js @@ -93,7 +93,11 @@ class ATBBar { ctx.rect(0, 0, Math.round(this.canvas.width * this.visualProgress), this.canvas.height) ctx.clip() - ctx.fillStyle = '#77F' + if (this.battleCharacter.stunIsSignificant) { + ctx.fillStyle = '#888' + } else { + ctx.fillStyle = '#77F' + } ctx.fillRect(0, 0, this.canvas.width, this.canvas.height) ctx.restore() @@ -134,6 +138,15 @@ class ATBBar { i += action.size } } + + if (this.battleCharacter.stunIsSignificant) { + ctx.fillStyle = 'rgba(255, 255, 255, 0.5)' + ctx.fillRect(0, 0, this.canvas.width, this.canvas.height) + ctx.textAlign = 'left' + ctx.fillStyle = 'black' + ctx.font = '5px pixel-font' + ctx.fillText('Stunned!', 2, this.canvas.height / 2 + 2.5) + } } update(dt) { @@ -247,7 +260,6 @@ class ATBBar { if (action.cooldown) { this.battleCharacter.cooldownTimers[action.id] = action.cooldown * this.segmentCount this.battleCharacter.cooldownTimers[action.id] -= this.segmentCount - this.getRemainingSpace() - console.log('Enqueued cooldown:', action.label, action.cooldown * this.segmentCount, this.battleCharacter.cooldownTimers[action.id]) } this.queuedActions.push(action) return true -- cgit 1.3.0-6-gf8a5