Unified turret outlines, fixed saves not working
|
After Width: | Height: | Size: 378 B |
|
After Width: | Height: | Size: 352 B |
|
Before Width: | Height: | Size: 520 B After Width: | Height: | Size: 536 B |
|
Before Width: | Height: | Size: 313 B After Width: | Height: | Size: 250 B |
|
Before Width: | Height: | Size: 493 B After Width: | Height: | Size: 506 B |
|
Before Width: | Height: | Size: 374 B After Width: | Height: | Size: 392 B |
|
Before Width: | Height: | Size: 808 B After Width: | Height: | Size: 827 B |
|
Before Width: | Height: | Size: 329 B After Width: | Height: | Size: 343 B |
|
Before Width: | Height: | Size: 338 B After Width: | Height: | Size: 356 B |
|
Before Width: | Height: | Size: 516 B After Width: | Height: | Size: 534 B |
|
Before Width: | Height: | Size: 450 B After Width: | Height: | Size: 471 B |
|
Before Width: | Height: | Size: 402 B After Width: | Height: | Size: 422 B |
|
Before Width: | Height: | Size: 370 B After Width: | Height: | Size: 379 B |
|
Before Width: | Height: | Size: 368 B After Width: | Height: | Size: 387 B |
|
Before Width: | Height: | Size: 398 B After Width: | Height: | Size: 414 B |
|
Before Width: | Height: | Size: 677 B After Width: | Height: | Size: 682 B |
|
After Width: | Height: | Size: 279 B |
|
Before Width: | Height: | Size: 307 B After Width: | Height: | Size: 290 B |
|
Before Width: | Height: | Size: 279 B After Width: | Height: | Size: 284 B |
|
Before Width: | Height: | Size: 276 B After Width: | Height: | Size: 286 B |
|
Before Width: | Height: | Size: 283 B After Width: | Height: | Size: 278 B |
|
Before Width: | Height: | Size: 282 B After Width: | Height: | Size: 303 B |
|
Before Width: | Height: | Size: 92 KiB After Width: | Height: | Size: 93 KiB |
@@ -1,7 +1,7 @@
|
|||||||
#Autogenerated file. Do not modify.
|
#Autogenerated file. Do not modify.
|
||||||
#Wed Mar 21 16:44:11 EDT 2018
|
#Wed Mar 21 20:03:34 EDT 2018
|
||||||
version=release
|
version=release
|
||||||
androidBuildCode=587
|
androidBuildCode=596
|
||||||
name=Mindustry
|
name=Mindustry
|
||||||
code=3.4
|
code=3.4
|
||||||
build=custom build
|
build=custom build
|
||||||
|
|||||||
@@ -103,12 +103,13 @@ public class UI extends SceneModule{
|
|||||||
Colors.put("healthstats", Color.SCARLET);
|
Colors.put("healthstats", Color.SCARLET);
|
||||||
Colors.put("interact", Color.ORANGE);
|
Colors.put("interact", Color.ORANGE);
|
||||||
Colors.put("accent", Color.valueOf("f4ba6e"));
|
Colors.put("accent", Color.valueOf("f4ba6e"));
|
||||||
Colors.put("place", Color.PURPLE);
|
Colors.put("place", Color.valueOf("6335f8"));
|
||||||
Colors.put("placeInvalid", Color.RED);
|
Colors.put("placeInvalid", Color.RED);
|
||||||
Colors.put("placeRotate", Color.ORANGE);
|
Colors.put("placeRotate", Color.ORANGE);
|
||||||
Colors.put("break", Color.CORAL);
|
Colors.put("break", Color.CORAL);
|
||||||
Colors.put("breakStart", Color.YELLOW);
|
Colors.put("breakStart", Color.YELLOW);
|
||||||
Colors.put("breakInvalid", Color.RED);
|
Colors.put("breakInvalid", Color.RED);
|
||||||
|
Colors.put("range", Colors.get("accent"));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -161,6 +161,10 @@ public class World extends Module{
|
|||||||
return tiles;
|
return tiles;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void setMap(Map map){
|
||||||
|
this.currentMap = map;
|
||||||
|
}
|
||||||
|
|
||||||
public void loadMap(Map map){
|
public void loadMap(Map map){
|
||||||
loadMap(map, MathUtils.random(0, 999999));
|
loadMap(map, MathUtils.random(0, 999999));
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ import com.badlogic.gdx.graphics.Color;
|
|||||||
public enum Team {
|
public enum Team {
|
||||||
none(Color.DARK_GRAY),
|
none(Color.DARK_GRAY),
|
||||||
blue(Color.ROYAL),
|
blue(Color.ROYAL),
|
||||||
red(Color.SCARLET);
|
red(Color.valueOf("e84737"));
|
||||||
|
|
||||||
public final Color color;
|
public final Color color;
|
||||||
|
|
||||||
|
|||||||
@@ -40,6 +40,7 @@ public class Save16 extends SaveFileVersion {
|
|||||||
//general state
|
//general state
|
||||||
byte mode = stream.readByte();
|
byte mode = stream.readByte();
|
||||||
String mapname = stream.readUTF();
|
String mapname = stream.readUTF();
|
||||||
|
world.setMap(world.maps().getByName(mapname));
|
||||||
|
|
||||||
int wave = stream.readInt();
|
int wave = stream.readInt();
|
||||||
byte difficulty = stream.readByte();
|
byte difficulty = stream.readByte();
|
||||||
@@ -141,22 +142,24 @@ public class Save16 extends SaveFileVersion {
|
|||||||
|
|
||||||
Tile[][] tiles = world.createTiles(width, height);
|
Tile[][] tiles = world.createTiles(width, height);
|
||||||
|
|
||||||
for(int x = 0; x < world.width(); x ++){
|
for(int x = 0; x < width; x ++){
|
||||||
for(int y = 0; y < world.height(); y ++) {
|
for(int y = 0; y < height; y ++) {
|
||||||
byte floorid = stream.readByte();
|
byte floorid = stream.readByte();
|
||||||
byte wallid = stream.readByte();
|
byte wallid = stream.readByte();
|
||||||
|
|
||||||
Tile tile = new Tile(x, y, floorid, wallid);
|
Tile tile = new Tile(x, y, floorid, wallid);
|
||||||
|
|
||||||
|
|
||||||
if (wallid == Blocks.blockpart.id) {
|
if (wallid == Blocks.blockpart.id) {
|
||||||
tile.link = stream.readByte();
|
tile.link = stream.readByte();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (tile.entity != null) {
|
if (tile.entity != null) {
|
||||||
byte tr = stream.readByte();
|
byte tr = stream.readByte();
|
||||||
|
short health = stream.readShort();
|
||||||
|
|
||||||
byte team = Bits.getLeftByte(tr);
|
byte team = Bits.getLeftByte(tr);
|
||||||
byte rotation = Bits.getRightByte(tr);
|
byte rotation = Bits.getRightByte(tr);
|
||||||
short health = stream.readShort();
|
|
||||||
|
|
||||||
tile.setTeam(Team.values()[team]);
|
tile.setTeam(Team.values()[team]);
|
||||||
tile.entity.health = health;
|
tile.entity.health = health;
|
||||||
|
|||||||
@@ -15,6 +15,7 @@ public class Item implements Comparable<Item>{
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
iron = new Item("iron"),
|
iron = new Item("iron"),
|
||||||
|
copper = new Item("copper"),
|
||||||
coal = new Item("coal"){
|
coal = new Item("coal"){
|
||||||
{
|
{
|
||||||
explosiveness = 0.2f;
|
explosiveness = 0.2f;
|
||||||
@@ -38,7 +39,6 @@ public class Item implements Comparable<Item>{
|
|||||||
fluxiness = 0.65f;
|
fluxiness = 0.65f;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
glass = new Item("glass"),
|
|
||||||
silicon = new Item("silicon"),
|
silicon = new Item("silicon"),
|
||||||
biomatter = new Item("biomatter"){
|
biomatter = new Item("biomatter"){
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -8,7 +8,6 @@ import io.anuke.mindustry.Vars;
|
|||||||
import io.anuke.mindustry.core.GameState.State;
|
import io.anuke.mindustry.core.GameState.State;
|
||||||
import io.anuke.mindustry.net.Net;
|
import io.anuke.mindustry.net.Net;
|
||||||
import io.anuke.ucore.core.Core;
|
import io.anuke.ucore.core.Core;
|
||||||
import io.anuke.ucore.core.Graphics;
|
|
||||||
import io.anuke.ucore.core.Settings;
|
import io.anuke.ucore.core.Settings;
|
||||||
import io.anuke.ucore.function.Consumer;
|
import io.anuke.ucore.function.Consumer;
|
||||||
import io.anuke.ucore.scene.ui.Image;
|
import io.anuke.ucore.scene.ui.Image;
|
||||||
@@ -146,13 +145,9 @@ public class SettingsMenuDialog extends SettingsDialog{
|
|||||||
renderer.pixelSurface.setScale(Core.cameraScale);
|
renderer.pixelSurface.setScale(Core.cameraScale);
|
||||||
renderer.shadowSurface.setScale(Core.cameraScale);
|
renderer.shadowSurface.setScale(Core.cameraScale);
|
||||||
renderer.shieldSurface.setScale(Core.cameraScale);
|
renderer.shieldSurface.setScale(Core.cameraScale);
|
||||||
Graphics.getEffects1().setScale(Core.cameraScale);
|
|
||||||
Graphics.getEffects2().setScale(Core.cameraScale);
|
|
||||||
}else{
|
}else{
|
||||||
renderer.shadowSurface.setScale(1);
|
renderer.shadowSurface.setScale(1);
|
||||||
renderer.shieldSurface.setScale(1);
|
renderer.shieldSurface.setScale(1);
|
||||||
Graphics.getEffects1().setScale(1);
|
|
||||||
Graphics.getEffects2().setScale(1);
|
|
||||||
}
|
}
|
||||||
renderer.setPixelate(b);
|
renderer.setPixelate(b);
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -42,6 +42,7 @@ public class Tile{
|
|||||||
this(x, y);
|
this(x, y);
|
||||||
this.floor = floor;
|
this.floor = floor;
|
||||||
this.wall = wall;
|
this.wall = wall;
|
||||||
|
changed();
|
||||||
}
|
}
|
||||||
|
|
||||||
public Tile(int x, int y, byte floor, byte wall, byte rotation, byte team){
|
public Tile(int x, int y, byte floor, byte wall, byte rotation, byte team){
|
||||||
@@ -50,6 +51,7 @@ public class Tile{
|
|||||||
this.wall = wall;
|
this.wall = wall;
|
||||||
this.rotation = rotation;
|
this.rotation = rotation;
|
||||||
this.team = team;
|
this.team = team;
|
||||||
|
changed();
|
||||||
}
|
}
|
||||||
|
|
||||||
public int packedPosition(){
|
public int packedPosition(){
|
||||||
|
|||||||
@@ -1,10 +1,7 @@
|
|||||||
package io.anuke.mindustry.world.blocks.types.defense;
|
package io.anuke.mindustry.world.blocks.types.defense;
|
||||||
|
|
||||||
import com.badlogic.gdx.graphics.Color;
|
|
||||||
import io.anuke.mindustry.resource.Item;
|
import io.anuke.mindustry.resource.Item;
|
||||||
import io.anuke.mindustry.world.Tile;
|
import io.anuke.mindustry.world.Tile;
|
||||||
import io.anuke.ucore.graphics.Draw;
|
|
||||||
import io.anuke.ucore.graphics.Lines;
|
|
||||||
import io.anuke.ucore.util.Strings;
|
import io.anuke.ucore.util.Strings;
|
||||||
|
|
||||||
public abstract class PowerTurret extends Turret{
|
public abstract class PowerTurret extends Turret{
|
||||||
@@ -22,13 +19,6 @@ public abstract class PowerTurret extends Turret{
|
|||||||
stats.add("powershot", Strings.toFixed(powerUsed, 1));
|
stats.add("powershot", Strings.toFixed(powerUsed, 1));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public void drawSelect(Tile tile){
|
|
||||||
Draw.color(Color.GREEN);
|
|
||||||
Lines.dashCircle(tile.drawx(), tile.drawy(), range);
|
|
||||||
Draw.reset();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean hasAmmo(Tile tile){
|
public boolean hasAmmo(Tile tile){
|
||||||
return tile.entity.power.amount >= powerUsed;
|
return tile.entity.power.amount >= powerUsed;
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
package io.anuke.mindustry.world.blocks.types.defense;
|
package io.anuke.mindustry.world.blocks.types.defense;
|
||||||
|
|
||||||
import com.badlogic.gdx.graphics.Color;
|
|
||||||
import com.badlogic.gdx.math.MathUtils;
|
import com.badlogic.gdx.math.MathUtils;
|
||||||
import io.anuke.mindustry.entities.TileEntity;
|
import io.anuke.mindustry.entities.TileEntity;
|
||||||
import io.anuke.mindustry.world.Layer;
|
import io.anuke.mindustry.world.Layer;
|
||||||
@@ -68,13 +67,6 @@ public class RepairTurret extends PowerTurret{
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public void drawSelect(Tile tile){
|
|
||||||
Draw.color(Color.GREEN);
|
|
||||||
Lines.dashCircle(tile.drawx(), tile.drawy(), range);
|
|
||||||
Draw.reset();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void drawLayer2(Tile tile){
|
public void drawLayer2(Tile tile){
|
||||||
TurretEntity entity = tile.entity();
|
TurretEntity entity = tile.entity();
|
||||||
|
|||||||
@@ -77,6 +77,11 @@ public class Turret extends Block{
|
|||||||
public void draw(Tile tile){
|
public void draw(Tile tile){
|
||||||
if(base == null) {
|
if(base == null) {
|
||||||
Draw.rect("block-" + size, tile.drawx(), tile.drawy());
|
Draw.rect("block-" + size, tile.drawx(), tile.drawy());
|
||||||
|
if(Draw.hasRegion("block-" + size + "-top")) {
|
||||||
|
Draw.color(tile.getTeam().color, Color.WHITE, 0.45f);
|
||||||
|
Draw.rect("block-" + size + "-top", tile.drawx(), tile.drawy());
|
||||||
|
Draw.color();
|
||||||
|
}
|
||||||
}else{
|
}else{
|
||||||
Draw.rect(base, tile.drawx(), tile.drawy());
|
Draw.rect(base, tile.drawx(), tile.drawy());
|
||||||
}
|
}
|
||||||
@@ -95,14 +100,14 @@ public class Turret extends Block{
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void drawSelect(Tile tile){
|
public void drawSelect(Tile tile){
|
||||||
Draw.color(Color.GREEN);
|
Draw.color(tile.getTeam().color);
|
||||||
Lines.dashCircle(tile.drawx(), tile.drawy(), range);
|
Lines.dashCircle(tile.drawx(), tile.drawy(), range);
|
||||||
Draw.reset();
|
Draw.reset();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void drawPlace(int x, int y, int rotation, boolean valid){
|
public void drawPlace(int x, int y, int rotation, boolean valid){
|
||||||
Draw.color(Color.PURPLE);
|
Draw.color("place");
|
||||||
Lines.stroke(1f);
|
Lines.stroke(1f);
|
||||||
Lines.dashCircle(x * tilesize, y * tilesize, range);
|
Lines.dashCircle(x * tilesize, y * tilesize, range);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -92,7 +92,7 @@ public class Generator extends PowerBlock{
|
|||||||
@Override
|
@Override
|
||||||
public void drawPlace(int x, int y, int rotation, boolean valid){
|
public void drawPlace(int x, int y, int rotation, boolean valid){
|
||||||
if(hasLasers){
|
if(hasLasers){
|
||||||
Draw.color(Color.PURPLE);
|
Draw.color("place");
|
||||||
Lines.stroke(2f);
|
Lines.stroke(2f);
|
||||||
|
|
||||||
for(int i = 0; i < laserDirections; i++){
|
for(int i = 0; i < laserDirections; i++){
|
||||||
|
|||||||
@@ -0,0 +1,14 @@
|
|||||||
|
package io.anuke.mindustry.world.blocks.types.production;
|
||||||
|
|
||||||
|
import io.anuke.mindustry.entities.units.UnitType;
|
||||||
|
import io.anuke.mindustry.world.Block;
|
||||||
|
|
||||||
|
public class UnitFactory extends Block {
|
||||||
|
protected UnitType type;
|
||||||
|
|
||||||
|
public UnitFactory(String name) {
|
||||||
|
super(name);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||