placeEffect (#7968)
This commit is contained in:
@@ -250,7 +250,7 @@ public class Control implements ApplicationListener, Loadable{
|
||||
}else{
|
||||
//when already hosting, instantly build everything. this looks bad but it's better than a desync
|
||||
Fx.coreBuildBlock.at(build.x, build.y, 0f, build.block);
|
||||
Fx.placeBlock.at(build.x, build.y, build.block.size);
|
||||
build.block.placeEffect.at(build.x, build.y, build.block.size);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -288,7 +288,7 @@ public class Control implements ApplicationListener, Loadable{
|
||||
build.dropped();
|
||||
|
||||
Fx.coreBuildBlock.at(build.x, build.y, 0f, build.block);
|
||||
Fx.placeBlock.at(build.x, build.y, build.block.size);
|
||||
build.block.placeEffect.at(build.x, build.y, build.block.size);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -179,7 +179,7 @@ abstract class PayloadComp implements Posc, Rotc, Hitboxc, Unitc{
|
||||
}
|
||||
|
||||
Fx.unitDrop.at(tile);
|
||||
Fx.placeBlock.at(on.drawx(), on.drawy(), on.block().size);
|
||||
on.block().placeEffect.at(on.drawx(), on.drawy(), on.block().size);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@@ -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