3x3 breach

This commit is contained in:
Anuken
2021-12-27 15:54:09 -05:00
parent f337a12f90
commit 677abf4924
11 changed files with 45 additions and 21 deletions
@@ -69,7 +69,7 @@ public class BaseTurret extends Block{
@Override
public void drawSelect(){
Drawf.dashCircle(x, y, range, team.color);
Drawf.dashCircle(x, y, range(), team.color);
}
}
}
@@ -39,7 +39,8 @@ public class ItemTurret extends Turret{
public void limitRange(float margin){
for(var entry : ammoTypes.copy().entries()){
var copy = entry.value.copy();
copy.lifetime = (range + margin) / copy.speed;
float realRange = copy.rangeChange + range;
copy.lifetime = (realRange + margin) / copy.speed;
ammoTypes.put(entry.key, copy);
}
}
@@ -214,6 +214,14 @@ public class Turret extends ReloadTurret{
public float heatReq;
public float[] sideHeat = new float[4];
@Override
public float range(){
if(hasAmmo()){
return range + peekAmmo().rangeChange;
}
return range;
}
@Override
public float warmup(){
return shootWarmup;
@@ -408,6 +416,8 @@ public class Turret extends ReloadTurret{
}
protected void findTarget(){
float range = range();
if(targetAir && !targetGround){
target = Units.bestEnemy(team, x, y, range, e -> !e.dead() && !e.isGrounded(), unitSort);
}else{
@@ -553,7 +563,7 @@ public class Turret extends ReloadTurret{
}
protected void bullet(BulletType type, float angle){
float lifeScl = type.scaleVelocity ? Mathf.clamp(Mathf.dst(x + bulletOffset.x, y + bulletOffset.y, targetPos.x, targetPos.y) / type.range(), minRange / type.range(), range / type.range()) : 1f;
float lifeScl = type.scaleVelocity ? Mathf.clamp(Mathf.dst(x + bulletOffset.x, y + bulletOffset.y, targetPos.x, targetPos.y) / type.range(), minRange / type.range(), range() / type.range()) : 1f;
type.create(this, team, x + bulletOffset.x, y + bulletOffset.y, angle, 1f + Mathf.range(velocityInaccuracy), lifeScl);
}
@@ -5,7 +5,7 @@ public class ConsumeCoolant extends ConsumeLiquidFilter{
public float maxTemp = 0.5f, maxFlammability = 0.1f;
public ConsumeCoolant(float amount){
this.filter = liquid -> liquid.temperature <= maxTemp && liquid.flammability < maxFlammability;
this.filter = liquid -> liquid.coolant && liquid.temperature <= maxTemp && liquid.flammability < maxFlammability;
this.amount = amount;
}
@@ -305,6 +305,10 @@ public class StatValues{
sep(bt, Core.bundle.format("bullet.buildingdamage", (int)(type.buildingDamageMultiplier * 100)));
}
if(type.rangeChange != 0 && !compact){
sep(bt, Core.bundle.format("bullet.range", (type.rangeChange > 0 ? "+" : "-") + Strings.autoFixed(type.rangeChange / tilesize, 1)));
}
if(type.splashDamage > 0){
sep(bt, Core.bundle.format("bullet.splashdamage", (int)type.splashDamage, Strings.fixed(type.splashDamageRadius / tilesize, 1)));
}