mirror of
https://github.com/Anuken/Mindustry.git
synced 2026-01-26 06:22:17 -08:00
Misc tech tree & block stuff
This commit is contained in:
parent
13e57ba89e
commit
07ff2de2a2
5 changed files with 25 additions and 15 deletions
|
|
@ -4445,7 +4445,7 @@ public class Blocks{
|
|||
consumePower(2f);
|
||||
size = 3;
|
||||
//TODO expand this list
|
||||
filter = Seq.with(Blocks.tungstenWallLarge, Blocks.berylliumWallLarge, Blocks.carbideWallLarge, Blocks.reinforcedLiquidContainer, Blocks.reinforcedContainer, Blocks.beamNode);
|
||||
filter = Seq.with(Blocks.tungstenWallLarge, Blocks.berylliumWallLarge, Blocks.carbideWallLarge, Blocks.reinforcedSurgeWallLarge, Blocks.reinforcedLiquidContainer, Blocks.reinforcedContainer, Blocks.beamNode);
|
||||
}};
|
||||
|
||||
//yes this block is pretty much useless
|
||||
|
|
|
|||
|
|
@ -141,7 +141,7 @@ public class TechTree{
|
|||
}
|
||||
|
||||
public String localizedName(){
|
||||
return Core.bundle.get("techtree." + name);
|
||||
return Core.bundle.get("techtree." + name, name);
|
||||
}
|
||||
|
||||
public void setupRequirements(ItemStack[] requirements){
|
||||
|
|
|
|||
|
|
@ -886,7 +886,7 @@ public class ContentParser{
|
|||
researchName = research.asString();
|
||||
customRequirements = null;
|
||||
}else{
|
||||
researchName = research.getString("parent");
|
||||
researchName = research.getString("parent", null);
|
||||
customRequirements = research.has("requirements") ? parser.readValue(ItemStack[].class, research.get("requirements")) : null;
|
||||
}
|
||||
|
||||
|
|
@ -922,18 +922,28 @@ public class ContentParser{
|
|||
node.setupRequirements(unlock.researchRequirements());
|
||||
}
|
||||
|
||||
//find parent node.
|
||||
TechNode parent = TechTree.all.find(t -> t.content.name.equals(researchName) || t.content.name.equals(currentMod.name + "-" + researchName) || t.content.name.equals(SaveVersion.mapFallback(researchName)));
|
||||
|
||||
if(parent == null){
|
||||
Log.warn("Content '" + researchName + "' isn't in the tech tree, but '" + unlock.name + "' requires it to be researched.");
|
||||
if(research.getBoolean("root", false)){
|
||||
node.name = research.getString("name", unlock.name);
|
||||
node.requiresUnlock = research.getBoolean("requiresUnlock", false);
|
||||
TechTree.roots.add(node);
|
||||
}else{
|
||||
//add this node to the parent
|
||||
if(!parent.children.contains(node)){
|
||||
parent.children.add(node);
|
||||
if(researchName != null){
|
||||
//find parent node.
|
||||
TechNode parent = TechTree.all.find(t -> t.content.name.equals(researchName) || t.content.name.equals(currentMod.name + "-" + researchName) || t.content.name.equals(SaveVersion.mapFallback(researchName)));
|
||||
|
||||
if(parent == null){
|
||||
Log.warn("Content '" + researchName + "' isn't in the tech tree, but '" + unlock.name + "' requires it to be researched.");
|
||||
}else{
|
||||
//add this node to the parent
|
||||
if(!parent.children.contains(node)){
|
||||
parent.children.add(node);
|
||||
}
|
||||
//reparent the node
|
||||
node.parent = parent;
|
||||
}
|
||||
}else{
|
||||
Log.warn(unlock.name + " is not a root node, and does not have a `parent: ` property. Ignoring.");
|
||||
}
|
||||
//reparent the node
|
||||
node.parent = parent;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
|
|
|||
|
|
@ -144,7 +144,7 @@ public class PayloadDeconstructor extends PayloadBlock{
|
|||
time += edelta();
|
||||
|
||||
for(int i = 0; i < reqs.length; i++){
|
||||
accum[i] += reqs[i].amount * state.rules.deconstructRefundMultiplier * realShift;
|
||||
accum[i] += reqs[i].amount * (payload instanceof BuildPayload ? state.rules.buildCostMultiplier : 1f) * realShift;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -25,4 +25,4 @@ org.gradle.caching=true
|
|||
#used for slow jitpack builds; TODO see if this actually works
|
||||
org.gradle.internal.http.socketTimeout=100000
|
||||
org.gradle.internal.http.connectionTimeout=100000
|
||||
archash=dfcb21ce56
|
||||
archash=ef9d6ac655
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue