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,16 @@
package mindustry.entities.pattern;
public class ShootBarrel extends ShootPattern{
/** barrels [in x, y, rotation] format. */
public float[] barrels = {0f, 0f, 0f};
/** offset of barrel to start on */
public int barrelOffset = 0;
@Override
public void shoot(int totalShots, BulletHandler handler){
for(int i = 0; i < shots; i++){
int index = ((i + totalShots + barrelOffset) % (barrels.length / 3)) * 3;
handler.shoot(barrels[index], barrels[index + 1], barrels[index + 2], firstShotDelay + shotDelay * i);
}
}
}