drawCracks and createRubble (#6989)
This commit is contained in:
@@ -1108,7 +1108,7 @@ abstract class BuildingComp implements Posc, Teamc, Healthc, Buildingc, Timerc,
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void drawCracks(){
|
public void drawCracks(){
|
||||||
if(!damaged() || block.size > BlockRenderer.maxCrackSize) return;
|
if(!block.drawCracks || !damaged() || block.size > BlockRenderer.maxCrackSize) return;
|
||||||
int id = pos();
|
int id = pos();
|
||||||
TextureRegion region = renderer.blocks.cracks[block.size - 1][Mathf.clamp((int)((1f - healthf()) * BlockRenderer.crackRegions), 0, BlockRenderer.crackRegions-1)];
|
TextureRegion region = renderer.blocks.cracks[block.size - 1][Mathf.clamp((int)((1f - healthf()) * BlockRenderer.crackRegions), 0, BlockRenderer.crackRegions-1)];
|
||||||
Draw.colorl(0.2f, 0.1f + (1f - healthf())* 0.6f);
|
Draw.colorl(0.2f, 0.1f + (1f - healthf())* 0.6f);
|
||||||
@@ -1322,7 +1322,7 @@ abstract class BuildingComp implements Posc, Teamc, Healthc, Buildingc, Timerc,
|
|||||||
|
|
||||||
Damage.dynamicExplosion(x, y, flammability, explosiveness * 3.5f, power, tilesize * block.size / 2f, state.rules.damageExplosions, block.destroyEffect);
|
Damage.dynamicExplosion(x, y, flammability, explosiveness * 3.5f, power, tilesize * block.size / 2f, state.rules.damageExplosions, block.destroyEffect);
|
||||||
|
|
||||||
if(!floor().solid && !floor().isLiquid){
|
if(block.createRubble && !floor().solid && !floor().isLiquid){
|
||||||
Effect.rubble(x, y, block.size);
|
Effect.rubble(x, y, block.size);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -166,6 +166,10 @@ public class Block extends UnlockableContent implements Senseable{
|
|||||||
public float baseExplosiveness = 0f;
|
public float baseExplosiveness = 0f;
|
||||||
/** bullet that this block spawns when destroyed */
|
/** bullet that this block spawns when destroyed */
|
||||||
public @Nullable BulletType destroyBullet = null;
|
public @Nullable BulletType destroyBullet = null;
|
||||||
|
/** whether cracks are drawn when this block is damaged */
|
||||||
|
public boolean drawCracks = true;
|
||||||
|
/** whether rubble is created when this block is destroyed */
|
||||||
|
public boolean createRubble = true;
|
||||||
/** whether this block can be placed on edges of liquids. */
|
/** whether this block can be placed on edges of liquids. */
|
||||||
public boolean floating = false;
|
public boolean floating = false;
|
||||||
/** multiblock size */
|
/** multiblock size */
|
||||||
|
|||||||
Reference in New Issue
Block a user