Unified turret outlines, fixed saves not working
BIN
core/assets-raw/sprites/blocks/turrets/block-2-top.png
Normal file
After Width: | Height: | Size: 378 B |
BIN
core/assets-raw/sprites/blocks/turrets/block-3-top.png
Normal file
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 |
BIN
core/assets-raw/sprites/items/item-copper.png
Normal file
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.
|
||||
#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
|
||||
|
@ -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
|
||||
|
@ -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));
|
||||
|
@ -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;
|
||||
|
||||
|
@ -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;
|
||||
|
@ -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"){
|
||||
{
|
||||
|
@ -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);
|
||||
});
|
||||
|
@ -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(){
|
||||
|
@ -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;
|
||||
|
@ -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();
|
||||
|
@ -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);
|
||||
}
|
||||
|
@ -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++){
|
||||
|
@ -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);
|
||||
}
|
||||
|
||||
|
||||
}
|