This commit is contained in:
Anuken
2023-02-15 10:34:57 -05:00
6 changed files with 50 additions and 38 deletions

View File

@@ -3404,6 +3404,7 @@ public class Blocks{
reload = 30f;
inaccuracy = 10f;
range = 240f;
consumeAmmoOnce = false;
size = 2;
scaledHealth = 300;
shootSound = Sounds.missile;
@@ -3466,6 +3467,7 @@ public class Blocks{
size = 2;
range = 190f;
reload = 31f;
consumeAmmoOnce = false;
ammoEjectBack = 3f;
recoil = 3f;
shake = 1f;

View File

@@ -1746,7 +1746,8 @@ abstract class BuildingComp implements Posc, Teamc, Healthc, Buildingc, Timerc,
public void updateConsumption(){
//everything is valid when cheating
if(!block.hasConsumers || cheating()){
potentialEfficiency = efficiency = optionalEfficiency = enabled && shouldConsume() && productionValid() ? 1f : 0f;
potentialEfficiency = enabled && productionValid() ? 1f : 0f;
efficiency = optionalEfficiency = shouldConsume() ? potentialEfficiency : 0f;
updateEfficiencyMultiplier();
return;
}

View File

@@ -42,7 +42,7 @@ public class Team implements Comparable<Team>{
Mathf.rand.setSeed(8);
//create the whole 256 placeholder teams
for(int i = 6; i < all.length; i++){
new Team(i, "team#" + i, Color.HSVtoRGB(360f * Mathf.random(), 100f * Mathf.random(0.6f, 1f), 100f * Mathf.random(0.8f, 1f), 1f));
new Team(i, "team#" + i, Color.HSVtoRGB(360f * Mathf.random(), 100f * Mathf.random(0.4f, 1f), 100f * Mathf.random(0.6f, 1f), 1f));
}
Mathf.rand.setSeed(new Rand().nextLong());
}

View File

@@ -51,6 +51,19 @@ public class ItemTurret extends Turret{
stats.add(Stat.ammo, StatValues.ammo(ammoTypes));
}
@Override
public void setBars(){
super.setBars();
addBar("ammo", (ItemTurretBuild entity) ->
new Bar(
"stat.ammo",
Pal.ammo,
() -> (float)entity.totalAmmo / maxAmmo
)
);
}
@Override
public void init(){
consume(new ConsumeItemFilter(i -> ammoTypes.containsKey(i)){
@@ -100,14 +113,6 @@ public class ItemTurret extends Turret{
super.updateTile();
}
@Override
public void displayBars(Table bars){
super.displayBars(bars);
bars.add(new Bar("stat.ammo", Pal.ammo, () -> (float)totalAmmo / maxAmmo)).growX();
bars.row();
}
@Override
public int acceptStack(Item item, int amount, Teamc source){
BulletType type = ammoTypes.get(item);