CleverRaven/Cataclysm-DDA — pull request #8920 by i2amroy (2014-09-10 11:31:59+00:00)
Title: Bashing Update

#### Summary
1. Fills in every bit of missing bash data I could find.
2. Removes those dang permanent rubble fields.
3. Makes rubble, wreckage, and ash furniture.
4. Merges the destroy and bash functions.
5. Added the ability to construct a real bed, fence gate, and set up a few more things similar to the anvil (such as the still, forge, etc.).

#### Gameplay Changes
1. Bashing things that you don't have a hope of breaking warn you after a few hits now.
2. Most things are bashable now, so feel free to break down walls with sledgehammers and whatnot.
3. All rubble types now grant a balancing penalty similar to that of roller skates, rather than a larger speed penalty. Overall the effect is somewhat a cross between the old rubble terrain and the old rubble field effects.
4. Bashing fungal things makes them emit spores.
5. Rubble now works as a sealed container, so it can fall on top of items that were present and trap them there until it gets cleaned up. This also prevents you from being able to see what exactly is under all that rubble until it gets cleaned up.

#### Technical Stuff
1. No more BASHABLE flag, it's now determined on the fly based on the actual data of the terrain.
2. Destructible stuff is similarly determined as needed, mostly as an extension of the bashing field.
3. Removed a few "OH GOD FIX THIS PLEASE & TODO" spots.
4. Removed the EXPLODES flag as it was locked in stone. Gas pumps still explode in fire due to a combination of exploding on bashing and being flammable.
5. Removed both the "chance" and "num_tests" values from bashing data because they make the probabilities go haywire. An easy example is how raising your strength from 8->9 could be over a 100x increase in your chance of bashing something vs. 30->31. It's now a nice linear slope. Similarly all the "chance" field was doing was giving bushes the ability to randomly become the strongest thing in the universe.
6. Added the "str_min_roll" and "str_max_roll" fields to the bash data structure in case you truly wanted to control that.
7. Destroy() now works as a loop of bash() that keeps going until everything it can destroy has been (or it finds itself stuck in a loop).
8. Monsters that used to be able to destroy things now simply get a magic multiplier to their bash skill.
9. Changed the way collapsing ceilings are handled. They now tend to not collapse as much early, but they eventually tend to reach a critical point where most of the ceiling will go at once (similar to real life).
10. The various types of rubble have all been simplified to a single rubble function.
11. Items from rubble are now placed when the rubble is created, rather then being magically generated on cleanup. This allows for individualized returns from rubble based on the terrain destroyed. For mapgen there is still a small amount of hardcoding present, but it has been centralized into a single location.
12. Removed a few totally unused terrains. This should only cause error messages if people had used the debug menu map editor to put them into their saves.
13. Changed a few of the power station terrain id's, since there was no need to have "_pw_st_" in something like a large metal support that could easily be used elsewhere.
14. Reduces the type of vehicle collisions, simplifying there.

### Crash/Bug Fixes
1. Stopped the game from instantly crashing if "t_null" terrain was present.
2. Stopped the electromagnet bionic from being able to pull metal objects magically out of sealed vending machines.
3. A few other small fixes and updates that I stumbled upon, usually when they intersected with one of the code spots I was currently updating.

### Compatibility Notes
1. Rubble/wreckage in old saves doesn't give items anymore when cleaned up. This is because the particular bit of update code is called *a lot*, and I didn't want to slow it down any more by adding items at that point. If desired it can almost certainly be added.
2. All old rubble fields will turn into smoke fields. This isn't something I can do much about, because the field code is all still hardcoded, leading to weird things happening with saves when you remove one of them.

### Things to Look Out For or Comment On
1. A lot of the bash numbers have changed, and for many of them I only got a relatively small amount of testing in (especially for things like car collisions). As a result it's possible I might have made a mis-guess in the strength of something simple, like a shrub, which could result in something like "death shrubs" again.
2. The compatibility code in mapbuffer.cpp is called *a lot* (Once for every single square when updating). If you have any ideas about potential speed improvements there let me know.
3. Similarly I was having trouble with the field update code. If you have an idea about how that could be handled let me know.
4. I only did the absolute minimum changes required on the mod stuff. As such some of them may need more updates before they meet the new quality level of the rest of the game.
5. While I tried to catch all of the spots the various rubbles show up in mapgen, it's possible that there might be a few spots that are now t_null or rubble placed on top of a wall due to the fact that it no longer overwrites the previous terrain during mapgen. If you find one let me know and I can try to update it.

### Potential Future Expansions (For Another PR)
1. Finish squashing the last bit of hardcoded rubble items
2. Sanity check bash/deconstruction returns. I did a rough pass, and it really needs a fine-toothed comb.
3. JSON-ize fields
4. Improve the roof collapse code. Though what is there is better than before, it's still fully possible to take out all of the walls in a building and still be left with some magically floating ceilings present.
5. Make being caught under rubble actually pin the player/monster until they can free themselves (waiting on an effects upgrade).
6. Handle fire-explosive terrain in a flexible, adjustable, manner that can trigger appropriately.