mirror of
https://github.com/Anuken/Mindustry.git
synced 2026-10-02 11:10:50 +03:00
Removed default loadout from generator
This commit is contained in:
@@ -182,6 +182,7 @@ public class Planets{
|
|||||||
clipRadius = 2f;
|
clipRadius = 2f;
|
||||||
defaultEnv = Env.space;
|
defaultEnv = Env.space;
|
||||||
icon = "commandRally";
|
icon = "commandRally";
|
||||||
|
defaultCore = Blocks.coreBastion;
|
||||||
generator = new AsteroidGenerator();
|
generator = new AsteroidGenerator();
|
||||||
cgen.get((AsteroidGenerator)generator);
|
cgen.get((AsteroidGenerator)generator);
|
||||||
|
|
||||||
|
|||||||
@@ -123,6 +123,10 @@ public class Schematic implements Publishable, Comparable<Schematic>{
|
|||||||
return name().compareTo(schematic.name());
|
return name().compareTo(schematic.name());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static Schematic ofBlock(Block block){
|
||||||
|
return new Schematic(Seq.with(new Stile(block, 0, 0, null, (byte)0)), new StringMap(), block.size, block.size);
|
||||||
|
}
|
||||||
|
|
||||||
public static class Stile{
|
public static class Stile{
|
||||||
public Block block;
|
public Block block;
|
||||||
public short x, y;
|
public short x, y;
|
||||||
|
|||||||
@@ -127,7 +127,7 @@ public class Universe{
|
|||||||
}
|
}
|
||||||
|
|
||||||
public Schematic getLastLoadout(){
|
public Schematic getLastLoadout(){
|
||||||
if(lastLoadout == null) lastLoadout = state.rules.sector == null || state.rules.sector.planet.generator == null ? Loadouts.basicShard : state.rules.sector.planet.generator.defaultLoadout;
|
if(lastLoadout == null) lastLoadout = state.rules.sector == null ? Loadouts.basicShard : state.rules.sector.planet.defaultLoadout;
|
||||||
return lastLoadout;
|
return lastLoadout;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -9,7 +9,6 @@ import mindustry.*;
|
|||||||
import mindustry.ai.*;
|
import mindustry.ai.*;
|
||||||
import mindustry.ai.Astar.*;
|
import mindustry.ai.Astar.*;
|
||||||
import mindustry.content.*;
|
import mindustry.content.*;
|
||||||
import mindustry.game.*;
|
|
||||||
import mindustry.world.*;
|
import mindustry.world.*;
|
||||||
import mindustry.world.blocks.environment.*;
|
import mindustry.world.blocks.environment.*;
|
||||||
|
|
||||||
@@ -26,8 +25,6 @@ public abstract class BasicGenerator implements WorldGenerator{
|
|||||||
//for drawing
|
//for drawing
|
||||||
protected @Nullable Block floor, block, ore;
|
protected @Nullable Block floor, block, ore;
|
||||||
|
|
||||||
public Schematic defaultLoadout = Loadouts.basicShard;
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void generate(Tiles tiles, WorldParams params){
|
public void generate(Tiles tiles, WorldParams params){
|
||||||
this.tiles = tiles;
|
this.tiles = tiles;
|
||||||
|
|||||||
@@ -24,10 +24,6 @@ public class AsteroidGenerator extends BlankPlanetGenerator{
|
|||||||
@Nullable Rand rand;
|
@Nullable Rand rand;
|
||||||
int seed;
|
int seed;
|
||||||
|
|
||||||
{
|
|
||||||
defaultLoadout = Loadouts.basicNucleus;
|
|
||||||
}
|
|
||||||
|
|
||||||
void asteroid(int ax, int ay, int radius){
|
void asteroid(int ax, int ay, int radius){
|
||||||
Floor floor = (
|
Floor floor = (
|
||||||
rand.chance(iceChance) ? Blocks.ice :
|
rand.chance(iceChance) ? Blocks.ice :
|
||||||
|
|||||||
@@ -30,7 +30,6 @@ public class ErekirPlanetGenerator extends PlanetGenerator{
|
|||||||
|
|
||||||
{
|
{
|
||||||
baseSeed = 2;
|
baseSeed = 2;
|
||||||
defaultLoadout = Loadouts.basicBastion;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -151,6 +151,8 @@ public class Planet extends UnlockableContent{
|
|||||||
public boolean alwaysPlayMusic = false;
|
public boolean alwaysPlayMusic = false;
|
||||||
/** Default core block for launching. */
|
/** Default core block for launching. */
|
||||||
public Block defaultCore = Blocks.coreShard;
|
public Block defaultCore = Blocks.coreShard;
|
||||||
|
/** Default loadout schematic; if not set, gets initialized to the default core provided. */
|
||||||
|
public @Nullable Schematic defaultLoadout;
|
||||||
/** Parent body that this planet orbits around. If null, this planet is considered to be in the middle of the solar system. */
|
/** Parent body that this planet orbits around. If null, this planet is considered to be in the middle of the solar system. */
|
||||||
public @Nullable Planet parent;
|
public @Nullable Planet parent;
|
||||||
/** The root parent of the whole solar system this planet is in. */
|
/** The root parent of the whole solar system this planet is in. */
|
||||||
@@ -451,6 +453,8 @@ public class Planet extends UnlockableContent{
|
|||||||
loadRules();
|
loadRules();
|
||||||
loadStats();
|
loadStats();
|
||||||
|
|
||||||
|
if(defaultLoadout == null) defaultLoadout = Schematic.ofBlock(defaultCore);
|
||||||
|
|
||||||
if(techTree == null){
|
if(techTree == null){
|
||||||
techTree = TechTree.roots.find(n -> n.planet == this);
|
techTree = TechTree.roots.find(n -> n.planet == this);
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-1
@@ -26,4 +26,4 @@ org.gradle.caching=true
|
|||||||
org.gradle.internal.http.socketTimeout=100000
|
org.gradle.internal.http.socketTimeout=100000
|
||||||
org.gradle.internal.http.connectionTimeout=100000
|
org.gradle.internal.http.connectionTimeout=100000
|
||||||
android.enableR8.fullMode=false
|
android.enableR8.fullMode=false
|
||||||
archash=b43a5b04ce
|
archash=fa3f8b009d
|
||||||
|
|||||||
Reference in New Issue
Block a user