placeEffect (#7968)
This commit is contained in:
@@ -312,6 +312,8 @@ public class Block extends UnlockableContent implements Senseable{
|
||||
public float deconstructThreshold = 0f;
|
||||
/** If true, this block deconstructs immediately. Instant deconstruction implies no resource refund. */
|
||||
public boolean instantDeconstruct = false;
|
||||
/** Effect for placing the block. Passes size as rotation. */
|
||||
public Effect placeEffect = Fx.placeBlock;
|
||||
/** Effect for breaking the block. Passes size as rotation. */
|
||||
public Effect breakEffect = Fx.breakBlock;
|
||||
/** Effect for destroying the block. */
|
||||
|
||||
@@ -99,7 +99,7 @@ public class ConstructBlock extends Block{
|
||||
}
|
||||
|
||||
if(fogControl.isVisibleTile(team, tile.x, tile.y)){
|
||||
Fx.placeBlock.at(tile.drawx(), tile.drawy(), block.size);
|
||||
block.placeEffect.at(tile.drawx(), tile.drawy(), block.size);
|
||||
if(shouldPlay()) block.placeSound.at(tile, block.placePitchChange ? calcPitch(true) : 1f);
|
||||
}
|
||||
|
||||
|
||||
@@ -96,7 +96,7 @@ public abstract class BlockProducer extends PayloadBlock{
|
||||
if(progress >= recipe.buildCost){
|
||||
consume();
|
||||
payload = new BuildPayload(recipe, team);
|
||||
Fx.placeBlock.at(x, y, payload.size() / tilesize);
|
||||
payload.block().placeEffect.at(x, y, payload.size() / tilesize);
|
||||
payVector.setZero();
|
||||
progress %= 1f;
|
||||
}
|
||||
|
||||
@@ -150,7 +150,7 @@ public class CoreBlock extends StorageBlock{
|
||||
//finish placement immediately when a block is replaced.
|
||||
if(previous instanceof CoreBlock){
|
||||
tile.setBlock(this, tile.team());
|
||||
Fx.placeBlock.at(tile, tile.block().size);
|
||||
tile.block().placeEffect.at(tile, tile.block().size);
|
||||
Fx.upgradeCore.at(tile.drawx(), tile.drawy(), 0f, tile.block());
|
||||
Fx.upgradeCoreBloom.at(tile, tile.block().size);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user