mirror of
https://github.com/Anuken/Mindustry.git
synced 2025-02-12 03:37:27 +07:00
Fixed turrets firing without power as players
This commit is contained in:
parent
c4fb84c359
commit
605a370679
@ -1731,7 +1731,7 @@ public class Blocks implements ContentList{
|
||||
health = 150 * size * size;
|
||||
consumes.add(new ConsumeLiquidFilter(liquid -> liquid.temperature <= 0.5f && liquid.flammability < 0.1f, 2f)).update(false).optional(true, true);
|
||||
|
||||
consumes.powerCond(10f, (TurretBuild entity) -> entity.target != null || (entity.logicControlled() && entity.logicShooting));
|
||||
consumes.powerCond(10f, TurretBuild::isActive);
|
||||
}};
|
||||
|
||||
spectre = new ItemTurret("spectre"){{
|
||||
|
@ -1314,6 +1314,7 @@ public class UnitTypes implements ContentList{
|
||||
buildSpeed = 4f;
|
||||
drawShields = false;
|
||||
commandLimit = 6;
|
||||
lowAltitude = true;
|
||||
|
||||
ammoCapacity = 1300;
|
||||
ammoResupplyAmount = 20;
|
||||
|
@ -261,7 +261,7 @@ public class DefaultWaves{
|
||||
curTier = Math.min(curTier, 3);
|
||||
|
||||
//small chance to switch species
|
||||
if(Mathf.chance(0.2)){
|
||||
if(Mathf.chance(0.3)){
|
||||
curSpecies = Structs.random(species);
|
||||
}
|
||||
}
|
||||
|
@ -20,7 +20,7 @@ public class PowerTurret extends Turret{
|
||||
|
||||
@Override
|
||||
public void init(){
|
||||
consumes.powerCond(powerUse, (TurretBuild entity) -> entity.target != null || (entity.logicControlled() && entity.logicShooting));
|
||||
consumes.powerCond(powerUse, TurretBuild::isActive);
|
||||
super.init();
|
||||
}
|
||||
|
||||
|
@ -195,6 +195,10 @@ public abstract class Turret extends Block{
|
||||
return logicControlTime > 0;
|
||||
}
|
||||
|
||||
public boolean isActive(){
|
||||
return target != null || (logicControlled() && logicShooting) || (isControlled() && unit.isShooting());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void draw(){
|
||||
Draw.rect(baseRegion, x, y);
|
||||
|
Loading…
Reference in New Issue
Block a user