]> granicus.if.org Git - nethack/commitdiff
Macros for checking is object artifact
authorPasi Kallinen <paxed@alt.org>
Fri, 12 Aug 2022 16:37:34 +0000 (19:37 +0300)
committerPasi Kallinen <paxed@alt.org>
Fri, 12 Aug 2022 16:37:34 +0000 (19:37 +0300)
19 files changed:
include/obj.h
src/artifact.c
src/attrib.c
src/dokick.c
src/dothrow.c
src/engrave.c
src/hack.c
src/insight.c
src/makemon.c
src/mhitu.c
src/minion.c
src/mondata.c
src/mplayer.c
src/pray.c
src/read.c
src/sit.c
src/trap.c
src/uhitm.c
src/wield.c

index 7c716d8215bdf8630761204ddca5001001b3347a..237f48bc333fa816d35a0df5dc4247a01ac864cc 100644 (file)
@@ -391,6 +391,9 @@ struct obj {
 #define is_mines_prize(o) ((o)->o_id == g.context.achieveo.mines_prize_oid)
 #define is_soko_prize(o) ((o)->o_id == g.context.achieveo.soko_prize_oid)
 
+#define is_art(o,art) ((o) && (o)->oartifact == (art))
+#define u_wield_art(art) is_art(uwep, art)
+
 /* Flags for get_obj_location(). */
 #define CONTAINED_TOO 0x1
 #define BURIED_TOO 0x2
index 96e636f41e1fe3e05bdecdb0f3d7f38e53654706..14019ba3af256cdb9490d3948b62c81d760417f7 100644 (file)
@@ -987,7 +987,7 @@ spec_dbon(struct obj *otmp, struct monst *mon, int tmp)
     if (!weap || (weap->attk.adtyp == AD_PHYS /* check for `NO_ATTK' */
                   && weap->attk.damn == 0 && weap->attk.damd == 0))
         g.spec_dbon_applies = FALSE;
-    else if (otmp->oartifact == ART_GRIMTOOTH)
+    else if (is_art(otmp, ART_GRIMTOOTH))
         /* Grimtooth has SPFX settings to warn against elves but we want its
            damage bonus to apply to all targets, so bypass spec_applies() */
         g.spec_dbon_applies = TRUE;
@@ -1428,7 +1428,7 @@ artifact_hit(struct monst *magr, struct monst *mdef, struct obj *otmp,
     /* We really want "on a natural 20" but Nethack does it in */
     /* reverse from AD&D. */
     if (spec_ability(otmp, SPFX_BEHEAD)) {
-        if (otmp->oartifact == ART_TSURUGI_OF_MURAMASA && dieroll == 1) {
+        if (is_art(otmp, ART_TSURUGI_OF_MURAMASA) && dieroll == 1) {
             wepdesc = "The razor-sharp blade";
             /* not really beheading, but so close, why add another SPFX */
             if (youattack && engulfing_u(mdef)) {
@@ -1472,7 +1472,7 @@ artifact_hit(struct monst *magr, struct monst *mdef, struct obj *otmp,
                 otmp->dknown = TRUE;
                 return TRUE;
             }
-        } else if (otmp->oartifact == ART_VORPAL_BLADE
+        } else if (is_art(otmp, ART_VORPAL_BLADE)
                    && (dieroll == 1 || mdef->data == &mons[PM_JABBERWOCK])) {
             static const char *const behead_msg[2] = { "%s beheads %s!",
                                                        "%s decapitates %s!" };
@@ -1543,7 +1543,7 @@ artifact_hit(struct monst *magr, struct monst *mdef, struct obj *otmp,
                    the result won't be printed */
                 char *otmpname = distant_name(otmp, xname);
 
-                if (otmp->oartifact == ART_STORMBRINGER)
+                if (is_art(otmp, ART_STORMBRINGER))
                     pline_The("%s blade draws the %s from %s!",
                               hcolor(NH_BLACK), life, mon_nam(mdef));
                 else
@@ -1576,7 +1576,7 @@ artifact_hit(struct monst *magr, struct monst *mdef, struct obj *otmp,
 
             if (Blind) {
                 You_feel("an %s drain your %s!",
-                         (otmp->oartifact == ART_STORMBRINGER)
+                         is_art(otmp, ART_STORMBRINGER)
                             ? "unholy blade"
                             : "object",
                          life);
@@ -1585,7 +1585,7 @@ artifact_hit(struct monst *magr, struct monst *mdef, struct obj *otmp,
                    the result won't be printed */
                 char *otmpname = distant_name(otmp, xname);
 
-                if (otmp->oartifact == ART_STORMBRINGER)
+                if (is_art(otmp, ART_STORMBRINGER))
                     pline_The("%s blade drains your %s!",
                               hcolor(NH_BLACK), life);
                 else
@@ -1976,7 +1976,7 @@ artifact_light(struct obj *obj)
         && (obj->owornmask & W_ARM) != 0L)
         return TRUE;
 
-    return (boolean) (get_artifact(obj) && obj->oartifact == ART_SUNSWORD);
+    return (boolean) (get_artifact(obj) && is_art(obj, ART_SUNSWORD));
 }
 
 /* KMH -- Talking artifacts are finally implemented */
@@ -2164,10 +2164,9 @@ glow_verb(int count, /* 0 means blind rather than no applicable creatures */
 void
 Sting_effects(int orc_count) /* new count (warn_obj_cnt is old count); -1 is a flag value */
 {
-    if (uwep
-        && (uwep->oartifact == ART_STING
-            || uwep->oartifact == ART_ORCRIST
-            || uwep->oartifact == ART_GRIMTOOTH)) {
+    if (u_wield_art(ART_STING)
+        || u_wield_art(ART_ORCRIST)
+        || u_wield_art(ART_GRIMTOOTH)) {
         int oldstr = glow_strength(g.warn_obj_cnt),
             newstr = glow_strength(orc_count);
 
@@ -2450,7 +2449,7 @@ mkot_trap_warn(void)
         "hot", "very hot", "like fire"
     };
 
-    if (!uarmg && uwep && uwep->oartifact == ART_MASTER_KEY_OF_THIEVERY) {
+    if (!uarmg && u_wield_art(ART_MASTER_KEY_OF_THIEVERY)) {
         int idx, ntraps = count_surround_traps(u.ux, u.uy);
 
         if (ntraps != g.mkot_trap_warn_count) {
@@ -2468,7 +2467,7 @@ boolean
 is_magic_key(struct monst *mon, /* if null, non-rogue is assumed */
              struct obj *obj)
 {
-    if (obj && obj->oartifact == ART_MASTER_KEY_OF_THIEVERY) {
+    if (is_art(obj, ART_MASTER_KEY_OF_THIEVERY)) {
         if ((mon == &g.youmonst) ? Role_if(PM_ROGUE)
                                  : (mon && mon->data == &mons[PM_ROGUE]))
             return !obj->cursed; /* a rogue; non-cursed suffices for magic */
index 7809d32286149e4e5d15b392820a4faeac9dc6a0..b74fcf5abd42075644efa6ba76571bfce3f01348 100644 (file)
@@ -879,8 +879,7 @@ from_what(int propidx) /* special cases can have negative values */
                replace this with what_blocks() comparable to what_gives() */
             switch (-propidx) {
             case BLINDED:
-                if (ublindf
-                    && ublindf->oartifact == ART_EYES_OF_THE_OVERWORLD)
+                if (is_art(ublindf, ART_EYES_OF_THE_OVERWORLD))
                     Sprintf(buf, because_of, bare_artifactname(ublindf));
                 break;
             case INVIS:
@@ -1082,7 +1081,7 @@ acurr(int x)
                 || u.umonnum == PM_AMOROUS_DEMON))
             return (schar) 18;
     } else if (x == A_CON) {
-        if (uwep && uwep->oartifact == ART_OGRESMASHER)
+        if (u_wield_art(ART_OGRESMASHER))
             return (schar) 25;
     } else if (x == A_INT || x == A_WIS) {
         /* yes, this may raise int/wis if player is sufficiently
@@ -1129,7 +1128,7 @@ extremeattr(int attrindx) /* does attrindx's value match its max or min? */
         if (uarmg && uarmg->otyp == GAUNTLETS_OF_POWER)
             lolimit = hilimit;
     } else if (attrindx == A_CON) {
-        if (uwep && uwep->oartifact == ART_OGRESMASHER)
+        if (u_wield_art(ART_OGRESMASHER))
             lolimit = hilimit;
     }
     /* this exception is hypothetical; the only other worn item affecting
index 95cc3f11765d999a18df5e8ab7ba2ccdd1ee5054..1236dc6904072fe4612139cba4e654c2a70ceabc 100644 (file)
@@ -567,7 +567,7 @@ really_kick_object(coordxy x, coordxy y)
     }
 
     /* Mjollnir is magically too heavy to kick */
-    if (g.kickedobj->oartifact == ART_MJOLLNIR)
+    if (is_art(g.kickedobj, ART_MJOLLNIR))
         range = 1;
 
     /* see if the object has a place to move into */
index e751ff1e9e9c0f2b5dc980ba38eeca80952b15d0..a75fac95fe41b43fa4d714654b18c7d8ad9177ab 100644 (file)
@@ -115,11 +115,11 @@ throw_obj(struct obj *obj, int shotlimit)
     if (!canletgo(obj, "throw")) {
         return ECMD_OK;
     }
-    if (obj->oartifact == ART_MJOLLNIR && obj != uwep) {
+    if (is_art(obj, ART_MJOLLNIR) && obj != uwep) {
         pline("%s must be wielded before it can be thrown.", The(xname(obj)));
         return ECMD_OK;
     }
-    if ((obj->oartifact == ART_MJOLLNIR && ACURR(A_STR) < STR19(25))
+    if ((is_art(obj, ART_MJOLLNIR) && ACURR(A_STR) < STR19(25))
         || (obj->otyp == BOULDER && !throws_rocks(g.youmonst.data))) {
         pline("It's too heavy.");
         return ECMD_TIME;
@@ -1524,7 +1524,7 @@ throwit(struct obj *obj,
 
         if (obj->otyp == BOULDER)
             range = 20; /* you must be giant */
-        else if (obj->oartifact == ART_MJOLLNIR)
+        else if (is_art(obj, ART_MJOLLNIR))
             range = (range + 1) / 2; /* it's heavy */
         else if (tethered_weapon) /* primary weapon is aklys */
             /* if an aklys is going to return, range is limited by the
index 55c4bdbdb68837394497361f2a0cf1743e3c00c4..975b79a09f934e6068a69f15318c5e83e5a0147c 100644 (file)
@@ -837,7 +837,7 @@ doengrave(void)
         break;
 
     case WEAPON_CLASS:
-        if (otmp->oartifact == ART_FIRE_BRAND)
+        if (is_art(otmp, ART_FIRE_BRAND))
             type = BURN;
         else if (is_blade(otmp)) {
             if ((int) otmp->spe > -3)
index e85939985bff2608ce88367fa625bbc08ba93844..fbd682e0b881aa8f9692b83418284262453103a9 100644 (file)
@@ -1441,7 +1441,7 @@ trapmove(
         climb_pit();
         break;
     case TT_WEB:
-        if (uwep && uwep->oartifact == ART_STING) {
+        if (u_wield_art(ART_STING)) {
             /* escape trap but don't move and don't destroy it */
             u.utrap = 0; /* caller will call reset_utrap() */
             pline("Sting cuts through the web!");
@@ -1747,7 +1747,7 @@ domove_fight_web(coordxy x, coordxy y)
 
     if (g.context.forcefight && trap && trap->ttyp == WEB
         && trap->tseen && uwep) {
-        if (uwep->oartifact == ART_STING) {
+        if (u_wield_art(ART_STING)) {
             /* guaranteed success */
             pline("%s cuts through the web!",
                   bare_artifactname(uwep));
index 0a1d3e73d7c17eff68604d01f6e090b46b37cb23..3dfada4ad1bdcd51fc2274665231292a05c52d92 100644 (file)
@@ -801,7 +801,7 @@ one_characteristic(int mode, int final, int attrindx)
     case A_DEX:
         break;
     case A_CON:
-        if (uwep && uwep->oartifact == ART_OGRESMASHER && uwep->cursed)
+        if (u_wield_art(ART_OGRESMASHER) && uwep->cursed)
             hide_innate_value = TRUE;
         break;
     case A_INT:
index 87f0a98099eecbbc149cec5bd57540c32f954368..9b9e6cc0474007b27890348363e42437cbdce310 100644 (file)
@@ -1359,8 +1359,7 @@ makemon(
     if (is_dprince(ptr) && ptr->msound == MS_BRIBE) {
         mtmp->mpeaceful = mtmp->minvis = mtmp->perminvis = 1;
         mtmp->mavenge = 0;
-        if (uwep && (uwep->oartifact == ART_EXCALIBUR
-                     || uwep->oartifact == ART_DEMONBANE))
+        if (u_wield_art(ART_EXCALIBUR) || u_wield_art(ART_DEMONBANE))
             mtmp->mpeaceful = mtmp->mtame = FALSE;
     }
     if (mndx == PM_RAVEN && uwep && uwep->otyp == BEC_DE_CORBIN)
index 610948bf278fe79c9cacadaa09707282c8d9530a..27c2c9de9dbd0d6770979e04a1f9d7ce729f0181 100644 (file)
@@ -366,8 +366,8 @@ getmattk(struct monst *magr, struct monst *mdef,
                && (magr->mcan
                    || (weap && ((weap->otyp == CORPSE
                                  && touch_petrifies(&mons[weap->corpsenm]))
-                                || weap->oartifact == ART_STORMBRINGER
-                                || weap->oartifact == ART_VORPAL_BLADE)))) {
+                                || is_art(weap, ART_STORMBRINGER)
+                                || is_art(weap, ART_VORPAL_BLADE))))) {
         *alt_attk_buf = *attk;
         attk = alt_attk_buf;
         attk->adtyp = AD_PHYS;
index 9fd819e15abab7e07ab90492d319df825f3c5c51..c3645cb883dd1a8953e0c5f372b46273b65205e6 100644 (file)
@@ -66,7 +66,7 @@ msummon(struct monst *mon)
     if (mon) {
         ptr = mon->data;
 
-        if (uwep && uwep->oartifact == ART_DEMONBANE && is_demon(ptr)) {
+        if (u_wield_art(ART_DEMONBANE) && is_demon(ptr)) {
             if (canseemon(mon))
                 pline("%s looks puzzled for a moment.", Monnam(mon));
             return 0;
@@ -259,8 +259,7 @@ demon_talk(register struct monst *mtmp)
 {
     long cash, demand, offer;
 
-    if (uwep && (uwep->oartifact == ART_EXCALIBUR
-                 || uwep->oartifact == ART_DEMONBANE)) {
+    if (u_wield_art(ART_EXCALIBUR) || u_wield_art(ART_DEMONBANE)) {
         if (canspotmon(mtmp))
             pline("%s looks very angry.", Amonnam(mtmp));
         else
index da0f2f840e2a71976edf2dd0983c25a2336c0cf0..764be912429170b897c6e49cc27fe5f90f30cd79 100644 (file)
@@ -424,7 +424,7 @@ can_be_strangled(struct monst* mon)
 boolean
 can_track(register struct permonst* ptr)
 {
-    if (uwep && uwep->oartifact == ART_EXCALIBUR)
+    if (u_wield_art(ART_EXCALIBUR))
         return TRUE;
     else
         return (boolean) haseyes(ptr);
index 5def5e45c6cd922ce58282ce8bf106c39c98287c..966e00e5fdf30fd8bd2bad216e1ee873f3457707 100644 (file)
@@ -266,7 +266,7 @@ mk_mplayer(struct permonst *ptr, coordxy x, coordxy y, boolean special)
                 && monmightthrowwep(otmp))
                 otmp->quan += (long) rn2(is_spear(otmp) ? 4 : 8);
             /* mplayers knew better than to overenchant Magicbane */
-            if (otmp->oartifact == ART_MAGICBANE)
+            if (is_art(otmp, ART_MAGICBANE))
                 otmp->spe = rnd(4);
             (void) mpickobj(mtmp, otmp);
         }
index 5d56f867fbe9e9ff0402bc71db5df936615c5e04..3f5847f94471ad1ab319c3b7c4a23ec724714cce 100644 (file)
@@ -794,8 +794,8 @@ gcrownu(void)
     /* 3.3.[01] had this in the A_NEUTRAL case,
        preventing chaotic wizards from receiving a spellbook */
     if (Role_if(PM_WIZARD)
-        && (!uwep || (uwep->oartifact != ART_VORPAL_BLADE
-                      && uwep->oartifact != ART_STORMBRINGER))
+        && !u_wield_art(ART_VORPAL_BLADE)
+        && !u_wield_art(ART_STORMBRINGER)
         && !carrying(SPE_FINGER_OF_DEATH)) {
         class_gift = SPE_FINGER_OF_DEATH;
     } else if (Role_if(PM_MONK) && (!uwep || !uwep->oartifact)
@@ -816,7 +816,7 @@ gcrownu(void)
         break;
     case A_NEUTRAL:
         u.uevent.uhand_of_elbereth = 2;
-        in_hand = (uwep && uwep->oartifact == ART_VORPAL_BLADE);
+        in_hand = u_wield_art(ART_VORPAL_BLADE);
         already_exists = exist_artifact(LONG_SWORD,
                                         artiname(ART_VORPAL_BLADE));
         verbalize("Thou shalt be my Envoy of Balance!");
@@ -825,7 +825,7 @@ gcrownu(void)
         break;
     case A_CHAOTIC:
         u.uevent.uhand_of_elbereth = 3;
-        in_hand = (uwep && uwep->oartifact == ART_STORMBRINGER);
+        in_hand = u_wield_art(ART_STORMBRINGER);
         already_exists = exist_artifact(RUNESWORD, artiname(ART_STORMBRINGER));
         what = (((already_exists && !in_hand) || class_gift != STRANGE_OBJECT)
                 ? "take lives"
@@ -874,7 +874,7 @@ gcrownu(void)
                 Your("sword shines brightly for a moment.");
             obj = oname(obj, artiname(ART_EXCALIBUR),
                         ONAME_GIFT | ONAME_KNOW_ARTI);
-            if (obj && obj->oartifact == ART_EXCALIBUR) {
+            if (is_art(obj, ART_EXCALIBUR)) {
                 u.ugifts++;
                 livelog_printf(LL_DIVINEGIFT | LL_ARTIFACT,
                                "had %s wielded %s transformed into %s",
@@ -883,7 +883,7 @@ gcrownu(void)
         }
         /* acquire Excalibur's skill regardless of weapon or gift */
         unrestrict_weapon_skill(P_LONG_SWORD);
-        if (obj && obj->oartifact == ART_EXCALIBUR)
+        if (is_art(obj, ART_EXCALIBUR))
             discover_artifact(ART_EXCALIBUR);
         break;
     case A_NEUTRAL:
@@ -906,7 +906,7 @@ gcrownu(void)
         }
         /* acquire Vorpal Blade's skill regardless of weapon or gift */
         unrestrict_weapon_skill(P_LONG_SWORD);
-        if (obj && obj->oartifact == ART_VORPAL_BLADE)
+        if (is_art(obj, ART_VORPAL_BLADE))
             discover_artifact(ART_VORPAL_BLADE);
         break;
     case A_CHAOTIC: {
@@ -932,7 +932,7 @@ gcrownu(void)
         }
         /* acquire Stormbringer's skill regardless of weapon or gift */
         unrestrict_weapon_skill(P_BROAD_SWORD);
-        if (obj && obj->oartifact == ART_STORMBRINGER)
+        if (is_art(obj, ART_STORMBRINGER))
             discover_artifact(ART_STORMBRINGER);
         break;
     }
index 50cc1611fdf46d3162d36a438ecf2ae06c73cf5b..5089314a6b160fd73c9244a7aedec4093a410c93 100644 (file)
@@ -522,7 +522,7 @@ doread(void)
                            "became literate by reading a coin's engravings");
 
         return ECMD_TIME;
-    } else if (scroll->oartifact == ART_ORB_OF_FATE) {
+    } else if (is_art(scroll, ART_ORB_OF_FATE)) {
         if (Blind)
             You("feel the engraved signature:");
         else
index 14d3878211af341f93bc792dd4a987955bbf5b64..737d857f0ae35f0972373d1f70cfc2f2bd71b1a4 100644 (file)
--- a/src/sit.c
+++ b/src/sit.c
@@ -384,7 +384,7 @@ rndcurse(void)
     struct obj *otmp;
     static const char mal_aura[] = "feel a malignant aura surround %s.";
 
-    if (uwep && (uwep->oartifact == ART_MAGICBANE) && rn2(20)) {
+    if (u_wield_art(ART_MAGICBANE) && rn2(20)) {
         You(mal_aura, "the magic-absorbing blade");
         return;
     }
index 5901eeb7a80074bcada0fd56cc4868bf21f37c93..3ba2729a5a04f5a8793170943f51328ef519d7e9 100644 (file)
@@ -2084,7 +2084,7 @@ trapeffect_anti_magic(
             if (Half_physical_damage || Half_spell_damage)
                 dmgval2 += rnd(4);
             /* give Magicbane wielder dose of own medicine */
-            if (uwep && uwep->oartifact == ART_MAGICBANE)
+            if (u_wield_art(ART_MAGICBANE))
                 dmgval2 += rnd(4);
             /* having an artifact--other than own quest one--which
                confers magic resistance simply by being carried
@@ -2130,7 +2130,7 @@ trapeffect_anti_magic(
             int dmgval2 = rnd(4);
 
             if ((otmp = MON_WEP(mtmp)) != 0
-                && otmp->oartifact == ART_MAGICBANE)
+                && is_art(otmp, ART_MAGICBANE))
                 dmgval2 += rnd(4);
             for (otmp = mtmp->minvent; otmp; otmp = otmp->nobj)
                 if (otmp->oartifact
index 6f6aecc8162076ffd941d184bbb940d86caad9b1..568f545177d50409986e627fc9c117c9bfbb1966 100644 (file)
@@ -253,7 +253,7 @@ attack_checks(
     if (flags.confirm && mtmp->mpeaceful
         && !Confusion && !Hallucination && !Stunned) {
         /* Intelligent chaotic weapons (Stormbringer) want blood */
-        if (wep && wep->oartifact == ART_STORMBRINGER) {
+        if (is_art(wep, ART_STORMBRINGER)) {
             g.override_confirmation = TRUE;
             return FALSE;
         }
@@ -409,7 +409,7 @@ do_attack(struct monst *mtmp)
      */
     /* Intelligent chaotic weapons (Stormbringer) want blood */
     if (is_safemon(mtmp) && !g.context.forcefight) {
-        if (!uwep || uwep->oartifact != ART_STORMBRINGER) {
+        if (!u_wield_art(ART_STORMBRINGER)) {
             /* There are some additional considerations: this won't work
              * if in a shop or Punished or you miss a random roll or
              * if you can walk thru walls and your pet cannot (KAA) or
@@ -690,7 +690,7 @@ hitum(struct monst *mon, struct attack *uattk)
     /* Cleaver attacks three spots, 'mon' and one on either side of 'mon';
        it can't be part of dual-wielding but we guard against that anyway;
        cleave return value reflects status of primary target ('mon') */
-    if (uwep && uwep->oartifact == ART_CLEAVER && !u.twoweap
+    if (u_wield_art(ART_CLEAVER) && !u.twoweap
         && !u.uswallow && !u.ustuck && !NODIAG(u.umonnum))
         return hitum_cleave(mon, uattk);
 
@@ -874,7 +874,7 @@ hmon_hitmon(
                 if (!train_weapon_skill || mon == u.ustuck || u.twoweap
                     /* Cleaver can hit up to three targets at once so don't
                        let it also hit from behind or shatter foes' weapons */
-                    || (hand_to_hand && obj->oartifact == ART_CLEAVER)) {
+                    || (hand_to_hand && is_art(obj, ART_CLEAVER))) {
                     ; /* no special bonuses */
                 } else if (mon->mflee && Role_if(PM_ROGUE) && !Upolyd
                            /* multi-shot throwing is too powerful here */
@@ -4585,7 +4585,7 @@ m_is_steadfast(struct monst *mtmp)
         || (!is_u && (is_flyer(mtmp->data) || is_floater(mtmp->data))))
         return FALSE;
 
-    if (otmp && otmp->oartifact == ART_GIANTSLAYER)
+    if (is_art(otmp, ART_GIANTSLAYER))
         return TRUE;
     return FALSE;
 }
index defc62f57dfa02728658824081a41d24c440a3d4..82ae46dc04833ff55f0e96cde21f8b0d6954e306 100644 (file)
@@ -112,8 +112,8 @@ setuwep(struct obj *obj)
             pline("%s shining.", Tobjnam(olduwep, "stop"));
     }
     if (uwep == obj
-        && ((uwep && uwep->oartifact == ART_OGRESMASHER)
-            || (olduwep && olduwep->oartifact == ART_OGRESMASHER)))
+        && (u_wield_art(ART_OGRESMASHER)
+            || is_art(olduwep, ART_OGRESMASHER)))
         g.context.botl = 1;
     /* Note: Explicitly wielding a pick-axe will not give a "bashing"
      * message.  Wielding one via 'a'pplying it will.
@@ -1003,7 +1003,7 @@ chwepon(struct obj *otmp, int amount)
      * addition adverse reaction on Magicbane whose effects are
      * spe dependent.  Give an obscure clue here.
      */
-    if (uwep->oartifact == ART_MAGICBANE && uwep->spe >= 0) {
+    if (u_wield_art(ART_MAGICBANE) && uwep->spe >= 0) {
         Your("right %s %sches!", body_part(HAND),
              (((amount > 1) && (uwep->spe > 1)) ? "flin" : "it"));
     }