Upgradeable cores

This commit is contained in:
Anuken
2020-06-27 19:16:39 -04:00
parent 313cadb763
commit 80332e37d5
63 changed files with 365 additions and 290 deletions

View File

@@ -63,7 +63,7 @@ public class BaseGenerator{
Schematics.placeLoadout(coreschem.schematic, tile.x, tile.y, team, coreschem.required instanceof Item ? ores.get((Item)coreschem.required) : Blocks.oreCopper);
//fill core with every type of item (even non-material)
Building entity = tile.entity;
Building entity = tile.build;
for(Item item : content.items()){
entity.items.add(item, entity.block().itemCapacity);
}
@@ -130,9 +130,11 @@ public class BaseGenerator{
}
public void postGenerate(){
if(tiles == null) return;
for(Tile tile : tiles){
if(tile.isCenter() && tile.block() instanceof PowerNode){
tile.entity.placed();
tile.build.placed();
}
}
}

View File

@@ -34,7 +34,7 @@ public class FileMapGenerator implements WorldGenerator{
if(tile.block() instanceof StorageBlock && !(tile.block() instanceof CoreBlock) && state.hasSector()){
for(Content content : state.getSector().data.resources){
if(content instanceof Item && Mathf.chance(0.3)){
tile.entity.items.add((Item)content, Math.min(Mathf.random(500), tile.block().itemCapacity));
tile.build.items.add((Item)content, Math.min(Mathf.random(500), tile.block().itemCapacity));
}
}
}