This commit is contained in:
Anuken
2020-09-16 16:04:11 -04:00
parent 5c98512e4f
commit 030542890e
8 changed files with 25 additions and 9 deletions

View File

@@ -12,8 +12,8 @@ public class RepairAI extends AIController{
boolean shoot = false;
if(target != null){
if(!target.within(unit, unit.type().range)){
moveTo(target, unit.type().range * 0.9f);
if(!target.within(unit, unit.type().range * 0.8f)){
moveTo(target, unit.type().range * 0.8f);
}else{
unit.aim(target);
shoot = true;

View File

@@ -327,7 +327,7 @@ public class Blocks implements ContentList{
duneWall = new StaticWall("dune-wall"){{
variants = 2;
basalt.asFloor().wall = this;
basalt.asFloor().wall = darksandWater.asFloor().wall = darksandTaintedWater.asFloor().wall = this;
}};
sandWall = new StaticWall("sand-wall"){{
@@ -1645,7 +1645,7 @@ public class Blocks implements ContentList{
}};
spectre = new ItemTurret("spectre"){{
requirements(Category.turret, with(Items.copper, 350, Items.graphite, 300, Items.surgealloy, 250, Items.plastanium, 175, Items.thorium, 250));
requirements(Category.turret, with(Items.copper, 900, Items.graphite, 300, Items.surgealloy, 250, Items.plastanium, 175, Items.thorium, 250));
ammo(
Items.graphite, Bullets.standardDenseBig,
Items.pyratite, Bullets.standardIncendiaryBig,
@@ -1671,7 +1671,7 @@ public class Blocks implements ContentList{
}};
meltdown = new LaserTurret("meltdown"){{
requirements(Category.turret, with(Items.copper, 250, Items.lead, 350, Items.graphite, 300, Items.surgealloy, 325, Items.silicon, 325));
requirements(Category.turret, with(Items.copper, 1200, Items.lead, 350, Items.graphite, 300, Items.surgealloy, 325, Items.silicon, 325));
shootEffect = Fx.shootBigSmoke2;
shootCone = 40f;
recoilAmount = 4f;

View File

@@ -33,11 +33,17 @@ public class World{
public @NonNull Tiles tiles = new Tiles(0, 0);
private boolean generating, invalidMap;
private ObjectMap<Map, Runnable> customMapLoaders = new ObjectMap<>();
public World(){
}
/** Adds a custom handler function for loading a custom map - usually a generated one. */
public void addMapLoader(Map map, Runnable loader){
customMapLoaders.put(map, loader);
}
public boolean isInvalidMap(){
return invalidMap;
}
@@ -270,6 +276,12 @@ public class World{
}
public void loadMap(Map map, Rules checkRules){
//load using custom loader if possible
if(customMapLoaders.containsKey(map)){
customMapLoaders.get(map).run();
return;
}
try{
SaveIO.load(map.file, new FilterContext(map));
}catch(Throwable e){

View File

@@ -2,7 +2,6 @@ package mindustry.editor;
import arc.func.*;
import arc.util.ArcAnnotate.*;
import arc.util.*;
import mindustry.content.*;
import mindustry.editor.DrawOperation.*;
import mindustry.game.*;
@@ -47,6 +46,11 @@ public class EditorTile extends Tile{
return;
}
//if(this.block == type && (build == null || build.rotation == rotation)){
// ui.editor.editor.renderer().updatePoint(x, y);
// return;
//}
if(rotation != 0) op(OpType.rotation, (byte)rotation);
if(team() != Team.derelict) op(OpType.team, (byte)team().id);
op(OpType.block, block.id);

View File

@@ -130,7 +130,7 @@ public class Map implements Comparable<Map>, Publishable{
}
public String tag(String name){
return tags.containsKey(name) && !tags.get(name).trim().isEmpty() ? tags.get(name) : Core.bundle.get("unknown");
return tags.containsKey(name) && !tags.get(name).trim().isEmpty() ? tags.get(name) : Core.bundle.get("unknown", "unknown");
}
public boolean hasTag(String name){

View File

@@ -59,6 +59,7 @@ public class Maps{
/** @return the next map to shuffle to. May be null, in which case the server should be stopped. */
public @Nullable Map getNextMap(Gamemode mode, @Nullable Map previous){
if(shuffler != null) return shuffler.next(mode, previous);
return shuffleMode.next(mode, previous);
}

View File

@@ -57,7 +57,7 @@ public class ChatFragment extends Table{
}
}
return net.active();
return net.active() && ui.hudfrag.shown();
});
update(() -> {