Turret pattern rewrite

This commit is contained in:
Anuken
2022-02-24 23:29:36 -05:00
parent c3e9a961c5
commit 45f27eaeec
17 changed files with 239 additions and 240 deletions

View File

@@ -0,0 +1,25 @@
package mindustry.entities.pattern;
public class ShootMulti extends ShootPattern{
public ShootPattern source;
public ShootPattern[] dest = {};
public ShootMulti(ShootPattern source, ShootPattern... dest){
this.source = source;
this.dest = dest;
}
public ShootMulti(){
}
@Override
public void shoot(int totalShots, BulletHandler handler){
source.shoot(totalShots, (x, y, rotation, delay) -> {
for(var pattern : dest){
pattern.shoot(totalShots, (x2, y2, rot2, delay2) -> {
handler.shoot(x + x2, y + y2, rotation + rot2, delay + delay2);
});
}
});
}
}