1 /* NetHack 3.6 wield.c $NHDT-Date: 1461967849 2016/04/29 22:10:49 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.49 $ */
2 /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
3 /* NetHack may be freely redistributed. See license for details. */
7 /* KMH -- Differences between the three weapon slots.
9 * The main weapon (uwep):
10 * 1. Is filled by the (w)ield command.
11 * 2. Can be filled with any type of item.
12 * 3. May be carried in one or both hands.
13 * 4. Is used as the melee weapon and as the launcher for
15 * 5. Only conveys intrinsics when it is a weapon, weapon-tool,
17 * 6. Certain cursed items will weld to the hand and cannot be
18 * unwielded or dropped. See erodeable_wep() and will_weld()
19 * below for the list of which items apply.
21 * The secondary weapon (uswapwep):
22 * 1. Is filled by the e(x)change command, which swaps this slot
23 * with the main weapon. If the "pushweapon" option is set,
24 * the (w)ield command will also store the old weapon in the
26 * 2. Can be filled with anything that will fit in the main weapon
27 * slot; that is, any type of item.
28 * 3. Is usually NOT considered to be carried in the hands.
29 * That would force too many checks among the main weapon,
30 * second weapon, shield, gloves, and rings; and it would
31 * further be complicated by bimanual weapons. A special
32 * exception is made for two-weapon combat.
33 * 4. Is used as the second weapon for two-weapon combat, and as
34 * a convenience to swap with the main weapon.
35 * 5. Never conveys intrinsics.
36 * 6. Cursed items never weld (see #3 for reasons), but they also
37 * prevent two-weapon combat.
39 * The quiver (uquiver):
40 * 1. Is filled by the (Q)uiver command.
41 * 2. Can be filled with any type of item.
42 * 3. Is considered to be carried in a special part of the pack.
43 * 4. Is used as the item to throw with the (f)ire command.
44 * This is a convenience over the normal (t)hrow command.
45 * 5. Never conveys intrinsics.
46 * 6. Cursed items never weld; their effect is handled by the normal
48 * 7. The autoquiver option will fill it with something deemed
49 * suitable if (f)ire is used when it's empty.
51 * No item may be in more than one of these slots.
54 STATIC_DCL boolean
FDECL(cant_wield_corpse
, (struct obj
*));
55 STATIC_DCL
int FDECL(ready_weapon
, (struct obj
*));
57 /* used by will_weld() */
58 /* probably should be renamed */
59 #define erodeable_wep(optr) \
60 ((optr)->oclass == WEAPON_CLASS || is_weptool(optr) \
61 || (optr)->otyp == HEAVY_IRON_BALL || (optr)->otyp == IRON_CHAIN)
63 /* used by welded(), and also while wielding */
64 #define will_weld(optr) \
65 ((optr)->cursed && (erodeable_wep(optr) || (optr)->otyp == TIN_OPENER))
67 /*** Functions that place a given item in a slot ***/
68 /* Proper usage includes:
69 * 1. Initializing the slot during character generation or a
71 * 2. Setting the slot due to a player's actions.
72 * 3. If one of the objects in the slot are split off, these
73 * functions can be used to put the remainder back in the slot.
74 * 4. Putting an item that was thrown and returned back into the slot.
75 * 5. Emptying the slot, by passing a null object. NEVER pass
78 * If the item is being moved from another slot, it is the caller's
79 * responsibility to handle that. It's also the caller's responsibility
80 * to print the appropriate messages.
84 register struct obj
*obj
;
86 struct obj
*olduwep
= uwep
;
89 return; /* necessary to not set unweapon */
90 /* This message isn't printed in the caller because it happens
91 * *whenever* Sunsword is unwielded, from whatever cause.
94 if (uwep
== obj
&& artifact_light(olduwep
) && olduwep
->lamplit
) {
95 end_burn(olduwep
, FALSE
);
97 pline("%s shining.", Tobjnam(olduwep
, "stop"));
99 /* Note: Explicitly wielding a pick-axe will not give a "bashing"
100 * message. Wielding one via 'a'pplying it will.
101 * 3.2.2: Wielding arbitrary objects will give bashing message too.
104 unweapon
= (obj
->oclass
== WEAPON_CLASS
)
105 ? is_launcher(obj
) || is_ammo(obj
) || is_missile(obj
)
106 || (is_pole(obj
) && !u
.usteed
)
107 : !is_weptool(obj
) && !is_wet_towel(obj
);
109 unweapon
= TRUE
; /* for "bare hands" message */
114 cant_wield_corpse(obj
)
119 if (uarmg
|| obj
->otyp
!= CORPSE
|| !touch_petrifies(&mons
[obj
->corpsenm
])
123 /* Prevent wielding cockatrice when not wearing gloves --KAA */
124 You("wield %s in your bare %s.",
125 corpse_xname(obj
, (const char *) 0, CXN_PFX_THE
),
126 makeplural(body_part(HAND
)));
127 Sprintf(kbuf
, "wielding %s bare-handed", killer_xname(obj
));
136 /* Separated function so swapping works easily */
142 You("are empty %s.", body_part(HANDED
));
143 setuwep((struct obj
*) 0);
146 You("are already empty %s.", body_part(HANDED
));
147 } else if (wep
->otyp
== CORPSE
&& cant_wield_corpse(wep
)) {
148 /* hero must have been life-saved to get here; use a turn */
149 res
++; /* corpse won't be wielded */
150 } else if (uarms
&& bimanual(wep
)) {
151 You("cannot wield a two-handed %s while wearing a shield.",
152 is_sword(wep
) ? "sword" : wep
->otyp
== BATTLE_AXE
? "axe"
154 } else if (!retouch_object(&wep
, FALSE
)) {
155 res
++; /* takes a turn even though it doesn't get wielded */
157 /* Weapon WILL be wielded after this point */
159 if (will_weld(wep
)) {
160 const char *tmp
= xname(wep
), *thestr
= "The ";
162 if (strncmp(tmp
, thestr
, 4) && !strncmp(The(tmp
), thestr
, 4))
166 pline("%s%s %s to your %s!", tmp
, aobjnam(wep
, "weld"),
167 (wep
->quan
== 1L) ? "itself" : "themselves", /* a3 */
168 bimanual(wep
) ? (const char *) makeplural(body_part(HAND
))
172 /* The message must be printed before setuwep (since
173 * you might die and be revived from changing weapons),
174 * and the message must be before the death message and
175 * Lifesaved rewielding. Yet we want the message to
176 * say "weapon in hand", thus this kludge.
177 * [That comment is obsolete. It dates from the days (3.0)
178 * when unwielding Firebrand could cause hero to be burned
179 * to death in Hell due to loss of fire resistance.
180 * "Lifesaved re-wielding or re-wearing" is ancient history.]
182 long dummy
= wep
->owornmask
;
184 wep
->owornmask
|= W_WEP
;
185 prinv((char *) 0, wep
, 0L);
186 wep
->owornmask
= dummy
;
190 /* KMH -- Talking artifacts are finally implemented */
193 if (artifact_light(wep
) && !wep
->lamplit
) {
194 begin_burn(wep
, FALSE
);
196 pline("%s to shine %s!", Tobjnam(wep
, "begin"),
197 arti_light_description(wep
));
200 /* we'll get back to this someday, but it's not balanced yet */
201 if (Race_if(PM_ELF
) && !wep
->oartifact
202 && objects
[wep
->otyp
].oc_material
== IRON
) {
203 /* Elves are averse to wielding cold iron */
204 You("have an uneasy feeling about wielding cold iron.");
209 struct monst
*this_shkp
;
211 if ((this_shkp
= shop_keeper(inside_shop(u
.ux
, u
.uy
)))
212 != (struct monst
*) 0) {
213 pline("%s says \"You be careful with my %s!\"",
214 shkname(this_shkp
), xname(wep
));
223 register struct obj
*obj
;
225 setworn(obj
, W_QUIVER
);
231 register struct obj
*obj
;
233 setworn(obj
, W_SWAPWEP
);
237 /*** Commands to change particular slot(s) ***/
239 static NEARDATA
const char wield_objs
[] = {
240 ALL_CLASSES
, ALLOW_NONE
, WEAPON_CLASS
, TOOL_CLASS
, 0
242 static NEARDATA
const char ready_objs
[] = {
243 ALLOW_COUNT
, COIN_CLASS
, ALL_CLASSES
, ALLOW_NONE
, WEAPON_CLASS
, 0
245 static NEARDATA
const char bullets
[] = { /* (note: different from dothrow.c) */
246 ALLOW_COUNT
, COIN_CLASS
, ALL_CLASSES
, ALLOW_NONE
,
247 GEM_CLASS
, WEAPON_CLASS
, 0
253 register struct obj
*wep
, *oldwep
;
256 /* May we attempt this? */
258 if (cantwield(youmonst
.data
)) {
259 pline("Don't be ridiculous!");
263 /* Prompt for a new weapon */
264 if (!(wep
= getobj(wield_objs
, "wield")))
267 else if (wep
== uwep
) {
268 You("are already wielding that!");
269 if (is_weptool(wep
) || is_wet_towel(wep
))
270 unweapon
= FALSE
; /* [see setuwep()] */
272 } else if (welded(uwep
)) {
274 /* previously interrupted armor removal mustn't be resumed */
279 /* Handle no object, or object in other slot */
281 wep
= (struct obj
*) 0;
282 else if (wep
== uswapwep
)
283 return doswapweapon();
284 else if (wep
== uquiver
)
285 setuqwep((struct obj
*) 0);
286 else if (wep
->owornmask
& (W_ARMOR
| W_ACCESSORY
| W_SADDLE
)) {
287 You("cannot wield that!");
291 /* Set your new primary weapon */
293 result
= ready_weapon(wep
);
294 if (flags
.pushweapon
&& oldwep
&& uwep
!= oldwep
)
304 register struct obj
*oldwep
, *oldswap
;
307 /* May we attempt this? */
309 if (cantwield(youmonst
.data
)) {
310 pline("Don't be ridiculous!");
318 /* Unwield your current secondary weapon */
321 setuswapwep((struct obj
*) 0);
323 /* Set your new primary weapon */
324 result
= ready_weapon(oldswap
);
326 /* Set your new secondary weapon */
327 if (uwep
== oldwep
) {
328 /* Wield failed for some reason */
329 setuswapwep(oldswap
);
333 prinv((char *) 0, uswapwep
, 0L);
335 You("have no secondary weapon readied.");
338 if (u
.twoweap
&& !can_twoweapon())
348 struct obj
*newquiver
;
349 const char *quivee_types
;
351 boolean finish_splitting
= FALSE
,
352 was_uwep
= FALSE
, was_twoweap
= u
.twoweap
;
354 /* Since the quiver isn't in your hands, don't check cantwield(), */
355 /* will_weld(), touch_petrifies(), etc. */
357 /* forget last splitobj() before calling getobj() with ALLOW_COUNT */
358 context
.objsplit
.child_oid
= context
.objsplit
.parent_oid
= 0;
360 /* Prompt for a new quiver: "What do you want to ready?"
361 (Include gems/stones as likely candidates if either primary
362 or secondary weapon is a sling.) */
363 quivee_types
= (uslinging()
365 && objects
[uswapwep
->otyp
].oc_skill
== P_SLING
))
368 newquiver
= getobj(quivee_types
, "ready");
373 } else if (newquiver
== &zeroobj
) { /* no object */
374 /* Explicitly nothing */
376 You("now have no ammunition readied.");
377 /* skip 'quivering: prinv()' */
378 setuqwep((struct obj
*) 0);
380 You("already have no ammunition readied!");
383 } else if (newquiver
->o_id
== context
.objsplit
.child_oid
) {
384 /* if newquiver is the result of supplying a count to getobj()
385 we don't want to split something already in the quiver;
386 for any other item, we need to give it its own inventory slot */
387 if (uquiver
&& uquiver
->o_id
== context
.objsplit
.parent_oid
) {
388 unsplitobj(newquiver
);
389 goto already_quivered
;
391 finish_splitting
= TRUE
;
392 } else if (newquiver
== uquiver
) {
394 pline("That ammunition is already readied!");
396 } else if (newquiver
->owornmask
& (W_ARMOR
| W_ACCESSORY
| W_SADDLE
)) {
397 You("cannot ready that!");
399 } else if (newquiver
== uwep
) {
400 int weld_res
= !uwep
->bknown
;
404 reset_remarm(); /* same as dowield() */
407 /* offer to split stack if wielding more than 1 */
408 if (uwep
->quan
> 1L && inv_cnt(FALSE
) < 52 && splittable(uwep
)) {
409 Sprintf(qbuf
, "You are wielding %ld %s. Ready %ld of them?",
410 uwep
->quan
, simpleonames(uwep
), uwep
->quan
- 1L);
415 /* leave 1 wielded, split rest off and put into quiver */
416 newquiver
= splitobj(uwep
, uwep
->quan
- 1L);
417 finish_splitting
= TRUE
;
422 Strcpy(qbuf
, "Ready all of them instead?");
424 Sprintf(qbuf
, "You are wielding %s. Ready %s instead?",
425 /* uwep->quan is 1, but name might be plural ('boots') */
426 !is_plural(uwep
) ? "that" : "those",
427 !is_plural(uwep
) ? "it" : "them");
429 /* require confirmation to ready the main weapon */
430 if (ynq(qbuf
) != 'y') {
431 (void) Shk_Your(qbuf
, uwep
); /* replace qbuf[] contents */
432 pline("%s%s %s wielded.", qbuf
,
433 simpleonames(uwep
), otense(uwep
, "remain"));
436 /* quivering main weapon, so no longer wielding it */
437 setuwep((struct obj
*) 0);
440 } else if (newquiver
== uswapwep
) {
441 if (uswapwep
->quan
> 1L && inv_cnt(FALSE
) < 52
442 && splittable(uswapwep
)) {
443 Sprintf(qbuf
, "%s %ld %s. Ready %ld of them?",
444 u
.twoweap
? "You are dual wielding"
445 : "Your alternate weapon is",
446 uswapwep
->quan
, simpleonames(uswapwep
),
447 uswapwep
->quan
- 1L);
452 /* leave 1 alt-wielded, split rest off and put into quiver */
453 newquiver
= splitobj(uswapwep
, uswapwep
->quan
- 1L);
454 finish_splitting
= TRUE
;
459 Strcpy(qbuf
, "Ready all of them instead?");
461 Sprintf(qbuf
, "%s your %s weapon. Ready %s instead?",
462 !is_plural(uswapwep
) ? "That is" : "Those are",
463 u
.twoweap
? "second" : "alternate",
464 /* uswapwep->quan is 1, but name might be plural */
465 !is_plural(uswapwep
) ? "it" : "them");
467 /* require confirmation to ready the alternate weapon */
468 if (ynq(qbuf
) != 'y') {
469 (void) Shk_Your(qbuf
, uswapwep
); /* replace qbuf[] contents */
470 pline("%s%s %s %s.", qbuf
,
471 simpleonames(uswapwep
), otense(uswapwep
, "remain"),
472 u
.twoweap
? "wielded" : "as secondary weapon");
475 /* quivering alternate weapon, so no more uswapwep */
476 setuswapwep((struct obj
*) 0);
481 if (finish_splitting
) {
483 newquiver
->nomerge
= 1;
485 newquiver
->nomerge
= 0;
487 /* place item in quiver before printing so that inventory feedback
488 includes "(at the ready)" */
490 prinv((char *) 0, newquiver
, 0L);
492 /* quiver is a convenience slot and manipulating it ordinarily
493 consumes no time, but unwielding primary or secondary weapon
494 should take time (perhaps we're adjacent to a rust monster
495 or disenchanter and want to hit it immediately, but not with
496 something we're wielding that's vulnerable to its damage) */
499 You("are now empty %s.", body_part(HANDED
));
501 } else if (was_twoweap
&& !u
.twoweap
) {
502 You("are no longer wielding two weapons at once.");
508 /* used for #rub and for applying pick-axe, whip, grappling hook or polearm */
510 wield_tool(obj
, verb
)
512 const char *verb
; /* "rub",&c */
518 return TRUE
; /* nothing to do if already wielding it */
523 more_than_1
= (obj
->quan
> 1L || strstri(what
, "pair of ") != 0
524 || strstri(what
, "s of ") != 0);
526 if (obj
->owornmask
& (W_ARMOR
| W_ACCESSORY
)) {
527 You_cant("%s %s while wearing %s.", verb
, yname(obj
),
528 more_than_1
? "them" : "it");
533 const char *hand
= body_part(HAND
);
536 hand
= makeplural(hand
);
537 if (strstri(what
, "pair of ") != 0)
540 "Since your weapon is welded to your %s, you cannot %s %s %s.",
541 hand
, verb
, more_than_1
? "those" : "that", xname(obj
));
543 You_cant("do that.");
547 if (cantwield(youmonst
.data
)) {
548 You_cant("hold %s strongly enough.", more_than_1
? "them" : "it");
552 if (uarms
&& bimanual(obj
)) {
553 You("cannot %s a two-handed %s while wearing a shield.", verb
,
554 (obj
->oclass
== WEAPON_CLASS
) ? "weapon" : "tool");
559 setuqwep((struct obj
*) 0);
560 if (uswapwep
== obj
) {
561 (void) doswapweapon();
562 /* doswapweapon might fail */
566 struct obj
*oldwep
= uwep
;
568 You("now wield %s.", doname(obj
));
570 if (flags
.pushweapon
&& oldwep
&& uwep
!= oldwep
)
574 return FALSE
; /* rewielded old object after dying */
575 /* applying weapon or tool that gets wielded ends two-weapon combat */
578 if (obj
->oclass
!= WEAPON_CLASS
)
588 #define NOT_WEAPON(obj) (!is_weptool(obj) && obj->oclass != WEAPON_CLASS)
589 if (!could_twoweap(youmonst
.data
)) {
591 You_cant("use two weapons in your current form.");
593 pline("%s aren't able to use two weapons at once.",
594 makeplural((flags
.female
&& urole
.name
.f
) ? urole
.name
.f
596 } else if (!uwep
|| !uswapwep
)
597 Your("%s%s%s empty.", uwep
? "left " : uswapwep
? "right " : "",
598 body_part(HAND
), (!uwep
&& !uswapwep
) ? "s are" : " is");
599 else if (NOT_WEAPON(uwep
) || NOT_WEAPON(uswapwep
)) {
600 otmp
= NOT_WEAPON(uwep
) ? uwep
: uswapwep
;
601 pline("%s %s.", Yname2(otmp
),
602 is_plural(otmp
) ? "aren't weapons" : "isn't a weapon");
603 } else if (bimanual(uwep
) || bimanual(uswapwep
)) {
604 otmp
= bimanual(uwep
) ? uwep
: uswapwep
;
605 pline("%s isn't one-handed.", Yname2(otmp
));
607 You_cant("use two weapons while wearing a shield.");
608 else if (uswapwep
->oartifact
)
609 pline("%s being held second to another weapon!",
610 Yobjnam2(uswapwep
, "resist"));
611 else if (uswapwep
->otyp
== CORPSE
&& cant_wield_corpse(uswapwep
)) {
612 /* [Note: NOT_WEAPON() check prevents ever getting here...] */
613 ; /* must be life-saved to reach here; return FALSE */
614 } else if (Glib
|| uswapwep
->cursed
) {
616 uswapwep
->bknown
= TRUE
;
627 struct obj
*obj
= uswapwep
;
629 /* Avoid trashing makeplural's static buffer */
630 Strcpy(str
, makeplural(body_part(HAND
)));
631 pline("%s from your %s!", Yobjnam2(obj
, "slip"), str
);
638 /* You can always toggle it off */
640 You("switch to your primary weapon.");
646 /* May we use two weapons? */
647 if (can_twoweapon()) {
649 You("begin two-weapon combat.");
652 return (rnd(20) > ACURR(A_DEX
));
657 /*** Functions to empty a given slot ***/
658 /* These should be used only when the item can't be put back in
659 * the slot by life saving. Proper usage includes:
660 * 1. The item has been eaten, stolen, burned away, or rotted away.
661 * 2. Making an item disappear for a bones pile.
667 if (artifact_light(uwep
) && uwep
->lamplit
) {
668 end_burn(uwep
, FALSE
);
670 pline("%s shining.", Tobjnam(uwep
, "stop"));
672 setworn((struct obj
*) 0, W_WEP
);
682 setworn((struct obj
*) 0, W_SWAPWEP
);
691 setworn((struct obj
*) 0, W_QUIVER
);
700 You("can no longer use two weapons at once.");
708 chwepon(otmp
, amount
)
709 register struct obj
*otmp
;
712 const char *color
= hcolor((amount
< 0) ? NH_BLACK
: NH_BLUE
);
713 const char *xtime
, *wepname
= "";
715 int otyp
= STRANGE_OBJECT
;
717 if (!uwep
|| (uwep
->oclass
!= WEAPON_CLASS
&& !is_weptool(uwep
))) {
720 if (amount
>= 0 && uwep
&& will_weld(uwep
)) { /* cursed tin opener */
722 Sprintf(buf
, "%s with %s aura.",
723 Yobjnam2(uwep
, "glow"), an(hcolor(NH_AMBER
)));
724 uwep
->bknown
= !Hallucination
;
726 /* cursed tin opener is wielded in right hand */
727 Sprintf(buf
, "Your right %s tingles.", body_part(HAND
));
732 Sprintf(buf
, "Your %s %s.", makeplural(body_part(HAND
)),
733 (amount
>= 0) ? "twitch" : "itch");
735 strange_feeling(otmp
, buf
); /* pline()+docall()+useup() */
736 exercise(A_DEX
, (boolean
) (amount
>= 0));
740 if (otmp
&& otmp
->oclass
== SCROLL_CLASS
)
743 if (uwep
->otyp
== WORM_TOOTH
&& amount
>= 0) {
744 multiple
= (uwep
->quan
> 1L);
745 /* order: message, transformation, shop handling */
746 Your("%s %s much sharper now.", simpleonames(uwep
),
747 multiple
? "fuse, and become" : "is");
748 uwep
->otyp
= CRYSKNIFE
;
749 uwep
->oerodeproof
= 0;
752 uwep
->owt
= weight(uwep
);
756 /* update shop bill to reflect new higher value */
758 alter_cost(uwep
, 0L);
759 if (otyp
!= STRANGE_OBJECT
)
764 } else if (uwep
->otyp
== CRYSKNIFE
&& amount
< 0) {
765 multiple
= (uwep
->quan
> 1L);
766 /* order matters: message, shop handling, transformation */
767 Your("%s %s much duller now.", simpleonames(uwep
),
768 multiple
? "fuse, and become" : "is");
769 costly_alteration(uwep
, COST_DEGRD
); /* DECHNT? other? */
770 uwep
->otyp
= WORM_TOOTH
;
771 uwep
->oerodeproof
= 0;
774 uwep
->owt
= weight(uwep
);
776 if (otyp
!= STRANGE_OBJECT
&& otmp
->bknown
)
784 wepname
= ONAME(uwep
);
785 if (amount
< 0 && uwep
->oartifact
&& restrict_name(uwep
, wepname
)) {
787 pline("%s %s.", Yobjnam2(uwep
, "faintly glow"), color
);
790 /* there is a (soft) upper and lower limit to uwep->spe */
791 if (((uwep
->spe
> 5 && amount
>= 0) || (uwep
->spe
< -5 && amount
< 0))
794 pline("%s %s for a while and then %s.",
795 Yobjnam2(uwep
, "violently glow"), color
,
796 otense(uwep
, "evaporate"));
798 pline("%s.", Yobjnam2(uwep
, "evaporate"));
800 useupall(uwep
); /* let all of them disappear */
804 xtime
= (amount
* amount
== 1) ? "moment" : "while";
805 pline("%s %s for a %s.",
806 Yobjnam2(uwep
, amount
== 0 ? "violently glow" : "glow"), color
,
808 if (otyp
!= STRANGE_OBJECT
&& uwep
->known
809 && (amount
> 0 || (amount
< 0 && otmp
->bknown
)))
813 costly_alteration(uwep
, COST_DECHNT
);
818 /* update shop bill to reflect new higher price */
820 alter_cost(uwep
, 0L);
824 * Enchantment, which normally improves a weapon, has an
825 * addition adverse reaction on Magicbane whose effects are
826 * spe dependent. Give an obscure clue here.
828 if (uwep
->oartifact
== ART_MAGICBANE
&& uwep
->spe
>= 0) {
829 Your("right %s %sches!", body_part(HAND
),
830 (((amount
> 1) && (uwep
->spe
> 1)) ? "flin" : "it"));
833 /* an elven magic clue, cookie@keebler */
834 /* elven weapons vibrate warningly when enchanted beyond a limit */
836 && (is_elven_weapon(uwep
) || uwep
->oartifact
|| !rn2(7)))
837 pline("%s unexpectedly.", Yobjnam2(uwep
, "suddenly vibrate"));
844 register struct obj
*obj
;
846 if (obj
&& obj
== uwep
&& will_weld(obj
)) {
855 register struct obj
*obj
;
859 savewornmask
= obj
->owornmask
;
860 pline("%s welded to your %s!", Yobjnam2(obj
, "are"),
861 bimanual(obj
) ? (const char *) makeplural(body_part(HAND
))
863 obj
->owornmask
= savewornmask
;
866 /* test whether monster's wielded weapon is stuck to hand/paw/whatever */
871 /* caller is responsible for making sure this is a monster's item */
872 if (obj
&& (obj
->owornmask
& W_WEP
) && will_weld(obj
))