diff --git a/build.gradle b/build.gradle index dfcc9007b1..37cabcebab 100644 --- a/build.gradle +++ b/build.gradle @@ -27,7 +27,7 @@ allprojects { appName = 'Mindustry' gdxVersion = '1.9.8' roboVMVersion = '2.3.0' - uCoreVersion = 'cf9553e76e6226650b86921a73208e360049ba44' + uCoreVersion = 'ba0efc413a71192cbede7b4e4bf734860ca764d8' getVersionString = { String buildVersion = getBuildVersion() diff --git a/core/src/io/anuke/mindustry/content/blocks/TurretBlocks.java b/core/src/io/anuke/mindustry/content/blocks/TurretBlocks.java index 6e226dcf5e..ff79f96d91 100644 --- a/core/src/io/anuke/mindustry/content/blocks/TurretBlocks.java +++ b/core/src/io/anuke/mindustry/content/blocks/TurretBlocks.java @@ -243,7 +243,7 @@ public class TurretBlocks extends BlockList implements ContentList{ shootShake = 2f; powerUsed = 10f; range = 160f; - reload = 130f; + reload = 200f; firingMoveFract = 0.25f; shootDuration = 180f; powerCapacity = 50f; diff --git a/core/src/io/anuke/mindustry/content/bullets/TurretBullets.java b/core/src/io/anuke/mindustry/content/bullets/TurretBullets.java index cc3d403eee..04c93a0512 100644 --- a/core/src/io/anuke/mindustry/content/bullets/TurretBullets.java +++ b/core/src/io/anuke/mindustry/content/bullets/TurretBullets.java @@ -170,6 +170,7 @@ public class TurretBullets extends BulletList implements ContentList{ hiteffect = BulletFx.hitMeltdown; despawneffect = Fx.none; hitsize = 4; + drawSize = 420f; lifetime = 16f; pierce = true; } diff --git a/core/src/io/anuke/mindustry/entities/bullet/Bullet.java b/core/src/io/anuke/mindustry/entities/bullet/Bullet.java index d7142d6e8a..16db392276 100644 --- a/core/src/io/anuke/mindustry/entities/bullet/Bullet.java +++ b/core/src/io/anuke/mindustry/entities/bullet/Bullet.java @@ -125,6 +125,11 @@ public class Bullet extends BulletEntity implements TeamTrait, SyncT this.data = data; } + @Override + public float drawSize(){ + return type.drawSize; + } + @Override public float getDamage(){ if(owner instanceof Unit){ @@ -169,11 +174,6 @@ public class Bullet extends BulletEntity implements TeamTrait, SyncT type.draw(this); } - @Override - public float drawSize(){ - return 8; - } - @Override public boolean collides(SolidTrait other){ return type.collides && super.collides(other) && !supressCollision; diff --git a/core/src/io/anuke/mindustry/world/blocks/defense/turrets/CooledTurret.java b/core/src/io/anuke/mindustry/world/blocks/defense/turrets/CooledTurret.java index 8aee521de2..4fc7b9fb41 100644 --- a/core/src/io/anuke/mindustry/world/blocks/defense/turrets/CooledTurret.java +++ b/core/src/io/anuke/mindustry/world/blocks/defense/turrets/CooledTurret.java @@ -37,7 +37,7 @@ public class CooledTurret extends Turret{ entity.reload += (used * liquid.heatCapacity) / liquid.heatCapacity; entity.liquids.remove(liquid, used); - if(Mathf.chance(0.04 * used)){ + if(Mathf.chance(0.06 * used)){ Effects.effect(coolEffect, tile.drawx() + Mathf.range(size * tilesize / 2f), tile.drawy() + Mathf.range(size * tilesize / 2f)); } } diff --git a/core/src/io/anuke/mindustry/world/blocks/defense/turrets/LaserTurret.java b/core/src/io/anuke/mindustry/world/blocks/defense/turrets/LaserTurret.java index 6c191a1ea0..96310e3410 100644 --- a/core/src/io/anuke/mindustry/world/blocks/defense/turrets/LaserTurret.java +++ b/core/src/io/anuke/mindustry/world/blocks/defense/turrets/LaserTurret.java @@ -4,9 +4,13 @@ import io.anuke.mindustry.entities.TileEntity; import io.anuke.mindustry.entities.bullet.Bullet; import io.anuke.mindustry.entities.bullet.BulletType; import io.anuke.mindustry.type.AmmoType; +import io.anuke.mindustry.type.Liquid; import io.anuke.mindustry.world.Tile; +import io.anuke.mindustry.world.consumers.ConsumeLiquidFilter; +import io.anuke.ucore.core.Effects; import io.anuke.ucore.core.Timers; import io.anuke.ucore.util.Angles; +import io.anuke.ucore.util.Mathf; import static io.anuke.mindustry.Vars.tilesize; @@ -16,10 +20,16 @@ public class LaserTurret extends PowerTurret{ public LaserTurret(String name){ super(name); + canOverdrive = false; + + consumes.remove(ConsumeLiquidFilter.class); + consumes.add(new ConsumeLiquidFilter(liquid -> liquid.temperature <= 0.5f && liquid.flammability < 0.1f, 0.01f)).update(false); } @Override - protected void updateShooting(Tile tile){ + public void update(Tile tile) { + super.update(tile); + LaserTurretEntity entity = tile.entity(); if(entity.bulletLife > 0 && entity.bullet != null){ @@ -33,17 +43,33 @@ public class LaserTurret extends PowerTurret{ if(entity.bulletLife <= 0f){ entity.bullet = null; } + } + } + + @Override + protected void updateShooting(Tile tile){ + LaserTurretEntity entity = tile.entity(); + + if(entity.bulletLife > 0 && entity.bullet != null){ return; } - if(entity.reload >= reload){ + if(entity.reload >= reload && entity.cons.valid()){ AmmoType type = peekAmmo(tile); shoot(tile, type); entity.reload = 0f; }else{ - entity.reload += tile.entity.delta() * peekAmmo(tile).reloadMultiplier; + Liquid liquid = entity.liquids.current(); + + float used = Math.min(Math.min(entity.liquids.get(liquid), maxCoolantUsed * Timers.delta()), Math.max(0, ((reload - entity.reload) / coolantMultiplier) / liquid.heatCapacity)); + entity.reload += (used * liquid.heatCapacity) / liquid.heatCapacity; + entity.liquids.remove(liquid, used); + + if(Mathf.chance(0.06 * used)){ + Effects.effect(coolEffect, tile.drawx() + Mathf.range(size * tilesize / 2f), tile.drawy() + Mathf.range(size * tilesize / 2f)); + } } }