Multi shotgun fix (#8460)
* Multi-barrel shotgun fix * multi-recoil support * @Nullable for everything
This commit is contained in:
@@ -1,5 +1,7 @@
|
||||
package mindustry.entities.pattern;
|
||||
|
||||
import arc.util.*;
|
||||
|
||||
public class ShootSpread extends ShootPattern{
|
||||
/** spread between bullets, in degrees. */
|
||||
public float spread = 5f;
|
||||
@@ -13,7 +15,7 @@ public class ShootSpread extends ShootPattern{
|
||||
}
|
||||
|
||||
@Override
|
||||
public void shoot(int totalShots, BulletHandler handler){
|
||||
public void shoot(int totalShots, BulletHandler handler, @Nullable Runnable barrelIncrementer){
|
||||
for(int i = 0; i < shots; i++){
|
||||
float angleOffset = i * spread - (shots - 1) * spread / 2f;
|
||||
handler.shoot(0, 0, angleOffset, firstShotDelay + shotDelay * i);
|
||||
|
||||
Reference in New Issue
Block a user