]> granicus.if.org Git - nethack/commitdiff
Rename `rust_dmg()` to `erode_obj()`.
authorSean Hunt <scshunt@csclub.uwaterloo.ca>
Tue, 24 Feb 2015 20:21:30 +0000 (15:21 -0500)
committerSean Hunt <scshunt@csclub.uwaterloo.ca>
Mon, 2 Mar 2015 17:50:01 +0000 (12:50 -0500)
include/extern.h
src/mhitm.c
src/potion.c
src/spell.c
src/trap.c
src/uhitm.c

index 6ca49b411fa5c6ca75ca79f88ef888d2613b695c..f9fc3be0cf987268c5d987e45e018f4b516ee44c 100644 (file)
@@ -2203,7 +2203,7 @@ E coord *FDECL(gettrack, (int,int));
 /* ### trap.c ### */
 
 E boolean FDECL(burnarmor,(struct monst *));
-E boolean FDECL(rust_dmg, (struct obj *,const char *,int,BOOLEAN_P,BOOLEAN_P));
+E boolean FDECL(erode_obj, (struct obj *,const char *,int,BOOLEAN_P,BOOLEAN_P));
 E boolean FDECL(grease_protect, (struct obj *,const char *,struct monst *));
 E struct trap *FDECL(maketrap, (int,int,int));
 E void FDECL(fall_through, (BOOLEAN_P));
index 31c9dba1163d8f75d8d1b0e6cced40bdb007d2e1..88770c52342a9b893ffbc8827c3faf9262def901 100644 (file)
@@ -1303,7 +1303,7 @@ register struct obj *obj;
            dmgtyp = ERODE_BURN;
        else
            return;
-       (void) rust_dmg(obj, 0, dmgtyp, TRUE, TRUE);
+       (void) erode_obj(obj, 0, dmgtyp, TRUE, TRUE);
 }
 
 STATIC_OVL void
index 483544c2bb8a3c2b633f5fb4b8ffe2ce11d6867f..782fa7ace5192b71ac60d14dee7d74659cb159ed 100644 (file)
@@ -1931,7 +1931,7 @@ dodip()
        }
 
        if (potion->otyp == POT_ACID) {
-           if (rust_dmg(obj, 0, ERODE_CORRODE, TRUE, FALSE))
+           if (erode_obj(obj, 0, ERODE_CORRODE, TRUE, FALSE))
                goto poof;
        }
 
index 5d499bf73ae78ca430be7e92715a56c8cebd3d4c..597d4e606e2176ef5765b46832446533432444e8 100644 (file)
@@ -144,7 +144,7 @@ cursed_book(bp)
        case 5:
                pline_The("book was coated with contact poison!");
                if (uarmg) {
-                    rust_dmg(uarmg, "gloves", ERODE_CORRODE, TRUE, TRUE);
+                    erode_obj(uarmg, "gloves", ERODE_CORRODE, TRUE, TRUE);
                    break;
                }
                /* temp disable in_use; death should not destroy the book */
index f78b7ad66df0c5e0a3d9049d550a97a8436e0727..d535fc230020f1c14627be683f08a87445cd314f 100644 (file)
@@ -55,7 +55,7 @@ struct monst *victim;
     int mat_idx;
     
     if (!victim) return 0;
-#define burn_dmg(obj,descr) rust_dmg(obj, descr, ERODE_BURN, TRUE, FALSE)
+#define burn_dmg(obj,descr) erode_obj(obj, descr, ERODE_BURN, TRUE, FALSE)
     while (1) {
        switch (rn2(5)) {
        case 0:
@@ -109,7 +109,7 @@ struct monst *victim;
  * "print", if set, means to print a message even if no change occurs.
  */
 boolean
-rust_dmg(otmp, ostr, type, check_grease, print)
+erode_obj(otmp, ostr, type, check_grease, print)
 register struct obj *otmp;
 register const char *ostr;
 int type;
@@ -151,7 +151,7 @@ boolean print;
                    is_primary = FALSE;
                    break;
                 default:
-                    impossible("Invalid erosion type in rust_dmg");
+                    impossible("Invalid erosion type in erode_obj");
                     return FALSE;
        }
        erosion = is_primary ? otmp->oeroded : otmp->oeroded2;
@@ -3101,7 +3101,7 @@ struct obj *obj;
         obj->spe = 0;
         obj->dknown = 0;
     } else
-        rust_dmg(obj, NULL, ERODE_CORRODE, TRUE, TRUE);
+        erode_obj(obj, NULL, ERODE_CORRODE, TRUE, TRUE);
 }
 
 /* returns:
@@ -3195,7 +3195,7 @@ boolean force;
                         return 2;
                 }
         } else {
-                return rust_dmg(obj, ostr, ERODE_RUST, FALSE, FALSE) ? 2 : 0;
+                return erode_obj(obj, ostr, ERODE_RUST, FALSE, FALSE) ? 2 : 0;
         }
         return 0;
 }
index 51f38eee0d10ac67425d398bf052766341b2e4be..b594fd863a5abb8df6c261f5e1a91e675efd0423 100644 (file)
@@ -47,34 +47,34 @@ int hurt;
            switch(rn2(5)) {
            case 0:
                target = which_armor(mdef, W_ARMH);
-               if (!target || !rust_dmg(target, xname(target), hurt, TRUE, FALSE))
+               if (!target || !erode_obj(target, xname(target), hurt, TRUE, FALSE))
                    continue;
                break;
            case 1:
                target = which_armor(mdef, W_ARMC);
                if (target) {
-                   (void)rust_dmg(target, xname(target), hurt, TRUE, TRUE);
+                   (void)erode_obj(target, xname(target), hurt, TRUE, TRUE);
                    break;
                }
                if ((target = which_armor(mdef, W_ARM)) != (struct obj *)0) {
-                   (void)rust_dmg(target, xname(target), hurt, TRUE, TRUE);
+                   (void)erode_obj(target, xname(target), hurt, TRUE, TRUE);
                } else if ((target = which_armor(mdef, W_ARMU)) != (struct obj *)0) {
-                   (void)rust_dmg(target, xname(target), hurt, TRUE, TRUE);
+                   (void)erode_obj(target, xname(target), hurt, TRUE, TRUE);
                }
                break;
            case 2:
                target = which_armor(mdef, W_ARMS);
-               if (!target || !rust_dmg(target, xname(target), hurt, TRUE, FALSE))
+               if (!target || !erode_obj(target, xname(target), hurt, TRUE, FALSE))
                    continue;
                break;
            case 3:
                target = which_armor(mdef, W_ARMG);
-               if (!target || !rust_dmg(target, xname(target), hurt, TRUE, FALSE))
+               if (!target || !erode_obj(target, xname(target), hurt, TRUE, FALSE))
                    continue;
                break;
            case 4:
                target = which_armor(mdef, W_ARMF);
-               if (!target || !rust_dmg(target, xname(target), hurt, TRUE, FALSE))
+               if (!target || !erode_obj(target, xname(target), hurt, TRUE, FALSE))
                    continue;
                break;
            }
@@ -2222,7 +2222,7 @@ boolean wep_was_destroyed;
            if(mhit && !mon->mcan) {
                if (aatyp == AT_KICK) {
                    if (uarmf && !rn2(6))
-                       (void)rust_dmg(uarmf, xname(uarmf), ERODE_BURN, TRUE, TRUE);
+                       (void)erode_obj(uarmf, xname(uarmf), ERODE_BURN, TRUE, TRUE);
                } else if (aatyp == AT_WEAP || aatyp == AT_CLAW ||
                           aatyp == AT_MAGC || aatyp == AT_TUCH)
                    passive_obj(mon, (struct obj*)0, &(ptr->mattk[i]));
@@ -2242,7 +2242,7 @@ boolean wep_was_destroyed;
            if (mhit) {
                if (aatyp == AT_KICK) {
                    if (uarmf && !rn2(6))
-                       (void)rust_dmg(uarmf, xname(uarmf), ERODE_CORRODE, TRUE, TRUE);
+                       (void)erode_obj(uarmf, xname(uarmf), ERODE_CORRODE, TRUE, TRUE);
                } else if (aatyp == AT_WEAP || aatyp == AT_CLAW ||
                           aatyp == AT_MAGC || aatyp == AT_TUCH)
                    passive_obj(mon, (struct obj*)0, &(ptr->mattk[i]));
@@ -2275,7 +2275,7 @@ boolean wep_was_destroyed;
            if(mhit && !mon->mcan) {
                if (aatyp == AT_KICK) {
                    if (uarmf)
-                       (void)rust_dmg(uarmf, xname(uarmf), ERODE_RUST, TRUE, TRUE);
+                       (void)erode_obj(uarmf, xname(uarmf), ERODE_RUST, TRUE, TRUE);
                } else if (aatyp == AT_WEAP || aatyp == AT_CLAW ||
                           aatyp == AT_MAGC || aatyp == AT_TUCH)
                    passive_obj(mon, (struct obj*)0, &(ptr->mattk[i]));
@@ -2285,7 +2285,7 @@ boolean wep_was_destroyed;
            if(mhit && !mon->mcan) {
                if (aatyp == AT_KICK) {
                    if (uarmf)
-                       (void)rust_dmg(uarmf, xname(uarmf), ERODE_CORRODE, TRUE, TRUE);
+                       (void)erode_obj(uarmf, xname(uarmf), ERODE_CORRODE, TRUE, TRUE);
                } else if (aatyp == AT_WEAP || aatyp == AT_CLAW ||
                           aatyp == AT_MAGC || aatyp == AT_TUCH)
                    passive_obj(mon, (struct obj*)0, &(ptr->mattk[i]));
@@ -2446,22 +2446,22 @@ struct attack *mattk;           /* null means we find one internally */
 
        case AD_FIRE:
            if(!rn2(6) && !mon->mcan) {
-               (void) rust_dmg(obj, 0, ERODE_BURN, FALSE, FALSE);
+               (void) erode_obj(obj, 0, ERODE_BURN, FALSE, FALSE);
            }
            break;
        case AD_ACID:
            if(!rn2(6)) {
-               (void) rust_dmg(obj, 0, ERODE_CORRODE, FALSE, FALSE);
+               (void) erode_obj(obj, 0, ERODE_CORRODE, FALSE, FALSE);
            }
            break;
        case AD_RUST:
            if(!mon->mcan) {
-               (void) rust_dmg(obj, 0, ERODE_RUST, FALSE, FALSE);
+               (void) erode_obj(obj, 0, ERODE_RUST, FALSE, FALSE);
            }
            break;
        case AD_CORR:
            if(!mon->mcan) {
-               (void) rust_dmg(obj, 0, ERODE_CORRODE, FALSE, FALSE);
+               (void) erode_obj(obj, 0, ERODE_CORRODE, FALSE, FALSE);
            }
            break;
        case AD_ENCH: