Map implemented / Editor pick key / Crash fix

This commit is contained in:
Anuken
2019-01-31 12:45:11 -05:00
parent e727ee6d4a
commit 745ff1a270
8 changed files with 1617 additions and 1213 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

File diff suppressed because it is too large Load Diff

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.0 MiB

After

Width:  |  Height:  |  Size: 1.0 MiB

View File

@@ -36,7 +36,7 @@ public class Blocks implements ContentList{
//environment //environment
air, part, spawn, deepwater, water, tar, stone, craters, charr, sand, ice, snow, air, part, spawn, deepwater, water, tar, stone, craters, charr, sand, ice, snow,
grass, holostone, rocks, icerocks, cliffs, pine, whiteTree, whiteTreeDead, sporeCluster, grass, holostone, rocks, icerocks, cliffs, pine, whiteTree, whiteTreeDead, sporeCluster,
iceSnow, sandWater, duneRocks, stainedRocks, stainedStone, stainedRocksRed, stainedStoneRed, stainedRocksYellow, stainedStoneYellow, iceSnow, sandWater, duneRocks, stainedRocks, stainedStone, stainedRocksRed, stainedStoneRed, stainedRocksYellow, stainedStoneYellow, stainedBoulder,
//crafting //crafting
siliconSmelter, kiln, graphitePress, plastaniumCompressor, multiPress, phaseWeaver, surgeSmelter, pyratiteMixer, blastMixer, cryofluidMixer, siliconSmelter, kiln, graphitePress, plastaniumCompressor, multiPress, phaseWeaver, surgeSmelter, pyratiteMixer, blastMixer, cryofluidMixer,
@@ -64,7 +64,7 @@ public class Blocks implements ContentList{
mechanicalDrill, pneumaticDrill, laserDrill, blastDrill, plasmaDrill, waterExtractor, oilExtractor, cultivator, mechanicalDrill, pneumaticDrill, laserDrill, blastDrill, plasmaDrill, waterExtractor, oilExtractor, cultivator,
//storage //storage
core, vault, container, unloader, launchPad, core, coreBastion, vault, container, unloader, launchPad,
//turrets //turrets
duo, hail, arc, wave, lancer, swarmer, salvo, fuse, ripple, cyclone, spectre, meltdown, duo, hail, arc, wave, lancer, swarmer, salvo, fuse, ripple, cyclone, spectre, meltdown,
@@ -250,6 +250,7 @@ public class Blocks implements ContentList{
stainedStoneRed = new Floor("stained-stone-red"){{ stainedStoneRed = new Floor("stained-stone-red"){{
edgeStyle = "blocky"; edgeStyle = "blocky";
hasOres = true;
}}; }};
stainedRocksYellow = new StaticWall("stained-rocks-yellow"){{ stainedRocksYellow = new StaticWall("stained-rocks-yellow"){{
@@ -260,6 +261,10 @@ public class Blocks implements ContentList{
edgeStyle = "blocky"; edgeStyle = "blocky";
}}; }};
stainedBoulder = new Rock("stained-boulder"){{
variants = 2;
}};
//endregion //endregion
//region crafting //region crafting

View File

@@ -226,6 +226,7 @@ public class Zones implements ContentList{
}}; }};
}}; }};
/*
crags = new Zone("crags", new MapGenerator("groundZero", 1)){{ //TODO implement crags = new Zone("crags", new MapGenerator("groundZero", 1)){{ //TODO implement
deployCost = ItemStack.with(Items.copper, 300); deployCost = ItemStack.with(Items.copper, 300);
startingItems = ItemStack.with(Items.copper, 200); startingItems = ItemStack.with(Items.copper, 200);
@@ -237,21 +238,81 @@ public class Zones implements ContentList{
waveTimer = true; waveTimer = true;
waveSpacing = 60 * 80; waveSpacing = 60 * 80;
}}; }};
}}; }};*/
stainedMountains = new Zone("stainedMountains", new MapGenerator("stainedMountains", 2).dist(2.5f, true)){{ //TODO implement stainedMountains = new Zone("stainedMountains", new MapGenerator("stainedMountains", 2)
deployCost = ItemStack.with(Items.copper, 300); .dist(2.5f, true)
startingItems = ItemStack.with(Items.copper, 200); .decor(new Decoration(Blocks.stainedStone, Blocks.stainedBoulder, 0.01))){{
conditionWave = 15;
deployCost = ItemStack.with(Items.copper, 500, Items.lead, 300, Items.silicon, 100);
startingItems = ItemStack.with(Items.copper, 400, Items.lead, 100);
conditionWave = 10;
launchPeriod = 10;
zoneRequirements = new Zone[]{frozenForest}; zoneRequirements = new Zone[]{frozenForest};
blockRequirements = new Block[]{Blocks.copperWall}; blockRequirements = new Block[]{Blocks.pneumaticDrill};
itemRequirements = ItemStack.with(Items.copper, 8000, Items.silicon, 2000);
rules = () -> new Rules(){{ rules = () -> new Rules(){{
waves = true; waves = true;
waveTimer = true; waveTimer = true;
waveSpacing = 60 * 80; waveSpacing = 60 * 60 * 2;
spawns = Array.with(
new SpawnGroup(UnitTypes.titan){{
unitScaling = 2;
spacing = 2;
end = 10;
}},
new SpawnGroup(UnitTypes.dagger){{
begin = 2;
unitScaling = 1;
spacing = 2;
}},
new SpawnGroup(UnitTypes.dagger){{
begin = 10;
spacing = 2;
unitScaling = 2;
unitAmount = 2;
}},
new SpawnGroup(UnitTypes.ghoul){{
begin = 5;
unitScaling = 0.5f;
unitAmount = 1;
spacing = 5;
}},
new SpawnGroup(UnitTypes.wraith){{
begin = 10;
unitScaling = 1f;
unitAmount = 1;
spacing = 5;
}},
new SpawnGroup(UnitTypes.dagger){{
begin = 2;
unitScaling = 1;
spacing = 2;
}},
new SpawnGroup(UnitTypes.wraith){{
begin = 23;
unitScaling = 1f;
unitAmount = 1;
spacing = 2;
}},
new SpawnGroup(UnitTypes.crawler){{
begin = 20;
unitScaling = 1;
spacing = 10;
unitScaling = 0.5f;
unitAmount = 10;
}}
);
}}; }};
}}; }};
/*
impact = new Zone("impact", new MapGenerator("groundZero", 1)){{ //TODO implement impact = new Zone("impact", new MapGenerator("groundZero", 1)){{ //TODO implement
deployCost = ItemStack.with(Items.copper, 300); deployCost = ItemStack.with(Items.copper, 300);
startingItems = ItemStack.with(Items.copper, 200); startingItems = ItemStack.with(Items.copper, 200);
@@ -328,6 +389,6 @@ public class Zones implements ContentList{
waveTimer = true; waveTimer = true;
waveSpacing = 60 * 80; waveSpacing = 60 * 80;
}}; }};
}}; }};*/
} }
} }

View File

@@ -67,7 +67,6 @@ public class MapView extends Element implements GestureListener{
return false; return false;
} }
@Override @Override
public boolean touchDown(InputEvent event, float x, float y, int pointer, KeyCode button){ public boolean touchDown(InputEvent event, float x, float y, int pointer, KeyCode button){
if(pointer != 0){ if(pointer != 0){
@@ -132,7 +131,7 @@ public class MapView extends Element implements GestureListener{
op = null; op = null;
} }
if(lastTool != null){ if(button == KeyCode.MOUSE_MIDDLE && lastTool != null){
tool = lastTool; tool = lastTool;
lastTool = null; lastTool = null;
} }
@@ -216,6 +215,16 @@ public class MapView extends Element implements GestureListener{
offsety -= ay * 15f / zoom; offsety -= ay * 15f / zoom;
} }
if(Core.input.keyTap(KeyCode.SHIFT_LEFT)){
lastTool = tool;
tool = EditorTool.pick;
}
if(Core.input.keyRelease(KeyCode.SHIFT_LEFT) && lastTool != null){
tool = lastTool;
lastTool = null;
}
if(ui.editor.hasPane()) return; if(ui.editor.hasPane()) return;
zoom += Core.input.axis(KeyCode.SCROLL) / 10f * zoom; zoom += Core.input.axis(KeyCode.SCROLL) / 10f * zoom;