Interval bullets for continuous bullets (#8628)
This commit is contained in:
@@ -74,6 +74,8 @@ public class ContinuousBulletType extends BulletType{
|
||||
if(shake > 0){
|
||||
Effect.shake(shake, shake, b);
|
||||
}
|
||||
|
||||
updateBulletInterval(b);
|
||||
}
|
||||
|
||||
public void applyDamage(Bullet b){
|
||||
|
||||
@@ -75,7 +75,9 @@ public class PointLaserBulletType extends BulletType{
|
||||
|
||||
@Override
|
||||
public void update(Bullet b){
|
||||
super.update(b);
|
||||
updateTrail(b);
|
||||
updateTrailEffects(b);
|
||||
updateBulletInterval(b);
|
||||
|
||||
if(b.timer.get(0, damageInterval)){
|
||||
Damage.collidePoint(b, b.team, hitEffect, b.aimX, b.aimY);
|
||||
@@ -115,4 +117,13 @@ public class PointLaserBulletType extends BulletType{
|
||||
b.trail.update(b.aimX, b.aimY, b.fslope() * (1f - (trailSinMag > 0 ? Mathf.absin(Time.time, trailSinScl, trailSinMag) : 0f)));
|
||||
}
|
||||
}
|
||||
|
||||
public void updateBulletInterval(Bullet b){
|
||||
if(intervalBullet != null && b.time >= intervalDelay && b.timer.get(2, bulletInterval)){
|
||||
float ang = b.rotation();
|
||||
for(int i = 0; i < intervalBullets; i++){
|
||||
intervalBullet.create(b, b.aimX, b.aimY, ang + Mathf.range(intervalRandomSpread) + intervalAngle + ((i - (intervalBullets - 1f)/2f) * intervalSpread));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user