Multi shotgun fix (#8460)

* Multi-barrel shotgun fix

* multi-recoil support

* @Nullable for everything
This commit is contained in:
MEEPofFaith
2023-04-03 13:38:10 -07:00
committed by GitHub
parent 2075a226e1
commit 6d71bcd2eb
13 changed files with 73 additions and 20 deletions

View File

@@ -1,5 +1,7 @@
package mindustry.entities.pattern;
import arc.util.*;
public class ShootMulti extends ShootPattern{
public ShootPattern source;
public ShootPattern[] dest = {};
@@ -25,7 +27,7 @@ public class ShootMulti extends ShootPattern{
}
@Override
public void shoot(int totalShots, BulletHandler handler){
public void shoot(int totalShots, BulletHandler handler, @Nullable Runnable barrelIncrementer){
source.shoot(totalShots, (x, y, rotation, delay, move) -> {
for(var pattern : dest){
pattern.shoot(totalShots, (x2, y2, rot2, delay2, mover) -> {
@@ -35,6 +37,6 @@ public class ShootMulti extends ShootPattern{
});
});
}
});
}, barrelIncrementer);
}
}