Fixed #2654 / Fixed #2651 / fine I'll add a base

This commit is contained in:
Anuken
2020-09-22 10:03:05 -04:00
parent 87032c82b1
commit a6c10a97f2
13 changed files with 1797 additions and 1779 deletions

View File

@@ -277,7 +277,7 @@ public abstract class BulletType extends Content{
bullet.damage = damage < 0 ? this.damage : damage;
bullet.add();
if(keepVelocity && owner instanceof Hitboxc) bullet.vel.add(((Hitboxc)owner).deltaX() / Time.delta, ((Hitboxc)owner).deltaY() / Time.delta);
if(keepVelocity && owner instanceof Hitboxc) bullet.vel.add(((Velc)owner).vel().x, ((Velc)owner).vel().y);
return bullet;
}

View File

@@ -66,12 +66,14 @@ public class LaserBulletType extends BulletType{
int f = idx++;
for(int s : Mathf.signs){
Time.run(f * lightningDelay, () ->
Lightning.create(b, lightningColor,
lightningDamage < 0 ? damage : lightningDamage,
cx, cy, rot + 90*s + Mathf.range(lightningAngleRand),
lightningLength + Mathf.random(lightningLengthRand))
);
Time.run(f * lightningDelay, () -> {
if(b.isAdded() && b.type == this){
Lightning.create(b, lightningColor,
lightningDamage < 0 ? damage : lightningDamage,
cx, cy, rot + 90*s + Mathf.range(lightningAngleRand),
lightningLength + Mathf.random(lightningLengthRand));
}
});
}
}
}