MCPcopy Index your code
hub / github.com/NetHack/NetHack / zombie_form

Function zombie_form

src/mon.c:385–413  ·  view source on GitHub ↗

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. */

Source from the content-addressed store, hash-verified

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. */
385int
386zombie_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 */
416int

Callers 6

zombify_monFunction · 0.85
readobjnamFunction · 0.85
mdamagemFunction · 0.85
mm_2way_aggressionFunction · 0.85
xkilledFunction · 0.85
start_corpse_timeoutFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected