Fires, puddles, feature reimplementations

This commit is contained in:
Anuken
2020-02-09 23:43:08 -05:00
parent 3feca9bbf8
commit e9b066b866
23 changed files with 375 additions and 159 deletions

View File

@@ -630,8 +630,7 @@ public class Block extends BlockStorage{
Time.run(i / 2f, () -> {
Tile other = world.tile(tile.x + Mathf.range(size / 2), tile.y + Mathf.range(size / 2));
if(other != null){
//TODO puddle
//Puddle.deposit(other, liquid, splash);
Puddles.deposit(other, liquid, splash);
}
});
}

View File

@@ -7,6 +7,7 @@ import arc.util.*;
import mindustry.*;
import mindustry.content.*;
import mindustry.ctype.*;
import mindustry.entities.*;
import mindustry.gen.*;
import mindustry.type.*;
import mindustry.world.consumers.*;
@@ -176,8 +177,7 @@ public abstract class BlockStorage extends UnlockableContent{
}
}else if(leakResistance != 100f && !next.block().solid && !next.block().hasLiquids){
float leakAmount = tile.entity.liquids().get(liquid) / leakResistance;
//TODO deposit puddle
//Puddle.deposit(next, tile, liquid, leakAmount);
Puddles.deposit(next, tile, liquid, leakAmount);
tile.entity.liquids().remove(liquid, leakAmount);
}
return 0;

View File

@@ -67,16 +67,6 @@ public class LiquidTurret extends Turret{
return entity.target != null && hasAmmo(tile);
}
@Override
protected boolean validateTarget(Tile tile){
TurretEntity entity = tile.ent();
if(entity.liquids().current().canExtinguish() && entity.target instanceof Tile){
//TODO fix
//return Fire.has(((Tile)entity.target).x, ((Tile)entity.target).y);
}
return super.validateTarget(tile);
}
@Override
protected void findTarget(Tile tile){
TurretEntity entity = tile.ent();
@@ -84,10 +74,10 @@ public class LiquidTurret extends Turret{
int tr = (int)(range / tilesize);
for(int x = -tr; x <= tr; x++){
for(int y = -tr; y <= tr; y++){
//if(Fire.has(x + tile.x, y + tile.y)){
// entity.target = world.tile(x + tile.x, y + tile.y);
// return;
//}
if(Fires.has(x + tile.x, y + tile.y)){
entity.target = Fires.get(x + tile.x, y + tile.y);
return;
}
}
}
}
@@ -103,7 +93,7 @@ public class LiquidTurret extends Turret{
type.shootEffect.at(tile.drawx() + tr.x, tile.drawy() + tr.y, entity.rotation, entity.liquids().current().color);
type.smokeEffect.at(tile.drawx() + tr.x, tile.drawy() + tr.y, entity.rotation, entity.liquids().current().color);
//shootSound.at(tile);
shootSound.at(tile);
if(shootShake > 0){
Effects.shake(shootShake, shootShake, tile.entity);

View File

@@ -317,7 +317,7 @@ public abstract class Turret extends Block{
public float recoil = 0f;
public float heat;
public int shots;
public Teamc target;
public Posc target;
@Override
public void write(DataOutput stream) throws IOException{