This commit is contained in:
Anuken
2018-09-14 12:59:52 -04:00
parent 796df1cec5
commit c1c1a3318c
6 changed files with 38 additions and 11 deletions

View File

@@ -27,7 +27,7 @@ allprojects {
appName = 'Mindustry' appName = 'Mindustry'
gdxVersion = '1.9.8' gdxVersion = '1.9.8'
roboVMVersion = '2.3.0' roboVMVersion = '2.3.0'
uCoreVersion = 'cf9553e76e6226650b86921a73208e360049ba44' uCoreVersion = 'ba0efc413a71192cbede7b4e4bf734860ca764d8'
getVersionString = { getVersionString = {
String buildVersion = getBuildVersion() String buildVersion = getBuildVersion()

View File

@@ -243,7 +243,7 @@ public class TurretBlocks extends BlockList implements ContentList{
shootShake = 2f; shootShake = 2f;
powerUsed = 10f; powerUsed = 10f;
range = 160f; range = 160f;
reload = 130f; reload = 200f;
firingMoveFract = 0.25f; firingMoveFract = 0.25f;
shootDuration = 180f; shootDuration = 180f;
powerCapacity = 50f; powerCapacity = 50f;

View File

@@ -170,6 +170,7 @@ public class TurretBullets extends BulletList implements ContentList{
hiteffect = BulletFx.hitMeltdown; hiteffect = BulletFx.hitMeltdown;
despawneffect = Fx.none; despawneffect = Fx.none;
hitsize = 4; hitsize = 4;
drawSize = 420f;
lifetime = 16f; lifetime = 16f;
pierce = true; pierce = true;
} }

View File

@@ -125,6 +125,11 @@ public class Bullet extends BulletEntity<BulletType> implements TeamTrait, SyncT
this.data = data; this.data = data;
} }
@Override
public float drawSize(){
return type.drawSize;
}
@Override @Override
public float getDamage(){ public float getDamage(){
if(owner instanceof Unit){ if(owner instanceof Unit){
@@ -169,11 +174,6 @@ public class Bullet extends BulletEntity<BulletType> implements TeamTrait, SyncT
type.draw(this); type.draw(this);
} }
@Override
public float drawSize(){
return 8;
}
@Override @Override
public boolean collides(SolidTrait other){ public boolean collides(SolidTrait other){
return type.collides && super.collides(other) && !supressCollision; return type.collides && super.collides(other) && !supressCollision;

View File

@@ -37,7 +37,7 @@ public class CooledTurret extends Turret{
entity.reload += (used * liquid.heatCapacity) / liquid.heatCapacity; entity.reload += (used * liquid.heatCapacity) / liquid.heatCapacity;
entity.liquids.remove(liquid, used); 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)); Effects.effect(coolEffect, tile.drawx() + Mathf.range(size * tilesize / 2f), tile.drawy() + Mathf.range(size * tilesize / 2f));
} }
} }

View File

@@ -4,9 +4,13 @@ import io.anuke.mindustry.entities.TileEntity;
import io.anuke.mindustry.entities.bullet.Bullet; import io.anuke.mindustry.entities.bullet.Bullet;
import io.anuke.mindustry.entities.bullet.BulletType; import io.anuke.mindustry.entities.bullet.BulletType;
import io.anuke.mindustry.type.AmmoType; import io.anuke.mindustry.type.AmmoType;
import io.anuke.mindustry.type.Liquid;
import io.anuke.mindustry.world.Tile; 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.core.Timers;
import io.anuke.ucore.util.Angles; import io.anuke.ucore.util.Angles;
import io.anuke.ucore.util.Mathf;
import static io.anuke.mindustry.Vars.tilesize; import static io.anuke.mindustry.Vars.tilesize;
@@ -16,10 +20,16 @@ public class LaserTurret extends PowerTurret{
public LaserTurret(String name){ public LaserTurret(String name){
super(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 @Override
protected void updateShooting(Tile tile){ public void update(Tile tile) {
super.update(tile);
LaserTurretEntity entity = tile.entity(); LaserTurretEntity entity = tile.entity();
if(entity.bulletLife > 0 && entity.bullet != null){ if(entity.bulletLife > 0 && entity.bullet != null){
@@ -33,17 +43,33 @@ public class LaserTurret extends PowerTurret{
if(entity.bulletLife <= 0f){ if(entity.bulletLife <= 0f){
entity.bullet = null; entity.bullet = null;
} }
}
}
@Override
protected void updateShooting(Tile tile){
LaserTurretEntity entity = tile.entity();
if(entity.bulletLife > 0 && entity.bullet != null){
return; return;
} }
if(entity.reload >= reload){ if(entity.reload >= reload && entity.cons.valid()){
AmmoType type = peekAmmo(tile); AmmoType type = peekAmmo(tile);
shoot(tile, type); shoot(tile, type);
entity.reload = 0f; entity.reload = 0f;
}else{ }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));
}
} }
} }