Unified turret outlines, fixed saves not working

This commit is contained in:
Anuken 2018-03-21 20:04:59 -04:00
parent 85988a2ff9
commit 238c589ad6
37 changed files with 334 additions and 307 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 378 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 352 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 520 B

After

Width:  |  Height:  |  Size: 536 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 313 B

After

Width:  |  Height:  |  Size: 250 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 493 B

After

Width:  |  Height:  |  Size: 506 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 374 B

After

Width:  |  Height:  |  Size: 392 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 808 B

After

Width:  |  Height:  |  Size: 827 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 329 B

After

Width:  |  Height:  |  Size: 343 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 338 B

After

Width:  |  Height:  |  Size: 356 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 516 B

After

Width:  |  Height:  |  Size: 534 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 450 B

After

Width:  |  Height:  |  Size: 471 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 402 B

After

Width:  |  Height:  |  Size: 422 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 370 B

After

Width:  |  Height:  |  Size: 379 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 368 B

After

Width:  |  Height:  |  Size: 387 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 398 B

After

Width:  |  Height:  |  Size: 414 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 677 B

After

Width:  |  Height:  |  Size: 682 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 279 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 307 B

After

Width:  |  Height:  |  Size: 290 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 279 B

After

Width:  |  Height:  |  Size: 284 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 276 B

After

Width:  |  Height:  |  Size: 286 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 283 B

After

Width:  |  Height:  |  Size: 278 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 282 B

After

Width:  |  Height:  |  Size: 303 B

File diff suppressed because it is too large Load Diff

Binary file not shown.

Before

Width:  |  Height:  |  Size: 92 KiB

After

Width:  |  Height:  |  Size: 93 KiB

View File

@ -1,7 +1,7 @@
#Autogenerated file. Do not modify.
#Wed Mar 21 16:44:11 EDT 2018
#Wed Mar 21 20:03:34 EDT 2018
version=release
androidBuildCode=587
androidBuildCode=596
name=Mindustry
code=3.4
build=custom build

View File

@ -103,12 +103,13 @@ public class UI extends SceneModule{
Colors.put("healthstats", Color.SCARLET);
Colors.put("interact", Color.ORANGE);
Colors.put("accent", Color.valueOf("f4ba6e"));
Colors.put("place", Color.PURPLE);
Colors.put("place", Color.valueOf("6335f8"));
Colors.put("placeInvalid", Color.RED);
Colors.put("placeRotate", Color.ORANGE);
Colors.put("break", Color.CORAL);
Colors.put("breakStart", Color.YELLOW);
Colors.put("breakInvalid", Color.RED);
Colors.put("range", Colors.get("accent"));
}
@Override

View File

@ -160,6 +160,10 @@ public class World extends Module{
return tiles;
}
public void setMap(Map map){
this.currentMap = map;
}
public void loadMap(Map map){
loadMap(map, MathUtils.random(0, 999999));

View File

@ -5,7 +5,7 @@ import com.badlogic.gdx.graphics.Color;
public enum Team {
none(Color.DARK_GRAY),
blue(Color.ROYAL),
red(Color.SCARLET);
red(Color.valueOf("e84737"));
public final Color color;

View File

@ -40,6 +40,7 @@ public class Save16 extends SaveFileVersion {
//general state
byte mode = stream.readByte();
String mapname = stream.readUTF();
world.setMap(world.maps().getByName(mapname));
int wave = stream.readInt();
byte difficulty = stream.readByte();
@ -141,22 +142,24 @@ public class Save16 extends SaveFileVersion {
Tile[][] tiles = world.createTiles(width, height);
for(int x = 0; x < world.width(); x ++){
for(int y = 0; y < world.height(); y ++) {
for(int x = 0; x < width; x ++){
for(int y = 0; y < height; y ++) {
byte floorid = stream.readByte();
byte wallid = stream.readByte();
Tile tile = new Tile(x, y, floorid, wallid);
if (wallid == Blocks.blockpart.id) {
tile.link = stream.readByte();
}
if (tile.entity != null) {
byte tr = stream.readByte();
short health = stream.readShort();
byte team = Bits.getLeftByte(tr);
byte rotation = Bits.getRightByte(tr);
short health = stream.readShort();
tile.setTeam(Team.values()[team]);
tile.entity.health = health;

View File

@ -15,6 +15,7 @@ public class Item implements Comparable<Item>{
}
},
iron = new Item("iron"),
copper = new Item("copper"),
coal = new Item("coal"){
{
explosiveness = 0.2f;
@ -38,7 +39,6 @@ public class Item implements Comparable<Item>{
fluxiness = 0.65f;
}
},
glass = new Item("glass"),
silicon = new Item("silicon"),
biomatter = new Item("biomatter"){
{

View File

@ -8,7 +8,6 @@ import io.anuke.mindustry.Vars;
import io.anuke.mindustry.core.GameState.State;
import io.anuke.mindustry.net.Net;
import io.anuke.ucore.core.Core;
import io.anuke.ucore.core.Graphics;
import io.anuke.ucore.core.Settings;
import io.anuke.ucore.function.Consumer;
import io.anuke.ucore.scene.ui.Image;
@ -146,13 +145,9 @@ public class SettingsMenuDialog extends SettingsDialog{
renderer.pixelSurface.setScale(Core.cameraScale);
renderer.shadowSurface.setScale(Core.cameraScale);
renderer.shieldSurface.setScale(Core.cameraScale);
Graphics.getEffects1().setScale(Core.cameraScale);
Graphics.getEffects2().setScale(Core.cameraScale);
}else{
renderer.shadowSurface.setScale(1);
renderer.shieldSurface.setScale(1);
Graphics.getEffects1().setScale(1);
Graphics.getEffects2().setScale(1);
}
renderer.setPixelate(b);
});

View File

@ -42,6 +42,7 @@ public class Tile{
this(x, y);
this.floor = floor;
this.wall = wall;
changed();
}
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.rotation = rotation;
this.team = team;
changed();
}
public int packedPosition(){

View File

@ -1,10 +1,7 @@
package io.anuke.mindustry.world.blocks.types.defense;
import com.badlogic.gdx.graphics.Color;
import io.anuke.mindustry.resource.Item;
import io.anuke.mindustry.world.Tile;
import io.anuke.ucore.graphics.Draw;
import io.anuke.ucore.graphics.Lines;
import io.anuke.ucore.util.Strings;
public abstract class PowerTurret extends Turret{
@ -22,13 +19,6 @@ public abstract class PowerTurret extends Turret{
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
public boolean hasAmmo(Tile tile){
return tile.entity.power.amount >= powerUsed;

View File

@ -1,6 +1,5 @@
package io.anuke.mindustry.world.blocks.types.defense;
import com.badlogic.gdx.graphics.Color;
import com.badlogic.gdx.math.MathUtils;
import io.anuke.mindustry.entities.TileEntity;
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
public void drawLayer2(Tile tile){
TurretEntity entity = tile.entity();

View File

@ -77,6 +77,11 @@ public class Turret extends Block{
public void draw(Tile tile){
if(base == null) {
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{
Draw.rect(base, tile.drawx(), tile.drawy());
}
@ -95,14 +100,14 @@ public class Turret extends Block{
@Override
public void drawSelect(Tile tile){
Draw.color(Color.GREEN);
Draw.color(tile.getTeam().color);
Lines.dashCircle(tile.drawx(), tile.drawy(), range);
Draw.reset();
}
@Override
public void drawPlace(int x, int y, int rotation, boolean valid){
Draw.color(Color.PURPLE);
Draw.color("place");
Lines.stroke(1f);
Lines.dashCircle(x * tilesize, y * tilesize, range);
}

View File

@ -92,7 +92,7 @@ public class Generator extends PowerBlock{
@Override
public void drawPlace(int x, int y, int rotation, boolean valid){
if(hasLasers){
Draw.color(Color.PURPLE);
Draw.color("place");
Lines.stroke(2f);
for(int i = 0; i < laserDirections; i++){

View File

@ -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);
}
}