mirror of
https://github.com/Anuken/Mindustry.git
synced 2025-02-22 12:38:05 +07:00
This commit is contained in:
parent
49e4aaa49b
commit
aebd3f959f
@ -297,6 +297,8 @@ wave.waveInProgress = [lightgray]Wave in progress
|
||||
waiting = [lightgray]Waiting...
|
||||
waiting.players = Waiting for players...
|
||||
wave.enemies = [lightgray]{0} Enemies Remaining
|
||||
wave.enemycores = [accent]{0}[lightgray] Enemy Cores
|
||||
wave.enemycore = [accent]{0}[lightgray] Enemy Core
|
||||
wave.enemy = [lightgray]{0} Enemy Remaining
|
||||
wave.guardianwarn = Guardian approaching in [accent]{0}[] waves.
|
||||
wave.guardianwarn.one = Guardian approaching in [accent]{0}[] wave.
|
||||
|
@ -247,7 +247,7 @@ public class BlockIndexer{
|
||||
for(int i = 0; i < activeTeams.size; i++){
|
||||
Team enemy = activeTeams.items[i];
|
||||
|
||||
if(enemy == team) continue;
|
||||
if(enemy == team || team == Team.derelict) continue;
|
||||
|
||||
Building entity = indexer.findTile(enemy, x, y, range, pred, true);
|
||||
if(entity != null){
|
||||
@ -276,10 +276,7 @@ public class BlockIndexer{
|
||||
for(int ty = ry * quadrantSize; ty < (ry + 1) * quadrantSize && ty < world.height(); ty++){
|
||||
Building e = world.build(tx, ty);
|
||||
|
||||
if(e == null) continue;
|
||||
|
||||
if(e.team != team || !pred.get(e) || !e.block.targetable)
|
||||
continue;
|
||||
if(e == null || e.team != team || !pred.get(e) || !e.block.targetable || e.team == Team.derelict) continue;
|
||||
|
||||
float ndst = e.dst2(x, y);
|
||||
if(ndst < range2 && (closest == null ||
|
||||
|
@ -197,7 +197,7 @@ public class Units{
|
||||
cdist = 0f;
|
||||
|
||||
nearbyEnemies(team, x - range, y - range, range*2f, range*2f, e -> {
|
||||
if(e.dead() || !predicate.get(e)) return;
|
||||
if(e.dead() || !predicate.get(e) || e.team == Team.derelict) return;
|
||||
|
||||
float dst2 = e.dst2(x, y);
|
||||
if(dst2 < range*range && (result == null || dst2 < cdist)){
|
||||
|
@ -1371,6 +1371,10 @@ abstract class BuildingComp implements Posc, Teamc, Healthc, Buildingc, Timerc,
|
||||
}
|
||||
}
|
||||
|
||||
if(team == Team.derelict){
|
||||
enabled = false;
|
||||
}
|
||||
|
||||
if(!headless){
|
||||
if(sound != null){
|
||||
sound.update(x, y, shouldActiveSound());
|
||||
|
@ -109,6 +109,8 @@ public class AIController implements UnitController{
|
||||
target = null;
|
||||
}
|
||||
|
||||
unit.isShooting = false;
|
||||
|
||||
for(int i = 0; i < targets.length; i++){
|
||||
WeaponMount mount = unit.mounts[i];
|
||||
Weapon weapon = mount.weapon;
|
||||
@ -140,6 +142,8 @@ public class AIController implements UnitController{
|
||||
|
||||
mount.shoot = shoot;
|
||||
mount.rotate = shoot;
|
||||
|
||||
unit.isShooting |= shoot;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -79,16 +79,13 @@ public class MobileInput extends InputHandler implements GestureListener{
|
||||
Unit unit = Units.closestEnemy(player.team(), x, y, 20f, u -> !u.dead);
|
||||
|
||||
if(unit != null){
|
||||
player.miner().mineTile(null);
|
||||
player.unit().mineTile = null;
|
||||
target = unit;
|
||||
}else{
|
||||
Building tile = world.buildWorld(x, y);
|
||||
|
||||
if(tile != null && player.team().isEnemy(tile.team)){
|
||||
player.miner().mineTile(null);
|
||||
target = tile;
|
||||
}else if(tile != null && player.unit().type.canHeal && tile.team == player.team() && tile.damaged()){
|
||||
player.miner().mineTile(null);
|
||||
if((tile != null && player.team().isEnemy(tile.team) && tile.team != Team.derelict) || (tile != null && player.unit().type.canHeal && tile.team == player.team() && tile.damaged())){
|
||||
player.unit().mineTile = null;
|
||||
target = tile;
|
||||
}
|
||||
}
|
||||
|
@ -139,7 +139,7 @@ public class ItemSeq implements Iterable<ItemStack>, Serializable{
|
||||
|
||||
@Override
|
||||
public String toString(){
|
||||
return JsonIO.write(this);
|
||||
return JsonIO.print(JsonIO.write(this));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -59,10 +59,12 @@ public class ResearchDialog extends BaseDialog{
|
||||
//add global counts of each sector
|
||||
for(Planet planet : content.planets()){
|
||||
for(Sector sector : planet.sectors){
|
||||
if(sector.hasSave()){
|
||||
if(sector.hasSave() && sector.hasBase()){
|
||||
ItemSeq cached = sector.items();
|
||||
add(cached);
|
||||
cache.put(sector, cached);
|
||||
cached.each((item, amount) -> {
|
||||
values[item.id] += amount;
|
||||
total += amount;
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -486,12 +486,17 @@ public class SettingsMenuDialog extends SettingsDialog{
|
||||
throw new IllegalArgumentException("Not valid save data.");
|
||||
}
|
||||
|
||||
//delete old saves so they don't interfere
|
||||
saveDirectory.deleteDirectory();
|
||||
|
||||
//purge existing tmp data, keep everything else
|
||||
tmpDirectory.deleteDirectory();
|
||||
|
||||
zipped.walk(f -> f.copyTo(base.child(f.path())));
|
||||
dest.delete();
|
||||
|
||||
//clear old data
|
||||
settings.clear();
|
||||
//load data so it's saved on exit
|
||||
settings.load();
|
||||
}
|
||||
|
@ -203,15 +203,13 @@ public class HudFragment extends Fragment{
|
||||
}else{
|
||||
logic.skipWave();
|
||||
}
|
||||
}).growY().fillX().right().width(40f).disabled(b -> !canSkipWave())
|
||||
.visible(() -> state.rules.waves).name("skip");
|
||||
}).growY().fillX().right().width(40f).disabled(b -> !canSkipWave()).name("skip");
|
||||
}).width(dsize * 5 + 4f);
|
||||
|
||||
wavesMain.row();
|
||||
|
||||
wavesMain.table(Tex.button, t -> t.margin(10f).add(new Bar("boss.health", Pal.health, () -> state.boss() == null ? 0f : state.boss().healthf()).blink(Color.white))
|
||||
.grow()).fillX().visible(() -> state.rules.waves && state.boss() != null).height(60f).get()
|
||||
.name = "boss";
|
||||
.grow()).fillX().visible(() -> state.rules.waves && state.boss() != null).height(60f).name("boss");
|
||||
|
||||
wavesMain.row();
|
||||
|
||||
@ -244,7 +242,6 @@ public class HudFragment extends Fragment{
|
||||
info.name = "fps/ping";
|
||||
info.touchable = Touchable.disabled;
|
||||
info.top().left().margin(4).visible(() -> Core.settings.getBool("fps") && shown);
|
||||
info.update(() -> info.setTranslation(state.rules.waves || state.isEditor() ? 0f : -Scl.scl(dsize * 4 + 3), 0));
|
||||
IntFormat fps = new IntFormat("fps");
|
||||
IntFormat ping = new IntFormat("ping");
|
||||
IntFormat mem = new IntFormat("memory");
|
||||
@ -600,7 +597,7 @@ public class HudFragment extends Fragment{
|
||||
}
|
||||
|
||||
private Table makeStatusTable(){
|
||||
Button table = new Button(Styles.waveb);
|
||||
Table table = new Table(Tex.wavepane);
|
||||
|
||||
StringBuilder ibuild = new StringBuilder();
|
||||
|
||||
@ -608,6 +605,8 @@ public class HudFragment extends Fragment{
|
||||
IntFormat wavefc = new IntFormat("wave.cap");
|
||||
IntFormat enemyf = new IntFormat("wave.enemy");
|
||||
IntFormat enemiesf = new IntFormat("wave.enemies");
|
||||
IntFormat enemycf = new IntFormat("wave.enemycore");
|
||||
IntFormat enemycsf = new IntFormat("wave.enemycores");
|
||||
IntFormat waitingf = new IntFormat("wave.waiting", i -> {
|
||||
ibuild.setLength(0);
|
||||
int m = i/60;
|
||||
@ -623,7 +622,6 @@ public class HudFragment extends Fragment{
|
||||
return ibuild.toString();
|
||||
});
|
||||
|
||||
table.clearChildren();
|
||||
table.touchable = Touchable.enabled;
|
||||
|
||||
StringBuilder builder = new StringBuilder();
|
||||
@ -745,6 +743,13 @@ public class HudFragment extends Fragment{
|
||||
|
||||
table.labelWrap(() -> {
|
||||
builder.setLength(0);
|
||||
|
||||
if(!state.rules.waves && state.rules.attackMode){
|
||||
int sum = Math.max(state.teams.present.sum(t -> t.team != player.team() ? t.cores.size : 0), 1);
|
||||
builder.append(sum > 1 ? enemycsf.get(sum) : enemycf.get(sum));
|
||||
return builder;
|
||||
}
|
||||
|
||||
if(state.rules.winWave > 1 && state.rules.winWave >= state.wave && state.isCampaign()){
|
||||
builder.append(wavefc.get(state.wave, state.rules.winWave));
|
||||
}else{
|
||||
@ -770,8 +775,10 @@ public class HudFragment extends Fragment{
|
||||
return builder;
|
||||
}).growX().pad(8f);
|
||||
|
||||
table.setDisabled(true);
|
||||
table.visible(() -> state.rules.waves);
|
||||
table.update(() -> {
|
||||
//table.background(state.rules.waves ? Tex.wavepane : null);
|
||||
});
|
||||
table.touchable(() -> state.rules.waves ? Touchable.enabled : Touchable.disabled);
|
||||
|
||||
return table;
|
||||
}
|
||||
|
@ -10,6 +10,7 @@ import arc.util.io.*;
|
||||
import mindustry.annotations.Annotations.*;
|
||||
import mindustry.content.*;
|
||||
import mindustry.entities.units.*;
|
||||
import mindustry.game.*;
|
||||
import mindustry.gen.*;
|
||||
import mindustry.graphics.*;
|
||||
import mindustry.type.*;
|
||||
|
@ -147,7 +147,11 @@ public class LogicBlock extends Block{
|
||||
String name = stream.readUTF();
|
||||
short x = stream.readShort(), y = stream.readShort();
|
||||
|
||||
transformer.get(Tmp.p1.set(x, y));
|
||||
Tmp.p2.set((int)(offset / (tilesize/2)), (int)(offset / (tilesize/2)));
|
||||
transformer.get(Tmp.p1.set(x * 2, y * 2).sub(Tmp.p2));
|
||||
Tmp.p1.add(Tmp.p2);
|
||||
Tmp.p1.x /= 2;
|
||||
Tmp.p1.y /= 2;
|
||||
links.add(new LogicLink(Tmp.p1.x, Tmp.p1.y, name, true));
|
||||
}
|
||||
|
||||
|
@ -1,3 +1,3 @@
|
||||
org.gradle.daemon=true
|
||||
org.gradle.jvmargs=-Xms256m -Xmx1024m
|
||||
archash=ebc3ce51dadc2aec4b5e5799d5d4d712b9681422
|
||||
archash=c3f584d2d17fe0a91798565b73ea4d72ad312abf
|
||||
|
Loading…
Reference in New Issue
Block a user