Defined first 12 zones

This commit is contained in:
Anuken 2019-01-20 11:49:17 -05:00
parent ea9155b903
commit 750388a425
14 changed files with 1194 additions and 1024 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 120 B

After

Width:  |  Height:  |  Size: 240 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 116 B

After

Width:  |  Height:  |  Size: 261 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 363 B

View File

@ -34,7 +34,7 @@ deconstruction.title = Block Deconstruction Guide
deconstruction = You've just selected [accent]block deconstruction mode[].\n\nTo begin breaking, simply tap a block near your ship.\nOnce you have selected some blocks, press the checkbox to confirm, and your ship will begin de-constructing them.\n\n- [accent]Remove blocks[] from your selection by tapping them.\n- [accent]Remove blocks in an area[] by tapping and holding an empty spot, then dragging in a direction.\n- [accent]Cancel deconstruction or selection[] by pressing the X at the bottom left.
showagain = Don't show again next session
coreattack = < Core is under attack! >
unlocks = Unlocks
database = Core Database
savegame = Save Game
loadgame = Load Game
joingame = Join Game
@ -253,6 +253,17 @@ error.io = Network I/O error.
error.any = Unknown network error.
zone.groundZero.name = Ground Zero
zone.craters.name = The Craters
zone.frozenForest.name = Frozen Forest
zone.ruinousShores.name = Ruinous Shores
zone.crags.name = Crags
zone.stainedMountains.name = Stained Mountains
zone.impact.name = Impact 0079
zone.desolateRift.name = Desolate Rift
zone.arcticDesert.name = Arctic Desert
zone.dryWastes.name = Dry Wastes
zone.nuclearComplex.name = Nuclear Production Complex
zone.moltenFault.name = Molten Fault
settings.language = Language
settings.reset = Reset to Defaults

File diff suppressed because it is too large Load Diff

Binary file not shown.

Before

Width:  |  Height:  |  Size: 968 KiB

After

Width:  |  Height:  |  Size: 978 KiB

View File

@ -7,9 +7,11 @@ import io.anuke.mindustry.game.SpawnGroup;
import io.anuke.mindustry.maps.generators.MapGenerator;
import io.anuke.mindustry.type.ItemStack;
import io.anuke.mindustry.type.Zone;
import io.anuke.mindustry.world.Block;
public class Zones implements ContentList{
public Zone groundZero;
public Zone groundZero, craters, frozenForest, ruinousShores, crags, stainedMountains,
impact, desolateRift, arcticDesert, dryWastes, nuclearComplex, moltenFault;
@Override
public void load(){
@ -55,5 +57,148 @@ public class Zones implements ContentList{
);
}};
}};
craters = new Zone("craters", new MapGenerator("groundZero", 1)){{ //TODO implement
deployCost = ItemStack.with(Items.copper, 300);
startingItems = ItemStack.with(Items.copper, 200);
conditionWave = 15;
zoneRequirements = new Zone[]{groundZero};
blockRequirements = new Block[]{Blocks.copperWall};
rules = () -> new Rules(){{
waves = true;
waveTimer = true;
waveSpacing = 60 * 80;
}};
}};
frozenForest = new Zone("frozenForest", new MapGenerator("groundZero", 1)){{ //TODO implement
deployCost = ItemStack.with(Items.copper, 300);
startingItems = ItemStack.with(Items.copper, 200);
conditionWave = 15;
zoneRequirements = new Zone[]{groundZero};
blockRequirements = new Block[]{Blocks.copperWall};
rules = () -> new Rules(){{
waves = true;
waveTimer = true;
waveSpacing = 60 * 80;
}};
}};
ruinousShores = new Zone("ruinousShores", new MapGenerator("groundZero", 1)){{ //TODO implement
deployCost = ItemStack.with(Items.copper, 300);
startingItems = ItemStack.with(Items.copper, 200);
conditionWave = 15;
zoneRequirements = new Zone[]{groundZero};
blockRequirements = new Block[]{Blocks.copperWall};
rules = () -> new Rules(){{
waves = true;
waveTimer = true;
waveSpacing = 60 * 80;
}};
}};
crags = new Zone("crags", new MapGenerator("groundZero", 1)){{ //TODO implement
deployCost = ItemStack.with(Items.copper, 300);
startingItems = ItemStack.with(Items.copper, 200);
conditionWave = 15;
zoneRequirements = new Zone[]{groundZero};
blockRequirements = new Block[]{Blocks.copperWall};
rules = () -> new Rules(){{
waves = true;
waveTimer = true;
waveSpacing = 60 * 80;
}};
}};
stainedMountains = new Zone("stainedMountains", new MapGenerator("groundZero", 1)){{ //TODO implement
deployCost = ItemStack.with(Items.copper, 300);
startingItems = ItemStack.with(Items.copper, 200);
conditionWave = 15;
zoneRequirements = new Zone[]{groundZero};
blockRequirements = new Block[]{Blocks.copperWall};
rules = () -> new Rules(){{
waves = true;
waveTimer = true;
waveSpacing = 60 * 80;
}};
}};
impact = new Zone("impact", new MapGenerator("groundZero", 1)){{ //TODO implement
deployCost = ItemStack.with(Items.copper, 300);
startingItems = ItemStack.with(Items.copper, 200);
conditionWave = 15;
zoneRequirements = new Zone[]{groundZero};
blockRequirements = new Block[]{Blocks.copperWall};
rules = () -> new Rules(){{
waves = true;
waveTimer = true;
waveSpacing = 60 * 80;
}};
}};
desolateRift = new Zone("desolateRift", new MapGenerator("groundZero", 1)){{ //TODO implement
deployCost = ItemStack.with(Items.copper, 300);
startingItems = ItemStack.with(Items.copper, 200);
conditionWave = 15;
zoneRequirements = new Zone[]{groundZero};
blockRequirements = new Block[]{Blocks.copperWall};
rules = () -> new Rules(){{
waves = true;
waveTimer = true;
waveSpacing = 60 * 80;
}};
}};
arcticDesert = new Zone("arcticDesert", new MapGenerator("groundZero", 1)){{ //TODO implement
deployCost = ItemStack.with(Items.copper, 300);
startingItems = ItemStack.with(Items.copper, 200);
conditionWave = 15;
zoneRequirements = new Zone[]{groundZero};
blockRequirements = new Block[]{Blocks.copperWall};
rules = () -> new Rules(){{
waves = true;
waveTimer = true;
waveSpacing = 60 * 80;
}};
}};
dryWastes = new Zone("dryWastes", new MapGenerator("groundZero", 1)){{ //TODO implement
deployCost = ItemStack.with(Items.copper, 300);
startingItems = ItemStack.with(Items.copper, 200);
conditionWave = 15;
zoneRequirements = new Zone[]{groundZero};
blockRequirements = new Block[]{Blocks.copperWall};
rules = () -> new Rules(){{
waves = true;
waveTimer = true;
waveSpacing = 60 * 80;
}};
}};
nuclearComplex = new Zone("nuclearComplex", new MapGenerator("groundZero", 1)){{ //TODO implement
deployCost = ItemStack.with(Items.copper, 300);
startingItems = ItemStack.with(Items.copper, 200);
conditionWave = 15;
zoneRequirements = new Zone[]{groundZero};
blockRequirements = new Block[]{Blocks.copperWall};
rules = () -> new Rules(){{
waves = true;
waveTimer = true;
waveSpacing = 60 * 80;
}};
}};
moltenFault = new Zone("moltenFault", new MapGenerator("groundZero", 1)){{ //TODO implement
deployCost = ItemStack.with(Items.copper, 300);
startingItems = ItemStack.with(Items.copper, 200);
conditionWave = 15;
zoneRequirements = new Zone[]{groundZero};
blockRequirements = new Block[]{Blocks.copperWall};
rules = () -> new Rules(){{
waves = true;
waveTimer = true;
waveSpacing = 60 * 80;
}};
}};
}
}

View File

@ -64,7 +64,7 @@ public class UI implements ApplicationListener{
public TraceDialog traces;
public ChangelogDialog changelog;
public LocalPlayerDialog localplayers;
public UnlocksDialog unlocks;
public DatabaseDialog unlocks;
public ContentInfoDialog content;
public DeployDialog deploy;
public TechTreeDialog tech;
@ -165,7 +165,7 @@ public class UI implements ApplicationListener{
load = new LoadDialog();
levels = new CustomGameDialog();
language = new LanguageDialog();
unlocks = new UnlocksDialog();
unlocks = new DatabaseDialog();
settings = new SettingsMenuDialog();
host = new HostDialog();
paused = new PausedDialog();

View File

@ -69,6 +69,10 @@ public class MapGenerator extends Generator{
for(int x = 0; x < data.width(); x++){
for(int y = 0; y < data.height(); y++){
if(Mathf.chance(0.05) && tiles[x][y].floor() == Blocks.stone && tiles[x][y].block() == Blocks.air){
tiles[x][y].setBlock(Blocks.rock);
}
final double scl = 10;
final int mag = 3;
int newX = Mathf.clamp((int)(simplex.octaveNoise2D(1, 1, 1.0 / scl, x, y) * mag + x), 0, data.width()-1);

View File

@ -18,6 +18,7 @@ public class Zone extends UnlockableContent{
public ItemStack[] startingItems = {};
public Block[] blockRequirements = {};
public ItemStack[] itemRequirements = {};
public Zone[] zoneRequirements = {};
public Supplier<Rules> rules = Rules::new;
public boolean alwaysUnlocked;
public int conditionWave = Integer.MAX_VALUE;

View File

@ -15,10 +15,10 @@ import io.anuke.arc.scene.utils.UIUtils;
import static io.anuke.mindustry.Vars.*;
public class UnlocksDialog extends FloatingDialog{
public class DatabaseDialog extends FloatingDialog{
public UnlocksDialog(){
super("$unlocks");
public DatabaseDialog(){
super("database");
shouldPause = true;
addCloseButton();
@ -58,7 +58,7 @@ public class UnlocksDialog extends FloatingDialog{
if(unlock.isHidden()) continue;
Image image = data.isUnlocked(unlock) ? new Image(unlock.getContentIcon()) : new Image("icon-locked");
Image image = data.isUnlocked(unlock) ? new Image(unlock.getContentIcon()) : new Image("icon-tree-locked");
image.addListener(new HandCursorListener());
list.add(image).size(size).pad(3);

View File

@ -2,8 +2,8 @@ package io.anuke.mindustry.ui.dialogs;
import io.anuke.arc.Core;
import io.anuke.arc.collection.ObjectIntMap;
import io.anuke.arc.scene.ui.TextButton;
import io.anuke.arc.scene.ui.layout.Table;
import io.anuke.mindustry.Vars;
import io.anuke.mindustry.core.GameState.State;
import io.anuke.mindustry.io.SaveIO.SaveException;
import io.anuke.mindustry.type.Item;
@ -32,7 +32,7 @@ public class DeployDialog extends FloatingDialog{
top().left().margin(10);
ObjectIntMap<Item> items = data.items();
for(Item item : Vars.content.items()){
for(Item item : content.items()){
if(item.type == ItemType.material && data.isUnlocked(item)){
label(() -> items.get(item, 0) + "").left();
addImage(item.region).size(8*4).pad(4);
@ -45,23 +45,31 @@ public class DeployDialog extends FloatingDialog{
if(control.saves.getZoneSlot() == null){
for(Zone zone : Vars.content.zones()){
if(data.isUnlocked(zone)){
table(t -> {
t.addButton(zone.localizedName(), () -> {
data.removeItems(zone.deployCost);
hide();
world.playZone(zone);
}).size(150f).disabled(b -> !data.hasItems(zone.deployCost));
t.row();
t.table(req -> {
req.left();
for(ItemStack stack : zone.deployCost){
req.addImage(stack.item.region).size(8 * 3);
req.add(stack.amount + "").left();
}
}).pad(3).growX();
}).pad(3);
int i = 0;
for(Zone zone : content.zones()){
table(t -> {
TextButton button = t.addButton(zone.localizedName(), () -> {
data.removeItems(zone.deployCost);
hide();
world.playZone(zone);
}).size(150f).disabled(b -> !data.hasItems(zone.deployCost) || !data.isUnlocked(zone)).get();
button.row();
button.table(req -> {
for(ItemStack stack : zone.deployCost){
req.addImage(stack.item.region).size(8 * 3);
req.add(stack.amount + "").left();
}
}).pad(3).growX();
button.row();
button.addImage("icon-zone-locked").visible(() -> !data.isUnlocked(zone));
button.update(() -> button.setText(data.isUnlocked(zone) ? zone.localizedName() : "???"));
}).pad(3);
if(++i % 4 == 0){
row();
}
}
}else{

View File

@ -169,7 +169,7 @@ public class TechTreeDialog extends FloatingDialog{
button.tapped(() -> moved = false);
button.setSize(nodeSize, nodeSize);
button.update(() -> {
button.setPosition(node.x + panX + width/2f, node.y + panY + height/2f - 0.5f, Align.center);
button.setPosition(node.x + panX + width/2f, node.y + panY + height/2f, Align.center);
button.getStyle().up = Core.scene.skin.getDrawable(!locked(node) ? "content-background" : "content-background-locked");
((TextureRegionDrawable)button.getStyle().imageUp)
.setRegion(node.visible ? node.node.block.icon(Icon.medium) : Core.atlas.find("icon-tree-locked"));

View File

@ -127,12 +127,6 @@ public class MenuFragment extends Fragment{
out.row();
out.add(new MenuButton("icon-menu", "$changelog.title", ui.changelog::show));
out.add(new MenuButton("icon-unlocks", "$unlocks", ui.unlocks::show));
out.row();
out.add(new MenuButton("icon-exit", "$quit", Core.app::exit)).width(bw).colspan(2);
});
}