New preset / Indication of vulnerable sectors

This commit is contained in:
Anuken
2020-11-10 13:47:55 -05:00
parent f0c4ebfd31
commit ddc2cc7098
14 changed files with 61 additions and 19 deletions

View File

@@ -10,7 +10,7 @@ public class SectorPresets implements ContentList{
groundZero,
craters, frozenForest, ruinousShores, stainedMountains, tarFields, fungalPass,
saltFlats, overgrowth,
desolateRift, nuclearComplex;
impact0078, desolateRift, nuclearComplex;
@Override
public void load(){
@@ -55,17 +55,22 @@ public class SectorPresets implements ContentList{
}};
tarFields = new SectorPreset("tarFields", serpulo, 23){{
captureWave = 50;
captureWave = 40;
difficulty = 5;
}};
impact0078 = new SectorPreset("impact0078", serpulo, 227){{
captureWave = 45;
difficulty = 7;
}};
desolateRift = new SectorPreset("desolateRift", serpulo, 123){{
captureWave = 40;
captureWave = 30;
difficulty = 8;
}};
nuclearComplex = new SectorPreset("nuclearComplex", serpulo, 130){{
captureWave = 60;
captureWave = 50;
difficulty = 7;
}};
}

View File

@@ -479,19 +479,25 @@ public class TechTree implements ContentList{
new Research(kiln),
new Research(mechanicalPump)
), () -> {
node(tarFields, Seq.with(
new SectorComplete(ruinousShores),
new Research(coalCentrifuge),
new Research(conduit),
new Research(wave)
), () -> {
node(desolateRift, Seq.with(
//TODO change positions?
node(impact0078, Seq.with(
new SectorComplete(tarFields),
new Research(thermalGenerator),
new Research(thoriumReactor)
new Research(Items.thorium),
new Research(overdriveProjector)
), () -> {
node(desolateRift, Seq.with(
new SectorComplete(impact0078),
new Research(thermalGenerator),
new Research(thoriumReactor)
), () -> {
});
});
});

View File

@@ -12,7 +12,6 @@ import arc.util.*;
import mindustry.audio.*;
import mindustry.content.*;
import mindustry.core.GameState.*;
import mindustry.ctype.*;
import mindustry.entities.*;
import mindustry.game.EventType.*;
import mindustry.game.*;
@@ -406,6 +405,10 @@ public class Control implements ApplicationListener, Loadable{
}
}
for(Music music : assets.getAll(Music.class, new Seq<>())){
music.stop();
}
content.dispose();
net.dispose();
Musics.dispose();

View File

@@ -334,6 +334,9 @@ public class Saves{
}
public void delete(){
if(SaveIO.backupFileFor(file).exists()){
SaveIO.backupFileFor(file).delete();
}
file.delete();
saves.remove(this, true);
if(this == current){

View File

@@ -177,17 +177,23 @@ public class PlanetRenderer implements Disposable{
}
public void drawArc(Planet planet, Vec3 a, Vec3 b){
drawArc(planet, a, b, Pal.accent, Color.clear, 1f);
}
public void drawArc(Planet planet, Vec3 a, Vec3 b, Color from, Color to, float length){
drawArc(planet, a, b, from, to, length, 80f, 25);
}
public void drawArc(Planet planet, Vec3 a, Vec3 b, Color from, Color to, float length, float timeScale, int pointCount){
Vec3 avg = Tmp.v31.set(b).add(a).scl(0.5f);
avg.setLength(planet.radius*2f);
avg.setLength(planet.radius*(1f+length));
points.clear();
points.addAll(Tmp.v33.set(b).setLength(outlineRad), Tmp.v31, Tmp.v34.set(a).setLength(outlineRad));
Tmp.bz3.set(points);
float points = 25;
for(int i = 0; i < points + 1; i++){
float f = i / points;
Tmp.c1.set(Pal.accent).lerp(Color.clear, (f+Time.globalTime()/80f)%1f);
for(int i = 0; i < pointCount + 1; i++){
float f = i / (float)pointCount;
Tmp.c1.set(from).lerp(to, (f+Time.globalTime()/timeScale)%1f);
batch.color(Tmp.c1);
batch.vertex(Tmp.bz3.valueAt(Tmp.v32, f));

View File

@@ -160,7 +160,7 @@ public class PlanetDialog extends BaseDialog implements PlanetInterfaceRenderer{
if(canSelect(sec) || sec.unlocked()){
Color color =
sec.hasBase() ? Team.sharded.color :
sec.hasBase() ? Tmp.c2.set(Team.sharded.color).lerp(Team.crux.color, sec.hasEnemyBase() ? 0.5f : 0f) :
sec.preset != null ? Team.derelict.color :
sec.hasEnemyBase() ? Team.crux.color :
null;
@@ -202,6 +202,16 @@ public class PlanetDialog extends BaseDialog implements PlanetInterfaceRenderer{
}
}
for(Sector sec : planet.sectors){
if(sec.hasBase()){
for(Sector enemy : sec.near()){
if(enemy.hasEnemyBase()){
planets.drawArc(planet, enemy.tile.v, sec.tile.v, Team.crux.color, Color.clear, 0.24f, 110f, 25);
}
}
}
}
/*
//TODO render arcs
if(selected != null && selected.preset != null){
@@ -391,6 +401,9 @@ public class PlanetDialog extends BaseDialog implements PlanetInterfaceRenderer{
(plus ? "+" : "") + (toCapture < 0 ? "" : "/" + toCapture) + " waves");
stable.row();
}
}else if(sector.hasBase() && sector.near().contains(Sector::hasEnemyBase)){
stable.add("[scarlet]Vulnerable");
stable.row();
}
if(sector.save != null && sector.info.resources.any()){

View File

@@ -146,6 +146,12 @@ public class SettingsMenuDialog extends SettingsDialog{
}
}
}
for(var slot : control.saves.getSaveSlots().copy()){
if(slot.isSector()){
slot.delete();
}
}
});
}).marginLeft(4);

View File

@@ -177,7 +177,7 @@ public class ItemTurret extends Turret{
totalAmmo += a;
//only add ammo if this is a valid ammo type
if(ammoTypes.containsKey(item)){
if(item != null && ammoTypes.containsKey(item)){
ammo.add(new ItemEntry(item, a));
}
}

View File

@@ -210,7 +210,7 @@ public class CoreBlock extends StorageBlock{
super.onDestroyed();
//add a spawn to the map for future reference - waves should be disabled, so it shouldn't matter
if(state.isCampaign() && team == state.rules.waveTeam){
if(state.isCampaign() && team == state.rules.waveTeam && team.cores().size <= 1){
//do not recache
tile.setOverlayQuiet(Blocks.spawn);