Drill balancing / More starting resources

This commit is contained in:
Anuken
2018-08-07 16:13:37 -04:00
parent 4b61f273d5
commit 18ebda01a4
4 changed files with 42 additions and 36 deletions

View File

@@ -14,10 +14,6 @@ public class Items implements ContentList{
@Override
public void load(){
stone = new Item("stone", Color.valueOf("777777")){{
hardness = 3;
}};
tungsten = new Item("tungsten", Color.valueOf("a0b0c8")){{
type = ItemType.material;
hardness = 1;
@@ -54,6 +50,10 @@ public class Items implements ContentList{
cost = 1.2f;
}};
stone = new Item("stone", Color.valueOf("777777")){{
hardness = 3;
}};
silicon = new Item("silicon", Color.valueOf("53565c")){{
type = ItemType.material;
cost = 0.9f;

View File

@@ -109,8 +109,8 @@ public class Recipes implements ContentList{
new Recipe(distribution, StorageBlocks.vault, new ItemStack(Items.carbide, 500), new ItemStack(Items.thorium, 350));
//DRILLS, PRODUCERS
new Recipe(production, ProductionBlocks.tungstenDrill, new ItemStack(Items.tungsten, 15));
new Recipe(production, ProductionBlocks.carbideDrill, new ItemStack(Items.tungsten, 25), new ItemStack(Items.carbide, 40));
new Recipe(production, ProductionBlocks.tungstenDrill, new ItemStack(Items.tungsten, 40));
new Recipe(production, ProductionBlocks.carbideDrill, new ItemStack(Items.tungsten, 50), new ItemStack(Items.carbide, 40));
new Recipe(production, ProductionBlocks.laserdrill, new ItemStack(Items.tungsten, 70), new ItemStack(Items.carbide, 90), new ItemStack(Items.silicon, 60), new ItemStack(Items.titanium, 50));
new Recipe(production, ProductionBlocks.blastdrill, new ItemStack(Items.tungsten, 130), new ItemStack(Items.carbide, 180), new ItemStack(Items.silicon, 120), new ItemStack(Items.titanium, 100), new ItemStack(Items.thorium, 60));

View File

@@ -151,17 +151,17 @@ public class Sectors{
//set starter items
if(sector.difficulty > 12){ //now with titanium
sector.startingItems = Array.with(new ItemStack(Items.tungsten, 1800), new ItemStack(Items.lead, 550), new ItemStack(Items.carbide, 470), new ItemStack(Items.silicon, 460), new ItemStack(Items.titanium, 230));
sector.startingItems = Array.with(new ItemStack(Items.tungsten, 1900), new ItemStack(Items.lead, 600), new ItemStack(Items.carbide, 470), new ItemStack(Items.silicon, 460), new ItemStack(Items.titanium, 230));
}else if(sector.difficulty > 8){ //just more resources
sector.startingItems = Array.with(new ItemStack(Items.tungsten, 1400), new ItemStack(Items.lead, 400), new ItemStack(Items.carbide, 340), new ItemStack(Items.silicon, 250));
sector.startingItems = Array.with(new ItemStack(Items.tungsten, 1500), new ItemStack(Items.lead, 450), new ItemStack(Items.carbide, 340), new ItemStack(Items.silicon, 250));
}else if(sector.difficulty > 5){ //now with silicon
sector.startingItems = Array.with(new ItemStack(Items.tungsten, 900), new ItemStack(Items.lead, 300), new ItemStack(Items.carbide, 190), new ItemStack(Items.silicon, 140));
sector.startingItems = Array.with(new ItemStack(Items.tungsten, 950), new ItemStack(Items.lead, 350), new ItemStack(Items.carbide, 190), new ItemStack(Items.silicon, 140));
}else if(sector.difficulty > 3){ //now with carbide
sector.startingItems = Array.with(new ItemStack(Items.tungsten, 650), new ItemStack(Items.lead, 200), new ItemStack(Items.carbide, 130));
sector.startingItems = Array.with(new ItemStack(Items.tungsten, 700), new ItemStack(Items.lead, 250), new ItemStack(Items.carbide, 130));
}else if(sector.difficulty > 1){ //more starter items for faster start
sector.startingItems = Array.with(new ItemStack(Items.tungsten, 400), new ItemStack(Items.lead, 150));
sector.startingItems = Array.with(new ItemStack(Items.tungsten, 500), new ItemStack(Items.lead, 180));
}else{ //base starting items to prevent grinding much
sector.startingItems = Array.with(new ItemStack(Items.tungsten, 150), new ItemStack(Items.lead, 70));
sector.startingItems = Array.with(new ItemStack(Items.tungsten, 170), new ItemStack(Items.lead, 70));
}
}

View File

@@ -26,7 +26,6 @@ public class Drill extends Block{
protected final int timerDump = timers++;
protected final Array<Tile> drawTiles = new Array<>();
protected final Array<Item> toAdd = new Array<>();
/**Maximum tier of blocks this drill can mine.*/
protected int tier;
@@ -140,37 +139,44 @@ public class Drill extends Block{
@Override
public void update(Tile tile){
toAdd.clear();
DrillEntity entity = tile.entity();
float multiplier = 0f;
float totalHardness = 0f;
boolean foundDominant = entity.dominantItem != null;
if(entity.dominantItem == null){
boolean foundDominant = false;
for(Tile other : tile.getLinkedTiles(tempTiles)){
if(isValid(other)){
Item drop = getDrop(other);
toAdd.add(drop);
totalHardness += drop.hardness;
multiplier += 1f;
for(Tile other : tile.getLinkedTiles(tempTiles)){
if(isValid(other)){
Item drop = getDrop(other);
if(!foundDominant){
entity.dominantItem = drop;
foundDominant = true;
}else if(entity.dominantItem != drop){
entity.dominantItem = null;
if(!foundDominant){
entity.dominantItem = drop;
foundDominant = true;
}else if(entity.dominantItem != drop && drop.id < entity.dominantItem.id){
entity.dominantItem = drop;
}
}
}
for(Tile other : tile.getLinkedTiles(tempTiles)){
if(isValid(other) && other.floor().dropsItem(entity.dominantItem)){
entity.dominantItems ++;
}
}
}
if(entity.dominantItem == null){
return;
}
float totalHardness = entity.dominantItems * entity.dominantItem.hardness;
if(entity.timer.get(timerDump, 15)){
tryDump(tile);
}
entity.drillTime += entity.warmup * Timers.delta();
if(entity.items.total() < itemCapacity && toAdd.size > 0 && entity.cons.valid()){
if(entity.items.total() < itemCapacity && entity.dominantItems > 0 && entity.cons.valid()){
float speed = 1f;
@@ -179,7 +185,7 @@ public class Drill extends Block{
}
entity.warmup = Mathf.lerpDelta(entity.warmup, speed, warmupSpeed);
entity.progress += Timers.delta() * multiplier * speed * entity.warmup;
entity.progress += Timers.delta() * entity.dominantItems * speed * entity.warmup;
if(Mathf.chance(Timers.delta() * updateEffectChance * entity.warmup))
Effects.effect(updateEffect, entity.x + Mathf.range(size * 2f), entity.y + Mathf.range(size * 2f));
@@ -188,18 +194,17 @@ public class Drill extends Block{
return;
}
if(toAdd.size > 0 && entity.progress >= drillTime + hardnessDrillMultiplier * Math.max(totalHardness, 1f) / multiplier
if(entity.dominantItems > 0 && entity.progress >= drillTime + hardnessDrillMultiplier * Math.max(totalHardness, 1f) / entity.dominantItems
&& tile.entity.items.total() < itemCapacity){
int index = entity.index % toAdd.size;
offloadNear(tile, toAdd.get(index));
offloadNear(tile, entity.dominantItem);
useContent(toAdd.get(index));
useContent(entity.dominantItem);
entity.index++;
entity.progress = 0f;
Effects.effect(drillEffect, toAdd.get(index).color,
Effects.effect(drillEffect, entity.dominantItem.color,
entity.x + Mathf.range(size), entity.y + Mathf.range(size));
}
}
@@ -237,6 +242,7 @@ public class Drill extends Block{
public float warmup;
public float drillTime;
public int dominantItems;
public Item dominantItem;
}