|
52 | 52 | -- Container:destroy removes all blocks of the |
53 | 53 | -- container, it won't be visible on the map anymore |
54 | 54 | function Container:destroy(running) |
| 55 | + X = self.x+2 |
| 56 | + Y = GROUND_LEVEL+2 |
| 57 | + Z = self.z+2 |
| 58 | + LOG("Exploding at X:" .. X .. " Y:" .. Y .. " Z:" .. Z) |
| 59 | + local World = cRoot:Get():GetDefaultWorld() |
| 60 | + World:BroadcastSoundEffect("random.explode", X, Y, Z, 1, 1) |
| 61 | + World:BroadcastParticleEffect("hugeexplosion",X, Y, Z, 0, 0, 0, 1, 1) |
| 62 | + |
| 63 | + -- if a block is removed before it's button/lever/sign, that object will drop |
| 64 | + -- and the player can collect it. Remove these first |
| 65 | + |
| 66 | + -- lever |
| 67 | + digBlock(UpdateQueue,self.x+1,GROUND_LEVEL+3,self.z+1) |
| 68 | + -- signs |
| 69 | + digBlock(UpdateQueue,self.x+3,GROUND_LEVEL+2,self.z-1) |
| 70 | + digBlock(UpdateQueue,self.x,GROUND_LEVEL+2,self.z-1) |
| 71 | + digBlock(UpdateQueue,self.x+1,GROUND_LEVEL+2,self.z-1) |
| 72 | + -- torch |
| 73 | + digBlock(UpdateQueue,self.x+1,GROUND_LEVEL+3,self.z+1) |
| 74 | + --button |
| 75 | + digBlock(UpdateQueue,self.x+2,GROUND_LEVEL+3,self.z+2) |
| 76 | + |
| 77 | + -- rest of the blocks |
55 | 78 | for py = GROUND_LEVEL+1, GROUND_LEVEL+4 |
56 | 79 | do |
57 | 80 | for px=self.x-1, self.x+4 |
|
0 commit comments