H206 - passive fire damage affecting weapons (trunk only)

<email deleted> reported back on 8/31/06 that elven weapons were not
affected when he poked a fire elemental with them.  This is true, but
moreover, there was no code to have passive fire to affect attackers.
Now erode_obj() supports all the same damage types as rust_dmg(), and added
the connecting code to allow passive fire attacks do something.
There probably should be macros for the damage types used by rust_dmg
and erode_obj, and possibly these functions should be combined, but they
are slightly different and dealing with that requires more thought.
This commit is contained in:
cohrs
2007-03-20 20:08:09 +00:00
parent 338e8b0a19
commit a5640e4bc8
10 changed files with 94 additions and 50 deletions

View File

@@ -932,7 +932,7 @@ unsigned trflags;
break;
if (u.twoweap || (uwep && bimanual(uwep)))
(void) erode_obj(u.twoweap ? uswapwep : uwep,
FALSE, TRUE, FALSE);
1, TRUE, FALSE);
glovecheck: (void) rust_dmg(uarmg, "gauntlets", 1, TRUE, &youmonst);
/* Not "metal gauntlets" since it gets called
* even if it's leather for the message
@@ -941,7 +941,7 @@ glovecheck: (void) rust_dmg(uarmg, "gauntlets", 1, TRUE, &youmonst);
case 2:
pline("%s your right %s!", A_gush_of_water_hits,
body_part(ARM));
(void) erode_obj(uwep, FALSE, TRUE, FALSE);
(void) erode_obj(uwep, 1, TRUE, FALSE);
goto glovecheck;
default:
pline("%s you!", A_gush_of_water_hits);
@@ -2090,7 +2090,7 @@ register struct monst *mtmp;
break;
target = MON_WEP(mtmp);
if (target && bimanual(target))
(void) erode_obj(target, FALSE, TRUE, FALSE);
(void) erode_obj(target, 1, TRUE, FALSE);
glovecheck: target = which_armor(mtmp, W_ARMG);
(void) rust_dmg(target, "gauntlets", 1, TRUE, mtmp);
break;
@@ -2098,7 +2098,7 @@ glovecheck: target = which_armor(mtmp, W_ARMG);
if (in_sight)
pline("%s %s's right %s!", A_gush_of_water_hits,
mon_nam(mtmp), mbodypart(mtmp, ARM));
(void) erode_obj(MON_WEP(mtmp), FALSE, TRUE, FALSE);
(void) erode_obj(MON_WEP(mtmp), 1, TRUE, FALSE);
goto glovecheck;
default:
if (in_sight)