fix cast times

This commit is contained in:
2025-01-12 14:50:37 +09:00
parent d9d62d7070
commit 302d2f0618
3 changed files with 46 additions and 26 deletions
+32 -12
View File
@@ -1,8 +1,8 @@
import Projectile from './projectile.js'
// Q: damage -> self sustain / crowd control
// W: control -> mobility
// E: support -> vision / selfless support / creative
// major damage OR minor self sustain / crowd control
// major support OR minor vision / selfless support / creative
// major control OR minor mobility
export default class Ability {
id = crypto.randomUUID()
@@ -95,19 +95,39 @@ export default class Ability {
},
})
static control = new Ability({
id: 'control',
name: 'Control',
castTime: 1,
cooldown: 5,
effect: function controlEffect() { console.log('Control is still work in progress.') },
})
static shieldThrow = new Ability({
id: 'shield_throw',
name: 'Shield Throw',
castTime: 0.1,
cooldown: 7,
effect: function shieldThrowEffect() { console.log('Shield throw is still work in progress.') },
effect: function shieldThrowEffect(caster, cursor) { },
})
static blink = new Ability({
id: 'blink',
name: 'Blink',
castTime: 1,
cooldown: 2,
range: 400,
effect: function blinkEffect(caster, cursor) {
const ability = this
const direction = cursor.clone().sub(caster.position)
if (direction.length() > ability.range) {
direction.normalize().multiplyScalar(ability.range)
}
const destination = caster.position.clone().add(direction)
caster.teleport(destination)
caster.cooldown(ability.id)
},
})
static control = new Ability({
id: 'control',
name: 'Control',
castTime: 1,
cooldown: 5,
effect: function controlEffect(caster, cursor) { },
})
}