MCPcopy Create free account
hub / github.com/NetHack/NetHack / cant_revive

Function cant_revive

src/read.c:3111–3134  ·  view source on GitHub ↗

some creatures have special data structures that only make sense in their * normal locations -- if the player tries to create one elsewhere, or to * revive one, the disoriented creature becomes a zombie */

Source from the content-addressed store, hash-verified

3109 * revive one, the disoriented creature becomes a zombie
3110 */
3111boolean
3112cant_revive(
3113 int *mtype,
3114 boolean revival,
3115 struct obj *from_obj)
3116{
3117 /* SHOPKEEPERS can be revived now */
3118 if (*mtype == PM_GUARD || (*mtype == PM_SHOPKEEPER && !revival)
3119 || *mtype == PM_HIGH_CLERIC || *mtype == PM_ALIGNED_CLERIC
3120 || *mtype == PM_ANGEL) {
3121 *mtype = PM_HUMAN_ZOMBIE;
3122 return TRUE;
3123 } else if (*mtype == PM_LONG_WORM_TAIL) { /* for create_particular() */
3124 *mtype = PM_LONG_WORM;
3125 return TRUE;
3126 } else if (unique_corpstat(&mons[*mtype])
3127 && (!from_obj || !has_omonst(from_obj))) {
3128 /* unique corpses (from bones or wizard mode wish) or
3129 statues (bones or any wish) end up as shapechangers */
3130 *mtype = PM_DOPPELGANGER;
3131 return TRUE;
3132 }
3133 return FALSE;
3134}
3135
3136staticfn boolean
3137create_particular_parse(

Callers 4

resetobjsFunction · 0.85
animate_statueFunction · 0.85
reviveFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected