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-2019 */
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 pline("
\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;
1674 count_worn_stuff(&otmp, FALSE);
1675 if (!Narmorpieces && !Naccessories) {
1676 /* assert( GRAY_DRAGON_SCALES > YELLOW_DRAGON_SCALE_MAIL ); */
1679 pline_The("%s merged with your skin!",
1680 uskin->otyp >= GRAY_DRAGON_SCALES
1681 ? "dragon scales are"
1682 : "dragon scale mail is");
1684 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",
1685 uskin->otyp >= GRAY_DRAGON_SCALES
1690 pline("Not wearing any armor or accessories.");
1692 pline("
\8aZ
\82â
\91\95\8fü
\95i
\82ð
\90g
\82É
\82Â
\82¯
\82Ä
\82¢
\82È
\82¢
\81D");
1695 if (Narmorpieces != 1 || ParanoidRemove)
1696 otmp = getobj(clothes, "take off");
1700 return armor_or_accessory_off(otmp);
1703 /* the 'R' command */
1707 struct obj *otmp = 0;
1709 count_worn_stuff(&otmp, TRUE);
1710 if (!Naccessories && !Narmorpieces) {
1712 pline("Not wearing any accessories or armor.");
1714 pline("
\91\95\8fü
\95i
\82â
\8aZ
\82ð
\90g
\82É
\82Â
\82¯
\82Ä
\82¢
\82È
\82¢
\81D");
1717 if (Naccessories != 1 || ParanoidRemove)
1718 otmp = getobj(accessories, "remove");
1722 return armor_or_accessory_off(otmp);
1725 /* Check if something worn is cursed _and_ unremovable. */
1728 register struct obj *otmp;
1731 impossible("cursed without otmp");
1734 /* Curses, like chickens, come home to roost. */
1735 if ((otmp == uwep) ? welded(otmp) : (int) otmp->cursed) {
1737 boolean use_plural = (is_boots(otmp) || is_gloves(otmp)
1738 || otmp->otyp == LENSES || otmp->quan > 1L);
1740 You("can't. %s cursed.", use_plural ? "They are" : "It is");
1742 pline("
\96³
\97\9d\82¾
\81D
\82»
\82ê
\82Í
\8eô
\82í
\82ê
\82Ä
\82¢
\82é
\81D");
1744 otmp->bknown = TRUE;
1752 register struct obj *otmp;
1754 register int delay = -objects[otmp->otyp].oc_delay;
1761 multi_reason = "disrobing";
1763 multi_reason = "
\92E
\82¢
\82Å
\82¢
\82é
\8e\9e\82É";
1764 if (is_helmet(otmp)) {
1767 nomovemsg = !strcmp(helm_simple_name(otmp), "hat")
1769 nomovemsg = !strcmp(helm_simple_name(otmp), "
\96X
\8eq")
1771 ? "You finish taking off your hat."
1773 ? "
\82 \82È
\82½
\82Í
\8a\95\82ð
\92E
\82¬
\82¨
\82¦
\82½
\81D"
1775 : "You finish taking off your helmet.";
1777 : "
\82 \82È
\82½
\82Í
\96X
\8eq
\82ð
\92E
\82¬
\82¨
\82¦
\82½
\81D";
1778 afternmv = Helmet_off;
1779 } else if (is_gloves(otmp)) {
1781 nomovemsg = "You finish taking off your gloves.";
1783 nomovemsg = "
\82 \82È
\82½
\82Í
\8f¬
\8eè
\82ð
\92E
\82¬
\82¨
\82¦
\82½
\81D";
1784 afternmv = Gloves_off;
1785 } else if (is_boots(otmp)) {
1787 nomovemsg = "You finish taking off your boots.";
1789 nomovemsg = "
\82 \82È
\82½
\82Í
\8cC
\82ð
\92E
\82¬
\82¨
\82¦
\82½
\81D";
1790 afternmv = Boots_off;
1793 nomovemsg = "You finish taking off your suit.";
1795 nomovemsg = "
\82 \82È
\82½
\82Í
\92\85\82Ä
\82¢
\82é
\95¨
\82ð
\92E
\82¬
\82¨
\82¦
\82½
\81D";
1796 afternmv = Armor_off;
1799 /* Be warned! We want off_msg after removing the item to
1800 * avoid "You were wearing ____ (being worn)." However, an
1801 * item which grants fire resistance might cause some trouble
1802 * if removed in Hell and lifesaving puts it back on; in this
1803 * case the message will be printed at the wrong time (after
1804 * the messages saying you died and were lifesaved). Luckily,
1805 * no cloak, shield, or fast-removable armor grants fire
1806 * resistance, so we can safely do the off_msg afterwards.
1807 * Rings do grant fire resistance, but for rings we want the
1808 * off_msg before removal anyway so there's no problem. Take
1809 * care in adding armors granting fire resistance; this code
1810 * might need modification.
1811 * 3.2 (actually 3.1 even): that comment is obsolete since
1812 * fire resistance is not required for Gehennom so setworn()
1813 * doesn't force the resistance granting item to be re-worn
1814 * after being lifesaved anymore.
1818 else if (is_shield(otmp))
1819 (void) Shield_off();
1821 setworn((struct obj *) 0, otmp->owornmask & W_ARMOR);
1824 context.takeoff.mask = context.takeoff.what = 0L;
1829 **
\95¨
\82É
\82æ
\82Á
\82Ä
\93®
\8e\8c\82ª
\95Ï
\89»
\82·
\82é
\82Ì
\82Å otmp
\82ð
\92Ç
\89Á
1836 already_wearing(cc, otmp)
1844 m = jconj(jonmsg(otmp, &j), "
\82Ä
\82¢
\82é");
1847 You("are already wearing %s%c", cc, (cc == c_that_) ? '!' : '.');
1849 You("
\82à
\82¤%s%s%s%s", cc, j, m, (cc == c_that_) ? "
\81I" : "
\81D");
1853 already_wearing2(cc1, cc2)
1854 const char *cc1, *cc2;
1857 You_cant("wear %s because you're wearing %s there already.", cc1, cc2);
1859 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);
1863 * canwearobj checks to see whether the player can wear a piece of armor
1865 * inputs: otmp (the piece of armor)
1866 * noisy (if TRUE give error messages, otherwise be quiet about it)
1867 * output: mask (otmp's armor type)
1870 canwearobj(otmp, mask, noisy)
1882 /* this is the same check as for 'W' (dowear), but different message,
1883 in case we get here via 'P' (doputon) */
1884 if (verysmall(youmonst.data) || nohands(youmonst.data)) {
1887 You("can't wear any armor in your current form.");
1889 You("
\8c»
\8dÝ
\82Ì
\8ep
\82Å
\82Í
\96h
\8bï
\82ð
\90g
\82É
\82Â
\82¯
\82é
\82±
\82Æ
\82Í
\82Å
\82«
\82È
\82¢
\81D");
1893 which = is_cloak(otmp)
1900 if (which && cantweararm(youmonst.data)
1901 /* same exception for cloaks as used in m_dowear() */
1902 && (which != c_cloak || youmonst.data->msize != MZ_SMALL)
1903 && (racial_exception(&youmonst, otmp) < 1)) {
1906 pline_The("%s will not fit on your body.", which);
1908 pline("%s
\82Í
\82 \82È
\82½
\82Ì
\91Ì
\82É
\8d\87\82í
\82È
\82¢
\81D", which);
1910 } else if (otmp->owornmask & W_ARMOR) {
1913 already_wearing(c_that_);
1915 already_wearing(c_that_, otmp);
1920 if (welded(uwep) && bimanual(uwep) && (is_suit(otmp) || is_shirt(otmp))) {
1923 You("cannot do that while holding your %s.",
1925 pline("%s
\82ð
\8e\9d\82Á
\82½
\82Ü
\82Ü
\82Å
\82Í
\82»
\82ê
\82Í
\8fo
\97\88\82È
\82¢
\81D",
1926 is_sword(uwep) ? c_sword : c_weapon);
1930 if (is_helmet(otmp)) {
1934 already_wearing(an(helm_simple_name(uarmh)));
1936 already_wearing(helm_simple_name(uarmh), uarmh);
1939 } else if (Upolyd && has_horns(youmonst.data) && !is_flimsy(otmp)) {
1940 /* (flimsy exception matches polyself handling) */
1943 pline_The("%s won't fit over your horn%s.",
1944 helm_simple_name(otmp),
1945 plur(num_horns(youmonst.data)));
1947 pline("
\8ap
\82ª
\82¶
\82á
\82Ü
\82Å%s
\82ð
\90g
\82É
\82Â
\82¯
\82ç
\82ê
\82È
\82¢
\81D",
1948 helm_simple_name(otmp));
1953 } else if (is_shield(otmp)) {
1957 already_wearing(an(c_shield));
1959 already_wearing(c_shield, uarms);
1962 } else if (uwep && bimanual(uwep)) {
1965 You("cannot wear a shield while wielding a two-handed %s.",
1966 is_sword(uwep) ? c_sword : (uwep->otyp == BATTLE_AXE)
1971 m = jconj(jonmsg(uwep, &j), "
\82Ä
\82¢
\82é");
1972 You("
\97¼
\8eè
\8e\9d\82¿
\82Ì%s%s%s
\82Ì
\82Å
\8f\82\82Å
\90g
\82ð
\8eç
\82ê
\82È
\82¢
\81D",
1973 is_sword(uwep) ? c_sword :
1974 uwep->otyp == BATTLE_AXE ? c_axe : c_weapon,
1979 } else if (u.twoweap) {
1982 You("cannot wear a shield while wielding two weapons.");
1984 You("
\93ñ
\93\81\97¬
\82ð
\82µ
\82Ä
\82¢
\82é
\82Ì
\82Å
\8f\82\82Å
\90g
\82ð
\8eç
\82ê
\82È
\82¢
\81D");
1988 } else if (is_boots(otmp)) {
1992 already_wearing(c_boots);
1994 already_wearing(c_boots, uarmf);
1997 } else if (Upolyd && slithy(youmonst.data)) {
2000 You("have no feet..."); /* not body_part(FOOT) */
2002 You("
\91«
\82ª
\82È
\82¢
\81D
\81D
\81D"); /* not body_part(FOOT) */
2005 } else if (Upolyd && youmonst.data->mlet == S_CENTAUR) {
2006 /* break_armor() pushes boots off for centaurs,
2007 so don't let dowear() put them back on... */
2010 pline("You have too many hooves to wear %s.",
2011 c_boots); /* makeplural(body_part(FOOT)) yields
2012 "rear hooves" which sounds odd */
2014 pline("%s
\82ð
\97\9a\82
\82É
\82Í
\91«
\82ª
\91½
\82·
\82¬
\82é
\81D", c_boots);
2018 && (u.utraptype == TT_BEARTRAP || u.utraptype == TT_INFLOOR
2019 || u.utraptype == TT_LAVA
2020 || u.utraptype == TT_BURIEDBALL)) {
2021 if (u.utraptype == TT_BEARTRAP) {
2024 Your("%s is trapped!", body_part(FOOT));
2026 Your("%s
\82Íã©
\82É
\82©
\82©
\82Á
\82Ä
\82¢
\82é
\81I", body_part(FOOT));
2027 } else if (u.utraptype == TT_INFLOOR || u.utraptype == TT_LAVA) {
2030 Your("%s are stuck in the %s!",
2031 makeplural(body_part(FOOT)), surface(u.ux, u.uy));
2033 Your("%s
\82Í%s
\82É
\82Í
\82Ü
\82Á
\82Ä
\82¢
\82é
\81I",
2034 body_part(FOOT), surface(u.ux, u.uy));
2036 } else { /*TT_BURIEDBALL*/
2039 Your("%s is attached to the buried ball!",
2042 Your("%s
\82Í
\96\84\82Ü
\82Á
\82Ä
\82¢
\82é
\8b\85\82É
\82Â
\82È
\82ª
\82Á
\82Ä
\82¢
\82é
\81I",
2049 } else if (is_gloves(otmp)) {
2053 already_wearing(c_gloves);
2055 already_wearing(c_gloves, uarmg);
2058 } else if (welded(uwep)) {
2061 You("cannot wear gloves over your %s.",
2063 You("%s
\82Ì
\8fã
\82©
\82ç
\8f¬
\8eè
\82ð
\91\95\94õ
\82Å
\82«
\82È
\82¢
\81D",
2064 is_sword(uwep) ? c_sword : c_weapon);
2068 } else if (is_shirt(otmp)) {
2069 if (uarm || uarmc || uarmu) {
2073 already_wearing(an(c_shirt));
2075 already_wearing(c_shirt, uarmu);
2080 You_cant("wear that over your %s.",
2082 You("%s
\82Ì
\8fã
\82©
\82ç
\92\85\82é
\82±
\82Æ
\82Í
\82Å
\82«
\82È
\82¢
\81D",
2083 (uarm && !uarmc) ? c_armor
2084 : cloak_simple_name(uarmc));
2089 } else if (is_cloak(otmp)) {
2093 already_wearing(an(cloak_simple_name(uarmc)));
2095 already_wearing(cloak_simple_name(uarmc), otmp);
2099 } else if (is_suit(otmp)) {
2103 You("cannot wear armor over a %s.", cloak_simple_name(uarmc));
2105 You("%s
\82Ì
\8fã
\82©
\82ç
\92\85\82é
\82±
\82Æ
\82Í
\82Å
\82«
\82È
\82¢
\81D", cloak_simple_name(uarmc));
2110 already_wearing("some armor");
2112 already_wearing("
\8aZ", uarm);
2117 /* getobj can't do this after setting its allow_all flag; that
2118 happens if you have armor for slots that are covered up or
2119 extra armor for slots that are filled */
2122 silly_thing("wear", otmp);
2124 silly_thing("
\90g
\82É
\82Â
\82¯
\82é", otmp);
2127 /* Unnecessary since now only weapons and special items like pick-axes get
2128 * welded to your hand, not armor
2131 if (noisy) weldmsg(otmp);
2139 accessory_or_armor_on(obj)
2143 boolean armor, ring, eyewear;
2145 if (obj->owornmask & (W_ACCESSORY | W_ARMOR)) {
2147 already_wearing(c_that_);
2149 already_wearing(c_that_, obj);
2153 armor = (obj->oclass == ARMOR_CLASS);
2154 ring = (obj->oclass == RING_CLASS || obj->otyp == MEAT_RING);
2155 eyewear = (obj->otyp == BLINDFOLD || obj->otyp == TOWEL
2156 || obj->otyp == LENSES);
2157 /* checks which are performed prior to actually touching the item */
2159 if (!canwearobj(obj, &mask, TRUE))
2162 if (obj->otyp == HELM_OF_OPPOSITE_ALIGNMENT
2163 && qstart_level.dnum == u.uz.dnum) { /* in quest */
2164 if (u.ualignbase[A_CURRENT] == u.ualignbase[A_ORIGINAL])
2166 You("narrowly avoid losing all chance at your goal.");
2168 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");
2169 else /* converted */
2171 You("are suddenly overcome with shame and change your mind.");
2173 You("
\93Ë
\91R
\92p
\82¸
\82©
\82µ
\82
\82È
\82Á
\82Ä
\8dl
\82¦
\82ð
\95Ï
\82¦
\82½
\81D");
2174 u.ublessed = 0; /* lose your god's protection */
2175 makeknown(obj->otyp);
2176 context.botl = 1; /*for AC after zeroing u.ublessed */
2182 char answer, qbuf[QBUFSZ];
2185 if (nolimbs(youmonst.data)) {
2187 You("cannot make the ring stick to your body.");
2189 You("
\8ew
\97Ö
\82ð
\82Í
\82ß
\82ç
\82ê
\82È
\82¢
\91Ì
\82¾
\81D");
2192 if (uleft && uright) {
2194 There("are no more %s%s to fill.",
2195 humanoid(youmonst.data) ? "ring-" : "",
2196 makeplural(body_part(FINGER)));
2198 pline("
\82Í
\82ß
\82é
\82±
\82Æ
\82Ì
\82Å
\82«
\82é%s%s
\82ª
\82È
\82¢
\81D",
2199 humanoid(youmonst.data) ? "
\96ò" : "",
2206 } else if (uright) {
2211 Sprintf(qbuf, "Which %s%s, Right or Left?",
2212 humanoid(youmonst.data) ? "ring-" : "",
2215 Sprintf(qbuf, "
\82Ç
\82¿
\82ç
\82Ì%s%s
\81C
\89E(r)
\82»
\82ê
\82Æ
\82à
\8d¶(l)
\81H",
2216 humanoid(youmonst.data) ? "
\96ò" : "",
2219 answer = yn_function(qbuf, "rl", '\0');
2234 if (uarmg && uarmg->cursed) {
2235 res = !uarmg->bknown;
2238 You("cannot remove your gloves to put on the ring.");
2240 You("
\8ew
\97Ö
\82ð
\82Í
\82ß
\82æ
\82¤
\82Æ
\82µ
\82½
\82ª
\8f¬
\8eè
\82ª
\92E
\82°
\82È
\82¢
\81D");
2241 return res; /* uses move iff we learned gloves are cursed */
2244 res = !uwep->bknown; /* check this before calling welded() */
2245 if ((mask == RIGHT_RING || bimanual(uwep)) && welded(uwep)) {
2246 const char *hand = body_part(HAND);
2248 /* welded will set bknown */
2250 hand = makeplural(hand);
2252 You("cannot free your weapon %s to put on the ring.",
2254 You("
\8ew
\97Ö
\82ð
\82Í
\82ß
\82æ
\82¤
\82Æ
\82µ
\82½
\82ª
\97\98%s
\82Ì
\8e©
\97R
\82ª
\82«
\82©
\82È
\82¢
\81D",
2256 return res; /* uses move iff we learned weapon is cursed */
2259 } else if (obj->oclass == AMULET_CLASS) {
2262 already_wearing("an amulet");
2264 already_wearing("
\96\82\8f\9c\82¯", uamul);
2268 } else if (eyewear) {
2270 if (ublindf->otyp == TOWEL)
2272 Your("%s is already covered by a towel.",
2275 You("
\8aù
\82É
\83^
\83I
\83\8b\82ð
\90g
\82É
\82Â
\82¯
\82Ä
\82¢
\82é
\81D");
2277 else if (ublindf->otyp == BLINDFOLD) {
2278 if (obj->otyp == LENSES)
2280 already_wearing2("lenses", "a blindfold");
2282 already_wearing2("
\83\8c\83\93\83Y", "
\96Ú
\89B
\82µ");
2285 already_wearing("a blindfold");
2287 already_wearing("
\96Ú
\89B
\82µ", ublindf);
2289 } else if (ublindf->otyp == LENSES) {
2290 if (obj->otyp == BLINDFOLD)
2292 already_wearing2("a blindfold", "some lenses");
2294 already_wearing2("
\96Ú
\89B
\82µ", "
\83\8c\83\93\83Y");
2297 already_wearing("some lenses");
2299 already_wearing("
\83\8c\83\93\83Y", ublindf);
2303 already_wearing(something); /* ??? */
2305 already_wearing("
\89½
\82©", ublindf); /* ??? */
2311 /* neither armor nor accessory */
2313 You_cant("wear that!");
2315 You_cant("
\82»
\82ê
\82ð
\90g
\82É
\82Â
\82¯
\82ç
\82ê
\82È
\82¢
\81I");
2320 if (!retouch_object(&obj, FALSE))
2321 return 1; /* costs a turn even though it didn't get worn */
2326 obj->known = 1; /* since AC is shown on the status line */
2327 /* if the armor is wielded, release it for wearing */
2328 if (obj->owornmask & W_WEAPON)
2329 remove_worn_item(obj, FALSE);
2331 delay = -objects[obj->otyp].oc_delay;
2335 multi_reason = "dressing up";
2337 multi_reason = "
\91\95\94õ
\82µ
\82Ä
\82¢
\82é
\8e\9e\82É";
2339 afternmv = Boots_on;
2341 afternmv = Helmet_on;
2343 afternmv = Gloves_on;
2345 afternmv = Armor_on;
2347 nomovemsg = "You finish your dressing maneuver.";
2349 nomovemsg = "
\91\95\94õ
\82µ
\8fI
\82¦
\82½
\81D";
2359 context.takeoff.mask = context.takeoff.what = 0L;
2360 } else { /* not armor */
2361 boolean give_feedback = FALSE;
2363 /* [releasing wielded accessory handled in Xxx_on()] */
2367 give_feedback = TRUE;
2368 } else if (obj->oclass == AMULET_CLASS) {
2369 setworn(obj, W_AMUL);
2371 /* no feedback here if amulet of change got used up */
2372 give_feedback = (uamul != 0);
2373 } else if (eyewear) {
2374 /* setworn() handled by Blindf_on() */
2376 /* message handled by Blindf_on(); leave give_feedback False */
2378 /* feedback for ring or for amulet other than 'change' */
2379 if (give_feedback && is_worn(obj))
2380 prinv((char *) 0, obj, 0L);
2385 /* the 'W' command */
2391 /* cantweararm() checks for suits of armor, not what we want here;
2392 verysmall() or nohands() checks for shields, gloves, etc... */
2393 if (verysmall(youmonst.data) || nohands(youmonst.data)) {
2395 pline("Don't even bother.");
2397 pline("
\82»
\82ñ
\82È
\82Â
\82Ü
\82ç
\82È
\82¢
\82±
\82Æ
\82É
\82±
\82¾
\82í
\82é
\82È
\81D");
2400 if (uarm && uarmu && uarmc && uarmh && uarms && uarmg && uarmf
2401 && uleft && uright && uamul && ublindf) {
2402 /* 'W' message doesn't mention accessories */
2404 You("are already wearing a full complement of armor.");
2406 You("
\82·
\82Å
\82É
\8a®
\91S
\91\95\94õ
\82µ
\82Ä
\82¢
\82é
\81D");
2409 otmp = getobj(clothes, "wear");
2410 return otmp ? accessory_or_armor_on(otmp) : 0;
2413 /* the 'P' command */
2419 if (uleft && uright && uamul && ublindf
2420 && uarm && uarmu && uarmc && uarmh && uarms && uarmg && uarmf) {
2421 /* 'P' message doesn't mention armor */
2423 Your("%s%s are full, and you're already wearing an amulet and %s.",
2424 humanoid(youmonst.data) ? "ring-" : "",
2425 makeplural(body_part(FINGER)),
2426 (ublindf->otyp == LENSES) ? "some lenses" : "a blindfold");
2428 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",
2429 humanoid(youmonst.data) ? "
\96ò" : "",
2431 ublindf->otyp==LENSES ? "
\83\8c\83\93\83Y" : "
\96Ú
\89B
\82µ");
2435 otmp = getobj(accessories, "put on");
2436 return otmp ? accessory_or_armor_on(otmp) : 0;
2439 /* calculate current armor class */
2443 int uac = mons[u.umonnum].ac; /* base armor class for current form */
2445 /* armor class from worn gear */
2447 uac -= ARM_BONUS(uarm);
2449 uac -= ARM_BONUS(uarmc);
2451 uac -= ARM_BONUS(uarmh);
2453 uac -= ARM_BONUS(uarmf);
2455 uac -= ARM_BONUS(uarms);
2457 uac -= ARM_BONUS(uarmg);
2459 uac -= ARM_BONUS(uarmu);
2460 if (uleft && uleft->otyp == RIN_PROTECTION)
2462 if (uright && uright->otyp == RIN_PROTECTION)
2465 /* armor class from other sources */
2466 if (HProtection & INTRINSIC)
2468 uac -= u.uspellprot;
2470 /* [The magic binary numbers 127 and -128 should be replaced with the
2471 * mystic decimal numbers 99 and -99 which require no explanation to
2472 * the uninitiated and would cap the width of a status line value at
2473 * one less character.]
2476 uac = -128; /* u.uac is an schar */
2478 uac = 127; /* for completeness */
2489 register struct obj *otmp;
2491 boolean leftfall, rightfall, wastwoweap = FALSE;
2492 const char *otherwep = 0, *thiswep, *which, *hand;
2494 leftfall = (uleft && !uleft->cursed
2495 && (!uwep || !welded(uwep) || !bimanual(uwep)));
2496 rightfall = (uright && !uright->cursed && (!welded(uwep)));
2497 if (!uarmg && (leftfall || rightfall) && !nolimbs(youmonst.data)) {
2498 /* changed so cursed rings don't fall off, GAN 10/30/86 */
2500 Your("%s off your %s.",
2501 (leftfall && rightfall) ? "rings slip" : "ring slips",
2502 (leftfall && rightfall) ? makeplural(body_part(FINGER))
2503 : body_part(FINGER));
2505 Your("
\8ew
\97Ö
\82Í%s
\82©
\82ç
\8a\8a\82è
\97\8e\82¿
\82½
\81D", body_part(FINGER));
2521 if (u.twoweap && otmp) {
2522 /* secondary weapon doesn't need nearly as much handling as
2523 primary; when in two-weapon mode, we know it's one-handed
2524 with something else in the other hand and also that it's
2525 a weapon or weptool rather than something unusual, plus
2526 we don't need to compare its type with the primary */
2527 otherwep = is_sword(otmp) ? c_sword : weapon_descr(otmp);
2528 if (otmp->quan > 1L)
2529 otherwep = makeplural(otherwep);
2530 hand = body_part(HAND);
2536 Your("%s %s%s from your %s%s.", otherwep, xfl ? "also " : "",
2537 otense(otmp, "slip"), which, hand);
2539 You("%s%s%s%s
\82©
\82ç
\8a\8a\82è
\97\8e\82Æ
\82µ
\82½
\81D", otherwep, xfl ? "
\82à
\82Ü
\82½" : "
\82ð",
2540 which, body_part(HAND));
2544 setuswapwep((struct obj *) 0); /* clears u.twoweap */
2545 if (canletgo(otmp, ""))
2549 if (otmp && !welded(otmp)) {
2550 long savequan = otmp->quan;
2552 /* nice wording if both weapons are the same type */
2553 thiswep = is_sword(otmp) ? c_sword : weapon_descr(otmp);
2554 if (otherwep && strcmp(thiswep, makesingular(otherwep)))
2556 if (otmp->quan > 1L) {
2557 /* most class names for unconventional wielded items
2558 are ok, but if wielding multiple apples or rations
2559 we don't want "your foods slip", so force non-corpse
2560 food to be singular; skipping makeplural() isn't
2561 enough--we need to fool otense() too */
2562 if (!strcmp(thiswep, "food"))
2565 thiswep = makeplural(thiswep);
2567 hand = body_part(HAND);
2570 hand = makeplural(hand);
2571 else if (wastwoweap)
2573 which = "right "; /* preceding msg was about left */
2575 which = "
\89E"; /* preceding msg was about left */
2578 pline("%s %s%s %s%s from your %s%s.",
2579 !strncmp(thiswep, "corpse", 6) ? "The" : "Your",
2580 otherwep ? "other " : "", thiswep, xfl ? "also " : "",
2581 otense(otmp, "slip"), which, hand);
2583 You("%s%s%s%s%s
\82©
\82ç
\8a\8a\82è
\97\8e\82Æ
\82µ
\82½
\81D",
2584 otherwep ? "
\82à
\82¤
\82Ð
\82Æ
\82Â
\82Ì" : "", thiswep,
2585 xfl ? "
\82à
\82Ü
\82½" : "
\82ð",
2586 which, body_part(HAND));
2589 otmp->quan = savequan;
2590 setuwep((struct obj *) 0);
2591 if (canletgo(otmp, ""))
2598 struct monst *victim;
2600 register struct obj *otmph, *otmp;
2602 otmph = (victim == &youmonst) ? uarmc : which_armor(victim, W_ARMC);
2604 otmph = (victim == &youmonst) ? uarm : which_armor(victim, W_ARM);
2606 otmph = (victim == &youmonst) ? uarmu : which_armor(victim, W_ARMU);
2608 otmp = (victim == &youmonst) ? uarmh : which_armor(victim, W_ARMH);
2609 if (otmp && (!otmph || !rn2(4)))
2611 otmp = (victim == &youmonst) ? uarmg : which_armor(victim, W_ARMG);
2612 if (otmp && (!otmph || !rn2(4)))
2614 otmp = (victim == &youmonst) ? uarmf : which_armor(victim, W_ARMF);
2615 if (otmp && (!otmph || !rn2(4)))
2617 otmp = (victim == &youmonst) ? uarms : which_armor(victim, W_ARMS);
2618 if (otmp && (!otmph || !rn2(4)))
2623 /* used for praying to check and fix levitation trouble */
2625 stuck_ring(ring, otyp)
2629 if (ring != uleft && ring != uright) {
2630 impossible("stuck_ring: neither left nor right?");
2631 return (struct obj *) 0;
2634 if (ring && ring->otyp == otyp) {
2635 /* reasons ring can't be removed match those checked by select_off();
2636 limbless case has extra checks because ordinarily it's temporary */
2637 if (nolimbs(youmonst.data) && uamul
2638 && uamul->otyp == AMULET_OF_UNCHANGING && uamul->cursed)
2640 if (welded(uwep) && (ring == uright || bimanual(uwep)))
2642 if (uarmg && uarmg->cursed)
2647 /* either no ring or not right type or nothing prevents its removal */
2648 return (struct obj *) 0;
2651 /* also for praying; find worn item that confers "Unchanging" attribute */
2655 if (uamul && uamul->otyp == AMULET_OF_UNCHANGING)
2663 register struct obj *otmp;
2670 *buf = '\0'; /* lint suppression */
2672 /* special ring checks */
2673 if (otmp == uright || otmp == uleft) {
2674 if (nolimbs(youmonst.data)) {
2676 pline_The("ring is stuck.");
2678 pline("
\8ew
\97Ö
\82Í
\91Ì
\82É
\96\84\82Ü
\82Á
\82Ä
\82µ
\82Ü
\82Á
\82Ä
\82¢
\82é
\81D");
2682 why = 0; /* the item which prevents ring removal */
2683 if (welded(uwep) && (otmp == uright || bimanual(uwep))) {
2685 Sprintf(buf, "free a weapon %s", body_part(HAND));
2687 Sprintf(buf, "
\97\98\98r
\82Ì
\8e©
\97R
\82ª
\82«
\82©
\82È
\82¢");
2689 } else if (uarmg && uarmg->cursed) {
2691 Sprintf(buf, "take off your %s", c_gloves);
2693 Sprintf(buf, "%s
\82ª
\92E
\82°
\82È
\82¢", c_gloves);
2698 You("cannot %s to remove the ring.", buf);
2700 You("
\8ew
\97Ö
\82ð
\82Í
\82¸
\82»
\82¤
\82Æ
\82µ
\82½
\82ª%s
\81D", buf);
2705 /* special glove checks */
2706 if (otmp == uarmg) {
2709 You("are unable to take off your %s while wielding that %s.",
2710 c_gloves, is_sword(uwep) ? c_sword : c_weapon);
2712 You("%s
\82ð
\8e\9d\82Á
\82½
\82Ü
\82Ü%s
\82ð
\82Í
\82¸
\82·
\82±
\82Æ
\82Í
\82Å
\82«
\82È
\82¢
\81D",
2713 is_sword(uwep) ? c_sword : c_weapon, c_gloves);
2715 uwep->bknown = TRUE;
2719 You_cant("take off the slippery %s with your slippery %s.",
2720 c_gloves, makeplural(body_part(FINGER)));
2722 You_cant("
\8a\8a\82è
\82â
\82·
\82¢%s
\82ð
\8a\8a\82è
\82â
\82·
\82¢%s
\82Å
\82Í
\82¸
\82¹
\82È
\82¢
\81D",
2723 c_gloves, body_part(FINGER));
2728 /* special boot checks */
2729 if (otmp == uarmf) {
2730 if (u.utrap && u.utraptype == TT_BEARTRAP) {
2732 pline_The("bear trap prevents you from pulling your %s out.",
2734 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",
2737 } else if (u.utrap && u.utraptype == TT_INFLOOR) {
2739 You("are stuck in the %s, and cannot pull your %s out.",
2741 You("%s
\82ª%s
\82É
\82Í
\82Ü
\82Á
\82Ä
\82¢
\82é
\82Ì
\82Å
\92E
\82®
\82±
\82Æ
\82ª
\82Å
\82«
\82È
\82¢
\81D",
2742 surface(u.ux, u.uy), makeplural(body_part(FOOT)));
2746 /* special suit and shirt checks */
2747 if (otmp == uarm || otmp == uarmu) {
2748 why = 0; /* the item which prevents disrobing */
2749 if (uarmc && uarmc->cursed) {
2751 Sprintf(buf, "remove your %s", cloak_simple_name(uarmc));
2753 Sprintf(buf, "%s
\82ª
\92E
\82°
\82È
\82¢", cloak_simple_name(uarmc));
2755 } else if (otmp == uarmu && uarm && uarm->cursed) {
2757 Sprintf(buf, "remove your %s", c_suit);
2759 Sprintf(buf, "%s
\82ª
\92E
\82°
\82È
\82¢", c_suit);
2761 } else if (welded(uwep) && bimanual(uwep)) {
2763 Sprintf(buf, "release your %s",
2764 is_sword(uwep) ? c_sword : (uwep->otyp == BATTLE_AXE)
2768 Sprintf(buf, "%s
\82ª
\8eè
\95ú
\82¹
\82È
\82¢",
2769 is_sword(uwep) ? c_sword : (uwep->otyp == BATTLE_AXE)
2777 You("cannot %s to take off %s.", buf, the(xname(otmp)));
2779 You("%s
\82ð
\82Í
\82¸
\82»
\82¤
\82Æ
\82µ
\82½
\82ª%s
\81D", xname(otmp), buf);
2784 /* basic curse check */
2785 if (otmp == uquiver || (otmp == uswapwep && !u.twoweap)) {
2786 ; /* some items can be removed even when cursed */
2788 /* otherwise, this is fundamental */
2794 context.takeoff.mask |= WORN_ARMOR;
2795 else if (otmp == uarmc)
2796 context.takeoff.mask |= WORN_CLOAK;
2797 else if (otmp == uarmf)
2798 context.takeoff.mask |= WORN_BOOTS;
2799 else if (otmp == uarmg)
2800 context.takeoff.mask |= WORN_GLOVES;
2801 else if (otmp == uarmh)
2802 context.takeoff.mask |= WORN_HELMET;
2803 else if (otmp == uarms)
2804 context.takeoff.mask |= WORN_SHIELD;
2805 else if (otmp == uarmu)
2806 context.takeoff.mask |= WORN_SHIRT;
2807 else if (otmp == uleft)
2808 context.takeoff.mask |= LEFT_RING;
2809 else if (otmp == uright)
2810 context.takeoff.mask |= RIGHT_RING;
2811 else if (otmp == uamul)
2812 context.takeoff.mask |= WORN_AMUL;
2813 else if (otmp == ublindf)
2814 context.takeoff.mask |= WORN_BLINDF;
2815 else if (otmp == uwep)
2816 context.takeoff.mask |= W_WEP;
2817 else if (otmp == uswapwep)
2818 context.takeoff.mask |= W_SWAPWEP;
2819 else if (otmp == uquiver)
2820 context.takeoff.mask |= W_QUIVER;
2823 impossible("select_off: %s???", doname(otmp));
2828 STATIC_OVL struct obj *
2831 struct obj *otmp = (struct obj *) 0;
2832 struct takeoff_info *doff = &context.takeoff;
2834 context.takeoff.mask |= I_SPECIAL; /* set flag for cancel_doff() */
2835 if (doff->what == W_WEP) {
2836 if (!cursed(uwep)) {
2837 setuwep((struct obj *) 0);
2839 You("are empty %s.", body_part(HANDED));
2841 You("
\89½
\82à%s
\82É
\82µ
\82Ä
\82¢
\82È
\82¢
\81D", body_part(HAND));
2844 } else if (doff->what == W_SWAPWEP) {
2845 setuswapwep((struct obj *) 0);
2847 You("no longer have a second weapon readied.");
2849 You("
\97\
\94õ
\82Ì
\95\90\8aí
\82ð
\82¨
\82³
\82ß
\82½
\81D");
2851 } else if (doff->what == W_QUIVER) {
2852 setuqwep((struct obj *) 0);
2854 You("no longer have ammunition readied.");
2856 You("
\8f\80\94õ
\82µ
\82½
\96î
\92e
\82ð
\82¨
\82³
\82ß
\82½
\81D");
2857 } else if (doff->what == WORN_ARMOR) {
2861 } else if (doff->what == WORN_CLOAK) {
2865 } else if (doff->what == WORN_BOOTS) {
2869 } else if (doff->what == WORN_GLOVES) {
2872 (void) Gloves_off();
2873 } else if (doff->what == WORN_HELMET) {
2876 (void) Helmet_off();
2877 } else if (doff->what == WORN_SHIELD) {
2880 (void) Shield_off();
2881 } else if (doff->what == WORN_SHIRT) {
2885 } else if (doff->what == WORN_AMUL) {
2889 } else if (doff->what == LEFT_RING) {
2893 } else if (doff->what == RIGHT_RING) {
2897 } else if (doff->what == WORN_BLINDF) {
2898 if (!cursed(ublindf))
2899 Blindf_off(ublindf);
2901 impossible("do_takeoff: taking off %lx", doff->what);
2903 context.takeoff.mask &= ~I_SPECIAL; /* clear cancel_doff() flag */
2908 /* occupation callback for 'A' */
2914 register struct obj *otmp;
2915 struct takeoff_info *doff = &context.takeoff;
2918 if (doff->delay > 0) {
2920 return 1; /* still busy */
2922 if ((otmp = do_takeoff()) != 0)
2924 doff->mask &= ~doff->what;
2928 for (i = 0; takeoff_order[i]; i++)
2929 if (doff->mask & takeoff_order[i]) {
2930 doff->what = takeoff_order[i];
2934 otmp = (struct obj *) 0;
2937 if (doff->what == 0L) {
2939 You("finish %s.", doff->disrobing);
2941 You("
\91\95\94õ
\82ð
\89ð
\82«
\82¨
\82¦
\82½
\81D");
2943 } else if (doff->what == W_WEP) {
2945 } else if (doff->what == W_SWAPWEP) {
2947 } else if (doff->what == W_QUIVER) {
2949 } else if (doff->what == WORN_ARMOR) {
2951 /* If a cloak is being worn, add the time to take it off and put
2952 * it back on again. Kludge alert! since that time is 0 for all
2953 * known cloaks, add 1 so that it actually matters...
2956 doff->delay += 2 * objects[uarmc->otyp].oc_delay + 1;
2957 } else if (doff->what == WORN_CLOAK) {
2959 } else if (doff->what == WORN_BOOTS) {
2961 } else if (doff->what == WORN_GLOVES) {
2963 } else if (doff->what == WORN_HELMET) {
2965 } else if (doff->what == WORN_SHIELD) {
2967 } else if (doff->what == WORN_SHIRT) {
2969 /* add the time to take off and put back on armor and/or cloak */
2971 doff->delay += 2 * objects[uarm->otyp].oc_delay;
2973 doff->delay += 2 * objects[uarmc->otyp].oc_delay + 1;
2974 } else if (doff->what == WORN_AMUL) {
2976 } else if (doff->what == LEFT_RING) {
2978 } else if (doff->what == RIGHT_RING) {
2980 } else if (doff->what == WORN_BLINDF) {
2981 /* [this used to be 2, but 'R' (and 'T') only require 1 turn to
2982 remove a blindfold, so 'A' shouldn't have been requiring 2] */
2985 impossible("take_off: taking off %lx", doff->what);
2986 return 0; /* force done */
2990 doff->delay += objects[otmp->otyp].oc_delay;
2992 /* Since setting the occupation now starts the counter next move, that
2993 * would always produce a delay 1 too big per item unless we subtract
2994 * 1 here to account for it.
2996 if (doff->delay > 0)
2999 set_occupation(take_off, doff->disrobing, 0);
3000 return 1; /* get busy */
3003 /* clear saved context to avoid inappropriate resumption of interrupted 'A' */
3007 context.takeoff.what = context.takeoff.mask = 0L;
3008 context.takeoff.disrobing[0] = '\0';
3011 /* the 'A' command -- remove multiple worn items */
3017 if (context.takeoff.what || context.takeoff.mask) {
3019 You("continue %s.", context.takeoff.disrobing);
3021 You("
\91\95\94õ
\82ð
\89ð
\82
\82Ì
\82ð
\8dÄ
\8aJ
\82µ
\82½
\81D");
3023 set_occupation(take_off, context.takeoff.disrobing, 0);
3025 set_occupation(take_off, "
\91\95\94õ
\82ð
\89ð
\82", 0);
3027 } else if (!uwep && !uswapwep && !uquiver && !uamul && !ublindf && !uleft
3028 && !uright && !wearing_armor()) {
3030 You("are not wearing anything.");
3032 You("
\89½
\82à
\91\95\94õ
\82µ
\82Ä
\82¢
\82È
\82¢
\81D");
3036 add_valid_menu_class(0); /* reset */
3037 if (flags.menu_style != MENU_TRADITIONAL
3038 || (result = ggetobj("take off", select_off, 0, FALSE,
3039 (unsigned *) 0)) < -1)
3040 result = menu_remarm(result);
3042 if (context.takeoff.mask) {
3043 #if 0 /*JP*//*
\93ú
\96{
\8cê
\82Å
\82Í
\8eg
\82í
\82È
\82¢*/
3044 /* default activity for armor and/or accessories,
3045 possibly combined with weapons */
3046 (void) strncpy(context.takeoff.disrobing, "disrobing", CONTEXTVERBSZ);
3047 /* specific activity when handling weapons only */
3048 if (!(context.takeoff.mask & ~W_WEAPON))
3049 (void) strncpy(context.takeoff.disrobing, "disarming",
3054 /* The time to perform the command is already completely accounted for
3055 * in take_off(); if we return 1, that would add an extra turn to each
3066 menu_item *pick_list;
3067 boolean all_worn_categories = TRUE;
3070 all_worn_categories = (retry == -2);
3071 } else if (flags.menu_style == MENU_FULL) {
3072 all_worn_categories = FALSE;
3074 n = query_category("What type of things do you want to take off?",
3076 n = query_category("
\82Ç
\82Ì
\83^
\83C
\83v
\82Ì
\95¨
\82Ì
\91\95\94õ
\82ð
\89ð
\82«
\82Ü
\82·
\82©
\81H",
3077 invent, (WORN_TYPES | ALL_TYPES
3078 | UNPAID_TYPES | BUCX_TYPES),
3079 &pick_list, PICK_ANY);
3082 for (i = 0; i < n; i++) {
3083 if (pick_list[i].item.a_int == ALL_TYPES_SELECTED)
3084 all_worn_categories = TRUE;
3086 add_valid_menu_class(pick_list[i].item.a_int);
3088 free((genericptr_t) pick_list);
3089 } else if (flags.menu_style == MENU_COMBINATION) {
3090 unsigned ggofeedback = 0;
3092 i = ggetobj("take off", select_off, 0, TRUE, &ggofeedback);
3093 if (ggofeedback & ALL_FINISHED)
3095 all_worn_categories = (i == -2);
3097 if (menu_class_present('u')
3098 || menu_class_present('B') || menu_class_present('U')
3099 || menu_class_present('C') || menu_class_present('X'))
3100 all_worn_categories = FALSE;
3103 n = query_objlist("What do you want to take off?", &invent,
3104 (SIGNAL_NOMENU | USE_INVLET | INVORDER_SORT),
3105 &pick_list, PICK_ANY,
3106 all_worn_categories ? is_worn : is_worn_by_type);
3108 n = query_objlist("
\82Ç
\82Ì
\91\95\94õ
\82ð
\89ð
\82«
\82Ü
\82·
\82©
\81H", &invent,
3109 (SIGNAL_NOMENU | USE_INVLET | INVORDER_SORT),
3110 &pick_list, PICK_ANY,
3111 all_worn_categories ? is_worn : is_worn_by_type);
3114 for (i = 0; i < n; i++)
3115 (void) select_off(pick_list[i].item.a_obj);
3116 free((genericptr_t) pick_list);
3117 } else if (n < 0 && flags.menu_style != MENU_COMBINATION) {
3119 There("is nothing else you can remove or unwield.");
3121 pline("
\91\95\94õ
\82ð
\89ð
\82¯
\82é
\82à
\82Ì
\82Í
\89½
\82à
\82È
\82¢
\81D");
3126 /* hit by destroy armor scroll/black dragon breath/monster spell */
3129 register struct obj *atmp;
3131 register struct obj *otmp;
3132 #define DESTROY_ARM(o) \
3133 ((otmp = (o)) != 0 && (!atmp || atmp == otmp) \
3134 && (!obj_resists(otmp, 0, 90)) \
3135 ? (otmp->in_use = TRUE) \
3138 if (DESTROY_ARM(uarmc)) {
3142 Your("%s crumbles and turns to dust!", cloak_simple_name(uarmc));
3144 Your("%s
\82Í
\95²
\81X
\82É
\82È
\82Á
\82½
\81I", cloak_simple_name(uarmc));
3147 } else if (DESTROY_ARM(uarm)) {
3151 Your("armor turns to dust and falls to the %s!", surface(u.ux, u.uy));
3153 Your("
\8aZ
\82Í
\90o
\82Æ
\82È
\82è%s
\82É
\97\8e\82¿
\82½
\81I", surface(u.ux,u.uy));
3154 (void) Armor_gone();
3156 } else if (DESTROY_ARM(uarmu)) {
3160 Your("shirt crumbles into tiny threads and falls apart!");
3162 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");
3165 } else if (DESTROY_ARM(uarmh)) {
3169 Your("%s turns to dust and is blown away!", helm_simple_name(uarmh));
3171 Your("%s
\82Í
\90o
\82Æ
\82È
\82è
\90\81\82«
\82Æ
\82ñ
\82¾
\81I", helm_simple_name(uarmh));
3172 (void) Helmet_off();
3174 } else if (DESTROY_ARM(uarmg)) {
3178 Your("gloves vanish!");
3180 Your("
\8f¬
\8eè
\82Í
\8fÁ
\82¦
\82½
\81I");
3181 (void) Gloves_off();
3186 selftouch("
\82»
\82Ì
\82Æ
\82«
\82 \82È
\82½
\82Í");
3187 } else if (DESTROY_ARM(uarmf)) {
3191 Your("boots disintegrate!");
3193 Your("
\8cC
\82Í
\95²
\81X
\82É
\8dÓ
\82¯
\82½
\81I");
3196 } else if (DESTROY_ARM(uarms)) {
3200 Your("shield crumbles away!");
3202 Your("
\8f\82\82Í
\8dÓ
\82¯
\8eU
\82Á
\82½
\81I");
3203 (void) Shield_off();
3206 return 0; /* could not destroy anything */
3215 adj_abon(otmp, delta)
3216 register struct obj *otmp;
3217 register schar delta;
3219 if (uarmg && uarmg == otmp && otmp->otyp == GAUNTLETS_OF_DEXTERITY) {
3221 makeknown(uarmg->otyp);
3222 ABON(A_DEX) += (delta);
3226 if (uarmh && uarmh == otmp && otmp->otyp == HELM_OF_BRILLIANCE) {
3228 makeknown(uarmh->otyp);
3229 ABON(A_INT) += (delta);
3230 ABON(A_WIS) += (delta);
3236 /* decide whether a worn item is covered up by some other worn item,
3237 used for dipping into liquid and applying grease;
3238 some criteria are different than select_off()'s */
3240 inaccessible_equipment(obj, verb, only_if_known_cursed)
3242 const char *verb; /* "dip" or "grease", or null to avoid messages */
3243 /*JP:
\93ú
\96{
\8cê
\82Å
\82Í "
\82ð
\90Z
\82·", "
\82É
\8e\89\82ð
\93h
\82é", null
\82Ì
\82¢
\82¸
\82ê
\82©*/
3244 boolean only_if_known_cursed; /* ignore covering unless known to be cursed */
3247 static NEARDATA const char need_to_take_off_outer_armor[] =
3248 "need to take off %s to %s %s.";
3249 #else /*JP:
\88ø
\90\94\82ª
\8c´
\95¶
\82Æ
\95Ï
\82í
\82Á
\82Ä
\82¢
\82é
\82±
\82Æ
\82É
\92\8d\88Ó*/
3250 static NEARDATA const char need_to_take_off_outer_armor[] =
3251 "%s%s
\82É
\82Í%s
\82ð%s
\95K
\97v
\82ª
\82 \82é
\81D";
3254 boolean anycovering = !only_if_known_cursed; /* more comprehensible... */
3255 #define BLOCKSACCESS(x) (anycovering || ((x)->cursed && (x)->bknown))
3257 if (!obj || !obj->owornmask)
3258 return FALSE; /* not inaccessible */
3260 /* check for suit covered by cloak */
3261 if (obj == uarm && uarmc && BLOCKSACCESS(uarmc)) {
3263 Strcpy(buf, yname(uarmc));
3265 You(need_to_take_off_outer_armor, buf, verb, yname(obj));
3266 #else /*JP:
\91Î
\8fÛ
\82Í
\83N
\83\8d\81[
\83N
\82È
\82Ì
\82Åjoffmsg
\82ð
\8eg
\82í
\82¸
\8c\88\82ß
\8c\82\82¿*/
3267 You(need_to_take_off_outer_armor, xname(obj), verb, buf, "
\92E
\82®");
3272 /* check for shirt covered by suit and/or cloak */
3274 && ((uarm && BLOCKSACCESS(uarm)) || (uarmc && BLOCKSACCESS(uarmc)))) {
3276 char cloaktmp[QBUFSZ], suittmp[QBUFSZ];
3277 /* if sameprefix, use yname and xname to get "your cloak and suit"
3278 or "Manlobbi's cloak and suit"; otherwise, use yname and yname
3279 to get "your cloak and Manlobbi's suit" or vice versa */
3280 boolean sameprefix = (uarm && uarmc
3281 && !strcmp(shk_your(cloaktmp, uarmc),
3282 shk_your(suittmp, uarm)));
3286 Strcat(buf, yname(uarmc));
3289 Strcat(buf, " and ");
3291 Strcat(buf, "
\82Æ");
3293 Strcat(buf, sameprefix ? xname(uarm) : yname(uarm));
3295 You(need_to_take_off_outer_armor, buf, verb, yname(obj));
3296 #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¿*/
3297 You(need_to_take_off_outer_armor, xname(obj), verb, buf, "
\92E
\82®");
3302 /* check for ring covered by gloves */
3303 if ((obj == uleft || obj == uright) && uarmg && BLOCKSACCESS(uarmg)) {
3305 Strcpy(buf, yname(uarmg));
3307 You(need_to_take_off_outer_armor, buf, verb, yname(obj));
3308 #else /*JP:
\91Î
\8fÛ
\82Í
\8f¬
\8eè
\82È
\82Ì
\82Åjoffmsg
\82ð
\8eg
\82í
\82¸
\8c\88\82ß
\8c\82\82¿*/
3309 You(need_to_take_off_outer_armor, xname(obj), verb, buf, "
\82Í
\82¸
\82·");
3314 /* item is not inaccessible */