for changing into form that's immune to strangulation */
| 165 | |
| 166 | /* for changing into form that's immune to strangulation */ |
| 167 | staticfn void |
| 168 | check_strangling(boolean on) |
| 169 | { |
| 170 | /* on -- maybe resume strangling */ |
| 171 | if (on) { |
| 172 | boolean was_strangled = (Strangled != 0L); |
| 173 | |
| 174 | /* when Strangled is already set, polymorphing from one |
| 175 | vulnerable form into another causes the counter to be reset */ |
| 176 | if (uamul && uamul->otyp == AMULET_OF_STRANGULATION |
| 177 | && can_be_strangled(&gy.youmonst)) { |
| 178 | Strangled = 6L; |
| 179 | disp.botl = TRUE; |
| 180 | Your("%s %s your %s!", simpleonames(uamul), |
| 181 | was_strangled ? "still constricts" : "begins constricting", |
| 182 | body_part(NECK)); /* "throat" */ |
| 183 | makeknown(AMULET_OF_STRANGULATION); |
| 184 | } |
| 185 | |
| 186 | /* off -- maybe block strangling */ |
| 187 | } else { |
| 188 | if (Strangled && !can_be_strangled(&gy.youmonst)) { |
| 189 | Strangled = 0L; |
| 190 | disp.botl = TRUE; |
| 191 | You("are no longer being strangled."); |
| 192 | } |
| 193 | } |
| 194 | } |
| 195 | |
| 196 | DISABLE_WARNING_FORMAT_NONLITERAL |
| 197 |
no test coverage detected