| 1087 | } |
| 1088 | |
| 1089 | void |
| 1090 | Amulet_off(void) |
| 1091 | { |
| 1092 | struct obj *amul = uamul; /* for off_msg() after setworn(NULL,W_AMUL) */ |
| 1093 | boolean mkn = FALSE, early_off_msg = FALSE; |
| 1094 | |
| 1095 | svc.context.takeoff.mask &= ~W_AMUL; |
| 1096 | |
| 1097 | switch (uamul->otyp) { |
| 1098 | case AMULET_OF_ESP: |
| 1099 | /* need to update ability before calling see_monsters() */ |
| 1100 | setworn((struct obj *) 0, W_AMUL); |
| 1101 | off_msg(amul); |
| 1102 | early_off_msg = TRUE; |
| 1103 | |
| 1104 | see_monsters(); |
| 1105 | break; |
| 1106 | case AMULET_OF_LIFE_SAVING: |
| 1107 | case AMULET_VERSUS_POISON: |
| 1108 | case AMULET_OF_REFLECTION: |
| 1109 | case AMULET_OF_CHANGE: |
| 1110 | case AMULET_OF_UNCHANGING: |
| 1111 | case FAKE_AMULET_OF_YENDOR: |
| 1112 | break; |
| 1113 | case AMULET_OF_MAGICAL_BREATHING: |
| 1114 | /* amulet is currently still on; take it off before calling drown() |
| 1115 | and region_danger(); call off_msg() before specific messages */ |
| 1116 | setworn((struct obj *) 0, W_AMUL); |
| 1117 | off_msg(amul); /* 'uamul' has been set to Null */ |
| 1118 | early_off_msg = TRUE; |
| 1119 | |
| 1120 | if (Underwater) { |
| 1121 | if (!cant_drown(gy.youmonst.data) && !Swimming) { |
| 1122 | You("suddenly inhale an unhealthy amount of %s!", |
| 1123 | hliquid("water")); |
| 1124 | mkn = TRUE; /* in case of life-saving */ |
| 1125 | (void) drown(); |
| 1126 | } |
| 1127 | } |
| 1128 | if (region_danger()) { |
| 1129 | /* "breathing": wouldn't get here otherwise */ |
| 1130 | You("are breathing poison gas!"); |
| 1131 | mkn = TRUE; |
| 1132 | } |
| 1133 | break; |
| 1134 | case AMULET_OF_STRANGULATION: |
| 1135 | setworn((struct obj *) 0, W_AMUL); |
| 1136 | off_msg(amul); |
| 1137 | early_off_msg = TRUE; |
| 1138 | |
| 1139 | if (Strangled) { |
| 1140 | Strangled = 0L; |
| 1141 | disp.botl = TRUE; |
| 1142 | if (Breathless) |
| 1143 | Your("%s is no longer constricted!", body_part(NECK)); |
| 1144 | else |
| 1145 | You("can breathe more easily!"); |
| 1146 | mkn = TRUE; |
no test coverage detected