Unlock necessary blocks before landing

This commit is contained in:
Anuken 2022-01-23 15:28:12 -05:00
parent b281f29f01
commit 5a2d69278b
4 changed files with 10 additions and 0 deletions

Binary file not shown.

View File

@ -57,6 +57,12 @@ public class Planets{
totalRadius += 2.6f;
lightSrcTo = 0.5f;
lightDstFrom = 0.2f;
unlockedOnLand.addAll(
Blocks.plasmaBore, Blocks.duct,
Blocks.turbineCondenser, Blocks.breach,
Blocks.coreCitadel
);
}};
//TODO names

View File

@ -91,6 +91,8 @@ public class Planet extends UnlockableContent{
public @Nullable TechNode techTree;
/** Planets that can be launched to from this one. Made mutual in init(). */
public Seq<Planet> launchCandidates = new Seq<>();
/** Content (usually planet-specific) that is unlocked upon landing here. */
public Seq<UnlockableContent> unlockedOnLand = new Seq<>();
/** Loads the mesh. Clientside only. Defaults to a boring sphere mesh. */
protected Prov<GenericMesh> meshLoader = () -> new ShaderSphereMesh(this, Shaders.unlit, 2), cloudMeshLoader = () -> null;

View File

@ -1137,6 +1137,8 @@ public class PlanetDialog extends BaseDialog implements PlanetInterfaceRenderer{
//TODO animation
//schematic selection and cost handled by listener
listener.get(sector);
//unlock right before launch
sector.planet.unlockedOnLand.each(UnlockableContent::unlock);
control.playSector(sector);
}else{
//sector should have base here