Merge remote-tracking branch 'origin/master'
This commit is contained in:
@@ -1108,7 +1108,7 @@ abstract class BuildingComp implements Posc, Teamc, Healthc, Buildingc, Timerc,
|
||||
}
|
||||
|
||||
public void drawCracks(){
|
||||
if(!damaged() || block.size > BlockRenderer.maxCrackSize) return;
|
||||
if(!block.drawCracks || !damaged() || block.size > BlockRenderer.maxCrackSize) return;
|
||||
int id = pos();
|
||||
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);
|
||||
@@ -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);
|
||||
|
||||
if(!floor().solid && !floor().isLiquid){
|
||||
if(block.createRubble && !floor().solid && !floor().isLiquid){
|
||||
Effect.rubble(x, y, block.size);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -547,7 +547,7 @@ public class PlacementFragment{
|
||||
}
|
||||
|
||||
Seq<Block> getByCategory(Category cat){
|
||||
return returnArray.selectFrom(content.blocks(), block -> block.category == cat && block.isVisible());
|
||||
return returnArray.selectFrom(content.blocks(), block -> block.category == cat && block.isVisible() && block.environmentBuildable());
|
||||
}
|
||||
|
||||
Seq<Block> getUnlockedByCategory(Category cat){
|
||||
|
||||
@@ -166,6 +166,10 @@ public class Block extends UnlockableContent implements Senseable{
|
||||
public float baseExplosiveness = 0f;
|
||||
/** bullet that this block spawns when destroyed */
|
||||
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. */
|
||||
public boolean floating = false;
|
||||
/** multiblock size */
|
||||
|
||||
@@ -80,6 +80,7 @@ public class PayloadMassDriver extends PayloadBlock{
|
||||
|
||||
stats.add(Stat.payloadCapacity, StatValues.squared(maxPayloadSize, StatUnit.blocksSquared));
|
||||
stats.add(Stat.reload, 60f / (chargeTime + reload), StatUnit.seconds);
|
||||
stats.add(Stat.shootRange, range / tilesize, StatUnit.blocks);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -48,6 +48,13 @@ public class BeamNode extends PowerBlock{
|
||||
addBar("batteries", PowerNode.makeBatteryBalance());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setStats(){
|
||||
super.setStats();
|
||||
|
||||
stats.add(Stat.powerRange, range, StatUnit.blocks);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void init(){
|
||||
super.init();
|
||||
|
||||
@@ -5,9 +5,11 @@ import arc.graphics.*;
|
||||
import arc.graphics.g2d.*;
|
||||
import arc.math.*;
|
||||
import arc.math.geom.*;
|
||||
import arc.struct.*;
|
||||
import arc.util.*;
|
||||
import arc.util.io.*;
|
||||
import mindustry.annotations.Annotations.*;
|
||||
import mindustry.content.*;
|
||||
import mindustry.entities.units.*;
|
||||
import mindustry.game.*;
|
||||
import mindustry.gen.*;
|
||||
@@ -15,6 +17,7 @@ import mindustry.graphics.*;
|
||||
import mindustry.type.*;
|
||||
import mindustry.ui.*;
|
||||
import mindustry.world.*;
|
||||
import mindustry.world.blocks.environment.*;
|
||||
import mindustry.world.meta.*;
|
||||
|
||||
import static mindustry.Vars.*;
|
||||
@@ -102,6 +105,9 @@ public class BeamDrill extends Block{
|
||||
public void setStats(){
|
||||
super.setStats();
|
||||
|
||||
stats.add(Stat.drillTier, StatValues.blocks(b -> (b instanceof Floor f && f.wallOre && f.itemDrop != null && f.itemDrop.hardness <= tier) || (b instanceof StaticWall w && w.itemDrop != null && w.itemDrop.hardness <= tier)));
|
||||
|
||||
stats.add(Stat.drillSpeed, 60f / drillTime * size, StatUnit.itemsSecond);
|
||||
if(optionalBoostIntensity != 1){
|
||||
stats.add(Stat.boostEffect, optionalBoostIntensity, StatUnit.timesSpeed);
|
||||
}
|
||||
|
||||
@@ -64,6 +64,7 @@ public class WallCrafter extends Block{
|
||||
|
||||
stats.add(Stat.output, output);
|
||||
stats.add(Stat.tiles, StatValues.blocks(attribute, floating, 1f, true, false));
|
||||
stats.add(Stat.drillSpeed, 60f / drillTime * size);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -11,6 +11,7 @@ import mindustry.gen.*;
|
||||
import mindustry.graphics.*;
|
||||
import mindustry.logic.*;
|
||||
import mindustry.world.*;
|
||||
import mindustry.world.meta.*;
|
||||
|
||||
import static mindustry.Vars.*;
|
||||
|
||||
@@ -29,6 +30,14 @@ public class RepairTower extends Block{
|
||||
solid = true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setStats(){
|
||||
super.setStats();
|
||||
|
||||
stats.add(Stat.range, range, StatUnit.blocks);
|
||||
stats.add(Stat.repairSpeed, healAmount * 60f, StatUnit.perSecond);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void drawPlace(int x, int y, int rotation, boolean valid){
|
||||
super.drawPlace(x, y, rotation, valid);
|
||||
|
||||
@@ -204,7 +204,7 @@ public class StatValues{
|
||||
for(int i = 0; i < list.size; i++){
|
||||
var item = list.get(i);
|
||||
|
||||
if(item instanceof Block block && block.itemDrop != null && !block.itemDrop.unlocked()) continue;
|
||||
if(item instanceof Block block && block.itemDrop != null && !block.itemDrop.unlockedNow()) continue;
|
||||
|
||||
if(item.uiIcon.found()) l.image(item.uiIcon).size(iconSmall).padRight(2).padLeft(2).padTop(3).padBottom(3);
|
||||
l.add(item.localizedName).left().padLeft(1).padRight(4).colspan(item.uiIcon.found() ? 1 : 2);
|
||||
|
||||
Reference in New Issue
Block a user