[ENHANCEMENT/TWEAK] Combining block damage/impact crashes with damage system
boot2big opened this issue ยท 6 comments
Damage the vehicle/part/collision group if it causes blocks to break or if they collide hard enough to cause what currently explodes the vehicle immediately.
Example would be if the vehicle in question breaks weak blocks like dirt, wood, leaves, etc. with a low hardness value the vehicle takes little to no damage, but will take more damage if the blocks destroyed have a higher hardness value like stone or obsidian.
Maybe leave the total explosion point for collision damage events that take away 50% to 100% of the vehicle's health (enough to say, destroy a plane if it goes nose first into a mountain or the ground, but not enough to punish someone in a sub-compact that accidentally brushed a wall)
@Ilya-torshov and the other folks i need your help damnit
Blocks currently damage collision box groups, but we need to agree on whether they'll also damage the vehicle or not, and if so how that will be handled
Since most packs don't (and likely won't) implement damageable collision boxes, I don't want to enforce this and have it affect vehicle death. However, I can have it at least damage the collision group health of any boxes that break blocks.... if you give me a formula for the damage they take, based on the block hardness.
That certainly is a toughy considering a couple snags, since most blocks average between 1.25 and 5 hardness, while some are upwards of 22.5 to 50 (we do not count water or lava since neither are breakable by anything in MTS), and some of the unbreakable blocks have a hardness value of -1 which ideally shouldn't repair a vehicle or its boxes on impact...
I would say if its hardness value is under 20 (not arbitrary, this is the hardness for the enderchest) then triple or even quadruple it as this would only result in the highest damage applied being 30/40, or if its above 20 then either no added multipliers or only double it, since 50 to 100 damage is already gonna be pretty nasty to a whole vehicle let alone your front bumper alone.
(Hardness values checked on https://minecraft.fandom.com/wiki/Module:Hardness_values, please correct if I'm wrong on some of these)
The unbreakable blocks are easy to account for: just ignore them. In that we can just ignore them. Bedrock is used more as a hard barrier than building material, so it not causing damage shouldn't be an issue in survival, as you can't even build with it in survival. And if you're down at Y=4, well, chances are you're in a hole and will get beat up by "digging" down there anyways.
From what I see, the logic should be something like:
if(hardness >= 20) then damage += hardness*2;
elseif(hardness > 0) then damage += 4
?