Return monster index of zombie monster which this monster could be turned into, or NON_PM if it doesn't have a direct counterpart. Sort of the zombie-specific inverse of undead_to_corpse. */
| 383 | be turned into, or NON_PM if it doesn't have a direct counterpart. |
| 384 | Sort of the zombie-specific inverse of undead_to_corpse. */ |
| 385 | int |
| 386 | zombie_form(struct permonst *pm) |
| 387 | { |
| 388 | switch (pm->mlet) { |
| 389 | case S_ZOMBIE: /* when already a zombie/ghoul/skeleton, will stay as is */ |
| 390 | return NON_PM; |
| 391 | case S_KOBOLD: |
| 392 | return PM_KOBOLD_ZOMBIE; |
| 393 | case S_ORC: |
| 394 | return PM_ORC_ZOMBIE; |
| 395 | case S_GIANT: |
| 396 | if (pm == &mons[PM_ETTIN]) |
| 397 | return PM_ETTIN_ZOMBIE; |
| 398 | return PM_GIANT_ZOMBIE; |
| 399 | case S_HUMAN: |
| 400 | case S_KOP: |
| 401 | if (is_elf(pm)) |
| 402 | return PM_ELF_ZOMBIE; |
| 403 | return PM_HUMAN_ZOMBIE; |
| 404 | case S_HUMANOID: |
| 405 | if (is_dwarf(pm)) |
| 406 | return PM_DWARF_ZOMBIE; |
| 407 | else |
| 408 | break; |
| 409 | case S_GNOME: |
| 410 | return PM_GNOME_ZOMBIE; |
| 411 | } |
| 412 | return NON_PM; |
| 413 | } |
| 414 | |
| 415 | /* convert the monster index of an undead to its living counterpart */ |
| 416 | int |
no outgoing calls
no test coverage detected