Selectable tech tree

This commit is contained in:
Anuken
2021-12-08 21:57:10 -05:00
parent 36dc0e9e3e
commit 8a2908374a
8 changed files with 101 additions and 17 deletions

View File

@@ -1096,7 +1096,8 @@ public class Blocks{
craftEffect = new RadialEffect(Fx.heatReactorSmoke, 4, 90f, 7f);
itemCapacity = 20;
consumes.item(Items.thorium, 2);
consumes.item(Items.thorium, 3);
consumes.liquid(Liquids.nitrogen, 1f / 60f);
outputItem = new ItemStack(Items.fissileMatter, 1);
}};
@@ -2854,7 +2855,7 @@ public class Blocks{
restitution = 0.03f;
range = 180;
shootCone = 3f;
health = 300 * size * size;
health = 350 * size * size;
rotateSpeed = 1.6f;
limitRange();
@@ -2862,9 +2863,9 @@ public class Blocks{
//TODO implementation; splash damage? shotgun? AA? I have no ideas
fracture = new ItemTurret("fracture"){{
requirements(Category.turret, with(Items.tungsten, 35, Items.silicon, 35));
requirements(Category.turret, with(Items.tungsten, 30, Items.graphite, 30, Items.silicon, 35));
ammo(
Items.tungsten, new ContinuousFlameBulletType(45f){{
Items.tungsten, new ContinuousFlameBulletType(50f){{
length = 105f;
shootEffect = Fx.randLifeSpark;
width = 4.5f;
@@ -2903,7 +2904,7 @@ public class Blocks{
range = 90;
shootCone = 15f;
inaccuracy = 0f;
health = 300 * size * size;
health = 420 * size * size;
rotateSpeed = 3f;
}};
@@ -2954,7 +2955,7 @@ public class Blocks{
range = 190;
shootCone = 15f;
inaccuracy = 20f;
health = 300 * size * size;
health = 400 * size * size;
rotateSpeed = 3f;
//???

View File

@@ -6,7 +6,7 @@ import static mindustry.content.TechTree.*;
public class ErekirTechTree{
public static void load(){
rootErekir = node(coreBastion, () -> {
Planets.erekir.techTree = nodeRoot("erekir", coreBastion, () -> {
node(duct, () -> {
node(ductRouter, () -> {
node(ductBridge, () -> {
@@ -142,11 +142,13 @@ public class ErekirTechTree{
});
node(breach, () -> {
//fracture turret is broken and thus not listed
//TODO big tech jump here; incomplete turret
node(sublimate, () -> {
node(fracture, () -> {
//TODO big tech jump here; incomplete turret
node(sublimate, () -> {
});
});
});

View File

@@ -12,7 +12,7 @@ import static mindustry.content.UnitTypes.*;
public class SerpuloTechTree{
public static void load(){
root = node(coreShard, () -> {
Planets.serpulo.techTree = nodeRoot("serpulo", coreShard, () -> {
node(conveyor, () -> {

View File

@@ -12,8 +12,14 @@ public class TechTree{
private static TechNode context = null;
public static Seq<TechNode> all = new Seq<>();
//TODO deprecate and refactor the root system
public static TechNode root, rootErekir;
public static Seq<TechNode> roots = new Seq<>();
public static TechNode nodeRoot(String name, UnlockableContent content, Runnable children){
var root = node(content, content.researchRequirements(), children);
root.name = name;
roots.add(root);
return root;
}
public static TechNode node(UnlockableContent content, Runnable children){
return node(content, content.researchRequirements(), children);
@@ -69,6 +75,8 @@ public class TechTree{
public static class TechNode{
/** Depth in tech tree. */
public int depth;
/** Name for root node - used in tech tree selector. */
public @Nullable String name;
/** Requirement node. */
public @Nullable TechNode parent;
/** Content to be researched. */
@@ -103,6 +111,10 @@ public class TechTree{
all.add(this);
}
public String localizedName(){
return Core.bundle.get("techtree." + name);
}
public void setupRequirements(ItemStack[] requirements){
this.requirements = requirements;
this.finishedRequirements = new ItemStack[requirements.length];