mirror of
https://github.com/Anuken/Mindustry.git
synced 2025-02-10 02:37:12 +07:00
parent
8d91a9b014
commit
075be1a862
@ -551,7 +551,9 @@ public class TechTree implements ContentList{
|
||||
node(nuclearComplex, Seq.with(
|
||||
new SectorComplete(fungalPass),
|
||||
new Research(thermalGenerator),
|
||||
new Research(laserDrill)
|
||||
new Research(laserDrill),
|
||||
new Research(Items.plastanium),
|
||||
new Research(swarmer)
|
||||
), () -> {
|
||||
|
||||
});
|
||||
@ -613,7 +615,9 @@ public class TechTree implements ContentList{
|
||||
});
|
||||
|
||||
nodeProduce(Liquids.oil, () -> {
|
||||
nodeProduce(Items.plastanium, () -> {
|
||||
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
|
@ -139,7 +139,7 @@ abstract class BuilderComp implements Posc, Teamc, Rotc{
|
||||
boolean shouldSkip(BuildPlan request, @Nullable Building core){
|
||||
//requests that you have at least *started* are considered
|
||||
if(state.rules.infiniteResources || team().rules().infiniteResources || request.breaking || core == null) return false;
|
||||
return (request.stuck && !core.items.has(request.block.requirements)) || (Structs.contains(request.block.requirements, i -> !core.items.has(i.item)) && !request.initialized);
|
||||
return (request.stuck && !core.items.has(request.block.requirements)) || (Structs.contains(request.block.requirements, i -> !core.items.has(i.item) && Mathf.round(i.amount * state.rules.buildCostMultiplier) > 0) && !request.initialized);
|
||||
}
|
||||
|
||||
void removeBuild(int x, int y, boolean breaking){
|
||||
|
@ -1,5 +1,6 @@
|
||||
package mindustry.type;
|
||||
|
||||
import arc.math.*;
|
||||
import arc.struct.*;
|
||||
import mindustry.content.*;
|
||||
|
||||
@ -35,10 +36,10 @@ public class ItemStack implements Comparable<ItemStack>{
|
||||
return other != null && other.item == item && other.amount == amount;
|
||||
}
|
||||
|
||||
public static ItemStack[] mult(ItemStack[] stacks, int amount){
|
||||
public static ItemStack[] mult(ItemStack[] stacks, float amount){
|
||||
ItemStack[] copy = new ItemStack[stacks.length];
|
||||
for(int i = 0; i < copy.length; i++){
|
||||
copy[i] = new ItemStack(stacks[i].item, stacks[i].amount * amount);
|
||||
copy[i] = new ItemStack(stacks[i].item, Mathf.round(stacks[i].amount * amount));
|
||||
}
|
||||
return copy;
|
||||
}
|
||||
|
@ -187,10 +187,10 @@ public class Planet extends UnlockableContent{
|
||||
}
|
||||
|
||||
if(sector.hasEnemyBase()){
|
||||
sum += 2.5f;
|
||||
sum += 1.9f;
|
||||
}
|
||||
|
||||
sector.threat = sector.preset == null ? Math.min(sum / 5f, 1.5f) : Mathf.clamp(sector.preset.difficulty / 10f);
|
||||
sector.threat = sector.preset == null ? Math.min(sum / 5f, 1.2f) : Mathf.clamp(sector.preset.difficulty / 10f);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -108,7 +108,7 @@ public class Sector{
|
||||
|
||||
public boolean isBeingPlayed(){
|
||||
//after the launch dialog, a sector is no longer considered being played
|
||||
return Vars.state.isGame() && Vars.state.rules.sector == this && !Vars.state.gameOver;
|
||||
return Vars.state.isGame() && Vars.state.rules.sector == this && !Vars.state.gameOver && !net.client();
|
||||
}
|
||||
|
||||
public String name(){
|
||||
@ -169,6 +169,8 @@ public class Sector{
|
||||
}
|
||||
|
||||
public void addItems(ItemSeq items){
|
||||
if(net.client()) return;
|
||||
|
||||
if(isBeingPlayed()){
|
||||
if(state.rules.defaultTeam.core() != null){
|
||||
ItemModule storage = state.rules.defaultTeam.items();
|
||||
|
@ -64,8 +64,8 @@ public class ResearchDialog extends BaseDialog{
|
||||
ItemSeq cached = sector.items();
|
||||
cache.put(sector, cached);
|
||||
cached.each((item, amount) -> {
|
||||
values[item.id] += amount;
|
||||
total += amount;
|
||||
values[item.id] += Math.max(amount, 0);
|
||||
total += Math.max(amount, 0);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
@ -58,7 +58,7 @@ public class LaunchPad extends Block{
|
||||
|
||||
@Override
|
||||
public Cursor getCursor(){
|
||||
return !state.isCampaign() ? SystemCursor.arrow : super.getCursor();
|
||||
return !state.isCampaign() || net.client() ? SystemCursor.arrow : super.getCursor();
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -136,7 +136,7 @@ public class LaunchPad extends Block{
|
||||
|
||||
@Override
|
||||
public void buildConfiguration(Table table){
|
||||
if(!state.isCampaign()){
|
||||
if(!state.isCampaign() || net.client()){
|
||||
deselect();
|
||||
return;
|
||||
}
|
||||
@ -234,7 +234,9 @@ public class LaunchPad extends Block{
|
||||
Events.fire(new LaunchItemEvent(stack));
|
||||
}
|
||||
|
||||
destsec.addItems(dest);
|
||||
if(!net.client()){
|
||||
destsec.addItems(dest);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -50,7 +50,7 @@ public class Junction extends Block{
|
||||
Building dest = nearby(i);
|
||||
|
||||
//skip blocks that don't want the item, keep waiting until they do
|
||||
if(dest == null || !dest.acceptItem(this, item) || dest.team != team){
|
||||
if(item == null || dest == null || !dest.acceptItem(this, item) || dest.team != team){
|
||||
continue;
|
||||
}
|
||||
|
||||
|
@ -144,7 +144,7 @@ public class CoreBlock extends StorageBlock{
|
||||
//right before placing, create a "destination" item array which is all the previous items minus core requirements
|
||||
ItemModule items = tile.build.items.copy();
|
||||
if(!state.rules.infiniteResources){
|
||||
items.remove(requirements);
|
||||
items.remove(ItemStack.mult(requirements, state.rules.buildCostMultiplier));
|
||||
}
|
||||
|
||||
nextItems = items;
|
||||
@ -157,7 +157,7 @@ public class CoreBlock extends StorageBlock{
|
||||
|
||||
if(!canPlaceOn(world.tile(x, y), player.team())){
|
||||
|
||||
drawPlaceText(Core.bundle.get((player.team().core() != null && player.team().core().items.has(requirements)) || state.rules.infiniteResources ?
|
||||
drawPlaceText(Core.bundle.get((player.team().core() != null && player.team().core().items.has(requirements, state.rules.buildCostMultiplier)) || state.rules.infiniteResources ?
|
||||
"bar.corereq" :
|
||||
"bar.noresources"
|
||||
), x, y, valid);
|
||||
|
@ -317,7 +317,7 @@ public class SStats implements SteamUserStatsCallback{
|
||||
SStat.attacksWon.add();
|
||||
}
|
||||
|
||||
if(!e.sector.isBeingPlayed()){
|
||||
if(!e.sector.isBeingPlayed() && !net.client()){
|
||||
captureBackground.complete();
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user