hero lays an egg */
| 355 | |
| 356 | /* hero lays an egg */ |
| 357 | staticfn int |
| 358 | lay_an_egg(void) |
| 359 | { |
| 360 | struct obj *uegg; |
| 361 | |
| 362 | if (!flags.female) { |
| 363 | pline("%s can't lay eggs!", |
| 364 | Hallucination |
| 365 | ? "You may think you are a platypus, but a male still" |
| 366 | : "Males"); |
| 367 | return ECMD_OK; |
| 368 | } else if (u.uhunger < (int) objects[EGG].oc_nutrition) { |
| 369 | You("don't have enough energy to lay an egg."); |
| 370 | return ECMD_OK; |
| 371 | } else if (eggs_in_water(gy.youmonst.data)) { |
| 372 | if (!(Underwater || Is_waterlevel(&u.uz))) { |
| 373 | pline("A splash tetra you are not."); |
| 374 | return ECMD_OK; |
| 375 | } |
| 376 | if (Upolyd |
| 377 | && (gy.youmonst.data == &mons[PM_GIANT_EEL] |
| 378 | || gy.youmonst.data == &mons[PM_ELECTRIC_EEL])) { |
| 379 | You("yearn for the Sargasso Sea."); |
| 380 | return ECMD_OK; |
| 381 | } |
| 382 | } |
| 383 | uegg = mksobj(EGG, FALSE, FALSE); |
| 384 | uegg->spe = 1; |
| 385 | uegg->quan = 1L; |
| 386 | uegg->owt = weight(uegg); |
| 387 | /* this sets hatch timers if appropriate */ |
| 388 | set_corpsenm(uegg, egg_type_from_parent(u.umonnum, FALSE)); |
| 389 | uegg->known = 1; |
| 390 | observe_object(uegg); |
| 391 | You("%s an egg.", eggs_in_water(gy.youmonst.data) ? "spawn" : "lay"); |
| 392 | dropy(uegg); |
| 393 | stackobj(uegg); |
| 394 | morehungry((int) objects[EGG].oc_nutrition); |
| 395 | return ECMD_TIME; |
| 396 | } |
| 397 | |
| 398 | /* #sit command */ |
| 399 | int |
no test coverage detected