Add line tool and undo tools
This commit is contained in:
@@ -10,6 +10,8 @@ import io.anuke.mindustry.input.PlaceMode;
|
||||
import io.anuke.mindustry.resource.Mech;
|
||||
import io.anuke.mindustry.resource.Recipe;
|
||||
import io.anuke.mindustry.resource.Weapon;
|
||||
import io.anuke.mindustry.world.Tile;
|
||||
import io.anuke.mindustry.world.blocks.Blocks;
|
||||
import io.anuke.ucore.core.*;
|
||||
import io.anuke.ucore.entities.DestructibleEntity;
|
||||
import io.anuke.ucore.util.Angles;
|
||||
@@ -74,6 +76,11 @@ public class Player extends DestructibleEntity{
|
||||
|
||||
if(health < maxhealth && Timers.get(this, "regen", 50))
|
||||
health ++;
|
||||
|
||||
Tile tile = world.tileWorld(x, y);
|
||||
if(tile != null && tile.floor().liquid && tile.block() == Blocks.air){
|
||||
damage(health+1); //drown
|
||||
}
|
||||
|
||||
vector.set(0, 0);
|
||||
|
||||
|
||||
@@ -54,18 +54,20 @@ public class TileEntity extends Entity{
|
||||
}
|
||||
|
||||
public void onDeath(){
|
||||
dead = true;
|
||||
|
||||
if(tile.block() == ProductionBlocks.core){
|
||||
Vars.control.coreDestroyed();
|
||||
}
|
||||
|
||||
Block block = tile.block();
|
||||
|
||||
block.onDestroyed(tile);
|
||||
|
||||
Vars.world.removeBlock(tile);
|
||||
remove();
|
||||
|
||||
if(!dead) {
|
||||
dead = true;
|
||||
Block block = tile.block();
|
||||
|
||||
block.onDestroyed(tile);
|
||||
|
||||
Vars.world.removeBlock(tile);
|
||||
remove();
|
||||
}
|
||||
}
|
||||
|
||||
public void collision(Bullet other){
|
||||
|
||||
@@ -9,11 +9,14 @@ import io.anuke.mindustry.entities.*;
|
||||
import io.anuke.mindustry.graphics.Fx;
|
||||
import io.anuke.mindustry.graphics.Shaders;
|
||||
import io.anuke.mindustry.world.Tile;
|
||||
import io.anuke.mindustry.world.blocks.Blocks;
|
||||
import io.anuke.ucore.UCore;
|
||||
import io.anuke.ucore.core.*;
|
||||
import io.anuke.ucore.entities.*;
|
||||
import io.anuke.ucore.util.*;
|
||||
|
||||
import static io.anuke.mindustry.Vars.world;
|
||||
|
||||
public class Enemy extends DestructibleEntity{
|
||||
public final static Color[] tierColors = { Color.valueOf("ffe451"), Color.valueOf("f48e20"), Color.valueOf("ff6757"), Color.valueOf("ff2d86") };
|
||||
public final static int maxtier = 4;
|
||||
@@ -211,6 +214,11 @@ public class Enemy extends DestructibleEntity{
|
||||
}else{
|
||||
idletime = 0;
|
||||
}
|
||||
|
||||
Tile tile = world.tileWorld(x, y);
|
||||
if(tile != null && tile.floor().liquid && tile.block() == Blocks.air){
|
||||
damage(health+1); //drown
|
||||
}
|
||||
|
||||
if(Float.isNaN(angle)){
|
||||
angle = 0;
|
||||
|
||||
Reference in New Issue
Block a user