return to original form, usually either due to polymorph timing out or dying from loss of hit points while being polymorphed */
| 1364 | /* return to original form, usually either due to polymorph timing out |
| 1365 | or dying from loss of hit points while being polymorphed */ |
| 1366 | void |
| 1367 | rehumanize(void) |
| 1368 | { |
| 1369 | boolean was_flying = (Flying != 0); |
| 1370 | |
| 1371 | /* You can't revert back while unchanging */ |
| 1372 | if (Unchanging) { |
| 1373 | if (u.mh < 1) { |
| 1374 | svk.killer.format = NO_KILLER_PREFIX; |
| 1375 | Strcpy(svk.killer.name, "killed while stuck in creature form"); |
| 1376 | done(DIED); |
| 1377 | /* can get to here if declining to die in explore or wizard |
| 1378 | mode; since we're wearing an amulet of unchanging we can't |
| 1379 | be wearing an amulet of life-saving */ |
| 1380 | return; /* don't rehumanize after all */ |
| 1381 | } else if (uamul && uamul->otyp == AMULET_OF_UNCHANGING) { |
| 1382 | Your("%s %s!", simpleonames(uamul), otense(uamul, "fail")); |
| 1383 | observe_object(uamul); |
| 1384 | makeknown(AMULET_OF_UNCHANGING); |
| 1385 | } |
| 1386 | } |
| 1387 | |
| 1388 | /* |
| 1389 | * Right now, dying while being a shifted vampire (bat, cloud, wolf) |
| 1390 | * reverts to human rather than to vampire. |
| 1391 | */ |
| 1392 | |
| 1393 | if (emits_light(gy.youmonst.data)) |
| 1394 | del_light_source(LS_MONSTER, monst_to_any(&gy.youmonst)); |
| 1395 | polyman("You return to %s form!", gu.urace.adj); |
| 1396 | |
| 1397 | if (u.uhp < 1) { |
| 1398 | /* can only happen if some bit of code reduces u.uhp |
| 1399 | instead of u.mh while poly'd */ |
| 1400 | Your("old form was not healthy enough to survive."); |
| 1401 | Sprintf(svk.killer.name, "reverting to unhealthy %s form", |
| 1402 | gu.urace.adj); |
| 1403 | svk.killer.format = KILLED_BY; |
| 1404 | done(DIED); |
| 1405 | } |
| 1406 | nomul(0); |
| 1407 | |
| 1408 | disp.botl = TRUE; |
| 1409 | gv.vision_full_recalc = 1; |
| 1410 | encumber_msg(); |
| 1411 | update_inventory(); |
| 1412 | if (was_flying && !Flying && u.usteed) |
| 1413 | You("and %s return gently to the %s.", |
| 1414 | mon_nam(u.usteed), surface(u.ux, u.uy)); |
| 1415 | retouch_equipment(2); |
| 1416 | if (!uarmg) |
| 1417 | selftouch(no_longer_petrify_resistant); |
| 1418 | } |
| 1419 | |
| 1420 | int |
| 1421 | dobreathe(void) |
no test coverage detected