Cubyz
Cubyz copied to clipboard
Dynamite!
Description
This pull request introduces sulfur based explosives:
- dynamite stick
- dynamite block
Dynamite stick is crafted from 2 sulfur and 2 coal
It can be placed like torch and can be ignited with torch. Explosion is instant and does not harm player.
Dynamite block can be crafted with 16 dynamite sticks
It has significantly higher block damage and damage radius
Explosions are done with ray casting and take resistance and health of block they break into account to reduce the radius of the explosion. Blocks marked as air and fluid are not destroyed.
Links
Depends on: #1313 Related to: #849
I cannot accept this until #610 (to avoid lag spikes) and #81 (to avoid griefing) are resolved. Alternatively, a gamerule to disable explosives could be a short-term workaround for the survival world until we have those features.
The dynamite block model is clever, but it stops you from making a giant pile of dynamite (without there being a bunch of gaps). I think a standard cube would be fine:
Question: would a pile of dynamite increase its range, or its power?
Both, preferably as emergent behavior. I would prefer to avoid dynamite blocks flying around like in minecraft tho. With #1261 we can make dynamite explosion damage blocks it can not break, so consecutive explosions would break blocks damaged by previous ones. As for range, I would like to count how many TNT blocks are touching and merge their explosion strength and range as an optimization.
That said current tag based system (explosionSmall and friends) for explosion control is not acceptable long term. IMO we should allow for arbitrary attributes (that are not performance critical, not for rendering control) for blocks to be stored in hash map of ZonElements. This problem will re-appear every time we add some non-binary configurable trait of a block (or item!),
to name few:
- food value,
- explosion strength and radius,
- fluid spread radius, viscosity
- inventory capacity for storage blocks 3-rd party modifications will be interested in this kind of parameters too.
Resolved conflicts with network refactor.
Damage for stone and mud
Future improvements:
- [ ] Sticks of dynamite should be throwable
- [ ] Sticks of dynamite should be placeable on bottom of a block
- [ ] Delayed explosions with dedicated EntityDataClass
- [ ] Chained explosions
- [ ] Ignition animation
- [ ] Explosion particles
- [ ] Damage to blocks which were not broken but were in explosion radius (#1261)
- [ ] Entity damage
- [ ] Scale damage with number of dynamite sticks placed in one block
- [ ] Block drops
- [x] Batched block updates
- [ ] Placeable string / gunpowder to be used as fuse for igniting dynamite from afar
- [ ] Torches replace dynamite when placed on same block and vice versa
- [ ] VTable based item interactions?
- [ ] Maybe we should have system for arbitrary properties? Explosives could use
explosionStrengthandexplosionRadiusbut adding them for all blocks doesn't make sense.
Closing until it's a priority to integrate similar stuff into engine.