1 /* NetHack 3.6 do_wear.c $NHDT-Date: 1514072526 2017/12/23 23:42:06 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.100 $ */
2 /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
3 /*-Copyright (c) Robert Patrick Rankin, 2012. */
4 /* NetHack may be freely redistributed. See license for details. */
6 /* JNetHack Copyright */
7 /* (c) Issei Numata, Naoki Hamada, Shigehiro Miyashita, 1994-2000 */
8 /* For 3.4-, Copyright (c) SHIRAKATA Kentaro, 2002-2018 */
9 /* JNetHack may be freely redistributed. See license for details. */
13 #if 0 /*JP*//*
\96¢
\8eg
\97p*/
14 static NEARDATA const char see_yourself[] = "see yourself";
16 static NEARDATA const char unknown_type[] = "Unknown type of %s (%d)";
18 static NEARDATA const char c_armor[] = "armor", c_suit[] = "suit",
19 c_shirt[] = "shirt", c_cloak[] = "cloak",
20 c_gloves[] = "gloves", c_boots[] = "boots",
21 c_helmet[] = "helmet", c_shield[] = "shield",
22 c_weapon[] = "weapon", c_sword[] = "sword",
23 c_axe[] = "axe", c_that_[] = "that";
25 static NEARDATA const char c_armor[] = "
\8aZ", c_suit[] = "
\95\9e",
26 c_shirt[] = "
\83V
\83\83\83c", c_cloak[] = "
\83N
\83\8d\81[
\83N",
27 c_gloves[] = "
\8f¬
\8eè", c_boots[] = "
\8cC",
28 c_helmet[] = "
\8a\95", c_shield[] = "
\8f\82",
29 c_weapon[] = "
\95\90\8aí", c_sword[] = "
\8c\95",
30 c_axe[] = "
\95\80", c_that_[] = "
\82»
\82ê";
33 static NEARDATA const long takeoff_order[] = {
34 WORN_BLINDF, W_WEP, WORN_SHIELD, WORN_GLOVES, LEFT_RING,
35 RIGHT_RING, WORN_CLOAK, WORN_HELMET, WORN_AMUL, WORN_ARMOR,
36 WORN_SHIRT, WORN_BOOTS, W_SWAPWEP, W_QUIVER, 0L
39 STATIC_DCL void FDECL(on_msg, (struct obj *));
40 STATIC_DCL void FDECL(toggle_stealth, (struct obj *, long, BOOLEAN_P));
41 STATIC_DCL void FDECL(toggle_displacement, (struct obj *, long, BOOLEAN_P));
42 STATIC_PTR int NDECL(Armor_on);
43 /* int NDECL(Boots_on); -- moved to extern.h */
44 STATIC_PTR int NDECL(Cloak_on);
45 STATIC_PTR int NDECL(Helmet_on);
46 STATIC_PTR int NDECL(Gloves_on);
47 STATIC_DCL void FDECL(wielding_corpse, (struct obj *, BOOLEAN_P));
48 STATIC_PTR int NDECL(Shield_on);
49 STATIC_PTR int NDECL(Shirt_on);
50 STATIC_DCL void NDECL(Amulet_on);
51 STATIC_DCL void FDECL(learnring, (struct obj *, BOOLEAN_P));
52 STATIC_DCL void FDECL(Ring_off_or_gone, (struct obj *, BOOLEAN_P));
53 STATIC_PTR int FDECL(select_off, (struct obj *));
54 STATIC_DCL struct obj *NDECL(do_takeoff);
55 STATIC_PTR int NDECL(take_off);
56 STATIC_DCL int FDECL(menu_remarm, (int));
57 STATIC_DCL void FDECL(count_worn_stuff, (struct obj **, BOOLEAN_P));
58 STATIC_PTR int FDECL(armor_or_accessory_off, (struct obj *));
59 STATIC_PTR int FDECL(accessory_or_armor_on, (struct obj *));
61 STATIC_DCL void FDECL(already_wearing, (const char *));
63 STATIC_DCL void FDECL(already_wearing, (const char*, struct obj *));
65 STATIC_DCL void FDECL(already_wearing2, (const char *, const char *));
73 You("were wearing %s.", doname(otmp));
77 m = joffmsg(otmp, &j);
79 You("%s%s%s
\81D", doname(otmp), j, jpast(m));
83 /* for items that involve no delay */
91 /* call xname() before obj_is_pname(); formatting obj's name
92 might set obj->dknown and that affects the pname test */
93 const char *otmp_name = xname(otmp);
96 if (otmp->otyp == TOWEL)
97 Sprintf(how, " around your %s", body_part(HEAD));
98 You("are now wearing %s%s.",
99 obj_is_pname(otmp) ? the(otmp_name) : an(otmp_name), how);
103 m = jonmsg(otmp, &j);
104 You("%s%s%s
\81D", xname(otmp), j, jpast(m));
109 /* starting equipment gets auto-worn at beginning of new game,
110 and we don't want stealth or displacement feedback then */
111 static boolean initial_don = FALSE; /* manipulated in set_wear() */
113 /* putting on or taking off an item which confers stealth;
114 give feedback and discover it iff stealth state is changing */
117 toggle_stealth(obj, oldprop, on)
119 long oldprop; /* prop[].extrinsic, with obj->owornmask stripped by caller */
122 if (on ? initial_don : context.takeoff.cancelled_don)
125 if (!oldprop /* extrinsic stealth from something else */
126 && !HStealth /* intrinsic stealth */
127 && !BStealth) { /* stealth blocked by something */
128 if (obj->otyp == RIN_STEALTH)
129 learnring(obj, TRUE);
131 makeknown(obj->otyp);
136 You("move very quietly.");
138 Your("
\90Ã
\82©
\82É
\93®
\82¯
\82é
\82æ
\82¤
\82É
\82È
\82Á
\82½
\81D");
139 else if (Levitation || Flying)
141 You("float imperceptibly.");
143 You("
\82¢
\82Â
\82Ì
\82Ü
\82É
\82©
\95\82\82¢
\82Ä
\82¢
\82½
\81D");
146 You("walk very quietly.");
148 Your("
\91«
\89¹
\82Í
\8f¬
\82³
\82
\82È
\82Á
\82½
\81D");
151 You("sure are noisy.");
153 Your("
\91«
\89¹
\82Í
\91å
\82«
\82
\82È
\82Á
\82½
\81D");
158 /* putting on or taking off an item which confers displacement;
159 give feedback and discover it iff displacement state is changing *and*
160 hero is able to see self (or sense monsters) */
163 toggle_displacement(obj, oldprop, on)
165 long oldprop; /* prop[].extrinsic, with obj->owornmask stripped by caller */
168 if (on ? initial_don : context.takeoff.cancelled_don)
171 if (!oldprop /* extrinsic displacement from something else */
172 && !(u.uprops[DISPLACED].intrinsic) /* (theoretical) */
173 && !(u.uprops[DISPLACED].blocked) /* (also theoretical) */
174 /* we don't use canseeself() here because it augments vision
175 with touch, which isn't appropriate for deciding whether
176 we'll notice that monsters have trouble spotting the hero */
177 && ((!Blind /* see anything */
178 && !u.uswallow /* see surroundings */
179 && !Invisible) /* see self */
180 /* actively sensing nearby monsters via telepathy or extended
181 monster detection overrides vision considerations because
182 hero also senses self in this situation */
184 || (Blind_telepat && Blind)
185 || Detect_monsters))) {
186 makeknown(obj->otyp);
189 You_feel("that monsters%s have difficulty pinpointing your location.",
190 on ? "" : " no longer");
192 You_feel("
\89ö
\95¨
\82Í
\82 \82È
\82½
\82Ì
\88Ê
\92u
\82ª
\82Í
\82Á
\82«
\82è
\82Æ
\95ª
\82©%s
\82È
\82Á
\82½
\82æ
\82¤
\82¾
\81D",
193 on ? "
\82ç
\82È
\82" : "
\82é
\82æ
\82¤
\82É");
199 * The Type_on() functions should be called *after* setworn().
200 * The Type_off() functions call setworn() themselves.
201 * [Blindf_on() is an exception and calls setworn() itself.]
208 u.uprops[objects[uarmf->otyp].oc_oprop].extrinsic & ~WORN_BOOTS;
210 switch (uarmf->otyp) {
217 case WATER_WALKING_BOOTS:
220 /* (we don't need a lava check here since boots can't be
221 put on while feet are stuck) */
224 /* Speed boots are still better than intrinsic speed, */
225 /* though not better than potion speed */
226 if (!oldprop && !(HFast & TIMEOUT)) {
227 makeknown(uarmf->otyp);
229 You_feel("yourself speed up%s.",
230 (oldprop || HFast) ? " a bit more" : "");
232 You("%s
\91f
\91\81\82
\82È
\82Á
\82½
\82æ
\82¤
\82È
\8bC
\82ª
\82µ
\82½
\81D",
233 (oldprop || HFast) ? "
\82³
\82ç
\82É" : "");
238 toggle_stealth(uarmf, oldprop, TRUE);
241 if (!oldprop && !(HFumbling & ~TIMEOUT))
242 incr_itimeout(&HFumbling, rnd(20));
244 case LEVITATION_BOOTS:
245 if (!oldprop && !HLevitation && !BLevitation) {
246 makeknown(uarmf->otyp);
250 float_vs_flight(); /* maybe toggle (BFlying & I_SPECIAL) */
254 impossible(unknown_type, c_boots, uarmf->otyp);
262 struct obj *otmp = uarmf;
263 int otyp = otmp->otyp;
264 long oldprop = u.uprops[objects[otyp].oc_oprop].extrinsic & ~WORN_BOOTS;
266 context.takeoff.mask &= ~W_ARMF;
267 /* For levitation, float_down() returns if Levitation, so we
268 * must do a setworn() _before_ the levitation case.
270 setworn((struct obj *) 0, W_ARMF);
273 if (!Very_fast && !context.takeoff.cancelled_don) {
276 You_feel("yourself slow down%s.", Fast ? " a bit" : "");
278 You("%s
\82Ì
\82ë
\82
\82È
\82Á
\82½
\82æ
\82¤
\82È
\8bC
\82ª
\82µ
\82½
\81D", Fast ? "
\82¿
\82å
\82Á
\82Æ" : "");
281 case WATER_WALKING_BOOTS:
282 /* check for lava since fireproofed boots make it viable */
283 if ((is_pool(u.ux, u.uy) || is_lava(u.ux, u.uy))
284 && !Levitation && !Flying && !is_clinger(youmonst.data)
285 && !context.takeoff.cancelled_don
286 /* avoid recursive call to lava_effects() */
287 && !iflags.in_lava_effects) {
288 /* make boots known in case you survive the drowning */
294 toggle_stealth(otmp, oldprop, FALSE);
297 if (!oldprop && !(HFumbling & ~TIMEOUT))
298 HFumbling = EFumbling = 0;
300 case LEVITATION_BOOTS:
301 if (!oldprop && !HLevitation && !BLevitation
302 && !context.takeoff.cancelled_don) {
303 (void) float_down(0L, 0L);
306 float_vs_flight(); /* maybe toggle (BFlying & I_SPECIAL) */
316 impossible(unknown_type, c_boots, otyp);
318 context.takeoff.cancelled_don = FALSE;
326 u.uprops[objects[uarmc->otyp].oc_oprop].extrinsic & ~WORN_CLOAK;
328 switch (uarmc->otyp) {
331 case CLOAK_OF_MAGIC_RESISTANCE:
335 case CLOAK_OF_PROTECTION:
336 makeknown(uarmc->otyp);
339 toggle_stealth(uarmc, oldprop, TRUE);
341 case CLOAK_OF_DISPLACEMENT:
342 toggle_displacement(uarmc, oldprop, TRUE);
345 /* Note: it's already being worn, so we have to cheat here. */
346 if ((HInvis || EInvis) && !Blind) {
349 You("can %s!", See_invisible ? "no longer see through yourself"
353 See_invisible ? "
\82 \82È
\82½
\82Í
\93§
\96¾
\82Å
\82È
\82
\82È
\82Á
\82½" :
354 "
\8e©
\95ª
\8e©
\90g
\82ª
\8c©
\82¦
\82é
\82æ
\82¤
\82É
\82È
\82Á
\82½");
358 case CLOAK_OF_INVISIBILITY:
359 /* since cloak of invisibility was worn, we know mummy wrapping
360 wasn't, so no need to check `oldprop' against blocked */
361 if (!oldprop && !HInvis && !Blind) {
362 makeknown(uarmc->otyp);
365 pline("Suddenly you can%s yourself.",
366 See_invisible ? " see through" : "not see");
368 pline("
\93Ë
\91R
\81C%s
\82È
\82Á
\82½
\81D",
369 See_invisible ? "
\82 \82È
\82½
\82Í
\93§
\96¾
\82É" : "
\8e©
\95ª
\8e©
\90g
\82ª
\8c©
\82¦
\82È
\82");
375 pline("%s very tightly.", Tobjnam(uarmc, "fit"));
377 pline("%s
\82Í
\82Æ
\82Ä
\82à
\82Ò
\82Á
\82¿
\82è
\8d\87\82¤
\81D",xname(uarmc));
379 /* Alchemy smock gives poison _and_ acid resistance */
381 EAcid_resistance |= WORN_CLOAK;
384 impossible(unknown_type, c_cloak, uarmc->otyp);
392 struct obj *otmp = uarmc;
393 int otyp = otmp->otyp;
394 long oldprop = u.uprops[objects[otyp].oc_oprop].extrinsic & ~WORN_CLOAK;
396 context.takeoff.mask &= ~W_ARMC;
397 /* For mummy wrapping, taking it off first resets `Invisible'. */
398 setworn((struct obj *) 0, W_ARMC);
402 case CLOAK_OF_PROTECTION:
403 case CLOAK_OF_MAGIC_RESISTANCE:
409 toggle_stealth(otmp, oldprop, FALSE);
411 case CLOAK_OF_DISPLACEMENT:
412 toggle_displacement(otmp, oldprop, FALSE);
415 if (Invis && !Blind) {
418 You("can %s.", See_invisible ? "see through yourself"
419 : "no longer see yourself");
421 pline("%s
\81D", See_invisible ? "
\82 \82È
\82½
\82Í
\93§
\96¾
\82É
\82È
\82Á
\82½"
422 : "
\8e©
\95ª
\8e©
\90g
\82ª
\8c©
\82¦
\82È
\82
\82È
\82Á
\82½");
426 case CLOAK_OF_INVISIBILITY:
427 if (!oldprop && !HInvis && !Blind) {
428 makeknown(CLOAK_OF_INVISIBILITY);
431 pline("Suddenly you can %s.",
432 See_invisible ? "no longer see through yourself"
435 pline("
\93Ë
\91R
\81C%s
\81D",
436 See_invisible ? "
\82 \82È
\82½
\82Í
\93§
\96¾
\82Å
\82È
\82
\82È
\82Á
\82½"
437 : "
\8e©
\95ª
\8e©
\90g
\82ª
\8c©
\82¦
\82é
\82æ
\82¤
\82É
\82È
\82Á
\82½");
441 /* Alchemy smock gives poison _and_ acid resistance */
443 EAcid_resistance &= ~WORN_CLOAK;
446 impossible(unknown_type, c_cloak, otyp);
455 switch (uarmh->otyp) {
459 case ELVEN_LEATHER_HELM:
460 case DWARVISH_IRON_HELM:
462 case HELM_OF_TELEPATHY:
464 case HELM_OF_BRILLIANCE:
465 adj_abon(uarmh, uarmh->spe);
468 /* people think marked wizards know what they're talking
469 * about, but it takes trained arrogance to pull it off,
470 * and the actual enchantment of the hat is irrelevant.
472 ABON(A_CHA) += (Role_if(PM_WIZARD) ? 1 : -1);
474 makeknown(uarmh->otyp);
476 case HELM_OF_OPPOSITE_ALIGNMENT:
477 /* changing alignment can toggle off active artifact
478 properties, including levitation; uarmh could get
479 dropped or destroyed here */
480 uchangealign((u.ualign.type != A_NEUTRAL)
482 : (uarmh->o_id % 2) ? A_CHAOTIC : A_LAWFUL,
484 /* makeknown(uarmh->otyp); -- moved below, after xname() */
487 if (uarmh && !uarmh->cursed) {
490 pline("%s for a moment.", Tobjnam(uarmh, "vibrate"));
492 pline("%s
\82Í
\88ê
\8fu
\90k
\82¦
\82½
\81D", xname(uarmh));
495 pline("%s %s for a moment.", Tobjnam(uarmh, "glow"),
498 pline("%s
\82Í
\88ê
\8fu%s
\8bP
\82¢
\82½
\81D",
499 xname(uarmh), jconj_adj(hcolor(NH_BLACK)));
503 context.botl = 1; /* reveal new alignment or INT & WIS */
506 pline("My brain hurts!"); /* Monty Python's Flying Circus */
508 pline("
\82Ì
\81[
\82Ý
\82»
\83o
\81[
\83\93\81I"); /*
\83\82\83\93\83e
\83B
\83p
\83C
\83\
\83\93\82Æ
\82Í
\82¿
\82å
\82Á
\82Æ
\88á
\82¤
\82¯
\82Ç*/
510 } else if (uarmh && uarmh->otyp == DUNCE_CAP) {
512 You_feel("%s.", /* track INT change; ignore WIS */
514 <= (ABASE(A_INT) + ABON(A_INT) + ATEMP(A_INT))
515 ? "like sitting in a corner"
518 You("%s
\82æ
\82¤
\82È
\8bC
\82ª
\82µ
\82½
\81D",
520 <= (ABASE(A_INT) + ABON(A_INT) + ATEMP(A_INT))
521 ? "
\8b÷
\82Á
\82±
\82É
\8dÀ
\82Á
\82Ä
\82¢
\82é"
522 : "
\96Ú
\82ª
\82Ü
\82í
\82Á
\82½");
525 /* [message moved to uchangealign()] */
526 makeknown(HELM_OF_OPPOSITE_ALIGNMENT);
530 impossible(unknown_type, c_helmet, uarmh->otyp);
536 Helmet_off(VOID_ARGS)
538 context.takeoff.mask &= ~W_ARMH;
540 switch (uarmh->otyp) {
544 case ELVEN_LEATHER_HELM:
545 case DWARVISH_IRON_HELM:
552 if (!context.takeoff.cancelled_don) {
553 ABON(A_CHA) += (Role_if(PM_WIZARD) ? -1 : 1);
557 case HELM_OF_TELEPATHY:
558 /* need to update ability before calling see_monsters() */
559 setworn((struct obj *) 0, W_ARMH);
562 case HELM_OF_BRILLIANCE:
563 if (!context.takeoff.cancelled_don)
564 adj_abon(uarmh, -uarmh->spe);
566 case HELM_OF_OPPOSITE_ALIGNMENT:
567 /* changing alignment can toggle off active artifact
568 properties, including levitation; uarmh could get
569 dropped or destroyed here */
570 uchangealign(u.ualignbase[A_CURRENT], 2);
573 impossible(unknown_type, c_helmet, uarmh->otyp);
575 setworn((struct obj *) 0, W_ARMH);
576 context.takeoff.cancelled_don = FALSE;
585 u.uprops[objects[uarmg->otyp].oc_oprop].extrinsic & ~WORN_GLOVES;
587 switch (uarmg->otyp) {
590 case GAUNTLETS_OF_FUMBLING:
591 if (!oldprop && !(HFumbling & ~TIMEOUT))
592 incr_itimeout(&HFumbling, rnd(20));
594 case GAUNTLETS_OF_POWER:
595 makeknown(uarmg->otyp);
596 context.botl = 1; /* taken care of in attrib.c */
598 case GAUNTLETS_OF_DEXTERITY:
599 adj_abon(uarmg, uarmg->spe);
602 impossible(unknown_type, c_gloves, uarmg->otyp);
608 wielding_corpse(obj, voluntary)
610 boolean voluntary; /* taking gloves off on purpose? */
614 if (!obj || obj->otyp != CORPSE)
616 if (obj != uwep && (obj != uswapwep || !u.twoweap))
619 if (touch_petrifies(&mons[obj->corpsenm]) && !Stone_resistance) {
621 You("now wield %s in your bare %s.",
622 corpse_xname(obj, (const char *) 0, CXN_ARTICLE),
623 makeplural(body_part(HAND)));
625 You("%s
\82ð
\91f%s
\82Å
\8e\9d\82Á
\82½
\81D",
626 corpse_xname(obj, (const char *) 0, CXN_ARTICLE),
630 Sprintf(kbuf, "%s gloves while wielding %s",
631 voluntary ? "removing" : "losing", killer_xname(obj));
633 Sprintf(kbuf, "%s
\82ð
\8e\9d\82Á
\82Ä
\82¢
\82é
\82Æ
\82«
\82É
\8eè
\91Ü
\82ð%s",
634 killer_xname(obj), voluntary ? "
\8aO
\82µ
\82Ä" : "
\8e¸
\82Á
\82Ä");
637 /* life-saved; can't continue wielding cockatrice corpse though */
638 remove_worn_item(obj, FALSE);
643 Gloves_off(VOID_ARGS)
646 u.uprops[objects[uarmg->otyp].oc_oprop].extrinsic & ~WORN_GLOVES;
647 boolean on_purpose = !context.mon_moving && !uarmg->in_use;
649 context.takeoff.mask &= ~W_ARMG;
651 switch (uarmg->otyp) {
654 case GAUNTLETS_OF_FUMBLING:
655 if (!oldprop && !(HFumbling & ~TIMEOUT))
656 HFumbling = EFumbling = 0;
658 case GAUNTLETS_OF_POWER:
659 makeknown(uarmg->otyp);
660 context.botl = 1; /* taken care of in attrib.c */
662 case GAUNTLETS_OF_DEXTERITY:
663 if (!context.takeoff.cancelled_don)
664 adj_abon(uarmg, -uarmg->spe);
667 impossible(unknown_type, c_gloves, uarmg->otyp);
669 setworn((struct obj *) 0, W_ARMG);
670 context.takeoff.cancelled_don = FALSE;
671 (void) encumber_msg(); /* immediate feedback for GoP */
673 /* prevent wielding cockatrice when not wearing gloves */
674 if (uwep && uwep->otyp == CORPSE)
675 wielding_corpse(uwep, on_purpose);
677 /* KMH -- ...or your secondary weapon when you're wielding it
678 [This case can't actually happen; twoweapon mode won't
679 engage if a corpse has been set up as the alternate weapon.] */
680 if (u.twoweap && uswapwep && uswapwep->otyp == CORPSE)
681 wielding_corpse(uswapwep, on_purpose);
689 /* no shield currently requires special handling when put on, but we
690 keep this uncommented in case somebody adds a new one which does */
691 switch (uarms->otyp) {
694 case URUK_HAI_SHIELD:
696 case DWARVISH_ROUNDSHIELD:
698 case SHIELD_OF_REFLECTION:
701 impossible(unknown_type, c_shield, uarms->otyp);
708 Shield_off(VOID_ARGS)
710 context.takeoff.mask &= ~W_ARMS;
712 /* no shield currently requires special handling when taken off, but we
713 keep this uncommented in case somebody adds a new one which does */
714 switch (uarms->otyp) {
717 case URUK_HAI_SHIELD:
719 case DWARVISH_ROUNDSHIELD:
721 case SHIELD_OF_REFLECTION:
724 impossible(unknown_type, c_shield, uarms->otyp);
727 setworn((struct obj *) 0, W_ARMS);
734 /* no shirt currently requires special handling when put on, but we
735 keep this uncommented in case somebody adds a new one which does */
736 switch (uarmu->otyp) {
741 impossible(unknown_type, c_shirt, uarmu->otyp);
750 context.takeoff.mask &= ~W_ARMU;
752 /* no shirt currently requires special handling when taken off, but we
753 keep this uncommented in case somebody adds a new one which does */
754 switch (uarmu->otyp) {
759 impossible(unknown_type, c_shirt, uarmu->otyp);
762 setworn((struct obj *) 0, W_ARMU);
766 /* This must be done in worn.c, because one of the possible intrinsics
767 * conferred is fire resistance, and we have to immediately set
768 * HFire_resistance in worn.c since worn.c will check it before returning.
780 context.takeoff.mask &= ~W_ARM;
781 setworn((struct obj *) 0, W_ARM);
782 context.takeoff.cancelled_don = FALSE;
786 /* The gone functions differ from the off functions in that if you die from
787 * taking it off and have life saving, you still die.
792 context.takeoff.mask &= ~W_ARM;
794 context.takeoff.cancelled_don = FALSE;
801 /* make sure amulet isn't wielded; can't use remove_worn_item()
802 here because it has already been set worn in amulet slot */
804 setuwep((struct obj *) 0);
805 else if (uamul == uswapwep)
806 setuswapwep((struct obj *) 0);
807 else if (uamul == uquiver)
808 setuqwep((struct obj *) 0);
810 switch (uamul->otyp) {
812 case AMULET_OF_LIFE_SAVING:
813 case AMULET_VERSUS_POISON:
814 case AMULET_OF_REFLECTION:
815 case AMULET_OF_MAGICAL_BREATHING:
816 case FAKE_AMULET_OF_YENDOR:
818 case AMULET_OF_UNCHANGING:
820 make_slimed(0L, (char *) 0);
822 case AMULET_OF_CHANGE: {
823 int orig_sex = poly_gender();
828 /* Don't use same message as polymorph */
829 if (orig_sex != poly_gender()) {
830 makeknown(AMULET_OF_CHANGE);
832 You("are suddenly very %s!",
833 flags.female ? "feminine" : "masculine");
835 You("
\93Ë
\91R%s
\82Á
\82Û
\82
\82È
\82Á
\82½
\81I",
836 flags.female ? "
\8f\97" : "
\92j");
840 /* already polymorphed into single-gender monster; only
841 changed the character's base sex */
843 You("don't feel like yourself.");
845 You("
\8e©
\95ª
\8e©
\90g
\82¶
\82á
\82È
\82
\82È
\82Á
\82½
\8bC
\82ª
\82µ
\82½
\81D");
847 pline_The("amulet disintegrates!");
849 pline("
\96\82\8f\9c\82¯
\82Í
\82±
\82È
\82²
\82È
\82É
\82È
\82Á
\82½
\81I");
850 if (orig_sex == poly_gender() && uamul->dknown
851 && !objects[AMULET_OF_CHANGE].oc_name_known
852 && !objects[AMULET_OF_CHANGE].oc_uname)
857 case AMULET_OF_STRANGULATION:
858 if (can_be_strangled(&youmonst)) {
859 makeknown(AMULET_OF_STRANGULATION);
863 pline("It constricts your throat!");
865 pline("
\96\82\8f\9c\82¯
\82Í
\82 \82È
\82½
\82Ì
\8dA
\82ð
\8di
\82ß
\82Â
\82¯
\82½
\81I");
868 case AMULET_OF_RESTFUL_SLEEP: {
869 long newnap = (long) rnd(100), oldnap = (HSleepy & TIMEOUT);
871 /* avoid clobbering FROMOUTSIDE bit, which might have
872 gotten set by previously eating one of these amulets */
873 if (newnap < oldnap || oldnap == 0L)
874 HSleepy = (HSleepy & ~TIMEOUT) | newnap;
876 case AMULET_OF_YENDOR:
884 context.takeoff.mask &= ~W_AMUL;
886 switch (uamul->otyp) {
888 /* need to update ability before calling see_monsters() */
889 setworn((struct obj *) 0, W_AMUL);
892 case AMULET_OF_LIFE_SAVING:
893 case AMULET_VERSUS_POISON:
894 case AMULET_OF_REFLECTION:
895 case AMULET_OF_CHANGE:
896 case AMULET_OF_UNCHANGING:
897 case FAKE_AMULET_OF_YENDOR:
899 case AMULET_OF_MAGICAL_BREATHING:
901 /* HMagical_breathing must be set off
902 before calling drown() */
903 setworn((struct obj *) 0, W_AMUL);
904 if (!breathless(youmonst.data) && !amphibious(youmonst.data)
907 You("suddenly inhale an unhealthy amount of %s!",
910 You("
\93Ë
\91R
\81C
\91å
\97Ê
\82Ì%s
\82ð
\88ù
\82Ý
\8d\9e\82ñ
\82¾
\81I",
918 case AMULET_OF_STRANGULATION:
924 Your("%s is no longer constricted!", body_part(NECK));
926 pline("%s
\82ª
\8ay
\82É
\82È
\82Á
\82½
\81I", body_part(NECK));
929 You("can breathe more easily!");
931 You("
\8ay
\82É
\8cÄ
\8bz
\82Å
\82«
\82é
\82æ
\82¤
\82É
\82È
\82Á
\82½
\81I");
934 case AMULET_OF_RESTFUL_SLEEP:
935 setworn((struct obj *) 0, W_AMUL);
936 /* HSleepy = 0L; -- avoid clobbering FROMOUTSIDE bit */
937 if (!ESleepy && !(HSleepy & ~TIMEOUT))
938 HSleepy &= ~TIMEOUT; /* clear timeout bits */
940 case AMULET_OF_YENDOR:
943 setworn((struct obj *) 0, W_AMUL);
947 /* handle ring discovery; comparable to learnwand() */
949 learnring(ring, observed)
953 int ringtype = ring->otyp;
955 /* if effect was observeable then we usually discover the type */
957 /* if we already know the ring type which accomplishes this
958 effect (assumes there is at most one type for each effect),
959 mark this ring as having been seen (no need for makeknown);
960 otherwise if we have seen this ring, discover its type */
961 if (objects[ringtype].oc_name_known)
963 else if (ring->dknown)
965 #if 0 /* see learnwand() */
971 /* make enchantment of charged ring known (might be +0) and update
972 perm invent window if we've seen this ring and know its type */
973 if (ring->dknown && objects[ringtype].oc_name_known) {
974 if (objects[ringtype].oc_charged)
982 register struct obj *obj;
984 long oldprop = u.uprops[objects[obj->otyp].oc_oprop].extrinsic;
985 int old_attrib, which;
988 /* make sure ring isn't wielded; can't use remove_worn_item()
989 here because it has already been set worn in a ring slot */
991 setuwep((struct obj *) 0);
992 else if (obj == uswapwep)
993 setuswapwep((struct obj *) 0);
994 else if (obj == uquiver)
995 setuqwep((struct obj *) 0);
997 /* only mask out W_RING when we don't have both
998 left and right rings of the same type */
999 if ((oldprop & W_RING) != W_RING)
1002 switch (obj->otyp) {
1003 case RIN_TELEPORTATION:
1004 case RIN_REGENERATION:
1007 case RIN_AGGRAVATE_MONSTER:
1008 case RIN_POISON_RESISTANCE:
1009 case RIN_FIRE_RESISTANCE:
1010 case RIN_COLD_RESISTANCE:
1011 case RIN_SHOCK_RESISTANCE:
1013 case RIN_TELEPORT_CONTROL:
1015 case RIN_POLYMORPH_CONTROL:
1016 case RIN_FREE_ACTION:
1017 case RIN_SLOW_DIGESTION:
1018 case RIN_SUSTAIN_ABILITY:
1022 toggle_stealth(obj, oldprop, TRUE);
1027 case RIN_SEE_INVISIBLE:
1028 /* can now see invisible monsters */
1029 set_mimic_blocking(); /* do special mimic handling */
1032 if (Invis && !oldprop && !HSee_invisible && !Blind) {
1035 pline("Suddenly you are transparent, but there!");
1037 pline("
\93Ë
\91R
\93§
\96¾
\82É
\82È
\82Á
\82½
\81D
\82µ
\82©
\82µ
\91¶
\8dÝ
\82Í
\82µ
\82Ä
\82¢
\82é
\81I");
1038 learnring(obj, TRUE);
1041 case RIN_INVISIBILITY:
1042 if (!oldprop && !HInvis && !BInvis && !Blind) {
1043 learnring(obj, TRUE);
1045 self_invis_message();
1048 case RIN_LEVITATION:
1049 if (!oldprop && !HLevitation && !BLevitation) {
1051 learnring(obj, TRUE);
1052 spoteffects(FALSE); /* for sinks */
1054 float_vs_flight(); /* maybe toggle (BFlying & I_SPECIAL) */
1057 case RIN_GAIN_STRENGTH:
1060 case RIN_GAIN_CONSTITUTION:
1066 old_attrib = ACURR(which);
1067 ABON(which) += obj->spe;
1068 observable = (old_attrib != ACURR(which));
1069 /* if didn't change, usually means ring is +0 but might
1070 be because nonzero couldn't go below min or above max;
1071 learn +0 enchantment if attribute value is not stuck
1072 at a limit [and ring has been seen and its type is
1073 already discovered, both handled by learnring()] */
1074 if (observable || !extremeattr(which))
1075 learnring(obj, observable);
1078 case RIN_INCREASE_ACCURACY: /* KMH */
1079 u.uhitinc += obj->spe;
1081 case RIN_INCREASE_DAMAGE:
1082 u.udaminc += obj->spe;
1084 case RIN_PROTECTION_FROM_SHAPE_CHAN:
1087 case RIN_PROTECTION:
1088 /* usually learn enchantment and discover type;
1089 won't happen if ring is unseen or if it's +0
1090 and the type hasn't been discovered yet */
1091 observable = (obj->spe != 0);
1092 learnring(obj, observable);
1094 find_ac(); /* updates botl */
1100 Ring_off_or_gone(obj, gone)
1101 register struct obj *obj;
1104 long mask = (obj->owornmask & W_RING);
1105 int old_attrib, which;
1108 context.takeoff.mask &= ~mask;
1109 if (!(u.uprops[objects[obj->otyp].oc_oprop].extrinsic & mask))
1110 impossible("Strange... I didn't know you had that ring.");
1114 setworn((struct obj *) 0, obj->owornmask);
1116 switch (obj->otyp) {
1117 case RIN_TELEPORTATION:
1118 case RIN_REGENERATION:
1121 case RIN_AGGRAVATE_MONSTER:
1122 case RIN_POISON_RESISTANCE:
1123 case RIN_FIRE_RESISTANCE:
1124 case RIN_COLD_RESISTANCE:
1125 case RIN_SHOCK_RESISTANCE:
1127 case RIN_TELEPORT_CONTROL:
1129 case RIN_POLYMORPH_CONTROL:
1130 case RIN_FREE_ACTION:
1131 case RIN_SLOW_DIGESTION:
1132 case RIN_SUSTAIN_ABILITY:
1136 toggle_stealth(obj, (EStealth & ~mask), FALSE);
1141 case RIN_SEE_INVISIBLE:
1142 /* Make invisible monsters go away */
1143 if (!See_invisible) {
1144 set_mimic_blocking(); /* do special mimic handling */
1148 if (Invisible && !Blind) {
1151 pline("Suddenly you cannot see yourself.");
1153 pline("
\93Ë
\91R
\81C
\8e©
\95ª
\8e©
\90g
\82ª
\8c©
\82¦
\82È
\82
\82È
\82Á
\82½
\81D");
1154 learnring(obj, TRUE);
1157 case RIN_INVISIBILITY:
1158 if (!Invis && !BInvis && !Blind) {
1161 Your("body seems to unfade%s.",
1162 See_invisible ? " completely" : "..");
1164 Your("
\91Ì
\82ª%s
\81D",
1165 See_invisible ? "
\8a®
\91S
\82É
\8c»
\82í
\82ê
\82½" : "
\8e\9f\91æ
\82É
\8c»
\82í
\82ê
\82Ä
\82«
\82½
\81D
\81D");
1167 learnring(obj, TRUE);
1170 case RIN_LEVITATION:
1172 (void) float_down(0L, 0L);
1174 learnring(obj, TRUE);
1176 float_vs_flight(); /* maybe toggle (BFlying & I_SPECIAL) */
1179 case RIN_GAIN_STRENGTH:
1182 case RIN_GAIN_CONSTITUTION:
1188 old_attrib = ACURR(which);
1189 ABON(which) -= obj->spe;
1190 observable = (old_attrib != ACURR(which));
1191 /* same criteria as Ring_on() */
1192 if (observable || !extremeattr(which))
1193 learnring(obj, observable);
1196 case RIN_INCREASE_ACCURACY: /* KMH */
1197 u.uhitinc -= obj->spe;
1199 case RIN_INCREASE_DAMAGE:
1200 u.udaminc -= obj->spe;
1202 case RIN_PROTECTION:
1203 /* might have been put on while blind and we can now see
1204 or perhaps been forgotten due to amnesia */
1205 observable = (obj->spe != 0);
1206 learnring(obj, observable);
1208 find_ac(); /* updates botl */
1210 case RIN_PROTECTION_FROM_SHAPE_CHAN:
1211 /* If you're no longer protected, let the chameleons
1212 * change shape again -dgk
1223 Ring_off_or_gone(obj, FALSE);
1230 Ring_off_or_gone(obj, TRUE);
1235 register struct obj *otmp;
1237 boolean already_blind = Blind, changed = FALSE;
1239 /* blindfold might be wielded; release it for wearing */
1240 if (otmp->owornmask & W_WEAPON)
1241 remove_worn_item(otmp, FALSE);
1242 setworn(otmp, W_TOOL);
1245 if (Blind && !already_blind) {
1249 You_cant("see any more.");
1251 You("
\89½
\82à
\8c©
\82¦
\82È
\82
\82È
\82Á
\82½
\81D");
1252 /* set ball&chain variables before the hero goes blind */
1255 } else if (already_blind && !Blind) {
1257 /* "You are now wearing the Eyes of the Overworld." */
1258 if (u.uroleplay.blind) {
1259 /* this can only happen by putting on the Eyes of the Overworld;
1260 that shouldn't actually produce a permanent cure, but we
1261 can't let the "blind from birth" conduct remain intact */
1263 pline("For the first time in your life, you can see!");
1265 pline("
\90l
\90¶
\82Å
\8f\89\82ß
\82Ä
\81C
\96Ú
\82ª
\8c©
\82¦
\82é
\82æ
\82¤
\82É
\82È
\82Á
\82½
\81I");
1266 u.uroleplay.blind = FALSE;
1271 You("
\96Ú
\82ª
\8c©
\82¦
\82é
\82æ
\82¤
\82É
\82È
\82Á
\82½
\81I");
1274 /* blindness has just been toggled */
1275 if (Blind_telepat || Infravision)
1277 vision_full_recalc = 1; /* recalc vision limits */
1279 learn_unseen_invent();
1286 register struct obj *otmp;
1288 boolean was_blind = Blind, changed = FALSE;
1291 impossible("Blindf_off without otmp");
1294 context.takeoff.mask &= ~W_TOOL;
1295 setworn((struct obj *) 0, otmp->owornmask);
1300 /* "still cannot see" makes no sense when removing lenses
1301 since they can't have been the cause of your blindness */
1302 if (otmp->otyp != LENSES)
1304 You("still cannot see.");
1306 You("
\82Ü
\82¾
\96Ú
\82ª
\8c©
\82¦
\82È
\82¢
\81D");
1308 changed = TRUE; /* !was_blind */
1309 /* "You were wearing the Eyes of the Overworld." */
1311 You_cant("see anything now!");
1313 You("
\8d¡
\82Í
\89½
\82à
\8c©
\82é
\82±
\82Æ
\82ª
\82Å
\82«
\82È
\82¢
\81I");
1314 /* set ball&chain variables before the hero goes blind */
1318 } else if (was_blind) {
1319 if (!gulp_blnd_check()) {
1320 changed = TRUE; /* !Blind */
1322 You("can see again.");
1324 You("
\82Ó
\82½
\82½
\82Ñ
\96Ú
\82ª
\8c©
\82¦
\82é
\82æ
\82¤
\82É
\82È
\82Á
\82½
\81D");
1328 /* blindness has just been toggled */
1329 if (Blind_telepat || Infravision)
1331 vision_full_recalc = 1; /* recalc vision limits */
1333 learn_unseen_invent();
1338 /* called in moveloop()'s prologue to set side-effects of worn start-up items;
1339 also used by poly_obj() when a worn item gets transformed */
1342 struct obj *obj; /* if null, do all worn items; otherwise just obj itself */
1346 if (!obj ? ublindf != 0 : (obj == ublindf))
1347 (void) Blindf_on(ublindf);
1348 if (!obj ? uright != 0 : (obj == uright))
1349 (void) Ring_on(uright);
1350 if (!obj ? uleft != 0 : (obj == uleft))
1351 (void) Ring_on(uleft);
1352 if (!obj ? uamul != 0 : (obj == uamul))
1355 if (!obj ? uarmu != 0 : (obj == uarmu))
1357 if (!obj ? uarm != 0 : (obj == uarm))
1359 if (!obj ? uarmc != 0 : (obj == uarmc))
1361 if (!obj ? uarmf != 0 : (obj == uarmf))
1363 if (!obj ? uarmg != 0 : (obj == uarmg))
1365 if (!obj ? uarmh != 0 : (obj == uarmh))
1367 if (!obj ? uarms != 0 : (obj == uarms))
1370 initial_don = FALSE;
1373 /* check whether the target object is currently being put on (or taken off--
1374 also checks for doffing--[why?]) */
1379 boolean result = FALSE;
1381 /* 'W' (or 'P' used for armor) sets afternmv */
1384 else if (otmp == uarm)
1385 result = (afternmv == Armor_on);
1386 else if (otmp == uarmu)
1387 result = (afternmv == Shirt_on);
1388 else if (otmp == uarmc)
1389 result = (afternmv == Cloak_on);
1390 else if (otmp == uarmf)
1391 result = (afternmv == Boots_on);
1392 else if (otmp == uarmh)
1393 result = (afternmv == Helmet_on);
1394 else if (otmp == uarmg)
1395 result = (afternmv == Gloves_on);
1396 else if (otmp == uarms)
1397 result = (afternmv == Shield_on);
1402 /* check whether the target object is currently being taken off,
1403 so that stop_donning() and steal() can vary messages */
1408 long what = context.takeoff.what;
1409 boolean result = FALSE;
1411 /* 'T' (or 'R' used for armor) sets afternmv, 'A' sets takeoff.what */
1413 result = (afternmv == Armor_off || what == WORN_ARMOR);
1414 else if (otmp == uarmu)
1415 result = (afternmv == Shirt_off || what == WORN_SHIRT);
1416 else if (otmp == uarmc)
1417 result = (afternmv == Cloak_off || what == WORN_CLOAK);
1418 else if (otmp == uarmf)
1419 result = (afternmv == Boots_off || what == WORN_BOOTS);
1420 else if (otmp == uarmh)
1421 result = (afternmv == Helmet_off || what == WORN_HELMET);
1422 else if (otmp == uarmg)
1423 result = (afternmv == Gloves_off || what == WORN_GLOVES);
1424 else if (otmp == uarms)
1425 result = (afternmv == Shield_off || what == WORN_SHIELD);
1426 /* these 1-turn items don't need 'afternmv' checks */
1427 else if (otmp == uamul)
1428 result = (what == WORN_AMUL);
1429 else if (otmp == uleft)
1430 result = (what == LEFT_RING);
1431 else if (otmp == uright)
1432 result = (what == RIGHT_RING);
1433 else if (otmp == ublindf)
1434 result = (what == WORN_BLINDF);
1435 else if (otmp == uwep)
1436 result = (what == W_WEP);
1437 else if (otmp == uswapwep)
1438 result = (what == W_SWAPWEP);
1439 else if (otmp == uquiver)
1440 result = (what == W_QUIVER);
1445 /* despite their names, cancel_don() and cancel_doff() both apply to both
1446 donning and doffing... */
1448 cancel_doff(obj, slotmask)
1452 /* Called by setworn() for old item in specified slot or by setnotworn()
1453 * for specified item. We don't want to call cancel_don() if we got
1454 * here via <X>_off() -> setworn((struct obj *)0) -> cancel_doff()
1455 * because that would stop the 'A' command from continuing with next
1456 * selected item. So do_takeoff() sets a flag in takeoff.mask for us.
1457 * [For taking off an individual item with 'T'/'R'/'w-', it doesn't
1458 * matter whether cancel_don() gets called here--the item has already
1459 * been removed by now.]
1461 if (!(context.takeoff.mask & I_SPECIAL) && donning(obj))
1462 cancel_don(); /* applies to doffing too */
1463 context.takeoff.mask &= ~slotmask;
1466 /* despite their names, cancel_don() and cancel_doff() both apply to both
1467 donning and doffing... */
1471 /* the piece of armor we were donning/doffing has vanished, so stop
1472 * wasting time on it (and don't dereference it when donning would
1475 context.takeoff.cancelled_don =
1476 (afternmv == Boots_on || afternmv == Helmet_on
1477 || afternmv == Gloves_on || afternmv == Armor_on);
1478 afternmv = (int NDECL((*))) 0;
1479 nomovemsg = (char *) 0;
1481 context.takeoff.delay = 0;
1482 context.takeoff.what = 0L;
1485 /* called by steal() during theft from hero; interrupt donning/doffing */
1487 stop_donning(stolenobj)
1488 struct obj *stolenobj; /* no message if stolenobj is already being doffing */
1495 for (otmp = invent; otmp; otmp = otmp->nobj)
1496 if ((otmp->owornmask & W_ARMOR) && donning(otmp))
1498 /* at most one item will pass donning() test at any given time */
1502 /* donning() returns True when doffing too; doffing() is more specific */
1503 putting_on = !doffing(otmp);
1504 /* cancel_don() looks at afternmv; it can also cancel doffing */
1506 /* don't want <armor>_on() or <armor>_off() being called
1507 by unmul() since the on or off action isn't completing */
1508 afternmv = (int NDECL((*))) 0;
1509 if (putting_on || otmp != stolenobj) {
1511 Sprintf(buf, "You stop %s %s.",
1512 putting_on ? "putting on" : "taking off",
1513 thesimpleoname(otmp));
1515 Sprintf(buf, "
\82 \82È
\82½
\82Í%s
\82ð%s
\82Ì
\82ð
\8e~
\82ß
\82½
\81D",
1516 thesimpleoname(otmp),
1517 putting_on ? "
\90g
\82É
\82Â
\82¯
\82é" : "
\8aO
\82·");
1520 buf[0] = '\0'; /* silently stop doffing stolenobj */
1521 result = -multi; /* remember this before calling unmul() */
1524 /* while putting on, item becomes worn immediately but side-effects are
1525 deferred until the delay expires; when interrupted, make it unworn
1526 (while taking off, item stays worn until the delay expires; when
1527 interrupted, leave it worn) */
1529 remove_worn_item(otmp, FALSE);
1534 /* both 'clothes' and 'accessories' now include both armor and accessories;
1535 TOOL_CLASS is for eyewear, FOOD_CLASS is for MEAT_RING */
1536 static NEARDATA const char clothes[] = {
1537 ARMOR_CLASS, RING_CLASS, AMULET_CLASS, TOOL_CLASS, FOOD_CLASS, 0
1539 static NEARDATA const char accessories[] = {
1540 RING_CLASS, AMULET_CLASS, TOOL_CLASS, FOOD_CLASS, ARMOR_CLASS, 0
1542 STATIC_VAR NEARDATA int Narmorpieces, Naccessories;
1544 /* assign values to Narmorpieces and Naccessories */
1546 count_worn_stuff(which, accessorizing)
1547 struct obj **which; /* caller wants this when count is 1 */
1548 boolean accessorizing;
1552 Narmorpieces = Naccessories = 0;
1554 #define MOREWORN(x,wtyp) do { if (x) { wtyp++; otmp = x; } } while (0)
1556 MOREWORN(uarmh, Narmorpieces);
1557 MOREWORN(uarms, Narmorpieces);
1558 MOREWORN(uarmg, Narmorpieces);
1559 MOREWORN(uarmf, Narmorpieces);
1560 /* for cloak/suit/shirt, we only count the outermost item so that it
1561 can be taken off without confirmation if final count ends up as 1 */
1563 MOREWORN(uarmc, Narmorpieces);
1565 MOREWORN(uarm, Narmorpieces);
1567 MOREWORN(uarmu, Narmorpieces);
1569 *which = otmp; /* default item iff Narmorpieces is 1 */
1572 MOREWORN(uleft, Naccessories);
1573 MOREWORN(uright, Naccessories);
1574 MOREWORN(uamul, Naccessories);
1575 MOREWORN(ublindf, Naccessories);
1577 *which = otmp; /* default item iff Naccessories is 1 */
1581 /* take off one piece or armor or one accessory;
1582 shared by dotakeoff('T') and doremring('R') */
1584 armor_or_accessory_off(obj)
1591 if (!(obj->owornmask & (W_ARMOR | W_ACCESSORY))) {
1593 You("are not wearing that.");
1595 You("
\82»
\82ê
\82ð
\90g
\82É
\82Â
\82¯
\82Ä
\82¢
\82È
\82¢
\81D");
1599 || ((obj == uarm) && uarmc)
1600 || ((obj == uarmu) && (uarmc || uarm))) {
1601 char why[QBUFSZ], what[QBUFSZ];
1603 why[0] = what[0] = '\0';
1606 Strcat(what, cloak_simple_name(uarmc));
1607 if ((obj == uarmu) && uarm) {
1610 Strcat(what, " and ");
1612 Strcat(what, "
\82Æ");
1614 Strcat(what, suit_simple_name(uarm));
1617 Sprintf(why, " without taking off your %s first", what);
1619 Sprintf(why, "
\90æ
\82É%s
\82ð
\82Í
\82¸
\82³
\82È
\82¢
\82Æ", what);
1623 Strcpy(why, "; it's embedded");
1625 Strcpy(why, "
\82
\82Á
\82Â
\82¢
\82Ä
\82¢
\82é
\82Ì
\82Å");
1629 You_cant("take that off%s.", why);
1631 m = joffmsg(obj, &j);
1632 pline("%s
\82»
\82ê%s%s
\82±
\82Æ
\82Í
\82Å
\82«
\82È
\82¢
\81D", why, j, m);
1637 reset_remarm(); /* clear context.takeoff.mask and context.takeoff.what */
1638 (void) select_off(obj);
1639 if (!context.takeoff.mask)
1641 /* none of armoroff()/Ring_/Amulet/Blindf_off() use context.takeoff.mask */
1644 if (obj->owornmask & W_ARMOR) {
1645 (void) armoroff(obj);
1646 } else if (obj == uright || obj == uleft) {
1647 /* Sometimes we want to give the off_msg before removing and
1648 * sometimes after; for instance, "you were wearing a moonstone
1649 * ring (on right hand)" is desired but "you were wearing a
1650 * square amulet (being worn)" is not because of the redundant
1655 } else if (obj == uamul) {
1658 } else if (obj == ublindf) {
1659 Blindf_off(obj); /* does its own off_msg */
1661 impossible("removing strange accessory?");
1663 remove_worn_item(obj, FALSE);
1668 /* the 'T' command */
1672 struct obj *otmp = (struct obj *) 0;
1678 count_worn_stuff(&otmp, FALSE);
1679 if (!Narmorpieces && !Naccessories) {
1680 /* assert( GRAY_DRAGON_SCALES > YELLOW_DRAGON_SCALE_MAIL ); */
1683 pline_The("%s merged with your skin!",
1684 uskin->otyp >= GRAY_DRAGON_SCALES
1685 ? "dragon scales are"
1686 : "dragon scale mail is");
1688 pline("
\83h
\83\89\83S
\83\93\82Ì
\97Ø%s
\82Í
\82 \82È
\82½
\82Ì
\94§
\82Æ
\97Z
\8d\87\82µ
\82Ä
\82µ
\82Ü
\82Á
\82Ä
\82¢
\82é
\81I",
1689 uskin->otyp >= GRAY_DRAGON_SCALES
1694 pline("Not wearing any armor or accessories.");
1696 pline("
\8aZ
\82â
\91\95\8fü
\95i
\82ð
\90g
\82É
\82Â
\82¯
\82Ä
\82¢
\82È
\82¢
\81D");
1699 if (Narmorpieces != 1 || ParanoidRemove)
1700 otmp = getobj(clothes, "take off");
1704 return armor_or_accessory_off(otmp);
1707 /* the 'R' command */
1711 struct obj *otmp = 0;
1713 count_worn_stuff(&otmp, TRUE);
1714 if (!Naccessories && !Narmorpieces) {
1716 pline("Not wearing any accessories or armor.");
1718 pline("
\91\95\8fü
\95i
\82â
\8aZ
\82ð
\90g
\82É
\82Â
\82¯
\82Ä
\82¢
\82È
\82¢
\81D");
1721 if (Naccessories != 1 || ParanoidRemove)
1722 otmp = getobj(accessories, "remove");
1726 return armor_or_accessory_off(otmp);
1729 /* Check if something worn is cursed _and_ unremovable. */
1732 register struct obj *otmp;
1735 impossible("cursed without otmp");
1738 /* Curses, like chickens, come home to roost. */
1739 if ((otmp == uwep) ? welded(otmp) : (int) otmp->cursed) {
1741 boolean use_plural = (is_boots(otmp) || is_gloves(otmp)
1742 || otmp->otyp == LENSES || otmp->quan > 1L);
1744 You("can't. %s cursed.", use_plural ? "They are" : "It is");
1746 pline("
\96³
\97\9d\82¾
\81D
\82»
\82ê
\82Í
\8eô
\82í
\82ê
\82Ä
\82¢
\82é
\81D");
1748 otmp->bknown = TRUE;
1756 register struct obj *otmp;
1758 register int delay = -objects[otmp->otyp].oc_delay;
1765 multi_reason = "disrobing";
1767 multi_reason = "
\92E
\82¢
\82Å
\82¢
\82é
\8e\9e\82É";
1768 if (is_helmet(otmp)) {
1771 nomovemsg = !strcmp(helm_simple_name(otmp), "hat")
1773 nomovemsg = !strcmp(helm_simple_name(otmp), "
\96X
\8eq")
1775 ? "You finish taking off your hat."
1777 ? "
\82 \82È
\82½
\82Í
\8a\95\82ð
\92E
\82¬
\82¨
\82¦
\82½
\81D"
1779 : "You finish taking off your helmet.";
1781 : "
\82 \82È
\82½
\82Í
\96X
\8eq
\82ð
\92E
\82¬
\82¨
\82¦
\82½
\81D";
1782 afternmv = Helmet_off;
1783 } else if (is_gloves(otmp)) {
1785 nomovemsg = "You finish taking off your gloves.";
1787 nomovemsg = "
\82 \82È
\82½
\82Í
\8f¬
\8eè
\82ð
\92E
\82¬
\82¨
\82¦
\82½
\81D";
1788 afternmv = Gloves_off;
1789 } else if (is_boots(otmp)) {
1791 nomovemsg = "You finish taking off your boots.";
1793 nomovemsg = "
\82 \82È
\82½
\82Í
\8cC
\82ð
\92E
\82¬
\82¨
\82¦
\82½
\81D";
1794 afternmv = Boots_off;
1797 nomovemsg = "You finish taking off your suit.";
1799 nomovemsg = "
\82 \82È
\82½
\82Í
\92\85\82Ä
\82¢
\82é
\95¨
\82ð
\92E
\82¬
\82¨
\82¦
\82½
\81D";
1800 afternmv = Armor_off;
1803 /* Be warned! We want off_msg after removing the item to
1804 * avoid "You were wearing ____ (being worn)." However, an
1805 * item which grants fire resistance might cause some trouble
1806 * if removed in Hell and lifesaving puts it back on; in this
1807 * case the message will be printed at the wrong time (after
1808 * the messages saying you died and were lifesaved). Luckily,
1809 * no cloak, shield, or fast-removable armor grants fire
1810 * resistance, so we can safely do the off_msg afterwards.
1811 * Rings do grant fire resistance, but for rings we want the
1812 * off_msg before removal anyway so there's no problem. Take
1813 * care in adding armors granting fire resistance; this code
1814 * might need modification.
1815 * 3.2 (actually 3.1 even): that comment is obsolete since
1816 * fire resistance is not required for Gehennom so setworn()
1817 * doesn't force the resistance granting item to be re-worn
1818 * after being lifesaved anymore.
1822 else if (is_shield(otmp))
1823 (void) Shield_off();
1825 setworn((struct obj *) 0, otmp->owornmask & W_ARMOR);
1828 context.takeoff.mask = context.takeoff.what = 0L;
1833 **
\95¨
\82É
\82æ
\82Á
\82Ä
\93®
\8e\8c\82ª
\95Ï
\89»
\82·
\82é
\82Ì
\82Å otmp
\82ð
\92Ç
\89Á
1840 already_wearing(cc, otmp)
1848 m = jconj(jonmsg(otmp, &j), "
\82Ä
\82¢
\82é");
1851 You("are already wearing %s%c", cc, (cc == c_that_) ? '!' : '.');
1853 You("
\82à
\82¤%s%s%s%s", cc, j, m, (cc == c_that_) ? "
\81I" : "
\81D");
1857 already_wearing2(cc1, cc2)
1858 const char *cc1, *cc2;
1861 You_cant("wear %s because you're wearing %s there already.", cc1, cc2);
1863 You_cant("%s
\82ð
\90g
\82É
\95t
\82¯
\82Ä
\82¢
\82é
\82Ì
\82Å%s
\82ð
\90g
\82É
\82Â
\82¯
\82ç
\82ê
\82È
\82¢
\81D", cc2, cc1);
1867 * canwearobj checks to see whether the player can wear a piece of armor
1869 * inputs: otmp (the piece of armor)
1870 * noisy (if TRUE give error messages, otherwise be quiet about it)
1871 * output: mask (otmp's armor type)
1874 canwearobj(otmp, mask, noisy)
1886 /* this is the same check as for 'W' (dowear), but different message,
1887 in case we get here via 'P' (doputon) */
1888 if (verysmall(youmonst.data) || nohands(youmonst.data)) {
1891 You("can't wear any armor in your current form.");
1893 You("
\8c»
\8dÝ
\82Ì
\8ep
\82Å
\82Í
\96h
\8bï
\82ð
\90g
\82É
\82Â
\82¯
\82é
\82±
\82Æ
\82Í
\82Å
\82«
\82È
\82¢
\81D");
1897 which = is_cloak(otmp)
1904 if (which && cantweararm(youmonst.data)
1905 /* same exception for cloaks as used in m_dowear() */
1906 && (which != c_cloak || youmonst.data->msize != MZ_SMALL)
1907 && (racial_exception(&youmonst, otmp) < 1)) {
1910 pline_The("%s will not fit on your body.", which);
1912 pline("%s
\82Í
\82 \82È
\82½
\82Ì
\91Ì
\82É
\8d\87\82í
\82È
\82¢
\81D", which);
1914 } else if (otmp->owornmask & W_ARMOR) {
1917 already_wearing(c_that_);
1919 already_wearing(c_that_, otmp);
1924 if (welded(uwep) && bimanual(uwep) && (is_suit(otmp) || is_shirt(otmp))) {
1927 You("cannot do that while holding your %s.",
1929 pline("%s
\82ð
\8e\9d\82Á
\82½
\82Ü
\82Ü
\82Å
\82Í
\82»
\82ê
\82Í
\8fo
\97\88\82È
\82¢
\81D",
1930 is_sword(uwep) ? c_sword : c_weapon);
1934 if (is_helmet(otmp)) {
1938 already_wearing(an(helm_simple_name(uarmh)));
1940 already_wearing(helm_simple_name(uarmh), uarmh);
1943 } else if (Upolyd && has_horns(youmonst.data) && !is_flimsy(otmp)) {
1944 /* (flimsy exception matches polyself handling) */
1947 pline_The("%s won't fit over your horn%s.",
1948 helm_simple_name(otmp),
1949 plur(num_horns(youmonst.data)));
1951 pline("
\8ap
\82ª
\82¶
\82á
\82Ü
\82Å%s
\82ð
\90g
\82É
\82Â
\82¯
\82ç
\82ê
\82È
\82¢
\81D",
1952 helm_simple_name(otmp));
1957 } else if (is_shield(otmp)) {
1961 already_wearing(an(c_shield));
1963 already_wearing(c_shield, uarms);
1966 } else if (uwep && bimanual(uwep)) {
1969 You("cannot wear a shield while wielding a two-handed %s.",
1970 is_sword(uwep) ? c_sword : (uwep->otyp == BATTLE_AXE)
1975 m = jconj(jonmsg(uwep, &j), "
\82Ä
\82¢
\82é");
1976 You("
\97¼
\8eè
\8e\9d\82¿
\82Ì%s%s%s
\82Ì
\82Å
\8f\82\82Å
\90g
\82ð
\8eç
\82ê
\82È
\82¢
\81D",
1977 is_sword(uwep) ? c_sword :
1978 uwep->otyp == BATTLE_AXE ? c_axe : c_weapon,
1983 } else if (u.twoweap) {
1986 You("cannot wear a shield while wielding two weapons.");
1988 You("
\93ñ
\93\81\97¬
\82ð
\82µ
\82Ä
\82¢
\82é
\82Ì
\82Å
\8f\82\82Å
\90g
\82ð
\8eç
\82ê
\82È
\82¢
\81D");
1992 } else if (is_boots(otmp)) {
1996 already_wearing(c_boots);
1998 already_wearing(c_boots, uarmf);
2001 } else if (Upolyd && slithy(youmonst.data)) {
2004 You("have no feet..."); /* not body_part(FOOT) */
2006 You("
\91«
\82ª
\82È
\82¢
\81D
\81D
\81D"); /* not body_part(FOOT) */
2009 } else if (Upolyd && youmonst.data->mlet == S_CENTAUR) {
2010 /* break_armor() pushes boots off for centaurs,
2011 so don't let dowear() put them back on... */
2014 pline("You have too many hooves to wear %s.",
2015 c_boots); /* makeplural(body_part(FOOT)) yields
2016 "rear hooves" which sounds odd */
2018 pline("%s
\82ð
\97\9a\82
\82É
\82Í
\91«
\82ª
\91½
\82·
\82¬
\82é
\81D", c_boots);
2022 && (u.utraptype == TT_BEARTRAP || u.utraptype == TT_INFLOOR
2023 || u.utraptype == TT_LAVA
2024 || u.utraptype == TT_BURIEDBALL)) {
2025 if (u.utraptype == TT_BEARTRAP) {
2028 Your("%s is trapped!", body_part(FOOT));
2030 Your("%s
\82Íã©
\82É
\82©
\82©
\82Á
\82Ä
\82¢
\82é
\81I", body_part(FOOT));
2031 } else if (u.utraptype == TT_INFLOOR || u.utraptype == TT_LAVA) {
2034 Your("%s are stuck in the %s!",
2035 makeplural(body_part(FOOT)), surface(u.ux, u.uy));
2037 Your("%s
\82Í%s
\82É
\82Í
\82Ü
\82Á
\82Ä
\82¢
\82é
\81I",
2038 body_part(FOOT), surface(u.ux, u.uy));
2040 } else { /*TT_BURIEDBALL*/
2043 Your("%s is attached to the buried ball!",
2046 Your("%s
\82Í
\96\84\82Ü
\82Á
\82Ä
\82¢
\82é
\8b\85\82É
\82Â
\82È
\82ª
\82Á
\82Ä
\82¢
\82é
\81I",
2053 } else if (is_gloves(otmp)) {
2057 already_wearing(c_gloves);
2059 already_wearing(c_gloves, uarmg);
2062 } else if (welded(uwep)) {
2065 You("cannot wear gloves over your %s.",
2067 You("%s
\82Ì
\8fã
\82©
\82ç
\8f¬
\8eè
\82ð
\91\95\94õ
\82Å
\82«
\82È
\82¢
\81D",
2068 is_sword(uwep) ? c_sword : c_weapon);
2072 } else if (is_shirt(otmp)) {
2073 if (uarm || uarmc || uarmu) {
2077 already_wearing(an(c_shirt));
2079 already_wearing(c_shirt, uarmu);
2084 You_cant("wear that over your %s.",
2086 You("%s
\82Ì
\8fã
\82©
\82ç
\92\85\82é
\82±
\82Æ
\82Í
\82Å
\82«
\82È
\82¢
\81D",
2087 (uarm && !uarmc) ? c_armor
2088 : cloak_simple_name(uarmc));
2093 } else if (is_cloak(otmp)) {
2097 already_wearing(an(cloak_simple_name(uarmc)));
2099 already_wearing(cloak_simple_name(uarmc), otmp);
2103 } else if (is_suit(otmp)) {
2107 You("cannot wear armor over a %s.", cloak_simple_name(uarmc));
2109 You("%s
\82Ì
\8fã
\82©
\82ç
\92\85\82é
\82±
\82Æ
\82Í
\82Å
\82«
\82È
\82¢
\81D", cloak_simple_name(uarmc));
2114 already_wearing("some armor");
2116 already_wearing("
\8aZ", uarm);
2121 /* getobj can't do this after setting its allow_all flag; that
2122 happens if you have armor for slots that are covered up or
2123 extra armor for slots that are filled */
2126 silly_thing("wear", otmp);
2128 silly_thing("
\90g
\82É
\82Â
\82¯
\82é", otmp);
2131 /* Unnecessary since now only weapons and special items like pick-axes get
2132 * welded to your hand, not armor
2135 if (noisy) weldmsg(otmp);
2143 accessory_or_armor_on(obj)
2147 boolean armor, ring, eyewear;
2149 if (obj->owornmask & (W_ACCESSORY | W_ARMOR)) {
2151 already_wearing(c_that_);
2153 already_wearing(c_that_, obj);
2157 armor = (obj->oclass == ARMOR_CLASS);
2158 ring = (obj->oclass == RING_CLASS || obj->otyp == MEAT_RING);
2159 eyewear = (obj->otyp == BLINDFOLD || obj->otyp == TOWEL
2160 || obj->otyp == LENSES);
2161 /* checks which are performed prior to actually touching the item */
2163 if (!canwearobj(obj, &mask, TRUE))
2166 if (obj->otyp == HELM_OF_OPPOSITE_ALIGNMENT
2167 && qstart_level.dnum == u.uz.dnum) { /* in quest */
2168 if (u.ualignbase[A_CURRENT] == u.ualignbase[A_ORIGINAL])
2170 You("narrowly avoid losing all chance at your goal.");
2172 You("
\96Ú
\93I
\82ð
\92B
\90¬
\82·
\82é
\89Â
\94\
\90«
\82ð
\8e¸
\82¤
\82±
\82Æ
\82ð
\82È
\82ñ
\82Æ
\82©
\89ñ
\94ð
\82µ
\82½
\81D");
2173 else /* converted */
2175 You("are suddenly overcome with shame and change your mind.");
2177 You("
\93Ë
\91R
\92p
\82¸
\82©
\82µ
\82
\82È
\82Á
\82Ä
\8dl
\82¦
\82ð
\95Ï
\82¦
\82½
\81D");
2178 u.ublessed = 0; /* lose your god's protection */
2179 makeknown(obj->otyp);
2180 context.botl = 1; /*for AC after zeroing u.ublessed */
2186 char answer, qbuf[QBUFSZ];
2189 if (nolimbs(youmonst.data)) {
2191 You("cannot make the ring stick to your body.");
2193 You("
\8ew
\97Ö
\82ð
\82Í
\82ß
\82ç
\82ê
\82È
\82¢
\91Ì
\82¾
\81D");
2196 if (uleft && uright) {
2198 There("are no more %s%s to fill.",
2199 humanoid(youmonst.data) ? "ring-" : "",
2200 makeplural(body_part(FINGER)));
2202 pline("
\82Í
\82ß
\82é
\82±
\82Æ
\82Ì
\82Å
\82«
\82é%s%s
\82ª
\82È
\82¢
\81D",
2203 humanoid(youmonst.data) ? "
\96ò" : "",
2210 } else if (uright) {
2215 Sprintf(qbuf, "Which %s%s, Right or Left?",
2216 humanoid(youmonst.data) ? "ring-" : "",
2219 Sprintf(qbuf, "
\82Ç
\82¿
\82ç
\82Ì%s%s
\81C
\89E(r)
\82»
\82ê
\82Æ
\82à
\8d¶(l)
\81H",
2220 humanoid(youmonst.data) ? "
\96ò" : "",
2223 answer = yn_function(qbuf, "rl", '\0');
2238 if (uarmg && uarmg->cursed) {
2239 res = !uarmg->bknown;
2242 You("cannot remove your gloves to put on the ring.");
2244 You("
\8ew
\97Ö
\82ð
\82Í
\82ß
\82æ
\82¤
\82Æ
\82µ
\82½
\82ª
\8f¬
\8eè
\82ª
\92E
\82°
\82È
\82¢
\81D");
2245 return res; /* uses move iff we learned gloves are cursed */
2248 res = !uwep->bknown; /* check this before calling welded() */
2249 if ((mask == RIGHT_RING || bimanual(uwep)) && welded(uwep)) {
2250 const char *hand = body_part(HAND);
2252 /* welded will set bknown */
2254 hand = makeplural(hand);
2256 You("cannot free your weapon %s to put on the ring.",
2258 You("
\8ew
\97Ö
\82ð
\82Í
\82ß
\82æ
\82¤
\82Æ
\82µ
\82½
\82ª
\97\98%s
\82Ì
\8e©
\97R
\82ª
\82«
\82©
\82È
\82¢
\81D",
2260 return res; /* uses move iff we learned weapon is cursed */
2263 } else if (obj->oclass == AMULET_CLASS) {
2266 already_wearing("an amulet");
2268 already_wearing("
\96\82\8f\9c\82¯", uamul);
2272 } else if (eyewear) {
2274 if (ublindf->otyp == TOWEL)
2276 Your("%s is already covered by a towel.",
2279 You("
\8aù
\82É
\83^
\83I
\83\8b\82ð
\90g
\82É
\82Â
\82¯
\82Ä
\82¢
\82é
\81D");
2281 else if (ublindf->otyp == BLINDFOLD) {
2282 if (obj->otyp == LENSES)
2284 already_wearing2("lenses", "a blindfold");
2286 already_wearing2("
\83\8c\83\93\83Y", "
\96Ú
\89B
\82µ");
2289 already_wearing("a blindfold");
2291 already_wearing("
\96Ú
\89B
\82µ", ublindf);
2293 } else if (ublindf->otyp == LENSES) {
2294 if (obj->otyp == BLINDFOLD)
2296 already_wearing2("a blindfold", "some lenses");
2298 already_wearing2("
\96Ú
\89B
\82µ", "
\83\8c\83\93\83Y");
2301 already_wearing("some lenses");
2303 already_wearing("
\83\8c\83\93\83Y", ublindf);
2307 already_wearing(something); /* ??? */
2309 already_wearing("
\89½
\82©", ublindf); /* ??? */
2315 /* neither armor nor accessory */
2317 You_cant("wear that!");
2319 You_cant("
\82»
\82ê
\82ð
\90g
\82É
\82Â
\82¯
\82ç
\82ê
\82È
\82¢
\81I");
2324 if (!retouch_object(&obj, FALSE))
2325 return 1; /* costs a turn even though it didn't get worn */
2330 obj->known = 1; /* since AC is shown on the status line */
2331 /* if the armor is wielded, release it for wearing */
2332 if (obj->owornmask & W_WEAPON)
2333 remove_worn_item(obj, FALSE);
2335 delay = -objects[obj->otyp].oc_delay;
2339 multi_reason = "dressing up";
2341 multi_reason = "
\91\95\94õ
\82µ
\82Ä
\82¢
\82é
\8e\9e\82É";
2343 afternmv = Boots_on;
2345 afternmv = Helmet_on;
2347 afternmv = Gloves_on;
2349 afternmv = Armor_on;
2351 nomovemsg = "You finish your dressing maneuver.";
2353 nomovemsg = "
\91\95\94õ
\82µ
\8fI
\82¦
\82½
\81D";
2363 context.takeoff.mask = context.takeoff.what = 0L;
2364 } else { /* not armor */
2365 boolean give_feedback = FALSE;
2367 /* [releasing wielded accessory handled in Xxx_on()] */
2371 give_feedback = TRUE;
2372 } else if (obj->oclass == AMULET_CLASS) {
2373 setworn(obj, W_AMUL);
2375 /* no feedback here if amulet of change got used up */
2376 give_feedback = (uamul != 0);
2377 } else if (eyewear) {
2378 /* setworn() handled by Blindf_on() */
2380 /* message handled by Blindf_on(); leave give_feedback False */
2382 /* feedback for ring or for amulet other than 'change' */
2383 if (give_feedback && is_worn(obj))
2384 prinv((char *) 0, obj, 0L);
2389 /* the 'W' command */
2395 /* cantweararm() checks for suits of armor, not what we want here;
2396 verysmall() or nohands() checks for shields, gloves, etc... */
2397 if (verysmall(youmonst.data) || nohands(youmonst.data)) {
2399 pline("Don't even bother.");
2401 pline("
\82»
\82ñ
\82È
\82Â
\82Ü
\82ç
\82È
\82¢
\82±
\82Æ
\82É
\82±
\82¾
\82í
\82é
\82È
\81D");
2404 if (uarm && uarmu && uarmc && uarmh && uarms && uarmg && uarmf
2405 && uleft && uright && uamul && ublindf) {
2406 /* 'W' message doesn't mention accessories */
2408 You("are already wearing a full complement of armor.");
2410 You("
\82·
\82Å
\82É
\8a®
\91S
\91\95\94õ
\82µ
\82Ä
\82¢
\82é
\81D");
2413 otmp = getobj(clothes, "wear");
2414 return otmp ? accessory_or_armor_on(otmp) : 0;
2417 /* the 'P' command */
2423 if (uleft && uright && uamul && ublindf
2424 && uarm && uarmu && uarmc && uarmh && uarms && uarmg && uarmf) {
2425 /* 'P' message doesn't mention armor */
2427 Your("%s%s are full, and you're already wearing an amulet and %s.",
2428 humanoid(youmonst.data) ? "ring-" : "",
2429 makeplural(body_part(FINGER)),
2430 (ublindf->otyp == LENSES) ? "some lenses" : "a blindfold");
2432 Your("%s%s
\82Í
\82Ó
\82³
\82ª
\82Á
\82Ä
\82é
\82µ
\81C
\82·
\82Å
\82É
\96\82\8f\9c\82¯
\82Æ%s
\82à
\90g
\82É
\82Â
\82¯
\82Ä
\82¢
\82é
\81D",
2433 humanoid(youmonst.data) ? "
\96ò" : "",
2435 ublindf->otyp==LENSES ? "
\83\8c\83\93\83Y" : "
\96Ú
\89B
\82µ");
2439 otmp = getobj(accessories, "put on");
2440 return otmp ? accessory_or_armor_on(otmp) : 0;
2443 /* calculate current armor class */
2447 int uac = mons[u.umonnum].ac; /* base armor class for current form */
2449 /* armor class from worn gear */
2451 uac -= ARM_BONUS(uarm);
2453 uac -= ARM_BONUS(uarmc);
2455 uac -= ARM_BONUS(uarmh);
2457 uac -= ARM_BONUS(uarmf);
2459 uac -= ARM_BONUS(uarms);
2461 uac -= ARM_BONUS(uarmg);
2463 uac -= ARM_BONUS(uarmu);
2464 if (uleft && uleft->otyp == RIN_PROTECTION)
2466 if (uright && uright->otyp == RIN_PROTECTION)
2469 /* armor class from other sources */
2470 if (HProtection & INTRINSIC)
2472 uac -= u.uspellprot;
2474 /* [The magic binary numbers 127 and -128 should be replaced with the
2475 * mystic decimal numbers 99 and -99 which require no explanation to
2476 * the uninitiated and would cap the width of a status line value at
2477 * one less character.]
2480 uac = -128; /* u.uac is an schar */
2482 uac = 127; /* for completeness */
2493 register struct obj *otmp;
2495 boolean leftfall, rightfall, wastwoweap = FALSE;
2496 const char *otherwep = 0, *thiswep, *which, *hand;
2498 leftfall = (uleft && !uleft->cursed
2499 && (!uwep || !welded(uwep) || !bimanual(uwep)));
2500 rightfall = (uright && !uright->cursed && (!welded(uwep)));
2501 if (!uarmg && (leftfall || rightfall) && !nolimbs(youmonst.data)) {
2502 /* changed so cursed rings don't fall off, GAN 10/30/86 */
2504 Your("%s off your %s.",
2505 (leftfall && rightfall) ? "rings slip" : "ring slips",
2506 (leftfall && rightfall) ? makeplural(body_part(FINGER))
2507 : body_part(FINGER));
2509 Your("
\8ew
\97Ö
\82Í%s
\82©
\82ç
\8a\8a\82è
\97\8e\82¿
\82½
\81D", body_part(FINGER));
2525 if (u.twoweap && otmp) {
2526 /* secondary weapon doesn't need nearly as much handling as
2527 primary; when in two-weapon mode, we know it's one-handed
2528 with something else in the other hand and also that it's
2529 a weapon or weptool rather than something unusual, plus
2530 we don't need to compare its type with the primary */
2531 otherwep = is_sword(otmp) ? c_sword : weapon_descr(otmp);
2532 if (otmp->quan > 1L)
2533 otherwep = makeplural(otherwep);
2534 hand = body_part(HAND);
2537 Your("%s %s%s from your %s%s.", otherwep, xfl ? "also " : "",
2538 otense(otmp, "slip"), which, hand);
2540 You("%s%s%s
\82©
\82ç
\8a\8a\82è
\97\8e\82Æ
\82µ
\82½
\81D", otherwep, xfl ? "
\82à
\82Ü
\82½" : "
\82ð",
2545 setuswapwep((struct obj *) 0); /* clears u.twoweap */
2546 if (canletgo(otmp, ""))
2550 if (otmp && !welded(otmp)) {
2551 long savequan = otmp->quan;
2553 /* nice wording if both weapons are the same type */
2554 thiswep = is_sword(otmp) ? c_sword : weapon_descr(otmp);
2555 if (otherwep && strcmp(thiswep, makesingular(otherwep)))
2557 if (otmp->quan > 1L) {
2558 /* most class names for unconventional wielded items
2559 are ok, but if wielding multiple apples or rations
2560 we don't want "your foods slip", so force non-corpse
2561 food to be singular; skipping makeplural() isn't
2562 enough--we need to fool otense() too */
2563 if (!strcmp(thiswep, "food"))
2566 thiswep = makeplural(thiswep);
2568 hand = body_part(HAND);
2571 hand = makeplural(hand);
2572 else if (wastwoweap)
2573 which = "right "; /* preceding msg was about left */
2575 pline("%s %s%s %s%s from your %s%s.",
2576 !strncmp(thiswep, "corpse", 6) ? "The" : "Your",
2577 otherwep ? "other " : "", thiswep, xfl ? "also " : "",
2578 otense(otmp, "slip"), which, hand);
2580 You("%s%s%s%s
\82©
\82ç
\8a\8a\82è
\97\8e\82Æ
\82µ
\82½
\81D",
2581 otherwep ? "
\82à
\82¤
\82Ð
\82Æ
\82Â
\82Ì" : "", thiswep,
2582 xfl ? "
\82à
\82Ü
\82½" : "
\82ð",
2586 otmp->quan = savequan;
2587 setuwep((struct obj *) 0);
2588 if (canletgo(otmp, ""))
2595 struct monst *victim;
2597 register struct obj *otmph, *otmp;
2599 otmph = (victim == &youmonst) ? uarmc : which_armor(victim, W_ARMC);
2601 otmph = (victim == &youmonst) ? uarm : which_armor(victim, W_ARM);
2603 otmph = (victim == &youmonst) ? uarmu : which_armor(victim, W_ARMU);
2605 otmp = (victim == &youmonst) ? uarmh : which_armor(victim, W_ARMH);
2606 if (otmp && (!otmph || !rn2(4)))
2608 otmp = (victim == &youmonst) ? uarmg : which_armor(victim, W_ARMG);
2609 if (otmp && (!otmph || !rn2(4)))
2611 otmp = (victim == &youmonst) ? uarmf : which_armor(victim, W_ARMF);
2612 if (otmp && (!otmph || !rn2(4)))
2614 otmp = (victim == &youmonst) ? uarms : which_armor(victim, W_ARMS);
2615 if (otmp && (!otmph || !rn2(4)))
2620 /* used for praying to check and fix levitation trouble */
2622 stuck_ring(ring, otyp)
2626 if (ring != uleft && ring != uright) {
2627 impossible("stuck_ring: neither left nor right?");
2628 return (struct obj *) 0;
2631 if (ring && ring->otyp == otyp) {
2632 /* reasons ring can't be removed match those checked by select_off();
2633 limbless case has extra checks because ordinarily it's temporary */
2634 if (nolimbs(youmonst.data) && uamul
2635 && uamul->otyp == AMULET_OF_UNCHANGING && uamul->cursed)
2637 if (welded(uwep) && (ring == uright || bimanual(uwep)))
2639 if (uarmg && uarmg->cursed)
2644 /* either no ring or not right type or nothing prevents its removal */
2645 return (struct obj *) 0;
2648 /* also for praying; find worn item that confers "Unchanging" attribute */
2652 if (uamul && uamul->otyp == AMULET_OF_UNCHANGING)
2660 register struct obj *otmp;
2667 *buf = '\0'; /* lint suppression */
2669 /* special ring checks */
2670 if (otmp == uright || otmp == uleft) {
2671 if (nolimbs(youmonst.data)) {
2673 pline_The("ring is stuck.");
2675 pline("
\8ew
\97Ö
\82Í
\91Ì
\82É
\96\84\82Ü
\82Á
\82Ä
\82µ
\82Ü
\82Á
\82Ä
\82¢
\82é
\81D");
2679 why = 0; /* the item which prevents ring removal */
2680 if (welded(uwep) && (otmp == uright || bimanual(uwep))) {
2682 Sprintf(buf, "free a weapon %s", body_part(HAND));
2684 Sprintf(buf, "
\97\98\98r
\82Ì
\8e©
\97R
\82ª
\82«
\82©
\82È
\82¢");
2686 } else if (uarmg && uarmg->cursed) {
2688 Sprintf(buf, "take off your %s", c_gloves);
2690 Sprintf(buf, "%s
\82ª
\92E
\82°
\82È
\82¢", c_gloves);
2695 You("cannot %s to remove the ring.", buf);
2697 You("
\8ew
\97Ö
\82ð
\82Í
\82¸
\82»
\82¤
\82Æ
\82µ
\82½
\82ª%s
\81D", buf);
2702 /* special glove checks */
2703 if (otmp == uarmg) {
2706 You("are unable to take off your %s while wielding that %s.",
2707 c_gloves, is_sword(uwep) ? c_sword : c_weapon);
2709 You("%s
\82ð
\8e\9d\82Á
\82½
\82Ü
\82Ü%s
\82ð
\82Í
\82¸
\82·
\82±
\82Æ
\82Í
\82Å
\82«
\82È
\82¢
\81D",
2710 is_sword(uwep) ? c_sword : c_weapon, c_gloves);
2712 uwep->bknown = TRUE;
2716 You_cant("take off the slippery %s with your slippery %s.",
2717 c_gloves, makeplural(body_part(FINGER)));
2719 You_cant("
\8a\8a\82è
\82â
\82·
\82¢%s
\82ð
\8a\8a\82è
\82â
\82·
\82¢%s
\82Å
\82Í
\82¸
\82¹
\82È
\82¢
\81D",
2720 c_gloves, body_part(FINGER));
2725 /* special boot checks */
2726 if (otmp == uarmf) {
2727 if (u.utrap && u.utraptype == TT_BEARTRAP) {
2729 pline_The("bear trap prevents you from pulling your %s out.",
2731 pline("%s
\82ª
\8cF
\82Ìã©
\82É
\82Â
\82©
\82Ü
\82Á
\82Ä
\82¢
\82é
\82Ì
\82Å
\92E
\82®
\82±
\82Æ
\82ª
\82Å
\82«
\82È
\82¢
\81D",
2734 } else if (u.utrap && u.utraptype == TT_INFLOOR) {
2736 You("are stuck in the %s, and cannot pull your %s out.",
2738 You("%s
\82ª%s
\82É
\82Í
\82Ü
\82Á
\82Ä
\82¢
\82é
\82Ì
\82Å
\92E
\82®
\82±
\82Æ
\82ª
\82Å
\82«
\82È
\82¢
\81D",
2739 surface(u.ux, u.uy), makeplural(body_part(FOOT)));
2743 /* special suit and shirt checks */
2744 if (otmp == uarm || otmp == uarmu) {
2745 why = 0; /* the item which prevents disrobing */
2746 if (uarmc && uarmc->cursed) {
2748 Sprintf(buf, "remove your %s", cloak_simple_name(uarmc));
2750 Sprintf(buf, "%s
\82ª
\92E
\82°
\82È
\82¢", cloak_simple_name(uarmc));
2752 } else if (otmp == uarmu && uarm && uarm->cursed) {
2754 Sprintf(buf, "remove your %s", c_suit);
2756 Sprintf(buf, "%s
\82ª
\92E
\82°
\82È
\82¢", c_suit);
2758 } else if (welded(uwep) && bimanual(uwep)) {
2760 Sprintf(buf, "release your %s",
2761 is_sword(uwep) ? c_sword : (uwep->otyp == BATTLE_AXE)
2765 Sprintf(buf, "%s
\82ª
\8eè
\95ú
\82¹
\82È
\82¢",
2766 is_sword(uwep) ? c_sword : (uwep->otyp == BATTLE_AXE)
2774 You("cannot %s to take off %s.", buf, the(xname(otmp)));
2776 You("%s
\82ð
\82Í
\82¸
\82»
\82¤
\82Æ
\82µ
\82½
\82ª%s
\81D", xname(otmp), buf);
2781 /* basic curse check */
2782 if (otmp == uquiver || (otmp == uswapwep && !u.twoweap)) {
2783 ; /* some items can be removed even when cursed */
2785 /* otherwise, this is fundamental */
2791 context.takeoff.mask |= WORN_ARMOR;
2792 else if (otmp == uarmc)
2793 context.takeoff.mask |= WORN_CLOAK;
2794 else if (otmp == uarmf)
2795 context.takeoff.mask |= WORN_BOOTS;
2796 else if (otmp == uarmg)
2797 context.takeoff.mask |= WORN_GLOVES;
2798 else if (otmp == uarmh)
2799 context.takeoff.mask |= WORN_HELMET;
2800 else if (otmp == uarms)
2801 context.takeoff.mask |= WORN_SHIELD;
2802 else if (otmp == uarmu)
2803 context.takeoff.mask |= WORN_SHIRT;
2804 else if (otmp == uleft)
2805 context.takeoff.mask |= LEFT_RING;
2806 else if (otmp == uright)
2807 context.takeoff.mask |= RIGHT_RING;
2808 else if (otmp == uamul)
2809 context.takeoff.mask |= WORN_AMUL;
2810 else if (otmp == ublindf)
2811 context.takeoff.mask |= WORN_BLINDF;
2812 else if (otmp == uwep)
2813 context.takeoff.mask |= W_WEP;
2814 else if (otmp == uswapwep)
2815 context.takeoff.mask |= W_SWAPWEP;
2816 else if (otmp == uquiver)
2817 context.takeoff.mask |= W_QUIVER;
2820 impossible("select_off: %s???", doname(otmp));
2825 STATIC_OVL struct obj *
2828 struct obj *otmp = (struct obj *) 0;
2829 struct takeoff_info *doff = &context.takeoff;
2831 context.takeoff.mask |= I_SPECIAL; /* set flag for cancel_doff() */
2832 if (doff->what == W_WEP) {
2833 if (!cursed(uwep)) {
2834 setuwep((struct obj *) 0);
2836 You("are empty %s.", body_part(HANDED));
2838 You("
\89½
\82à%s
\82É
\82µ
\82Ä
\82¢
\82È
\82¢
\81D", body_part(HAND));
2841 } else if (doff->what == W_SWAPWEP) {
2842 setuswapwep((struct obj *) 0);
2844 You("no longer have a second weapon readied.");
2846 You("
\97\
\94õ
\82Ì
\95\90\8aí
\82ð
\82¨
\82³
\82ß
\82½
\81D");
2848 } else if (doff->what == W_QUIVER) {
2849 setuqwep((struct obj *) 0);
2851 You("no longer have ammunition readied.");
2853 You("
\8f\80\94õ
\82µ
\82½
\96î
\92e
\82ð
\82¨
\82³
\82ß
\82½
\81D");
2854 } else if (doff->what == WORN_ARMOR) {
2858 } else if (doff->what == WORN_CLOAK) {
2862 } else if (doff->what == WORN_BOOTS) {
2866 } else if (doff->what == WORN_GLOVES) {
2869 (void) Gloves_off();
2870 } else if (doff->what == WORN_HELMET) {
2873 (void) Helmet_off();
2874 } else if (doff->what == WORN_SHIELD) {
2877 (void) Shield_off();
2878 } else if (doff->what == WORN_SHIRT) {
2882 } else if (doff->what == WORN_AMUL) {
2886 } else if (doff->what == LEFT_RING) {
2890 } else if (doff->what == RIGHT_RING) {
2894 } else if (doff->what == WORN_BLINDF) {
2895 if (!cursed(ublindf))
2896 Blindf_off(ublindf);
2898 impossible("do_takeoff: taking off %lx", doff->what);
2900 context.takeoff.mask &= ~I_SPECIAL; /* clear cancel_doff() flag */
2905 /* occupation callback for 'A' */
2911 register struct obj *otmp;
2912 struct takeoff_info *doff = &context.takeoff;
2915 if (doff->delay > 0) {
2917 return 1; /* still busy */
2919 if ((otmp = do_takeoff()) != 0)
2921 doff->mask &= ~doff->what;
2925 for (i = 0; takeoff_order[i]; i++)
2926 if (doff->mask & takeoff_order[i]) {
2927 doff->what = takeoff_order[i];
2931 otmp = (struct obj *) 0;
2934 if (doff->what == 0L) {
2936 You("finish %s.", doff->disrobing);
2938 You("
\91\95\94õ
\82ð
\89ð
\82«
\82¨
\82¦
\82½
\81D");
2940 } else if (doff->what == W_WEP) {
2942 } else if (doff->what == W_SWAPWEP) {
2944 } else if (doff->what == W_QUIVER) {
2946 } else if (doff->what == WORN_ARMOR) {
2948 /* If a cloak is being worn, add the time to take it off and put
2949 * it back on again. Kludge alert! since that time is 0 for all
2950 * known cloaks, add 1 so that it actually matters...
2953 doff->delay += 2 * objects[uarmc->otyp].oc_delay + 1;
2954 } else if (doff->what == WORN_CLOAK) {
2956 } else if (doff->what == WORN_BOOTS) {
2958 } else if (doff->what == WORN_GLOVES) {
2960 } else if (doff->what == WORN_HELMET) {
2962 } else if (doff->what == WORN_SHIELD) {
2964 } else if (doff->what == WORN_SHIRT) {
2966 /* add the time to take off and put back on armor and/or cloak */
2968 doff->delay += 2 * objects[uarm->otyp].oc_delay;
2970 doff->delay += 2 * objects[uarmc->otyp].oc_delay + 1;
2971 } else if (doff->what == WORN_AMUL) {
2973 } else if (doff->what == LEFT_RING) {
2975 } else if (doff->what == RIGHT_RING) {
2977 } else if (doff->what == WORN_BLINDF) {
2978 /* [this used to be 2, but 'R' (and 'T') only require 1 turn to
2979 remove a blindfold, so 'A' shouldn't have been requiring 2] */
2982 impossible("take_off: taking off %lx", doff->what);
2983 return 0; /* force done */
2987 doff->delay += objects[otmp->otyp].oc_delay;
2989 /* Since setting the occupation now starts the counter next move, that
2990 * would always produce a delay 1 too big per item unless we subtract
2991 * 1 here to account for it.
2993 if (doff->delay > 0)
2996 set_occupation(take_off, doff->disrobing, 0);
2997 return 1; /* get busy */
3000 /* clear saved context to avoid inappropriate resumption of interrupted 'A' */
3004 context.takeoff.what = context.takeoff.mask = 0L;
3005 context.takeoff.disrobing[0] = '\0';
3008 /* the 'A' command -- remove multiple worn items */
3014 if (context.takeoff.what || context.takeoff.mask) {
3016 You("continue %s.", context.takeoff.disrobing);
3018 You("
\91\95\94õ
\82ð
\89ð
\82
\82Ì
\82ð
\8dÄ
\8aJ
\82µ
\82½
\81D");
3020 set_occupation(take_off, context.takeoff.disrobing, 0);
3022 set_occupation(take_off, "
\91\95\94õ
\82ð
\89ð
\82", 0);
3024 } else if (!uwep && !uswapwep && !uquiver && !uamul && !ublindf && !uleft
3025 && !uright && !wearing_armor()) {
3027 You("are not wearing anything.");
3029 You("
\89½
\82à
\91\95\94õ
\82µ
\82Ä
\82¢
\82È
\82¢
\81D");
3033 add_valid_menu_class(0); /* reset */
3034 if (flags.menu_style != MENU_TRADITIONAL
3035 || (result = ggetobj("take off", select_off, 0, FALSE,
3036 (unsigned *) 0)) < -1)
3037 result = menu_remarm(result);
3039 if (context.takeoff.mask) {
3040 #if 0 /*JP*//*
\93ú
\96{
\8cê
\82Å
\82Í
\8eg
\82í
\82È
\82¢*/
3041 /* default activity for armor and/or accessories,
3042 possibly combined with weapons */
3043 (void) strncpy(context.takeoff.disrobing, "disrobing", CONTEXTVERBSZ);
3044 /* specific activity when handling weapons only */
3045 if (!(context.takeoff.mask & ~W_WEAPON))
3046 (void) strncpy(context.takeoff.disrobing, "disarming",
3051 /* The time to perform the command is already completely accounted for
3052 * in take_off(); if we return 1, that would add an extra turn to each
3063 menu_item *pick_list;
3064 boolean all_worn_categories = TRUE;
3067 all_worn_categories = (retry == -2);
3068 } else if (flags.menu_style == MENU_FULL) {
3069 all_worn_categories = FALSE;
3071 n = query_category("What type of things do you want to take off?",
3073 n = query_category("
\82Ç
\82Ì
\83^
\83C
\83v
\82Ì
\95¨
\82Ì
\91\95\94õ
\82ð
\89ð
\82«
\82Ü
\82·
\82©
\81H",
3074 invent, (WORN_TYPES | ALL_TYPES
3075 | UNPAID_TYPES | BUCX_TYPES),
3076 &pick_list, PICK_ANY);
3079 for (i = 0; i < n; i++) {
3080 if (pick_list[i].item.a_int == ALL_TYPES_SELECTED)
3081 all_worn_categories = TRUE;
3083 add_valid_menu_class(pick_list[i].item.a_int);
3085 free((genericptr_t) pick_list);
3086 } else if (flags.menu_style == MENU_COMBINATION) {
3087 unsigned ggofeedback = 0;
3089 i = ggetobj("take off", select_off, 0, TRUE, &ggofeedback);
3090 if (ggofeedback & ALL_FINISHED)
3092 all_worn_categories = (i == -2);
3094 if (menu_class_present('u')
3095 || menu_class_present('B') || menu_class_present('U')
3096 || menu_class_present('C') || menu_class_present('X'))
3097 all_worn_categories = FALSE;
3100 n = query_objlist("What do you want to take off?", &invent,
3101 (SIGNAL_NOMENU | USE_INVLET | INVORDER_SORT),
3102 &pick_list, PICK_ANY,
3103 all_worn_categories ? is_worn : is_worn_by_type);
3105 n = query_objlist("
\82Ç
\82Ì
\91\95\94õ
\82ð
\89ð
\82«
\82Ü
\82·
\82©
\81H", &invent,
3106 (SIGNAL_NOMENU | USE_INVLET | INVORDER_SORT),
3107 &pick_list, PICK_ANY,
3108 all_worn_categories ? is_worn : is_worn_by_type);
3111 for (i = 0; i < n; i++)
3112 (void) select_off(pick_list[i].item.a_obj);
3113 free((genericptr_t) pick_list);
3114 } else if (n < 0 && flags.menu_style != MENU_COMBINATION) {
3116 There("is nothing else you can remove or unwield.");
3118 pline("
\91\95\94õ
\82ð
\89ð
\82¯
\82é
\82à
\82Ì
\82Í
\89½
\82à
\82È
\82¢
\81D");
3123 /* hit by destroy armor scroll/black dragon breath/monster spell */
3126 register struct obj *atmp;
3128 register struct obj *otmp;
3129 #define DESTROY_ARM(o) \
3130 ((otmp = (o)) != 0 && (!atmp || atmp == otmp) \
3131 && (!obj_resists(otmp, 0, 90)) \
3132 ? (otmp->in_use = TRUE) \
3135 if (DESTROY_ARM(uarmc)) {
3139 Your("%s crumbles and turns to dust!", cloak_simple_name(uarmc));
3141 Your("%s
\82Í
\95²
\81X
\82É
\82È
\82Á
\82½
\81I", cloak_simple_name(uarmc));
3144 } else if (DESTROY_ARM(uarm)) {
3148 Your("armor turns to dust and falls to the %s!", surface(u.ux, u.uy));
3150 Your("
\8aZ
\82Í
\90o
\82Æ
\82È
\82è%s
\82É
\97\8e\82¿
\82½
\81I", surface(u.ux,u.uy));
3151 (void) Armor_gone();
3153 } else if (DESTROY_ARM(uarmu)) {
3157 Your("shirt crumbles into tiny threads and falls apart!");
3159 Your("
\83V
\83\83\83c
\82Í
\83Y
\83^
\83Y
\83^
\82É
\97ô
\82¯
\81C
\8f¬
\82³
\82È
\8e\85\8bû
\82Æ
\82È
\82è
\97\8e\82¿
\82½
\81I");
3162 } else if (DESTROY_ARM(uarmh)) {
3166 Your("%s turns to dust and is blown away!", helm_simple_name(uarmh));
3168 Your("%s
\82Í
\90o
\82Æ
\82È
\82è
\90\81\82«
\82Æ
\82ñ
\82¾
\81I", helm_simple_name(uarmh));
3169 (void) Helmet_off();
3171 } else if (DESTROY_ARM(uarmg)) {
3175 Your("gloves vanish!");
3177 Your("
\8f¬
\8eè
\82Í
\8fÁ
\82¦
\82½
\81I");
3178 (void) Gloves_off();
3183 selftouch("
\82»
\82Ì
\82Æ
\82«
\82 \82È
\82½
\82Í");
3184 } else if (DESTROY_ARM(uarmf)) {
3188 Your("boots disintegrate!");
3190 Your("
\8cC
\82Í
\95²
\81X
\82É
\8dÓ
\82¯
\82½
\81I");
3193 } else if (DESTROY_ARM(uarms)) {
3197 Your("shield crumbles away!");
3199 Your("
\8f\82\82Í
\8dÓ
\82¯
\8eU
\82Á
\82½
\81I");
3200 (void) Shield_off();
3203 return 0; /* could not destroy anything */
3212 adj_abon(otmp, delta)
3213 register struct obj *otmp;
3214 register schar delta;
3216 if (uarmg && uarmg == otmp && otmp->otyp == GAUNTLETS_OF_DEXTERITY) {
3218 makeknown(uarmg->otyp);
3219 ABON(A_DEX) += (delta);
3223 if (uarmh && uarmh == otmp && otmp->otyp == HELM_OF_BRILLIANCE) {
3225 makeknown(uarmh->otyp);
3226 ABON(A_INT) += (delta);
3227 ABON(A_WIS) += (delta);
3233 /* decide whether a worn item is covered up by some other worn item,
3234 used for dipping into liquid and applying grease;
3235 some criteria are different than select_off()'s */
3237 inaccessible_equipment(obj, verb, only_if_known_cursed)
3239 const char *verb; /* "dip" or "grease", or null to avoid messages */
3240 /*JP:
\93ú
\96{
\8cê
\82Å
\82Í "
\82ð
\90Z
\82·", "
\82É
\8e\89\82ð
\93h
\82é", null
\82Ì
\82¢
\82¸
\82ê
\82©*/
3241 boolean only_if_known_cursed; /* ignore covering unless known to be cursed */
3244 static NEARDATA const char need_to_take_off_outer_armor[] =
3245 "need to take off %s to %s %s.";
3246 #else /*JP:
\88ø
\90\94\82ª
\8c´
\95¶
\82Æ
\95Ï
\82í
\82Á
\82Ä
\82¢
\82é
\82±
\82Æ
\82É
\92\8d\88Ó*/
3247 static NEARDATA const char need_to_take_off_outer_armor[] =
3248 "%s%s
\82É
\82Í%s
\82ð%s
\95K
\97v
\82ª
\82 \82é
\81D";
3251 boolean anycovering = !only_if_known_cursed; /* more comprehensible... */
3252 #define BLOCKSACCESS(x) (anycovering || ((x)->cursed && (x)->bknown))
3254 if (!obj || !obj->owornmask)
3255 return FALSE; /* not inaccessible */
3257 /* check for suit covered by cloak */
3258 if (obj == uarm && uarmc && BLOCKSACCESS(uarmc)) {
3260 Strcpy(buf, yname(uarmc));
3262 You(need_to_take_off_outer_armor, buf, verb, yname(obj));
3263 #else /*JP:
\91Î
\8fÛ
\82Í
\83N
\83\8d\81[
\83N
\82È
\82Ì
\82Åjoffmsg
\82ð
\8eg
\82í
\82¸
\8c\88\82ß
\8c\82\82¿*/
3264 You(need_to_take_off_outer_armor, xname(obj), verb, buf, "
\92E
\82®");
3269 /* check for shirt covered by suit and/or cloak */
3271 && ((uarm && BLOCKSACCESS(uarm)) || (uarmc && BLOCKSACCESS(uarmc)))) {
3273 char cloaktmp[QBUFSZ], suittmp[QBUFSZ];
3274 /* if sameprefix, use yname and xname to get "your cloak and suit"
3275 or "Manlobbi's cloak and suit"; otherwise, use yname and yname
3276 to get "your cloak and Manlobbi's suit" or vice versa */
3277 boolean sameprefix = (uarm && uarmc
3278 && !strcmp(shk_your(cloaktmp, uarmc),
3279 shk_your(suittmp, uarm)));
3283 Strcat(buf, yname(uarmc));
3286 Strcat(buf, " and ");
3288 Strcat(buf, "
\82Æ");
3290 Strcat(buf, sameprefix ? xname(uarm) : yname(uarm));
3292 You(need_to_take_off_outer_armor, buf, verb, yname(obj));
3293 #else /*JP:
\91Î
\8fÛ
\82Í
\83N
\83\8d\81[
\83N
\82©
\8aZ
\82È
\82Ì
\82Åjoffmsg
\82ð
\8eg
\82í
\82¸
\8c\88\82ß
\8c\82\82¿*/
3294 You(need_to_take_off_outer_armor, xname(obj), verb, buf, "
\92E
\82®");
3299 /* check for ring covered by gloves */
3300 if ((obj == uleft || obj == uright) && uarmg && BLOCKSACCESS(uarmg)) {
3302 Strcpy(buf, yname(uarmg));
3304 You(need_to_take_off_outer_armor, buf, verb, yname(obj));
3305 #else /*JP:
\91Î
\8fÛ
\82Í
\8f¬
\8eè
\82È
\82Ì
\82Åjoffmsg
\82ð
\8eg
\82í
\82¸
\8c\88\82ß
\8c\82\82¿*/
3306 You(need_to_take_off_outer_armor, xname(obj), verb, buf, "
\82Í
\82¸
\82·");
3311 /* item is not inaccessible */