Core launch cost

This commit is contained in:
Anuken 2020-06-22 21:02:53 -04:00
parent 58d8e22b40
commit 7dfd20d020
8 changed files with 157 additions and 151 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 177 B

After

Width:  |  Height:  |  Size: 237 B

File diff suppressed because it is too large Load Diff

View File

@ -159,7 +159,7 @@ public class Weathers implements ContentList{
sandstorm = new Weather("sandstorm"){
TextureRegion region;
float yspeed = 0.3f, xspeed = 6f, padding = 110f, size = 110f, invDensity = 800f;
Vec2 force = new Vec2(0.4f, 0.01f);
Vec2 force = new Vec2(0.45f, 0.01f);
Color color = Color.valueOf("f7cba4");
@Override

View File

@ -247,6 +247,9 @@ public class Control implements ApplicationListener, Loadable{
ent.block(Blocks.coreShard);
ent.lifetime(Vars.launchDuration);
ent.add();
//remove launch requirements from core
player.team().core().items.remove(player.team().core().block.requirements);
}
public void playSector(Sector sector){

View File

@ -10,6 +10,7 @@ import mindustry.mod.Mods.*;
import mindustry.type.*;
import mindustry.world.*;
import mindustry.world.blocks.storage.*;
import mindustry.world.meta.*;
import static mindustry.Vars.*;
@ -32,8 +33,10 @@ public class Schematic implements Publishable, Comparable<Schematic>{
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<ItemStack> stacks = new Seq<>();

View File

@ -44,6 +44,7 @@ public class BaseGenerator{
}
}
//TODO limit base size
float costBudget = 1000;
Seq<Block> wallsSmall = content.blocks().select(b -> b instanceof Wall && b.size == 1);

View File

@ -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);

View File

@ -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;
}
}