Core containers/vaults no longer explode violently
This commit is contained in:
@@ -1018,6 +1018,11 @@ abstract class BuildingComp implements Posc, Teamc, Healthc, Buildingc, Timerc,
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** @return the cap for item amount calculations, used when this block explodes. */
|
||||||
|
public int explosionItemCap(){
|
||||||
|
return block.itemCapacity;
|
||||||
|
}
|
||||||
|
|
||||||
/** Called when the block is destroyed. The tile is still intact at this stage. */
|
/** Called when the block is destroyed. The tile is still intact at this stage. */
|
||||||
public void onDestroyed(){
|
public void onDestroyed(){
|
||||||
float explosiveness = block.baseExplosiveness;
|
float explosiveness = block.baseExplosiveness;
|
||||||
@@ -1026,7 +1031,7 @@ abstract class BuildingComp implements Posc, Teamc, Healthc, Buildingc, Timerc,
|
|||||||
|
|
||||||
if(block.hasItems){
|
if(block.hasItems){
|
||||||
for(Item item : content.items()){
|
for(Item item : content.items()){
|
||||||
int amount = items.get(item);
|
int amount = Math.min(items.get(item), explosionItemCap());
|
||||||
explosiveness += item.explosiveness * amount;
|
explosiveness += item.explosiveness * amount;
|
||||||
flammability += item.flammability * amount;
|
flammability += item.flammability * amount;
|
||||||
power += item.charge * amount * 100f;
|
power += item.charge * amount * 100f;
|
||||||
|
|||||||
@@ -83,6 +83,12 @@ public class StorageBlock extends Block{
|
|||||||
return itemCapacity;
|
return itemCapacity;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int explosionItemCap(){
|
||||||
|
//when linked to a core, containers/vaults are made significantly less explosive.
|
||||||
|
return linkedCore != null ? Math.min(itemCapacity/60, 6) : itemCapacity;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void drawSelect(){
|
public void drawSelect(){
|
||||||
if(linkedCore != null){
|
if(linkedCore != null){
|
||||||
|
|||||||
Reference in New Issue
Block a user