fix projectiles phasing through stuff
This commit is contained in:
+9
-7
@@ -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({
|
||||
|
||||
Reference in New Issue
Block a user