Added batteries, 3x3 teleporter

This commit is contained in:
Anuken
2018-03-10 20:28:25 -05:00
parent bf6e33791d
commit 3ce7284fc5
20 changed files with 392 additions and 367 deletions
Binary file not shown.

After

Width:  |  Height:  |  Size: 260 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 662 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 242 B

After

Width:  |  Height:  |  Size: 235 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 230 B

After

Width:  |  Height:  |  Size: 259 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 273 B

After

Width:  |  Height:  |  Size: 168 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 282 B

After

Width:  |  Height:  |  Size: 626 B

File diff suppressed because it is too large Load Diff
Binary file not shown.

Before

Width:  |  Height:  |  Size: 89 KiB

After

Width:  |  Height:  |  Size: 88 KiB

+2 -2
View File
@@ -1,7 +1,7 @@
#Autogenerated file. Do not modify. #Autogenerated file. Do not modify.
#Sat Mar 10 15:19:13 EST 2018 #Sat Mar 10 20:25:11 EST 2018
version=release version=release
androidBuildCode=431 androidBuildCode=439
name=Mindustry name=Mindustry
code=3.4 code=3.4
build=custom build build=custom build
@@ -78,6 +78,8 @@ public class Recipes {
new Recipe(power, DistributionBlocks.powerlaser, stack(Item.steel, 3), stack(Item.iron, 3)), new Recipe(power, DistributionBlocks.powerlaser, stack(Item.steel, 3), stack(Item.iron, 3)),
new Recipe(power, DistributionBlocks.powerlasercorner, stack(Item.steel, 4), stack(Item.iron, 4)), new Recipe(power, DistributionBlocks.powerlasercorner, stack(Item.steel, 4), stack(Item.iron, 4)),
new Recipe(power, DistributionBlocks.powerlaserrouter, stack(Item.steel, 5), stack(Item.iron, 5)), new Recipe(power, DistributionBlocks.powerlaserrouter, stack(Item.steel, 5), stack(Item.iron, 5)),
new Recipe(power, DistributionBlocks.battery, stack(Item.steel, 5), stack(Item.iron, 5)),
new Recipe(power, DistributionBlocks.batteryLarge, stack(Item.steel, 5), stack(Item.iron, 5)),
new Recipe(power, DefenseBlocks.shieldgenerator, stack(Item.titanium, 30), stack(Item.dirium, 30)), new Recipe(power, DefenseBlocks.shieldgenerator, stack(Item.titanium, 30), stack(Item.dirium, 30)),
@@ -72,11 +72,21 @@ public class DistributionBlocks{
}}, }},
powerlaser = new PowerLaser("powerlaser"){{ powerlaser = new PowerLaser("powerlaser"){{
}}, }},
powerlaserrouter = new PowerLaserRouter("powerlaserrouter"){{ powerlaserrouter = new PowerLaser("powerlaserrouter"){{
laserDirections = 3;
}}, }},
powerlasercorner = new PowerLaserRouter("powerlasercorner"){{ powerlasercorner = new PowerLaser("powerlasercorner"){{
laserDirections = 2; laserDirections = 2;
}}, }},
battery = new PowerLaser("battery"){{
laserDirections = 1;
powerCapacity = 320f;
}},
batteryLarge = new PowerLaser("batterylarge"){{
laserDirections = 1;
size = 3;
powerCapacity = 2000f;
}},
teleporter = new Teleporter("teleporter"){{ teleporter = new Teleporter("teleporter"){{
}}, }},
sorter = new Sorter("sorter"){{ sorter = new Sorter("sorter"){{
@@ -13,6 +13,7 @@ public class BlockPart extends Block{
public BlockPart() { public BlockPart() {
super("blockpart"); super("blockpart");
solid = false; solid = false;
hasPower = hasInventory = hasLiquids = true;
} }
@Override @Override
@@ -5,7 +5,6 @@ import io.anuke.mindustry.world.Block;
import io.anuke.mindustry.world.BlockGroup; import io.anuke.mindustry.world.BlockGroup;
public abstract class PowerBlock extends Block{ public abstract class PowerBlock extends Block{
public float powerCapacity = 10f;
public float voltage = 0.001f; public float voltage = 0.001f;
public PowerBlock(String name) { public PowerBlock(String name) {
@@ -10,6 +10,7 @@ public class Wall extends Block{
solid = true; solid = true;
destructible = true; destructible = true;
group = BlockGroup.walls; group = BlockGroup.walls;
hasInventory = false;
} }
@Override @Override
@@ -10,6 +10,7 @@ public abstract class LiquidTurret extends Turret{
public LiquidTurret(String name) { public LiquidTurret(String name) {
super(name); super(name);
hasLiquids = true;
} }
@Override @Override
@@ -26,6 +26,7 @@ public class ShieldBlock extends PowerBlock{
super(name); super(name);
voltage = powerDrain; voltage = powerDrain;
powerCapacity = 80f; powerCapacity = 80f;
hasInventory = false;
} }
@Override @Override
@@ -3,6 +3,7 @@ package io.anuke.mindustry.world.blocks.types.distribution;
import com.badlogic.gdx.graphics.Color; import com.badlogic.gdx.graphics.Color;
import io.anuke.mindustry.world.Tile; import io.anuke.mindustry.world.Tile;
import io.anuke.mindustry.world.blocks.types.generation.Generator; import io.anuke.mindustry.world.blocks.types.generation.Generator;
import io.anuke.ucore.graphics.Draw;
public class PowerLaser extends Generator{ public class PowerLaser extends Generator{
public Color color = Color.valueOf("e54135"); public Color color = Color.valueOf("e54135");
@@ -14,6 +15,12 @@ public class PowerLaser extends Generator{
explosive = false; explosive = false;
laserDirections = 1; laserDirections = 1;
health = 50; health = 50;
hasInventory = false;
}
@Override
public void draw(Tile tile) {
Draw.rect(name(), tile.drawx(), tile.drawy(), tile.getRotation() * 90 - 90);
} }
@Override @Override
@@ -1,17 +0,0 @@
package io.anuke.mindustry.world.blocks.types.distribution;
import io.anuke.mindustry.world.Tile;
public class PowerLaserRouter extends PowerLaser{
public PowerLaserRouter(String name) {
super(name);
laserDirections = 3;
}
@Override
public void update(Tile tile){
distributeLaserPower(tile);
}
}
@@ -6,6 +6,7 @@ import com.badlogic.gdx.utils.ObjectSet;
import io.anuke.mindustry.entities.TileEntity; import io.anuke.mindustry.entities.TileEntity;
import io.anuke.mindustry.net.Net; import io.anuke.mindustry.net.Net;
import io.anuke.mindustry.resource.Item; import io.anuke.mindustry.resource.Item;
import io.anuke.mindustry.world.BarType;
import io.anuke.mindustry.world.Tile; import io.anuke.mindustry.world.Tile;
import io.anuke.mindustry.world.blocks.types.PowerBlock; import io.anuke.mindustry.world.blocks.types.PowerBlock;
import io.anuke.ucore.core.Timers; import io.anuke.ucore.core.Timers;
@@ -13,7 +14,6 @@ import io.anuke.ucore.graphics.Draw;
import io.anuke.ucore.scene.ui.ButtonGroup; import io.anuke.ucore.scene.ui.ButtonGroup;
import io.anuke.ucore.scene.ui.ImageButton; import io.anuke.ucore.scene.ui.ImageButton;
import io.anuke.ucore.scene.ui.layout.Table; import io.anuke.ucore.scene.ui.layout.Table;
import io.anuke.ucore.util.Mathf;
import io.anuke.ucore.util.Strings; import io.anuke.ucore.util.Strings;
import java.io.DataInputStream; import java.io.DataInputStream;
@@ -47,7 +47,7 @@ public class Teleporter extends PowerBlock{
solid = true; solid = true;
health = 80; health = 80;
powerCapacity = 30f; powerCapacity = 30f;
instantTransfer = true; size = 3;
} }
@Override @Override
@@ -59,6 +59,12 @@ public class Teleporter extends PowerBlock{
} }
} }
@Override
public void setBars(){
super.setBars();
bars.remove(BarType.inventory);
}
@Override @Override
public void setStats(){ public void setStats(){
super.setStats(); super.setStats();
@@ -78,10 +84,10 @@ public class Teleporter extends PowerBlock{
super.draw(tile); super.draw(tile);
Draw.color(colorArray[entity.color]); Draw.color(colorArray[entity.color]);
Draw.rect("blank", tile.worldx(), tile.worldy(), 2, 2); Draw.rect("teleporter-top", tile.drawx(), tile.drawy());
Draw.color(Color.WHITE); //Draw.color(Color.WHITE);
Draw.alpha(0.45f + Mathf.absin(Timers.time(), 7f, 0.26f)); //Draw.alpha(0.45f + Mathf.absin(Timers.time(), 7f, 0.26f));
Draw.rect("teleporter-top", tile.worldx(), tile.worldy()); //Draw.rect("teleporter-top", tile.worldx(), tile.worldy());
Draw.reset(); Draw.reset();
} }
@@ -255,7 +255,7 @@ public class Generator extends PowerBlock{
if(other != null && other.block().hasPower){ if(other != null && other.block().hasPower){
Tile linked = other.getLinked(); Tile linked = other.getLinked();
if(linked == null || linked.block().hasPower){ if((linked == null || linked.block().hasPower) && linked != tile){
return other; return other;
} }
} }