CleverRaven/Cataclysm-DDA — pull request #3694 by atomicdryad (2013-10-17 12:32:29+00:00)
Title: [DONE/RFI] Jsonize terrain and furniture bashing stats

This abstracts the ginormous case statement in map::bash and puts it into json, as a 'bash' structure for terrain and furniture entries. Please note that these variables are -not- my idea; the map::bash logic is just weird. Example, for t_wall_wood:

"bash": {
"str_min": 0, // minimum strength required to break, lowest possible result of rng roll
"str_max": 120, // highest possible result of rng roll
"num_tests": 2, // how many rng rolls must succeed
"sound": "crunch!", // sound on success
"sound_fail": "whump!", // sound on fail
"ter_set": "t_wall_wood_chipped", // what the terrain changes into
"items": [ // what items drop
{ "item": "2x4", "amount": 1, "minamount": 0}, // rng(0, 1) items drop
{ "item": "nail", "amount": 2 }, // 2 items drop
{ "item": "splinter", "amount": 1 }
]
}

**how it currently works**
Exactly the same as before, which is:
success: monster.melee_dice * monster.melee_sides >= rng ( str_min, str_max )
or for player:
success: strength >= rng ( str_min, str_max )
Most everything has a str_min of **0**
This means a **cat** will eventually succeed in busting down a wooden wall, after around ((120)/(1*3)) ^2 == 1600 attempts.

**what I've changed**
propping up a door with a bookcase used to change the min/max from 0/40 to 0/50, I've set it to 5/50 (cats and zombie kids CANNOT break down a door held shut with a bookcase).

**what I'd like to change further (opinions?)**
min strength for doors and walls not blocked to around 5 or whatever seems reasonable.

**what could use further discussion and FIXING (in another PR perhaps)**
The bashing logic is wonky; I'm coding and testing a way to give terrain HP, and think terrain/furniture could use a soak_hp + damage_hp; (ie, t_door.soak = 5, t_door.hp = 40 means a mob with 7 str will keep failing but eventually wear it down)

Also, the item drops, and terrain/furniture components in general are all over the place. The following functions maintain their own lists of stuff.
construction build:
construction deconstruct
map::bash
map::destroy
iuse::hammer (sometimes)
Fixing that is beyond the scope of this PR, however.