Turret pattern rewrite
This commit is contained in:
25
core/src/mindustry/entities/pattern/ShootMulti.java
Normal file
25
core/src/mindustry/entities/pattern/ShootMulti.java
Normal 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);
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user