Fix spread + burst turrets (#6069)

* Fix spread + burst turrets

* spread is 4 by default

set salvo spread to 0

* damnit
This commit is contained in:
Matthew Peng 2021-09-29 05:38:51 -07:00 committed by GitHub
parent 01d6aee754
commit a04b385f56
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 1 deletions

View File

@ -1675,6 +1675,7 @@ public class Blocks implements ContentList{
recoilAmount = 3f;
shootShake = 1f;
burstSpacing = 3f;
spread = 0f;
shots = 4;
ammoUseEffect = Fx.casing2;
health = 240 * size * size;

View File

@ -426,13 +426,14 @@ public class Turret extends ReloadTurret{
//when burst spacing is enabled, use the burst pattern
}else if(burstSpacing > 0.0001f){
for(int i = 0; i < shots; i++){
int ii = i;
Time.run(burstSpacing * i, () -> {
if(!isValid() || !hasAmmo()) return;
recoil = recoilAmount;
tr.trns(rotation, shootLength, Mathf.range(xRand));
bullet(type, rotation + Mathf.range(inaccuracy));
bullet(type, rotation + Mathf.range(inaccuracy + type.inaccuracy) + (ii - (int)(shots / 2f)) * spread);
effects();
useAmmo();
recoil = recoilAmount;