Increased nuclear reactor size, fixed multiblock bug

This commit is contained in:
Anuken
2017-11-02 20:40:59 -04:00
parent 5e16fbffc9
commit a27d7e097d
7 changed files with 189 additions and 183 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 427 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 427 B

After

Width:  |  Height:  |  Size: 506 B

File diff suppressed because it is too large Load Diff

Binary file not shown.

Before

Width:  |  Height:  |  Size: 41 KiB

After

Width:  |  Height:  |  Size: 42 KiB

View File

@@ -131,15 +131,15 @@ public class Tile{
}
/**Returns the list of all tiles linked to this multiblock, or an empty array if it's not a multiblock.
* This array contains only linked tiles, not this tile itself.*/
* This array contains all linked tiles, including this tile itself.*/
public Array<Tile> getLinkedTiles(){
tmpArray.clear();
if(!(block.width == 1 && block.health == 1)){
if(!(block.width == 1 && block.height == 1)){
int offsetx = -(block.width-1)/2;
int offsety = -(block.height-1)/2;
for(int dx = 0; dx < block.width; dx ++){
for(int dy = 0; dy < block.height; dy ++){
Tile other = World.tile(x + dx - offsetx, y + dy - offsety);
Tile other = World.tile(x + dx + offsetx, y + dy + offsety);
tmpArray.add(other);
}
}

View File

@@ -281,7 +281,7 @@ public class World{
int offsety = -(type.height-1)/2;
for(int dx = 0; dx < type.width; dx ++){
for(int dy = 0; dy < type.height; dy ++){
Tile other = tile(x + dx - offsetx, y + dy - offsety);
Tile other = tile(x + dx + offsetx, y + dy + offsety);
if(other == null || other.block() != Blocks.air){
return false;
}
@@ -311,7 +311,6 @@ public class World{
}else{
Tile target = tile.isLinked() ? tile.getLinked() : tile;
Array<Tile> removals = target.getLinkedTiles();
removals.add(tile);
for(Tile toremove : removals){
//note that setting a new block automatically unlinks it
toremove.setBlock(Blocks.air);

View File

@@ -220,14 +220,14 @@ public class ProductionBlocks{
{
//TODO
formalName = "nuclear reactor";
width = 2;
height = 2;
width = 3;
height = 3;
generateLiquid = Liquid.water;
generateItem = Item.uranium;
itemCapacity = 60;
itemInput = 6;
inputLiquid = 2f;
health = 340;
health = 500;
breaktime *= 2.2f;
powerCapacity = 100f;
}