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-2016 */
9 /* JNetHack may be freely redistributed. See license for details. */
13 static NEARDATA const char see_yourself[] = "see yourself";
14 static NEARDATA const char unknown_type[] = "Unknown type of %s (%d)";
16 static NEARDATA const char c_armor[] = "armor", c_suit[] = "suit",
17 c_shirt[] = "shirt", c_cloak[] = "cloak",
18 c_gloves[] = "gloves", c_boots[] = "boots",
19 c_helmet[] = "helmet", c_shield[] = "shield",
20 c_weapon[] = "weapon", c_sword[] = "sword",
21 c_axe[] = "axe", c_that_[] = "that";
23 static NEARDATA const char c_armor[] = "
\8aZ", c_suit[] = "
\95\9e",
24 c_shirt[] = "
\83V
\83\83\83c", c_cloak[] = "
\83N
\83\8d\81[
\83N",
25 c_gloves[] = "
\8f¬
\8eè", c_boots[] = "
\8cC",
26 c_helmet[] = "
\8a\95", c_shield[] = "
\8f\82",
27 c_weapon[] = "
\95\90\8aí", c_sword[] = "
\8c\95",
28 c_axe[] = "
\95\80", c_that_[] = "
\82»
\82ê";
31 static NEARDATA const long takeoff_order[] = {
32 WORN_BLINDF, W_WEP, WORN_SHIELD, WORN_GLOVES, LEFT_RING,
33 RIGHT_RING, WORN_CLOAK, WORN_HELMET, WORN_AMUL, WORN_ARMOR,
34 WORN_SHIRT, WORN_BOOTS, W_SWAPWEP, W_QUIVER, 0L
37 STATIC_DCL void FDECL(on_msg, (struct obj *));
38 STATIC_DCL void FDECL(toggle_stealth, (struct obj *, long, BOOLEAN_P));
39 STATIC_DCL void FDECL(toggle_displacement, (struct obj *, long, BOOLEAN_P));
40 STATIC_PTR int NDECL(Armor_on);
41 /* int NDECL(Boots_on); -- moved to extern.h */
42 STATIC_PTR int NDECL(Cloak_on);
43 STATIC_PTR int NDECL(Helmet_on);
44 STATIC_PTR int NDECL(Gloves_on);
45 STATIC_DCL void FDECL(wielding_corpse, (struct obj *, BOOLEAN_P));
46 STATIC_PTR int NDECL(Shield_on);
47 STATIC_PTR int NDECL(Shirt_on);
48 STATIC_DCL void NDECL(Amulet_on);
49 STATIC_DCL void FDECL(learnring, (struct obj *, BOOLEAN_P));
50 STATIC_DCL void FDECL(Ring_off_or_gone, (struct obj *, BOOLEAN_P));
51 STATIC_PTR int FDECL(select_off, (struct obj *));
52 STATIC_DCL struct obj *NDECL(do_takeoff);
53 STATIC_PTR int NDECL(take_off);
54 STATIC_DCL int FDECL(menu_remarm, (int));
55 STATIC_DCL void FDECL(count_worn_stuff, (struct obj **, BOOLEAN_P));
56 STATIC_PTR int FDECL(armor_or_accessory_off, (struct obj *));
57 STATIC_PTR int FDECL(accessory_or_armor_on, (struct obj *));
59 STATIC_DCL void FDECL(already_wearing, (const char *));
61 STATIC_DCL void FDECL(already_wearing, (const char*, struct obj *));
63 STATIC_DCL void FDECL(already_wearing2, (const char *, const char *));
71 You("were wearing %s.", doname(otmp));
75 m = joffmsg(otmp, &j);
77 You("%s%s%s
\81D", doname(otmp), j, jpast(m));
81 /* for items that involve no delay */
89 /* call xname() before obj_is_pname(); formatting obj's name
90 might set obj->dknown and that affects the pname test */
91 const char *otmp_name = xname(otmp);
94 if (otmp->otyp == TOWEL)
95 Sprintf(how, " around your %s", body_part(HEAD));
96 You("are now wearing %s%s.",
97 obj_is_pname(otmp) ? the(otmp_name) : an(otmp_name), how);
101 m = jonmsg(otmp, &j);
102 You("%s%s%s
\81D", xname(otmp), j, jpast(m));
107 /* starting equipment gets auto-worn at beginning of new game,
108 and we don't want stealth or displacement feedback then */
109 static boolean initial_don = FALSE; /* manipulated in set_wear() */
111 /* putting on or taking off an item which confers stealth;
112 give feedback and discover it iff stealth state is changing */
115 toggle_stealth(obj, oldprop, on)
117 long oldprop; /* prop[].extrinsic, with obj->owornmask stripped by caller */
120 if (on ? initial_don : context.takeoff.cancelled_don)
123 if (!oldprop /* extrinsic stealth from something else */
124 && !HStealth /* intrinsic stealth */
125 && !BStealth) { /* stealth blocked by something */
126 if (obj->otyp == RIN_STEALTH)
127 learnring(obj, TRUE);
129 makeknown(obj->otyp);
134 You("move very quietly.");
136 Your("
\90Ã
\82©
\82É
\93®
\82¯
\82é
\82æ
\82¤
\82É
\82È
\82Á
\82½
\81D");
137 else if (Levitation || Flying)
139 You("float imperceptibly.");
141 You("
\82¢
\82Â
\82Ì
\82Ü
\82É
\82©
\95\82\82¢
\82Ä
\82¢
\82½
\81D");
144 You("walk very quietly.");
146 Your("
\91«
\89¹
\82Í
\8f¬
\82³
\82
\82È
\82Á
\82½
\81D");
149 You("sure are noisy.");
151 Your("
\91«
\89¹
\82Í
\91å
\82«
\82
\82È
\82Á
\82½
\81D");
156 /* putting on or taking off an item which confers displacement;
157 give feedback and discover it iff displacement state is changing *and*
158 hero is able to see self (or sense monsters) */
161 toggle_displacement(obj, oldprop, on)
163 long oldprop; /* prop[].extrinsic, with obj->owornmask stripped by caller */
166 if (on ? initial_don : context.takeoff.cancelled_don)
169 if (!oldprop /* extrinsic displacement from something else */
170 && !(u.uprops[DISPLACED].intrinsic) /* (theoretical) */
171 && !(u.uprops[DISPLACED].blocked) /* (also theoretical) */
172 /* we don't use canseeself() here because it augments vision
173 with touch, which isn't appropriate for deciding whether
174 we'll notice that monsters have trouble spotting the hero */
175 && ((!Blind /* see anything */
176 && !u.uswallow /* see surroundings */
177 && !Invisible) /* see self */
178 /* actively sensing nearby monsters via telepathy or extended
179 monster detection overrides vision considerations because
180 hero also senses self in this situation */
182 || (Blind_telepat && Blind)
183 || Detect_monsters))) {
184 makeknown(obj->otyp);
187 You_feel("that monsters%s have difficulty pinpointing your location.",
188 on ? "" : " no longer");
190 You_feel("
\89ö
\95¨
\82Í
\82 \82È
\82½
\82Ì
\88Ê
\92u
\82ª
\82Í
\82Á
\82«
\82è
\82Æ
\95ª
\82©%s
\82È
\82Á
\82½
\82æ
\82¤
\82¾
\81D",
191 on ? "
\82ç
\82È
\82" : "
\82é
\82æ
\82¤
\82É");
197 * The Type_on() functions should be called *after* setworn().
198 * The Type_off() functions call setworn() themselves.
199 * [Blindf_on() is an exception and calls setworn() itself.]
206 u.uprops[objects[uarmf->otyp].oc_oprop].extrinsic & ~WORN_BOOTS;
208 switch (uarmf->otyp) {
215 case WATER_WALKING_BOOTS:
218 /* (we don't need a lava check here since boots can't be
219 put on while feet are stuck) */
222 /* Speed boots are still better than intrinsic speed, */
223 /* though not better than potion speed */
224 if (!oldprop && !(HFast & TIMEOUT)) {
225 makeknown(uarmf->otyp);
227 You_feel("yourself speed up%s.",
228 (oldprop || HFast) ? " a bit more" : "");
230 You("%s
\91f
\91\81\82
\82È
\82Á
\82½
\82æ
\82¤
\82È
\8bC
\82ª
\82µ
\82½
\81D",
231 (oldprop || HFast) ? "
\82³
\82ç
\82É" : "");
236 toggle_stealth(uarmf, oldprop, TRUE);
239 if (!oldprop && !(HFumbling & ~TIMEOUT))
240 incr_itimeout(&HFumbling, rnd(20));
242 case LEVITATION_BOOTS:
243 if (!oldprop && !HLevitation && !BLevitation) {
244 makeknown(uarmf->otyp);
248 float_vs_flight(); /* maybe toggle (BFlying & I_SPECIAL) */
252 impossible(unknown_type, c_boots, uarmf->otyp);
260 struct obj *otmp = uarmf;
261 int otyp = otmp->otyp;
262 long oldprop = u.uprops[objects[otyp].oc_oprop].extrinsic & ~WORN_BOOTS;
264 context.takeoff.mask &= ~W_ARMF;
265 /* For levitation, float_down() returns if Levitation, so we
266 * must do a setworn() _before_ the levitation case.
268 setworn((struct obj *) 0, W_ARMF);
271 if (!Very_fast && !context.takeoff.cancelled_don) {
274 You_feel("yourself slow down%s.", Fast ? " a bit" : "");
276 You("%s
\82Ì
\82ë
\82
\82È
\82Á
\82½
\82æ
\82¤
\82È
\8bC
\82ª
\82µ
\82½
\81D", Fast ? "
\82¿
\82å
\82Á
\82Æ" : "");
279 case WATER_WALKING_BOOTS:
280 /* check for lava since fireproofed boots make it viable */
281 if ((is_pool(u.ux, u.uy) || is_lava(u.ux, u.uy))
282 && !Levitation && !Flying && !is_clinger(youmonst.data)
283 && !context.takeoff.cancelled_don
284 /* avoid recursive call to lava_effects() */
285 && !iflags.in_lava_effects) {
286 /* make boots known in case you survive the drowning */
292 toggle_stealth(otmp, oldprop, FALSE);
295 if (!oldprop && !(HFumbling & ~TIMEOUT))
296 HFumbling = EFumbling = 0;
298 case LEVITATION_BOOTS:
299 if (!oldprop && !HLevitation && !BLevitation
300 && !context.takeoff.cancelled_don) {
301 (void) float_down(0L, 0L);
304 float_vs_flight(); /* maybe toggle (BFlying & I_SPECIAL) */
314 impossible(unknown_type, c_boots, otyp);
316 context.takeoff.cancelled_don = FALSE;
324 u.uprops[objects[uarmc->otyp].oc_oprop].extrinsic & ~WORN_CLOAK;
326 switch (uarmc->otyp) {
329 case CLOAK_OF_MAGIC_RESISTANCE:
333 case CLOAK_OF_PROTECTION:
334 makeknown(uarmc->otyp);
337 toggle_stealth(uarmc, oldprop, TRUE);
339 case CLOAK_OF_DISPLACEMENT:
340 toggle_displacement(uarmc, oldprop, TRUE);
343 /* Note: it's already being worn, so we have to cheat here. */
344 if ((HInvis || EInvis) && !Blind) {
347 You("can %s!", See_invisible ? "no longer see through yourself"
351 See_invisible ? "
\82 \82È
\82½
\82Í
\93§
\96¾
\82Å
\82È
\82
\82È
\82Á
\82½" :
352 "
\8e©
\95ª
\8e©
\90g
\82ª
\8c©
\82¦
\82é
\82æ
\82¤
\82É
\82È
\82Á
\82½");
356 case CLOAK_OF_INVISIBILITY:
357 /* since cloak of invisibility was worn, we know mummy wrapping
358 wasn't, so no need to check `oldprop' against blocked */
359 if (!oldprop && !HInvis && !Blind) {
360 makeknown(uarmc->otyp);
363 pline("Suddenly you can%s yourself.",
364 See_invisible ? " see through" : "not see");
366 pline("
\93Ë
\91R
\81C%s
\82È
\82Á
\82½
\81D",
367 See_invisible ? "
\82 \82È
\82½
\82Í
\93§
\96¾
\82É" : "
\8e©
\95ª
\8e©
\90g
\82ª
\8c©
\82¦
\82È
\82");
373 pline("%s very tightly.", Tobjnam(uarmc, "fit"));
375 pline("%s
\82Í
\82Æ
\82Ä
\82à
\82Ò
\82Á
\82¿
\82è
\8d\87\82¤
\81D",xname(uarmc));
377 /* Alchemy smock gives poison _and_ acid resistance */
379 EAcid_resistance |= WORN_CLOAK;
382 impossible(unknown_type, c_cloak, uarmc->otyp);
390 struct obj *otmp = uarmc;
391 int otyp = otmp->otyp;
392 long oldprop = u.uprops[objects[otyp].oc_oprop].extrinsic & ~WORN_CLOAK;
394 context.takeoff.mask &= ~W_ARMC;
395 /* For mummy wrapping, taking it off first resets `Invisible'. */
396 setworn((struct obj *) 0, W_ARMC);
400 case CLOAK_OF_PROTECTION:
401 case CLOAK_OF_MAGIC_RESISTANCE:
407 toggle_stealth(otmp, oldprop, FALSE);
409 case CLOAK_OF_DISPLACEMENT:
410 toggle_displacement(otmp, oldprop, FALSE);
413 if (Invis && !Blind) {
416 You("can %s.", See_invisible ? "see through yourself"
417 : "no longer see yourself");
419 pline("%s
\81D", See_invisible ? "
\82 \82È
\82½
\82Í
\93§
\96¾
\82É
\82È
\82Á
\82½"
420 : "
\8e©
\95ª
\8e©
\90g
\82ª
\8c©
\82¦
\82È
\82
\82È
\82Á
\82½");
424 case CLOAK_OF_INVISIBILITY:
425 if (!oldprop && !HInvis && !Blind) {
426 makeknown(CLOAK_OF_INVISIBILITY);
429 pline("Suddenly you can %s.",
430 See_invisible ? "no longer see through yourself"
433 pline("
\93Ë
\91R
\81C%s
\81D",
434 See_invisible ? "
\82 \82È
\82½
\82Í
\93§
\96¾
\82Å
\82È
\82
\82È
\82Á
\82½"
435 : "
\8e©
\95ª
\8e©
\90g
\82ª
\8c©
\82¦
\82é
\82æ
\82¤
\82É
\82È
\82Á
\82½");
439 /* Alchemy smock gives poison _and_ acid resistance */
441 EAcid_resistance &= ~WORN_CLOAK;
444 impossible(unknown_type, c_cloak, otyp);
453 switch (uarmh->otyp) {
457 case ELVEN_LEATHER_HELM:
458 case DWARVISH_IRON_HELM:
460 case HELM_OF_TELEPATHY:
462 case HELM_OF_BRILLIANCE:
463 adj_abon(uarmh, uarmh->spe);
466 /* people think marked wizards know what they're talking
467 * about, but it takes trained arrogance to pull it off,
468 * and the actual enchantment of the hat is irrelevant.
470 ABON(A_CHA) += (Role_if(PM_WIZARD) ? 1 : -1);
472 makeknown(uarmh->otyp);
474 case HELM_OF_OPPOSITE_ALIGNMENT:
475 /* changing alignment can toggle off active artifact
476 properties, including levitation; uarmh could get
477 dropped or destroyed here */
478 uchangealign((u.ualign.type != A_NEUTRAL)
480 : (uarmh->o_id % 2) ? A_CHAOTIC : A_LAWFUL,
482 /* makeknown(uarmh->otyp); -- moved below, after xname() */
485 if (uarmh && !uarmh->cursed) {
488 pline("%s for a moment.", Tobjnam(uarmh, "vibrate"));
490 pline("%s
\82Í
\88ê
\8fu
\90k
\82¦
\82½
\81D", xname(uarmh));
493 pline("%s %s for a moment.", Tobjnam(uarmh, "glow"),
496 pline("%s
\82Í
\88ê
\8fu%s
\8bP
\82¢
\82½
\81D",
497 xname(uarmh), jconj_adj(hcolor(NH_BLACK)));
501 context.botl = 1; /* reveal new alignment or INT & WIS */
504 pline("My brain hurts!"); /* Monty Python's Flying Circus */
506 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Ç*/
508 } else if (uarmh && uarmh->otyp == DUNCE_CAP) {
510 You_feel("%s.", /* track INT change; ignore WIS */
512 <= (ABASE(A_INT) + ABON(A_INT) + ATEMP(A_INT))
513 ? "like sitting in a corner"
516 You("%s
\82æ
\82¤
\82È
\8bC
\82ª
\82µ
\82½
\81D",
518 <= (ABASE(A_INT) + ABON(A_INT) + ATEMP(A_INT))
519 ? "
\8b÷
\82Á
\82±
\82É
\8dÀ
\82Á
\82Ä
\82¢
\82é"
520 : "
\96Ú
\82ª
\82Ü
\82í
\82Á
\82½");
523 /* [message moved to uchangealign()] */
524 makeknown(HELM_OF_OPPOSITE_ALIGNMENT);
528 impossible(unknown_type, c_helmet, uarmh->otyp);
534 Helmet_off(VOID_ARGS)
536 context.takeoff.mask &= ~W_ARMH;
538 switch (uarmh->otyp) {
542 case ELVEN_LEATHER_HELM:
543 case DWARVISH_IRON_HELM:
550 if (!context.takeoff.cancelled_don) {
551 ABON(A_CHA) += (Role_if(PM_WIZARD) ? -1 : 1);
555 case HELM_OF_TELEPATHY:
556 /* need to update ability before calling see_monsters() */
557 setworn((struct obj *) 0, W_ARMH);
560 case HELM_OF_BRILLIANCE:
561 if (!context.takeoff.cancelled_don)
562 adj_abon(uarmh, -uarmh->spe);
564 case HELM_OF_OPPOSITE_ALIGNMENT:
565 /* changing alignment can toggle off active artifact
566 properties, including levitation; uarmh could get
567 dropped or destroyed here */
568 uchangealign(u.ualignbase[A_CURRENT], 2);
571 impossible(unknown_type, c_helmet, uarmh->otyp);
573 setworn((struct obj *) 0, W_ARMH);
574 context.takeoff.cancelled_don = FALSE;
583 u.uprops[objects[uarmg->otyp].oc_oprop].extrinsic & ~WORN_GLOVES;
585 switch (uarmg->otyp) {
588 case GAUNTLETS_OF_FUMBLING:
589 if (!oldprop && !(HFumbling & ~TIMEOUT))
590 incr_itimeout(&HFumbling, rnd(20));
592 case GAUNTLETS_OF_POWER:
593 makeknown(uarmg->otyp);
594 context.botl = 1; /* taken care of in attrib.c */
596 case GAUNTLETS_OF_DEXTERITY:
597 adj_abon(uarmg, uarmg->spe);
600 impossible(unknown_type, c_gloves, uarmg->otyp);
606 wielding_corpse(obj, voluntary)
608 boolean voluntary; /* taking gloves off on purpose? */
612 if (!obj || obj->otyp != CORPSE)
614 if (obj != uwep && (obj != uswapwep || !u.twoweap))
617 if (touch_petrifies(&mons[obj->corpsenm]) && !Stone_resistance) {
619 You("now wield %s in your bare %s.",
620 corpse_xname(obj, (const char *) 0, CXN_ARTICLE),
621 makeplural(body_part(HAND)));
623 You("%s
\82ð
\91f%s
\82Å
\8e\9d\82Á
\82½
\81D",
624 corpse_xname(obj, (const char *) 0, CXN_ARTICLE),
628 Sprintf(kbuf, "%s gloves while wielding %s",
629 voluntary ? "removing" : "losing", killer_xname(obj));
631 Sprintf(kbuf, "%s
\82ð
\8e\9d\82Á
\82Ä
\82¢
\82é
\82Æ
\82«
\82É
\8eè
\91Ü
\82ð%s",
632 killer_xname(obj), voluntary ? "
\8aO
\82µ
\82Ä" : "
\8e¸
\82Á
\82Ä");
635 /* life-saved; can't continue wielding cockatrice corpse though */
636 remove_worn_item(obj, FALSE);
641 Gloves_off(VOID_ARGS)
644 u.uprops[objects[uarmg->otyp].oc_oprop].extrinsic & ~WORN_GLOVES;
645 boolean on_purpose = !context.mon_moving && !uarmg->in_use;
647 context.takeoff.mask &= ~W_ARMG;
649 switch (uarmg->otyp) {
652 case GAUNTLETS_OF_FUMBLING:
653 if (!oldprop && !(HFumbling & ~TIMEOUT))
654 HFumbling = EFumbling = 0;
656 case GAUNTLETS_OF_POWER:
657 makeknown(uarmg->otyp);
658 context.botl = 1; /* taken care of in attrib.c */
660 case GAUNTLETS_OF_DEXTERITY:
661 if (!context.takeoff.cancelled_don)
662 adj_abon(uarmg, -uarmg->spe);
665 impossible(unknown_type, c_gloves, uarmg->otyp);
667 setworn((struct obj *) 0, W_ARMG);
668 context.takeoff.cancelled_don = FALSE;
669 (void) encumber_msg(); /* immediate feedback for GoP */
671 /* prevent wielding cockatrice when not wearing gloves */
672 if (uwep && uwep->otyp == CORPSE)
673 wielding_corpse(uwep, on_purpose);
675 /* KMH -- ...or your secondary weapon when you're wielding it
676 [This case can't actually happen; twoweapon mode won't
677 engage if a corpse has been set up as the alternate weapon.] */
678 if (u.twoweap && uswapwep && uswapwep->otyp == CORPSE)
679 wielding_corpse(uswapwep, on_purpose);
687 /* no shield currently requires special handling when put on, but we
688 keep this uncommented in case somebody adds a new one which does */
689 switch (uarms->otyp) {
692 case URUK_HAI_SHIELD:
694 case DWARVISH_ROUNDSHIELD:
696 case SHIELD_OF_REFLECTION:
699 impossible(unknown_type, c_shield, uarms->otyp);
706 Shield_off(VOID_ARGS)
708 context.takeoff.mask &= ~W_ARMS;
710 /* no shield currently requires special handling when taken off, but we
711 keep this uncommented in case somebody adds a new one which does */
712 switch (uarms->otyp) {
715 case URUK_HAI_SHIELD:
717 case DWARVISH_ROUNDSHIELD:
719 case SHIELD_OF_REFLECTION:
722 impossible(unknown_type, c_shield, uarms->otyp);
725 setworn((struct obj *) 0, W_ARMS);
732 /* no shirt currently requires special handling when put on, but we
733 keep this uncommented in case somebody adds a new one which does */
734 switch (uarmu->otyp) {
739 impossible(unknown_type, c_shirt, uarmu->otyp);
748 context.takeoff.mask &= ~W_ARMU;
750 /* no shirt currently requires special handling when taken off, but we
751 keep this uncommented in case somebody adds a new one which does */
752 switch (uarmu->otyp) {
757 impossible(unknown_type, c_shirt, uarmu->otyp);
760 setworn((struct obj *) 0, W_ARMU);
764 /* This must be done in worn.c, because one of the possible intrinsics
765 * conferred is fire resistance, and we have to immediately set
766 * HFire_resistance in worn.c since worn.c will check it before returning.
778 context.takeoff.mask &= ~W_ARM;
779 setworn((struct obj *) 0, W_ARM);
780 context.takeoff.cancelled_don = FALSE;
784 /* The gone functions differ from the off functions in that if you die from
785 * taking it off and have life saving, you still die.
790 context.takeoff.mask &= ~W_ARM;
792 context.takeoff.cancelled_don = FALSE;
799 /* make sure amulet isn't wielded; can't use remove_worn_item()
800 here because it has already been set worn in amulet slot */
802 setuwep((struct obj *) 0);
803 else if (uamul == uswapwep)
804 setuswapwep((struct obj *) 0);
805 else if (uamul == uquiver)
806 setuqwep((struct obj *) 0);
808 switch (uamul->otyp) {
810 case AMULET_OF_LIFE_SAVING:
811 case AMULET_VERSUS_POISON:
812 case AMULET_OF_REFLECTION:
813 case AMULET_OF_MAGICAL_BREATHING:
814 case FAKE_AMULET_OF_YENDOR:
816 case AMULET_OF_UNCHANGING:
818 make_slimed(0L, (char *) 0);
820 case AMULET_OF_CHANGE: {
821 int orig_sex = poly_gender();
826 /* Don't use same message as polymorph */
827 if (orig_sex != poly_gender()) {
828 makeknown(AMULET_OF_CHANGE);
830 You("are suddenly very %s!",
831 flags.female ? "feminine" : "masculine");
833 You("
\93Ë
\91R%s
\82Á
\82Û
\82
\82È
\82Á
\82½
\81I",
834 flags.female ? "
\8f\97" : "
\92j");
838 /* already polymorphed into single-gender monster; only
839 changed the character's base sex */
841 You("don't feel like yourself.");
843 You("
\8e©
\95ª
\8e©
\90g
\82¶
\82á
\82È
\82
\82È
\82Á
\82½
\8bC
\82ª
\82µ
\82½
\81D");
845 pline_The("amulet disintegrates!");
847 pline("
\96\82\8f\9c\82¯
\82Í
\82±
\82È
\82²
\82È
\82É
\82È
\82Á
\82½
\81I");
848 if (orig_sex == poly_gender() && uamul->dknown
849 && !objects[AMULET_OF_CHANGE].oc_name_known
850 && !objects[AMULET_OF_CHANGE].oc_uname)
855 case AMULET_OF_STRANGULATION:
856 if (can_be_strangled(&youmonst)) {
857 makeknown(AMULET_OF_STRANGULATION);
861 pline("It constricts your throat!");
863 pline("
\96\82\8f\9c\82¯
\82Í
\82 \82È
\82½
\82Ì
\8dA
\82ð
\8di
\82ß
\82Â
\82¯
\82½
\81I");
866 case AMULET_OF_RESTFUL_SLEEP: {
867 long newnap = (long) rnd(100), oldnap = (HSleepy & TIMEOUT);
869 /* avoid clobbering FROMOUTSIDE bit, which might have
870 gotten set by previously eating one of these amulets */
871 if (newnap < oldnap || oldnap == 0L)
872 HSleepy = (HSleepy & ~TIMEOUT) | newnap;
874 case AMULET_OF_YENDOR:
882 context.takeoff.mask &= ~W_AMUL;
884 switch (uamul->otyp) {
886 /* need to update ability before calling see_monsters() */
887 setworn((struct obj *) 0, W_AMUL);
890 case AMULET_OF_LIFE_SAVING:
891 case AMULET_VERSUS_POISON:
892 case AMULET_OF_REFLECTION:
893 case AMULET_OF_CHANGE:
894 case AMULET_OF_UNCHANGING:
895 case FAKE_AMULET_OF_YENDOR:
897 case AMULET_OF_MAGICAL_BREATHING:
899 /* HMagical_breathing must be set off
900 before calling drown() */
901 setworn((struct obj *) 0, W_AMUL);
902 if (!breathless(youmonst.data) && !amphibious(youmonst.data)
905 You("suddenly inhale an unhealthy amount of %s!",
908 You("
\93Ë
\91R
\81C
\91å
\97Ê
\82Ì%s
\82ð
\88ù
\82Ý
\8d\9e\82ñ
\82¾
\81I",
916 case AMULET_OF_STRANGULATION:
922 Your("%s is no longer constricted!", body_part(NECK));
924 pline("%s
\82ª
\8ay
\82É
\82È
\82Á
\82½
\81I", body_part(NECK));
927 You("can breathe more easily!");
929 You("
\8ay
\82É
\8cÄ
\8bz
\82Å
\82«
\82é
\82æ
\82¤
\82É
\82È
\82Á
\82½
\81I");
932 case AMULET_OF_RESTFUL_SLEEP:
933 setworn((struct obj *) 0, W_AMUL);
934 /* HSleepy = 0L; -- avoid clobbering FROMOUTSIDE bit */
935 if (!ESleepy && !(HSleepy & ~TIMEOUT))
936 HSleepy &= ~TIMEOUT; /* clear timeout bits */
938 case AMULET_OF_YENDOR:
941 setworn((struct obj *) 0, W_AMUL);
945 /* handle ring discovery; comparable to learnwand() */
947 learnring(ring, observed)
951 int ringtype = ring->otyp;
953 /* if effect was observeable then we usually discover the type */
955 /* if we already know the ring type which accomplishes this
956 effect (assumes there is at most one type for each effect),
957 mark this ring as having been seen (no need for makeknown);
958 otherwise if we have seen this ring, discover its type */
959 if (objects[ringtype].oc_name_known)
961 else if (ring->dknown)
963 #if 0 /* see learnwand() */
969 /* make enchantment of charged ring known (might be +0) and update
970 perm invent window if we've seen this ring and know its type */
971 if (ring->dknown && objects[ringtype].oc_name_known) {
972 if (objects[ringtype].oc_charged)
980 register struct obj *obj;
982 long oldprop = u.uprops[objects[obj->otyp].oc_oprop].extrinsic;
983 int old_attrib, which;
986 /* make sure ring isn't wielded; can't use remove_worn_item()
987 here because it has already been set worn in a ring slot */
989 setuwep((struct obj *) 0);
990 else if (obj == uswapwep)
991 setuswapwep((struct obj *) 0);
992 else if (obj == uquiver)
993 setuqwep((struct obj *) 0);
995 /* only mask out W_RING when we don't have both
996 left and right rings of the same type */
997 if ((oldprop & W_RING) != W_RING)
1000 switch (obj->otyp) {
1001 case RIN_TELEPORTATION:
1002 case RIN_REGENERATION:
1005 case RIN_AGGRAVATE_MONSTER:
1006 case RIN_POISON_RESISTANCE:
1007 case RIN_FIRE_RESISTANCE:
1008 case RIN_COLD_RESISTANCE:
1009 case RIN_SHOCK_RESISTANCE:
1011 case RIN_TELEPORT_CONTROL:
1013 case RIN_POLYMORPH_CONTROL:
1014 case RIN_FREE_ACTION:
1015 case RIN_SLOW_DIGESTION:
1016 case RIN_SUSTAIN_ABILITY:
1020 toggle_stealth(obj, oldprop, TRUE);
1025 case RIN_SEE_INVISIBLE:
1026 /* can now see invisible monsters */
1027 set_mimic_blocking(); /* do special mimic handling */
1030 if (Invis && !oldprop && !HSee_invisible && !Blind) {
1033 pline("Suddenly you are transparent, but there!");
1035 pline("
\93Ë
\91R
\93§
\96¾
\82É
\82È
\82Á
\82½
\81D
\82µ
\82©
\82µ
\91¶
\8dÝ
\82Í
\82µ
\82Ä
\82¢
\82é
\81I");
1036 learnring(obj, TRUE);
1039 case RIN_INVISIBILITY:
1040 if (!oldprop && !HInvis && !BInvis && !Blind) {
1041 learnring(obj, TRUE);
1043 self_invis_message();
1046 case RIN_LEVITATION:
1047 if (!oldprop && !HLevitation && !BLevitation) {
1049 learnring(obj, TRUE);
1050 spoteffects(FALSE); /* for sinks */
1052 float_vs_flight(); /* maybe toggle (BFlying & I_SPECIAL) */
1055 case RIN_GAIN_STRENGTH:
1058 case RIN_GAIN_CONSTITUTION:
1064 old_attrib = ACURR(which);
1065 ABON(which) += obj->spe;
1066 observable = (old_attrib != ACURR(which));
1067 /* if didn't change, usually means ring is +0 but might
1068 be because nonzero couldn't go below min or above max;
1069 learn +0 enchantment if attribute value is not stuck
1070 at a limit [and ring has been seen and its type is
1071 already discovered, both handled by learnring()] */
1072 if (observable || !extremeattr(which))
1073 learnring(obj, observable);
1076 case RIN_INCREASE_ACCURACY: /* KMH */
1077 u.uhitinc += obj->spe;
1079 case RIN_INCREASE_DAMAGE:
1080 u.udaminc += obj->spe;
1082 case RIN_PROTECTION_FROM_SHAPE_CHAN:
1085 case RIN_PROTECTION:
1086 /* usually learn enchantment and discover type;
1087 won't happen if ring is unseen or if it's +0
1088 and the type hasn't been discovered yet */
1089 observable = (obj->spe != 0);
1090 learnring(obj, observable);
1092 find_ac(); /* updates botl */
1098 Ring_off_or_gone(obj, gone)
1099 register struct obj *obj;
1102 long mask = (obj->owornmask & W_RING);
1103 int old_attrib, which;
1106 context.takeoff.mask &= ~mask;
1107 if (!(u.uprops[objects[obj->otyp].oc_oprop].extrinsic & mask))
1108 impossible("Strange... I didn't know you had that ring.");
1112 setworn((struct obj *) 0, obj->owornmask);
1114 switch (obj->otyp) {
1115 case RIN_TELEPORTATION:
1116 case RIN_REGENERATION:
1119 case RIN_AGGRAVATE_MONSTER:
1120 case RIN_POISON_RESISTANCE:
1121 case RIN_FIRE_RESISTANCE:
1122 case RIN_COLD_RESISTANCE:
1123 case RIN_SHOCK_RESISTANCE:
1125 case RIN_TELEPORT_CONTROL:
1127 case RIN_POLYMORPH_CONTROL:
1128 case RIN_FREE_ACTION:
1129 case RIN_SLOW_DIGESTION:
1130 case RIN_SUSTAIN_ABILITY:
1134 toggle_stealth(obj, (EStealth & ~mask), FALSE);
1139 case RIN_SEE_INVISIBLE:
1140 /* Make invisible monsters go away */
1141 if (!See_invisible) {
1142 set_mimic_blocking(); /* do special mimic handling */
1146 if (Invisible && !Blind) {
1149 pline("Suddenly you cannot see yourself.");
1151 pline("
\93Ë
\91R
\81C
\8e©
\95ª
\8e©
\90g
\82ª
\8c©
\82¦
\82È
\82
\82È
\82Á
\82½
\81D");
1152 learnring(obj, TRUE);
1155 case RIN_INVISIBILITY:
1156 if (!Invis && !BInvis && !Blind) {
1159 Your("body seems to unfade%s.",
1160 See_invisible ? " completely" : "..");
1162 Your("
\91Ì
\82ª%s
\81D",
1163 See_invisible ? "
\8a®
\91S
\82É
\8c»
\82í
\82ê
\82½" : "
\8e\9f\91æ
\82É
\8c»
\82í
\82ê
\82Ä
\82«
\82½
\81D
\81D");
1165 learnring(obj, TRUE);
1168 case RIN_LEVITATION:
1170 (void) float_down(0L, 0L);
1172 learnring(obj, TRUE);
1174 float_vs_flight(); /* maybe toggle (BFlying & I_SPECIAL) */
1177 case RIN_GAIN_STRENGTH:
1180 case RIN_GAIN_CONSTITUTION:
1186 old_attrib = ACURR(which);
1187 ABON(which) -= obj->spe;
1188 observable = (old_attrib != ACURR(which));
1189 /* same criteria as Ring_on() */
1190 if (observable || !extremeattr(which))
1191 learnring(obj, observable);
1194 case RIN_INCREASE_ACCURACY: /* KMH */
1195 u.uhitinc -= obj->spe;
1197 case RIN_INCREASE_DAMAGE:
1198 u.udaminc -= obj->spe;
1200 case RIN_PROTECTION:
1201 /* might have been put on while blind and we can now see
1202 or perhaps been forgotten due to amnesia */
1203 observable = (obj->spe != 0);
1204 learnring(obj, observable);
1206 find_ac(); /* updates botl */
1208 case RIN_PROTECTION_FROM_SHAPE_CHAN:
1209 /* If you're no longer protected, let the chameleons
1210 * change shape again -dgk
1221 Ring_off_or_gone(obj, FALSE);
1228 Ring_off_or_gone(obj, TRUE);
1233 register struct obj *otmp;
1235 boolean already_blind = Blind, changed = FALSE;
1237 /* blindfold might be wielded; release it for wearing */
1238 if (otmp->owornmask & W_WEAPON)
1239 remove_worn_item(otmp, FALSE);
1240 setworn(otmp, W_TOOL);
1243 if (Blind && !already_blind) {
1247 You_cant("see any more.");
1249 You("
\89½
\82à
\8c©
\82¦
\82È
\82
\82È
\82Á
\82½
\81D");
1250 /* set ball&chain variables before the hero goes blind */
1253 } else if (already_blind && !Blind) {
1255 /* "You are now wearing the Eyes of the Overworld." */
1256 if (u.uroleplay.blind) {
1257 /* this can only happen by putting on the Eyes of the Overworld;
1258 that shouldn't actually produce a permanent cure, but we
1259 can't let the "blind from birth" conduct remain intact */
1261 pline("For the first time in your life, you can see!");
1263 pline("
\90l
\90¶
\82Å
\8f\89\82ß
\82Ä
\81C
\96Ú
\82ª
\8c©
\82¦
\82é
\82æ
\82¤
\82É
\82È
\82Á
\82½
\81I");
1264 u.uroleplay.blind = FALSE;
1269 You("
\96Ú
\82ª
\8c©
\82¦
\82é
\82æ
\82¤
\82É
\82È
\82Á
\82½
\81I");
1272 /* blindness has just been toggled */
1273 if (Blind_telepat || Infravision)
1275 vision_full_recalc = 1; /* recalc vision limits */
1277 learn_unseen_invent();
1284 register struct obj *otmp;
1286 boolean was_blind = Blind, changed = FALSE;
1289 impossible("Blindf_off without otmp");
1292 context.takeoff.mask &= ~W_TOOL;
1293 setworn((struct obj *) 0, otmp->owornmask);
1298 /* "still cannot see" makes no sense when removing lenses
1299 since they can't have been the cause of your blindness */
1300 if (otmp->otyp != LENSES)
1302 You("still cannot see.");
1304 You("
\82Ü
\82¾
\96Ú
\82ª
\8c©
\82¦
\82È
\82¢
\81D");
1306 changed = TRUE; /* !was_blind */
1307 /* "You were wearing the Eyes of the Overworld." */
1309 You_cant("see anything now!");
1311 You("
\8d¡
\82Í
\89½
\82à
\8c©
\82é
\82±
\82Æ
\82ª
\82Å
\82«
\82È
\82¢
\81I");
1312 /* set ball&chain variables before the hero goes blind */
1316 } else if (was_blind) {
1317 if (!gulp_blnd_check()) {
1318 changed = TRUE; /* !Blind */
1320 You("can see again.");
1322 You("
\82Ó
\82½
\82½
\82Ñ
\96Ú
\82ª
\8c©
\82¦
\82é
\82æ
\82¤
\82É
\82È
\82Á
\82½
\81D");
1326 /* blindness has just been toggled */
1327 if (Blind_telepat || Infravision)
1329 vision_full_recalc = 1; /* recalc vision limits */
1331 learn_unseen_invent();
1336 /* called in moveloop()'s prologue to set side-effects of worn start-up items;
1337 also used by poly_obj() when a worn item gets transformed */
1340 struct obj *obj; /* if null, do all worn items; otherwise just obj itself */
1344 if (!obj ? ublindf != 0 : (obj == ublindf))
1345 (void) Blindf_on(ublindf);
1346 if (!obj ? uright != 0 : (obj == uright))
1347 (void) Ring_on(uright);
1348 if (!obj ? uleft != 0 : (obj == uleft))
1349 (void) Ring_on(uleft);
1350 if (!obj ? uamul != 0 : (obj == uamul))
1353 if (!obj ? uarmu != 0 : (obj == uarmu))
1355 if (!obj ? uarm != 0 : (obj == uarm))
1357 if (!obj ? uarmc != 0 : (obj == uarmc))
1359 if (!obj ? uarmf != 0 : (obj == uarmf))
1361 if (!obj ? uarmg != 0 : (obj == uarmg))
1363 if (!obj ? uarmh != 0 : (obj == uarmh))
1365 if (!obj ? uarms != 0 : (obj == uarms))
1368 initial_don = FALSE;
1371 /* check whether the target object is currently being put on (or taken off--
1372 also checks for doffing--[why?]) */
1377 boolean result = FALSE;
1379 /* 'W' (or 'P' used for armor) sets afternmv */
1382 else if (otmp == uarm)
1383 result = (afternmv == Armor_on);
1384 else if (otmp == uarmu)
1385 result = (afternmv == Shirt_on);
1386 else if (otmp == uarmc)
1387 result = (afternmv == Cloak_on);
1388 else if (otmp == uarmf)
1389 result = (afternmv == Boots_on);
1390 else if (otmp == uarmh)
1391 result = (afternmv == Helmet_on);
1392 else if (otmp == uarmg)
1393 result = (afternmv == Gloves_on);
1394 else if (otmp == uarms)
1395 result = (afternmv == Shield_on);
1400 /* check whether the target object is currently being taken off,
1401 so that stop_donning() and steal() can vary messages */
1406 long what = context.takeoff.what;
1407 boolean result = FALSE;
1409 /* 'T' (or 'R' used for armor) sets afternmv, 'A' sets takeoff.what */
1411 result = (afternmv == Armor_off || what == WORN_ARMOR);
1412 else if (otmp == uarmu)
1413 result = (afternmv == Shirt_off || what == WORN_SHIRT);
1414 else if (otmp == uarmc)
1415 result = (afternmv == Cloak_off || what == WORN_CLOAK);
1416 else if (otmp == uarmf)
1417 result = (afternmv == Boots_off || what == WORN_BOOTS);
1418 else if (otmp == uarmh)
1419 result = (afternmv == Helmet_off || what == WORN_HELMET);
1420 else if (otmp == uarmg)
1421 result = (afternmv == Gloves_off || what == WORN_GLOVES);
1422 else if (otmp == uarms)
1423 result = (afternmv == Shield_off || what == WORN_SHIELD);
1424 /* these 1-turn items don't need 'afternmv' checks */
1425 else if (otmp == uamul)
1426 result = (what == WORN_AMUL);
1427 else if (otmp == uleft)
1428 result = (what == LEFT_RING);
1429 else if (otmp == uright)
1430 result = (what == RIGHT_RING);
1431 else if (otmp == ublindf)
1432 result = (what == WORN_BLINDF);
1433 else if (otmp == uwep)
1434 result = (what == W_WEP);
1435 else if (otmp == uswapwep)
1436 result = (what == W_SWAPWEP);
1437 else if (otmp == uquiver)
1438 result = (what == W_QUIVER);
1443 /* despite their names, cancel_don() and cancel_doff() both apply to both
1444 donning and doffing... */
1446 cancel_doff(obj, slotmask)
1450 /* Called by setworn() for old item in specified slot or by setnotworn()
1451 * for specified item. We don't want to call cancel_don() if we got
1452 * here via <X>_off() -> setworn((struct obj *)0) -> cancel_doff()
1453 * because that would stop the 'A' command from continuing with next
1454 * selected item. So do_takeoff() sets a flag in takeoff.mask for us.
1455 * [For taking off an individual item with 'T'/'R'/'w-', it doesn't
1456 * matter whether cancel_don() gets called here--the item has already
1457 * been removed by now.]
1459 if (!(context.takeoff.mask & I_SPECIAL) && donning(obj))
1460 cancel_don(); /* applies to doffing too */
1461 context.takeoff.mask &= ~slotmask;
1464 /* despite their names, cancel_don() and cancel_doff() both apply to both
1465 donning and doffing... */
1469 /* the piece of armor we were donning/doffing has vanished, so stop
1470 * wasting time on it (and don't dereference it when donning would
1473 context.takeoff.cancelled_don =
1474 (afternmv == Boots_on || afternmv == Helmet_on
1475 || afternmv == Gloves_on || afternmv == Armor_on);
1476 afternmv = (int NDECL((*))) 0;
1477 nomovemsg = (char *) 0;
1479 context.takeoff.delay = 0;
1480 context.takeoff.what = 0L;
1483 /* called by steal() during theft from hero; interrupt donning/doffing */
1485 stop_donning(stolenobj)
1486 struct obj *stolenobj; /* no message if stolenobj is already being doffing */
1493 for (otmp = invent; otmp; otmp = otmp->nobj)
1494 if ((otmp->owornmask & W_ARMOR) && donning(otmp))
1496 /* at most one item will pass donning() test at any given time */
1500 /* donning() returns True when doffing too; doffing() is more specific */
1501 putting_on = !doffing(otmp);
1502 /* cancel_don() looks at afternmv; it can also cancel doffing */
1504 /* don't want <armor>_on() or <armor>_off() being called
1505 by unmul() since the on or off action isn't completing */
1506 afternmv = (int NDECL((*))) 0;
1507 if (putting_on || otmp != stolenobj) {
1509 Sprintf(buf, "You stop %s %s.",
1510 putting_on ? "putting on" : "taking off",
1511 thesimpleoname(otmp));
1513 Sprintf(buf, "
\82 \82È
\82½
\82Í%s
\82ð%s
\82Ì
\82ð
\8e~
\82ß
\82½
\81D",
1514 thesimpleoname(otmp),
1515 putting_on ? "
\90g
\82É
\82Â
\82¯
\82é" : "
\8aO
\82·");
1518 buf[0] = '\0'; /* silently stop doffing stolenobj */
1519 result = -multi; /* remember this before calling unmul() */
1522 /* while putting on, item becomes worn immediately but side-effects are
1523 deferred until the delay expires; when interrupted, make it unworn
1524 (while taking off, item stays worn until the delay expires; when
1525 interrupted, leave it worn) */
1527 remove_worn_item(otmp, FALSE);
1532 /* both 'clothes' and 'accessories' now include both armor and accessories;
1533 TOOL_CLASS is for eyewear, FOOD_CLASS is for MEAT_RING */
1534 static NEARDATA const char clothes[] = {
1535 ARMOR_CLASS, RING_CLASS, AMULET_CLASS, TOOL_CLASS, FOOD_CLASS, 0
1537 static NEARDATA const char accessories[] = {
1538 RING_CLASS, AMULET_CLASS, TOOL_CLASS, FOOD_CLASS, ARMOR_CLASS, 0
1540 STATIC_VAR NEARDATA int Narmorpieces, Naccessories;
1542 /* assign values to Narmorpieces and Naccessories */
1544 count_worn_stuff(which, accessorizing)
1545 struct obj **which; /* caller wants this when count is 1 */
1546 boolean accessorizing;
1550 Narmorpieces = Naccessories = 0;
1552 #define MOREWORN(x,wtyp) do { if (x) { wtyp++; otmp = x; } } while (0)
1554 MOREWORN(uarmh, Narmorpieces);
1555 MOREWORN(uarms, Narmorpieces);
1556 MOREWORN(uarmg, Narmorpieces);
1557 MOREWORN(uarmf, Narmorpieces);
1558 /* for cloak/suit/shirt, we only count the outermost item so that it
1559 can be taken off without confirmation if final count ends up as 1 */
1561 MOREWORN(uarmc, Narmorpieces);
1563 MOREWORN(uarm, Narmorpieces);
1565 MOREWORN(uarmu, Narmorpieces);
1567 *which = otmp; /* default item iff Narmorpieces is 1 */
1570 MOREWORN(uleft, Naccessories);
1571 MOREWORN(uright, Naccessories);
1572 MOREWORN(uamul, Naccessories);
1573 MOREWORN(ublindf, Naccessories);
1575 *which = otmp; /* default item iff Naccessories is 1 */
1579 /* take off one piece or armor or one accessory;
1580 shared by dotakeoff('T') and doremring('R') */
1582 armor_or_accessory_off(obj)
1589 if (!(obj->owornmask & (W_ARMOR | W_ACCESSORY))) {
1591 You("are not wearing that.");
1593 You("
\82»
\82ê
\82ð
\90g
\82É
\82Â
\82¯
\82Ä
\82¢
\82È
\82¢
\81D");
1597 || ((obj == uarm) && uarmc)
1598 || ((obj == uarmu) && (uarmc || uarm))) {
1599 char why[QBUFSZ], what[QBUFSZ];
1601 why[0] = what[0] = '\0';
1604 Strcat(what, cloak_simple_name(uarmc));
1605 if ((obj == uarmu) && uarm) {
1607 Strcat(what, " and ");
1608 Strcat(what, suit_simple_name(uarm));
1610 Sprintf(why, " without taking off your %s first", what);
1612 Strcpy(why, "; it's embedded");
1615 You_cant("take that off%s.", why);
1617 m = joffmsg(obj, &j);
1618 You("
\82»
\82ê%s%s
\82±
\82Æ
\82Í
\82Å
\82«
\82È
\82¢
\81D", j, m);
1623 reset_remarm(); /* clear context.takeoff.mask and context.takeoff.what */
1624 (void) select_off(obj);
1625 if (!context.takeoff.mask)
1627 /* none of armoroff()/Ring_/Amulet/Blindf_off() use context.takeoff.mask */
1630 if (obj->owornmask & W_ARMOR) {
1631 (void) armoroff(obj);
1632 } else if (obj == uright || obj == uleft) {
1633 /* Sometimes we want to give the off_msg before removing and
1634 * sometimes after; for instance, "you were wearing a moonstone
1635 * ring (on right hand)" is desired but "you were wearing a
1636 * square amulet (being worn)" is not because of the redundant
1641 } else if (obj == uamul) {
1644 } else if (obj == ublindf) {
1645 Blindf_off(obj); /* does its own off_msg */
1647 impossible("removing strange accessory?");
1649 remove_worn_item(obj, FALSE);
1654 /* the 'T' command */
1658 struct obj *otmp = (struct obj *) 0;
1664 count_worn_stuff(&otmp, FALSE);
1665 if (!Narmorpieces && !Naccessories) {
1666 /* assert( GRAY_DRAGON_SCALES > YELLOW_DRAGON_SCALE_MAIL ); */
1669 pline_The("%s merged with your skin!",
1670 uskin->otyp >= GRAY_DRAGON_SCALES
1671 ? "dragon scales are"
1672 : "dragon scale mail is");
1674 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",
1675 uskin->otyp >= GRAY_DRAGON_SCALES
1680 pline("Not wearing any armor or accessories.");
1682 pline("
\8aZ
\82â
\91\95\8fü
\95i
\82ð
\90g
\82É
\82Â
\82¯
\82Ä
\82¢
\82È
\82¢
\81D");
1685 if (Narmorpieces != 1 || ParanoidRemove)
1686 otmp = getobj(clothes, "take off");
1690 return armor_or_accessory_off(otmp);
1693 /* the 'R' command */
1697 struct obj *otmp = 0;
1699 count_worn_stuff(&otmp, TRUE);
1700 if (!Naccessories && !Narmorpieces) {
1702 pline("Not wearing any accessories or armor.");
1704 pline("
\91\95\8fü
\95i
\82â
\8aZ
\82ð
\90g
\82É
\82Â
\82¯
\82Ä
\82¢
\82È
\82¢
\81D");
1707 if (Naccessories != 1 || ParanoidRemove)
1708 otmp = getobj(accessories, "remove");
1712 return armor_or_accessory_off(otmp);
1715 /* Check if something worn is cursed _and_ unremovable. */
1718 register struct obj *otmp;
1721 impossible("cursed without otmp");
1724 /* Curses, like chickens, come home to roost. */
1725 if ((otmp == uwep) ? welded(otmp) : (int) otmp->cursed) {
1727 boolean use_plural = (is_boots(otmp) || is_gloves(otmp)
1728 || otmp->otyp == LENSES || otmp->quan > 1L);
1730 You("can't. %s cursed.", use_plural ? "They are" : "It is");
1732 pline("
\96³
\97\9d\82¾
\81D
\82»
\82ê
\82Í
\8eô
\82í
\82ê
\82Ä
\82¢
\82é
\81D");
1734 otmp->bknown = TRUE;
1742 register struct obj *otmp;
1744 register int delay = -objects[otmp->otyp].oc_delay;
1751 multi_reason = "disrobing";
1753 multi_reason = "
\92E
\82¢
\82Å
\82¢
\82é
\8e\9e\82É";
1754 if (is_helmet(otmp)) {
1757 nomovemsg = !strcmp(helm_simple_name(otmp), "hat")
1759 nomovemsg = !strcmp(helm_simple_name(otmp), "
\96X
\8eq")
1761 ? "You finish taking off your hat."
1763 ? "
\82 \82È
\82½
\82Í
\8a\95\82ð
\92E
\82¬
\82¨
\82¦
\82½
\81D"
1765 : "You finish taking off your helmet.";
1767 : "
\82 \82È
\82½
\82Í
\96X
\8eq
\82ð
\92E
\82¬
\82¨
\82¦
\82½
\81D";
1768 afternmv = Helmet_off;
1769 } else if (is_gloves(otmp)) {
1771 nomovemsg = "You finish taking off your gloves.";
1773 nomovemsg = "
\82 \82È
\82½
\82Í
\8f¬
\8eè
\82ð
\92E
\82¬
\82¨
\82¦
\82½
\81D";
1774 afternmv = Gloves_off;
1775 } else if (is_boots(otmp)) {
1777 nomovemsg = "You finish taking off your boots.";
1779 nomovemsg = "
\82 \82È
\82½
\82Í
\8cC
\82ð
\92E
\82¬
\82¨
\82¦
\82½
\81D";
1780 afternmv = Boots_off;
1783 nomovemsg = "You finish taking off your suit.";
1785 nomovemsg = "
\82 \82È
\82½
\82Í
\92\85\82Ä
\82¢
\82é
\95¨
\82ð
\92E
\82¬
\82¨
\82¦
\82½
\81D";
1786 afternmv = Armor_off;
1789 /* Be warned! We want off_msg after removing the item to
1790 * avoid "You were wearing ____ (being worn)." However, an
1791 * item which grants fire resistance might cause some trouble
1792 * if removed in Hell and lifesaving puts it back on; in this
1793 * case the message will be printed at the wrong time (after
1794 * the messages saying you died and were lifesaved). Luckily,
1795 * no cloak, shield, or fast-removable armor grants fire
1796 * resistance, so we can safely do the off_msg afterwards.
1797 * Rings do grant fire resistance, but for rings we want the
1798 * off_msg before removal anyway so there's no problem. Take
1799 * care in adding armors granting fire resistance; this code
1800 * might need modification.
1801 * 3.2 (actually 3.1 even): that comment is obsolete since
1802 * fire resistance is not required for Gehennom so setworn()
1803 * doesn't force the resistance granting item to be re-worn
1804 * after being lifesaved anymore.
1808 else if (is_shield(otmp))
1809 (void) Shield_off();
1811 setworn((struct obj *) 0, otmp->owornmask & W_ARMOR);
1814 context.takeoff.mask = context.takeoff.what = 0L;
1819 **
\95¨
\82É
\82æ
\82Á
\82Ä
\93®
\8e\8c\82ª
\95Ï
\89»
\82·
\82é
\82Ì
\82Å otmp
\82ð
\92Ç
\89Á
1826 already_wearing(cc, otmp)
1834 m = jconj(jonmsg(otmp, &j), "
\82Ä
\82¢
\82é");
1837 You("are already wearing %s%c", cc, (cc == c_that_) ? '!' : '.');
1839 You("
\82à
\82¤%s%s%s%s", cc, j, m, (cc == c_that_) ? "
\81I" : "
\81D");
1843 already_wearing2(cc1, cc2)
1844 const char *cc1, *cc2;
1847 You_cant("wear %s because you're wearing %s there already.", cc1, cc2);
1849 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);
1853 * canwearobj checks to see whether the player can wear a piece of armor
1855 * inputs: otmp (the piece of armor)
1856 * noisy (if TRUE give error messages, otherwise be quiet about it)
1857 * output: mask (otmp's armor type)
1860 canwearobj(otmp, mask, noisy)
1872 /* this is the same check as for 'W' (dowear), but different message,
1873 in case we get here via 'P' (doputon) */
1874 if (verysmall(youmonst.data) || nohands(youmonst.data)) {
1876 You("can't wear any armor in your current form.");
1880 which = is_cloak(otmp)
1887 if (which && cantweararm(youmonst.data)
1888 /* same exception for cloaks as used in m_dowear() */
1889 && (which != c_cloak || youmonst.data->msize != MZ_SMALL)
1890 && (racial_exception(&youmonst, otmp) < 1)) {
1893 pline_The("%s will not fit on your body.", which);
1895 pline("%s
\82Í
\82 \82È
\82½
\82Ì
\91Ì
\82É
\8d\87\82í
\82È
\82¢
\81D", which);
1897 } else if (otmp->owornmask & W_ARMOR) {
1900 already_wearing(c_that_);
1902 already_wearing(c_that_, otmp);
1907 if (welded(uwep) && bimanual(uwep) && (is_suit(otmp) || is_shirt(otmp))) {
1910 You("cannot do that while holding your %s.",
1912 pline("%s
\82ð
\8e\9d\82Á
\82½
\82Ü
\82Ü
\82Å
\82Í
\82»
\82ê
\82Í
\8fo
\97\88\82È
\82¢
\81D",
1913 is_sword(uwep) ? c_sword : c_weapon);
1917 if (is_helmet(otmp)) {
1921 already_wearing(an(helm_simple_name(uarmh)));
1923 already_wearing(helm_simple_name(uarmh), uarmh);
1926 } else if (Upolyd && has_horns(youmonst.data) && !is_flimsy(otmp)) {
1927 /* (flimsy exception matches polyself handling) */
1930 pline_The("%s won't fit over your horn%s.",
1931 helm_simple_name(otmp),
1932 plur(num_horns(youmonst.data)));
1934 pline("
\8ap
\82ª
\82¶
\82á
\82Ü
\82Å%s
\82ð
\90g
\82É
\82Â
\82¯
\82ç
\82ê
\82È
\82¢
\81D",
1935 helm_simple_name(otmp));
1940 } else if (is_shield(otmp)) {
1944 already_wearing(an(c_shield));
1946 already_wearing(c_shield, uarms);
1949 } else if (uwep && bimanual(uwep)) {
1952 You("cannot wear a shield while wielding a two-handed %s.",
1953 is_sword(uwep) ? c_sword : (uwep->otyp == BATTLE_AXE)
1958 m = jconj(jonmsg(uwep, &j), "
\82Ä
\82¢
\82é");
1959 You("
\97¼
\8eè
\8e\9d\82¿
\82Ì%s%s%s
\82Ì
\82Å
\8f\82\82Å
\90g
\82ð
\8eç
\82ê
\82È
\82¢
\81D",
1960 is_sword(uwep) ? c_sword :
1961 uwep->otyp == BATTLE_AXE ? c_axe : c_weapon,
1966 } else if (u.twoweap) {
1969 You("cannot wear a shield while wielding two weapons.");
1971 You("
\93ñ
\93\81\97¬
\82ð
\82µ
\82Ä
\82¢
\82é
\82Ì
\82Å
\8f\82\82Å
\90g
\82ð
\8eç
\82ê
\82È
\82¢
\81D");
1975 } else if (is_boots(otmp)) {
1979 already_wearing(c_boots);
1981 already_wearing(c_boots, uarmf);
1984 } else if (Upolyd && slithy(youmonst.data)) {
1987 You("have no feet..."); /* not body_part(FOOT) */
1989 You("
\91«
\82ª
\82È
\82¢
\81D
\81D
\81D"); /* not body_part(FOOT) */
1992 } else if (Upolyd && youmonst.data->mlet == S_CENTAUR) {
1993 /* break_armor() pushes boots off for centaurs,
1994 so don't let dowear() put them back on... */
1997 pline("You have too many hooves to wear %s.",
1998 c_boots); /* makeplural(body_part(FOOT)) yields
1999 "rear hooves" which sounds odd */
2001 pline("%s
\82ð
\97\9a\82
\82É
\82Í
\91«
\82ª
\91½
\82·
\82¬
\82é
\81D", c_boots);
2005 && (u.utraptype == TT_BEARTRAP || u.utraptype == TT_INFLOOR
2006 || u.utraptype == TT_LAVA
2007 || u.utraptype == TT_BURIEDBALL)) {
2008 if (u.utraptype == TT_BEARTRAP) {
2011 Your("%s is trapped!", body_part(FOOT));
2013 Your("%s
\82Íã©
\82É
\82©
\82©
\82Á
\82Ä
\82¢
\82é
\81I", body_part(FOOT));
2014 } else if (u.utraptype == TT_INFLOOR || u.utraptype == TT_LAVA) {
2017 Your("%s are stuck in the %s!",
2018 makeplural(body_part(FOOT)), surface(u.ux, u.uy));
2020 Your("%s
\82Í%s
\82É
\82Í
\82Ü
\82Á
\82Ä
\82¢
\82é
\81I",
2021 body_part(FOOT), surface(u.ux, u.uy));
2023 } else { /*TT_BURIEDBALL*/
2026 Your("%s is attached to the buried ball!",
2029 Your("%s
\82Í
\96\84\82Ü
\82Á
\82Ä
\82¢
\82é
\8b\85\82É
\82Â
\82È
\82ª
\82Á
\82Ä
\82¢
\82é
\81I",
2036 } else if (is_gloves(otmp)) {
2040 already_wearing(c_gloves);
2042 already_wearing(c_gloves, uarmg);
2045 } else if (welded(uwep)) {
2048 You("cannot wear gloves over your %s.",
2050 You("%s
\82Ì
\8fã
\82©
\82ç
\8f¬
\8eè
\82ð
\91\95\94õ
\82Å
\82«
\82È
\82¢
\81D",
2051 is_sword(uwep) ? c_sword : c_weapon);
2055 } else if (is_shirt(otmp)) {
2056 if (uarm || uarmc || uarmu) {
2060 already_wearing(an(c_shirt));
2062 already_wearing(c_shirt, uarmu);
2067 You_cant("wear that over your %s.",
2069 You("%s
\82Ì
\8fã
\82©
\82ç
\92\85\82é
\82±
\82Æ
\82Í
\82Å
\82«
\82È
\82¢
\81D",
2070 (uarm && !uarmc) ? c_armor
2071 : cloak_simple_name(uarmc));
2076 } else if (is_cloak(otmp)) {
2080 already_wearing(an(cloak_simple_name(uarmc)));
2082 already_wearing(cloak_simple_name(uarmc), otmp);
2086 } else if (is_suit(otmp)) {
2090 You("cannot wear armor over a %s.", cloak_simple_name(uarmc));
2092 You("%s
\82Ì
\8fã
\82©
\82ç
\92\85\82é
\82±
\82Æ
\82Í
\82Å
\82«
\82È
\82¢
\81D", cloak_simple_name(uarmc));
2097 already_wearing("some armor");
2099 already_wearing("
\8aZ", uarm);
2104 /* getobj can't do this after setting its allow_all flag; that
2105 happens if you have armor for slots that are covered up or
2106 extra armor for slots that are filled */
2109 silly_thing("wear", otmp);
2111 silly_thing("
\90g
\82É
\82Â
\82¯
\82é", otmp);
2114 /* Unnecessary since now only weapons and special items like pick-axes get
2115 * welded to your hand, not armor
2118 if (noisy) weldmsg(otmp);
2126 accessory_or_armor_on(obj)
2130 boolean armor, ring, eyewear;
2132 if (obj->owornmask & (W_ACCESSORY | W_ARMOR)) {
2134 already_wearing(c_that_);
2136 already_wearing(c_that_, obj);
2140 armor = (obj->oclass == ARMOR_CLASS);
2141 ring = (obj->oclass == RING_CLASS || obj->otyp == MEAT_RING);
2142 eyewear = (obj->otyp == BLINDFOLD || obj->otyp == TOWEL
2143 || obj->otyp == LENSES);
2144 /* checks which are performed prior to actually touching the item */
2146 if (!canwearobj(obj, &mask, TRUE))
2149 if (obj->otyp == HELM_OF_OPPOSITE_ALIGNMENT
2150 && qstart_level.dnum == u.uz.dnum) { /* in quest */
2151 if (u.ualignbase[A_CURRENT] == u.ualignbase[A_ORIGINAL])
2153 You("narrowly avoid losing all chance at your goal.");
2155 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");
2156 else /* converted */
2158 You("are suddenly overcome with shame and change your mind.");
2160 You("
\93Ë
\91R
\92p
\82¸
\82©
\82µ
\82
\82È
\82Á
\82Ä
\8dl
\82¦
\82ð
\95Ï
\82¦
\82½
\81D");
2161 u.ublessed = 0; /* lose your god's protection */
2162 makeknown(obj->otyp);
2163 context.botl = 1; /*for AC after zeroing u.ublessed */
2169 char answer, qbuf[QBUFSZ];
2172 if (nolimbs(youmonst.data)) {
2174 You("cannot make the ring stick to your body.");
2176 You("
\8ew
\97Ö
\82ð
\82Í
\82ß
\82ç
\82ê
\82È
\82¢
\91Ì
\82¾
\81D");
2179 if (uleft && uright) {
2181 There("are no more %s%s to fill.",
2182 humanoid(youmonst.data) ? "ring-" : "",
2183 makeplural(body_part(FINGER)));
2185 pline("
\82Í
\82ß
\82é
\82±
\82Æ
\82Ì
\82Å
\82«
\82é%s%s
\82ª
\82È
\82¢
\81D",
2186 humanoid(youmonst.data) ? "
\96ò" : "",
2193 } else if (uright) {
2198 Sprintf(qbuf, "Which %s%s, Right or Left?",
2199 humanoid(youmonst.data) ? "ring-" : "",
2202 Sprintf(qbuf, "
\82Ç
\82¿
\82ç
\82Ì%s%s
\81C
\89E(r)
\82»
\82ê
\82Æ
\82à
\8d¶(l)
\81H",
2203 humanoid(youmonst.data) ? "
\96ò" : "",
2206 answer = yn_function(qbuf, "rl", '\0');
2221 if (uarmg && uarmg->cursed) {
2222 res = !uarmg->bknown;
2225 You("cannot remove your gloves to put on the ring.");
2227 You("
\8ew
\97Ö
\82ð
\82Í
\82ß
\82æ
\82¤
\82Æ
\82µ
\82½
\82ª
\8f¬
\8eè
\82ª
\92E
\82°
\82È
\82¢
\81D");
2228 return res; /* uses move iff we learned gloves are cursed */
2231 res = !uwep->bknown; /* check this before calling welded() */
2232 if ((mask == RIGHT_RING || bimanual(uwep)) && welded(uwep)) {
2233 const char *hand = body_part(HAND);
2235 /* welded will set bknown */
2237 hand = makeplural(hand);
2239 You("cannot free your weapon %s to put on the ring.",
2241 You("
\8ew
\97Ö
\82ð
\82Í
\82ß
\82æ
\82¤
\82Æ
\82µ
\82½
\82ª
\97\98%s
\82Ì
\8e©
\97R
\82ª
\82«
\82©
\82È
\82¢
\81D",
2243 return res; /* uses move iff we learned weapon is cursed */
2246 } else if (obj->oclass == AMULET_CLASS) {
2249 already_wearing("an amulet");
2251 already_wearing("
\96\82\8f\9c\82¯", uamul);
2255 } else if (eyewear) {
2257 if (ublindf->otyp == TOWEL)
2259 Your("%s is already covered by a towel.",
2262 You("
\8aù
\82É
\83^
\83I
\83\8b\82ð
\90g
\82É
\82Â
\82¯
\82Ä
\82¢
\82é
\81D");
2264 else if (ublindf->otyp == BLINDFOLD) {
2265 if (obj->otyp == LENSES)
2267 already_wearing2("lenses", "a blindfold");
2269 already_wearing2("
\83\8c\83\93\83Y", "
\96Ú
\89B
\82µ");
2272 already_wearing("a blindfold");
2274 already_wearing("
\96Ú
\89B
\82µ", ublindf);
2276 } else if (ublindf->otyp == LENSES) {
2277 if (obj->otyp == BLINDFOLD)
2279 already_wearing2("a blindfold", "some lenses");
2281 already_wearing2("
\96Ú
\89B
\82µ", "
\83\8c\83\93\83Y");
2284 already_wearing("some lenses");
2286 already_wearing("
\83\8c\83\93\83Y", ublindf);
2290 already_wearing(something); /* ??? */
2292 already_wearing("
\89½
\82©", ublindf); /* ??? */
2298 /* neither armor nor accessory */
2300 You_cant("wear that!");
2302 You_cant("
\82»
\82ê
\82ð
\90g
\82É
\82Â
\82¯
\82ç
\82ê
\82È
\82¢
\81I");
2307 if (!retouch_object(&obj, FALSE))
2308 return 1; /* costs a turn even though it didn't get worn */
2313 obj->known = 1; /* since AC is shown on the status line */
2314 /* if the armor is wielded, release it for wearing */
2315 if (obj->owornmask & W_WEAPON)
2316 remove_worn_item(obj, FALSE);
2318 delay = -objects[obj->otyp].oc_delay;
2322 multi_reason = "dressing up";
2324 multi_reason = "
\91\95\94õ
\82µ
\82Ä
\82¢
\82é
\8e\9e\82É";
2326 afternmv = Boots_on;
2328 afternmv = Helmet_on;
2330 afternmv = Gloves_on;
2332 afternmv = Armor_on;
2334 nomovemsg = "You finish your dressing maneuver.";
2336 nomovemsg = "
\91\95\94õ
\82µ
\8fI
\82¦
\82½
\81D";
2346 context.takeoff.mask = context.takeoff.what = 0L;
2347 } else { /* not armor */
2348 boolean give_feedback = FALSE;
2350 /* [releasing wielded accessory handled in Xxx_on()] */
2354 give_feedback = TRUE;
2355 } else if (obj->oclass == AMULET_CLASS) {
2356 setworn(obj, W_AMUL);
2358 /* no feedback here if amulet of change got used up */
2359 give_feedback = (uamul != 0);
2360 } else if (eyewear) {
2361 /* setworn() handled by Blindf_on() */
2363 /* message handled by Blindf_on(); leave give_feedback False */
2365 /* feedback for ring or for amulet other than 'change' */
2366 if (give_feedback && is_worn(obj))
2367 prinv((char *) 0, obj, 0L);
2372 /* the 'W' command */
2378 /* cantweararm() checks for suits of armor, not what we want here;
2379 verysmall() or nohands() checks for shields, gloves, etc... */
2380 if (verysmall(youmonst.data) || nohands(youmonst.data)) {
2382 pline("Don't even bother.");
2384 pline("
\82»
\82ñ
\82È
\82Â
\82Ü
\82ç
\82È
\82¢
\82±
\82Æ
\82É
\82±
\82¾
\82í
\82é
\82È
\81D");
2387 if (uarm && uarmu && uarmc && uarmh && uarms && uarmg && uarmf
2388 && uleft && uright && uamul && ublindf) {
2389 /* 'W' message doesn't mention accessories */
2391 You("are already wearing a full complement of armor.");
2393 You("
\82·
\82Å
\82É
\8a®
\91S
\91\95\94õ
\82µ
\82Ä
\82¢
\82é
\81D");
2396 otmp = getobj(clothes, "wear");
2397 return otmp ? accessory_or_armor_on(otmp) : 0;
2400 /* the 'P' command */
2406 if (uleft && uright && uamul && ublindf
2407 && uarm && uarmu && uarmc && uarmh && uarms && uarmg && uarmf) {
2408 /* 'P' message doesn't mention armor */
2410 Your("%s%s are full, and you're already wearing an amulet and %s.",
2411 humanoid(youmonst.data) ? "ring-" : "",
2412 makeplural(body_part(FINGER)),
2413 (ublindf->otyp == LENSES) ? "some lenses" : "a blindfold");
2415 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",
2416 humanoid(youmonst.data) ? "
\96ò" : "",
2418 ublindf->otyp==LENSES ? "
\83\8c\83\93\83Y" : "
\96Ú
\89B
\82µ");
2422 otmp = getobj(accessories, "put on");
2423 return otmp ? accessory_or_armor_on(otmp) : 0;
2426 /* calculate current armor class */
2430 int uac = mons[u.umonnum].ac; /* base armor class for current form */
2432 /* armor class from worn gear */
2434 uac -= ARM_BONUS(uarm);
2436 uac -= ARM_BONUS(uarmc);
2438 uac -= ARM_BONUS(uarmh);
2440 uac -= ARM_BONUS(uarmf);
2442 uac -= ARM_BONUS(uarms);
2444 uac -= ARM_BONUS(uarmg);
2446 uac -= ARM_BONUS(uarmu);
2447 if (uleft && uleft->otyp == RIN_PROTECTION)
2449 if (uright && uright->otyp == RIN_PROTECTION)
2452 /* armor class from other sources */
2453 if (HProtection & INTRINSIC)
2455 uac -= u.uspellprot;
2457 /* [The magic binary numbers 127 and -128 should be replaced with the
2458 * mystic decimal numbers 99 and -99 which require no explanation to
2459 * the uninitiated and would cap the width of a status line value at
2460 * one less character.]
2463 uac = -128; /* u.uac is an schar */
2465 uac = 127; /* for completeness */
2476 register struct obj *otmp;
2478 boolean leftfall, rightfall, wastwoweap = FALSE;
2479 const char *otherwep = 0, *thiswep, *which, *hand;
2481 leftfall = (uleft && !uleft->cursed
2482 && (!uwep || !welded(uwep) || !bimanual(uwep)));
2483 rightfall = (uright && !uright->cursed && (!welded(uwep)));
2484 if (!uarmg && (leftfall || rightfall) && !nolimbs(youmonst.data)) {
2485 /* changed so cursed rings don't fall off, GAN 10/30/86 */
2487 Your("%s off your %s.",
2488 (leftfall && rightfall) ? "rings slip" : "ring slips",
2489 (leftfall && rightfall) ? makeplural(body_part(FINGER))
2490 : body_part(FINGER));
2492 Your("
\8ew
\97Ö
\82Í%s
\82©
\82ç
\8a\8a\82è
\97\8e\82¿
\82½
\81D", body_part(FINGER));
2508 if (u.twoweap && otmp) {
2509 /* secondary weapon doesn't need nearly as much handling as
2510 primary; when in two-weapon mode, we know it's one-handed
2511 with something else in the other hand and also that it's
2512 a weapon or weptool rather than something unusual, plus
2513 we don't need to compare its type with the primary */
2514 otherwep = is_sword(otmp) ? c_sword : weapon_descr(otmp);
2515 if (otmp->quan > 1L)
2516 otherwep = makeplural(otherwep);
2517 hand = body_part(HAND);
2520 Your("%s %s%s from your %s%s.", otherwep, xfl ? "also " : "",
2521 otense(otmp, "slip"), which, hand);
2523 You("%s%s%s
\82©
\82ç
\8a\8a\82è
\97\8e\82Æ
\82µ
\82½
\81D", otherwep, xfl ? "
\82à
\82Ü
\82½" : "
\82ð",
2528 setuswapwep((struct obj *) 0); /* clears u.twoweap */
2529 if (canletgo(otmp, ""))
2533 if (otmp && !welded(otmp)) {
2534 long savequan = otmp->quan;
2536 /* nice wording if both weapons are the same type */
2537 thiswep = is_sword(otmp) ? c_sword : weapon_descr(otmp);
2538 if (otherwep && strcmp(thiswep, makesingular(otherwep)))
2540 if (otmp->quan > 1L) {
2541 /* most class names for unconventional wielded items
2542 are ok, but if wielding multiple apples or rations
2543 we don't want "your foods slip", so force non-corpse
2544 food to be singular; skipping makeplural() isn't
2545 enough--we need to fool otense() too */
2546 if (!strcmp(thiswep, "food"))
2549 thiswep = makeplural(thiswep);
2551 hand = body_part(HAND);
2554 hand = makeplural(hand);
2555 else if (wastwoweap)
2556 which = "right "; /* preceding msg was about left */
2558 pline("%s %s%s %s%s from your %s%s.",
2559 !strncmp(thiswep, "corpse", 6) ? "The" : "Your",
2560 otherwep ? "other " : "", thiswep, xfl ? "also " : "",
2561 otense(otmp, "slip"), which, hand);
2563 You("%s%s%s%s
\82©
\82ç
\8a\8a\82è
\97\8e\82Æ
\82µ
\82½
\81D",
2564 otherwep ? "
\82à
\82¤
\82Ð
\82Æ
\82Â
\82Ì" : "", thiswep,
2565 xfl ? "
\82à
\82Ü
\82½" : "
\82ð",
2569 otmp->quan = savequan;
2570 setuwep((struct obj *) 0);
2571 if (canletgo(otmp, ""))
2578 struct monst *victim;
2580 register struct obj *otmph, *otmp;
2582 otmph = (victim == &youmonst) ? uarmc : which_armor(victim, W_ARMC);
2584 otmph = (victim == &youmonst) ? uarm : which_armor(victim, W_ARM);
2586 otmph = (victim == &youmonst) ? uarmu : which_armor(victim, W_ARMU);
2588 otmp = (victim == &youmonst) ? uarmh : which_armor(victim, W_ARMH);
2589 if (otmp && (!otmph || !rn2(4)))
2591 otmp = (victim == &youmonst) ? uarmg : which_armor(victim, W_ARMG);
2592 if (otmp && (!otmph || !rn2(4)))
2594 otmp = (victim == &youmonst) ? uarmf : which_armor(victim, W_ARMF);
2595 if (otmp && (!otmph || !rn2(4)))
2597 otmp = (victim == &youmonst) ? uarms : which_armor(victim, W_ARMS);
2598 if (otmp && (!otmph || !rn2(4)))
2603 /* used for praying to check and fix levitation trouble */
2605 stuck_ring(ring, otyp)
2609 if (ring != uleft && ring != uright) {
2610 impossible("stuck_ring: neither left nor right?");
2611 return (struct obj *) 0;
2614 if (ring && ring->otyp == otyp) {
2615 /* reasons ring can't be removed match those checked by select_off();
2616 limbless case has extra checks because ordinarily it's temporary */
2617 if (nolimbs(youmonst.data) && uamul
2618 && uamul->otyp == AMULET_OF_UNCHANGING && uamul->cursed)
2620 if (welded(uwep) && (ring == uright || bimanual(uwep)))
2622 if (uarmg && uarmg->cursed)
2627 /* either no ring or not right type or nothing prevents its removal */
2628 return (struct obj *) 0;
2631 /* also for praying; find worn item that confers "Unchanging" attribute */
2635 if (uamul && uamul->otyp == AMULET_OF_UNCHANGING)
2643 register struct obj *otmp;
2650 *buf = '\0'; /* lint suppression */
2652 /* special ring checks */
2653 if (otmp == uright || otmp == uleft) {
2654 if (nolimbs(youmonst.data)) {
2656 pline_The("ring is stuck.");
2658 pline("
\8ew
\97Ö
\82Í
\91Ì
\82É
\96\84\82Ü
\82Á
\82Ä
\82µ
\82Ü
\82Á
\82Ä
\82¢
\82é
\81D");
2662 why = 0; /* the item which prevents ring removal */
2663 if (welded(uwep) && (otmp == uright || bimanual(uwep))) {
2665 Sprintf(buf, "free a weapon %s", body_part(HAND));
2667 Sprintf(buf, "
\97\98\98r
\82Ì
\8e©
\97R
\82ª
\82«
\82©
\82È
\82¢");
2669 } else if (uarmg && uarmg->cursed) {
2671 Sprintf(buf, "take off your %s", c_gloves);
2673 Sprintf(buf, "%s
\82ª
\92E
\82°
\82È
\82¢", c_gloves);
2678 You("cannot %s to remove the ring.", buf);
2680 You("
\8ew
\97Ö
\82ð
\82Í
\82¸
\82»
\82¤
\82Æ
\82µ
\82½
\82ª%s
\81D", buf);
2685 /* special glove checks */
2686 if (otmp == uarmg) {
2689 You("are unable to take off your %s while wielding that %s.",
2690 c_gloves, is_sword(uwep) ? c_sword : c_weapon);
2692 You("%s
\82ð
\8e\9d\82Á
\82½
\82Ü
\82Ü%s
\82ð
\82Í
\82¸
\82·
\82±
\82Æ
\82Í
\82Å
\82«
\82È
\82¢
\81D",
2693 is_sword(uwep) ? c_sword : c_weapon, c_gloves);
2695 uwep->bknown = TRUE;
2699 You_cant("take off the slippery %s with your slippery %s.",
2700 c_gloves, makeplural(body_part(FINGER)));
2702 You_cant("
\8a\8a\82è
\82â
\82·
\82¢%s
\82ð
\8a\8a\82è
\82â
\82·
\82¢%s
\82Å
\82Í
\82¸
\82¹
\82È
\82¢
\81D",
2703 c_gloves, body_part(FINGER));
2708 /* special boot checks */
2709 if (otmp == uarmf) {
2710 if (u.utrap && u.utraptype == TT_BEARTRAP) {
2712 pline_The("bear trap prevents you from pulling your %s out.",
2714 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",
2717 } else if (u.utrap && u.utraptype == TT_INFLOOR) {
2719 You("are stuck in the %s, and cannot pull your %s out.",
2721 You("%s
\82ª%s
\82É
\82Í
\82Ü
\82Á
\82Ä
\82¢
\82é
\82Ì
\82Å
\92E
\82®
\82±
\82Æ
\82ª
\82Å
\82«
\82È
\82¢
\81D",
2722 surface(u.ux, u.uy), makeplural(body_part(FOOT)));
2726 /* special suit and shirt checks */
2727 if (otmp == uarm || otmp == uarmu) {
2728 why = 0; /* the item which prevents disrobing */
2729 if (uarmc && uarmc->cursed) {
2731 Sprintf(buf, "remove your %s", cloak_simple_name(uarmc));
2733 Sprintf(buf, "%s
\82ª
\92E
\82°
\82È
\82¢", cloak_simple_name(uarmc));
2735 } else if (otmp == uarmu && uarm && uarm->cursed) {
2737 Sprintf(buf, "remove your %s", c_suit);
2739 Sprintf(buf, "%s
\82ª
\92E
\82°
\82È
\82¢", c_suit);
2741 } else if (welded(uwep) && bimanual(uwep)) {
2743 Sprintf(buf, "release your %s",
2744 is_sword(uwep) ? c_sword : (uwep->otyp == BATTLE_AXE)
2748 Sprintf(buf, "%s
\82ª
\8eè
\95ú
\82¹
\82È
\82¢",
2749 is_sword(uwep) ? c_sword : (uwep->otyp == BATTLE_AXE)
2757 You("cannot %s to take off %s.", buf, the(xname(otmp)));
2759 You("%s
\82ð
\82Í
\82¸
\82»
\82¤
\82Æ
\82µ
\82½
\82ª%s
\81D", xname(otmp), buf);
2764 /* basic curse check */
2765 if (otmp == uquiver || (otmp == uswapwep && !u.twoweap)) {
2766 ; /* some items can be removed even when cursed */
2768 /* otherwise, this is fundamental */
2774 context.takeoff.mask |= WORN_ARMOR;
2775 else if (otmp == uarmc)
2776 context.takeoff.mask |= WORN_CLOAK;
2777 else if (otmp == uarmf)
2778 context.takeoff.mask |= WORN_BOOTS;
2779 else if (otmp == uarmg)
2780 context.takeoff.mask |= WORN_GLOVES;
2781 else if (otmp == uarmh)
2782 context.takeoff.mask |= WORN_HELMET;
2783 else if (otmp == uarms)
2784 context.takeoff.mask |= WORN_SHIELD;
2785 else if (otmp == uarmu)
2786 context.takeoff.mask |= WORN_SHIRT;
2787 else if (otmp == uleft)
2788 context.takeoff.mask |= LEFT_RING;
2789 else if (otmp == uright)
2790 context.takeoff.mask |= RIGHT_RING;
2791 else if (otmp == uamul)
2792 context.takeoff.mask |= WORN_AMUL;
2793 else if (otmp == ublindf)
2794 context.takeoff.mask |= WORN_BLINDF;
2795 else if (otmp == uwep)
2796 context.takeoff.mask |= W_WEP;
2797 else if (otmp == uswapwep)
2798 context.takeoff.mask |= W_SWAPWEP;
2799 else if (otmp == uquiver)
2800 context.takeoff.mask |= W_QUIVER;
2803 impossible("select_off: %s???", doname(otmp));
2808 STATIC_OVL struct obj *
2811 struct obj *otmp = (struct obj *) 0;
2812 struct takeoff_info *doff = &context.takeoff;
2814 context.takeoff.mask |= I_SPECIAL; /* set flag for cancel_doff() */
2815 if (doff->what == W_WEP) {
2816 if (!cursed(uwep)) {
2817 setuwep((struct obj *) 0);
2819 You("are empty %s.", body_part(HANDED));
2821 You("
\89½
\82à%s
\82É
\82µ
\82Ä
\82¢
\82È
\82¢
\81D", body_part(HAND));
2824 } else if (doff->what == W_SWAPWEP) {
2825 setuswapwep((struct obj *) 0);
2827 You("no longer have a second weapon readied.");
2829 You("
\97\
\94õ
\82Ì
\95\90\8aí
\82ð
\82¨
\82³
\82ß
\82½
\81D");
2831 } else if (doff->what == W_QUIVER) {
2832 setuqwep((struct obj *) 0);
2834 You("no longer have ammunition readied.");
2836 You("
\8f\80\94õ
\82µ
\82½
\96î
\92e
\82ð
\82¨
\82³
\82ß
\82½
\81D");
2837 } else if (doff->what == WORN_ARMOR) {
2841 } else if (doff->what == WORN_CLOAK) {
2845 } else if (doff->what == WORN_BOOTS) {
2849 } else if (doff->what == WORN_GLOVES) {
2852 (void) Gloves_off();
2853 } else if (doff->what == WORN_HELMET) {
2856 (void) Helmet_off();
2857 } else if (doff->what == WORN_SHIELD) {
2860 (void) Shield_off();
2861 } else if (doff->what == WORN_SHIRT) {
2865 } else if (doff->what == WORN_AMUL) {
2869 } else if (doff->what == LEFT_RING) {
2873 } else if (doff->what == RIGHT_RING) {
2877 } else if (doff->what == WORN_BLINDF) {
2878 if (!cursed(ublindf))
2879 Blindf_off(ublindf);
2881 impossible("do_takeoff: taking off %lx", doff->what);
2883 context.takeoff.mask &= ~I_SPECIAL; /* clear cancel_doff() flag */
2888 /* occupation callback for 'A' */
2894 register struct obj *otmp;
2895 struct takeoff_info *doff = &context.takeoff;
2898 if (doff->delay > 0) {
2900 return 1; /* still busy */
2902 if ((otmp = do_takeoff()) != 0)
2904 doff->mask &= ~doff->what;
2908 for (i = 0; takeoff_order[i]; i++)
2909 if (doff->mask & takeoff_order[i]) {
2910 doff->what = takeoff_order[i];
2914 otmp = (struct obj *) 0;
2917 if (doff->what == 0L) {
2919 You("finish %s.", doff->disrobing);
2921 You("
\91\95\94õ
\82ð
\89ð
\82«
\82¨
\82¦
\82½
\81D");
2923 } else if (doff->what == W_WEP) {
2925 } else if (doff->what == W_SWAPWEP) {
2927 } else if (doff->what == W_QUIVER) {
2929 } else if (doff->what == WORN_ARMOR) {
2931 /* If a cloak is being worn, add the time to take it off and put
2932 * it back on again. Kludge alert! since that time is 0 for all
2933 * known cloaks, add 1 so that it actually matters...
2936 doff->delay += 2 * objects[uarmc->otyp].oc_delay + 1;
2937 } else if (doff->what == WORN_CLOAK) {
2939 } else if (doff->what == WORN_BOOTS) {
2941 } else if (doff->what == WORN_GLOVES) {
2943 } else if (doff->what == WORN_HELMET) {
2945 } else if (doff->what == WORN_SHIELD) {
2947 } else if (doff->what == WORN_SHIRT) {
2949 /* add the time to take off and put back on armor and/or cloak */
2951 doff->delay += 2 * objects[uarm->otyp].oc_delay;
2953 doff->delay += 2 * objects[uarmc->otyp].oc_delay + 1;
2954 } else if (doff->what == WORN_AMUL) {
2956 } else if (doff->what == LEFT_RING) {
2958 } else if (doff->what == RIGHT_RING) {
2960 } else if (doff->what == WORN_BLINDF) {
2961 /* [this used to be 2, but 'R' (and 'T') only require 1 turn to
2962 remove a blindfold, so 'A' shouldn't have been requiring 2] */
2965 impossible("take_off: taking off %lx", doff->what);
2966 return 0; /* force done */
2970 doff->delay += objects[otmp->otyp].oc_delay;
2972 /* Since setting the occupation now starts the counter next move, that
2973 * would always produce a delay 1 too big per item unless we subtract
2974 * 1 here to account for it.
2976 if (doff->delay > 0)
2979 set_occupation(take_off, doff->disrobing, 0);
2980 return 1; /* get busy */
2983 /* clear saved context to avoid inappropriate resumption of interrupted 'A' */
2987 context.takeoff.what = context.takeoff.mask = 0L;
2988 context.takeoff.disrobing[0] = '\0';
2991 /* the 'A' command -- remove multiple worn items */
2997 if (context.takeoff.what || context.takeoff.mask) {
2999 You("continue %s.", context.takeoff.disrobing);
3001 You("
\91\95\94õ
\82ð
\89ð
\82
\82Ì
\82ð
\8dÄ
\8aJ
\82µ
\82½
\81D");
3003 set_occupation(take_off, context.takeoff.disrobing, 0);
3005 set_occupation(take_off, "
\91\95\94õ
\82ð
\89ð
\82", 0);
3007 } else if (!uwep && !uswapwep && !uquiver && !uamul && !ublindf && !uleft
3008 && !uright && !wearing_armor()) {
3010 You("are not wearing anything.");
3012 You("
\89½
\82à
\91\95\94õ
\82µ
\82Ä
\82¢
\82È
\82¢
\81D");
3016 add_valid_menu_class(0); /* reset */
3017 if (flags.menu_style != MENU_TRADITIONAL
3018 || (result = ggetobj("take off", select_off, 0, FALSE,
3019 (unsigned *) 0)) < -1)
3020 result = menu_remarm(result);
3022 if (context.takeoff.mask) {
3023 #if 0 /*JP*//*
\93ú
\96{
\8cê
\82Å
\82Í
\8eg
\82í
\82È
\82¢*/
3024 /* default activity for armor and/or accessories,
3025 possibly combined with weapons */
3026 (void) strncpy(context.takeoff.disrobing, "disrobing", CONTEXTVERBSZ);
3027 /* specific activity when handling weapons only */
3028 if (!(context.takeoff.mask & ~W_WEAPON))
3029 (void) strncpy(context.takeoff.disrobing, "disarming",
3034 /* The time to perform the command is already completely accounted for
3035 * in take_off(); if we return 1, that would add an extra turn to each
3046 menu_item *pick_list;
3047 boolean all_worn_categories = TRUE;
3050 all_worn_categories = (retry == -2);
3051 } else if (flags.menu_style == MENU_FULL) {
3052 all_worn_categories = FALSE;
3054 n = query_category("What type of things do you want to take off?",
3056 n = query_category("
\82Ç
\82Ì
\83^
\83C
\83v
\82Ì
\95¨
\82Ì
\91\95\94õ
\82ð
\89ð
\82«
\82Ü
\82·
\82©
\81H",
3057 invent, (WORN_TYPES | ALL_TYPES
3058 | UNPAID_TYPES | BUCX_TYPES),
3059 &pick_list, PICK_ANY);
3062 for (i = 0; i < n; i++) {
3063 if (pick_list[i].item.a_int == ALL_TYPES_SELECTED)
3064 all_worn_categories = TRUE;
3066 add_valid_menu_class(pick_list[i].item.a_int);
3068 free((genericptr_t) pick_list);
3069 } else if (flags.menu_style == MENU_COMBINATION) {
3070 unsigned ggofeedback = 0;
3072 i = ggetobj("take off", select_off, 0, TRUE, &ggofeedback);
3073 if (ggofeedback & ALL_FINISHED)
3075 all_worn_categories = (i == -2);
3077 if (menu_class_present('u')
3078 || menu_class_present('B') || menu_class_present('U')
3079 || menu_class_present('C') || menu_class_present('X'))
3080 all_worn_categories = FALSE;
3083 n = query_objlist("What do you want to take off?", &invent,
3084 (SIGNAL_NOMENU | USE_INVLET | INVORDER_SORT),
3085 &pick_list, PICK_ANY,
3086 all_worn_categories ? is_worn : is_worn_by_type);
3088 n = query_objlist("
\82Ç
\82Ì
\91\95\94õ
\82ð
\89ð
\82«
\82Ü
\82·
\82©
\81H", &invent,
3089 (SIGNAL_NOMENU | USE_INVLET | INVORDER_SORT),
3090 &pick_list, PICK_ANY,
3091 all_worn_categories ? is_worn : is_worn_by_type);
3094 for (i = 0; i < n; i++)
3095 (void) select_off(pick_list[i].item.a_obj);
3096 free((genericptr_t) pick_list);
3097 } else if (n < 0 && flags.menu_style != MENU_COMBINATION) {
3099 There("is nothing else you can remove or unwield.");
3101 pline("
\91\95\94õ
\82ð
\89ð
\82¯
\82é
\82à
\82Ì
\82Í
\89½
\82à
\82È
\82¢
\81D");
3106 /* hit by destroy armor scroll/black dragon breath/monster spell */
3109 register struct obj *atmp;
3111 register struct obj *otmp;
3112 #define DESTROY_ARM(o) \
3113 ((otmp = (o)) != 0 && (!atmp || atmp == otmp) \
3114 && (!obj_resists(otmp, 0, 90)) \
3115 ? (otmp->in_use = TRUE) \
3118 if (DESTROY_ARM(uarmc)) {
3122 Your("%s crumbles and turns to dust!", cloak_simple_name(uarmc));
3124 Your("%s
\82Í
\95²
\81X
\82É
\82È
\82Á
\82½
\81I", cloak_simple_name(uarmc));
3127 } else if (DESTROY_ARM(uarm)) {
3131 Your("armor turns to dust and falls to the %s!", surface(u.ux, u.uy));
3133 Your("
\8aZ
\82Í
\90o
\82Æ
\82È
\82è%s
\82É
\97\8e\82¿
\82½
\81I", surface(u.ux,u.uy));
3134 (void) Armor_gone();
3136 } else if (DESTROY_ARM(uarmu)) {
3140 Your("shirt crumbles into tiny threads and falls apart!");
3142 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");
3145 } else if (DESTROY_ARM(uarmh)) {
3149 Your("%s turns to dust and is blown away!", helm_simple_name(uarmh));
3151 Your("%s
\82Í
\90o
\82Æ
\82È
\82è
\90\81\82«
\82Æ
\82ñ
\82¾
\81I", helm_simple_name(uarmh));
3152 (void) Helmet_off();
3154 } else if (DESTROY_ARM(uarmg)) {
3158 Your("gloves vanish!");
3160 Your("
\8f¬
\8eè
\82Í
\8fÁ
\82¦
\82½
\81I");
3161 (void) Gloves_off();
3166 selftouch("
\82»
\82Ì
\82Æ
\82«
\82 \82È
\82½
\82Í");
3167 } else if (DESTROY_ARM(uarmf)) {
3171 Your("boots disintegrate!");
3173 Your("
\8cC
\82Í
\95²
\81X
\82É
\8dÓ
\82¯
\82½
\81I");
3176 } else if (DESTROY_ARM(uarms)) {
3180 Your("shield crumbles away!");
3182 Your("
\8f\82\82Í
\8dÓ
\82¯
\8eU
\82Á
\82½
\81I");
3183 (void) Shield_off();
3186 return 0; /* could not destroy anything */
3195 adj_abon(otmp, delta)
3196 register struct obj *otmp;
3197 register schar delta;
3199 if (uarmg && uarmg == otmp && otmp->otyp == GAUNTLETS_OF_DEXTERITY) {
3201 makeknown(uarmg->otyp);
3202 ABON(A_DEX) += (delta);
3206 if (uarmh && uarmh == otmp && otmp->otyp == HELM_OF_BRILLIANCE) {
3208 makeknown(uarmh->otyp);
3209 ABON(A_INT) += (delta);
3210 ABON(A_WIS) += (delta);
3216 /* decide whether a worn item is covered up by some other worn item,
3217 used for dipping into liquid and applying grease;
3218 some criteria are different than select_off()'s */
3220 inaccessible_equipment(obj, verb, only_if_known_cursed)
3222 const char *verb; /* "dip" or "grease", or null to avoid messages */
3223 /*JP:
\93ú
\96{
\8cê
\82Å
\82Í "
\82ð
\90Z
\82·", "
\82É
\8e\89\82ð
\93h
\82é", null
\82Ì
\82¢
\82¸
\82ê
\82©*/
3224 boolean only_if_known_cursed; /* ignore covering unless known to be cursed */
3227 static NEARDATA const char need_to_take_off_outer_armor[] =
3228 "need to take off %s to %s %s.";
3229 #else /*JP:
\88ø
\90\94\82ª
\8c´
\95¶
\82Æ
\95Ï
\82í
\82Á
\82Ä
\82¢
\82é
\82±
\82Æ
\82É
\92\8d\88Ó*/
3230 static NEARDATA const char need_to_take_off_outer_armor[] =
3231 "%s%s
\82É
\82Í%s
\82ð%s
\95K
\97v
\82ª
\82 \82é
\81D";
3234 boolean anycovering = !only_if_known_cursed; /* more comprehensible... */
3235 #define BLOCKSACCESS(x) (anycovering || ((x)->cursed && (x)->bknown))
3237 if (!obj || !obj->owornmask)
3238 return FALSE; /* not inaccessible */
3240 /* check for suit covered by cloak */
3241 if (obj == uarm && uarmc && BLOCKSACCESS(uarmc)) {
3243 Strcpy(buf, yname(uarmc));
3245 You(need_to_take_off_outer_armor, buf, verb, yname(obj));
3246 #else /*JP:
\91Î
\8fÛ
\82Í
\83N
\83\8d\81[
\83N
\82È
\82Ì
\82Åjoffmsg
\82ð
\8eg
\82í
\82¸
\8c\88\82ß
\8c\82\82¿*/
3247 You(need_to_take_off_outer_armor, xname(obj), verb, buf, "
\92E
\82®");
3252 /* check for shirt covered by suit and/or cloak */
3254 && ((uarm && BLOCKSACCESS(uarm)) || (uarmc && BLOCKSACCESS(uarmc)))) {
3256 char cloaktmp[QBUFSZ], suittmp[QBUFSZ];
3257 /* if sameprefix, use yname and xname to get "your cloak and suit"
3258 or "Manlobbi's cloak and suit"; otherwise, use yname and yname
3259 to get "your cloak and Manlobbi's suit" or vice versa */
3260 boolean sameprefix = (uarm && uarmc
3261 && !strcmp(shk_your(cloaktmp, uarmc),
3262 shk_your(suittmp, uarm)));
3266 Strcat(buf, yname(uarmc));
3269 Strcat(buf, " and ");
3271 Strcat(buf, "
\82Æ");
3273 Strcat(buf, sameprefix ? xname(uarm) : yname(uarm));
3275 You(need_to_take_off_outer_armor, buf, verb, yname(obj));
3276 #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¿*/
3277 You(need_to_take_off_outer_armor, xname(obj), verb, buf, "
\92E
\82®");
3282 /* check for ring covered by gloves */
3283 if ((obj == uleft || obj == uright) && uarmg && BLOCKSACCESS(uarmg)) {
3285 Strcpy(buf, yname(uarmg));
3287 You(need_to_take_off_outer_armor, buf, verb, yname(obj));
3288 #else /*JP:
\91Î
\8fÛ
\82Í
\8f¬
\8eè
\82È
\82Ì
\82Åjoffmsg
\82ð
\8eg
\82í
\82¸
\8c\88\82ß
\8c\82\82¿*/
3289 You(need_to_take_off_outer_armor, xname(obj), verb, buf, "
\82Í
\82¸
\82·");
3294 /* item is not inaccessible */