Fixes wave being an item turret for some reason

This commit is contained in:
Anuken
2020-05-30 09:06:39 -04:00
parent 9e7a97b780
commit 8d0486d425
4 changed files with 20 additions and 17 deletions

View File

@@ -1416,7 +1416,7 @@ public class Blocks implements ContentList{
shootSound = Sounds.artillery;
}};
wave = new ItemTurret("wave"){{
wave = new LiquidTurret("wave"){{
requirements(Category.turret, ItemStack.with(Items.metaglass, 45, Items.lead, 75));
ammo(
Liquids.water, Bullets.waterShot,

View File

@@ -221,25 +221,28 @@ abstract class TileComp implements Posc, Teamc, Healthc, Tilec, Timerc, QuadTree
return tile.absoluteRelativeTo(cx, cy);
}
public @Nullable Tile frontLarge(){
int trns = block.size/2 + 1;
return tile.getNearby(Geometry.d4(rotation()).x * trns, Geometry.d4(rotation()).y * trns);
}
/** Multiblock front. */
public @Nullable Tilec front(){
return nearby((rotation() + 4) % 4);
}
public @Nullable Tilec right(){
return nearby((rotation() + 3) % 4);
int trns = block.size/2 + 1;
return nearby(Geometry.d4(rotation()).x * trns, Geometry.d4(rotation()).y * trns);
}
/** Multiblock back. */
public @Nullable Tilec back(){
return nearby((rotation() + 2) % 4);
int trns = block.size/2 + 1;
return nearby(Geometry.d4(rotation() + 2).x * trns, Geometry.d4(rotation() + 2).y * trns);
}
/** Multiblock left. */
public @Nullable Tilec left(){
return nearby((rotation() + 1) % 4);
int trns = block.size/2 + 1;
return nearby(Geometry.d4(rotation() + 1).x * trns, Geometry.d4(rotation() + 1).y * trns);
}
/** Multiblock right. */
public @Nullable Tilec right(){
int trns = block.size/2 + 1;
return nearby(Geometry.d4(rotation() + 3).x * trns, Geometry.d4(rotation() + 3).y * trns);
}
public int pos(){

View File

@@ -344,7 +344,7 @@ public abstract class Turret extends Block{
tr.trns(rotation, size * tilesize / 2f, Mathf.range(xRand));
for(int i = 0; i < shots; i++){
bullet(type, rotation + Mathf.range(inaccuracy + type.inaccuracy) + (i - shots / 2f) * spread);
bullet(type, rotation + Mathf.range(inaccuracy + type.inaccuracy) + (i - (int)(shots / 2f)) * spread);
}
}

View File

@@ -79,12 +79,12 @@ public class PayloadAcceptor extends Block{
if(payVector.len() >= size * tilesize/2f){
payVector.clamp(-size * tilesize / 2f, size * tilesize / 2f, -size * tilesize / 2f, size * tilesize / 2f);
Tile front = frontLarge();
if(front != null && front.entity != null && front.block().outputsPayload){
Tilec front = front();
if(front != null && front.block().outputsPayload){
if(movePayload(payload)){
payload = null;
}
}else if(front != null && !front.solid()){
}else if(front != null && !front.tile().solid()){
dumpPayload();
}
}