Fixed offloadNear and power smelter bugs

This commit is contained in:
Anuken
2018-03-27 21:30:54 -04:00
parent 18d81f6daa
commit 1d0063ed39
9 changed files with 207 additions and 200 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 284 B

After

Width:  |  Height:  |  Size: 292 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 190 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 248 B

After

Width:  |  Height:  |  Size: 293 B

File diff suppressed because it is too large Load Diff

Binary file not shown.

Before

Width:  |  Height:  |  Size: 95 KiB

After

Width:  |  Height:  |  Size: 95 KiB

View File

@ -1,7 +1,7 @@
#Autogenerated file. Do not modify.
#Tue Mar 27 20:10:08 EDT 2018
#Tue Mar 27 21:26:54 EDT 2018
version=release
androidBuildCode=678
androidBuildCode=681
name=Mindustry
code=3.4
build=custom build

View File

@ -41,8 +41,9 @@ public class CraftingBlocks {
powersmelter = new PowerSmelter("powersmelter") {{
health = 90;
craftEffect = Fx.smeltsmoke;
inputs = new ItemStack[]{new ItemStack(Items.coal, 1), new ItemStack(Items.iron, 1)};
result = Items.densealloy;
result = Items.steel;
burnDuration = 45f;
powerUse = 0.1f;
craftTime = 25f;

View File

@ -111,10 +111,12 @@ public abstract class BaseBlock {
int size = tile.block().size;
GridPoint2[] nearby = Edges.getEdges(size);
byte i = (byte)(tile.getDump() % nearby.length);
for(int j = 0; j < nearby.length; j ++){
Tile other = tile.getNearby(nearby[j]);
Tile in = tile.getNearby(Edges.getInsideEdges(size)[j]);
tile.setDump((byte)((i + 1) % nearby.length));
Tile other = tile.getNearby(nearby[i]);
Tile in = tile.getNearby(Edges.getInsideEdges(size)[i]);
if(other != null && other.block().acceptItem(item, other, in) && canDump(tile, other, item)){
other.block().handleItem(item, other, in);
return;

View File

@ -14,7 +14,6 @@ import io.anuke.ucore.core.Effects.Effect;
import io.anuke.ucore.core.Timers;
import io.anuke.ucore.graphics.Draw;
import io.anuke.ucore.graphics.Fill;
import io.anuke.ucore.util.Log;
import io.anuke.ucore.util.Mathf;
import io.anuke.ucore.util.Strings;
@ -131,21 +130,19 @@ public class PowerSmelter extends PowerBlock {
PowerSmelterEntity entity = tile.entity();
Log.info(entity.heat + "");
//draw glowing center
if(entity.heat > 0f){
float g = 0.3f;
float r = 0.06f;
float cr = Mathf.random(0.1f);
Draw.alpha(((1f-g) + Mathf.absin(Timers.time(), 9f, g) + Mathf.random(r) - r) * entity.heat);
Draw.alpha(((1f-g) + Mathf.absin(Timers.time(), 8f, g) + Mathf.random(r) - r) * entity.heat);
Draw.tint(Color.valueOf("ffc999"));
Fill.circle(tile.drawx(), tile.drawy(), 3f + Mathf.absin(Timers.time(), 6f, 2f) + cr);
Fill.circle(tile.drawx(), tile.drawy(), 3f + Mathf.absin(Timers.time(), 5f, 2f) + cr);
Draw.color(1f, 1f, 1f, entity.heat);
Draw.rect(name + "-top", tile.drawx(), tile.drawy());
Fill.circle(tile.drawx(), tile.drawy(), 2f + Mathf.absin(Timers.time(), 6f, 1f) + cr);
Fill.circle(tile.drawx(), tile.drawy(), 1.9f + Mathf.absin(Timers.time(), 5f, 1f) + cr);
Draw.color();
}