mirror of
https://github.com/PixelGuys/Cubyz.git
synced 2025-08-03 19:28:49 -04:00
Hardcode the chisel break time to 0.5 seconds, to make it easier in survival.
This commit is contained in:
parent
4196870814
commit
35883591d2
@ -854,11 +854,18 @@ pub const MeshSelection = struct { // MARK: MeshSelection
|
|||||||
if(isTool) {
|
if(isTool) {
|
||||||
power = stack.item.?.tool.getPowerByBlockClass(block.blockClass());
|
power = stack.item.?.tool.getPowerByBlockClass(block.blockClass());
|
||||||
}
|
}
|
||||||
|
const isChisel = stack.item != null and stack.item.? == .baseItem and std.mem.eql(u8, stack.item.?.baseItem.id, "cubyz:chisel");
|
||||||
|
if(isChisel and block.mode() == main.rotation.getByID("stairs")) { // TODO: Remove once the chisel is a tool.
|
||||||
|
power = 10;
|
||||||
|
}
|
||||||
if(power >= block.breakingPower()) {
|
if(power >= block.breakingPower()) {
|
||||||
var breakTime: f32 = block.blockHealth();
|
var breakTime: f32 = block.blockHealth();
|
||||||
if(isTool) {
|
if(isTool) {
|
||||||
breakTime = breakTime*stack.item.?.tool.swingTime/power;
|
breakTime = breakTime*stack.item.?.tool.swingTime/power;
|
||||||
}
|
}
|
||||||
|
if(isChisel and block.mode() == main.rotation.getByID("stairs")) { // TODO: Remove once the chisel is a tool.
|
||||||
|
breakTime = 0.5;
|
||||||
|
}
|
||||||
currentBlockProgress += @as(f32, @floatCast(deltaTime))/breakTime;
|
currentBlockProgress += @as(f32, @floatCast(deltaTime))/breakTime;
|
||||||
if(currentBlockProgress < 1) {
|
if(currentBlockProgress < 1) {
|
||||||
mesh_storage.removeBreakingAnimation(lastSelectedBlockPos);
|
mesh_storage.removeBreakingAnimation(lastSelectedBlockPos);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user