1 /* NetHack 3.6 wield.c $NHDT-Date: 1446887539 2015/11/07 09:12:19 $ $NHDT-Branch: master $:$NHDT-Revision: 1.47 $ */
2 /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
3 /* NetHack may be freely redistributed. See license for details. */
5 /* JNetHack Copyright */
6 /* (c) Issei Numata, Naoki Hamada, Shigehiro Miyashita, 1994-2000 */
7 /* For 3.4-, Copyright (c) SHIRAKATA Kentaro, 2002-2016 */
8 /* JNetHack may be freely redistributed. See license for details. */
12 /* KMH -- Differences between the three weapon slots.
14 * The main weapon (uwep):
15 * 1. Is filled by the (w)ield command.
16 * 2. Can be filled with any type of item.
17 * 3. May be carried in one or both hands.
18 * 4. Is used as the melee weapon and as the launcher for
20 * 5. Only conveys intrinsics when it is a weapon, weapon-tool,
22 * 6. Certain cursed items will weld to the hand and cannot be
23 * unwielded or dropped. See erodeable_wep() and will_weld()
24 * below for the list of which items apply.
26 * The secondary weapon (uswapwep):
27 * 1. Is filled by the e(x)change command, which swaps this slot
28 * with the main weapon. If the "pushweapon" option is set,
29 * the (w)ield command will also store the old weapon in the
31 * 2. Can be filled with anything that will fit in the main weapon
32 * slot; that is, any type of item.
33 * 3. Is usually NOT considered to be carried in the hands.
34 * That would force too many checks among the main weapon,
35 * second weapon, shield, gloves, and rings; and it would
36 * further be complicated by bimanual weapons. A special
37 * exception is made for two-weapon combat.
38 * 4. Is used as the second weapon for two-weapon combat, and as
39 * a convenience to swap with the main weapon.
40 * 5. Never conveys intrinsics.
41 * 6. Cursed items never weld (see #3 for reasons), but they also
42 * prevent two-weapon combat.
44 * The quiver (uquiver):
45 * 1. Is filled by the (Q)uiver command.
46 * 2. Can be filled with any type of item.
47 * 3. Is considered to be carried in a special part of the pack.
48 * 4. Is used as the item to throw with the (f)ire command.
49 * This is a convenience over the normal (t)hrow command.
50 * 5. Never conveys intrinsics.
51 * 6. Cursed items never weld; their effect is handled by the normal
53 * 7. The autoquiver option will fill it with something deemed
54 * suitable if (f)ire is used when it's empty.
56 * No item may be in more than one of these slots.
59 STATIC_DCL boolean FDECL(cant_wield_corpse, (struct obj *));
60 STATIC_DCL int FDECL(ready_weapon, (struct obj *));
62 /* used by will_weld() */
63 /* probably should be renamed */
64 #define erodeable_wep(optr) \
65 ((optr)->oclass == WEAPON_CLASS || is_weptool(optr) \
66 || (optr)->otyp == HEAVY_IRON_BALL || (optr)->otyp == IRON_CHAIN)
68 /* used by welded(), and also while wielding */
69 #define will_weld(optr) \
70 ((optr)->cursed && (erodeable_wep(optr) || (optr)->otyp == TIN_OPENER))
72 /*** Functions that place a given item in a slot ***/
73 /* Proper usage includes:
74 * 1. Initializing the slot during character generation or a
76 * 2. Setting the slot due to a player's actions.
77 * 3. If one of the objects in the slot are split off, these
78 * functions can be used to put the remainder back in the slot.
79 * 4. Putting an item that was thrown and returned back into the slot.
80 * 5. Emptying the slot, by passing a null object. NEVER pass
83 * If the item is being moved from another slot, it is the caller's
84 * responsibility to handle that. It's also the caller's responsibility
85 * to print the appropriate messages.
89 register struct obj *obj;
91 struct obj *olduwep = uwep;
94 return; /* necessary to not set unweapon */
95 /* This message isn't printed in the caller because it happens
96 * *whenever* Sunsword is unwielded, from whatever cause.
99 if (uwep == obj && artifact_light(olduwep) && olduwep->lamplit) {
100 end_burn(olduwep, FALSE);
103 pline("%s shining.", Tobjnam(olduwep, "stop"));
105 pline("%s
\82Í
\8bP
\82«
\82ð
\8e~
\82ß
\82½
\81D", xname(olduwep));
107 /* Note: Explicitly wielding a pick-axe will not give a "bashing"
108 * message. Wielding one via 'a'pplying it will.
109 * 3.2.2: Wielding arbitrary objects will give bashing message too.
112 unweapon = (obj->oclass == WEAPON_CLASS)
113 ? is_launcher(obj) || is_ammo(obj) || is_missile(obj)
114 || (is_pole(obj) && !u.usteed)
115 : !is_weptool(obj) && !is_wet_towel(obj);
117 unweapon = TRUE; /* for "bare hands" message */
122 cant_wield_corpse(obj)
127 if (uarmg || obj->otyp != CORPSE || !touch_petrifies(&mons[obj->corpsenm])
131 /* Prevent wielding cockatrice when not wearing gloves --KAA */
133 You("wield %s in your bare %s.",
134 corpse_xname(obj, (const char *) 0, CXN_PFX_THE),
135 makeplural(body_part(HAND)));
137 You("%s
\82ð%s
\82É
\82µ
\82½
\81D",
138 corpse_xname(obj, (const char *) 0, CXN_PFX_THE),
142 Sprintf(kbuf, "wielding %s bare-handed", killer_xname(obj));
144 Sprintf(kbuf, "%s
\82ð
\91f
\8eè
\82Å
\8eè
\82É
\82µ
\82Ä", killer_xname(obj));
153 /* Separated function so swapping works easily */
160 You("are empty %s.", body_part(HANDED));
162 You("%s
\82ð
\8bó
\82¯
\82½
\81D", body_part(HAND));
163 setuwep((struct obj *) 0);
167 You("are already empty %s.", body_part(HANDED));
169 You("
\89½
\82à%s
\82É
\82µ
\82Ä
\82¢
\82È
\82¢
\81I", body_part(HAND));
170 } else if (wep->otyp == CORPSE && cant_wield_corpse(wep)) {
171 /* hero must have been life-saved to get here; use a turn */
172 res++; /* corpse won't be wielded */
173 } else if (uarms && bimanual(wep)) {
175 You("cannot wield a two-handed %s while wearing a shield.",
176 is_sword(wep) ? "sword" : wep->otyp == BATTLE_AXE ? "axe"
179 pline("
\8f\82\82ð
\91\95\94õ
\82µ
\82Ä
\82¢
\82é
\82Æ
\82«
\82É
\97¼
\8eè
\8e\9d\82¿
\82Ì%s
\82ð
\91\95\94õ
\82Å
\82«
\82È
\82¢
\81D",
180 is_sword(wep) ? "
\8c\95" : wep->otyp == BATTLE_AXE ? "
\95\80"
183 } else if (!retouch_object(&wep, FALSE)) {
184 res++; /* takes a turn even though it doesn't get wielded */
186 /* Weapon WILL be wielded after this point */
188 if (will_weld(wep)) {
189 #if 0 /*JP*//*
\8eg
\82í
\82È
\82¢*/
190 const char *tmp = xname(wep), *thestr = "The ";
192 if (strncmp(tmp, thestr, 4) && !strncmp(The(tmp), thestr, 4))
198 pline("%s%s %s to your %s!", tmp, aobjnam(wep, "weld"),
199 (wep->quan == 1L) ? "itself" : "themselves", /* a3 */
200 bimanual(wep) ? (const char *) makeplural(body_part(HAND))
203 pline("%s
\82Í
\8f\9f\8eè
\82É
\82 \82È
\82½
\82Ì%s
\82É
\91\95\94õ
\82³
\82ê
\82½
\81D",
204 xname(wep), body_part(HAND));
208 /* The message must be printed before setuwep (since
209 * you might die and be revived from changing weapons),
210 * and the message must be before the death message and
211 * Lifesaved rewielding. Yet we want the message to
212 * say "weapon in hand", thus this kludge.
214 long dummy = wep->owornmask;
216 wep->owornmask |= W_WEP;
217 prinv((char *) 0, wep, 0L);
218 wep->owornmask = dummy;
222 /* KMH -- Talking artifacts are finally implemented */
225 if (artifact_light(wep) && !wep->lamplit) {
226 begin_burn(wep, FALSE);
229 pline("%s to shine %s!", Tobjnam(wep, "begin"),
230 arti_light_description(wep));
232 pline("%s
\82Í%s
\8bP
\82«
\82Í
\82¶
\82ß
\82½
\81I", xname(wep),
233 arti_light_description(wep));
237 /* we'll get back to this someday, but it's not balanced yet */
238 if (Race_if(PM_ELF) && !wep->oartifact
239 && objects[wep->otyp].oc_material == IRON) {
240 /* Elves are averse to wielding cold iron */
241 You("have an uneasy feeling about wielding cold iron.");
246 struct monst *this_shkp;
248 if ((this_shkp = shop_keeper(inside_shop(u.ux, u.uy)))
249 != (struct monst *) 0) {
251 pline("%s says \"You be careful with my %s!\"",
252 shkname(this_shkp), xname(wep));
254 pline("%s
\82Í
\8fq
\82×
\82½
\81u%s
\82Ì
\88µ
\82¢
\82Í
\8bC
\82ð
\82Â
\82¯
\82Ä
\82
\82ê
\82æ
\81I
\81v",
255 shkname(this_shkp), xname(wep));
265 register struct obj *obj;
267 setworn(obj, W_QUIVER);
273 register struct obj *obj;
275 setworn(obj, W_SWAPWEP);
279 /*** Commands to change particular slot(s) ***/
281 static NEARDATA const char wield_objs[] = { ALL_CLASSES, ALLOW_NONE,
282 WEAPON_CLASS, TOOL_CLASS, 0 };
283 static NEARDATA const char ready_objs[] = { COIN_CLASS, ALL_CLASSES,
284 ALLOW_NONE, WEAPON_CLASS, 0 };
285 static NEARDATA const char bullets[] = /* (note: different from dothrow.c) */
286 { COIN_CLASS, ALL_CLASSES, ALLOW_NONE, GEM_CLASS, WEAPON_CLASS, 0 };
291 register struct obj *wep, *oldwep;
294 /* May we attempt this? */
296 if (cantwield(youmonst.data)) {
298 pline("Don't be ridiculous!");
300 pline("
\82Î
\82©
\82Î
\82©
\82µ
\82¢
\81I");
304 /* Prompt for a new weapon */
305 if (!(wep = getobj(wield_objs, "wield")))
308 else if (wep == uwep) {
310 You("are already wielding that!");
312 You("
\82à
\82¤
\82»
\82ê
\82ð%s
\82É
\82µ
\82Ä
\82¢
\82é
\81I", body_part(HAND));
313 if (is_weptool(wep) || is_wet_towel(wep))
314 unweapon = FALSE; /* [see setuwep()] */
316 } else if (welded(uwep)) {
318 /* previously interrupted armor removal mustn't be resumed */
323 /* Handle no object, or object in other slot */
325 wep = (struct obj *) 0;
326 else if (wep == uswapwep)
327 return doswapweapon();
328 else if (wep == uquiver)
329 setuqwep((struct obj *) 0);
330 else if (wep->owornmask & (W_ARMOR | W_ACCESSORY | W_SADDLE)) {
332 You("cannot wield that!");
334 You("
\82»
\82ê
\82ð
\91\95\94õ
\82Å
\82«
\82È
\82¢
\81I");
338 /* Set your new primary weapon */
340 result = ready_weapon(wep);
341 if (flags.pushweapon && oldwep && uwep != oldwep)
351 register struct obj *oldwep, *oldswap;
354 /* May we attempt this? */
356 if (cantwield(youmonst.data)) {
358 pline("Don't be ridiculous!");
360 pline("
\82Î
\82©
\82Î
\82©
\82µ
\82¢
\81I");
368 /* Unwield your current secondary weapon */
371 setuswapwep((struct obj *) 0);
373 /* Set your new primary weapon */
374 result = ready_weapon(oldswap);
376 /* Set your new secondary weapon */
378 /* Wield failed for some reason */
379 setuswapwep(oldswap);
383 prinv((char *) 0, uswapwep, 0L);
386 You("have no secondary weapon readied.");
388 You("
\97\
\94õ
\82Ì
\95\90\8aí
\82Ì
\97p
\88Ó
\82ð
\82â
\82ß
\82½
\81D");
391 if (u.twoweap && !can_twoweapon())
400 register struct obj *newquiver;
401 const char *quivee_types =
403 || (uswapwep && objects[uswapwep->otyp].oc_skill == P_SLING))
407 /* Since the quiver isn't in your hands, don't check cantwield(), */
408 /* will_weld(), touch_petrifies(), etc. */
411 /* Prompt for a new quiver */
412 if (!(newquiver = getobj(quivee_types, "ready")))
416 /* Handle no object, or object in other slot */
417 /* Any type is okay, since we give no intrinsics anyways */
418 if (newquiver == &zeroobj) {
419 /* Explicitly nothing */
422 You("now have no ammunition readied.");
424 pline("
\91\95\93U
\82·
\82é
\82½
\82ß
\82Ì
\96î
\92e
\82ª
\82È
\82
\82È
\82Á
\82½
\81D");
425 setuqwep(newquiver = (struct obj *) 0);
428 You("already have no ammunition readied!");
430 pline("
\91\95\93U
\82·
\82é
\82½
\82ß
\82Ì
\96î
\92e
\82ª
\82È
\82¢
\81D");
433 } else if (newquiver == uquiver) {
435 pline("That ammunition is already readied!");
437 pline("
\82à
\82¤
\91\95\93U
\82³
\82ê
\82Ä
\82¢
\82é
\81I");
439 } else if (newquiver == uwep) {
440 /* Prevent accidentally readying the main weapon */
442 pline("%s already being used as a weapon!",
443 !is_plural(uwep) ? "That is" : "They are");
445 pline("
\82à
\82¤
\95\90\8aí
\82Æ
\82µ
\82Ä
\8eg
\82í
\82ê
\82Ä
\82¢
\82é
\81I");
448 } else if (newquiver->owornmask & (W_ARMOR | W_ACCESSORY | W_SADDLE)) {
450 You("cannot ready that!");
452 You("
\82»
\82ê
\82Í
\8eg
\82¦
\82È
\82¢
\81I");
457 /* Check if it's the secondary weapon */
458 if (newquiver == uswapwep) {
459 setuswapwep((struct obj *) 0);
463 /* Okay to put in quiver; print it */
464 dummy = newquiver->owornmask;
465 newquiver->owornmask |= W_QUIVER;
466 prinv((char *) 0, newquiver, 0L);
467 newquiver->owornmask = dummy;
470 /* Finally, place it in the quiver */
472 /* Take no time since this is a convenience slot */
476 /* used for #rub and for applying pick-axe, whip, grappling hook or polearm */
478 wield_tool(obj, verb)
480 const char *verb; /* "rub",&c */
486 return TRUE; /* nothing to do if already wielding it */
494 more_than_1 = (obj->quan > 1L || strstri(what, "pair of ") != 0
495 || strstri(what, "s of ") != 0);
498 if (obj->owornmask & (W_ARMOR | W_ACCESSORY)) {
500 You_cant("%s %s while wearing %s.", verb, yname(obj),
501 more_than_1 ? "them" : "it");
503 pline("
\90g
\82É
\82Â
\82¯
\82½
\82Ü
\82Ü
\82Å
\82Í%s
\82Í
\8eg
\82¦
\82È
\82¢
\81D", yname(obj));
510 const char *hand = body_part(HAND);
513 hand = makeplural(hand);
514 if (strstri(what, "pair of ") != 0)
517 "Since your weapon is welded to your %s, you cannot %s %s %s.",
518 hand, verb, more_than_1 ? "those" : "that", xname(obj));
520 pline("
\95\90\8aí
\82ð
\8eè
\82É
\82µ
\82Ä
\82¢
\82é
\82Ì
\82Å
\81C%s
\82ð
\8eg
\82¦
\82È
\82¢
\81D", xname(obj));
524 You_cant("do that.");
526 pline("
\82»
\82ê
\82Í
\82Å
\82«
\82È
\82¢
\81D");
530 if (cantwield(youmonst.data)) {
532 You_cant("hold %s strongly enough.", more_than_1 ? "them" : "it");
534 You("
\82»
\82ê
\82ð
\8e\9d\82Â
\82Ù
\82Ç
\97Í
\82ª
\82È
\82¢
\81D");
538 if (uarms && bimanual(obj)) {
540 You("cannot %s a two-handed %s while wearing a shield.", verb,
541 (obj->oclass == WEAPON_CLASS) ? "weapon" : "tool");
543 pline("
\8f\82\82ð
\91\95\94õ
\82µ
\82½
\82Ü
\82Ü
\97¼
\8eè
\8e\9d\82¿
\82Ì%s
\82ð
\91\95\94õ
\82Å
\82«
\82È
\82¢
\81D",
544 (obj->oclass == WEAPON_CLASS) ? "
\95\90\8aí" : "
\93¹
\8bï");
550 setuqwep((struct obj *) 0);
551 if (uswapwep == obj) {
552 (void) doswapweapon();
553 /* doswapweapon might fail */
557 struct obj *oldwep = uwep;
560 You("now wield %s.", doname(obj));
562 You("%s
\82ð
\91\95\94õ
\82µ
\82½
\81D", doname(obj));
564 if (flags.pushweapon && oldwep && uwep != oldwep)
568 return FALSE; /* rewielded old object after dying */
569 /* applying weapon or tool that gets wielded ends two-weapon combat */
572 if (obj->oclass != WEAPON_CLASS)
582 #define NOT_WEAPON(obj) (!is_weptool(obj) && obj->oclass != WEAPON_CLASS)
583 if (!could_twoweap(youmonst.data)) {
586 You_cant("use two weapons in your current form.");
588 pline("
\8c»
\8dÝ
\82Ì
\8ep
\82Å
\82Í
\93ñ
\93\81\97¬
\82Í
\8eg
\82¦
\82È
\82¢
\81D");
591 pline("%s aren't able to use two weapons at once.",
593 pline("%s
\82Í
\93ñ
\82Â
\82Ì
\95\90\8aí
\82ð
\93¯
\8e\9e\82É
\88µ
\82¦
\82È
\82¢
\81D",
594 makeplural((flags.female && urole.name.f) ? urole.name.f
596 } else if (!uwep || !uswapwep)
598 Your("%s%s%s empty.", uwep ? "left " : uswapwep ? "right " : "",
599 body_part(HAND), (!uwep && !uswapwep) ? "s are" : " is");
601 Your("%s%s
\82Í
\8bó
\82Á
\82Û
\82¾
\81D", uwep ? "
\8d¶
\82Ì" : uswapwep ? "
\89E
\82Ì" : "",
604 else if (NOT_WEAPON(uwep) || NOT_WEAPON(uswapwep)) {
605 otmp = NOT_WEAPON(uwep) ? uwep : uswapwep;
607 pline("%s %s.", Yname2(otmp),
608 is_plural(otmp) ? "aren't weapons" : "isn't a weapon");
610 pline("%s
\82Í
\95\90\8aí
\82¶
\82á
\82È
\82¢
\81D", Yname2(otmp));
612 } else if (bimanual(uwep) || bimanual(uswapwep)) {
613 otmp = bimanual(uwep) ? uwep : uswapwep;
615 pline("%s isn't one-handed.", Yname2(otmp));
617 pline("%s
\82Í
\95Ð
\8eè
\8e\9d\82¿
\82Ì
\95\90\8aí
\82¶
\82á
\82È
\82¢
\81D", Yname2(otmp));
620 You_cant("use two weapons while wearing a shield.");
622 You("
\8f\82\82ð
\8e\9d\82Á
\82Ä
\82¢
\82é
\8aÔ
\82Í
\97¼
\8eè
\8e\9d\82¿
\82Å
\82«
\82È
\82¢
\81D");
623 else if (uswapwep->oartifact)
625 pline("%s being held second to another weapon!",
626 Yobjnam2(uswapwep, "resist"));
628 pline("%s
\82Í
\97\
\94õ
\82Ì
\95\90\8aí
\82Æ
\82µ
\82Ä
\88µ
\82í
\82ê
\82é
\82±
\82Æ
\82ð
\8b\91\82ñ
\82¾
\81I",
631 else if (uswapwep->otyp == CORPSE && cant_wield_corpse(uswapwep)) {
632 /* [Note: NOT_WEAPON() check prevents ever getting here...] */
633 ; /* must be life-saved to reach here; return FALSE */
634 } else if (Glib || uswapwep->cursed) {
636 uswapwep->bknown = TRUE;
647 struct obj *obj = uswapwep;
649 /* Avoid trashing makeplural's static buffer */
650 Strcpy(str, makeplural(body_part(HAND)));
652 pline("%s from your %s!", Yobjnam2(obj, "slip"), str);
654 You("%s
\82ð
\97\8e\82µ
\82Ä
\82µ
\82Ü
\82Á
\82½
\81I", xname(obj));
661 /* You can always toggle it off */
664 You("switch to your primary weapon.");
666 You("
\88ê
\82Â
\82Ì
\95\90\8aí
\82Å
\90í
\93¬
\82·
\82é
\82±
\82Æ
\82É
\82µ
\82½
\81D");
672 /* May we use two weapons? */
673 if (can_twoweapon()) {
676 You("begin two-weapon combat.");
678 You("
\93ñ
\93\81\97¬
\82Å
\90í
\93¬
\82·
\82é
\82±
\82Æ
\82É
\82µ
\82½
\81D");
681 return (rnd(20) > ACURR(A_DEX));
686 /*** Functions to empty a given slot ***/
687 /* These should be used only when the item can't be put back in
688 * the slot by life saving. Proper usage includes:
689 * 1. The item has been eaten, stolen, burned away, or rotted away.
690 * 2. Making an item disappear for a bones pile.
696 if (artifact_light(uwep) && uwep->lamplit) {
697 end_burn(uwep, FALSE);
700 pline("%s shining.", Tobjnam(uwep, "stop"));
702 pline("%s
\82Í
\8bP
\82«
\82ð
\8e~
\82ß
\82½
\81D", xname(uwep));
704 setworn((struct obj *) 0, W_WEP);
714 setworn((struct obj *) 0, W_SWAPWEP);
723 setworn((struct obj *) 0, W_QUIVER);
733 You("can no longer use two weapons at once.");
735 You("
\82à
\82¤
\82Q
\82Â
\82Ì
\95\90\8aí
\82ð
\93¯
\8e\9e\82É
\8eg
\97p
\82·
\82é
\82±
\82Æ
\82Í
\82Å
\82«
\82È
\82¢
\81D");
743 chwepon(otmp, amount)
744 register struct obj *otmp;
747 const char *color = hcolor((amount < 0) ? NH_BLACK : NH_BLUE);
748 const char *xtime, *wepname = "";
750 int otyp = STRANGE_OBJECT;
752 if (!uwep || (uwep->oclass != WEAPON_CLASS && !is_weptool(uwep))) {
756 Sprintf(buf, "Your %s %s.", makeplural(body_part(HAND)),
757 (amount >= 0) ? "twitch" : "itch");
759 Sprintf(buf, "
\82 \82È
\82½
\82Ì%s
\82Í%s
\81D", makeplural(body_part(HAND)),
760 (amount >= 0) ? "
\82Ð
\82«
\82Â
\82Á
\82½" : "
\83\80\83Y
\83\80\83Y
\82µ
\82½");
762 strange_feeling(otmp, buf);
763 exercise(A_DEX, (boolean) (amount >= 0));
767 if (otmp && otmp->oclass == SCROLL_CLASS)
770 if (uwep->otyp == WORM_TOOTH && amount >= 0) {
771 multiple = (uwep->quan > 1L);
772 /* order: message, transformation, shop handling */
774 Your("%s %s much sharper now.", simpleonames(uwep),
775 multiple ? "fuse, and become" : "is");
777 Your("%s
\82Í%s
\82æ
\82è
\89s
\82³
\82ð
\91\9d\82µ
\82½
\82æ
\82¤
\82¾
\81D", simpleonames(uwep),
778 multiple ? "
\97Z
\8d\87\82µ
\82Ä
\81C" : "");
780 uwep->otyp = CRYSKNIFE;
781 uwep->oerodeproof = 0;
784 uwep->owt = weight(uwep);
788 /* update shop bill to reflect new higher value */
790 alter_cost(uwep, 0L);
791 if (otyp != STRANGE_OBJECT)
796 } else if (uwep->otyp == CRYSKNIFE && amount < 0) {
797 multiple = (uwep->quan > 1L);
798 /* order matters: message, shop handling, transformation */
800 Your("%s %s much duller now.", simpleonames(uwep),
801 multiple ? "fuse, and become" : "is");
803 Your("%s
\82Í%s
\82æ
\82è
\93Ý
\82
\82È
\82Á
\82Ä
\82µ
\82Ü
\82Á
\82½
\82æ
\82¤
\82¾
\81D", simpleonames(uwep),
804 multiple ? "
\97Z
\8d\87\82µ
\82Ä
\81C" : "");
806 costly_alteration(uwep, COST_DEGRD); /* DECHNT? other? */
807 uwep->otyp = WORM_TOOTH;
808 uwep->oerodeproof = 0;
811 uwep->owt = weight(uwep);
813 if (otyp != STRANGE_OBJECT && otmp->bknown)
821 wepname = ONAME(uwep);
822 if (amount < 0 && uwep->oartifact && restrict_name(uwep, wepname)) {
825 pline("%s %s.", Yobjnam2(uwep, "faintly glow"), color);
827 Your("%s
\82Í
\82í
\82¸
\82©
\82É%s
\8bP
\82¢
\82½
\81D", xname(uwep),jconj_adj(color));
830 /* there is a (soft) upper and lower limit to uwep->spe */
831 if (((uwep->spe > 5 && amount >= 0) || (uwep->spe < -5 && amount < 0))
835 pline("%s %s for a while and then %s.",
836 Yobjnam2(uwep, "violently glow"), color,
837 otense(uwep, "evaporate"));
839 Your("%s
\82Í
\82µ
\82Î
\82ç
\82
\8c\83\82µ
\82%s
\8bP
\82«
\81C
\8fö
\94
\82µ
\82½
\81D",
840 xname(uwep), jconj_adj(color));
844 pline("%s.", Yobjnam2(uwep, "evaporate"));
846 Your("%s
\82Í
\8fö
\94
\82µ
\82½
\81D", xname(uwep));
848 useupall(uwep); /* let all of them disappear */
853 xtime = (amount * amount == 1) ? "moment" : "while";
855 xtime = (amount*amount == 1) ? "
\88ê
\8fu" : "
\82µ
\82Î
\82ç
\82
\82Ì
\8aÔ";
857 pline("%s %s for a %s.",
858 Yobjnam2(uwep, amount == 0 ? "violently glow" : "glow"), color,
861 Your("%s
\82Í%s%s%s
\8bP
\82¢
\82½
\81D",
862 xname(uwep), xtime, jconj_adj(color),
863 amount == 0 ? "
\8c\83\82µ
\82" : "");
865 if (otyp != STRANGE_OBJECT && uwep->known
866 && (amount > 0 || (amount < 0 && otmp->bknown)))
870 costly_alteration(uwep, COST_DECHNT);
875 /* update shop bill to reflect new higher price */
877 alter_cost(uwep, 0L);
881 * Enchantment, which normally improves a weapon, has an
882 * addition adverse reaction on Magicbane whose effects are
883 * spe dependent. Give an obscure clue here.
885 if (uwep->oartifact == ART_MAGICBANE && uwep->spe >= 0) {
887 Your("right %s %sches!", body_part(HAND),
888 (((amount > 1) && (uwep->spe > 1)) ? "flin" : "it"));
890 Your("
\89E%s
\82Í%s
\81I",
892 (((amount > 1) && (uwep->spe > 1)) ? "
\82Ð
\82è
\82Ð
\82è
\82µ
\82½" : "
\83\80\83Y
\83\80\83Y
\82µ
\82½"));
896 /* an elven magic clue, cookie@keebler */
897 /* elven weapons vibrate warningly when enchanted beyond a limit */
899 && (is_elven_weapon(uwep) || uwep->oartifact || !rn2(7)))
901 pline("%s unexpectedly.", Yobjnam2(uwep, "suddenly vibrate"));
903 Your("%s
\82Í
\93Ë
\91R
\90k
\82¦
\82¾
\82µ
\82½
\81D", xname(uwep));
910 register struct obj *obj;
912 if (obj && obj == uwep && will_weld(obj)) {
921 register struct obj *obj;
925 savewornmask = obj->owornmask;
927 pline("%s welded to your %s!", Yobjnam2(obj, "are"),
928 bimanual(obj) ? (const char *) makeplural(body_part(HAND))
931 You("%s
\82ð%s
\82É
\8d\
\82¦
\82½
\81I", xname(obj), body_part(HAND));
933 obj->owornmask = savewornmask;
936 /* test whether monster's wielded weapon is stuck to hand/paw/whatever */
941 /* caller is responsible for making sure this is a monster's item */
942 if (obj && (obj->owornmask & W_WEP) && will_weld(obj))