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
@@ -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);
@@ -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{