Various tweaks and bugfixes

This commit is contained in:
Anuken
2020-11-22 21:20:33 -05:00
parent 3db2fea32b
commit ecea8eab01
27 changed files with 9363 additions and 9208 deletions

View File

@@ -45,7 +45,7 @@ public class BuilderAI extends AIController{
BuildPlan req = unit.buildPlan();
boolean valid =
(req.tile().build instanceof ConstructBuild && req.tile().<ConstructBuild>bc().cblock == req.block) ||
(req.tile() != null && req.tile().build instanceof ConstructBuild && req.tile().<ConstructBuild>bc().cblock == req.block) ||
(req.breaking ?
Build.validBreak(unit.team(), req.x, req.y) :
Build.validPlace(req.block, unit.team(), req.x, req.y, req.rotation));

View File

@@ -39,7 +39,7 @@ public class Blocks implements ContentList{
//environment
air, spawn, cliff, deepwater, water, taintedWater, tar, slag, stone, craters, charr, sand, darksand, dirt, mud, ice, snow, darksandTaintedWater, space,
dacite, stoneWall, dirtWall, sporeWall, iceWall, daciteWall, sporePine, snowPine, pine, shrubs, whiteTree, whiteTreeDead, sporeCluster,
iceSnow, sandWater, darksandWater, duneWall, sandWall, moss, sporeMoss, shale, shaleWall, shaleBoulder, sandBoulder, daciteBoulder, boulder, snowBoulder, grass, salt,
iceSnow, sandWater, darksandWater, duneWall, sandWall, moss, sporeMoss, shale, shaleWall, shaleBoulder, sandBoulder, daciteBoulder, boulder, snowBoulder, basaltBoulder, grass, salt,
metalFloor, metalFloorDamaged, metalFloor2, metalFloor3, metalFloor5, basalt, magmarock, hotrock, snowWall, saltWall,
darkPanel1, darkPanel2, darkPanel3, darkPanel4, darkPanel5, darkPanel6, darkMetal,
pebbles, tendrils,
@@ -415,6 +415,10 @@ public class Blocks implements ContentList{
variants = 2;
}};
basaltBoulder = new Boulder("basalt-boulder"){{
variants = 2;
}};
moss = new Floor("moss"){{
variants = 3;
attributes.set(Attribute.spores, 0.15f);
@@ -1153,7 +1157,7 @@ public class Blocks implements ContentList{
}};
battery = new Battery("battery"){{
requirements(Category.power, with(Items.copper, 4, Items.lead, 20));
requirements(Category.power, with(Items.copper, 5, Items.lead, 20));
consumes.powerBuffered(4000f);
}};
@@ -1354,7 +1358,7 @@ public class Blocks implements ContentList{
//region storage
coreShard = new CoreBlock("core-shard"){{
requirements(Category.effect, BuildVisibility.editorOnly, with(Items.copper, 1000, Items.lead, 1000));
requirements(Category.effect, BuildVisibility.editorOnly, with(Items.copper, 1000, Items.lead, 800));
alwaysUnlocked = true;
unitType = UnitTypes.alpha;

View File

@@ -58,6 +58,7 @@ public enum Binding implements KeyBind{
fullscreen(KeyCode.f11),
pause(KeyCode.space),
minimap(KeyCode.m),
research(KeyCode.b),
planet_map(KeyCode.n),
toggle_menus(KeyCode.c),
screenshot(KeyCode.p),

View File

@@ -240,6 +240,7 @@ public class DesktopInput extends InputHandler{
if(state.isGame() && !scene.hasDialog() && !(scene.getKeyboardFocus() instanceof TextField)){
if(Core.input.keyTap(Binding.minimap)) ui.minimapfrag.toggle();
if(Core.input.keyTap(Binding.planet_map) && state.isCampaign()) ui.planet.toggle();
if(Core.input.keyTap(Binding.research) && state.isCampaign()) ui.research.toggle();
}
if(state.isMenu() || Core.scene.hasDialog()) return;

View File

@@ -302,6 +302,14 @@ public class Maps{
flooronto = Blocks.sand;
block = Blocks.sandBoulder;
}},
new ScatterFilter(){{
flooronto = Blocks.darksand;
block = Blocks.basaltBoulder;
}},
new ScatterFilter(){{
flooronto = Blocks.basalt;
block = Blocks.basaltBoulder;
}},
new ScatterFilter(){{
flooronto = Blocks.dacite;
block = Blocks.daciteBoulder;

View File

@@ -7,7 +7,7 @@ import mindustry.world.*;
import static mindustry.maps.filters.FilterOption.*;
public class ScatterFilter extends GenerateFilter{
protected float chance = 0.014f;
protected float chance = 0.013f;
protected Block flooronto = Blocks.air, floor = Blocks.air, block = Blocks.air;
@Override

View File

@@ -22,6 +22,7 @@ import mindustry.game.*;
import mindustry.gen.*;
import mindustry.graphics.*;
import mindustry.graphics.g3d.*;
import mindustry.input.*;
import mindustry.maps.*;
import mindustry.type.*;
import mindustry.ui.*;
@@ -60,7 +61,7 @@ public class PlanetDialog extends BaseDialog implements PlanetInterfaceRenderer{
shouldPause = true;
keyDown(key -> {
if(key == KeyCode.escape || key == KeyCode.back){
if(key == KeyCode.escape || key == KeyCode.back || key == Core.keybinds.get(Binding.planet_map).key){
if(showing() && newPresets.size > 1){
//clear all except first, which is the last sector.
newPresets.truncate(1);
@@ -684,7 +685,7 @@ public class PlanetDialog extends BaseDialog implements PlanetInterfaceRenderer{
if(sector.info.wavesSurvived >= 0 && sector.info.wavesSurvived - sector.info.wavesPassed >= 0 && !sector.isBeingPlayed()){
int toCapture = sector.info.attack || sector.info.winWave <= 1 ? -1 : sector.info.winWave - (sector.info.wave + sector.info.wavesPassed);
boolean plus = (sector.info.wavesSurvived - sector.info.wavesPassed) >= SectorDamage.maxRetWave - 1;
stable.add(Core.bundle.format("sectors.survives", Math.min(sector.info.wavesSurvived - sector.info.wavesPassed, toCapture <= 0 ? 200 : 0) +
stable.add(Core.bundle.format("sectors.survives", Math.min(sector.info.wavesSurvived - sector.info.wavesPassed, toCapture <= 0 ? 200 : toCapture) +
(plus ? "+" : "") + (toCapture < 0 ? "" : "/" + toCapture)));
stable.row();
}

View File

@@ -21,6 +21,7 @@ import mindustry.game.EventType.*;
import mindustry.game.Objectives.*;
import mindustry.gen.*;
import mindustry.graphics.*;
import mindustry.input.*;
import mindustry.type.*;
import mindustry.ui.*;
import mindustry.ui.layout.*;
@@ -114,6 +115,12 @@ public class ResearchDialog extends BaseDialog{
addCloseButton();
keyDown(key -> {
if(key == Core.keybinds.get(Binding.research).key){
Core.app.post(this::hide);
}
});
buttons.button("@database", Icon.book, () -> {
hide();
ui.database.show();

View File

@@ -396,7 +396,7 @@ public class SettingsMenuDialog extends SettingsDialog{
graphics.checkPref("blockstatus", false);
graphics.checkPref("playerchat", true);
if(!mobile){
graphics.checkPref("coreitems", false);
graphics.checkPref("coreitems", true);
}
graphics.checkPref("minimap", !mobile);
graphics.checkPref("smoothcamera", true);

View File

@@ -50,7 +50,9 @@ public class HintsFragment extends Fragment{
}else if(hints.size > 0){
//check one hint each frame to see if it should be shown.
Hint hint = hints.find(Hint::show);
if(hint != null && !hint.finished() & !hint.complete()){
if(hint != null && hint.complete()){
hints.remove(hint);
}else if(hint != null){
display(hint);
}
}
@@ -79,7 +81,7 @@ public class HintsFragment extends Fragment{
void checkNext(){
if(current != null) return;
hints.removeAll(h -> h == current || !h.valid() || h.finished() || (h.show() && h.complete()));
hints.removeAll(h -> !h.valid() || h.finished() || (h.show() && h.complete()));
hints.sort(Hint::order);
Hint first = hints.find(Hint::show);
@@ -158,6 +160,7 @@ public class HintsFragment extends Fragment{
payloadPickup(() -> !player.unit().dead && player.unit() instanceof Payloadc p && p.payloads().isEmpty(), () -> player.unit() instanceof Payloadc p && p.payloads().any()),
payloadDrop(() -> !player.unit().dead && player.unit() instanceof Payloadc p && p.payloads().any(), () -> player.unit() instanceof Payloadc p && p.payloads().isEmpty()),
waveFire(() -> Groups.fire.size() > 0 && Blocks.wave.unlockedNow(), () -> indexer.getAllied(state.rules.defaultTeam, BlockFlag.extinguisher).size() > 0),
generator(() -> control.input.block == Blocks.combustionGenerator, () -> ui.hints.placedBlocks.contains(Blocks.combustionGenerator)),
;
@Nullable