New WIP missile turret

This commit is contained in:
Anuken
2022-06-29 17:37:32 -04:00
parent 4e3f7eccae
commit 36aa56f251
24 changed files with 282 additions and 52 deletions

View File

@@ -208,8 +208,6 @@ public class Turret extends ReloadTurret{
public float curRecoil, heat, logicControlTime = -1;
public float shootWarmup, charge;
public int totalShots;
//turrets need to shoot once for 'visual reload' to be valid, otherwise they seem stuck at reload 0 when placed.
public boolean visualReloadValid;
public boolean logicShooting = false;
public @Nullable Posc target;
public Vec2 targetPos = new Vec2();
@@ -503,7 +501,6 @@ public class Turret extends ReloadTurret{
protected void updateShooting(){
if(reloadCounter >= reload && !charging() && shootWarmup >= minWarmup){
visualReloadValid = true;
BulletType type = peekAmmo();
shoot(type);

View File

@@ -67,7 +67,7 @@ public class DrawTurret extends DrawBlock{
Draw.z(Layer.turret);
}
float progress = tb.visualReloadValid ? tb.progress() : 1f;
float progress = tb.progress();
//TODO no smooth reload
var params = DrawPart.params.set(build.warmup(), 1f - progress, 1f - progress, tb.heat, tb.curRecoil, tb.charge, tb.x + tb.recoilOffset.x, tb.y + tb.recoilOffset.y, tb.rotation);