Added 8 hidden sectors to Serpulo (UNTESTED)

This commit is contained in:
Anuken
2025-05-04 00:27:51 -04:00
parent 9be75f03fa
commit 909d740b68
14 changed files with 40 additions and 14 deletions

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@@ -163,6 +163,18 @@ public class SectorPresets{
difficulty = 10; difficulty = 10;
}}; }};
//TODO: for wave survival sectors the capture wave is incorrect
registerHiddenSectors(serpulo,
68, //Winter Forest by wpx: https://discord.com/channels/391020510269669376/1165421701362897000/1235654407006322700
241,//River Bastion by wpx: https://discord.com/channels/391020510269669376/1165421701362897000/1232658317126402050
173,//Front Line by stormrider: https://discord.com/channels/391020510269669376/1165421701362897000/1188484967064404061
25, //HochuPizzu by wpx: https://discord.com/channels/391020510269669376/1165421701362897000/1170279703056228515
12, //Salt Outpost by skeledragon: https://discord.com/channels/391020510269669376/1165421701362897000/1193441915459338361
82, //Desert Wastes by xaphiro_: https://discord.com/channels/391020510269669376/1165421701362897000/1226498922898264157
243,//Port 012 by skeledragon: https://discord.com/channels/391020510269669376/1165421701362897000/1174884280242012262
240 //Cold Grove by wpx: https://discord.com/channels/391020510269669376/1165421701362897000/1230550892718194742
);
//endregion //endregion
//region erekir //region erekir
@@ -186,11 +198,11 @@ public class SectorPresets{
attackAfterWaves = true; attackAfterWaves = true;
}}; }};
atlas = new SectorPreset("atlas", erekir, 14){{ //TODO random sector, pick a better one atlas = new SectorPreset("atlas", erekir, 14){{
difficulty = 5; difficulty = 5;
}}; }};
split = new SectorPreset("split", erekir, 19){{ //TODO random sector, pick a better one split = new SectorPreset("split", erekir, 19){{
difficulty = 2; difficulty = 2;
}}; }};
@@ -244,4 +256,12 @@ public class SectorPresets{
//endregion //endregion
} }
static void registerHiddenSectors(Planet planet, int... ids){
for(int id : ids){
new SectorPreset("sector-" + planet.name + "-" + id, "hidden/" + planet + "-" + id, planet, id){{
requireUnlock = false;
}};
}
}
} }

View File

@@ -73,7 +73,7 @@ public class SerpuloPlanetGenerator extends PlanetGenerator{
@Override @Override
public void getLockedText(Sector hovered, StringBuilder out){ public void getLockedText(Sector hovered, StringBuilder out){
if(hovered.preset == null && hovered.near().contains(Sector::hasBase)){ if((hovered.preset == null || !hovered.preset.requireUnlock) && hovered.near().contains(Sector::hasBase)){
out.append("[red]").append(Iconc.cancel).append("[]").append(Blocks.coreFoundation.emoji()).append(Core.bundle.get("sector.foundationrequired")); out.append("[red]").append(Iconc.cancel).append("[]").append(Blocks.coreFoundation.emoji()).append(Core.bundle.get("sector.foundationrequired"));
}else{ }else{
super.getLockedText(hovered, out); super.getLockedText(hovered, out);

View File

@@ -331,7 +331,7 @@ public class Planet extends UnlockableContent{
sum += 0.88f; sum += 0.88f;
} }
sector.threat = sector.preset == null ? sector.threat = sector.preset == null || !sector.preset.requireUnlock ?
Math.max(Math.min(sum / 5f, 1.2f), 0.3f) : //low threat sectors are pointless Math.max(Math.min(sum / 5f, 1.2f), 0.3f) : //low threat sectors are pointless
Mathf.clamp(sector.preset.difficulty / 10f); Mathf.clamp(sector.preset.difficulty / 10f);
} }

View File

@@ -137,7 +137,7 @@ public class Sector{
} }
public String name(){ public String name(){
if(preset != null && info.name == null) return preset.localizedName; if(preset != null && info.name == null && preset.requireUnlock) return preset.localizedName;
//single-sector "planets" use their own name for the sector name. //single-sector "planets" use their own name for the sector name.
if(info.name == null && planet.sectors.size == 1){ if(info.name == null && planet.sectors.size == 1){
return planet.localizedName; return planet.localizedName;

View File

@@ -2,6 +2,7 @@ package mindustry.type;
import arc.*; import arc.*;
import arc.func.*; import arc.func.*;
import arc.util.*;
import mindustry.ctype.*; import mindustry.ctype.*;
import mindustry.game.*; import mindustry.game.*;
import mindustry.gen.*; import mindustry.gen.*;
@@ -35,22 +36,27 @@ public class SectorPreset extends UnlockableContent{
public boolean attackAfterWaves = false; public boolean attackAfterWaves = false;
public SectorPreset(String name, Planet planet, int sector){ public SectorPreset(String name, Planet planet, int sector){
this(name); this(name, null, planet, sector);
}
public SectorPreset(String name, String fileName, Planet planet, int sector){
this(name, fileName, null);
initialize(planet, sector); initialize(planet, sector);
} }
/** Internal use only! */ /** Internal use only! */
public SectorPreset(String name, LoadedMod mod){ public SectorPreset(String name, LoadedMod mod){
this(name, null, mod);
}
/** Internal use only! */
public SectorPreset(String name, @Nullable String fileName, LoadedMod mod){
super(name); super(name);
if(mod != null){ if(mod != null){
this.minfo.mod = mod; this.minfo.mod = mod;
} }
this.generator = new FileMapGenerator(this.name, this); //this.name can change based on the mod being loaded, so if a fileName is not specified, make sure to use the newly assigned this.name
} this.generator = new FileMapGenerator(fileName == null ? this.name : fileName, this);
/** Internal use only! */
public SectorPreset(String name){
this(name, null);
} }
public void initialize(Planet planet, int sector){ public void initialize(Planet planet, int sector){

View File

@@ -264,7 +264,7 @@ public class PlanetDialog extends BaseDialog implements PlanetInterfaceRenderer{
//announce new presets //announce new presets
for(SectorPreset preset : content.sectors()){ for(SectorPreset preset : content.sectors()){
if(preset.unlocked() && !preset.alwaysUnlocked && !preset.sector.info.shown && !preset.sector.hasBase() && preset.planet == state.planet){ if(preset.unlocked() && !preset.alwaysUnlocked && !preset.sector.info.shown && preset.requireUnlock && !preset.sector.hasBase() && preset.planet == state.planet){
newPresets.add(preset.sector); newPresets.add(preset.sector);
preset.sector.info.shown = true; preset.sector.info.shown = true;
preset.sector.saveInfo(); preset.sector.saveInfo();
@@ -539,7 +539,7 @@ public class PlanetDialog extends BaseDialog implements PlanetInterfaceRenderer{
var preficon = sec.icon(); var preficon = sec.icon();
var icon = var icon =
sec.isAttacked() ? Fonts.getLargeIcon("warning") : sec.isAttacked() ? Fonts.getLargeIcon("warning") :
!sec.hasBase() && sec.preset != null && sec.preset.unlocked() && preficon == null ? !sec.hasBase() && sec.preset != null && sec.preset.requireUnlock && sec.preset.unlocked() && preficon == null ?
Fonts.getLargeIcon("terrain") : Fonts.getLargeIcon("terrain") :
sec.preset != null && sec.preset.requireUnlock && sec.preset.locked() && sec.preset.techNode != null && (sec.preset.techNode.parent == null || !sec.preset.techNode.parent.content.locked()) ? Fonts.getLargeIcon("lock") : sec.preset != null && sec.preset.requireUnlock && sec.preset.locked() && sec.preset.techNode != null && (sec.preset.techNode.parent == null || !sec.preset.techNode.parent.content.locked()) ? Fonts.getLargeIcon("lock") :
preficon; preficon;