Work on new maps continues
This commit is contained in:
@@ -37,6 +37,7 @@ public class Blocks implements ContentList{
|
||||
air, part, spawn, deepwater, water, tar, stone, craters, charr, sand, ice, snow,
|
||||
grass, holostone, rocks, icerocks, cliffs, pine, whiteTree, whiteTreeDead, sporeCluster,
|
||||
iceSnow, sandWater, duneRocks, stainedRocks, stainedStone, stainedRocksRed, stainedStoneRed, stainedRocksYellow, stainedStoneYellow, stainedBoulder,
|
||||
metalFloor, metalFloorDamaged, metalFloor2, metalFloor3, metalFloor4, metalFloor5,
|
||||
|
||||
//crafting
|
||||
siliconSmelter, kiln, graphitePress, plastaniumCompressor, multiPress, phaseWeaver, surgeSmelter, pyratiteMixer, blastMixer, cryofluidMixer,
|
||||
@@ -46,7 +47,7 @@ public class Blocks implements ContentList{
|
||||
powerVoid, powerSource, itemSource, liquidSource, itemVoid,
|
||||
|
||||
//defense
|
||||
scrapWall, scrapWallLarge,
|
||||
scrapWall, scrapWallLarge, scrapWallHuge, scrapWallGigantic, thruster, //ok these names are getting ridiculous. but at least I don't have humongous walls yet
|
||||
copperWall, copperWallLarge, titaniumWall, titaniumWallLarge, thoriumWall, thoriumWallLarge, door, doorLarge,
|
||||
phaseWall, phaseWallLarge, surgeWall, surgeWallLarge, mendProjector, overdriveProjector, forceProjector, shockMine,
|
||||
|
||||
@@ -265,6 +266,30 @@ public class Blocks implements ContentList{
|
||||
variants = 2;
|
||||
}};
|
||||
|
||||
metalFloor = new Floor("metal-floor"){{
|
||||
variants = 0;
|
||||
}};
|
||||
|
||||
metalFloorDamaged = new Floor("metal-floor-damaged"){{
|
||||
variants = 0;
|
||||
}};
|
||||
|
||||
metalFloor2 = new Floor("metal-floor-2"){{
|
||||
variants = 0;
|
||||
}};
|
||||
|
||||
metalFloor3 = new Floor("metal-floor-3"){{
|
||||
variants = 0;
|
||||
}};
|
||||
|
||||
metalFloor4 = new Floor("metal-floor-4"){{
|
||||
variants = 0;
|
||||
}};
|
||||
|
||||
metalFloor5 = new Floor("metal-floor-5"){{
|
||||
variants = 0;
|
||||
}};
|
||||
|
||||
//endregion
|
||||
//region crafting
|
||||
|
||||
@@ -492,13 +517,30 @@ public class Blocks implements ContentList{
|
||||
int wallHealthMultiplier = 3;
|
||||
|
||||
scrapWall = new Wall("scrap-wall"){{
|
||||
health = 80;
|
||||
variants = 3;
|
||||
health = 60 * wallHealthMultiplier;
|
||||
variants = 5;
|
||||
}};
|
||||
|
||||
scrapWallLarge = new Wall("scrap-wall-large"){{
|
||||
health = 80 * 4;
|
||||
health = 60 * 4 * wallHealthMultiplier;
|
||||
size = 2;
|
||||
variants = 4;
|
||||
}};
|
||||
|
||||
scrapWallHuge = new Wall("scrap-wall-huge"){{
|
||||
health = 60 * 9 * wallHealthMultiplier;
|
||||
size = 3;
|
||||
variants = 3;
|
||||
}};
|
||||
|
||||
scrapWallGigantic = new Wall("scrap-wall-gigantic"){{
|
||||
health = 60 * 16 * wallHealthMultiplier;
|
||||
size = 4;
|
||||
}};
|
||||
|
||||
thruster = new Wall("thruster"){{
|
||||
health = 55 * 16 * wallHealthMultiplier;
|
||||
size = 4;
|
||||
}};
|
||||
|
||||
copperWall = new Wall("copper-wall"){{
|
||||
|
||||
@@ -312,13 +312,13 @@ public class Zones implements ContentList{
|
||||
);
|
||||
}};
|
||||
}};
|
||||
/*
|
||||
impact = new Zone("impact", new MapGenerator("groundZero", 1)){{ //TODO implement
|
||||
deployCost = ItemStack.with(Items.copper, 300);
|
||||
|
||||
impact = new Zone("impact0079", new MapGenerator("impact0079")){{ //TODO implement
|
||||
deployCost = ItemStack.with(Items.copper, 4000);
|
||||
startingItems = ItemStack.with(Items.copper, 200);
|
||||
conditionWave = 15;
|
||||
zoneRequirements = new Zone[]{frozenForest};
|
||||
blockRequirements = new Block[]{Blocks.copperWall};
|
||||
zoneRequirements = new Zone[]{stainedMountains};
|
||||
blockRequirements = new Block[]{Blocks.launchPad};
|
||||
rules = () -> new Rules(){{
|
||||
waves = true;
|
||||
waveTimer = true;
|
||||
@@ -326,6 +326,8 @@ public class Zones implements ContentList{
|
||||
}};
|
||||
}};
|
||||
|
||||
/*
|
||||
|
||||
desolateRift = new Zone("desolateRift", new MapGenerator("groundZero", 1)){{ //TODO implement
|
||||
deployCost = ItemStack.with(Items.copper, 300);
|
||||
startingItems = ItemStack.with(Items.copper, 200);
|
||||
|
||||
@@ -236,10 +236,21 @@ public class MapEditor{
|
||||
}
|
||||
|
||||
public void resize(int width, int height){
|
||||
MapTileData previous = map;
|
||||
int offsetX = -(width - previous.width())/2, offsetY = -(height - previous.height())/2;
|
||||
|
||||
map = new MapTileData(width, height);
|
||||
for(int x = 0; x < map.width(); x++){
|
||||
for(int y = 0; y < map.height(); y++){
|
||||
map.write(x, y, DataPosition.floor, Blocks.stone.id);
|
||||
int px = offsetX + x, py = offsetY + y;
|
||||
if(Structs.inBounds(px, py, previous.width(), previous.height())){
|
||||
map.write(x, y, DataPosition.floor, previous.read(px, py, DataPosition.floor));
|
||||
map.write(x, y, DataPosition.wall, previous.read(px, py, DataPosition.wall));
|
||||
map.write(x, y, DataPosition.link, previous.read(px, py, DataPosition.link));
|
||||
map.write(x, y, DataPosition.rotationTeam, previous.read(px, py, DataPosition.rotationTeam));
|
||||
}else{
|
||||
map.write(x, y, DataPosition.floor, Blocks.stone.id);
|
||||
}
|
||||
}
|
||||
}
|
||||
renderer.resize(width, height);
|
||||
|
||||
@@ -58,6 +58,8 @@ public class MapView extends Element implements GestureListener{
|
||||
Core.input.getInputProcessors().insert(0, new GestureDetector(20, 0.5f, 2, 0.15f, this));
|
||||
touchable(Touchable.enabled);
|
||||
|
||||
Point2 firstTouch = new Point2();
|
||||
|
||||
addListener(new InputListener(){
|
||||
|
||||
@Override
|
||||
@@ -95,6 +97,7 @@ public class MapView extends Element implements GestureListener{
|
||||
startx = p.x;
|
||||
starty = p.y;
|
||||
tool.touched(editor, p.x, p.y);
|
||||
firstTouch.set(p);
|
||||
|
||||
if(tool.edit){
|
||||
updated = true;
|
||||
@@ -116,6 +119,14 @@ public class MapView extends Element implements GestureListener{
|
||||
Point2 p = project(x, y);
|
||||
|
||||
if(tool == EditorTool.line){
|
||||
if(Core.input.keyDown(KeyCode.TAB)){
|
||||
if(Math.abs(p.x - firstTouch.x) > Math.abs(p.y - firstTouch.y)){
|
||||
p.y = firstTouch.y;
|
||||
}else{
|
||||
p.x = firstTouch.x;
|
||||
}
|
||||
}
|
||||
|
||||
ui.editor.resetSaved();
|
||||
Array<Point2> points = br.line(startx, starty, p.x, p.y);
|
||||
for(Point2 point : points){
|
||||
@@ -140,6 +151,7 @@ public class MapView extends Element implements GestureListener{
|
||||
|
||||
@Override
|
||||
public void touchDragged(InputEvent event, float x, float y, int pointer){
|
||||
|
||||
mousex = x;
|
||||
mousey = y;
|
||||
|
||||
@@ -153,8 +165,19 @@ public class MapView extends Element implements GestureListener{
|
||||
}
|
||||
updated = true;
|
||||
}
|
||||
lastx = p.x;
|
||||
lasty = p.y;
|
||||
|
||||
if(tool == EditorTool.line && Core.input.keyDown(KeyCode.TAB)){
|
||||
if(Math.abs(p.x - firstTouch.x) > Math.abs(p.y - firstTouch.y)){
|
||||
lastx = p.x;
|
||||
lasty = firstTouch.y;
|
||||
}else{
|
||||
lastx = firstTouch.x;
|
||||
lasty = p.y;
|
||||
}
|
||||
}else{
|
||||
lastx = p.x;
|
||||
lasty = p.y;
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -316,7 +339,7 @@ public class MapView extends Element implements GestureListener{
|
||||
Lines.poly(brushPolygons[index], v2.x, v2.y, scaling);
|
||||
}
|
||||
|
||||
if((tool.edit || tool == EditorTool.line) && (!mobile || drawing)){
|
||||
if((tool.edit || (tool == EditorTool.line && !drawing)) && (!mobile || drawing)){
|
||||
Point2 p = project(mousex, mousey);
|
||||
Vector2 v = unproject(p.x, p.y).add(x, y);
|
||||
Lines.poly(brushPolygons[index], v.x, v.y, scaling);
|
||||
|
||||
@@ -33,6 +33,7 @@ public class MapGenerator extends Generator{
|
||||
public int enemySpawns = -1;
|
||||
/*Whether floor is distorted along with blocks.*/
|
||||
public boolean distortFloor = false;
|
||||
/**Items randomly added to containers and vaults.*/
|
||||
public ItemStack[] storageDrops = ItemStack.with(Items.copper, 300, Items.lead, 300, Items.silicon, 200, Items.graphite, 200, Items.blastCompound, 200);
|
||||
|
||||
public MapGenerator(String mapName){
|
||||
@@ -74,6 +75,7 @@ public class MapGenerator extends Generator{
|
||||
data.position(0, 0);
|
||||
TileDataMarker marker = data.newDataMarker();
|
||||
Array<Point2> players = new Array<>();
|
||||
Array<Block> coreTypes = new Array<>();
|
||||
Array<Point2> enemies = new Array<>();
|
||||
|
||||
for(int y = 0; y < data.height(); y++){
|
||||
@@ -82,6 +84,7 @@ public class MapGenerator extends Generator{
|
||||
|
||||
if(content.block(marker.wall) instanceof CoreBlock){
|
||||
players.add(new Point2(x, y));
|
||||
coreTypes.add(content.block(marker.wall));
|
||||
marker.wall = 0;
|
||||
}
|
||||
|
||||
@@ -164,7 +167,7 @@ public class MapGenerator extends Generator{
|
||||
}
|
||||
|
||||
//TODO set specific core block?
|
||||
tiles[core.x][core.y].setBlock(Blocks.coreShard, defaultTeam);
|
||||
tiles[core.x][core.y].setBlock(coreTypes.get(players.indexOf(core)), defaultTeam);
|
||||
|
||||
world.prepareTiles(tiles);
|
||||
world.setMap(map);
|
||||
|
||||
@@ -157,6 +157,8 @@ public class CoreBlock extends StorageBlock{
|
||||
if(entity.progress >= 1f){
|
||||
Call.onUnitRespawn(tile, entity.currentUnit);
|
||||
}
|
||||
}else{
|
||||
entity.heat = Mathf.lerpDelta(entity.heat, 0f, 0.1f);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user