fix projectiles phasing through stuff

This commit is contained in:
2025-01-17 14:01:18 +09:00
parent 20f8a2f1fe
commit 787b48a4df
4 changed files with 41 additions and 25 deletions
+9 -7
View File
@@ -24,21 +24,23 @@ export default class Ability {
Object.entries(options).forEach(([key, value]) => this[key] = value)
}
// TODO: skill seemingly going right through minions without a registered hit
static straightShot = new Ability({
id: 'straight_shot',
name: 'Straight Shot',
castTime: 0.1,
castTime: 0.25,
cooldown: 1,
damage: 10,
radius: 7,
range: 800,
speed: 3000,
radius: 60,
range: 1200,
speed: 2000,
effect: function straightShotEffect(caster, cursor) {
const ability = this
const straightShotCollision = function straightShotCollision(projectile, collidingEntity) {
collidingEntity.damage(ability.damage)
projectile.despawn()
if (!projectile.memory.hit) {
collidingEntity.damage(ability.damage)
projectile.memory.hit = true
projectile.destination = collidingEntity.position.clone()
}
}
const projectile = new Projectile({