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;
configurable = false;
plans.add(new UnitPlan(UnitTypes.stell, 60f * 60f, with(Items.graphite, 20f, Items.silicon, 40f)));
researchCostMultiplier = 1f / 8f;
consumePower(2f);
}};

View file

@ -197,6 +197,12 @@ public class ErekirTechTree{
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(UnitTypes.vanquish, () -> {
node(UnitTypes.conquer, Seq.with(tmpNever), () -> {
node(fabricator, () -> {
node(UnitTypes.stell, Seq.with(new Research(siliconArcFurnace), new Research(plasmaBore), new Research(turbineCondenser)), () -> {
});
});
node(shipAssembler, Seq.with(new OnSector(five)), () -> {
node(UnitTypes.quell, () -> {
node(UnitTypes.disrupt, Seq.with(tmpNever), () -> {
node(tankAssembler, Seq.with(new OnSector(four), new Research(constructor), new Research(atmosphericConcentrator)), () -> {
node(UnitTypes.vanquish, () -> {
node(UnitTypes.conquer, Seq.with(tmpNever), () -> {
});
});
node(mechAssembler, Seq.with(tmpNever), () -> {
node(UnitTypes.bulwark, () -> {
node(UnitTypes.krepost, Seq.with(tmpNever), () -> {
node(shipAssembler, Seq.with(new OnSector(five)), () -> {
node(UnitTypes.quell, () -> {
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.oxide, () -> {
nodeProduce(Items.fissileMatter, () -> {
});
});
nodeProduce(Liquids.ozone, () -> {
nodeProduce(Liquids.hydrogen, () -> {
nodeProduce(Liquids.nitrogen, () -> {
nodeProduce(Liquids.cyanogen, () -> {
nodeProduce(Items.graphite, () -> {
nodeProduce(Items.sand, () -> {
nodeProduce(Items.silicon, () -> {
nodeProduce(Items.oxide, () -> {
nodeProduce(Items.fissileMatter, () -> {
});
});
});
});
});
nodeProduce(Items.tungsten, () -> {
nodeProduce(Items.carbide, () -> {
nodeProduce(Liquids.gallium, () -> {
nodeProduce(Liquids.water, () -> {
nodeProduce(Liquids.ozone, () -> {
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")){{
alwaysUnlocked = true;
lowPriority = true;
}};

View file

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

View file

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

View file

@ -281,7 +281,7 @@ public class EventType{
/**
* Called *after* a tile has changed.
* 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 Tile tile;

View file

@ -325,16 +325,17 @@ public class ResearchDialog extends BaseDialog{
void checkNodes(TechTreeNode 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);
for(TechTreeNode l : node.children){
l.visible = !locked;
l.visible = !locked && l.parent.visible;
checkNodes(l);
}
itemDisplay.rebuild(items);
}
boolean selectable(TechNode node){
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.*;
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 TilePreChangeEvent preChange = new TilePreChangeEvent();
private static final ObjectSet<Building> tileSet = new ObjectSet<>();
@ -632,34 +630,13 @@ public class Tile implements Position, QuadTreeObject, Displayable{
protected void fireChanged(){
if(!world.isGenerating()){
//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;
}
Events.fire(tileChange.set(this));
}
}
protected void firePreChanged(){
if(!world.isGenerating()){
//same as above
boolean wasLocked = tilePreChangeLock;
var eventInst = wasLocked ? new TilePreChangeEvent() : preChange;
tilePreChangeLock = true;
Events.fire(eventInst.set(this));
if(!wasLocked){
tilePreChangeLock = false;
}
Events.fire(preChange.set(this));
}
}

View file

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