placeEffect (#7968)

This commit is contained in:
MEEPofFaith
2023-01-07 08:46:14 -08:00
committed by GitHub
parent 0d26b9e4f8
commit 6eadac38b7
6 changed files with 8 additions and 6 deletions

View File

@@ -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. */

View File

@@ -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);
}

View File

@@ -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;
}

View File

@@ -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);