From 8d6cac39d034347e3e11124650b673294ebda244 Mon Sep 17 00:00:00 2001 From: Anuken Date: Fri, 15 Jul 2022 19:26:23 -0400 Subject: [PATCH] Fixed #7178 / Maps renamed --- core/assets/bundles/bundle.properties | 14 ++-- core/assets/maps/{two.msav => aegis.msav} | Bin core/assets/maps/{four.msav => basin.msav} | Bin .../maps/{three.msav => intersect.msav} | Bin .../src/mindustry/content/ErekirTechTree.java | 62 +++++++++--------- core/src/mindustry/content/SectorPresets.java | 9 ++- core/src/mindustry/game/MapObjectives.java | 2 + core/src/mindustry/io/JsonIO.java | 14 +++- core/src/mindustry/io/SaveIO.java | 1 + 9 files changed, 59 insertions(+), 43 deletions(-) rename core/assets/maps/{two.msav => aegis.msav} (100%) rename core/assets/maps/{four.msav => basin.msav} (100%) rename core/assets/maps/{three.msav => intersect.msav} (100%) diff --git a/core/assets/bundles/bundle.properties b/core/assets/bundles/bundle.properties index b895e0687f..46c093675e 100644 --- a/core/assets/bundles/bundle.properties +++ b/core/assets/bundles/bundle.properties @@ -740,14 +740,20 @@ sector.impact0078.description = Here lie remnants of the interstellar transport sector.planetaryTerminal.description = The final target.\n\nThis coastal base contains a structure capable of launching Cores to local planets. It is extremely well guarded.\n\nProduce naval units. Eliminate the enemy as quickly as possible. Research the launch structure. sector.onset.name = The Onset +sector.aegis.name = Aegis +sector.lake.name = Name +sector.intersect.name = Intersect +sector.atlas.name = Atlas +sector.split.name = Split +sector.basin.name = Basin + sector.onset.description = The tutorial sector. This objective has not been created yet. Await further information. -sector.two.description = The enemy is protected by shields. An experimental shield breaker module has been detected in this sector.\nLocate this structure. Supply it with tungsten ammunition and destroy the enemy base. +sector.aegis.description = The enemy is protected by shields. An experimental shield breaker module has been detected in this sector.\nLocate this structure. Supply it with tungsten ammunition and destroy the enemy base. sector.lake.description = This sector's slag lake greatly limits viable units. A hover unit is the only option.\nResearch the [accent]ship fabricator[] and produce an [accent]elude[] unit as soon as possible. -sector.three.description = Scans suggest that this sector will be attacked from multiple sides soon after landing.\nSet up defenses quickly and expand as soon as possible.\n[accent]Mech[] units will be required for the area's rough terrain. +sector.intersect.description = Scans suggest that this sector will be attacked from multiple sides soon after landing.\nSet up defenses quickly and expand as soon as possible.\n[accent]Mech[] units will be required for the area's rough terrain. sector.atlas.description = This sector contains varied terrain and will require a variety of units to attack effectively.\nUpgraded units may also be necessary to get past some of the tougher enemy bases detected here.\nResearch the [accent]Electrolyzer[] and the [accent]Tank Refabricator[]. sector.split.description = The minimal enemy presence in this sector makes it perfect for testing new transport tech. -sector.four.description = {Temporary}\n\nThe last sector for now. Consider this a challenge level! - +sector.basin.description = {Temporary}\n\nThe last sector for now. Consider this a challenge level - more sectors will be added in a later release. status.burning.name = Burning status.freezing.name = Freezing diff --git a/core/assets/maps/two.msav b/core/assets/maps/aegis.msav similarity index 100% rename from core/assets/maps/two.msav rename to core/assets/maps/aegis.msav diff --git a/core/assets/maps/four.msav b/core/assets/maps/basin.msav similarity index 100% rename from core/assets/maps/four.msav rename to core/assets/maps/basin.msav diff --git a/core/assets/maps/three.msav b/core/assets/maps/intersect.msav similarity index 100% rename from core/assets/maps/three.msav rename to core/assets/maps/intersect.msav diff --git a/core/src/mindustry/content/ErekirTechTree.java b/core/src/mindustry/content/ErekirTechTree.java index a9f7b76c68..f499f0f894 100644 --- a/core/src/mindustry/content/ErekirTechTree.java +++ b/core/src/mindustry/content/ErekirTechTree.java @@ -86,7 +86,7 @@ public class ErekirTechTree{ }); }); - node(overflowDuct, Seq.with(new OnSector(two)), () -> { + node(overflowDuct, Seq.with(new OnSector(aegis)), () -> { node(underflowDuct); node(reinforcedContainer, () -> { node(ductUnloader, () -> { @@ -134,8 +134,8 @@ public class ErekirTechTree{ //TODO move into turbine condenser? node(plasmaBore, () -> { - node(impactDrill, Seq.with(new OnSector(two)), () -> { - node(largePlasmaBore, Seq.with(new OnSector(four)), () -> { + node(impactDrill, Seq.with(new OnSector(aegis)), () -> { + node(largePlasmaBore, Seq.with(new OnSector(basin)), () -> { node(eruptionDrill, () -> { }); @@ -145,22 +145,22 @@ public class ErekirTechTree{ node(turbineCondenser, () -> { node(beamNode, () -> { - node(ventCondenser, Seq.with(new OnSector(two)), () -> { - node(chemicalCombustionChamber, Seq.with(new OnSector(four)), () -> { + node(ventCondenser, Seq.with(new OnSector(aegis)), () -> { + node(chemicalCombustionChamber, Seq.with(new OnSector(basin)), () -> { node(pyrolysisGenerator, () -> { }); }); }); - node(beamTower, Seq.with(new OnSector(four)), () -> { + node(beamTower, Seq.with(new OnSector(basin)), () -> { }); node(regenProjector, () -> { //TODO more tiers of build tower or "support" structures like overdrive projectors - node(buildTower, Seq.with(new OnSector(four)), () -> { + node(buildTower, Seq.with(new OnSector(basin)), () -> { node(shockwaveTower, () -> { }); @@ -168,9 +168,9 @@ public class ErekirTechTree{ }); }); - node(reinforcedConduit, Seq.with(new OnSector(two)), () -> { + node(reinforcedConduit, Seq.with(new OnSector(aegis)), () -> { //TODO maybe should be even later - node(reinforcedPump, Seq.with(new OnSector(four)), () -> { + node(reinforcedPump, Seq.with(new OnSector(basin)), () -> { //TODO T2 pump, consume cyanogen or similar }); @@ -181,7 +181,7 @@ public class ErekirTechTree{ node(reinforcedLiquidRouter, () -> { node(reinforcedLiquidContainer, () -> { - node(reinforcedLiquidTank, Seq.with(new SectorComplete(three)), () -> { + node(reinforcedLiquidTank, Seq.with(new SectorComplete(intersect)), () -> { }); }); @@ -192,8 +192,8 @@ public class ErekirTechTree{ node(cliffCrusher, () -> { node(siliconArcFurnace, () -> { node(electrolyzer, Seq.with(new OnSector(atlas)), () -> { - node(oxidationChamber, Seq.with(new Research(tankRefabricator), new OnSector(four)), () -> { - node(electricHeater, Seq.with(new OnSector(four)), () -> { + node(oxidationChamber, Seq.with(new Research(tankRefabricator), new OnSector(basin)), () -> { + node(electricHeater, Seq.with(new OnSector(basin)), () -> { node(heatRedirector, () -> { node(surgeCrucible, () -> { @@ -204,8 +204,8 @@ public class ErekirTechTree{ }); - node(atmosphericConcentrator, Seq.with(new OnSector(four)), () -> { - node(cyanogenSynthesizer, Seq.with(new OnSector(four)), () -> { + node(atmosphericConcentrator, Seq.with(new OnSector(basin)), () -> { + node(cyanogenSynthesizer, Seq.with(new OnSector(basin)), () -> { }); }); @@ -220,7 +220,7 @@ public class ErekirTechTree{ }); }); - node(slagIncinerator, Seq.with(new OnSector(four)), () -> { + node(slagIncinerator, Seq.with(new OnSector(basin)), () -> { //TODO these are unused. //node(slagCentrifuge, () -> {}); @@ -261,25 +261,25 @@ public class ErekirTechTree{ node(diffuse, Seq.with(new OnSector(lake)), () -> { node(sublimate, () -> { - node(titan, Seq.with(new OnSector(four)), () -> { - node(afflict, Seq.with(new OnSector(four)), () -> { + node(titan, Seq.with(new OnSector(basin)), () -> { + node(afflict, Seq.with(new OnSector(basin)), () -> { }); }); - node(disperse, Seq.with(new OnSector(four)), () -> { + node(disperse, Seq.with(new OnSector(basin)), () -> { }); }); }); - node(radar, Seq.with(new Research(beamNode), new Research(turbineCondenser), new Research(tankFabricator), new OnSector(SectorPresets.two)), () -> { + node(radar, Seq.with(new Research(beamNode), new Research(turbineCondenser), new Research(tankFabricator), new OnSector(SectorPresets.aegis)), () -> { }); }); - node(coreCitadel, Seq.with(new SectorComplete(four)), () -> { + node(coreCitadel, Seq.with(new SectorComplete(basin)), () -> { node(coreAcropolis, () -> { }); @@ -288,23 +288,23 @@ public class ErekirTechTree{ node(tankFabricator, Seq.with(new Research(siliconArcFurnace), new Research(plasmaBore), new Research(turbineCondenser)), () -> { node(UnitTypes.stell); - node(unitRepairTower, Seq.with(new OnSector(four), new Research(mechRefabricator)), () -> { + node(unitRepairTower, Seq.with(new OnSector(basin), new Research(mechRefabricator)), () -> { }); node(shipFabricator, Seq.with(new OnSector(lake)), () -> { node(UnitTypes.elude); - node(mechFabricator, Seq.with(new OnSector(three)), () -> { + node(mechFabricator, Seq.with(new OnSector(intersect)), () -> { node(UnitTypes.merui); node(tankRefabricator, Seq.with(new OnSector(atlas)), () -> { node(UnitTypes.locus); - node(mechRefabricator, Seq.with(new OnSector(four)), () -> { + node(mechRefabricator, Seq.with(new OnSector(basin)), () -> { node(UnitTypes.cleroi); - node(shipRefabricator, Seq.with(new OnSector(four), tmpNever), () -> { + node(shipRefabricator, Seq.with(new OnSector(basin), tmpNever), () -> { node(UnitTypes.avert); //TODO @@ -314,7 +314,7 @@ public class ErekirTechTree{ node(UnitTypes.obviate); }); - node(tankAssembler, Seq.with(new OnSector(three), new Research(constructor), new Research(atmosphericConcentrator)), () -> { + node(tankAssembler, Seq.with(new OnSector(intersect), new Research(constructor), new Research(atmosphericConcentrator)), () -> { node(UnitTypes.vanquish, () -> { node(UnitTypes.conquer, Seq.with(tmpNever), () -> { @@ -322,7 +322,7 @@ public class ErekirTechTree{ }); }); - node(shipAssembler, Seq.with(new OnSector(four)), () -> { + node(shipAssembler, Seq.with(new OnSector(basin)), () -> { node(UnitTypes.quell, () -> { node(UnitTypes.disrupt, Seq.with(tmpNever), () -> { @@ -346,18 +346,18 @@ public class ErekirTechTree{ }); node(onset, () -> { - node(two, Seq.with(new SectorComplete(onset), new Research(ductRouter), new Research(ductBridge)), () -> { - node(lake, Seq.with(new SectorComplete(two)), () -> { + node(aegis, Seq.with(new SectorComplete(onset), new Research(ductRouter), new Research(ductBridge)), () -> { + node(lake, Seq.with(new SectorComplete(aegis)), () -> { }); - node(three, Seq.with(new SectorComplete(two), new SectorComplete(lake), new Research(ventCondenser), new Research(shipFabricator)), () -> { - node(atlas, Seq.with(new SectorComplete(three), new Research(mechFabricator)), () -> { + node(intersect, Seq.with(new SectorComplete(aegis), new SectorComplete(lake), new Research(ventCondenser), new Research(shipFabricator)), () -> { + node(atlas, Seq.with(new SectorComplete(intersect), new Research(mechFabricator)), () -> { node(split, Seq.with(new SectorComplete(atlas), new Research(reinforcedPayloadConveyor), new Research(reinforcedContainer)), () -> { }); - node(four, Seq.with(new SectorComplete(atlas)), () -> { + node(basin, Seq.with(new SectorComplete(atlas)), () -> { }); }); diff --git a/core/src/mindustry/content/SectorPresets.java b/core/src/mindustry/content/SectorPresets.java index e592310c4e..8d46fd05dc 100644 --- a/core/src/mindustry/content/SectorPresets.java +++ b/core/src/mindustry/content/SectorPresets.java @@ -12,7 +12,7 @@ public class SectorPresets{ impact0078, desolateRift, nuclearComplex, planetaryTerminal, coastline, navalFortress, - onset, two, lake, three, four, atlas, split; + onset, aegis, lake, intersect, basin, atlas, split; public static void load(){ //region serpulo @@ -113,7 +113,7 @@ public class SectorPresets{ difficulty = 1; }}; - two = new SectorPreset("two", erekir, 88){{ + aegis = new SectorPreset("aegis", erekir, 88){{ difficulty = 3; }}; @@ -121,10 +121,9 @@ public class SectorPresets{ difficulty = 4; }}; - three = new SectorPreset("three", erekir, 36){{ + intersect = new SectorPreset("intersect", erekir, 36){{ difficulty = 5; captureWave = 9; - attackAfterWaves = true; }}; atlas = new SectorPreset("atlas", erekir, 14){{ //TODO random sector, pick a better one @@ -135,7 +134,7 @@ public class SectorPresets{ difficulty = 5; }}; - four = new SectorPreset("four", erekir, 29){{ + basin = new SectorPreset("basin", erekir, 29){{ difficulty = 6; }}; diff --git a/core/src/mindustry/game/MapObjectives.java b/core/src/mindustry/game/MapObjectives.java index cf5fed390e..e6b3cc6289 100644 --- a/core/src/mindustry/game/MapObjectives.java +++ b/core/src/mindustry/game/MapObjectives.java @@ -70,6 +70,7 @@ public class MapObjectives implements Iterable, Eachable type = prov.get().getClass(); + JsonIO.classTag(Strings.camelize(type.getSimpleName().replace("Objective", "")), type); JsonIO.classTag(type.getSimpleName().replace("Objective", ""), type); } } @@ -80,6 +81,7 @@ public class MapObjectives implements Iterable, Eachable type = prov.get().getClass(); + JsonIO.classTag(Strings.camelize(type.getSimpleName().replace("Marker", "")), type); JsonIO.classTag(type.getSimpleName().replace("Marker", ""), type); } } diff --git a/core/src/mindustry/io/JsonIO.java b/core/src/mindustry/io/JsonIO.java index d594cb3218..8263dae6c5 100644 --- a/core/src/mindustry/io/JsonIO.java +++ b/core/src/mindustry/io/JsonIO.java @@ -287,11 +287,19 @@ public class JsonIO{ var exec = new MapObjectives(); // First iteration to instantiate the objectives. for(var value = data.child; value != null; value = value.next){ + //glenn why did you implement this in the least backwards compatible way possible + //the old objectives had lowercase class tags, now they're uppercase and either way I can't deserialize them without errors + if(value.has("class") && Character.isLowerCase(value.getString("class").charAt(0))){ + return new MapObjectives(); + } + MapObjective obj = json.readValue(MapObjective.class, value); - int pos = value.getInt("editorPos"); - obj.editorX = Point2.x(pos); - obj.editorY = Point2.y(pos); + if(value.has("editorPos")){ + int pos = value.getInt("editorPos"); + obj.editorX = Point2.x(pos); + obj.editorY = Point2.y(pos); + } exec.all.add(obj); } diff --git a/core/src/mindustry/io/SaveIO.java b/core/src/mindustry/io/SaveIO.java index 41888cbb41..6a828799b8 100644 --- a/core/src/mindustry/io/SaveIO.java +++ b/core/src/mindustry/io/SaveIO.java @@ -68,6 +68,7 @@ public class SaveIO{ getMeta(stream); return true; }catch(Throwable e){ + Log.err(e); return false; } }