add moveCancelable to Ability
This commit is contained in:
@@ -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,
|
||||
|
||||
+1
-2
@@ -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
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user