CleverRaven/Cataclysm-DDA — pull request #4872 by phaethonfire (2013-12-04 19:11:25+00:00)
Title: More scent changes

We actually have some working boundary conditions now! Woohoo. This PR improves scent gradients in enclosed spaces, uses FLAGS instead of other craziness like move cost and the bashable flag to decide how scent interacts with terrain, and modifies how scent reduction works to make more physical sense.

Two json flags are used for deciding how scent moves:
WALL - blocks all scent. A square with the wall flag will always be set to zero. Other squares will not diffuse into a wall square EXCEPT a small amount of scent (currently 20%) will be absorbed by the wall from neighboring squares. This is to prevent the really high scent accumulation in enclosed spaces. Walls now remove scent from the air. The WALL flag is also used by a little piece of code that decides how to display fungal walls. I think that piece of code is not needed anymore since there is information on how to display it in the json file now. I haven't messed with that for this PR, though. Other than that, scent is the only game function to use the "WALL" flag. We could change this to BLOCK_SCENT for clarity. For all other game functions, the move cost of 0 is enough to designate something as a wall.

REDUCE_SCENT - absorbs some scent like walls. The biggest feature here is that not much scent can squeeze by squares with this flag. Currently only 20% of normal scent squeezes in and 20% squeezes out.

Both the exact percentages of wall absorption and of diffusion in "REDUCE_SCENT" squares can be changed in game.cpp. Please let me know what you think.

I have edited terrain.json to match the new flags. I welcome anyone, especially our talented "content creators," to weigh in on what terrain should reduce scent and what terrain should block scent from that square. There are minor changes. Taping windows now blocks all scent from going through, palisade walls only reduce scent, etc. I also fixed some terrain that was missing the "BARRICADABLE" flag.

I have tested this both outdoors and below ground and think it is safe to push. After my last terrible PR, though, I'll ask that someone else please test this branch before merging.