1 /* NetHack 3.6 do_wear.c $NHDT-Date: 1551138255 2019/02/25 23:44:15 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.108 $ */
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 & FROMOUTSIDE)) {
246 makeknown(uarmf->otyp);
249 spoteffects(FALSE); /* for sink effect */
251 float_vs_flight(); /* maybe toggle (BFlying & I_SPECIAL) */
255 impossible(unknown_type, c_boots, uarmf->otyp);
257 uarmf->known = 1; /* boots' +/- evident because of status line AC */
264 struct obj *otmp = uarmf;
265 int otyp = otmp->otyp;
266 long oldprop = u.uprops[objects[otyp].oc_oprop].extrinsic & ~WORN_BOOTS;
268 context.takeoff.mask &= ~W_ARMF;
269 /* For levitation, float_down() returns if Levitation, so we
270 * must do a setworn() _before_ the levitation case.
272 setworn((struct obj *) 0, W_ARMF);
275 if (!Very_fast && !context.takeoff.cancelled_don) {
278 You_feel("yourself slow down%s.", Fast ? " a bit" : "");
280 You("%s
\82Ì
\82ë
\82
\82È
\82Á
\82½
\82æ
\82¤
\82È
\8bC
\82ª
\82µ
\82½
\81D", Fast ? "
\82¿
\82å
\82Á
\82Æ" : "");
283 case WATER_WALKING_BOOTS:
284 /* check for lava since fireproofed boots make it viable */
285 if ((is_pool(u.ux, u.uy) || is_lava(u.ux, u.uy))
286 && !Levitation && !Flying && !is_clinger(youmonst.data)
287 && !context.takeoff.cancelled_don
288 /* avoid recursive call to lava_effects() */
289 && !iflags.in_lava_effects) {
290 /* make boots known in case you survive the drowning */
296 toggle_stealth(otmp, oldprop, FALSE);
299 if (!oldprop && !(HFumbling & ~TIMEOUT))
300 HFumbling = EFumbling = 0;
302 case LEVITATION_BOOTS:
303 if (!oldprop && !HLevitation && !(BLevitation & FROMOUTSIDE)
304 && !context.takeoff.cancelled_don) {
305 (void) float_down(0L, 0L);
308 float_vs_flight(); /* maybe toggle (BFlying & I_SPECIAL) */
318 impossible(unknown_type, c_boots, otyp);
320 context.takeoff.cancelled_don = FALSE;
328 u.uprops[objects[uarmc->otyp].oc_oprop].extrinsic & ~WORN_CLOAK;
330 switch (uarmc->otyp) {
333 case CLOAK_OF_MAGIC_RESISTANCE:
337 case CLOAK_OF_PROTECTION:
338 makeknown(uarmc->otyp);
341 toggle_stealth(uarmc, oldprop, TRUE);
343 case CLOAK_OF_DISPLACEMENT:
344 toggle_displacement(uarmc, oldprop, TRUE);
347 /* Note: it's already being worn, so we have to cheat here. */
348 if ((HInvis || EInvis) && !Blind) {
351 You("can %s!", See_invisible ? "no longer see through yourself"
355 See_invisible ? "
\82 \82È
\82½
\82Í
\93§
\96¾
\82Å
\82È
\82
\82È
\82Á
\82½" :
356 "
\8e©
\95ª
\8e©
\90g
\82ª
\8c©
\82¦
\82é
\82æ
\82¤
\82É
\82È
\82Á
\82½");
360 case CLOAK_OF_INVISIBILITY:
361 /* since cloak of invisibility was worn, we know mummy wrapping
362 wasn't, so no need to check `oldprop' against blocked */
363 if (!oldprop && !HInvis && !Blind) {
364 makeknown(uarmc->otyp);
367 pline("Suddenly you can%s yourself.",
368 See_invisible ? " see through" : "not see");
370 pline("
\93Ë
\91R
\81C%s
\82È
\82Á
\82½
\81D",
371 See_invisible ? "
\82 \82È
\82½
\82Í
\93§
\96¾
\82É" : "
\8e©
\95ª
\8e©
\90g
\82ª
\8c©
\82¦
\82È
\82");
377 pline("%s very tightly.", Tobjnam(uarmc, "fit"));
379 pline("%s
\82Í
\82Æ
\82Ä
\82à
\82Ò
\82Á
\82¿
\82è
\8d\87\82¤
\81D",xname(uarmc));
381 /* Alchemy smock gives poison _and_ acid resistance */
383 EAcid_resistance |= WORN_CLOAK;
386 impossible(unknown_type, c_cloak, uarmc->otyp);
388 uarmc->known = 1; /* cloak's +/- evident because of status line AC */
395 struct obj *otmp = uarmc;
396 int otyp = otmp->otyp;
397 long oldprop = u.uprops[objects[otyp].oc_oprop].extrinsic & ~WORN_CLOAK;
399 context.takeoff.mask &= ~W_ARMC;
400 /* For mummy wrapping, taking it off first resets `Invisible'. */
401 setworn((struct obj *) 0, W_ARMC);
405 case CLOAK_OF_PROTECTION:
406 case CLOAK_OF_MAGIC_RESISTANCE:
412 toggle_stealth(otmp, oldprop, FALSE);
414 case CLOAK_OF_DISPLACEMENT:
415 toggle_displacement(otmp, oldprop, FALSE);
418 if (Invis && !Blind) {
421 You("can %s.", See_invisible ? "see through yourself"
422 : "no longer see yourself");
424 pline("%s
\81D", See_invisible ? "
\82 \82È
\82½
\82Í
\93§
\96¾
\82É
\82È
\82Á
\82½"
425 : "
\8e©
\95ª
\8e©
\90g
\82ª
\8c©
\82¦
\82È
\82
\82È
\82Á
\82½");
429 case CLOAK_OF_INVISIBILITY:
430 if (!oldprop && !HInvis && !Blind) {
431 makeknown(CLOAK_OF_INVISIBILITY);
434 pline("Suddenly you can %s.",
435 See_invisible ? "no longer see through yourself"
438 pline("
\93Ë
\91R
\81C%s
\81D",
439 See_invisible ? "
\82 \82È
\82½
\82Í
\93§
\96¾
\82Å
\82È
\82
\82È
\82Á
\82½"
440 : "
\8e©
\95ª
\8e©
\90g
\82ª
\8c©
\82¦
\82é
\82æ
\82¤
\82É
\82È
\82Á
\82½");
444 /* Alchemy smock gives poison _and_ acid resistance */
446 EAcid_resistance &= ~WORN_CLOAK;
449 impossible(unknown_type, c_cloak, otyp);
458 switch (uarmh->otyp) {
462 case ELVEN_LEATHER_HELM:
463 case DWARVISH_IRON_HELM:
465 case HELM_OF_TELEPATHY:
467 case HELM_OF_BRILLIANCE:
468 adj_abon(uarmh, uarmh->spe);
471 /* people think marked wizards know what they're talking
472 * about, but it takes trained arrogance to pull it off,
473 * and the actual enchantment of the hat is irrelevant.
475 ABON(A_CHA) += (Role_if(PM_WIZARD) ? 1 : -1);
477 makeknown(uarmh->otyp);
479 case HELM_OF_OPPOSITE_ALIGNMENT:
480 /* changing alignment can toggle off active artifact
481 properties, including levitation; uarmh could get
482 dropped or destroyed here */
483 uchangealign((u.ualign.type != A_NEUTRAL)
485 : (uarmh->o_id % 2) ? A_CHAOTIC : A_LAWFUL,
487 /* makeknown(uarmh->otyp); -- moved below, after xname() */
490 if (uarmh && !uarmh->cursed) {
493 pline("%s for a moment.", Tobjnam(uarmh, "vibrate"));
495 pline("%s
\82Í
\88ê
\8fu
\90k
\82¦
\82½
\81D", xname(uarmh));
498 pline("%s %s for a moment.", Tobjnam(uarmh, "glow"),
501 pline("%s
\82Í
\88ê
\8fu%s
\8bP
\82¢
\82½
\81D",
502 xname(uarmh), jconj_adj(hcolor(NH_BLACK)));
506 context.botl = 1; /* reveal new alignment or INT & WIS */
509 pline("My brain hurts!"); /* Monty Python's Flying Circus */
511 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Ç*/
513 } else if (uarmh && uarmh->otyp == DUNCE_CAP) {
515 You_feel("%s.", /* track INT change; ignore WIS */
517 <= (ABASE(A_INT) + ABON(A_INT) + ATEMP(A_INT))
518 ? "like sitting in a corner"
521 You("%s
\82æ
\82¤
\82È
\8bC
\82ª
\82µ
\82½
\81D",
523 <= (ABASE(A_INT) + ABON(A_INT) + ATEMP(A_INT))
524 ? "
\8b÷
\82Á
\82±
\82É
\8dÀ
\82Á
\82Ä
\82¢
\82é"
525 : "
\96Ú
\82ª
\82Ü
\82í
\82Á
\82½");
528 /* [message moved to uchangealign()] */
529 makeknown(HELM_OF_OPPOSITE_ALIGNMENT);
533 impossible(unknown_type, c_helmet, uarmh->otyp);
535 uarmh->known = 1; /* helmet's +/- evident because of status line AC */
540 Helmet_off(VOID_ARGS)
542 context.takeoff.mask &= ~W_ARMH;
544 switch (uarmh->otyp) {
548 case ELVEN_LEATHER_HELM:
549 case DWARVISH_IRON_HELM:
556 if (!context.takeoff.cancelled_don) {
557 ABON(A_CHA) += (Role_if(PM_WIZARD) ? -1 : 1);
561 case HELM_OF_TELEPATHY:
562 /* need to update ability before calling see_monsters() */
563 setworn((struct obj *) 0, W_ARMH);
566 case HELM_OF_BRILLIANCE:
567 if (!context.takeoff.cancelled_don)
568 adj_abon(uarmh, -uarmh->spe);
570 case HELM_OF_OPPOSITE_ALIGNMENT:
571 /* changing alignment can toggle off active artifact
572 properties, including levitation; uarmh could get
573 dropped or destroyed here */
574 uchangealign(u.ualignbase[A_CURRENT], 2);
577 impossible(unknown_type, c_helmet, uarmh->otyp);
579 setworn((struct obj *) 0, W_ARMH);
580 context.takeoff.cancelled_don = FALSE;
589 u.uprops[objects[uarmg->otyp].oc_oprop].extrinsic & ~WORN_GLOVES;
591 switch (uarmg->otyp) {
594 case GAUNTLETS_OF_FUMBLING:
595 if (!oldprop && !(HFumbling & ~TIMEOUT))
596 incr_itimeout(&HFumbling, rnd(20));
598 case GAUNTLETS_OF_POWER:
599 makeknown(uarmg->otyp);
600 context.botl = 1; /* taken care of in attrib.c */
602 case GAUNTLETS_OF_DEXTERITY:
603 adj_abon(uarmg, uarmg->spe);
606 impossible(unknown_type, c_gloves, uarmg->otyp);
608 uarmg->known = 1; /* gloves' +/- evident because of status line AC */
613 wielding_corpse(obj, voluntary)
615 boolean voluntary; /* taking gloves off on purpose? */
619 if (!obj || obj->otyp != CORPSE)
621 if (obj != uwep && (obj != uswapwep || !u.twoweap))
624 if (touch_petrifies(&mons[obj->corpsenm]) && !Stone_resistance) {
626 You("now wield %s in your bare %s.",
627 corpse_xname(obj, (const char *) 0, CXN_ARTICLE),
628 makeplural(body_part(HAND)));
630 You("%s
\82ð
\91f%s
\82Å
\8e\9d\82Á
\82½
\81D",
631 corpse_xname(obj, (const char *) 0, CXN_ARTICLE),
635 Sprintf(kbuf, "%s gloves while wielding %s",
636 voluntary ? "removing" : "losing", killer_xname(obj));
638 Sprintf(kbuf, "%s
\82ð
\8e\9d\82Á
\82Ä
\82¢
\82é
\82Æ
\82«
\82É
\8eè
\91Ü
\82ð%s",
639 killer_xname(obj), voluntary ? "
\8aO
\82µ
\82Ä" : "
\8e¸
\82Á
\82Ä");
642 /* life-saved; can't continue wielding cockatrice corpse though */
643 remove_worn_item(obj, FALSE);
648 Gloves_off(VOID_ARGS)
651 u.uprops[objects[uarmg->otyp].oc_oprop].extrinsic & ~WORN_GLOVES;
652 boolean on_purpose = !context.mon_moving && !uarmg->in_use;
654 context.takeoff.mask &= ~W_ARMG;
656 switch (uarmg->otyp) {
659 case GAUNTLETS_OF_FUMBLING:
660 if (!oldprop && !(HFumbling & ~TIMEOUT))
661 HFumbling = EFumbling = 0;
663 case GAUNTLETS_OF_POWER:
664 makeknown(uarmg->otyp);
665 context.botl = 1; /* taken care of in attrib.c */
667 case GAUNTLETS_OF_DEXTERITY:
668 if (!context.takeoff.cancelled_don)
669 adj_abon(uarmg, -uarmg->spe);
672 impossible(unknown_type, c_gloves, uarmg->otyp);
674 setworn((struct obj *) 0, W_ARMG);
675 context.takeoff.cancelled_don = FALSE;
676 (void) encumber_msg(); /* immediate feedback for GoP */
678 /* prevent wielding cockatrice when not wearing gloves */
679 if (uwep && uwep->otyp == CORPSE)
680 wielding_corpse(uwep, on_purpose);
682 /* KMH -- ...or your secondary weapon when you're wielding it
683 [This case can't actually happen; twoweapon mode won't
684 engage if a corpse has been set up as the alternate weapon.] */
685 if (u.twoweap && uswapwep && uswapwep->otyp == CORPSE)
686 wielding_corpse(uswapwep, on_purpose);
694 /* no shield currently requires special handling when put on, but we
695 keep this uncommented in case somebody adds a new one which does
696 [reflection is handled by setting u.uprops[REFLECTION].extrinsic
697 in setworn() called by armor_or_accessory_on() before Shield_on()] */
698 switch (uarms->otyp) {
701 case URUK_HAI_SHIELD:
703 case DWARVISH_ROUNDSHIELD:
705 case SHIELD_OF_REFLECTION:
708 impossible(unknown_type, c_shield, uarms->otyp);
710 uarms->known = 1; /* shield's +/- evident because of status line AC */
715 Shield_off(VOID_ARGS)
717 context.takeoff.mask &= ~W_ARMS;
719 /* no shield currently requires special handling when taken off, but we
720 keep this uncommented in case somebody adds a new one which does */
721 switch (uarms->otyp) {
724 case URUK_HAI_SHIELD:
726 case DWARVISH_ROUNDSHIELD:
728 case SHIELD_OF_REFLECTION:
731 impossible(unknown_type, c_shield, uarms->otyp);
734 setworn((struct obj *) 0, W_ARMS);
741 /* no shirt currently requires special handling when put on, but we
742 keep this uncommented in case somebody adds a new one which does */
743 switch (uarmu->otyp) {
748 impossible(unknown_type, c_shirt, uarmu->otyp);
750 uarmu->known = 1; /* shirt's +/- evident because of status line AC */
757 context.takeoff.mask &= ~W_ARMU;
759 /* no shirt currently requires special handling when taken off, but we
760 keep this uncommented in case somebody adds a new one which does */
761 switch (uarmu->otyp) {
766 impossible(unknown_type, c_shirt, uarmu->otyp);
769 setworn((struct obj *) 0, W_ARMU);
778 * No suits require special handling. Special properties conferred by
779 * suits are set up as intrinsics (actually 'extrinsics') by setworn()
780 * which is called by armor_or_accessory_on() before Armor_on().
782 uarm->known = 1; /* suit's +/- evident because of status line AC */
789 context.takeoff.mask &= ~W_ARM;
790 setworn((struct obj *) 0, W_ARM);
791 context.takeoff.cancelled_don = FALSE;
795 /* The gone functions differ from the off functions in that if you die from
796 * taking it off and have life saving, you still die. [Obsolete reference
797 * to lack of fire resistance being fatal in hell (nethack 3.0) and life
798 * saving putting a removed item back on to prevent that from immediately
804 context.takeoff.mask &= ~W_ARM;
806 context.takeoff.cancelled_don = FALSE;
813 /* make sure amulet isn't wielded; can't use remove_worn_item()
814 here because it has already been set worn in amulet slot */
816 setuwep((struct obj *) 0);
817 else if (uamul == uswapwep)
818 setuswapwep((struct obj *) 0);
819 else if (uamul == uquiver)
820 setuqwep((struct obj *) 0);
822 switch (uamul->otyp) {
824 case AMULET_OF_LIFE_SAVING:
825 case AMULET_VERSUS_POISON:
826 case AMULET_OF_REFLECTION:
827 case AMULET_OF_MAGICAL_BREATHING:
828 case FAKE_AMULET_OF_YENDOR:
830 case AMULET_OF_UNCHANGING:
832 make_slimed(0L, (char *) 0);
834 case AMULET_OF_CHANGE: {
835 int orig_sex = poly_gender();
840 /* Don't use same message as polymorph */
841 if (orig_sex != poly_gender()) {
842 makeknown(AMULET_OF_CHANGE);
844 You("are suddenly very %s!",
845 flags.female ? "feminine" : "masculine");
847 You("
\93Ë
\91R%s
\82Á
\82Û
\82
\82È
\82Á
\82½
\81I",
848 flags.female ? "
\8f\97" : "
\92j");
852 /* already polymorphed into single-gender monster; only
853 changed the character's base sex */
855 You("don't feel like yourself.");
857 You("
\8e©
\95ª
\8e©
\90g
\82¶
\82á
\82È
\82
\82È
\82Á
\82½
\8bC
\82ª
\82µ
\82½
\81D");
859 pline_The("amulet disintegrates!");
861 pline("
\96\82\8f\9c\82¯
\82Í
\82±
\82È
\82²
\82È
\82É
\82È
\82Á
\82½
\81I");
862 if (orig_sex == poly_gender() && uamul->dknown
863 && !objects[AMULET_OF_CHANGE].oc_name_known
864 && !objects[AMULET_OF_CHANGE].oc_uname)
869 case AMULET_OF_STRANGULATION:
870 if (can_be_strangled(&youmonst)) {
871 makeknown(AMULET_OF_STRANGULATION);
875 pline("It constricts your throat!");
877 pline("
\96\82\8f\9c\82¯
\82Í
\82 \82È
\82½
\82Ì
\8dA
\82ð
\8di
\82ß
\82Â
\82¯
\82½
\81I");
880 case AMULET_OF_RESTFUL_SLEEP: {
881 long newnap = (long) rnd(100), oldnap = (HSleepy & TIMEOUT);
883 /* avoid clobbering FROMOUTSIDE bit, which might have
884 gotten set by previously eating one of these amulets */
885 if (newnap < oldnap || oldnap == 0L)
886 HSleepy = (HSleepy & ~TIMEOUT) | newnap;
888 case AMULET_OF_YENDOR:
896 context.takeoff.mask &= ~W_AMUL;
898 switch (uamul->otyp) {
900 /* need to update ability before calling see_monsters() */
901 setworn((struct obj *) 0, W_AMUL);
904 case AMULET_OF_LIFE_SAVING:
905 case AMULET_VERSUS_POISON:
906 case AMULET_OF_REFLECTION:
907 case AMULET_OF_CHANGE:
908 case AMULET_OF_UNCHANGING:
909 case FAKE_AMULET_OF_YENDOR:
911 case AMULET_OF_MAGICAL_BREATHING:
913 /* HMagical_breathing must be set off
914 before calling drown() */
915 setworn((struct obj *) 0, W_AMUL);
916 if (!breathless(youmonst.data) && !amphibious(youmonst.data)
919 You("suddenly inhale an unhealthy amount of %s!",
922 You("
\93Ë
\91R
\81C
\91å
\97Ê
\82Ì%s
\82ð
\88ù
\82Ý
\8d\9e\82ñ
\82¾
\81I",
930 case AMULET_OF_STRANGULATION:
936 Your("%s is no longer constricted!", body_part(NECK));
938 pline("%s
\82ª
\8ay
\82É
\82È
\82Á
\82½
\81I", body_part(NECK));
941 You("can breathe more easily!");
943 You("
\8ay
\82É
\8cÄ
\8bz
\82Å
\82«
\82é
\82æ
\82¤
\82É
\82È
\82Á
\82½
\81I");
946 case AMULET_OF_RESTFUL_SLEEP:
947 setworn((struct obj *) 0, W_AMUL);
948 /* HSleepy = 0L; -- avoid clobbering FROMOUTSIDE bit */
949 if (!ESleepy && !(HSleepy & ~TIMEOUT))
950 HSleepy &= ~TIMEOUT; /* clear timeout bits */
952 case AMULET_OF_YENDOR:
955 setworn((struct obj *) 0, W_AMUL);
959 /* handle ring discovery; comparable to learnwand() */
961 learnring(ring, observed)
965 int ringtype = ring->otyp;
967 /* if effect was observeable then we usually discover the type */
969 /* if we already know the ring type which accomplishes this
970 effect (assumes there is at most one type for each effect),
971 mark this ring as having been seen (no need for makeknown);
972 otherwise if we have seen this ring, discover its type */
973 if (objects[ringtype].oc_name_known)
975 else if (ring->dknown)
977 #if 0 /* see learnwand() */
983 /* make enchantment of charged ring known (might be +0) and update
984 perm invent window if we've seen this ring and know its type */
985 if (ring->dknown && objects[ringtype].oc_name_known) {
986 if (objects[ringtype].oc_charged)
994 register struct obj *obj;
996 long oldprop = u.uprops[objects[obj->otyp].oc_oprop].extrinsic;
997 int old_attrib, which;
1000 /* make sure ring isn't wielded; can't use remove_worn_item()
1001 here because it has already been set worn in a ring slot */
1003 setuwep((struct obj *) 0);
1004 else if (obj == uswapwep)
1005 setuswapwep((struct obj *) 0);
1006 else if (obj == uquiver)
1007 setuqwep((struct obj *) 0);
1009 /* only mask out W_RING when we don't have both
1010 left and right rings of the same type */
1011 if ((oldprop & W_RING) != W_RING)
1014 switch (obj->otyp) {
1015 case RIN_TELEPORTATION:
1016 case RIN_REGENERATION:
1019 case RIN_AGGRAVATE_MONSTER:
1020 case RIN_POISON_RESISTANCE:
1021 case RIN_FIRE_RESISTANCE:
1022 case RIN_COLD_RESISTANCE:
1023 case RIN_SHOCK_RESISTANCE:
1025 case RIN_TELEPORT_CONTROL:
1027 case RIN_POLYMORPH_CONTROL:
1028 case RIN_FREE_ACTION:
1029 case RIN_SLOW_DIGESTION:
1030 case RIN_SUSTAIN_ABILITY:
1034 toggle_stealth(obj, oldprop, TRUE);
1039 case RIN_SEE_INVISIBLE:
1040 /* can now see invisible monsters */
1041 set_mimic_blocking(); /* do special mimic handling */
1044 if (Invis && !oldprop && !HSee_invisible && !Blind) {
1047 pline("Suddenly you are transparent, but there!");
1049 pline("
\93Ë
\91R
\93§
\96¾
\82É
\82È
\82Á
\82½
\81D
\82µ
\82©
\82µ
\91¶
\8dÝ
\82Í
\82µ
\82Ä
\82¢
\82é
\81I");
1050 learnring(obj, TRUE);
1053 case RIN_INVISIBILITY:
1054 if (!oldprop && !HInvis && !BInvis && !Blind) {
1055 learnring(obj, TRUE);
1057 self_invis_message();
1060 case RIN_LEVITATION:
1061 if (!oldprop && !HLevitation && !(BLevitation & FROMOUTSIDE)) {
1063 learnring(obj, TRUE);
1065 spoteffects(FALSE); /* for sinks */
1067 float_vs_flight(); /* maybe toggle (BFlying & I_SPECIAL) */
1070 case RIN_GAIN_STRENGTH:
1073 case RIN_GAIN_CONSTITUTION:
1079 old_attrib = ACURR(which);
1080 ABON(which) += obj->spe;
1081 observable = (old_attrib != ACURR(which));
1082 /* if didn't change, usually means ring is +0 but might
1083 be because nonzero couldn't go below min or above max;
1084 learn +0 enchantment if attribute value is not stuck
1085 at a limit [and ring has been seen and its type is
1086 already discovered, both handled by learnring()] */
1087 if (observable || !extremeattr(which))
1088 learnring(obj, observable);
1091 case RIN_INCREASE_ACCURACY: /* KMH */
1092 u.uhitinc += obj->spe;
1094 case RIN_INCREASE_DAMAGE:
1095 u.udaminc += obj->spe;
1097 case RIN_PROTECTION_FROM_SHAPE_CHAN:
1100 case RIN_PROTECTION:
1101 /* usually learn enchantment and discover type;
1102 won't happen if ring is unseen or if it's +0
1103 and the type hasn't been discovered yet */
1104 observable = (obj->spe != 0);
1105 learnring(obj, observable);
1107 find_ac(); /* updates botl */
1113 Ring_off_or_gone(obj, gone)
1114 register struct obj *obj;
1117 long mask = (obj->owornmask & W_RING);
1118 int old_attrib, which;
1121 context.takeoff.mask &= ~mask;
1122 if (!(u.uprops[objects[obj->otyp].oc_oprop].extrinsic & mask))
1123 impossible("Strange... I didn't know you had that ring.");
1127 setworn((struct obj *) 0, obj->owornmask);
1129 switch (obj->otyp) {
1130 case RIN_TELEPORTATION:
1131 case RIN_REGENERATION:
1134 case RIN_AGGRAVATE_MONSTER:
1135 case RIN_POISON_RESISTANCE:
1136 case RIN_FIRE_RESISTANCE:
1137 case RIN_COLD_RESISTANCE:
1138 case RIN_SHOCK_RESISTANCE:
1140 case RIN_TELEPORT_CONTROL:
1142 case RIN_POLYMORPH_CONTROL:
1143 case RIN_FREE_ACTION:
1144 case RIN_SLOW_DIGESTION:
1145 case RIN_SUSTAIN_ABILITY:
1149 toggle_stealth(obj, (EStealth & ~mask), FALSE);
1154 case RIN_SEE_INVISIBLE:
1155 /* Make invisible monsters go away */
1156 if (!See_invisible) {
1157 set_mimic_blocking(); /* do special mimic handling */
1161 if (Invisible && !Blind) {
1164 pline("Suddenly you cannot see yourself.");
1166 pline("
\93Ë
\91R
\81C
\8e©
\95ª
\8e©
\90g
\82ª
\8c©
\82¦
\82È
\82
\82È
\82Á
\82½
\81D");
1167 learnring(obj, TRUE);
1170 case RIN_INVISIBILITY:
1171 if (!Invis && !BInvis && !Blind) {
1174 Your("body seems to unfade%s.",
1175 See_invisible ? " completely" : "..");
1177 Your("
\91Ì
\82ª%s
\81D",
1178 See_invisible ? "
\8a®
\91S
\82É
\8c»
\82í
\82ê
\82½" : "
\8e\9f\91æ
\82É
\8c»
\82í
\82ê
\82Ä
\82«
\82½
\81D
\81D");
1180 learnring(obj, TRUE);
1183 case RIN_LEVITATION:
1184 if (!(BLevitation & FROMOUTSIDE)) {
1185 (void) float_down(0L, 0L);
1187 learnring(obj, TRUE);
1189 float_vs_flight(); /* maybe toggle (BFlying & I_SPECIAL) */
1192 case RIN_GAIN_STRENGTH:
1195 case RIN_GAIN_CONSTITUTION:
1201 old_attrib = ACURR(which);
1202 ABON(which) -= obj->spe;
1203 observable = (old_attrib != ACURR(which));
1204 /* same criteria as Ring_on() */
1205 if (observable || !extremeattr(which))
1206 learnring(obj, observable);
1209 case RIN_INCREASE_ACCURACY: /* KMH */
1210 u.uhitinc -= obj->spe;
1212 case RIN_INCREASE_DAMAGE:
1213 u.udaminc -= obj->spe;
1215 case RIN_PROTECTION:
1216 /* might have been put on while blind and we can now see
1217 or perhaps been forgotten due to amnesia */
1218 observable = (obj->spe != 0);
1219 learnring(obj, observable);
1221 find_ac(); /* updates botl */
1223 case RIN_PROTECTION_FROM_SHAPE_CHAN:
1224 /* If you're no longer protected, let the chameleons
1225 * change shape again -dgk
1236 Ring_off_or_gone(obj, FALSE);
1243 Ring_off_or_gone(obj, TRUE);
1250 boolean already_blind = Blind, changed = FALSE;
1252 /* blindfold might be wielded; release it for wearing */
1253 if (otmp->owornmask & W_WEAPON)
1254 remove_worn_item(otmp, FALSE);
1255 setworn(otmp, W_TOOL);
1258 if (Blind && !already_blind) {
1262 You_cant("see any more.");
1264 You("
\89½
\82à
\8c©
\82¦
\82È
\82
\82È
\82Á
\82½
\81D");
1265 /* set ball&chain variables before the hero goes blind */
1268 } else if (already_blind && !Blind) {
1270 /* "You are now wearing the Eyes of the Overworld." */
1271 if (u.uroleplay.blind) {
1272 /* this can only happen by putting on the Eyes of the Overworld;
1273 that shouldn't actually produce a permanent cure, but we
1274 can't let the "blind from birth" conduct remain intact */
1276 pline("For the first time in your life, you can see!");
1278 pline("
\90l
\90¶
\82Å
\8f\89\82ß
\82Ä
\81C
\96Ú
\82ª
\8c©
\82¦
\82é
\82æ
\82¤
\82É
\82È
\82Á
\82½
\81I");
1279 u.uroleplay.blind = FALSE;
1284 You("
\96Ú
\82ª
\8c©
\82¦
\82é
\82æ
\82¤
\82É
\82È
\82Á
\82½
\81I");
1287 toggle_blindness(); /* potion.c */
1295 boolean was_blind = Blind, changed = FALSE;
1298 impossible("Blindf_off without otmp");
1301 context.takeoff.mask &= ~W_TOOL;
1302 setworn((struct obj *) 0, otmp->owornmask);
1307 /* "still cannot see" makes no sense when removing lenses
1308 since they can't have been the cause of your blindness */
1309 if (otmp->otyp != LENSES)
1311 You("still cannot see.");
1313 You("
\82Ü
\82¾
\96Ú
\82ª
\8c©
\82¦
\82È
\82¢
\81D");
1315 changed = TRUE; /* !was_blind */
1316 /* "You were wearing the Eyes of the Overworld." */
1318 You_cant("see anything now!");
1320 You("
\8d¡
\82Í
\89½
\82à
\8c©
\82é
\82±
\82Æ
\82ª
\82Å
\82«
\82È
\82¢
\81I");
1321 /* set ball&chain variables before the hero goes blind */
1325 } else if (was_blind) {
1326 if (!gulp_blnd_check()) {
1327 changed = TRUE; /* !Blind */
1329 You("can see again.");
1331 You("
\82Ó
\82½
\82½
\82Ñ
\96Ú
\82ª
\8c©
\82¦
\82é
\82æ
\82¤
\82É
\82È
\82Á
\82½
\81D");
1335 toggle_blindness(); /* potion.c */
1339 /* called in moveloop()'s prologue to set side-effects of worn start-up items;
1340 also used by poly_obj() when a worn item gets transformed */
1343 struct obj *obj; /* if null, do all worn items; otherwise just obj itself */
1347 if (!obj ? ublindf != 0 : (obj == ublindf))
1348 (void) Blindf_on(ublindf);
1349 if (!obj ? uright != 0 : (obj == uright))
1350 (void) Ring_on(uright);
1351 if (!obj ? uleft != 0 : (obj == uleft))
1352 (void) Ring_on(uleft);
1353 if (!obj ? uamul != 0 : (obj == uamul))
1356 if (!obj ? uarmu != 0 : (obj == uarmu))
1358 if (!obj ? uarm != 0 : (obj == uarm))
1360 if (!obj ? uarmc != 0 : (obj == uarmc))
1362 if (!obj ? uarmf != 0 : (obj == uarmf))
1364 if (!obj ? uarmg != 0 : (obj == uarmg))
1366 if (!obj ? uarmh != 0 : (obj == uarmh))
1368 if (!obj ? uarms != 0 : (obj == uarms))
1371 initial_don = FALSE;
1374 /* check whether the target object is currently being put on (or taken off--
1375 also checks for doffing--[why?]) */
1380 boolean result = FALSE;
1382 /* 'W' (or 'P' used for armor) sets afternmv */
1385 else if (otmp == uarm)
1386 result = (afternmv == Armor_on);
1387 else if (otmp == uarmu)
1388 result = (afternmv == Shirt_on);
1389 else if (otmp == uarmc)
1390 result = (afternmv == Cloak_on);
1391 else if (otmp == uarmf)
1392 result = (afternmv == Boots_on);
1393 else if (otmp == uarmh)
1394 result = (afternmv == Helmet_on);
1395 else if (otmp == uarmg)
1396 result = (afternmv == Gloves_on);
1397 else if (otmp == uarms)
1398 result = (afternmv == Shield_on);
1403 /* check whether the target object is currently being taken off,
1404 so that stop_donning() and steal() can vary messages and doname()
1405 can vary "(being worn)" suffix */
1410 long what = context.takeoff.what;
1411 boolean result = FALSE;
1413 /* 'T' (or 'R' used for armor) sets afternmv, 'A' sets takeoff.what */
1415 result = (afternmv == Armor_off || what == WORN_ARMOR);
1416 else if (otmp == uarmu)
1417 result = (afternmv == Shirt_off || what == WORN_SHIRT);
1418 else if (otmp == uarmc)
1419 result = (afternmv == Cloak_off || what == WORN_CLOAK);
1420 else if (otmp == uarmf)
1421 result = (afternmv == Boots_off || what == WORN_BOOTS);
1422 else if (otmp == uarmh)
1423 result = (afternmv == Helmet_off || what == WORN_HELMET);
1424 else if (otmp == uarmg)
1425 result = (afternmv == Gloves_off || what == WORN_GLOVES);
1426 else if (otmp == uarms)
1427 result = (afternmv == Shield_off || what == WORN_SHIELD);
1428 /* these 1-turn items don't need 'afternmv' checks */
1429 else if (otmp == uamul)
1430 result = (what == WORN_AMUL);
1431 else if (otmp == uleft)
1432 result = (what == LEFT_RING);
1433 else if (otmp == uright)
1434 result = (what == RIGHT_RING);
1435 else if (otmp == ublindf)
1436 result = (what == WORN_BLINDF);
1437 else if (otmp == uwep)
1438 result = (what == W_WEP);
1439 else if (otmp == uswapwep)
1440 result = (what == W_SWAPWEP);
1441 else if (otmp == uquiver)
1442 result = (what == W_QUIVER);
1447 /* despite their names, cancel_don() and cancel_doff() both apply to both
1448 donning and doffing... */
1450 cancel_doff(obj, slotmask)
1454 /* Called by setworn() for old item in specified slot or by setnotworn()
1455 * for specified item. We don't want to call cancel_don() if we got
1456 * here via <X>_off() -> setworn((struct obj *)0) -> cancel_doff()
1457 * because that would stop the 'A' command from continuing with next
1458 * selected item. So do_takeoff() sets a flag in takeoff.mask for us.
1459 * [For taking off an individual item with 'T'/'R'/'w-', it doesn't
1460 * matter whether cancel_don() gets called here--the item has already
1461 * been removed by now.]
1463 if (!(context.takeoff.mask & I_SPECIAL) && donning(obj))
1464 cancel_don(); /* applies to doffing too */
1465 context.takeoff.mask &= ~slotmask;
1468 /* despite their names, cancel_don() and cancel_doff() both apply to both
1469 donning and doffing... */
1473 /* the piece of armor we were donning/doffing has vanished, so stop
1474 * wasting time on it (and don't dereference it when donning would
1477 context.takeoff.cancelled_don =
1478 (afternmv == Boots_on || afternmv == Helmet_on
1479 || afternmv == Gloves_on || afternmv == Armor_on);
1480 afternmv = (int NDECL((*))) 0;
1481 nomovemsg = (char *) 0;
1483 context.takeoff.delay = 0;
1484 context.takeoff.what = 0L;
1487 /* called by steal() during theft from hero; interrupt donning/doffing */
1489 stop_donning(stolenobj)
1490 struct obj *stolenobj; /* no message if stolenobj is already being doffing */
1497 for (otmp = invent; otmp; otmp = otmp->nobj)
1498 if ((otmp->owornmask & W_ARMOR) && donning(otmp))
1500 /* at most one item will pass donning() test at any given time */
1504 /* donning() returns True when doffing too; doffing() is more specific */
1505 putting_on = !doffing(otmp);
1506 /* cancel_don() looks at afternmv; it can also cancel doffing */
1508 /* don't want <armor>_on() or <armor>_off() being called
1509 by unmul() since the on or off action isn't completing */
1510 afternmv = (int NDECL((*))) 0;
1511 if (putting_on || otmp != stolenobj) {
1513 Sprintf(buf, "You stop %s %s.",
1514 putting_on ? "putting on" : "taking off",
1515 thesimpleoname(otmp));
1517 Sprintf(buf, "
\82 \82È
\82½
\82Í%s
\82ð%s
\82Ì
\82ð
\8e~
\82ß
\82½
\81D",
1518 thesimpleoname(otmp),
1519 putting_on ? "
\90g
\82É
\82Â
\82¯
\82é" : "
\8aO
\82·");
1522 buf[0] = '\0'; /* silently stop doffing stolenobj */
1523 result = -multi; /* remember this before calling unmul() */
1526 /* while putting on, item becomes worn immediately but side-effects are
1527 deferred until the delay expires; when interrupted, make it unworn
1528 (while taking off, item stays worn until the delay expires; when
1529 interrupted, leave it worn) */
1531 remove_worn_item(otmp, FALSE);
1536 /* both 'clothes' and 'accessories' now include both armor and accessories;
1537 TOOL_CLASS is for eyewear, FOOD_CLASS is for MEAT_RING */
1538 static NEARDATA const char clothes[] = {
1539 ARMOR_CLASS, RING_CLASS, AMULET_CLASS, TOOL_CLASS, FOOD_CLASS, 0
1541 static NEARDATA const char accessories[] = {
1542 RING_CLASS, AMULET_CLASS, TOOL_CLASS, FOOD_CLASS, ARMOR_CLASS, 0
1544 STATIC_VAR NEARDATA int Narmorpieces, Naccessories;
1546 /* assign values to Narmorpieces and Naccessories */
1548 count_worn_stuff(which, accessorizing)
1549 struct obj **which; /* caller wants this when count is 1 */
1550 boolean accessorizing;
1554 Narmorpieces = Naccessories = 0;
1556 #define MOREWORN(x,wtyp) do { if (x) { wtyp++; otmp = x; } } while (0)
1558 MOREWORN(uarmh, Narmorpieces);
1559 MOREWORN(uarms, Narmorpieces);
1560 MOREWORN(uarmg, Narmorpieces);
1561 MOREWORN(uarmf, Narmorpieces);
1562 /* for cloak/suit/shirt, we only count the outermost item so that it
1563 can be taken off without confirmation if final count ends up as 1 */
1565 MOREWORN(uarmc, Narmorpieces);
1567 MOREWORN(uarm, Narmorpieces);
1569 MOREWORN(uarmu, Narmorpieces);
1571 *which = otmp; /* default item iff Narmorpieces is 1 */
1574 MOREWORN(uleft, Naccessories);
1575 MOREWORN(uright, Naccessories);
1576 MOREWORN(uamul, Naccessories);
1577 MOREWORN(ublindf, Naccessories);
1579 *which = otmp; /* default item iff Naccessories is 1 */
1583 /* take off one piece or armor or one accessory;
1584 shared by dotakeoff('T') and doremring('R') */
1586 armor_or_accessory_off(obj)
1593 if (!(obj->owornmask & (W_ARMOR | W_ACCESSORY))) {
1595 You("are not wearing that.");
1597 You("
\82»
\82ê
\82ð
\90g
\82É
\82Â
\82¯
\82Ä
\82¢
\82È
\82¢
\81D");
1601 || ((obj == uarm) && uarmc)
1602 || ((obj == uarmu) && (uarmc || uarm))) {
1603 char why[QBUFSZ], what[QBUFSZ];
1605 why[0] = what[0] = '\0';
1608 Strcat(what, cloak_simple_name(uarmc));
1609 if ((obj == uarmu) && uarm) {
1612 Strcat(what, " and ");
1614 Strcat(what, "
\82Æ");
1616 Strcat(what, suit_simple_name(uarm));
1619 Sprintf(why, " without taking off your %s first", what);
1621 Sprintf(why, "
\90æ
\82É%s
\82ð
\82Í
\82¸
\82³
\82È
\82¢
\82Æ", what);
1625 Strcpy(why, "; it's embedded");
1627 Strcpy(why, "
\82
\82Á
\82Â
\82¢
\82Ä
\82¢
\82é
\82Ì
\82Å");
1631 You_cant("take that off%s.", why);
1633 m = joffmsg(obj, &j);
1634 pline("%s
\82»
\82ê%s%s
\82±
\82Æ
\82Í
\82Å
\82«
\82È
\82¢
\81D", why, j, m);
1639 reset_remarm(); /* clear context.takeoff.mask and context.takeoff.what */
1640 (void) select_off(obj);
1641 if (!context.takeoff.mask)
1643 /* none of armoroff()/Ring_/Amulet/Blindf_off() use context.takeoff.mask */
1646 if (obj->owornmask & W_ARMOR) {
1647 (void) armoroff(obj);
1648 } else if (obj == uright || obj == uleft) {
1649 /* Sometimes we want to give the off_msg before removing and
1650 * sometimes after; for instance, "you were wearing a moonstone
1651 * ring (on right hand)" is desired but "you were wearing a
1652 * square amulet (being worn)" is not because of the redundant
1657 } else if (obj == uamul) {
1660 } else if (obj == ublindf) {
1661 Blindf_off(obj); /* does its own off_msg */
1663 impossible("removing strange accessory?");
1665 remove_worn_item(obj, FALSE);
1670 /* the 'T' command */
1674 struct obj *otmp = (struct obj *) 0;
1676 count_worn_stuff(&otmp, FALSE);
1677 if (!Narmorpieces && !Naccessories) {
1678 /* assert( GRAY_DRAGON_SCALES > YELLOW_DRAGON_SCALE_MAIL ); */
1681 pline_The("%s merged with your skin!",
1682 uskin->otyp >= GRAY_DRAGON_SCALES
1683 ? "dragon scales are"
1684 : "dragon scale mail is");
1686 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",
1687 uskin->otyp >= GRAY_DRAGON_SCALES
1692 pline("Not wearing any armor or accessories.");
1694 pline("
\8aZ
\82â
\91\95\8fü
\95i
\82ð
\90g
\82É
\82Â
\82¯
\82Ä
\82¢
\82È
\82¢
\81D");
1697 if (Narmorpieces != 1 || ParanoidRemove)
1698 otmp = getobj(clothes, "take off");
1702 return armor_or_accessory_off(otmp);
1705 /* the 'R' command */
1709 struct obj *otmp = 0;
1711 count_worn_stuff(&otmp, TRUE);
1712 if (!Naccessories && !Narmorpieces) {
1714 pline("Not wearing any accessories or armor.");
1716 pline("
\91\95\8fü
\95i
\82â
\8aZ
\82ð
\90g
\82É
\82Â
\82¯
\82Ä
\82¢
\82È
\82¢
\81D");
1719 if (Naccessories != 1 || ParanoidRemove)
1720 otmp = getobj(accessories, "remove");
1724 return armor_or_accessory_off(otmp);
1727 /* Check if something worn is cursed _and_ unremovable. */
1730 register struct obj *otmp;
1733 impossible("cursed without otmp");
1736 /* Curses, like chickens, come home to roost. */
1737 if ((otmp == uwep) ? welded(otmp) : (int) otmp->cursed) {
1739 boolean use_plural = (is_boots(otmp) || is_gloves(otmp)
1740 || otmp->otyp == LENSES || otmp->quan > 1L);
1742 You("can't. %s cursed.", use_plural ? "They are" : "It is");
1744 pline("
\96³
\97\9d\82¾
\81D
\82»
\82ê
\82Í
\8eô
\82í
\82ê
\82Ä
\82¢
\82é
\81D");
1746 otmp->bknown = TRUE;
1754 register struct obj *otmp;
1756 register int delay = -objects[otmp->otyp].oc_delay;
1763 multi_reason = "disrobing";
1765 multi_reason = "
\92E
\82¢
\82Å
\82¢
\82é
\8e\9e\82É";
1766 if (is_helmet(otmp)) {
1769 nomovemsg = !strcmp(helm_simple_name(otmp), "hat")
1771 nomovemsg = !strcmp(helm_simple_name(otmp), "
\96X
\8eq")
1773 ? "You finish taking off your hat."
1775 ? "
\82 \82È
\82½
\82Í
\8a\95\82ð
\92E
\82¬
\82¨
\82¦
\82½
\81D"
1777 : "You finish taking off your helmet.";
1779 : "
\82 \82È
\82½
\82Í
\96X
\8eq
\82ð
\92E
\82¬
\82¨
\82¦
\82½
\81D";
1780 afternmv = Helmet_off;
1781 } else if (is_gloves(otmp)) {
1783 nomovemsg = "You finish taking off your gloves.";
1785 nomovemsg = "
\82 \82È
\82½
\82Í
\8f¬
\8eè
\82ð
\92E
\82¬
\82¨
\82¦
\82½
\81D";
1786 afternmv = Gloves_off;
1787 } else if (is_boots(otmp)) {
1789 nomovemsg = "You finish taking off your boots.";
1791 nomovemsg = "
\82 \82È
\82½
\82Í
\8cC
\82ð
\92E
\82¬
\82¨
\82¦
\82½
\81D";
1792 afternmv = Boots_off;
1795 nomovemsg = "You finish taking off your suit.";
1797 nomovemsg = "
\82 \82È
\82½
\82Í
\92\85\82Ä
\82¢
\82é
\95¨
\82ð
\92E
\82¬
\82¨
\82¦
\82½
\81D";
1798 afternmv = Armor_off;
1801 /* Be warned! We want off_msg after removing the item to
1802 * avoid "You were wearing ____ (being worn)." However, an
1803 * item which grants fire resistance might cause some trouble
1804 * if removed in Hell and lifesaving puts it back on; in this
1805 * case the message will be printed at the wrong time (after
1806 * the messages saying you died and were lifesaved). Luckily,
1807 * no cloak, shield, or fast-removable armor grants fire
1808 * resistance, so we can safely do the off_msg afterwards.
1809 * Rings do grant fire resistance, but for rings we want the
1810 * off_msg before removal anyway so there's no problem. Take
1811 * care in adding armors granting fire resistance; this code
1812 * might need modification.
1813 * 3.2 (actually 3.1 even): that comment is obsolete since
1814 * fire resistance is not required for Gehennom so setworn()
1815 * doesn't force the resistance granting item to be re-worn
1816 * after being lifesaved anymore.
1820 else if (is_shield(otmp))
1821 (void) Shield_off();
1823 setworn((struct obj *) 0, otmp->owornmask & W_ARMOR);
1826 context.takeoff.mask = context.takeoff.what = 0L;
1831 **
\95¨
\82É
\82æ
\82Á
\82Ä
\93®
\8e\8c\82ª
\95Ï
\89»
\82·
\82é
\82Ì
\82Å otmp
\82ð
\92Ç
\89Á
1838 already_wearing(cc, otmp)
1846 m = jconj(jonmsg(otmp, &j), "
\82Ä
\82¢
\82é");
1849 You("are already wearing %s%c", cc, (cc == c_that_) ? '!' : '.');
1851 You("
\82à
\82¤%s%s%s%s", cc, j, m, (cc == c_that_) ? "
\81I" : "
\81D");
1855 already_wearing2(cc1, cc2)
1856 const char *cc1, *cc2;
1859 You_cant("wear %s because you're wearing %s there already.", cc1, cc2);
1861 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);
1865 * canwearobj checks to see whether the player can wear a piece of armor
1867 * inputs: otmp (the piece of armor)
1868 * noisy (if TRUE give error messages, otherwise be quiet about it)
1869 * output: mask (otmp's armor type)
1872 canwearobj(otmp, mask, noisy)
1884 /* this is the same check as for 'W' (dowear), but different message,
1885 in case we get here via 'P' (doputon) */
1886 if (verysmall(youmonst.data) || nohands(youmonst.data)) {
1889 You("can't wear any armor in your current form.");
1891 You("
\8c»
\8dÝ
\82Ì
\8ep
\82Å
\82Í
\96h
\8bï
\82ð
\90g
\82É
\82Â
\82¯
\82é
\82±
\82Æ
\82Í
\82Å
\82«
\82È
\82¢
\81D");
1895 which = is_cloak(otmp)
1902 if (which && cantweararm(youmonst.data)
1903 /* same exception for cloaks as used in m_dowear() */
1904 && (which != c_cloak || youmonst.data->msize != MZ_SMALL)
1905 && (racial_exception(&youmonst, otmp) < 1)) {
1908 pline_The("%s will not fit on your body.", which);
1910 pline("%s
\82Í
\82 \82È
\82½
\82Ì
\91Ì
\82É
\8d\87\82í
\82È
\82¢
\81D", which);
1912 } else if (otmp->owornmask & W_ARMOR) {
1915 already_wearing(c_that_);
1917 already_wearing(c_that_, otmp);
1922 if (welded(uwep) && bimanual(uwep) && (is_suit(otmp) || is_shirt(otmp))) {
1925 You("cannot do that while holding your %s.",
1927 pline("%s
\82ð
\8e\9d\82Á
\82½
\82Ü
\82Ü
\82Å
\82Í
\82»
\82ê
\82Í
\8fo
\97\88\82È
\82¢
\81D",
1928 is_sword(uwep) ? c_sword : c_weapon);
1932 if (is_helmet(otmp)) {
1936 already_wearing(an(helm_simple_name(uarmh)));
1938 already_wearing(helm_simple_name(uarmh), uarmh);
1941 } else if (Upolyd && has_horns(youmonst.data) && !is_flimsy(otmp)) {
1942 /* (flimsy exception matches polyself handling) */
1945 pline_The("%s won't fit over your horn%s.",
1946 helm_simple_name(otmp),
1947 plur(num_horns(youmonst.data)));
1949 pline("
\8ap
\82ª
\82¶
\82á
\82Ü
\82Å%s
\82ð
\90g
\82É
\82Â
\82¯
\82ç
\82ê
\82È
\82¢
\81D",
1950 helm_simple_name(otmp));
1955 } else if (is_shield(otmp)) {
1959 already_wearing(an(c_shield));
1961 already_wearing(c_shield, uarms);
1964 } else if (uwep && bimanual(uwep)) {
1967 You("cannot wear a shield while wielding a two-handed %s.",
1968 is_sword(uwep) ? c_sword : (uwep->otyp == BATTLE_AXE)
1973 m = jconj(jonmsg(uwep, &j), "
\82Ä
\82¢
\82é");
1974 You("
\97¼
\8eè
\8e\9d\82¿
\82Ì%s%s%s
\82Ì
\82Å
\8f\82\82Å
\90g
\82ð
\8eç
\82ê
\82È
\82¢
\81D",
1975 is_sword(uwep) ? c_sword :
1976 uwep->otyp == BATTLE_AXE ? c_axe : c_weapon,
1981 } else if (u.twoweap) {
1984 You("cannot wear a shield while wielding two weapons.");
1986 You("
\93ñ
\93\81\97¬
\82ð
\82µ
\82Ä
\82¢
\82é
\82Ì
\82Å
\8f\82\82Å
\90g
\82ð
\8eç
\82ê
\82È
\82¢
\81D");
1990 } else if (is_boots(otmp)) {
1994 already_wearing(c_boots);
1996 already_wearing(c_boots, uarmf);
1999 } else if (Upolyd && slithy(youmonst.data)) {
2002 You("have no feet..."); /* not body_part(FOOT) */
2004 You("
\91«
\82ª
\82È
\82¢
\81D
\81D
\81D"); /* not body_part(FOOT) */
2007 } else if (Upolyd && youmonst.data->mlet == S_CENTAUR) {
2008 /* break_armor() pushes boots off for centaurs,
2009 so don't let dowear() put them back on... */
2012 pline("You have too many hooves to wear %s.",
2013 c_boots); /* makeplural(body_part(FOOT)) yields
2014 "rear hooves" which sounds odd */
2016 pline("%s
\82ð
\97\9a\82
\82É
\82Í
\91«
\82ª
\91½
\82·
\82¬
\82é
\81D", c_boots);
2020 && (u.utraptype == TT_BEARTRAP || u.utraptype == TT_INFLOOR
2021 || u.utraptype == TT_LAVA
2022 || u.utraptype == TT_BURIEDBALL)) {
2023 if (u.utraptype == TT_BEARTRAP) {
2026 Your("%s is trapped!", body_part(FOOT));
2028 Your("%s
\82Íã©
\82É
\82©
\82©
\82Á
\82Ä
\82¢
\82é
\81I", body_part(FOOT));
2029 } else if (u.utraptype == TT_INFLOOR || u.utraptype == TT_LAVA) {
2032 Your("%s are stuck in the %s!",
2033 makeplural(body_part(FOOT)), surface(u.ux, u.uy));
2035 Your("%s
\82Í%s
\82É
\82Í
\82Ü
\82Á
\82Ä
\82¢
\82é
\81I",
2036 body_part(FOOT), surface(u.ux, u.uy));
2038 } else { /*TT_BURIEDBALL*/
2041 Your("%s is attached to the buried ball!",
2044 Your("%s
\82Í
\96\84\82Ü
\82Á
\82Ä
\82¢
\82é
\8b\85\82É
\82Â
\82È
\82ª
\82Á
\82Ä
\82¢
\82é
\81I",
2051 } else if (is_gloves(otmp)) {
2055 already_wearing(c_gloves);
2057 already_wearing(c_gloves, uarmg);
2060 } else if (welded(uwep)) {
2063 You("cannot wear gloves over your %s.",
2065 You("%s
\82Ì
\8fã
\82©
\82ç
\8f¬
\8eè
\82ð
\91\95\94õ
\82Å
\82«
\82È
\82¢
\81D",
2066 is_sword(uwep) ? c_sword : c_weapon);
2070 } else if (is_shirt(otmp)) {
2071 if (uarm || uarmc || uarmu) {
2075 already_wearing(an(c_shirt));
2077 already_wearing(c_shirt, uarmu);
2082 You_cant("wear that over your %s.",
2084 You("%s
\82Ì
\8fã
\82©
\82ç
\92\85\82é
\82±
\82Æ
\82Í
\82Å
\82«
\82È
\82¢
\81D",
2085 (uarm && !uarmc) ? c_armor
2086 : cloak_simple_name(uarmc));
2091 } else if (is_cloak(otmp)) {
2095 already_wearing(an(cloak_simple_name(uarmc)));
2097 already_wearing(cloak_simple_name(uarmc), otmp);
2101 } else if (is_suit(otmp)) {
2105 You("cannot wear armor over a %s.", cloak_simple_name(uarmc));
2107 You("%s
\82Ì
\8fã
\82©
\82ç
\92\85\82é
\82±
\82Æ
\82Í
\82Å
\82«
\82È
\82¢
\81D", cloak_simple_name(uarmc));
2112 already_wearing("some armor");
2114 already_wearing("
\8aZ", uarm);
2119 /* getobj can't do this after setting its allow_all flag; that
2120 happens if you have armor for slots that are covered up or
2121 extra armor for slots that are filled */
2124 silly_thing("wear", otmp);
2126 silly_thing("
\90g
\82É
\82Â
\82¯
\82é", otmp);
2129 /* Unnecessary since now only weapons and special items like pick-axes get
2130 * welded to your hand, not armor
2133 if (noisy) weldmsg(otmp);
2141 accessory_or_armor_on(obj)
2145 boolean armor, ring, eyewear;
2147 if (obj->owornmask & (W_ACCESSORY | W_ARMOR)) {
2149 already_wearing(c_that_);
2151 already_wearing(c_that_, obj);
2155 armor = (obj->oclass == ARMOR_CLASS);
2156 ring = (obj->oclass == RING_CLASS || obj->otyp == MEAT_RING);
2157 eyewear = (obj->otyp == BLINDFOLD || obj->otyp == TOWEL
2158 || obj->otyp == LENSES);
2159 /* checks which are performed prior to actually touching the item */
2161 if (!canwearobj(obj, &mask, TRUE))
2164 if (obj->otyp == HELM_OF_OPPOSITE_ALIGNMENT
2165 && qstart_level.dnum == u.uz.dnum) { /* in quest */
2166 if (u.ualignbase[A_CURRENT] == u.ualignbase[A_ORIGINAL])
2168 You("narrowly avoid losing all chance at your goal.");
2170 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");
2171 else /* converted */
2173 You("are suddenly overcome with shame and change your mind.");
2175 You("
\93Ë
\91R
\92p
\82¸
\82©
\82µ
\82
\82È
\82Á
\82Ä
\8dl
\82¦
\82ð
\95Ï
\82¦
\82½
\81D");
2176 u.ublessed = 0; /* lose your god's protection */
2177 makeknown(obj->otyp);
2178 context.botl = 1; /*for AC after zeroing u.ublessed */
2184 char answer, qbuf[QBUFSZ];
2187 if (nolimbs(youmonst.data)) {
2189 You("cannot make the ring stick to your body.");
2191 You("
\8ew
\97Ö
\82ð
\82Í
\82ß
\82ç
\82ê
\82È
\82¢
\91Ì
\82¾
\81D");
2194 if (uleft && uright) {
2196 There("are no more %s%s to fill.",
2197 humanoid(youmonst.data) ? "ring-" : "",
2198 makeplural(body_part(FINGER)));
2200 pline("
\82Í
\82ß
\82é
\82±
\82Æ
\82Ì
\82Å
\82«
\82é%s%s
\82ª
\82È
\82¢
\81D",
2201 humanoid(youmonst.data) ? "
\96ò" : "",
2208 } else if (uright) {
2213 Sprintf(qbuf, "Which %s%s, Right or Left?",
2214 humanoid(youmonst.data) ? "ring-" : "",
2217 Sprintf(qbuf, "
\82Ç
\82¿
\82ç
\82Ì%s%s
\81C
\89E(r)
\82»
\82ê
\82Æ
\82à
\8d¶(l)
\81H",
2218 humanoid(youmonst.data) ? "
\96ò" : "",
2221 answer = yn_function(qbuf, "rl", '\0');
2236 if (uarmg && uarmg->cursed) {
2237 res = !uarmg->bknown;
2240 You("cannot remove your gloves to put on the ring.");
2242 You("
\8ew
\97Ö
\82ð
\82Í
\82ß
\82æ
\82¤
\82Æ
\82µ
\82½
\82ª
\8f¬
\8eè
\82ª
\92E
\82°
\82È
\82¢
\81D");
2243 return res; /* uses move iff we learned gloves are cursed */
2246 res = !uwep->bknown; /* check this before calling welded() */
2247 if ((mask == RIGHT_RING || bimanual(uwep)) && welded(uwep)) {
2248 const char *hand = body_part(HAND);
2250 /* welded will set bknown */
2252 hand = makeplural(hand);
2254 You("cannot free your weapon %s to put on the ring.",
2256 You("
\8ew
\97Ö
\82ð
\82Í
\82ß
\82æ
\82¤
\82Æ
\82µ
\82½
\82ª
\97\98%s
\82Ì
\8e©
\97R
\82ª
\82«
\82©
\82È
\82¢
\81D",
2258 return res; /* uses move iff we learned weapon is cursed */
2261 } else if (obj->oclass == AMULET_CLASS) {
2264 already_wearing("an amulet");
2266 already_wearing("
\96\82\8f\9c\82¯", uamul);
2270 } else if (eyewear) {
2272 if (ublindf->otyp == TOWEL)
2274 Your("%s is already covered by a towel.",
2277 You("
\8aù
\82É
\83^
\83I
\83\8b\82ð
\90g
\82É
\82Â
\82¯
\82Ä
\82¢
\82é
\81D");
2279 else if (ublindf->otyp == BLINDFOLD) {
2280 if (obj->otyp == LENSES)
2282 already_wearing2("lenses", "a blindfold");
2284 already_wearing2("
\83\8c\83\93\83Y", "
\96Ú
\89B
\82µ");
2287 already_wearing("a blindfold");
2289 already_wearing("
\96Ú
\89B
\82µ", ublindf);
2291 } else if (ublindf->otyp == LENSES) {
2292 if (obj->otyp == BLINDFOLD)
2294 already_wearing2("a blindfold", "some lenses");
2296 already_wearing2("
\96Ú
\89B
\82µ", "
\83\8c\83\93\83Y");
2299 already_wearing("some lenses");
2301 already_wearing("
\83\8c\83\93\83Y", ublindf);
2305 already_wearing(something); /* ??? */
2307 already_wearing("
\89½
\82©", ublindf); /* ??? */
2313 /* neither armor nor accessory */
2315 You_cant("wear that!");
2317 You_cant("
\82»
\82ê
\82ð
\90g
\82É
\82Â
\82¯
\82ç
\82ê
\82È
\82¢
\81I");
2322 if (!retouch_object(&obj, FALSE))
2323 return 1; /* costs a turn even though it didn't get worn */
2328 /* if the armor is wielded, release it for wearing (won't be
2329 welded even if cursed; that only happens for weapons/weptools) */
2330 if (obj->owornmask & W_WEAPON)
2331 remove_worn_item(obj, FALSE);
2333 * Setting obj->known=1 is done because setworn() causes hero's AC
2334 * to change so armor's +/- value is evident via the status line.
2335 * We used to set it here because of that, but then it would stick
2336 * if a nymph stole the armor before it was fully worn. Delay it
2337 * until the aftermv action. The player may still know this armor's
2338 * +/- amount if donning gets interrupted, but the hero won't.
2343 /* if there's no delay, we'll execute 'aftermv' immediately */
2345 afternmv = Armor_on;
2346 else if (obj == uarmh)
2347 afternmv = Helmet_on;
2348 else if (obj == uarmg)
2349 afternmv = Gloves_on;
2350 else if (obj == uarmf)
2351 afternmv = Boots_on;
2352 else if (obj == uarms)
2353 afternmv = Shield_on;
2354 else if (obj == uarmc)
2355 afternmv = Cloak_on;
2356 else if (obj == uarmu)
2357 afternmv = Shirt_on;
2359 panic("wearing armor not worn as armor? [%08lx]", obj->owornmask);
2361 delay = -objects[obj->otyp].oc_delay;
2365 multi_reason = "dressing up";
2367 multi_reason = "
\91\95\94õ
\82µ
\82Ä
\82¢
\82é
\8e\9e\82É";
2369 nomovemsg = "You finish your dressing maneuver.";
2371 nomovemsg = "
\91\95\94õ
\82µ
\8fI
\82¦
\82½
\81D";
2373 unmul(""); /* call (*aftermv)(), clear it+nomovemsg+multi_reason */
2376 context.takeoff.mask = context.takeoff.what = 0L;
2377 } else { /* not armor */
2378 boolean give_feedback = FALSE;
2380 /* [releasing wielded accessory handled in Xxx_on()] */
2384 give_feedback = TRUE;
2385 } else if (obj->oclass == AMULET_CLASS) {
2386 setworn(obj, W_AMUL);
2388 /* no feedback here if amulet of change got used up */
2389 give_feedback = (uamul != 0);
2390 } else if (eyewear) {
2391 /* setworn() handled by Blindf_on() */
2393 /* message handled by Blindf_on(); leave give_feedback False */
2395 /* feedback for ring or for amulet other than 'change' */
2396 if (give_feedback && is_worn(obj))
2397 prinv((char *) 0, obj, 0L);
2402 /* the 'W' command */
2408 /* cantweararm() checks for suits of armor, not what we want here;
2409 verysmall() or nohands() checks for shields, gloves, etc... */
2410 if (verysmall(youmonst.data) || nohands(youmonst.data)) {
2412 pline("Don't even bother.");
2414 pline("
\82»
\82ñ
\82È
\82Â
\82Ü
\82ç
\82È
\82¢
\82±
\82Æ
\82É
\82±
\82¾
\82í
\82é
\82È
\81D");
2417 if (uarm && uarmu && uarmc && uarmh && uarms && uarmg && uarmf
2418 && uleft && uright && uamul && ublindf) {
2419 /* 'W' message doesn't mention accessories */
2421 You("are already wearing a full complement of armor.");
2423 You("
\82·
\82Å
\82É
\8a®
\91S
\91\95\94õ
\82µ
\82Ä
\82¢
\82é
\81D");
2426 otmp = getobj(clothes, "wear");
2427 return otmp ? accessory_or_armor_on(otmp) : 0;
2430 /* the 'P' command */
2436 if (uleft && uright && uamul && ublindf
2437 && uarm && uarmu && uarmc && uarmh && uarms && uarmg && uarmf) {
2438 /* 'P' message doesn't mention armor */
2440 Your("%s%s are full, and you're already wearing an amulet and %s.",
2441 humanoid(youmonst.data) ? "ring-" : "",
2442 makeplural(body_part(FINGER)),
2443 (ublindf->otyp == LENSES) ? "some lenses" : "a blindfold");
2445 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",
2446 humanoid(youmonst.data) ? "
\96ò" : "",
2448 ublindf->otyp==LENSES ? "
\83\8c\83\93\83Y" : "
\96Ú
\89B
\82µ");
2452 otmp = getobj(accessories, "put on");
2453 return otmp ? accessory_or_armor_on(otmp) : 0;
2456 /* calculate current armor class */
2460 int uac = mons[u.umonnum].ac; /* base armor class for current form */
2462 /* armor class from worn gear */
2464 uac -= ARM_BONUS(uarm);
2466 uac -= ARM_BONUS(uarmc);
2468 uac -= ARM_BONUS(uarmh);
2470 uac -= ARM_BONUS(uarmf);
2472 uac -= ARM_BONUS(uarms);
2474 uac -= ARM_BONUS(uarmg);
2476 uac -= ARM_BONUS(uarmu);
2477 if (uleft && uleft->otyp == RIN_PROTECTION)
2479 if (uright && uright->otyp == RIN_PROTECTION)
2482 /* armor class from other sources */
2483 if (HProtection & INTRINSIC)
2485 uac -= u.uspellprot;
2487 /* [The magic binary numbers 127 and -128 should be replaced with the
2488 * mystic decimal numbers 99 and -99 which require no explanation to
2489 * the uninitiated and would cap the width of a status line value at
2490 * one less character.]
2493 uac = -128; /* u.uac is an schar */
2495 uac = 127; /* for completeness */
2506 register struct obj *otmp;
2508 boolean leftfall, rightfall, wastwoweap = FALSE;
2509 const char *otherwep = 0, *thiswep, *which, *hand;
2511 leftfall = (uleft && !uleft->cursed
2512 && (!uwep || !welded(uwep) || !bimanual(uwep)));
2513 rightfall = (uright && !uright->cursed && (!welded(uwep)));
2514 if (!uarmg && (leftfall || rightfall) && !nolimbs(youmonst.data)) {
2515 /* changed so cursed rings don't fall off, GAN 10/30/86 */
2517 Your("%s off your %s.",
2518 (leftfall && rightfall) ? "rings slip" : "ring slips",
2519 (leftfall && rightfall) ? makeplural(body_part(FINGER))
2520 : body_part(FINGER));
2522 Your("
\8ew
\97Ö
\82Í%s
\82©
\82ç
\8a\8a\82è
\97\8e\82¿
\82½
\81D", body_part(FINGER));
2538 if (u.twoweap && otmp) {
2539 /* secondary weapon doesn't need nearly as much handling as
2540 primary; when in two-weapon mode, we know it's one-handed
2541 with something else in the other hand and also that it's
2542 a weapon or weptool rather than something unusual, plus
2543 we don't need to compare its type with the primary */
2544 otherwep = is_sword(otmp) ? c_sword : weapon_descr(otmp);
2545 if (otmp->quan > 1L)
2546 otherwep = makeplural(otherwep);
2547 hand = body_part(HAND);
2553 Your("%s %s%s from your %s%s.", otherwep, xfl ? "also " : "",
2554 otense(otmp, "slip"), which, hand);
2556 You("%s%s%s%s
\82©
\82ç
\8a\8a\82è
\97\8e\82Æ
\82µ
\82½
\81D", otherwep, xfl ? "
\82à
\82Ü
\82½" : "
\82ð",
2557 which, body_part(HAND));
2561 setuswapwep((struct obj *) 0); /* clears u.twoweap */
2562 if (canletgo(otmp, ""))
2566 if (otmp && !welded(otmp)) {
2567 long savequan = otmp->quan;
2569 /* nice wording if both weapons are the same type */
2570 thiswep = is_sword(otmp) ? c_sword : weapon_descr(otmp);
2571 if (otherwep && strcmp(thiswep, makesingular(otherwep)))
2573 if (otmp->quan > 1L) {
2574 /* most class names for unconventional wielded items
2575 are ok, but if wielding multiple apples or rations
2576 we don't want "your foods slip", so force non-corpse
2577 food to be singular; skipping makeplural() isn't
2578 enough--we need to fool otense() too */
2579 if (!strcmp(thiswep, "food"))
2582 thiswep = makeplural(thiswep);
2584 hand = body_part(HAND);
2587 hand = makeplural(hand);
2588 else if (wastwoweap)
2590 which = "right "; /* preceding msg was about left */
2592 which = "
\89E"; /* preceding msg was about left */
2595 pline("%s %s%s %s%s from your %s%s.",
2596 !strncmp(thiswep, "corpse", 6) ? "The" : "Your",
2597 otherwep ? "other " : "", thiswep, xfl ? "also " : "",
2598 otense(otmp, "slip"), which, hand);
2600 You("%s%s%s%s%s
\82©
\82ç
\8a\8a\82è
\97\8e\82Æ
\82µ
\82½
\81D",
2601 otherwep ? "
\82à
\82¤
\82Ð
\82Æ
\82Â
\82Ì" : "", thiswep,
2602 xfl ? "
\82à
\82Ü
\82½" : "
\82ð",
2603 which, body_part(HAND));
2606 otmp->quan = savequan;
2607 setuwep((struct obj *) 0);
2608 if (canletgo(otmp, ""))
2615 struct monst *victim;
2617 register struct obj *otmph, *otmp;
2619 otmph = (victim == &youmonst) ? uarmc : which_armor(victim, W_ARMC);
2621 otmph = (victim == &youmonst) ? uarm : which_armor(victim, W_ARM);
2623 otmph = (victim == &youmonst) ? uarmu : which_armor(victim, W_ARMU);
2625 otmp = (victim == &youmonst) ? uarmh : which_armor(victim, W_ARMH);
2626 if (otmp && (!otmph || !rn2(4)))
2628 otmp = (victim == &youmonst) ? uarmg : which_armor(victim, W_ARMG);
2629 if (otmp && (!otmph || !rn2(4)))
2631 otmp = (victim == &youmonst) ? uarmf : which_armor(victim, W_ARMF);
2632 if (otmp && (!otmph || !rn2(4)))
2634 otmp = (victim == &youmonst) ? uarms : which_armor(victim, W_ARMS);
2635 if (otmp && (!otmph || !rn2(4)))
2640 /* used for praying to check and fix levitation trouble */
2642 stuck_ring(ring, otyp)
2646 if (ring != uleft && ring != uright) {
2647 impossible("stuck_ring: neither left nor right?");
2648 return (struct obj *) 0;
2651 if (ring && ring->otyp == otyp) {
2652 /* reasons ring can't be removed match those checked by select_off();
2653 limbless case has extra checks because ordinarily it's temporary */
2654 if (nolimbs(youmonst.data) && uamul
2655 && uamul->otyp == AMULET_OF_UNCHANGING && uamul->cursed)
2657 if (welded(uwep) && (ring == uright || bimanual(uwep)))
2659 if (uarmg && uarmg->cursed)
2664 /* either no ring or not right type or nothing prevents its removal */
2665 return (struct obj *) 0;
2668 /* also for praying; find worn item that confers "Unchanging" attribute */
2672 if (uamul && uamul->otyp == AMULET_OF_UNCHANGING)
2680 register struct obj *otmp;
2687 *buf = '\0'; /* lint suppression */
2689 /* special ring checks */
2690 if (otmp == uright || otmp == uleft) {
2691 if (nolimbs(youmonst.data)) {
2693 pline_The("ring is stuck.");
2695 pline("
\8ew
\97Ö
\82Í
\91Ì
\82É
\96\84\82Ü
\82Á
\82Ä
\82µ
\82Ü
\82Á
\82Ä
\82¢
\82é
\81D");
2699 why = 0; /* the item which prevents ring removal */
2700 if (welded(uwep) && (otmp == uright || bimanual(uwep))) {
2702 Sprintf(buf, "free a weapon %s", body_part(HAND));
2704 Sprintf(buf, "
\97\98\98r
\82Ì
\8e©
\97R
\82ª
\82«
\82©
\82È
\82¢");
2706 } else if (uarmg && uarmg->cursed) {
2708 Sprintf(buf, "take off your %s", c_gloves);
2710 Sprintf(buf, "%s
\82ª
\92E
\82°
\82È
\82¢", c_gloves);
2715 You("cannot %s to remove the ring.", buf);
2717 You("
\8ew
\97Ö
\82ð
\82Í
\82¸
\82»
\82¤
\82Æ
\82µ
\82½
\82ª%s
\81D", buf);
2722 /* special glove checks */
2723 if (otmp == uarmg) {
2726 You("are unable to take off your %s while wielding that %s.",
2727 c_gloves, is_sword(uwep) ? c_sword : c_weapon);
2729 You("%s
\82ð
\8e\9d\82Á
\82½
\82Ü
\82Ü%s
\82ð
\82Í
\82¸
\82·
\82±
\82Æ
\82Í
\82Å
\82«
\82È
\82¢
\81D",
2730 is_sword(uwep) ? c_sword : c_weapon, c_gloves);
2732 uwep->bknown = TRUE;
2736 You_cant("take off the slippery %s with your slippery %s.",
2737 c_gloves, makeplural(body_part(FINGER)));
2739 You_cant("
\8a\8a\82è
\82â
\82·
\82¢%s
\82ð
\8a\8a\82è
\82â
\82·
\82¢%s
\82Å
\82Í
\82¸
\82¹
\82È
\82¢
\81D",
2740 c_gloves, body_part(FINGER));
2745 /* special boot checks */
2746 if (otmp == uarmf) {
2747 if (u.utrap && u.utraptype == TT_BEARTRAP) {
2749 pline_The("bear trap prevents you from pulling your %s out.",
2751 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",
2754 } else if (u.utrap && u.utraptype == TT_INFLOOR) {
2756 You("are stuck in the %s, and cannot pull your %s out.",
2758 You("%s
\82ª%s
\82É
\82Í
\82Ü
\82Á
\82Ä
\82¢
\82é
\82Ì
\82Å
\92E
\82®
\82±
\82Æ
\82ª
\82Å
\82«
\82È
\82¢
\81D",
2759 surface(u.ux, u.uy), makeplural(body_part(FOOT)));
2763 /* special suit and shirt checks */
2764 if (otmp == uarm || otmp == uarmu) {
2765 why = 0; /* the item which prevents disrobing */
2766 if (uarmc && uarmc->cursed) {
2768 Sprintf(buf, "remove your %s", cloak_simple_name(uarmc));
2770 Sprintf(buf, "%s
\82ª
\92E
\82°
\82È
\82¢", cloak_simple_name(uarmc));
2772 } else if (otmp == uarmu && uarm && uarm->cursed) {
2774 Sprintf(buf, "remove your %s", c_suit);
2776 Sprintf(buf, "%s
\82ª
\92E
\82°
\82È
\82¢", c_suit);
2778 } else if (welded(uwep) && bimanual(uwep)) {
2780 Sprintf(buf, "release your %s",
2781 is_sword(uwep) ? c_sword : (uwep->otyp == BATTLE_AXE)
2785 Sprintf(buf, "%s
\82ª
\8eè
\95ú
\82¹
\82È
\82¢",
2786 is_sword(uwep) ? c_sword : (uwep->otyp == BATTLE_AXE)
2794 You("cannot %s to take off %s.", buf, the(xname(otmp)));
2796 You("%s
\82ð
\82Í
\82¸
\82»
\82¤
\82Æ
\82µ
\82½
\82ª%s
\81D", xname(otmp), buf);
2801 /* basic curse check */
2802 if (otmp == uquiver || (otmp == uswapwep && !u.twoweap)) {
2803 ; /* some items can be removed even when cursed */
2805 /* otherwise, this is fundamental */
2811 context.takeoff.mask |= WORN_ARMOR;
2812 else if (otmp == uarmc)
2813 context.takeoff.mask |= WORN_CLOAK;
2814 else if (otmp == uarmf)
2815 context.takeoff.mask |= WORN_BOOTS;
2816 else if (otmp == uarmg)
2817 context.takeoff.mask |= WORN_GLOVES;
2818 else if (otmp == uarmh)
2819 context.takeoff.mask |= WORN_HELMET;
2820 else if (otmp == uarms)
2821 context.takeoff.mask |= WORN_SHIELD;
2822 else if (otmp == uarmu)
2823 context.takeoff.mask |= WORN_SHIRT;
2824 else if (otmp == uleft)
2825 context.takeoff.mask |= LEFT_RING;
2826 else if (otmp == uright)
2827 context.takeoff.mask |= RIGHT_RING;
2828 else if (otmp == uamul)
2829 context.takeoff.mask |= WORN_AMUL;
2830 else if (otmp == ublindf)
2831 context.takeoff.mask |= WORN_BLINDF;
2832 else if (otmp == uwep)
2833 context.takeoff.mask |= W_WEP;
2834 else if (otmp == uswapwep)
2835 context.takeoff.mask |= W_SWAPWEP;
2836 else if (otmp == uquiver)
2837 context.takeoff.mask |= W_QUIVER;
2840 impossible("select_off: %s???", doname(otmp));
2845 STATIC_OVL struct obj *
2848 struct obj *otmp = (struct obj *) 0;
2849 struct takeoff_info *doff = &context.takeoff;
2851 context.takeoff.mask |= I_SPECIAL; /* set flag for cancel_doff() */
2852 if (doff->what == W_WEP) {
2853 if (!cursed(uwep)) {
2854 setuwep((struct obj *) 0);
2856 You("are empty %s.", body_part(HANDED));
2858 You("
\89½
\82à%s
\82É
\82µ
\82Ä
\82¢
\82È
\82¢
\81D", body_part(HAND));
2861 } else if (doff->what == W_SWAPWEP) {
2862 setuswapwep((struct obj *) 0);
2864 You("no longer have a second weapon readied.");
2866 You("
\97\
\94õ
\82Ì
\95\90\8aí
\82ð
\82¨
\82³
\82ß
\82½
\81D");
2868 } else if (doff->what == W_QUIVER) {
2869 setuqwep((struct obj *) 0);
2871 You("no longer have ammunition readied.");
2873 You("
\8f\80\94õ
\82µ
\82½
\96î
\92e
\82ð
\82¨
\82³
\82ß
\82½
\81D");
2874 } else if (doff->what == WORN_ARMOR) {
2878 } else if (doff->what == WORN_CLOAK) {
2882 } else if (doff->what == WORN_BOOTS) {
2886 } else if (doff->what == WORN_GLOVES) {
2889 (void) Gloves_off();
2890 } else if (doff->what == WORN_HELMET) {
2893 (void) Helmet_off();
2894 } else if (doff->what == WORN_SHIELD) {
2897 (void) Shield_off();
2898 } else if (doff->what == WORN_SHIRT) {
2902 } else if (doff->what == WORN_AMUL) {
2906 } else if (doff->what == LEFT_RING) {
2910 } else if (doff->what == RIGHT_RING) {
2914 } else if (doff->what == WORN_BLINDF) {
2915 if (!cursed(ublindf))
2916 Blindf_off(ublindf);
2918 impossible("do_takeoff: taking off %lx", doff->what);
2920 context.takeoff.mask &= ~I_SPECIAL; /* clear cancel_doff() flag */
2925 /* occupation callback for 'A' */
2931 register struct obj *otmp;
2932 struct takeoff_info *doff = &context.takeoff;
2935 if (doff->delay > 0) {
2937 return 1; /* still busy */
2939 if ((otmp = do_takeoff()) != 0)
2941 doff->mask &= ~doff->what;
2945 for (i = 0; takeoff_order[i]; i++)
2946 if (doff->mask & takeoff_order[i]) {
2947 doff->what = takeoff_order[i];
2951 otmp = (struct obj *) 0;
2954 if (doff->what == 0L) {
2956 You("finish %s.", doff->disrobing);
2958 You("
\91\95\94õ
\82ð
\89ð
\82«
\82¨
\82¦
\82½
\81D");
2960 } else if (doff->what == W_WEP) {
2962 } else if (doff->what == W_SWAPWEP) {
2964 } else if (doff->what == W_QUIVER) {
2966 } else if (doff->what == WORN_ARMOR) {
2968 /* If a cloak is being worn, add the time to take it off and put
2969 * it back on again. Kludge alert! since that time is 0 for all
2970 * known cloaks, add 1 so that it actually matters...
2973 doff->delay += 2 * objects[uarmc->otyp].oc_delay + 1;
2974 } else if (doff->what == WORN_CLOAK) {
2976 } else if (doff->what == WORN_BOOTS) {
2978 } else if (doff->what == WORN_GLOVES) {
2980 } else if (doff->what == WORN_HELMET) {
2982 } else if (doff->what == WORN_SHIELD) {
2984 } else if (doff->what == WORN_SHIRT) {
2986 /* add the time to take off and put back on armor and/or cloak */
2988 doff->delay += 2 * objects[uarm->otyp].oc_delay;
2990 doff->delay += 2 * objects[uarmc->otyp].oc_delay + 1;
2991 } else if (doff->what == WORN_AMUL) {
2993 } else if (doff->what == LEFT_RING) {
2995 } else if (doff->what == RIGHT_RING) {
2997 } else if (doff->what == WORN_BLINDF) {
2998 /* [this used to be 2, but 'R' (and 'T') only require 1 turn to
2999 remove a blindfold, so 'A' shouldn't have been requiring 2] */
3002 impossible("take_off: taking off %lx", doff->what);
3003 return 0; /* force done */
3007 doff->delay += objects[otmp->otyp].oc_delay;
3009 /* Since setting the occupation now starts the counter next move, that
3010 * would always produce a delay 1 too big per item unless we subtract
3011 * 1 here to account for it.
3013 if (doff->delay > 0)
3016 set_occupation(take_off, doff->disrobing, 0);
3017 return 1; /* get busy */
3020 /* clear saved context to avoid inappropriate resumption of interrupted 'A' */
3024 context.takeoff.what = context.takeoff.mask = 0L;
3025 context.takeoff.disrobing[0] = '\0';
3028 /* the 'A' command -- remove multiple worn items */
3034 if (context.takeoff.what || context.takeoff.mask) {
3036 You("continue %s.", context.takeoff.disrobing);
3038 You("
\91\95\94õ
\82ð
\89ð
\82
\82Ì
\82ð
\8dÄ
\8aJ
\82µ
\82½
\81D");
3040 set_occupation(take_off, context.takeoff.disrobing, 0);
3042 set_occupation(take_off, "
\91\95\94õ
\82ð
\89ð
\82", 0);
3044 } else if (!uwep && !uswapwep && !uquiver && !uamul && !ublindf && !uleft
3045 && !uright && !wearing_armor()) {
3047 You("are not wearing anything.");
3049 You("
\89½
\82à
\91\95\94õ
\82µ
\82Ä
\82¢
\82È
\82¢
\81D");
3053 add_valid_menu_class(0); /* reset */
3054 if (flags.menu_style != MENU_TRADITIONAL
3055 || (result = ggetobj("take off", select_off, 0, FALSE,
3056 (unsigned *) 0)) < -1)
3057 result = menu_remarm(result);
3059 if (context.takeoff.mask) {
3060 #if 0 /*JP*//*
\93ú
\96{
\8cê
\82Å
\82Í
\8eg
\82í
\82È
\82¢*/
3061 /* default activity for armor and/or accessories,
3062 possibly combined with weapons */
3063 (void) strncpy(context.takeoff.disrobing, "disrobing", CONTEXTVERBSZ);
3064 /* specific activity when handling weapons only */
3065 if (!(context.takeoff.mask & ~W_WEAPON))
3066 (void) strncpy(context.takeoff.disrobing, "disarming",
3071 /* The time to perform the command is already completely accounted for
3072 * in take_off(); if we return 1, that would add an extra turn to each
3083 menu_item *pick_list;
3084 boolean all_worn_categories = TRUE;
3087 all_worn_categories = (retry == -2);
3088 } else if (flags.menu_style == MENU_FULL) {
3089 all_worn_categories = FALSE;
3091 n = query_category("What type of things do you want to take off?",
3093 n = query_category("
\82Ç
\82Ì
\83^
\83C
\83v
\82Ì
\95¨
\82Ì
\91\95\94õ
\82ð
\89ð
\82«
\82Ü
\82·
\82©
\81H",
3094 invent, (WORN_TYPES | ALL_TYPES
3095 | UNPAID_TYPES | BUCX_TYPES),
3096 &pick_list, PICK_ANY);
3099 for (i = 0; i < n; i++) {
3100 if (pick_list[i].item.a_int == ALL_TYPES_SELECTED)
3101 all_worn_categories = TRUE;
3103 add_valid_menu_class(pick_list[i].item.a_int);
3105 free((genericptr_t) pick_list);
3106 } else if (flags.menu_style == MENU_COMBINATION) {
3107 unsigned ggofeedback = 0;
3109 i = ggetobj("take off", select_off, 0, TRUE, &ggofeedback);
3110 if (ggofeedback & ALL_FINISHED)
3112 all_worn_categories = (i == -2);
3114 if (menu_class_present('u')
3115 || menu_class_present('B') || menu_class_present('U')
3116 || menu_class_present('C') || menu_class_present('X'))
3117 all_worn_categories = FALSE;
3120 n = query_objlist("What do you want to take off?", &invent,
3121 (SIGNAL_NOMENU | USE_INVLET | INVORDER_SORT),
3122 &pick_list, PICK_ANY,
3123 all_worn_categories ? is_worn : is_worn_by_type);
3125 n = query_objlist("
\82Ç
\82Ì
\91\95\94õ
\82ð
\89ð
\82«
\82Ü
\82·
\82©
\81H", &invent,
3126 (SIGNAL_NOMENU | USE_INVLET | INVORDER_SORT),
3127 &pick_list, PICK_ANY,
3128 all_worn_categories ? is_worn : is_worn_by_type);
3131 for (i = 0; i < n; i++)
3132 (void) select_off(pick_list[i].item.a_obj);
3133 free((genericptr_t) pick_list);
3134 } else if (n < 0 && flags.menu_style != MENU_COMBINATION) {
3136 There("is nothing else you can remove or unwield.");
3138 pline("
\91\95\94õ
\82ð
\89ð
\82¯
\82é
\82à
\82Ì
\82Í
\89½
\82à
\82È
\82¢
\81D");
3143 /* hit by destroy armor scroll/black dragon breath/monster spell */
3146 register struct obj *atmp;
3148 register struct obj *otmp;
3149 #define DESTROY_ARM(o) \
3150 ((otmp = (o)) != 0 && (!atmp || atmp == otmp) \
3151 && (!obj_resists(otmp, 0, 90)) \
3152 ? (otmp->in_use = TRUE) \
3155 if (DESTROY_ARM(uarmc)) {
3159 Your("%s crumbles and turns to dust!", cloak_simple_name(uarmc));
3161 Your("%s
\82Í
\95²
\81X
\82É
\82È
\82Á
\82½
\81I", cloak_simple_name(uarmc));
3164 } else if (DESTROY_ARM(uarm)) {
3168 Your("armor turns to dust and falls to the %s!", surface(u.ux, u.uy));
3170 Your("
\8aZ
\82Í
\90o
\82Æ
\82È
\82è%s
\82É
\97\8e\82¿
\82½
\81I", surface(u.ux,u.uy));
3171 (void) Armor_gone();
3173 } else if (DESTROY_ARM(uarmu)) {
3177 Your("shirt crumbles into tiny threads and falls apart!");
3179 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");
3182 } else if (DESTROY_ARM(uarmh)) {
3186 Your("%s turns to dust and is blown away!", helm_simple_name(uarmh));
3188 Your("%s
\82Í
\90o
\82Æ
\82È
\82è
\90\81\82«
\82Æ
\82ñ
\82¾
\81I", helm_simple_name(uarmh));
3189 (void) Helmet_off();
3191 } else if (DESTROY_ARM(uarmg)) {
3195 Your("gloves vanish!");
3197 Your("
\8f¬
\8eè
\82Í
\8fÁ
\82¦
\82½
\81I");
3198 (void) Gloves_off();
3203 selftouch("
\82»
\82Ì
\82Æ
\82«
\82 \82È
\82½
\82Í");
3204 } else if (DESTROY_ARM(uarmf)) {
3208 Your("boots disintegrate!");
3210 Your("
\8cC
\82Í
\95²
\81X
\82É
\8dÓ
\82¯
\82½
\81I");
3213 } else if (DESTROY_ARM(uarms)) {
3217 Your("shield crumbles away!");
3219 Your("
\8f\82\82Í
\8dÓ
\82¯
\8eU
\82Á
\82½
\81I");
3220 (void) Shield_off();
3223 return 0; /* could not destroy anything */
3232 adj_abon(otmp, delta)
3233 register struct obj *otmp;
3234 register schar delta;
3236 if (uarmg && uarmg == otmp && otmp->otyp == GAUNTLETS_OF_DEXTERITY) {
3238 makeknown(uarmg->otyp);
3239 ABON(A_DEX) += (delta);
3243 if (uarmh && uarmh == otmp && otmp->otyp == HELM_OF_BRILLIANCE) {
3245 makeknown(uarmh->otyp);
3246 ABON(A_INT) += (delta);
3247 ABON(A_WIS) += (delta);
3253 /* decide whether a worn item is covered up by some other worn item,
3254 used for dipping into liquid and applying grease;
3255 some criteria are different than select_off()'s */
3257 inaccessible_equipment(obj, verb, only_if_known_cursed)
3259 const char *verb; /* "dip" or "grease", or null to avoid messages */
3260 /*JP:
\93ú
\96{
\8cê
\82Å
\82Í "
\82ð
\90Z
\82·", "
\82É
\8e\89\82ð
\93h
\82é", null
\82Ì
\82¢
\82¸
\82ê
\82©*/
3261 boolean only_if_known_cursed; /* ignore covering unless known to be cursed */
3264 static NEARDATA const char need_to_take_off_outer_armor[] =
3265 "need to take off %s to %s %s.";
3266 #else /*JP:
\88ø
\90\94\82ª
\8c´
\95¶
\82Æ
\95Ï
\82í
\82Á
\82Ä
\82¢
\82é
\82±
\82Æ
\82É
\92\8d\88Ó*/
3267 static NEARDATA const char need_to_take_off_outer_armor[] =
3268 "%s%s
\82É
\82Í%s
\82ð%s
\95K
\97v
\82ª
\82 \82é
\81D";
3271 boolean anycovering = !only_if_known_cursed; /* more comprehensible... */
3272 #define BLOCKSACCESS(x) (anycovering || ((x)->cursed && (x)->bknown))
3274 if (!obj || !obj->owornmask)
3275 return FALSE; /* not inaccessible */
3277 /* check for suit covered by cloak */
3278 if (obj == uarm && uarmc && BLOCKSACCESS(uarmc)) {
3280 Strcpy(buf, yname(uarmc));
3282 You(need_to_take_off_outer_armor, buf, verb, yname(obj));
3283 #else /*JP:
\91Î
\8fÛ
\82Í
\83N
\83\8d\81[
\83N
\82È
\82Ì
\82Åjoffmsg
\82ð
\8eg
\82í
\82¸
\8c\88\82ß
\8c\82\82¿*/
3284 You(need_to_take_off_outer_armor, xname(obj), verb, buf, "
\92E
\82®");
3289 /* check for shirt covered by suit and/or cloak */
3291 && ((uarm && BLOCKSACCESS(uarm)) || (uarmc && BLOCKSACCESS(uarmc)))) {
3293 char cloaktmp[QBUFSZ], suittmp[QBUFSZ];
3294 /* if sameprefix, use yname and xname to get "your cloak and suit"
3295 or "Manlobbi's cloak and suit"; otherwise, use yname and yname
3296 to get "your cloak and Manlobbi's suit" or vice versa */
3297 boolean sameprefix = (uarm && uarmc
3298 && !strcmp(shk_your(cloaktmp, uarmc),
3299 shk_your(suittmp, uarm)));
3303 Strcat(buf, yname(uarmc));
3306 Strcat(buf, " and ");
3308 Strcat(buf, "
\82Æ");
3310 Strcat(buf, sameprefix ? xname(uarm) : yname(uarm));
3312 You(need_to_take_off_outer_armor, buf, verb, yname(obj));
3313 #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¿*/
3314 You(need_to_take_off_outer_armor, xname(obj), verb, buf, "
\92E
\82®");
3319 /* check for ring covered by gloves */
3320 if ((obj == uleft || obj == uright) && uarmg && BLOCKSACCESS(uarmg)) {
3322 Strcpy(buf, yname(uarmg));
3324 You(need_to_take_off_outer_armor, buf, verb, yname(obj));
3325 #else /*JP:
\91Î
\8fÛ
\82Í
\8f¬
\8eè
\82È
\82Ì
\82Åjoffmsg
\82ð
\8eg
\82í
\82¸
\8c\88\82ß
\8c\82\82¿*/
3326 You(need_to_take_off_outer_armor, xname(obj), verb, buf, "
\82Í
\82¸
\82·");
3331 /* item is not inaccessible */