From 7dfd20d020df1ce1bd88c28d25d7d10554617411 Mon Sep 17 00:00:00 2001 From: Anuken Date: Mon, 22 Jun 2020 21:02:53 -0400 Subject: [PATCH] Core launch cost --- .../sprites/blocks/environment/sand1.png | Bin 177 -> 237 bytes core/src/mindustry/content/Blocks.java | 288 +++++++++--------- core/src/mindustry/content/Weathers.java | 2 +- core/src/mindustry/core/Control.java | 3 + core/src/mindustry/game/Schematic.java | 5 +- .../maps/generators/BaseGenerator.java | 1 + .../mindustry/ui/fragments/HudFragment.java | 3 +- core/src/mindustry/world/Block.java | 6 +- 8 files changed, 157 insertions(+), 151 deletions(-) diff --git a/core/assets-raw/sprites/blocks/environment/sand1.png b/core/assets-raw/sprites/blocks/environment/sand1.png index c7941f005984a494e13184034f169ece63ffbbf3..9ca1dda7a0d5ae9d4747000f4c7476d9d474aaed 100644 GIT binary patch delta 209 zcmV;?051Qr0qp^hB!2;OQb$4nuFf3k0001|Nklv|P0 z?@Eoo&+N5fs{`;MAd{yi0LcPKuVwhEd&m*KwM_Q7o?VB z%>oOg72T&{0Ae4AeE_}>xBw&wH$Xw4A<%t5gEP$nL^Znq2?KBgTR~Q(M#E-`00000 LNkvXXu0mjf-}zI@ delta 149 zcmV;G0BZm30kHv)B!75GL_t(|+U?e{4FDkw1HkMru?01YQ2sEKQ2$p6F<39TNX;fP}aop%)Q_gi;Vecp+OcL_$(MfPg@Xhz`g^ z_DB`e0g(#VZzzEF0qp~JvSum!z?B%%0myi&2?bbD4Q<6yat{ IntIntMap amounts = new IntIntMap(); tiles.each(t -> { + if(t.block.buildVisibility == BuildVisibility.hidden) return; + for(ItemStack stack : t.block.requirements){ - amounts.getAndIncrement(stack.item.id, 0, stack.amount); + amounts.inc(stack.item.id, stack.amount); } }); Seq stacks = new Seq<>(); diff --git a/core/src/mindustry/maps/generators/BaseGenerator.java b/core/src/mindustry/maps/generators/BaseGenerator.java index db507d2239..b398955105 100644 --- a/core/src/mindustry/maps/generators/BaseGenerator.java +++ b/core/src/mindustry/maps/generators/BaseGenerator.java @@ -44,6 +44,7 @@ public class BaseGenerator{ } } + //TODO limit base size float costBudget = 1000; Seq wallsSmall = content.blocks().select(b -> b instanceof Wall && b.size == 1); diff --git a/core/src/mindustry/ui/fragments/HudFragment.java b/core/src/mindustry/ui/fragments/HudFragment.java index b03f525f22..9c86c9c944 100644 --- a/core/src/mindustry/ui/fragments/HudFragment.java +++ b/core/src/mindustry/ui/fragments/HudFragment.java @@ -366,7 +366,8 @@ public class HudFragment extends Fragment{ t.button("test launch", Icon.warning, () -> { ui.planet.show(state.getSector(), ((CoreBlock)player.team().core().block).launchRange, player.team().core()); - }).width(150f); + }).width(150f) + .disabled(!player.team().core().items.has(player.team().core().block.requirements)); //disable core when missing resources for launch }); blockfrag.build(parent); diff --git a/core/src/mindustry/world/Block.java b/core/src/mindustry/world/Block.java index 601c31fac1..454e85c8db 100644 --- a/core/src/mindustry/world/Block.java +++ b/core/src/mindustry/world/Block.java @@ -629,11 +629,7 @@ public class Block extends UnlockableContent{ //load specific team regions teamRegions = new TextureRegion[Team.all.length]; for(Team team : Team.all){ - if(team.hasPalette){ - teamRegions[team.uid] = Core.atlas.find(name + "-team-" + team.name); - }else{ - teamRegions[team.uid] = teamRegion; - } + teamRegions[team.uid] = teamRegion.found() ? Core.atlas.find(name + "-team-" + team.name, teamRegion) : teamRegion; } }