Merge fire-based erosion to common codepaths.

This finally eliminates all direct increases of `oeroded` and `oeroded2`
and moves them all to go via `erode_obj()`. They are still manipulated
directly in a few places, but not to erode objects.

This now merges the `fire_damage()` function to a common codepath, used
for items on lava and burning oil, but fire needs more work. There is
still a duplication between `destroy_item()` and `fire_damage()`; the
two codepaths should eventually be merged in some manner so that there
is only one codepath to say "an object was affected by fire". This path
might require some parameters, such as whether the fire will just erode
objects or burn them outright, but that can happen another day.
This commit is contained in:
Sean Hunt
2015-03-01 11:54:40 -05:00
parent 3acd3c4a00
commit 777328bd5c
13 changed files with 226 additions and 177 deletions

View File

@@ -99,6 +99,9 @@
#define COST_BITE 13 /* start eating food */
#define COST_OPEN 14 /* open tin */
#define COST_BRKLCK 15 /* break box/chest's lock */
#define COST_RUST 16 /* rust damage */
#define COST_ROT 17 /* rotting attack */
#define COST_CORRODE 18 /* acid damage */
/* bitmask flags for corpse_xname();
PFX_THE takes precedence over ARTICLE, NO_PFX takes precedence over both */