From 1a5e81102072ac150122e5fc483406c75c89c236 Mon Sep 17 00:00:00 2001 From: Thayol Date: Fri, 17 Jan 2025 14:43:49 +0900 Subject: [PATCH] add moveCancelable to Ability --- src/ability.js | 3 +++ src/entity.js | 3 +-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/ability.js b/src/ability.js index ff5be6f..019ab92 100644 --- a/src/ability.js +++ b/src/ability.js @@ -11,6 +11,7 @@ export default class Ability { castTime = 0 cooldown = 0 damage = 0 + moveCancelable = false radius = 1 range = 0 speed = 1000 @@ -63,6 +64,7 @@ export default class Ability { castTime: 0.25, cooldown: 1.25, damage: 25, + moveCancelable: true, radius: 5, range: 500, speed: 600, @@ -94,6 +96,7 @@ export default class Ability { name: 'Melee Attack', castTime: 0.1, cooldown: 1.75, + moveCancelable: true, damage: 10, radius: 5, range: 100, diff --git a/src/entity.js b/src/entity.js index 64e08ef..d84860a 100644 --- a/src/entity.js +++ b/src/entity.js @@ -120,9 +120,8 @@ export default class Entity { this.#moving = false } - // TODO: cancelable and uncancelable abilities moveAction(cursor, attack = false) { - if (this.casting != null && (!this.#attacking || this.casting.ability.id != this.abilities[0].id)) { + if (this.casting != null && this.casting.ability.moveCancelable) { this.casting = null }