| 197 | |
| 198 | /* make a (new) human out of the player */ |
| 199 | staticfn void |
| 200 | polyman(const char *fmt, const char *arg) |
| 201 | { |
| 202 | boolean sticking = (sticks(gy.youmonst.data) && u.ustuck && !u.uswallow), |
| 203 | was_mimicking = (U_AP_TYPE != M_AP_NOTHING); |
| 204 | boolean was_blind = !!Blind, |
| 205 | had_see_invis = !!See_invisible; |
| 206 | |
| 207 | if (Upolyd) { |
| 208 | u.acurr = u.macurr; /* restore old attribs */ |
| 209 | u.amax = u.mamax; |
| 210 | u.umonnum = u.umonster; |
| 211 | flags.female = u.mfemale; |
| 212 | } |
| 213 | set_uasmon(); |
| 214 | |
| 215 | u.mh = u.mhmax = 0; |
| 216 | u.mtimedone = 0; |
| 217 | skinback(FALSE); |
| 218 | u.uundetected = 0; |
| 219 | |
| 220 | if (sticking) |
| 221 | uunstick(); |
| 222 | find_ac(); |
| 223 | if (was_mimicking) { |
| 224 | if (gm.multi < 0) |
| 225 | unmul(""); |
| 226 | gy.youmonst.m_ap_type = M_AP_NOTHING; |
| 227 | gy.youmonst.mappearance = 0; |
| 228 | } |
| 229 | |
| 230 | newsym(u.ux, u.uy); |
| 231 | |
| 232 | urgent_pline(fmt, arg); |
| 233 | /* check whether player foolishly genocided self while poly'd */ |
| 234 | if (ugenocided()) { |
| 235 | /* intervening activity might have clobbered genocide info */ |
| 236 | struct kinfo *kptr = find_delayed_killer(POLYMORPH); |
| 237 | |
| 238 | if (kptr != (struct kinfo *) 0 && kptr->name[0]) { |
| 239 | svk.killer.format = kptr->format; |
| 240 | Strcpy(svk.killer.name, kptr->name); |
| 241 | } else { |
| 242 | svk.killer.format = KILLED_BY; |
| 243 | Strcpy(svk.killer.name, "self-genocide"); |
| 244 | } |
| 245 | dealloc_killer(kptr); |
| 246 | done(GENOCIDED); |
| 247 | } |
| 248 | |
| 249 | if (!!See_invisible ^ had_see_invis) |
| 250 | set_mimic_blocking(); /* See_invisible just toggled */ |
| 251 | |
| 252 | if (u.twoweap && !could_twoweap(gy.youmonst.data)) |
| 253 | untwoweapon(); |
| 254 | |
| 255 | if (u.utrap && u.utraptype == TT_PIT) { |
| 256 | set_utrap(rn1(6, 2), TT_PIT); /* time to escape resets */ |
no test coverage detected