Procedural sectors on Serpulo now require a Foundation core
This commit is contained in:
@@ -1,5 +1,7 @@
|
||||
package mindustry.maps.generators;
|
||||
|
||||
import arc.*;
|
||||
import arc.graphics.g2d.*;
|
||||
import arc.math.geom.*;
|
||||
import arc.struct.*;
|
||||
import arc.struct.ObjectIntMap.*;
|
||||
@@ -8,10 +10,12 @@ import arc.util.noise.*;
|
||||
import mindustry.content.*;
|
||||
import mindustry.ctype.*;
|
||||
import mindustry.game.*;
|
||||
import mindustry.gen.*;
|
||||
import mindustry.graphics.g3d.*;
|
||||
import mindustry.graphics.g3d.PlanetGrid.*;
|
||||
import mindustry.type.*;
|
||||
import mindustry.type.Weather.*;
|
||||
import mindustry.ui.*;
|
||||
import mindustry.world.*;
|
||||
|
||||
import static mindustry.Vars.*;
|
||||
@@ -52,6 +56,14 @@ public abstract class PlanetGenerator extends BasicGenerator implements HexMeshe
|
||||
}
|
||||
}
|
||||
|
||||
public void getLockedText(Sector hovered, StringBuilder out){
|
||||
out.append("[gray]").append(Iconc.lock).append(" ").append(Core.bundle.get("locked"));
|
||||
}
|
||||
|
||||
public TextureRegion getLockedIcon(Sector hovered){
|
||||
return (hovered.preset == null && !hovered.planet.allowLaunchToNumbered ? Fonts.getLargeIcon("cancel") : Fonts.getLargeIcon("lock"));
|
||||
}
|
||||
|
||||
/** @return whether to allow landing on the specified procedural sector */
|
||||
public boolean allowLanding(Sector sector){
|
||||
return sector.planet.allowLaunchToNumbered && (sector.hasBase() || sector.near().contains(Sector::hasBase));
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package mindustry.maps.planet;
|
||||
|
||||
import arc.*;
|
||||
import arc.graphics.*;
|
||||
import arc.math.*;
|
||||
import arc.math.geom.*;
|
||||
@@ -10,6 +11,7 @@ import mindustry.ai.*;
|
||||
import mindustry.ai.BaseRegistry.*;
|
||||
import mindustry.content.*;
|
||||
import mindustry.game.*;
|
||||
import mindustry.gen.*;
|
||||
import mindustry.graphics.g3d.PlanetGrid.*;
|
||||
import mindustry.maps.generators.*;
|
||||
import mindustry.type.*;
|
||||
@@ -63,6 +65,21 @@ public class SerpuloPlanetGenerator extends PlanetGenerator{
|
||||
return (Mathf.pow(Simplex.noise3d(seed, 7, 0.5f, 1f/3f, position.x, position.y, position.z), 2.3f) + waterOffset) / (1f + waterOffset);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean allowLanding(Sector sector){
|
||||
return sector.planet.allowLaunchToNumbered && (sector.hasBase() || sector.near().contains(s -> s.hasBase() &&
|
||||
(s.info.bestCoreType.size >= 4 || s.isBeingPlayed() && state.rules.defaultTeam.cores().contains(b -> b.block.size >= 4))));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getLockedText(Sector hovered, StringBuilder out){
|
||||
if(hovered.preset == null && hovered.near().contains(Sector::hasBase)){
|
||||
out.append("[red]").append(Iconc.cancel).append("[]").append(Blocks.coreFoundation.emoji()).append(Core.bundle.get("sector.foundationrequired"));
|
||||
}else{
|
||||
super.getLockedText(hovered, out);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void generateSector(Sector sector){
|
||||
|
||||
|
||||
Reference in New Issue
Block a user