Erekir parallel tech tree changes

This commit is contained in:
Anuken
2022-02-20 13:32:25 -05:00
parent 02966a0911
commit 74233fdc2c
9 changed files with 67 additions and 58 deletions

View File

@@ -3620,6 +3620,7 @@ public class Blocks{
size = 3; size = 3;
configurable = false; configurable = false;
plans.add(new UnitPlan(UnitTypes.stell, 60f * 60f, with(Items.graphite, 20f, Items.silicon, 40f))); plans.add(new UnitPlan(UnitTypes.stell, 60f * 60f, with(Items.graphite, 20f, Items.silicon, 40f)));
researchCostMultiplier = 1f / 8f;
consumePower(2f); consumePower(2f);
}}; }};

View File

@@ -197,6 +197,12 @@ public class ErekirTechTree{
node(tungstenWallLarge, () -> { node(tungstenWallLarge, () -> {
}); });
node(carbideWall, () -> {
node(carbideWallLarge, () -> {
});
});
}); });
}); });
@@ -219,26 +225,32 @@ public class ErekirTechTree{
}); });
}); });
node(tankAssembler, Seq.with(new OnSector(four), new Research(constructor), new Research(atmosphericConcentrator)), () -> { node(fabricator, () -> {
node(UnitTypes.vanquish, () -> { node(UnitTypes.stell, Seq.with(new Research(siliconArcFurnace), new Research(plasmaBore), new Research(turbineCondenser)), () -> {
node(UnitTypes.conquer, Seq.with(tmpNever), () -> {
});
}); });
node(shipAssembler, Seq.with(new OnSector(five)), () -> { node(tankAssembler, Seq.with(new OnSector(four), new Research(constructor), new Research(atmosphericConcentrator)), () -> {
node(UnitTypes.quell, () -> { node(UnitTypes.vanquish, () -> {
node(UnitTypes.disrupt, Seq.with(tmpNever), () -> { node(UnitTypes.conquer, Seq.with(tmpNever), () -> {
}); });
}); });
node(mechAssembler, Seq.with(tmpNever), () -> { node(shipAssembler, Seq.with(new OnSector(five)), () -> {
node(UnitTypes.bulwark, () -> { node(UnitTypes.quell, () -> {
node(UnitTypes.krepost, Seq.with(tmpNever), () -> { node(UnitTypes.disrupt, Seq.with(tmpNever), () -> {
}); });
}); });
node(mechAssembler, Seq.with(tmpNever), () -> {
node(UnitTypes.bulwark, () -> {
node(UnitTypes.krepost, Seq.with(tmpNever), () -> {
});
});
});
}); });
}); });
}); });
@@ -258,26 +270,48 @@ public class ErekirTechTree{
}); });
nodeProduce(Items.beryllium, () -> { nodeProduce(Items.beryllium, () -> {
nodeProduce(Items.oxide, () -> { nodeProduce(Items.graphite, () -> {
nodeProduce(Items.fissileMatter, () -> { nodeProduce(Items.sand, () -> {
nodeProduce(Items.silicon, () -> {
}); nodeProduce(Items.oxide, () -> {
}); nodeProduce(Items.fissileMatter, () -> {
nodeProduce(Liquids.ozone, () -> {
nodeProduce(Liquids.hydrogen, () -> {
nodeProduce(Liquids.nitrogen, () -> {
nodeProduce(Liquids.cyanogen, () -> {
});
}); });
}); });
}); });
});
nodeProduce(Items.tungsten, () -> { nodeProduce(Liquids.water, () -> {
nodeProduce(Items.carbide, () -> { nodeProduce(Liquids.ozone, () -> {
nodeProduce(Liquids.gallium, () -> { nodeProduce(Liquids.hydrogen, () -> {
nodeProduce(Liquids.nitrogen, () -> {
nodeProduce(Liquids.cyanogen, () -> {
});
});
});
});
});
nodeProduce(Items.tungsten, () -> {
nodeProduce(Liquids.slag, () -> {
});
nodeProduce(Items.thorium, () -> {
nodeProduce(Items.carbide, () -> {
nodeProduce(Items.surgeAlloy, () -> {
nodeProduce(Items.phaseFabric, () -> {
});
});
nodeProduce(Liquids.gallium, () -> {
nodeProduce(Items.scrap, () -> {
});
});
});
}); });
}); });
}); });

View File

@@ -35,7 +35,6 @@ public class Items{
}}; }};
sand = new Item("sand", Color.valueOf("f7cba4")){{ sand = new Item("sand", Color.valueOf("f7cba4")){{
alwaysUnlocked = true;
lowPriority = true; lowPriority = true;
}}; }};

View File

@@ -12,7 +12,6 @@ public class Liquids{
water = new Liquid("water", Color.valueOf("596ab8")){{ water = new Liquid("water", Color.valueOf("596ab8")){{
heatCapacity = 0.4f; heatCapacity = 0.4f;
alwaysUnlocked = true;
effect = StatusEffects.wet; effect = StatusEffects.wet;
boilPoint = 0.5f; boilPoint = 0.5f;
gasColor = Color.grays(0.9f); gasColor = Color.grays(0.9f);

View File

@@ -2425,6 +2425,7 @@ public class UnitTypes{
armor = 5f; armor = 5f;
areaDamage = 5f; areaDamage = 5f;
treadRects = new Rect[]{new Rect(12, 7, 14, 51)}; treadRects = new Rect[]{new Rect(12, 7, 14, 51)};
researchCostMultiplier = 0f;
weapons.add(new Weapon("stell-weapon"){{ weapons.add(new Weapon("stell-weapon"){{
layerOffset = 0.0001f; layerOffset = 0.0001f;

View File

@@ -281,7 +281,7 @@ public class EventType{
/** /**
* Called *after* a tile has changed. * Called *after* a tile has changed.
* WARNING! This event is special: its instance is reused! Do not cache or use with a timer. * WARNING! This event is special: its instance is reused! Do not cache or use with a timer.
* Do not modify any tiles inside listeners that use this tile. * Do not modify any tiles inside listener code.
* */ * */
public static class TileChangeEvent{ public static class TileChangeEvent{
public Tile tile; public Tile tile;

View File

@@ -325,16 +325,17 @@ public class ResearchDialog extends BaseDialog{
void checkNodes(TechTreeNode node){ void checkNodes(TechTreeNode node){
boolean locked = locked(node.node); boolean locked = locked(node.node);
if(!locked) node.visible = true; if(!locked && (node.parent == null || node.parent.visible)) node.visible = true;
node.selectable = selectable(node.node); node.selectable = selectable(node.node);
for(TechTreeNode l : node.children){ for(TechTreeNode l : node.children){
l.visible = !locked; l.visible = !locked && l.parent.visible;
checkNodes(l); checkNodes(l);
} }
itemDisplay.rebuild(items); itemDisplay.rebuild(items);
} }
boolean selectable(TechNode node){ boolean selectable(TechNode node){
return node.content.unlocked() || !node.objectives.contains(i -> !i.complete()); return node.content.unlocked() || !node.objectives.contains(i -> !i.complete());
} }

View File

@@ -21,8 +21,6 @@ import mindustry.world.blocks.environment.*;
import static mindustry.Vars.*; import static mindustry.Vars.*;
public class Tile implements Position, QuadTreeObject, Displayable{ public class Tile implements Position, QuadTreeObject, Displayable{
private static boolean tileChangeLock = false;
private static boolean tilePreChangeLock = false;
private static final TileChangeEvent tileChange = new TileChangeEvent(); private static final TileChangeEvent tileChange = new TileChangeEvent();
private static final TilePreChangeEvent preChange = new TilePreChangeEvent(); private static final TilePreChangeEvent preChange = new TilePreChangeEvent();
private static final ObjectSet<Building> tileSet = new ObjectSet<>(); private static final ObjectSet<Building> tileSet = new ObjectSet<>();
@@ -632,34 +630,13 @@ public class Tile implements Position, QuadTreeObject, Displayable{
protected void fireChanged(){ protected void fireChanged(){
if(!world.isGenerating()){ if(!world.isGenerating()){
Events.fire(tileChange.set(this));
//A TileChangeEvent may cause other TileChangeEvents to occur, and if that happens, allocate a new instance.
boolean wasLocked = tileChangeLock;
var eventInst = wasLocked ? new TileChangeEvent() : tileChange;
tileChangeLock = true;
Events.fire(eventInst.set(this));
//unlock after it's done
if(!wasLocked){
tileChangeLock = false;
}
} }
} }
protected void firePreChanged(){ protected void firePreChanged(){
if(!world.isGenerating()){ if(!world.isGenerating()){
Events.fire(preChange.set(this));
//same as above
boolean wasLocked = tilePreChangeLock;
var eventInst = wasLocked ? new TilePreChangeEvent() : preChange;
tilePreChangeLock = true;
Events.fire(eventInst.set(this));
if(!wasLocked){
tilePreChangeLock = false;
}
} }
} }

View File

@@ -81,10 +81,7 @@ public class ItemSource extends Block{
while(counter >= limit){ while(counter >= limit){
items.set(outputItem, 1); items.set(outputItem, 1);
if(dump(outputItem)){ dump(outputItem);
//for debugging only
produced(outputItem);
}
items.set(outputItem, 0); items.set(outputItem, 0);
counter -= limit; counter -= limit;
} }